[Bug Fix] Imitate Death should also clear zone feign aggro (#4436)

This commit is contained in:
Fryguy 2024-07-31 18:28:36 -04:00 committed by GitHub
parent 6e9ff52dce
commit 421767e1e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2318,8 +2318,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
else if (spells[spell_id].max_value[i]) { else if (spells[spell_id].max_value[i]) {
if (spells[spell_id].max_value[i] >= 1000) { if (spells[spell_id].max_value[i] >= 1000) {
max_level = 1000 - spells[spell_id].max_value[i]; max_level = 1000 - spells[spell_id].max_value[i];
} } else {
else {
max_level = GetLevel() + spells[spell_id].max_value[i]; max_level = GetLevel() + spells[spell_id].max_value[i];
} }
} }
@ -2329,6 +2328,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if (IsClient()) { if (IsClient()) {
int pre_aggro_count = CastToClient()->GetAggroCount(); int pre_aggro_count = CastToClient()->GetAggroCount();
entity_list.RemoveFromTargetsFadingMemories(this, true, max_level); entity_list.RemoveFromTargetsFadingMemories(this, true, max_level);
entity_list.ClearZoneFeignAggro(this);
if (spellbonuses.ShroudofStealth || aabonuses.ShroudofStealth || itembonuses.ShroudofStealth) { if (spellbonuses.ShroudofStealth || aabonuses.ShroudofStealth || itembonuses.ShroudofStealth) {
improved_hidden = true; improved_hidden = true;
@ -2341,15 +2341,13 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if (pre_aggro_count == post_aggro_count) { if (pre_aggro_count == post_aggro_count) {
Message(Chat::SpellFailure, "You failed to escape from all your opponents."); Message(Chat::SpellFailure, "You failed to escape from all your opponents.");
break; break;
} } else if (post_aggro_count) {
else if (post_aggro_count) {
Message(Chat::SpellFailure, "You failed to escape from combat but you evade some of your opponents."); Message(Chat::SpellFailure, "You failed to escape from combat but you evade some of your opponents.");
break; break;
} }
} }
MessageString(Chat::Skills, ESCAPE); MessageString(Chat::Skills, ESCAPE);
} } else{
else{
entity_list.RemoveFromTargets(caster); entity_list.RemoveFromTargets(caster);
SetInvisible(Invisibility::Invisible); SetInvisible(Invisibility::Invisible);
} }