mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 00:53:46 +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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2298,8 +2298,8 @@ public:
|
||||
void SetSeer(WorldObject* target) { m_seer = target; }
|
||||
void SetViewpoint(WorldObject* target, bool apply);
|
||||
[[nodiscard]] WorldObject* GetViewpoint() const;
|
||||
void StopCastingCharm();
|
||||
void StopCastingBindSight();
|
||||
void StopCastingCharm(Aura* except = nullptr);
|
||||
void StopCastingBindSight(Aura* except = nullptr);
|
||||
|
||||
[[nodiscard]] uint32 GetSaveTimer() const { return m_nextSave; }
|
||||
void SetSaveTimer(uint32 timer) { m_nextSave = timer; }
|
||||
|
||||
Reference in New Issue
Block a user