From f0f920d0e8426df2470640ba923932d039f36b5e Mon Sep 17 00:00:00 2001 From: KayenEQ Date: Tue, 21 Oct 2014 14:14:35 -0400 Subject: [PATCH] Fix for bug with Discipline recast timers preventing them from working properly if you used a focus effect to reduce recast time to zero. (Specifically the recast timer failed to reset in the situation where you had already used the disc WIHTOUT the focus applied, then applied the focus and tried to have it reduced). --- zone/effects.cpp | 11 ++++++++++- zone/spells.cpp | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/zone/effects.cpp b/zone/effects.cpp index 7822d2e5e..e74e8399e 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -683,8 +683,17 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) { { uint32 reduced_recast = spell.recast_time / 1000; reduced_recast -= CastToClient()->GetFocusEffect(focusReduceRecastTime, spell_id); - if(reduced_recast < 0) + if(reduced_recast <= 0){ reduced_recast = 0; + CastToClient()->GetPTimers().Clear(&database, (uint32)DiscTimer); + } + + if (reduced_recast > 0) + CastSpell(spell_id, target, DISCIPLINE_SPELL_SLOT, -1, -1, 0, -1, (uint32)DiscTimer, reduced_recast); + else{ + CastSpell(spell_id, target, DISCIPLINE_SPELL_SLOT); + return true; + } CastSpell(spell_id, target, DISCIPLINE_SPELL_SLOT, -1, -1, 0, -1, (uint32)DiscTimer, reduced_recast); if(spells[spell_id].EndurTimerIndex < MAX_DISCIPLINE_TIMERS) diff --git a/zone/spells.cpp b/zone/spells.cpp index 8edb7b448..c616f794d 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2195,7 +2195,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration); mlog(SPELLS__CASTING, "Spell %d: Setting custom reuse timer %d to %d", spell_id, casting_spell_timer, casting_spell_timer_duration); } - else if(spells[spell_id].recast_time > 1000) { + else if(spells[spell_id].recast_time > 1000 && !spells[spell_id].IsDisciplineBuff) { int recast = spells[spell_id].recast_time/1000; if (spell_id == SPELL_LAY_ON_HANDS) //lay on hands {