From da401acdb2a32bf2b3c89cff4daecb6ff0a8971b Mon Sep 17 00:00:00 2001 From: Michael Cook Date: Thu, 10 Oct 2013 23:17:02 -0400 Subject: [PATCH] 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. --- changelog.txt | 1 + zone/spells.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog.txt b/changelog.txt index 899ab7015..059396ab6 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,7 @@ EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- == 10/10/2013 == Secrets: Fixed zone shutdown (or #reloadqst) reinitalization of Perl. This should allow for Perl 5.14 and later to work on Windows under the new quest system. +demonstar55: Beneficial single target buffs shouldn't have their mana/timers set if they fail to cast after the Mob::SpellOnTarget call in Mob::SpellFinished == 10/09/2013 == demonstar55: Fixed some more instances of the AA timer being eaten diff --git a/zone/spells.cpp b/zone/spells.cpp index 02ae8db0d..710bf62cf 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -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()