fix(Core/Misc): Change const to be after type name (#10591)

This commit is contained in:
Kitzunu
2022-02-14 20:05:45 +01:00
committed by GitHub
parent 9b83abca39
commit 455899dc75
168 changed files with 438 additions and 438 deletions
@@ -144,7 +144,7 @@ class boss_anub_arak : public CreatureScript
void SummonHelpers(float x, float y, float z, uint32 spellId)
{
const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(spellId);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
me->SummonCreature(spellInfo->Effects[EFFECT_0].MiscValue, x, y, z);
}
@@ -328,7 +328,7 @@ struct boss_taldaram : public BossAI
me->InterruptNonMeleeSpells(true);
}
void SpellHitTarget(Unit* /*target*/, const SpellInfo *spellInfo) override
void SpellHitTarget(Unit* /*target*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_CONJURE_FLAME_SPHERE)
{
@@ -257,7 +257,7 @@ public:
}
}
bool CanAIAttack(const Unit* who) const override
bool CanAIAttack(Unit const* who) const override
{
return me->GetHomePosition().GetExactDist2d(who) < 52.0f;
}
@@ -137,7 +137,7 @@ public:
pInstance->SetData(BOSS_ARGENT_CHALLENGE, IN_PROGRESS);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == 66905 && me->GetHealth() == 1) // hammer throw back damage (15k)
me->CastSpell(me, 68197, true);
@@ -187,7 +187,7 @@ public:
}
}
void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell) override
void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override
{
switch( spell->Id )
{
@@ -410,7 +410,7 @@ public:
events.RescheduleEvent(2, urand(3000, 4000)); // claw
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_BK_GHOUL_EXPLODE)
{
@@ -419,7 +419,7 @@ public:
}
}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
switch(spell->Id)
{
@@ -642,7 +642,7 @@ public:
}
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
switch( spell->Id )
{
@@ -416,7 +416,7 @@ public:
ScriptedAI::MoveInLineOfSight(who);
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
return target->GetEntry() != NPC_FROST_SPHERE;
}
@@ -505,7 +505,7 @@ public:
me->m_Events.AddEvent(new HideNpcEvent(*me), me->m_Events.CalculateTime(5000));
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
return target->GetEntry() != NPC_FROST_SPHERE && !me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
@@ -569,7 +569,7 @@ public:
}
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if( spell->Id == SPELL_SPIKE_FAIL )
{
@@ -640,7 +640,7 @@ public:
}
}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if( !target || !spell )
return;
@@ -713,7 +713,7 @@ public:
me->m_Events.AddEvent(new HideNpcEvent(*me), me->m_Events.CalculateTime(5000));
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
return target->GetEntry() != NPC_FROST_SPHERE;
}
@@ -145,7 +145,7 @@ public:
pInstance->SetData(TYPE_JARAXXUS, IN_PROGRESS);
}
void SpellHit(Unit* caster, const SpellInfo* spell) override
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
switch( spell->Id )
{
@@ -392,7 +392,7 @@ public:
events.RescheduleEvent(EVENT_SPELL_MISTRESS_KISS, urand(10000, 15000));
}
void SpellHit(Unit* /*caster*/, const SpellInfo* /*spell*/) override
void SpellHit(Unit* /*caster*/, SpellInfo const* /*spell*/) override
{
//if (caster && spell && spell->Id == 66287 /*control vehicle*/)
// caster->ClearUnitState(UNIT_STATE_ONVEHICLE);
@@ -747,7 +747,7 @@ public:
if( !count || !GetOwner() )
return;
if( const SpellInfo* se = GetAura()->GetSpellInfo() )
if( SpellInfo const* se = GetAura()->GetSpellInfo() )
if( Unit* owner = GetOwner()->ToUnit() )
{
uint32 auraId = 0;
@@ -107,7 +107,7 @@ public:
}
}
bool IsValidDedicatedInsanityItem(const ItemTemplate* item)
bool IsValidDedicatedInsanityItem(ItemTemplate const* item)
{
if (!item) // should not happen, but checked in GetAverageItemLevel()
return true;
@@ -118,7 +118,7 @@ public:
}
}
void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell) override
void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_TELEPORT)
{
@@ -144,7 +144,7 @@ public:
}
}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (spell->Id == SPELL_PHANTOM_BLAST_H)
bAchiev = false;
@@ -165,7 +165,7 @@ public:
}
}
bool CanAIAttack(const Unit* target) const override { return target->GetPositionZ() > 706.5f; }
bool CanAIAttack(Unit const* target) const override { return target->GetPositionZ() > 706.5f; }
void UpdateAI(uint32 diff) override
{
@@ -1460,7 +1460,7 @@ public:
summons.Despawn(s);
}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (target && target->IsAlive() && spell->Id == SPELL_LICH_KING_ZAP_PLAYER)
Unit::DealDamage(me, target, 10000);
@@ -169,7 +169,7 @@ public:
}
}
void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell) override
void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override
{
if (spell->Id == uint32(SPELL_SARONITE_TRIGGERED))
{
@@ -93,7 +93,7 @@ public:
pInstance->SetData(DATA_ICK, NOT_STARTED);
}
bool CanAIAttack(const Unit* /*who*/) const override
bool CanAIAttack(Unit const* /*who*/) const override
{
return pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) >= INSTANCE_PROGRESS_FINISHED_INTRO;
}
@@ -113,7 +113,7 @@ public:
pInstance->SetData(DATA_ICK, IN_PROGRESS);
}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (!target || !spell)
return;
@@ -214,7 +214,7 @@ public:
Talk(RAND(SAY_SLAY_1, SAY_SLAY_2));
}
bool CanAIAttack(const Unit* who) const override
bool CanAIAttack(Unit const* who) const override
{
switch (who->GetEntry())
{
@@ -877,7 +877,7 @@ public:
uint16 timer1;
uint16 timer2;
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (target && spell && target->GetTypeId() == TYPEID_PLAYER && spell->Id == 70827 && pInstance)
pInstance->SetData(DATA_ACHIEV_DONT_LOOK_UP, 0);
@@ -1112,7 +1112,7 @@ public:
me->ApplySpellImmune(0, IMMUNITY_ID, 70827, true);
}
bool CanAIAttack(const Unit* who) const override
bool CanAIAttack(Unit const* who) const override
{
return who->GetEntry() == NPC_FALLEN_WARRIOR;
}
@@ -1181,7 +1181,7 @@ public:
}
}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if ((spell->Id == SPELL_TELEPORT_JAINA || spell->Id == SPELL_TELEPORT_SYLVANAS) && target && target->GetTypeId() == TYPEID_PLAYER)
{
@@ -93,7 +93,7 @@ public:
events.ScheduleEvent(EVENT_TRANSFORMATION, 12000);
}
void SpellHitTarget(Unit* /*caster*/, const SpellInfo* spellInfo) override
void SpellHitTarget(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_TRANSFORMATION)
{
@@ -573,7 +573,7 @@ public:
BossAI::EnterEvadeMode();
}
bool CanAIAttack(const Unit* /*target*/) const override
bool CanAIAttack(Unit const* /*target*/) const override
{
return me->IsVisible();
}
@@ -316,7 +316,7 @@ public:
creature->AI()->DoAction(ACTION_START_OUTRO);
}
bool CanAIAttack(const Unit* /*target*/) const override
bool CanAIAttack(Unit const* /*target*/) const override
{
return _introDone;
}
@@ -1047,7 +1047,7 @@ public:
}
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
if (_instance->GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) != IN_PROGRESS)
return false;
@@ -1386,7 +1386,7 @@ public:
}
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
if (_instance->GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) != IN_PROGRESS)
return false;
@@ -1445,7 +1445,7 @@ public:
{
npc_igb_ship_crewAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) {}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
return _instance->GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) == IN_PROGRESS && target->GetTransport() == me->GetTransport() && target->GetPositionZ() < 478.0f && (me->GetEntry() == NPC_SKYBREAKER_DECKHAND ? (target->GetPositionY() > 2042.0f) : (target->GetPositionY() < 2431.0f));
}
@@ -1627,7 +1627,7 @@ struct npc_gunship_boarding_addAI : public ScriptedAI
checkTimer -= diff;
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
return Instance->GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) == IN_PROGRESS && target->GetTransport() && target->GetTransport() != me->GetTransport() && target->GetPositionZ() < 478.0f && (me->GetEntry() == NPC_SKYBREAKER_SERGEANT || me->GetEntry() == NPC_SKYBREAKER_MARINE ? (target->GetPositionY() < 2431.0f) : (target->GetPositionY() > 2042.0f));
}
@@ -1806,7 +1806,7 @@ public:
gunship_npc_AI::UpdateAI(diff);
}
bool CanAIAttack(const Unit* /*target*/) const override
bool CanAIAttack(Unit const* /*target*/) const override
{
return Instance->GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) == IN_PROGRESS;
}
@@ -1880,7 +1880,7 @@ public:
DoSpellAttackIfReady(me->GetEntry() == NPC_SKYBREAKER_RIFLEMAN ? SPELL_SHOOT : SPELL_HURL_AXE);
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
return Instance->GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) == IN_PROGRESS && target->GetTransport() && target->GetTransport() != me->GetTransport();
}
@@ -1935,7 +1935,7 @@ public:
me->_AddCreatureSpellCooldown(spellId, 0, 9000);
}
bool CanAIAttack(const Unit* /*target*/) const override
bool CanAIAttack(Unit const* /*target*/) const override
{
return Instance->GetBossState(DATA_ICECROWN_GUNSHIP_BATTLE) == IN_PROGRESS;
}
@@ -2426,7 +2426,7 @@ public:
void CalculateDamage(SpellEffIndex /*effIndex*/)
{
PreventHitEffect(EFFECT_0);
const SpellInfo* si = sSpellMgr->GetSpellInfo(GetSpellInfo()->Effects[0].TriggerSpell);
SpellInfo const* si = sSpellMgr->GetSpellInfo(GetSpellInfo()->Effects[0].TriggerSpell);
if (!si)
return;
SpellCastTargets targets;
@@ -135,7 +135,7 @@ public:
instance->SetBossState(DATA_LORD_MARROWGAR, IN_PROGRESS);
}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (target && (spell->Id == 69055 || spell->Id == 70814)) // Bone Slice (Saber Lash)
for (uint8 i = 0; i < 3; ++i)
@@ -217,7 +217,7 @@ public:
return me->IsValidAttackTarget(target);
}
private:
const Unit* me;
Unit const* me;
};
class boss_professor_putricide : public CreatureScript
@@ -283,7 +283,7 @@ public:
BossAI::AttackStart(who);
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
return me->IsVisible() && target->GetPositionZ() > 388.0f && target->GetPositionZ() < 410.0f && target->GetPositionY() > 3157.1f && target->GetExactDist2dSq(4356.0f, 3211.0f) < 80.0f * 80.0f;
}
@@ -895,8 +895,8 @@ public:
// big hax to unlock Abomination Eat Ooze ability, requires caster aura spell from difficulty X, but unlocks clientside when got base aura
void HandleScript(SpellEffIndex /*effIndex*/)
{
const SpellInfo* s1 = sSpellMgr->GetSpellInfo(70346);
const SpellInfo* s2 = sSpellMgr->GetSpellInfo(72456);
SpellInfo const* s1 = sSpellMgr->GetSpellInfo(70346);
SpellInfo const* s2 = sSpellMgr->GetSpellInfo(72456);
if (s1 && s2)
if (Unit* target = GetHitUnit())
{
@@ -354,7 +354,7 @@ public:
Talk(SAY_AGGRO);
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
return me->IsVisible() && target->GetEntry() != NPC_CROK_SCOURGEBANE;
}
@@ -947,7 +947,7 @@ public:
bool CheckProc(ProcEventInfo& eventInfo)
{
const SpellInfo* spellInfo = eventInfo.GetSpellInfo();
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
if (!spellInfo)
return false;
@@ -1766,7 +1766,7 @@ public:
DoMeleeAttackIfReady();
}
void SpellHitTarget(Unit* c, const SpellInfo* spell) override
void SpellHitTarget(Unit* c, SpellInfo const* spell) override
{
if (spell->Id == 71306 && c->GetTypeId() == TYPEID_UNIT) // Twisted Winds
{
@@ -2856,7 +2856,7 @@ public:
return target->GetExactDist(4357.0f, 2769.0f, 356.0f) < 170.0f;
}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (spell->Id == 71906 || spell->Id == 71942)
{
@@ -251,7 +251,7 @@ public:
SpellAreaForAreaMapBounds saBounds = sSpellMgr->GetSpellAreaForAreaMapBounds(4812);
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
if ((itr->second->raceMask & plr->getRaceMask()) && !creature->HasAura(itr->second->spellId))
if (const SpellInfo* si = sSpellMgr->GetSpellInfo(itr->second->spellId))
if (SpellInfo const* si = sSpellMgr->GetSpellInfo(itr->second->spellId))
if (si->HasAura(SPELL_AURA_MOD_INCREASE_HEALTH_PERCENT))
creature->AddAura(itr->second->spellId, creature);
}
@@ -226,7 +226,7 @@ public:
DoMeleeAttackIfReady();
}
void SpellHit(Unit* caster, const SpellInfo* spell) override
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id == RAID_MODE(SPELL_WIDOWS_EMBRACE, SPELL_MINION_WIDOWS_EMBRACE))
{
@@ -178,7 +178,7 @@ struct NotOnSameSide
public:
explicit NotOnSameSide(Unit* pSource) : m_inLiveSide(IN_LIVE_SIDE(pSource)) { }
bool operator() (const Unit* pTarget)
bool operator() (Unit const* pTarget)
{
return (m_inLiveSide != IN_LIVE_SIDE(pTarget));
}
@@ -384,7 +384,7 @@ public:
return false;
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spellInfo) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
uint8 pos = urand(0, 4);
switch (spellInfo->Id)
@@ -107,7 +107,7 @@ public:
events.ScheduleEvent(EVENT_BERSERK, RAID_MODE(720000, 540000));
}
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo) override
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == RAID_MODE(SPELL_SLIME_SPRAY_10, SPELL_SLIME_SPRAY_25) && target->GetTypeId() == TYPEID_PLAYER)
{
@@ -194,7 +194,7 @@ public:
}
}
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo) override
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_ICEBOLT_CAST)
{
@@ -310,7 +310,7 @@ public:
}
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_POWER_SPARK_MALYGOS_BUFF)
{
@@ -149,7 +149,7 @@ public:
summon->SetInCombatWithZone();
}
void SpellHit(Unit* caster, const SpellInfo* spellInfo) override
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override
{
if (spellInfo->Id >= SPELL_FIRE_MAGUS_DEATH && spellInfo->Id <= SPELL_ARCANE_MAGUS_DEATH && caster->ToCreature())
{
@@ -232,7 +232,7 @@ public:
Talk(SAY_PLAYER_KILL);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
switch( spell->Id )
{
@@ -141,7 +141,7 @@ public:
Talk(SAY_SLAY);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_DISPERSE)
Split();
@@ -246,7 +246,7 @@ public:
events.ScheduleEvent(EVENT_MOVE_TO_ANVIL, 0, 0, 2);
}
void SpellHitTarget(Unit* /*who*/, const SpellInfo* spellInfo) override
void SpellHitTarget(Unit* /*who*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_TEMPER)
{
@@ -283,7 +283,7 @@ public:
bool _fedOnTears;
bool _heraldOfTheTitans;
bool IsValidHeraldItem(const ItemTemplate* item)
bool IsValidHeraldItem(ItemTemplate const* item)
{
if (!item) // should not happen, but checked in GetAverageItemLevel()
return true;
@@ -322,7 +322,7 @@ public:
me->CastSpell(me, SPELL_ELECTRICAL_CHARGE, true);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spellInfo) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_SUPERCHARGE)
UpdatePhase();
@@ -491,7 +491,7 @@ public:
Talk(SAY_MOLGEIM_SLAY);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spellInfo) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_SUPERCHARGE)
UpdatePhase();
@@ -711,13 +711,13 @@ public:
Talk(SAY_BRUNDIR_SLAY);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spellInfo) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_SUPERCHARGE)
UpdatePhase();
}
void SpellHitTarget(Unit* /*target*/, const SpellInfo* spellInfo) override
void SpellHitTarget(Unit* /*target*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_CHAIN_LIGHTNING || spellInfo->Id == uint32(RAID_MODE(61916, 63482))) // Lightning Whirl triggered
_stunnedAchievement = false;
@@ -240,7 +240,7 @@ public:
}
void SummonedCreatureDespawn(Creature* cr) override { summons.Despawn(cr); }
void SpellHit(Unit* caster, const SpellInfo* spellInfo) override;
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override;
void JustDied(Unit*) override;
void KilledUnit(Unit* who) override;
void SpellHitTarget(Unit* target, SpellInfo const* spell) override;
@@ -608,7 +608,7 @@ void boss_flame_leviathan::boss_flame_leviathanAI::ScheduleEvents()
events.RescheduleEvent(EVENT_PURSUE, 0);
}
void boss_flame_leviathan::boss_flame_leviathanAI::SpellHit(Unit* /*caster*/, const SpellInfo* spellInfo)
void boss_flame_leviathan::boss_flame_leviathanAI::SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo)
{
if (spellInfo->Id == SPELL_SYSTEMS_SHUTDOWN)
{
@@ -1183,7 +1183,7 @@ public:
damage = 0;
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spellInfo) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
if (spellInfo->SchoolMask & SPELL_SCHOOL_MASK_FIRE && !me->HasAura(SPELL_BLAZE))
me->CastSpell(me, SPELL_BLAZE, true);
@@ -560,7 +560,7 @@ public:
}
}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (spell->Id == SPELL_NATURE_BOMB_FLIGHT)
me->SummonCreature(NPC_NATURE_BOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
@@ -200,7 +200,7 @@ public:
return 0;
}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (target && spell && target->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_VEZAX_SHADOW_CRASH_DMG)
bAchievShadowdodger = false;
@@ -314,7 +314,7 @@ public:
me->RemoveAura(SPELL_ICICLE_BOSS_AURA);
}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
switch( spell->Id )
{
@@ -552,7 +552,7 @@ public:
summons.Despawn(s);
}
bool CanAIAttack(const Unit* t) const override
bool CanAIAttack(Unit const* t) const override
{
if (t->GetTypeId() == TYPEID_PLAYER)
return !t->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER);
@@ -730,7 +730,7 @@ public:
}
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
switch( spell->Id )
{
@@ -777,7 +777,7 @@ public:
events.ScheduleEvent(EVENT_PRIEST_SMITE, 2100);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if(spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
{
@@ -829,7 +829,7 @@ public:
void MoveInLineOfSight(Unit* /*who*/) override {}
void EnterEvadeMode() override {}
bool CanAIAttack(const Unit* t) const override { return t->GetEntry() == NPC_HODIR; }
bool CanAIAttack(Unit const* t) const override { return t->GetEntry() == NPC_HODIR; }
void JustDied(Unit* /*killer*/) override
{
@@ -873,7 +873,7 @@ public:
events.ScheduleEvent(EVENT_DRUID_STARLIGHT, 10000);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if(spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
{
@@ -926,7 +926,7 @@ public:
void MoveInLineOfSight(Unit* /*who*/) override {}
void EnterEvadeMode() override {}
bool CanAIAttack(const Unit* t) const override { return t->GetEntry() == NPC_HODIR; }
bool CanAIAttack(Unit const* t) const override { return t->GetEntry() == NPC_HODIR; }
void JustDied(Unit* /*killer*/) override
{
@@ -970,7 +970,7 @@ public:
events.ScheduleEvent(EVENT_SHAMAN_STORM_CLOUD, 10000);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if(spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
{
@@ -979,7 +979,7 @@ public:
}
}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (target && spell->Id == SPELL_SHAMAN_STORM_CLOUD)
if (Aura* a = target->GetAura(SPELL_SHAMAN_STORM_CLOUD, me->GetGUID()))
@@ -1026,7 +1026,7 @@ public:
void MoveInLineOfSight(Unit* /*who*/) override {}
void EnterEvadeMode() override {}
bool CanAIAttack(const Unit* t) const override { return t->GetEntry() == NPC_HODIR; }
bool CanAIAttack(Unit const* t) const override { return t->GetEntry() == NPC_HODIR; }
void JustDied(Unit* /*killer*/) override
{
@@ -1071,7 +1071,7 @@ public:
events.ScheduleEvent(EVENT_MAGE_MELT_ICE, 1000);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if(spell->Id == SPELL_FLASH_FREEZE_TRAPPED_NPC)
{
@@ -1141,7 +1141,7 @@ public:
void MoveInLineOfSight(Unit* /*who*/) override {}
void EnterEvadeMode() override {}
bool CanAIAttack(const Unit* t) const override { return t->GetEntry() == NPC_HODIR; }
bool CanAIAttack(Unit const* t) const override { return t->GetEntry() == NPC_HODIR; }
void JustDied(Unit* /*killer*/) override
{
@@ -121,7 +121,7 @@ public:
me->CastSpell(me, 38757, true);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_ACTIVATE_CONSTRUCT)
{
@@ -325,7 +325,7 @@ public:
Unit::Kill(*itr, *itr);
}
void SpellHit(Unit* caster, const SpellInfo* spell) override
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (caster && spell->Id == SPELL_GRAB_CONTROL_2)
{
@@ -1255,7 +1255,7 @@ public:
return 0;
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if( spell->Id == SPELL_SELF_REPAIR )
{
@@ -1597,7 +1597,7 @@ public:
p->ToCreature()->DespawnOrUnsummon(8000);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if( spell->Id == SPELL_SELF_REPAIR )
{
@@ -1926,7 +1926,7 @@ public:
summons.Despawn(s);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if( spell->Id == SPELL_SELF_REPAIR )
{
@@ -1962,9 +1962,9 @@ public:
void AttackStart(Unit* /*who*/) override {}
void MoveInLineOfSight(Unit* /*who*/) override {}
bool CanAIAttack(const Unit* /*target*/) const override { return false; }
bool CanAIAttack(Unit const* /*target*/) const override { return false; }
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (target && spell && target->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_MINE_EXPLOSION)
if (InstanceScript* pInstance = me->GetInstanceScript())
@@ -2404,7 +2404,7 @@ public:
{
npc_ulduar_flames_spreadAI(Creature* pCreature) : NullCreatureAI(pCreature) {}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
switch( spell->Id )
{
@@ -2503,7 +2503,7 @@ public:
{
npc_ulduar_rocket_strike_triggerAI(Creature* pCreature) : NullCreatureAI(pCreature) {}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (!target || !spell)
return;
@@ -213,7 +213,7 @@ public:
pInstance->SetData(TYPE_RAZORSCALE, DONE);
}
void SpellHit(Unit* caster, const SpellInfo* spell) override
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (!caster || !pInstance)
return;
@@ -973,7 +973,7 @@ public:
timer2 = 6000;
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
return target && target->GetEntry() != NPC_RAZORSCALE;
}
@@ -1022,7 +1022,7 @@ public:
timer2 = 2000;
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
return target && target->GetEntry() != NPC_RAZORSCALE;
}
@@ -1078,7 +1078,7 @@ public:
timer2 = 6000;
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
return target && target->GetEntry() != NPC_RAZORSCALE;
}
@@ -622,7 +622,7 @@ public:
}
}
void SpellHit(Unit* caster, const SpellInfo* spellInfo) override
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_LIGHTNING_ORB_CHARGER)
{
@@ -633,7 +633,7 @@ public:
}
}
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo) override
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_LIGHTNING_CHARGE_DAMAGE && target->GetTypeId() == TYPEID_PLAYER)
_hitByLightning = true;
@@ -1093,7 +1093,7 @@ public:
me->SetDisableGravity(true);
}
void SpellHit(Unit*, const SpellInfo* spellInfo) override
void SpellHit(Unit*, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_CHARGE_ORB)
me->CastSpell(me, SPELL_LIGHTNING_PILLAR_P1, true);
@@ -1432,7 +1432,7 @@ public:
_checkTarget = true;
}
void SpellHit(Unit*, const SpellInfo* spellInfo) override
void SpellHit(Unit*, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_RUNIC_SMASH_LEFT || spellInfo->Id == SPELL_RUNIC_SMASH_RIGHT)
{
@@ -1645,7 +1645,7 @@ public:
}
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
return target->GetPositionX() < 2180 && target->GetPositionZ() < 425;
}
@@ -498,7 +498,7 @@ public:
me->CastSpell(pile, SPELL_ENERGY_ORB, true);
}
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo) override
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
{
// spawn not-so-random robots
if (spellInfo->Id == SPELL_ENERGY_ORB_TRIGGER && target->GetEntry() == NPC_PILE_TRIGGER)
@@ -611,7 +611,7 @@ public:
}
}
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo) override
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_SANITY)
if (Aura* aur = target->GetAura(SPELL_SANITY))
@@ -1163,7 +1163,7 @@ public:
return 0;
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spellInfo) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_IN_THE_MAWS_OF_THE_OLD_GOD)
me->AddLootMode(32);
@@ -1827,7 +1827,7 @@ public:
damage = me->GetHealth() - 1;
}
void SpellHit(Unit* caster, const SpellInfo* spellInfo) override
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_SHADOW_BEACON)
caster->GetAI()->DoAction(ACTION_YOGG_SARON_SHADOW_BEACON);
@@ -2247,7 +2247,7 @@ public:
me->CastSpell(me, SPELL_INSANE_PERIODIC, true);
}
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo) override
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_INSANE1)
{
@@ -321,7 +321,7 @@ public:
}
}
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo) override
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == 47593) // SPELL_FLAME_VISUAL trigger
target->CastSpell(target, me->GetMap()->IsHeroic() ? SPELL_FLAME_BREATH_H : SPELL_FLAME_BREATH_N, true);
@@ -196,7 +196,7 @@ public:
}
}
void SpellHitTarget(Unit*, const SpellInfo* spellInfo) override
void SpellHitTarget(Unit*, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == 59302 && pInstance) // Bane trigger
pInstance->SetData(DATA_YMIRON_ACHIEVEMENT, false);
@@ -125,7 +125,7 @@ public:
events.ScheduleEvent(EVENT_SUMMON_NEXT_MINION, 4000);
}
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo) override
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
{
// restore minions health
if (spellInfo->Id == SPELL_OVERCHARGE)
@@ -95,7 +95,7 @@ public:
events.RescheduleEvent(EVENT_SPELL_MANA_DESTRUCTION, 20000);
}
void SpellHitTarget(Unit* target, const SpellInfo* spell) override
void SpellHitTarget(Unit* target, SpellInfo const* spell) override
{
if (!target || !spell)
return;
@@ -320,7 +320,7 @@ public:
InstanceScript* pInstance;
uint32 uiRangeCheck_Timer;
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_CREATE_GLOBULE_VISUAL)
me->CastSpell(me, SPELL_WATER_GLOBULE, true);
@@ -132,7 +132,7 @@ public:
casterGuid.Clear();
}
void SpellHit(Unit* caster, const SpellInfo* spell) override
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (phase || spell->Id != SPELL_SET_CART)
return;
@@ -551,7 +551,7 @@ struct npc_beryl_sorcererAI : public CreatureAI
_events.ScheduleEvent(EVENT_FROSTBOLT, 3000, 4000);
}
void SpellHit(Unit* unit, const SpellInfo* spell) override
void SpellHit(Unit* unit, SpellInfo const* spell) override
{
if (spell->Id == SPELL_ARCANE_CHAINS && !_chainsCast)
{
@@ -774,7 +774,7 @@ public:
{
}
void SpellHit(Unit* unit, const SpellInfo* spell) override
void SpellHit(Unit* unit, SpellInfo const* spell) override
{
if (spell->Id == SPELL_NEURAL_NEEDLE && unit->GetTypeId() == TYPEID_PLAYER)
{
@@ -533,7 +533,7 @@ public:
me->SetCorpseDelay(1);
}
bool CanAIAttack(const Unit* who) const override
bool CanAIAttack(Unit const* who) const override
{
return who->GetEntry() == NPC_INJURED_7TH_LEGION_SOLDER;
}
@@ -1145,7 +1145,7 @@ public:
ScriptedAI::AttackStart(who);
}
bool CanAIAttack(const Unit* target) const override
bool CanAIAttack(Unit const* target) const override
{
if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE) || target->HasUnitState(UNIT_STATE_STUNNED) || me->GetDisplayId() == 11686)
return false;
@@ -1893,7 +1893,7 @@ public:
Talk (SAY_AGGRO, player);
}
void SpellHit(Unit* caster, const SpellInfo* spell) override
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id != SPELL_HIGH_EXECUTORS_BRANDING_IRON)
return;
@@ -354,7 +354,7 @@ public:
_gender = Data;
}
void SpellHit(Unit* Caster, const SpellInfo* Spell) override
void SpellHit(Unit* Caster, SpellInfo const* Spell) override
{
if (Spell->Id == SPELL_OUTHOUSE_GROANS)
{
@@ -534,7 +534,7 @@ public:
me->DespawnOrUnsummon(_despawnTimer);
}
void SpellHit(Unit* caster, const SpellInfo* spell) override
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id == SPELL_RENEW_SKIRMISHER && caster->GetTypeId() == TYPEID_PLAYER
&& caster->ToPlayer()->GetQuestStatus(QUEST_OVERWHELMED) == QUEST_STATUS_INCOMPLETE)
@@ -65,7 +65,7 @@ public:
}
}
void SpellHit(Unit* caster, const SpellInfo* spellInfo) override
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override
{
if (caster && spellInfo->Id == 44454)
me->GetMotionMaster()->MovePoint(0, *caster);
@@ -398,7 +398,7 @@ public:
}
}
void SpellHit(Unit* caster, const SpellInfo* spellInfo) override // for banana(51932), orange(51931), papaya(51933)
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override // for banana(51932), orange(51931), papaya(51933)
{
if (running)
{
@@ -147,7 +147,7 @@ public:
me->SetControlled(true, UNIT_STATE_STUNNED);
}
void SpellHit(Unit* caster, const SpellInfo* spellInfo) override
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_STORM_HAMMER)
{
@@ -413,7 +413,7 @@ public:
setCharm = true;
}
void SpellHit(Unit* caster, const SpellInfo* spellInfo) override
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override
{
if (!playerGUID && spellInfo->Id == SPELL_SPEAR_OF_HODIR)
{
@@ -789,7 +789,7 @@ public:
me->DespawnOrUnsummon();
}
void SpellHit(Unit* caster, const SpellInfo* spell) override
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id != SPELL_ICE_LANCE)
return;
@@ -477,14 +477,14 @@ public:
}
}
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo) override
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_THROW_PORTAL_CRYSTAL)
if (Aura* aura = target->AddAura(SPELL_ARTHAS_PORTAL, target))
aura->SetDuration(48000);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spellInfo) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override
{
if (spellInfo->Id == SPELL_TOUCH_OF_DEATH)
{
@@ -673,7 +673,7 @@ public:
me->DespawnOrUnsummon(1);
}
void SpellHit(Unit* caster, const SpellInfo* spell) override
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id == SPELL_UNLOCK_SHACKLE)
{
@@ -728,7 +728,7 @@ public:
DoCast(me, SPELL_KNEEL, true); // Little Hack for kneel - Thanks Illy :P
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
{
if (spell->Id == SPELL_FREE_RAGECLAW)
{
@@ -927,7 +927,7 @@ public:
Reset();
}
void SpellHit(Unit* caster, const SpellInfo* spell) override
void SpellHit(Unit* caster, SpellInfo const* spell) override
{
if (spell->Id != GYMERS_GRAB)
return;