[Rules] Evac Aggro Wipe (#3880)

clear aggro on evac spells, special case of wiping aggro for clients
This commit is contained in:
Fryguy 2024-01-07 13:51:07 -05:00 committed by GitHub
parent d9cfc3a858
commit bc3e9e8fba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View File

@ -471,6 +471,7 @@ RULE_BOOL(Spells, DOTBonusDamageSplitOverDuration, true, "Disable to have Damage
RULE_BOOL(Spells, HOTBonusHealingSplitOverDuration, true, "Disable to have Heal Over Time total bonus healing added to each tick instead of divided across duration")
RULE_BOOL(Spells, UseLegacyFizzleCode, false, "Enable will turn on the legacy fizzle code which is far stricter and more accurate to 2001/2002 testing.")
RULE_BOOL(Spells, LegacyManaburn, false, "Enable to have the legacy manaburn system from 2003 and earlier.")
RULE_BOOL(Spells, EvacClearAggroInSameZone, false, "Enable to clear aggro on clients when evacing in same zone.")
RULE_CATEGORY_END()
RULE_CATEGORY(Combat)

View File

@ -572,12 +572,16 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#ifdef SPELL_EFFECT_SPAM
LogDebug("Succor/Evacuation Spell In Same Zone");
#endif
if(IsClient())
if (IsClient()) {
CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), x, y, z, heading, 0, EvacToSafeCoords);
else
} else {
GMMove(x, y, z, heading);
}
else {
if (RuleB(Spells, EvacClearAggroInSameZone)) {
entity_list.ClearAggro(this);
}
} else {
#ifdef SPELL_EFFECT_SPAM
LogDebug("Succor/Evacuation Spell To Another Zone");
#endif
@ -1514,6 +1518,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
int wipechance = 0;
if (RuleB(Spells, EvacClearAggroInSameZone) && !wipechance && IsClient()) {
entity_list.ClearAggro(this);
}
if (caster) {
wipechance = caster->GetMemoryBlurChance(effect_value);
}