[Bug Fix] Edge case AA reset timer issue fixes (#1995)

* SendCastRestriction not displaying right on linux build

changed const char to string

* fail safe to prevent recast timer checks from triggered spells

* fixed

* Update spell_effects.cpp

* https://github.com/EQEmu/Server/pull/1995

better message code
This commit is contained in:
KayenEQ 2022-02-13 21:50:53 -05:00 committed by GitHub
parent 03adf20fe9
commit 1d4438ae1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 323 additions and 320 deletions

View File

@ -359,6 +359,7 @@ public:
void SendIllusionWearChange(Client* c);
int16 GetItemSlotToConsumeCharge(int32 spell_id, uint32 inventory_slot);
bool CheckItemRaceClassDietyRestrictionsOnCast(uint32 inventory_slot);
bool IsFromTriggeredSpell(EQ::spells::CastingSlot slot, uint32 item_slot = 0xFFFFFFFF);
//Bard
bool ApplyBardPulse(int32 spell_id, Mob *spell_target, EQ::spells::CastingSlot slot);

File diff suppressed because it is too large Load Diff

View File

@ -2395,9 +2395,6 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
else if(!SpellOnTarget(spell_id, spell_target, 0, true, resist_adjust, false, level_override)) {
if(IsBuffSpell(spell_id) && IsBeneficialSpell(spell_id)) {
// Prevent mana usage/timers being set for beneficial buffs
if(casting_spell_aa_id)
InterruptSpell();
return false;
}
}
@ -2588,7 +2585,8 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
/*
Set Recast Timer on spells.
*/
if(IsClient() && !isproc)
if(IsClient() && !isproc && !IsFromTriggeredSpell(slot, inventory_slot))
{
if (slot == CastingSlot::AltAbility) {
if (!aa_id) {
@ -2615,11 +2613,6 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui
CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration);
LogSpells("Spell [{}]: Setting custom reuse timer [{}] to [{}]", spell_id, casting_spell_timer, casting_spell_timer_duration);
}
else if(spell_id == casting_spell_id && casting_spell_timer != 0xFFFFFFFF)
{
CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration);
LogSpells("Spell [{}]: Setting custom reuse timer [{}] to [{}]", spell_id, casting_spell_timer, casting_spell_timer_duration);
}
else if(spells[spell_id].recast_time > 1000 && !spells[spell_id].is_discipline) {
int recast = spells[spell_id].recast_time/1000;
if (spell_id == SPELL_LAY_ON_HANDS) //lay on hands
@ -4006,8 +3999,9 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob *spelltar, int reflect_effectivenes
// if SpellEffect returned false there's a problem applying the
// spell. It's most likely a buff that can't stack.
LogSpells("Spell [{}] could not apply its effects [{}] -> [{}]\n", spell_id, GetName(), spelltar->GetName());
if(casting_spell_aa_id)
if (casting_spell_aa_id) {
MessageString(Chat::SpellFailure, SPELL_NO_HOLD);
}
safe_delete(action_packet);
return false;
}
@ -6644,3 +6638,11 @@ bool Mob::CheckItemRaceClassDietyRestrictionsOnCast(uint32 inventory_slot) {
return true;
}
bool Mob::IsFromTriggeredSpell(CastingSlot slot, uint32 item_slot) {
//spells triggered using spells finished use item slot, but there is no item set.
if ((slot == CastingSlot::Item) && (item_slot == 0xFFFFFFFF)) {
return true;
}
return false;
}