Fix mana and timer being used on single target buffs failing

Single target buffs shouldn't have their mana consumed or their
reuse timers set if they fail the Mob::SpellOnTarget call in
Mob::SpellFinished. Ex. Night's Dark Terror not taking hold
(no free slots) or Target running out of range.
Debuffs do not get this nice behavior.
This commit is contained in:
Michael Cook
2013-10-10 23:17:02 -04:00
parent 6154cfce99
commit da401acdb2
2 changed files with 7 additions and 2 deletions
+6 -2
View File
@@ -1818,9 +1818,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16
if (isproc) {
SpellOnTarget(spell_id, spell_target, false, true, resist_adjust, true);
} else {
if(!SpellOnTarget(spell_id, spell_target, false, true, resist_adjust, false))
if(casting_spell_type == 1) // AA failed to cast, InterruptSpell to reset timer
if(!SpellOnTarget(spell_id, spell_target, false, true, resist_adjust, false)) {
if(IsBuffSpell(spell_id) && IsBeneficialSpell(spell_id)) {
// Prevent mana usage/timers being set for beneficial buffs
InterruptSpell();
return false;
}
}
}
if(IsPlayerIllusionSpell(spell_id)
&& IsClient()