mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-18 11:25:42 +00:00
fix(Scripts/Karazhan): Chess Event. (#14736)
This commit is contained in:
@@ -9183,32 +9183,47 @@ Pet* Player::CreatePet(uint32 creatureEntry, uint32 spellID /*= 0*/)
|
||||
return pet;
|
||||
}
|
||||
|
||||
void Player::StopCastingCharm()
|
||||
void Player::StopCastingCharm(Aura* except /*= nullptr*/)
|
||||
{
|
||||
Unit* charm = GetCharm();
|
||||
if (!charm)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (charm->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (charm->ToCreature()->HasUnitTypeMask(UNIT_MASK_PUPPET))
|
||||
{
|
||||
((Puppet*)charm)->UnSummon();
|
||||
}
|
||||
else if (charm->IsVehicle())
|
||||
{
|
||||
ExitVehicle();
|
||||
}
|
||||
}
|
||||
|
||||
if (GetCharmGUID())
|
||||
charm->RemoveCharmAuras();
|
||||
{
|
||||
charm->RemoveAurasByType(SPELL_AURA_MOD_CHARM, ObjectGuid::Empty, except);
|
||||
charm->RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET, ObjectGuid::Empty, except);
|
||||
charm->RemoveAurasByType(SPELL_AURA_MOD_POSSESS, ObjectGuid::Empty, except);
|
||||
charm->RemoveAurasByType(SPELL_AURA_AOE_CHARM, ObjectGuid::Empty, except);
|
||||
}
|
||||
|
||||
if (GetCharmGUID())
|
||||
{
|
||||
LOG_FATAL("entities.player", "Player {} ({} is not able to uncharm unit ({})", GetName(), GetGUID().ToString(), GetCharmGUID().ToString());
|
||||
|
||||
if (charm->GetCharmerGUID())
|
||||
{
|
||||
LOG_FATAL("entities.player", "Charmed unit has charmer {}", charm->GetCharmerGUID().ToString());
|
||||
ABORT();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCharm(charm, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13031,15 +13046,15 @@ bool ItemPosCount::isContainedIn(ItemPosCountVec const& vec) const
|
||||
return false;
|
||||
}
|
||||
|
||||
void Player::StopCastingBindSight()
|
||||
void Player::StopCastingBindSight(Aura* except /*= nullptr*/)
|
||||
{
|
||||
if (WorldObject* target = GetViewpoint())
|
||||
{
|
||||
if (target->isType(TYPEMASK_UNIT))
|
||||
{
|
||||
((Unit*)target)->RemoveAurasByType(SPELL_AURA_BIND_SIGHT, GetGUID());
|
||||
((Unit*)target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS, GetGUID());
|
||||
((Unit*)target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET, GetGUID());
|
||||
((Unit*)target)->RemoveAurasByType(SPELL_AURA_BIND_SIGHT, GetGUID(), except);
|
||||
((Unit*)target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS, GetGUID(), except);
|
||||
((Unit*)target)->RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET, GetGUID(), except);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user