[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
View File
@@ -4843,6 +4843,26 @@ bool Mob::IsAffectedByBuffByGlobalGroup(GlobalGroup group)
return false;
}
void Mob::BuffDetachCaster(Mob *caster) {
if (!caster) {
return;
}
int buff_count = GetMaxTotalSlots();
for (int j = 0; j < buff_count; j++) {
if (buffs[j].spellid != SPELL_UNKNOWN) {
if (IsDetrimentalSpell(buffs[j].spellid)) {
//this is a pretty terrible way to do this but
//there really isn't another way till I rewrite the basics
Mob* c = entity_list.GetMob(buffs[j].casterid);
if (c && c == caster) {
buffs[j].casterid = 0;
}
}
}
}
}
// checks if 'this' can be affected by spell_id from caster
// returns true if the spell should fail, false otherwise
bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)