[Bug Fix] Depop Charm Pet and Detach Debuffs on Evacuate (#3888)

* [Bug Fix] depop charm pet and detach debuffs on evac.

This will depop charm pets and deteach debuffs to prevent some social aggro issues and exploitable conditions with charming and pulling a mob across the zone with no aggro concerns.

* Added Rules
This commit is contained in:
Fryguy
2024-01-07 16:44:15 -05:00
committed by GitHub
parent 066b762e73
commit 6db6d7dca9
6 changed files with 50 additions and 12 deletions
+20 -10
View File
@@ -568,19 +568,25 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
// Greater Decession = 3244
// Egress = 1566
if(!target_zone) {
if (!target_zone) {
#ifdef SPELL_EFFECT_SPAM
LogDebug("Succor/Evacuation Spell In Same Zone");
#endif
if (IsClient()) {
CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), x, y, z, heading, 0, EvacToSafeCoords);
} else {
GMMove(x, y, z, heading);
}
if (RuleB(Spells, EvacClearAggroInSameZone)) {
entity_list.ClearAggro(this);
if (IsClient()) {
if (HasPet()) {
if (RuleB(Spells, EvacClearCharmPet) && GetPet()->IsCharmed()) {
GetPet()->BuffFadeByEffect(SE_Charm);
}
}
CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), x, y, z, heading, 0, EvacToSafeCoords);
} else {
GMMove(x, y, z, heading);
}
if (RuleB(Spells, EvacClearAggroInSameZone)) {
entity_list.ClearAggro(this);
}
} else {
#ifdef SPELL_EFFECT_SPAM
LogDebug("Succor/Evacuation Spell To Another Zone");
@@ -2214,7 +2220,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
// clear aggro when summoned in zone and further than aggro clear distance rule.
if (RuleR(Spells, CallOfTheHeroAggroClearDist) == 0 || caster->CalculateDistance(GetX(), GetY(), GetZ()) >= RuleR(Spells, CallOfTheHeroAggroClearDist)) {
entity_list.ClearAggro(this);
if (RuleB(Spells, EvacClearCharmPet)) {
entity_list.ClearAggro(this, true);
} else {
entity_list.ClearAggro(this);
}
}
} else if (!RuleB(Combat, SummonMeleeRange) && caster->GetZoneID() == GetZoneID() && caster->CombatRange(this)) {
break;