mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Core/Unit: For convenience, explicitly redirect CastSpell with nullptr as first argument to the Unit* overloads. No more ->CastSpell((Unit*)nullptr, ...) all over the place!
(cherry picked from commitsc7896f3102and40c78cac4c)
This commit is contained in:
@@ -1233,7 +1233,9 @@ class TC_GAME_API Unit : public WorldObject
|
|||||||
|
|
||||||
void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||||
void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||||
|
void CastSpell(std::nullptr_t, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty) { CastSpell((Unit*)nullptr, spellId, triggered, castItem, triggeredByAura, originalCaster); }
|
||||||
void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||||
|
void CastSpell(std::nullptr_t, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty) { CastSpell((Unit*)nullptr, spellId, triggerFlags, castItem, triggeredByAura, originalCaster); }
|
||||||
void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||||
void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||||
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ class VoidSpawnSummon : public BasicEvent
|
|||||||
|
|
||||||
bool Execute(uint64 /*time*/, uint32 /*diff*/)
|
bool Execute(uint64 /*time*/, uint32 /*diff*/)
|
||||||
{
|
{
|
||||||
_owner->CastSpell((Unit*)nullptr, SPELL_SUMMON_VOID_SENTINEL, true);
|
_owner->CastSpell(nullptr, SPELL_SUMMON_VOID_SENTINEL, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -589,7 +589,7 @@ class spell_summon_blood_elves_script : SpellScriptLoader
|
|||||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < MAX_SUMMON_BLOOD_ELVES; ++i)
|
for (uint8 i = 0; i < MAX_SUMMON_BLOOD_ELVES; ++i)
|
||||||
GetCaster()->CastSpell((Unit*)nullptr, SummonBloodElvesSpells[urand(0,3)], true);
|
GetCaster()->CastSpell(nullptr, SummonBloodElvesSpells[urand(0,3)], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
@@ -621,7 +621,7 @@ class spell_muru_darkness : SpellScriptLoader
|
|||||||
void HandleAfterCast()
|
void HandleAfterCast()
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < MAX_SUMMON_DARK_FIEND; ++i)
|
for (uint8 i = 0; i < MAX_SUMMON_DARK_FIEND; ++i)
|
||||||
GetCaster()->CastSpell((Unit*)nullptr, SummonDarkFiendSpells[i], true);
|
GetCaster()->CastSpell(nullptr, SummonDarkFiendSpells[i], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
@@ -683,7 +683,7 @@ class spell_transform_visual_missile_periodic : public SpellScriptLoader
|
|||||||
|
|
||||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||||
{
|
{
|
||||||
GetTarget()->CastSpell((Unit*)nullptr, RAND(TRANSFORM_VISUAL_MISSILE_1, TRANSFORM_VISUAL_MISSILE_2), true);
|
GetTarget()->CastSpell(nullptr, RAND(TRANSFORM_VISUAL_MISSILE_1, TRANSFORM_VISUAL_MISSILE_2), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
@@ -709,7 +709,7 @@ class spell_summon_blood_elves_periodic : public SpellScriptLoader
|
|||||||
|
|
||||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||||
{
|
{
|
||||||
GetTarget()->CastSpell((Unit*)nullptr, SPELL_SUMMON_BLOOD_ELVES_SCRIPT, true);
|
GetTarget()->CastSpell(nullptr, SPELL_SUMMON_BLOOD_ELVES_SCRIPT, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register() override
|
void Register() override
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ class npc_corrupted_soul_fragment : public CreatureScript
|
|||||||
if (instance->GetGuidData(DATA_BRONJAHM).GetCounter() != id)
|
if (instance->GetGuidData(DATA_BRONJAHM).GetCounter() != id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
me->CastSpell((Unit*)nullptr, SPELL_CONSUME_SOUL, true);
|
me->CastSpell(nullptr, SPELL_CONSUME_SOUL, true);
|
||||||
me->DespawnOrUnsummon();
|
me->DespawnOrUnsummon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ class instance_gundrak : public InstanceMapScript
|
|||||||
|
|
||||||
if (GameObject* altar = GetGameObject(altarId))
|
if (GameObject* altar = GetGameObject(altarId))
|
||||||
if (Creature* trigger = altar->FindNearestCreature(NPC_ALTAR_TRIGGER, 10.0f))
|
if (Creature* trigger = altar->FindNearestCreature(NPC_ALTAR_TRIGGER, 10.0f))
|
||||||
trigger->CastSpell((Unit*)nullptr, spellId, true);
|
trigger->CastSpell(nullptr, spellId, true);
|
||||||
|
|
||||||
// eventId equals statueId
|
// eventId equals statueId
|
||||||
ToggleGameObject(eventId, GO_STATE_READY);
|
ToggleGameObject(eventId, GO_STATE_READY);
|
||||||
|
|||||||
@@ -865,7 +865,7 @@ class spell_summon_gauntlet_mobs_periodic : public SpellScriptLoader
|
|||||||
for (uint8 i = 0; i < 2; ++i)
|
for (uint8 i = 0; i < 2; ++i)
|
||||||
{
|
{
|
||||||
uint32 spellId = SummonSpellsList.front();
|
uint32 spellId = SummonSpellsList.front();
|
||||||
GetTarget()->CastSpell((Unit*)nullptr, spellId, true);
|
GetTarget()->CastSpell(nullptr, spellId, true);
|
||||||
SummonSpellsList.push_back(spellId);
|
SummonSpellsList.push_back(spellId);
|
||||||
SummonSpellsList.pop_front();
|
SummonSpellsList.pop_front();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user