refactor(Core): apply clang-tidy modernize-use-override (#3817)

This commit is contained in:
Francesco Borzì
2020-12-06 18:04:55 +01:00
committed by GitHub
parent 9facd81e54
commit d4a58700d4
561 changed files with 9574 additions and 9574 deletions

View File

@@ -79,7 +79,7 @@ public:
memset(BirdGUIDs, 0, sizeof(BirdGUIDs));
}
void Reset()
void Reset() override
{
_Reset();
@@ -96,7 +96,7 @@ public:
SetWeather(WEATHER_STATE_FINE, 0.0f);
}
void EnterCombat(Unit* /*who*/)
void EnterCombat(Unit* /*who*/) override
{
events.ScheduleEvent(EVENT_STATIC_DISRUPTION, urand(10000, 20000)); // 10 to 20 seconds (bosskillers)
events.ScheduleEvent(EVENT_GUST_OF_WIND, urand(20000, 30000)); // 20 to 30 seconds(bosskillers)
@@ -112,7 +112,7 @@ public:
instance->SetData(DATA_AKILZONEVENT, IN_PROGRESS);
}
void JustDied(Unit* /*killer*/)
void JustDied(Unit* /*killer*/) override
{
Talk(SAY_DEATH);
_JustDied();
@@ -120,7 +120,7 @@ public:
instance->SetData(DATA_AKILZONEVENT, DONE);
}
void KilledUnit(Unit* who)
void KilledUnit(Unit* who) override
{
if (who->GetTypeId() == TYPEID_PLAYER)
Talk(SAY_KILL);
@@ -209,7 +209,7 @@ public:
events.ScheduleEvent(EVENT_STORM_SEQUENCE, 1000);
}
void UpdateAI(uint32 diff)
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
@@ -361,7 +361,7 @@ public:
bool isRaining;
};
CreatureAI* GetAI(Creature* creature) const
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<boss_akilzonAI>(creature);
}
@@ -380,7 +380,7 @@ public:
bool arrived;
uint64 TargetGUID;
void Reset()
void Reset() override
{
EagleSwoop_Timer = urand(5000, 10000);
arrived = true;
@@ -388,15 +388,15 @@ public:
me->SetDisableGravity(true);
}
void EnterCombat(Unit* /*who*/)
void EnterCombat(Unit* /*who*/) override
{
DoZoneInCombat();
}
void MoveInLineOfSight(Unit* /*who*/) { }
void MoveInLineOfSight(Unit* /*who*/) override { }
void MovementInform(uint32, uint32)
void MovementInform(uint32, uint32) override
{
arrived = true;
if (TargetGUID)
@@ -409,7 +409,7 @@ public:
}
}
void UpdateAI(uint32 diff)
void UpdateAI(uint32 diff) override
{
if (EagleSwoop_Timer <= diff)
EagleSwoop_Timer = 0;
@@ -443,7 +443,7 @@ public:
}
};
CreatureAI* GetAI(Creature* creature) const
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_akilzon_eagleAI(creature);
}

View File

@@ -79,7 +79,7 @@ public:
uint64 LynxGUID;
void Reset()
void Reset() override
{
instance->SetData(DATA_HALAZZIEVENT, NOT_STARTED);
summons.DespawnAll();
@@ -95,14 +95,14 @@ public:
EnterPhase(PHASE_LYNX);
}
void EnterCombat(Unit* /*who*/)
void EnterCombat(Unit* /*who*/) override
{
instance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS);
Talk(SAY_AGGRO);
EnterPhase(PHASE_LYNX);
}
void JustSummoned(Creature* summon)
void JustSummoned(Creature* summon) override
{
summon->AI()->AttackStart(me->GetVictim());
if (summon->GetEntry() == NPC_SPIRIT_LYNX)
@@ -110,19 +110,19 @@ public:
summons.Summon(summon);
}
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if (damage >= me->GetHealth() && Phase != PHASE_ENRAGE)
damage = 0;
}
void SpellHit(Unit*, const SpellInfo* spell)
void SpellHit(Unit*, const SpellInfo* spell) override
{
if (spell->Id == SPELL_TRANSFORM_SPLIT2)
EnterPhase(PHASE_HUMAN);
}
void AttackStart(Unit* who)
void AttackStart(Unit* who) override
{
if (Phase != PHASE_MERGE)
ScriptedAI::AttackStart(who);
@@ -179,7 +179,7 @@ public:
Phase = NextPhase;
}
void UpdateAI(uint32 diff)
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
@@ -288,7 +288,7 @@ public:
DoMeleeAttackIfReady();
}
void KilledUnit(Unit* victim)
void KilledUnit(Unit* victim) override
{
if (victim->GetTypeId() != TYPEID_PLAYER)
return;
@@ -296,14 +296,14 @@ public:
Talk(SAY_KILL);
}
void JustDied(Unit* /*killer*/)
void JustDied(Unit* /*killer*/) override
{
instance->SetData(DATA_HALAZZIEVENT, DONE);
Talk(SAY_DEATH);
}
};
CreatureAI* GetAI(Creature* creature) const
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<boss_halazziAI>(creature);
}
@@ -322,27 +322,27 @@ public:
uint32 FrenzyTimer;
uint32 shredder_timer;
void Reset()
void Reset() override
{
FrenzyTimer = urand(30000, 50000); //frenzy every 30-50 seconds
shredder_timer = 4000;
}
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
{
if (damage >= me->GetHealth())
damage = 0;
}
void AttackStart(Unit* who)
void AttackStart(Unit* who) override
{
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
ScriptedAI::AttackStart(who);
}
void EnterCombat(Unit* /*who*/) {/*DoZoneInCombat();*/ }
void EnterCombat(Unit* /*who*/) override {/*DoZoneInCombat();*/ }
void UpdateAI(uint32 diff)
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
@@ -366,7 +366,7 @@ public:
};
CreatureAI* GetAI(Creature* creature) const
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_halazzi_lynxAI(creature);
}

View File

@@ -129,7 +129,7 @@ public:
uint64 FireBombGUIDs[40];
void Reset()
void Reset() override
{
instance->SetData(DATA_JANALAIEVENT, NOT_STARTED);
@@ -152,19 +152,19 @@ public:
HatchAllEggs(1);
}
void JustDied(Unit* /*killer*/)
void JustDied(Unit* /*killer*/) override
{
Talk(SAY_DEATH);
instance->SetData(DATA_JANALAIEVENT, DONE);
}
void KilledUnit(Unit* /*victim*/)
void KilledUnit(Unit* /*victim*/) override
{
Talk(SAY_SLAY);
}
void EnterCombat(Unit* /*who*/)
void EnterCombat(Unit* /*who*/) override
{
instance->SetData(DATA_JANALAIEVENT, IN_PROGRESS);
@@ -172,7 +172,7 @@ public:
// DoZoneInCombat();
}
void DamageDealt(Unit* target, uint32& damage, DamageEffectType /*damagetype*/)
void DamageDealt(Unit* target, uint32& damage, DamageEffectType /*damagetype*/) override
{
if (isFlameBreathing)
{
@@ -306,7 +306,7 @@ public:
}
}
void UpdateAI(uint32 diff)
void UpdateAI(uint32 diff) override
{
if (isFlameBreathing)
{
@@ -429,13 +429,13 @@ public:
else FireBreathTimer -= diff;
}
bool CheckEvadeIfOutOfCombatArea() const
bool CheckEvadeIfOutOfCombatArea() const override
{
return me->GetPositionZ() <= 12.0f;
}
};
CreatureAI* GetAI(Creature* creature) const
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<boss_janalaiAI>(creature);
}
@@ -454,25 +454,25 @@ public:
{
npc_janalai_firebombAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() { }
void Reset() override { }
void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
{
if (spell->Id == SPELL_FIRE_BOMB_THROW)
DoCast(me, SPELL_FIRE_BOMB_DUMMY, true);
}
void EnterCombat(Unit* /*who*/) { }
void EnterCombat(Unit* /*who*/) override { }
void AttackStart(Unit* /*who*/) { }
void AttackStart(Unit* /*who*/) override { }
void MoveInLineOfSight(Unit* /*who*/) { }
void MoveInLineOfSight(Unit* /*who*/) override { }
void UpdateAI(uint32 /*diff*/) { }
void UpdateAI(uint32 /*diff*/) override { }
};
CreatureAI* GetAI(Creature* creature) const
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_janalai_firebombAI(creature);
}
@@ -504,7 +504,7 @@ public:
bool hasChangedSide;
bool isHatching;
void Reset()
void Reset() override
{
me->SetWalk(true);
side = (me->GetPositionY() < 1150);
@@ -546,11 +546,11 @@ public:
return num == 0; // if num == 0, no more templist
}
void EnterCombat(Unit* /*who*/) { }
void AttackStart(Unit* /*who*/) { }
void MoveInLineOfSight(Unit* /*who*/) { }
void EnterCombat(Unit* /*who*/) override { }
void AttackStart(Unit* /*who*/) override { }
void MoveInLineOfSight(Unit* /*who*/) override { }
void MovementInform(uint32, uint32)
void MovementInform(uint32, uint32) override
{
if (waypoint == 5)
{
@@ -562,7 +562,7 @@ public:
WaitTimer = 1;
}
void UpdateAI(uint32 diff)
void UpdateAI(uint32 diff) override
{
if (!instance || !(instance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS))
{
@@ -606,7 +606,7 @@ public:
}
};
CreatureAI* GetAI(Creature* creature) const
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<npc_janalai_hatcherAI>(creature);
}
@@ -631,7 +631,7 @@ public:
InstanceScript* instance;
uint32 BuffetTimer;
void Reset()
void Reset() override
{
BuffetTimer = 7000;
if (me->GetPositionY() > 1150)
@@ -642,9 +642,9 @@ public:
me->SetDisableGravity(true);
}
void EnterCombat(Unit* /*who*/) {/*DoZoneInCombat();*/ }
void EnterCombat(Unit* /*who*/) override {/*DoZoneInCombat();*/ }
void UpdateAI(uint32 diff)
void UpdateAI(uint32 diff) override
{
if (!instance || !(instance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS))
{
@@ -666,7 +666,7 @@ public:
}
};
CreatureAI* GetAI(Creature* creature) const
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<npc_janalai_hatchlingAI>(creature);
}
@@ -677,7 +677,7 @@ class npc_janalai_egg : public CreatureScript
public:
npc_janalai_egg(): CreatureScript("npc_janalai_egg") { }
CreatureAI* GetAI(Creature* creature) const
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_janalai_eggAI(creature);
}
@@ -686,11 +686,11 @@ public:
{
npc_janalai_eggAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() { }
void Reset() override { }
void UpdateAI(uint32 /*diff*/) { }
void UpdateAI(uint32 /*diff*/) override { }
void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
void SpellHit(Unit* /*caster*/, const SpellInfo* spell) override
{
if (spell->Id == SPELL_HATCH_EGG)
{

View File

@@ -155,7 +155,7 @@ public:
SummonList Summons;
void Reset()
void Reset() override
{
instance->SetData(DATA_ZULJINEVENT, NOT_STARTED);
@@ -191,7 +191,7 @@ public:
//me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE);
}
void EnterCombat(Unit* /*who*/)
void EnterCombat(Unit* /*who*/) override
{
instance->SetData(DATA_ZULJINEVENT, IN_PROGRESS);
@@ -202,7 +202,7 @@ public:
EnterPhase(0);
}
void KilledUnit(Unit* /*victim*/)
void KilledUnit(Unit* /*victim*/) override
{
if (Intro_Timer)
return;
@@ -210,7 +210,7 @@ public:
Talk(YELL_KILL);
}
void JustDied(Unit* /*killer*/)
void JustDied(Unit* /*killer*/) override
{
instance->SetData(DATA_ZULJINEVENT, DONE);
@@ -221,7 +221,7 @@ public:
Temp->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD);
}
void AttackStart(Unit* who)
void AttackStart(Unit* who) override
{
if (Phase == 2)
AttackStartNoMove(who);
@@ -283,12 +283,12 @@ public:
}
}
void JustSummoned(Creature* summon)
void JustSummoned(Creature* summon) override
{
Summons.Summon(summon);
}
void SummonedCreatureDespawn(Creature* summon)
void SummonedCreatureDespawn(Creature* summon) override
{
Summons.Despawn(summon);
}
@@ -349,7 +349,7 @@ public:
Phase = NextPhase;
}
void UpdateAI(uint32 diff)
void UpdateAI(uint32 diff) override
{
if (!TankGUID)
{
@@ -551,7 +551,7 @@ public:
}
};
CreatureAI* GetAI(Creature* creature) const
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<boss_zuljinAI>(creature);
}
@@ -570,17 +570,17 @@ public:
{
npc_zuljin_vortexAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() { }
void Reset() override { }
void EnterCombat(Unit* /*target*/) { }
void EnterCombat(Unit* /*target*/) override { }
void SpellHit(Unit* caster, const SpellInfo* spell)
void SpellHit(Unit* caster, const SpellInfo* spell) override
{
if (spell->Id == SPELL_ZAP_INFORM)
DoCast(caster, SPELL_ZAP_DAMAGE, true);
}
void UpdateAI(uint32 /*diff*/)
void UpdateAI(uint32 /*diff*/) override
{
//if the vortex reach the target, it change his target to another player
if (me->IsWithinMeleeRange(me->GetVictim()))
@@ -588,7 +588,7 @@ public:
}
};
CreatureAI* GetAI(Creature* creature) const
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_zuljin_vortexAI(creature);
}

View File

@@ -78,7 +78,7 @@ public:
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint32 RandVendor[RAND_VENDOR];
void Initialize()
void Initialize() override
{
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
@@ -107,7 +107,7 @@ public:
m_auiEncounter[DATA_GONGEVENT] = NOT_STARTED;
}
bool IsEncounterInProgress() const
bool IsEncounterInProgress() const override
{
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
@@ -116,13 +116,13 @@ public:
return false;
}
void OnPlayerEnter(Player* /*player*/)
void OnPlayerEnter(Player* /*player*/) override
{
if (!HarrisonJonesGUID)
instance->SummonCreature(NPC_HARRISON_JONES, HarrisonJonesLoc);
}
void OnCreatureCreate(Creature* creature)
void OnCreatureCreate(Creature* creature) override
{
switch (creature->GetEntry())
{
@@ -139,7 +139,7 @@ public:
}
}
void OnGameObjectCreate(GameObject* go)
void OnGameObjectCreate(GameObject* go) override
{
switch (go->GetEntry())
{
@@ -212,7 +212,7 @@ public:
HandleGameObject(ZulJinGateGUID, true);
}
std::string GetSaveData()
std::string GetSaveData() override
{
OUT_SAVE_INST_DATA;
@@ -223,7 +223,7 @@ public:
return ss.str();
}
void Load(const char* load)
void Load(const char* load) override
{
if (!load)
return;
@@ -243,7 +243,7 @@ public:
else sLog->outError("Zul'aman: corrupted save data.");
}
void SetData(uint32 type, uint32 data)
void SetData(uint32 type, uint32 data) override
{
switch (type)
{
@@ -331,7 +331,7 @@ public:
}
}
uint32 GetData(uint32 type) const
uint32 GetData(uint32 type) const override
{
switch (type)
{
@@ -360,7 +360,7 @@ public:
}
}
void Update(uint32 diff)
void Update(uint32 diff) override
{
if (QuestMinute)
{
@@ -380,7 +380,7 @@ public:
}
}
uint64 GetData64(uint32 type) const
uint64 GetData64(uint32 type) const override
{
switch (type)
{
@@ -395,7 +395,7 @@ public:
};
InstanceScript* GetInstanceScript(InstanceMap* map) const
InstanceScript* GetInstanceScript(InstanceMap* map) const override
{
return new instance_zulaman_InstanceMapScript(map);
}

View File

@@ -602,16 +602,16 @@ public:
uint32 _gongTimer;
uint64 uiTargetGUID;
void Reset()
void Reset() override
{
_gongEvent = 0;
_gongTimer = 0;
uiTargetGUID = 0;
}
void EnterCombat(Unit* /*who*/) { }
void EnterCombat(Unit* /*who*/) override { }
void sGossipSelect(Player* player, uint32 sender, uint32 action)
void sGossipSelect(Player* player, uint32 sender, uint32 action) override
{
if (me->GetCreatureTemplate()->GossipMenuId == sender && !action)
{
@@ -624,7 +624,7 @@ public:
}
}
void SpellHit(Unit*, const SpellInfo* spell)
void SpellHit(Unit*, const SpellInfo* spell) override
{
if (spell->Id == SPELL_COSMETIC_SPEAR_THROW)
{
@@ -638,7 +638,7 @@ public:
}
}
void UpdateAI(uint32 diff)
void UpdateAI(uint32 diff) override
{
if (_gongEvent)
{
@@ -768,7 +768,7 @@ public:
}
};
CreatureAI* GetAI(Creature* creature) const
CreatureAI* GetAI(Creature* creature) const override
{
return GetInstanceAI<npc_harrison_jonesAI>(creature);
}
@@ -789,13 +789,13 @@ public:
GetHitGObj()->SendCustomAnim(0);
}
void Register()
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_banging_the_gong_SpellScript::Activate, EFFECT_1, SPELL_EFFECT_ACTIVATE_OBJECT);
}
};
SpellScript* GetSpellScript() const
SpellScript* GetSpellScript() const override
{
return new spell_banging_the_gong_SpellScript();
}