Move instrument mod outside of the EFFECT lop in SpellEffect

This commit is contained in:
Michael Cook (mackal) 2016-08-20 14:30:21 -04:00
parent 6daf207323
commit 696c02c0f0

View File

@ -194,6 +194,8 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
bool SE_SpellTrigger_HasCast = false; bool SE_SpellTrigger_HasCast = false;
// if buff slot, use instrument mod there, otherwise calc it
uint32 instrument_mod = buffslot > -1 ? buffs[buffslot].instrument_mod : caster ? caster->GetInstrumentMod(spell_id) : 10;
// iterate through the effects in the spell // iterate through the effects in the spell
for (i = 0; i < EFFECT_COUNT; i++) for (i = 0; i < EFFECT_COUNT; i++)
{ {
@ -201,9 +203,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
continue; continue;
effect = spell.effectid[i]; effect = spell.effectid[i];
// if buff slot, use instrument mod there, otherwise calc it effect_value = CalcSpellEffectValue(spell_id, i, caster_level, instrument_mod, caster ? caster : this);
uint32 inst = buffslot > -1 ? buffs[buffslot].instrument_mod : caster ? caster->GetInstrumentMod(spell_id) : 10;
effect_value = CalcSpellEffectValue(spell_id, i, caster_level, inst, caster ? caster : this);
if(spell_id == SPELL_LAY_ON_HANDS && caster && caster->GetAA(aaImprovedLayOnHands)) if(spell_id == SPELL_LAY_ON_HANDS && caster && caster->GetAA(aaImprovedLayOnHands))
effect_value = GetMaxHP(); effect_value = GetMaxHP();