mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-01 10:03:47 +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; }
|
||||
|
||||
@@ -18575,15 +18575,15 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
// Charmer stop charming
|
||||
if (playerCharmer)
|
||||
{
|
||||
playerCharmer->StopCastingCharm();
|
||||
playerCharmer->StopCastingBindSight();
|
||||
playerCharmer->StopCastingCharm(aurApp ? aurApp->GetBase() : nullptr);
|
||||
playerCharmer->StopCastingBindSight(aurApp ? aurApp->GetBase() : nullptr);
|
||||
}
|
||||
|
||||
// Charmed stop charming
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
ToPlayer()->StopCastingCharm();
|
||||
ToPlayer()->StopCastingBindSight();
|
||||
ToPlayer()->StopCastingCharm(aurApp ? aurApp->GetBase() : nullptr);
|
||||
ToPlayer()->StopCastingBindSight(aurApp ? aurApp->GetBase() : nullptr);
|
||||
}
|
||||
|
||||
// StopCastingCharm may remove a possessed pet?
|
||||
@@ -18695,8 +18695,11 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, uint32(GameTime::GetGameTime().count())); // cast can't be helped
|
||||
}
|
||||
}
|
||||
GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, GetFollowAngle());
|
||||
playerCharmer->CharmSpellInitialize();
|
||||
if (playerCharmer->m_seer != this)
|
||||
{
|
||||
GetMotionMaster()->MoveFollow(charmer, PET_FOLLOW_DIST, GetFollowAngle());
|
||||
playerCharmer->CharmSpellInitialize();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -2461,6 +2461,8 @@ public:
|
||||
|
||||
std::string GetDebugInfo() const override;
|
||||
|
||||
[[nodiscard]] uint32 GetOldFactionId() const { return _oldFactionId; }
|
||||
|
||||
protected:
|
||||
explicit Unit (bool isWorldObject);
|
||||
|
||||
|
||||
@@ -289,10 +289,6 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
|
||||
if (unit->GetNpcFlags() == UNIT_NPC_FLAG_NONE)
|
||||
return;
|
||||
|
||||
// xinef: do not allow to open gossip when npc is in combat
|
||||
if (unit->GetNpcFlags() == UNIT_NPC_FLAG_GOSSIP && unit->IsInCombat()) // should work on all flags?
|
||||
return;
|
||||
|
||||
// set faction visible if needed
|
||||
if (FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->GetFaction()))
|
||||
_player->GetReputationMgr().SetVisible(factionTemplateEntry);
|
||||
|
||||
@@ -4470,7 +4470,13 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
{
|
||||
spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
|
||||
});
|
||||
|
||||
// Game In Session
|
||||
ApplySpellFix({ 39331 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].Effect = SPELL_EFFECT_APPLY_AURA;
|
||||
spellInfo->Attributes |= SPELL_ATTR0_NO_AURA_CANCEL;
|
||||
spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CHANGE_MAP;
|
||||
});
|
||||
// Death Ray Warning Visual, Death Ray Damage Visual
|
||||
ApplySpellFix({ 63882, 63886 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user