Go Back   EQEmulator Home > EQEmulator Forums > Support > Spell Support

Spell Support Broken Spells? Want them Fixed? Request it here.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-26-2012, 07:11 PM
Hateborne
Hill Giant
 
Join Date: May 2010
Posts: 125
Exclamation SpellVulnerability Inconsistency?

Sorry to bother everyone again, but I am noticing something off with SpellVulnerability (in my limited experiences).

SpellVulnerability is being treated as a buff when attached to song. A buff in the sense that it is REDUCING damage taken. I do not have the exact numbers on hand at the moment. When attached to a bard spell, SpellVulnerability with base_value of 10 reduces damage by 10%. I thought I would get clever and do -10...it seemed to still reduce it by 10%.

When using SpellVulnerability on a spell, it seems to have a cap of sorts when using positive base_values. 10/25/50 seemed to all do the same thing. However, -10/-25/-50 caused VERY erratic numbers. I do remember -10 and -50 being higher than -25. All of the negative numbers caused a substantial damage increase.

Can anyone point out where I might look to trace the path of SpellVulnerability? I cannot find anything other than:
Code:
Spdat.h
#define SE_SpellVulnerability			296	// implemented - increase in incoming spell damage


spell_effects.cpp
		case SE_SpellVulnerability:
		{
			if(type == focusSpellVulnerability)
			{
				value = 1;
			}
			break;
		}

mob.h
typedef enum {	//focus types
	focusSpellHaste = 1,
	focusSpellDuration,
	focusRange,
	focusReagentCost,
	focusManaCost,
	focusImprovedHeal,
	focusImprovedDamage,
	focusImprovedDOT,		//i dont know about this...
	focusImprovedCritical,
	focusImprovedUndeadDamage,
	focusPetPower,
	focusResistRate,
	focusSpellHateMod,
	focusTriggerOnCast,
	focusSpellVulnerability,
	focusTwincast,
	focusSympatheticProc,
	focusSpellDamage,
	focusSpellDurByTic,
	focusSwarmPetDuration,
	focusReduceRecastTime,
	focusBlockNextSpell,
} focusType;
And from mob.cpp:
Code:
sint32 Mob::GetVulnerability(sint32 damage, Mob *caster, uint32 spell_id, int32 ticsremaining)
{
	// If we increased the datatype on GetBuffSlotFromType, this wouldnt be needed
	uint32 buff_count = GetMaxTotalSlots();
	for(int i = 0; i < buff_count; i++) 
	{
		if(IsEffectInSpell(buffs[i].spellid, SE_SpellVulnerability))
		{
			// For Clients, Pets and Bots that are casting the spell, see if the vulnerability affects their spell.
			if(!caster->IsNPC())
			{
				sint32 focus = caster->CalcFocusEffect(focusSpellVulnerability, buffs[i].spellid, spell_id);
				if(focus == 1)
				{
					damage += damage * spells[buffs[i].spellid].base[0] / 100;
					break;
				}
			}
			// If an NPC is casting the spell on a player that has a vulnerability, relaxed restrictions on focus 
			// so that either the Client is vulnerable to DoTs or DDs of various resists or all.
			else if (caster->IsNPC())
			{
				int npc_resist = 0;
				int npc_instant = 0;
				int npc_duration = 0;
				for(int j = 0; j < EFFECT_COUNT; j++)
				{
					switch (spells[buffs[i].spellid].effectid[j]) 
					{
					
					case SE_Blank:
						break;

					case SE_LimitResist:
						if(spells[buffs[i].spellid].base[j])
						{
							if(spells[spell_id].resisttype == spells[buffs[i].spellid].base[j])
								npc_resist = 1;
						}
						break;

					case SE_LimitInstant:
						if(!ticsremaining) 
						{
							npc_instant = 1;
							break;
						}

					case SE_LimitMinDur:
						if(ticsremaining) 
						{
							npc_duration = 1;
							break;
						}

						default:{
						// look pretty
							break;
						}	
					}
				}
				// DDs and Dots of all resists 
				if ((npc_instant) || (npc_duration)) 
					damage += damage * spells[buffs[i].spellid].base[0] / 100;
				
				else if (npc_resist) 
				{
					// DDs and Dots restricted by resists
					if ((npc_instant) || (npc_duration)) 
					{
						damage += damage * spells[buffs[i].spellid].base[0] / 100;
					}
					// DD and Dots of 1 resist ... these are to maintain compatibility with current spells, not ideal.
					else if (!npc_instant && !npc_duration)
					{
						damage += damage * spells[buffs[i].spellid].base[0] / 100;
					}
				}
			}
		}
	}
	return damage;
}
Thank you in advance.

-Hate
Reply With Quote
  #2  
Old 04-26-2012, 07:57 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

The operative line for a client casting the spell would be:

Code:
damage += damage * spells[buffs[i].spellid].base[0] / 100;
The value in base[0] appears to be the percentage amount added to the damage, so a value of 50 in base[0] should add 50% to the damage of the spell. As an example for a 50 damage spell it would be 50 + (50 * 50 / 100) = 75 total.

If you're getting other results and this is the only effect being considered then you'll probably have to trace through and see where else the damage value is modified.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:42 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3