mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Instance: add new hook & method
(cherry picked from commit 953b05459a)
This commit is contained in:
@@ -681,6 +681,35 @@ void InstanceScript::DoRemoveAurasDueToSpellOnPlayers(uint32 spell, bool include
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceScript::DoRemoveAurasDueToSpellOnPlayer(Player* player, uint32 spell, bool includePets /*= false*/, bool includeControlled /*= false*/)
|
||||
{
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
player->RemoveAurasDueToSpell(spell);
|
||||
|
||||
if (!includePets)
|
||||
return;
|
||||
|
||||
for (uint8 itr2 = 0; itr2 < MAX_SUMMON_SLOT; ++itr2)
|
||||
{
|
||||
ObjectGuid summonGUID = player->m_SummonSlot[itr2];
|
||||
if (!summonGUID.IsEmpty())
|
||||
if (Creature* summon = instance->GetCreature(summonGUID))
|
||||
summon->RemoveAurasDueToSpell(spell);
|
||||
}
|
||||
|
||||
if (!includeControlled)
|
||||
return;
|
||||
|
||||
for (auto itr2 = player->m_Controlled.begin(); itr2 != player->m_Controlled.end(); ++itr2)
|
||||
{
|
||||
if (Unit* controlled = *itr2)
|
||||
if (controlled->IsInWorld() && controlled->GetTypeId() == TYPEID_UNIT)
|
||||
controlled->RemoveAurasDueToSpell(spell);
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceScript::DoCastSpellOnPlayers(uint32 spell, bool includePets /*= false*/, bool includeControlled /*= false*/)
|
||||
{
|
||||
Map::PlayerList const& playerList = instance->GetPlayers();
|
||||
|
||||
Reference in New Issue
Block a user