Core/Instance: add new method
Port From (https://github.com/TrinityCore/TrinityCore/commit/934b72262d390f4e2cb87f07a4c1512a24a3b0d0)
This commit is contained in:
@@ -669,8 +669,7 @@ namespace Game.Maps
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DoRemoveAurasDueToSpellOnPlayer(Player player, uint spell, bool includePets = false, bool includeControlled = false)
|
||||
public void DoRemoveAurasDueToSpellOnPlayer(Player player, uint spell, bool includePets = false, bool includeControlled = false)
|
||||
{
|
||||
if (!player)
|
||||
return;
|
||||
@@ -738,6 +737,39 @@ namespace Game.Maps
|
||||
}
|
||||
}
|
||||
|
||||
public void DoCastSpellOnPlayer(Player player, uint spell, bool includePets = false, bool includeControlled = false)
|
||||
{
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
player.CastSpell(player, spell, true);
|
||||
|
||||
if (!includePets)
|
||||
return;
|
||||
|
||||
for (var i = 0; i < SharedConst.MaxSummonSlot; ++i)
|
||||
{
|
||||
ObjectGuid summonGUID = player.m_SummonSlot[i];
|
||||
if (!summonGUID.IsEmpty())
|
||||
{
|
||||
Creature summon = instance.GetCreature(summonGUID);
|
||||
if (summon != null)
|
||||
summon.CastSpell(player, spell, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!includeControlled)
|
||||
return;
|
||||
|
||||
for (var i = 0; i < player.m_Controlled.Count; ++i)
|
||||
{
|
||||
Unit controlled = player.m_Controlled[i];
|
||||
if (controlled != null)
|
||||
if (controlled.IsInWorld && controlled.IsCreature())
|
||||
controlled.CastSpell(player, spell, true);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool CheckAchievementCriteriaMeet(uint criteria_id, Player source, Unit target = null, uint miscvalue1 = 0)
|
||||
{
|
||||
Log.outError(LogFilter.Server, "Achievement system call CheckAchievementCriteriaMeet but instance script for map {0} not have implementation for achievement criteria {1}",
|
||||
|
||||
Reference in New Issue
Block a user