Fixed more instances of AA timers being eaten

Every time I touch zone/AA.cpp to fix timers it gets uglier.
This should fix the bug reported here: http://www.peqtgc.com/phpBB3/viewtopic.php?f=17&t=14125
It should also fix AAs not being reset when it when you have no buff slots free (confirmed on live)
This commit is contained in:
Michael Cook 2013-10-09 02:00:49 -04:00
parent 9a19a00bdc
commit 3a95f81196
3 changed files with 17 additions and 7 deletions

View File

@ -1,5 +1,8 @@
EQEMu Changelog (Started on Sept 24, 2003 15:50)
-------------------------------------------------------
== 10/09/2013 ==
demonstar55: Fixed some more instances of the AA timer being eaten
== 10/08/2013 ==
demonstar55: Added IsBuffSpell(spell_id) that will return true if the spell has a duration, so would end up in effects/song/discs etc windows on the client
demonstar55: Replaced instances of using CalcBuffDuration to determine if a spell was a buff with IsBuffSpell

View File

@ -262,7 +262,6 @@ void Client::ActivateAA(aaID activate){
}
SetMana(GetMana() - caa->mana_cost);
}
HandleAAAction(aaid);
if(caa->reuse_time > 0)
{
uint32 timer_base = CalcAAReuseTimer(caa);
@ -273,6 +272,7 @@ void Client::ActivateAA(aaID activate){
p_timers.Start(AATimerID + pTimerAAStart, timer_base);
SendAATimer(AATimerID, 0, 0);
}
HandleAAAction(aaid);
}
//cast the spell, if we have one
@ -531,10 +531,14 @@ void Client::HandleAAAction(aaID activate) {
}
//cast the spell, if we have one
if(spell_id > 0 && spell_id < SPDAT_RECORDS) {
//I dont know when we need to mem and when we do not, if ever...
//MemorizeSpell(8, spell_id, 3);
CastSpell(spell_id, target_id);
if(IsValidSpell(spell_id)) {
int aatid = GetAATimerID(activate);
if(!CastSpell(spell_id, target_id , 10, -1, -1, 0, -1, pTimerAAStart + aatid , CalcAAReuseTimer(caa), 1)) {
SendAATimer(aatid, 0, 0xFFFFFF);
Message_StringID(15,ABILITY_FAILED);
p_timers.Clear(&database, pTimerAAStart + aatid);
return;
}
}
//handle the duration timer if we have one.

View File

@ -1818,7 +1818,9 @@ 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 {
SpellOnTarget(spell_id, spell_target, false, true, resist_adjust, false);
if(!SpellOnTarget(spell_id, spell_target, false, true, resist_adjust, false))
if(casting_spell_type == 1) // AA failed to cast, InterruptSpell to reset timer
InterruptSpell();
}
if(IsPlayerIllusionSpell(spell_id)
&& IsClient()
@ -3478,7 +3480,8 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r
// if SpellEffect returned false there's a problem applying the
// spell. It's most likely a buff that can't stack.
mlog(SPELLS__CASTING_ERR, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName());
Message_StringID(MT_Shout, SPELL_NO_HOLD);
if(casting_spell_type != 1) // AA is handled differently
Message_StringID(MT_Shout, SPELL_NO_HOLD);
safe_delete(action_packet);
return false;
}