I have been working on trying to manipulate spells through the source, and I have run into some issues. For now, all of my changes are done through modifying the spell_effects.cpp; however, I would really like to be able to consolidate my changes in the mod_functions.cpp.
I tried to move some of my changes over to the mod_effect_value function in mod_functions, but I cannot get it to work properly. For one, if I do
Code:
IsDamageSpell(spell_id)
, it never returns as true, so I cannot modify damage spells. Additionally, if I do
Code:
IsEffectInSpell(spell_id, SE_DamageShield)
, it will hit that section multiple times and has even caused some zone crashes when checking if the caster was a client in that section.
Finally, in mod_buff_duration, if I make any changes to the "res" variable that is returned, it has strange side effects. For instance, I made a shaman to test out buff durations increased by wisdom, and it worked; however, I noticed that when I cast multiple buffs, they would change each others' values. For instance, a dex buff would put my dex to 97, then a strength buff would put my str to 77 and my dex to 92. Recasting the dex buff would put it back at 97 and my str at 72.
Overall, I am seeing strange behavior from using the spell mod functions in the mod_functions.cpp, and I am curious if anyone has any better suggestions for handling changes to spell effects.