View Single Post
  #6  
Old 08-28-2015, 11:18 PM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default

Thanks for the help; I modified my code accordingly, and I also changed it to do modifications based on the individual effect instead of the spell type which is what I think was causing having effects with no caster specified. My new problem though seems to be that the HoT spells just don't scale based on wisdom. When I run the zone in debugger, I can see when the heal effect is loaded in, and it seems to return the proper value; however, in the game, HoT spells still only apply their unmodified value.

For example, I am using Celestial Health and it's base effect value is 115. After my wisdom bonus is applied, the mod function returns 143. For some reason, in the game, the spell will only heal for 115 though. All nukes, DoTs, and heals that I have tested seem to be working though which makes me wonder if the HoT value calculation is modified somewhere else after the mod_effect_value function. I'll continue looking for a cause, and here is my code in case someone else is working on the same thing i am.

Code:
int Mob::mod_effect_value(int effect_value, uint16 spell_id, int effect_type, Mob* caster) 
{ 
	//Spell effects that require a caster
	if (caster)
	{
		//Damage or healing spell
		if (effect_type == SE_BardAEDot || effect_type == SE_CompleteHeal ||
			effect_type == SE_CurrentHP || effect_type == SE_CurrentHPOnce || effect_type == SE_HealOverTime)
		{
			if (effect_value < 0)//Nuke or Dot
			{
				if (this != caster)//Only apply damage bonus if casting on someone else to avoid death from AEs and so on
				{
					effect_value *= (caster->INT / 100.0);
				}		
			}
			else//Heal or HoT
			{
				effect_value *= (caster->WIS / 100.0);
			}
		}
	}
	//Damage shields and runes are based on the target and not the caster
	if (effect_type == SE_DamageShield || effect_type == SE_Rune)
	{
		effect_value *= (STA / 100.0);
	}
	return(effect_value); 
}
Reply With Quote