aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Examples
diff options
context:
space:
mode:
authorNay <dnpd.dd@gmail.com>2013-07-06 20:21:45 +0100
committerNay <dnpd.dd@gmail.com>2013-07-06 20:21:45 +0100
commit3561ab98bae1dc111530223aaf25f58bb3267677 (patch)
tree93cd9c541564b8469f617871dd51407609f3dee7 /src/server/scripts/Examples
parent0c911af24c263c4e931c7264242c9755074d270d (diff)
Misc: Use override and final C++11 keywords in a few places (mostly scripts)
OVERRIDE and FINAL are TC macros (expand to nothing if compiler does not support C++11)
Diffstat (limited to 'src/server/scripts/Examples')
-rw-r--r--src/server/scripts/Examples/example_commandscript.cpp2
-rw-r--r--src/server/scripts/Examples/example_creature.cpp18
-rw-r--r--src/server/scripts/Examples/example_escort.cpp18
-rw-r--r--src/server/scripts/Examples/example_gossip_codebox.cpp6
-rw-r--r--src/server/scripts/Examples/example_misc.cpp6
-rw-r--r--src/server/scripts/Examples/example_spell.cpp38
6 files changed, 44 insertions, 44 deletions
diff --git a/src/server/scripts/Examples/example_commandscript.cpp b/src/server/scripts/Examples/example_commandscript.cpp
index a87b8c5a555..0c10cec5155 100644
--- a/src/server/scripts/Examples/example_commandscript.cpp
+++ b/src/server/scripts/Examples/example_commandscript.cpp
@@ -43,7 +43,7 @@ class example_commandscript : public CommandScript
return true;
}
- ChatCommand* GetCommands() const
+ ChatCommand* GetCommands() const OVERRIDE
{
static ChatCommand HelloWorldCommandTable[] =
{
diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp
index ae4980c2d75..92c248c1fc9 100644
--- a/src/server/scripts/Examples/example_creature.cpp
+++ b/src/server/scripts/Examples/example_creature.cpp
@@ -111,7 +111,7 @@ class example_creature : public CreatureScript
// *** HANDLED FUNCTION ***
//This is called after spawn and whenever the core decides we need to evade
- void Reset()
+ void Reset() OVERRIDE
{
m_uiPhase = 1; // Start in phase 1
m_uiPhaseTimer = 60000; // 60 seconds
@@ -125,7 +125,7 @@ class example_creature : public CreatureScript
// *** HANDLED FUNCTION ***
// Enter Combat called once per combat
- void EnterCombat(Unit* who)
+ void EnterCombat(Unit* who) OVERRIDE
{
//Say some stuff
Talk(SAY_AGGRO, who->GetGUID());
@@ -134,21 +134,21 @@ class example_creature : public CreatureScript
// *** HANDLED FUNCTION ***
// Attack Start is called when victim change (including at start of combat)
// By default, attack who and start movement toward the victim.
- //void AttackStart(Unit* who)
+ //void AttackStart(Unit* who) OVERRIDE
//{
// ScriptedAI::AttackStart(who);
//}
// *** HANDLED FUNCTION ***
// Called when going out of combat. Reset is called just after.
- void EnterEvadeMode()
+ void EnterEvadeMode() OVERRIDE
{
Talk(SAY_EVADE);
}
// *** HANDLED FUNCTION ***
//Our Receive emote function
- void ReceiveEmote(Player* /*player*/, uint32 uiTextEmote)
+ void ReceiveEmote(Player* /*player*/, uint32 uiTextEmote) OVERRIDE
{
me->HandleEmoteCommand(uiTextEmote);
@@ -165,7 +165,7 @@ class example_creature : public CreatureScript
// *** HANDLED FUNCTION ***
//Update AI is called Every single map update (roughly once every 50ms if a player is within the grid)
- void UpdateAI(uint32 uiDiff)
+ void UpdateAI(uint32 uiDiff) OVERRIDE
{
//Out of combat timers
if (!me->GetVictim())
@@ -262,12 +262,12 @@ class example_creature : public CreatureScript
}
};
- CreatureAI* GetAI(Creature* creature) const
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new example_creatureAI(creature);
}
- bool OnGossipHello(Player* player, Creature* creature)
+ bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->SEND_GOSSIP_MENU(907, creature->GetGUID());
@@ -275,7 +275,7 @@ class example_creature : public CreatureScript
return true;
}
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
{
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF+1)
diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp
index 5d0f2321402..8cbd2fc4933 100644
--- a/src/server/scripts/Examples/example_escort.cpp
+++ b/src/server/scripts/Examples/example_escort.cpp
@@ -79,13 +79,13 @@ class example_escort : public CreatureScript
uint32 m_uiDeathCoilTimer;
uint32 m_uiChatTimer;
- void JustSummoned(Creature* summoned)
+ void JustSummoned(Creature* summoned) OVERRIDE
{
summoned->AI()->AttackStart(me);
}
// Pure Virtual Functions (Have to be implemented)
- void WaypointReached(uint32 waypointId)
+ void WaypointReached(uint32 waypointId) OVERRIDE
{
switch (waypointId)
{
@@ -108,7 +108,7 @@ class example_escort : public CreatureScript
}
}
- void EnterCombat(Unit* /*who*/)
+ void EnterCombat(Unit* /*who*/) OVERRIDE
{
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
@@ -119,13 +119,13 @@ class example_escort : public CreatureScript
Talk(SAY_AGGRO2);
}
- void Reset()
+ void Reset() OVERRIDE
{
m_uiDeathCoilTimer = 4000;
m_uiChatTimer = 4000;
}
- void JustDied(Unit* killer)
+ void JustDied(Unit* killer) OVERRIDE
{
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
@@ -142,7 +142,7 @@ class example_escort : public CreatureScript
Talk(SAY_DEATH_3);
}
- void UpdateAI(uint32 uiDiff)
+ void UpdateAI(uint32 uiDiff) OVERRIDE
{
//Must update npc_escortAI
npc_escortAI::UpdateAI(uiDiff);
@@ -186,12 +186,12 @@ class example_escort : public CreatureScript
}
};
- CreatureAI* GetAI(Creature* creature) const
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new example_escortAI(creature);
}
- bool OnGossipHello(Player* player, Creature* creature)
+ bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
{
player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
player->PrepareGossipMenu(creature, 0);
@@ -205,7 +205,7 @@ class example_escort : public CreatureScript
return true;
}
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
{
player->PlayerTalkClass->ClearMenus();
npc_escortAI* pEscortAI = CAST_AI(example_escort::example_escortAI, creature->AI());
diff --git a/src/server/scripts/Examples/example_gossip_codebox.cpp b/src/server/scripts/Examples/example_gossip_codebox.cpp
index 432e7e74c35..90aae21f807 100644
--- a/src/server/scripts/Examples/example_gossip_codebox.cpp
+++ b/src/server/scripts/Examples/example_gossip_codebox.cpp
@@ -55,7 +55,7 @@ class example_gossip_codebox : public CreatureScript
{
}
- bool OnGossipHello(Player* player, Creature* creature)
+ bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
{
player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
@@ -65,7 +65,7 @@ class example_gossip_codebox : public CreatureScript
return true;
}
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE
{
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF+2)
@@ -78,7 +78,7 @@ class example_gossip_codebox : public CreatureScript
return true;
}
- bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, char const* code)
+ bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, char const* code) OVERRIDE
{
player->PlayerTalkClass->ClearMenus();
if (sender == GOSSIP_SENDER_MAIN)
diff --git a/src/server/scripts/Examples/example_misc.cpp b/src/server/scripts/Examples/example_misc.cpp
index 5f329e94a31..980d52c729c 100644
--- a/src/server/scripts/Examples/example_misc.cpp
+++ b/src/server/scripts/Examples/example_misc.cpp
@@ -35,7 +35,7 @@ class AT_example_areatrigger : public AreaTriggerScript
{
}
- bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/)
+ bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/) OVERRIDE
{
player->Kill(player);
return true;
@@ -51,7 +51,7 @@ class ItemUse_example_item : public ItemScript
{
}
- bool OnUse(Player* /*player*/, Item* /*item*/, SpellCastTargets const& /*targets*/)
+ bool OnUse(Player* /*player*/, Item* /*item*/, SpellCastTargets const& /*targets*/) OVERRIDE
{
sScriptMgr->LoadDatabase();
return true;
@@ -67,7 +67,7 @@ class GOHello_example_go_teleporter : public GameObjectScript
{
}
- bool OnGossipHello(Player* player, GameObject* /*go*/)
+ bool OnGossipHello(Player* player, GameObject* /*go*/) OVERRIDE
{
player->TeleportTo(0, 1807.07f, 336.105f, 70.3975f, 0.0f);
return false;
diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp
index c3a56e7a2cb..30206ec555c 100644
--- a/src/server/scripts/Examples/example_spell.cpp
+++ b/src/server/scripts/Examples/example_spell.cpp
@@ -50,7 +50,7 @@ class spell_ex_5581 : public SpellScriptLoader
// function called on server startup
// checks if script has data required for it to work
- bool Validate(SpellInfo const* /*spellEntry*/)
+ bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE
{
// check if spellid 70522 exists in dbc, we will trigger it later
if (!sSpellMgr->GetSpellInfo(SPELL_TRIGGERED))
@@ -60,7 +60,7 @@ class spell_ex_5581 : public SpellScriptLoader
// function called just after script is added to spell
// we initialize local variables if needed
- bool Load()
+ bool Load() OVERRIDE
{
localVariable = "we're using local variable";
localVariable2 = new char();
@@ -73,7 +73,7 @@ class spell_ex_5581 : public SpellScriptLoader
// function called just before script delete
// we free allocated memory
- void Unload()
+ void Unload() OVERRIDE
{
delete localVariable2;
}
@@ -159,7 +159,7 @@ class spell_ex_5581 : public SpellScriptLoader
}
// register functions used in spell script - names of these functions do not matter
- void Register()
+ void Register() OVERRIDE
{
// we're registering our functions here
BeforeCast += SpellCastFn(spell_ex_5581SpellScript::HandleBeforeCast);
@@ -192,7 +192,7 @@ class spell_ex_5581 : public SpellScriptLoader
};
// function which creates SpellScript
- SpellScript* GetSpellScript() const
+ SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_ex_5581SpellScript();
}
@@ -208,7 +208,7 @@ class spell_ex_66244 : public SpellScriptLoader
PrepareAuraScript(spell_ex_66244AuraScript);
// function called on server startup
// checks if script has data required for it to work
- bool Validate(SpellInfo const* /*spellEntry*/)
+ bool Validate(SpellInfo const* /*spellEntry*/) OVERRIDE
{
// check if spellid exists in dbc, we will trigger it later
if (!sSpellMgr->GetSpellInfo(SPELL_TRIGGERED))
@@ -218,7 +218,7 @@ class spell_ex_66244 : public SpellScriptLoader
// function called in aura constructor
// we initialize local variables if needed
- bool Load()
+ bool Load() OVERRIDE
{
// do not load script if aura is casted by player or caster not avalible
if (Unit* caster = GetCaster())
@@ -316,7 +316,7 @@ class spell_ex_66244 : public SpellScriptLoader
}
// function registering
- void Register()
+ void Register() OVERRIDE
{
OnEffectApply += AuraEffectApplyFn(spell_ex_66244AuraScript::HandleOnEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_ex_66244AuraScript::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
@@ -347,7 +347,7 @@ class spell_ex_66244 : public SpellScriptLoader
};
// function which creates AuraScript
- AuraScript* GetAuraScript() const
+ AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_ex_66244AuraScript();
}
@@ -379,7 +379,7 @@ class spell_ex_absorb_aura : public SpellScriptLoader
}
// function registering
- void Register()
+ void Register() OVERRIDE
{
OnEffectAbsorb += AuraEffectAbsorbFn(spell_ex_absorb_auraAuraScript::HandleOnEffectAbsorb, EFFECT_0);
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_ex_absorb_auraAuraScript::HandleAfterEffectAbsorb, EFFECT_0);
@@ -387,7 +387,7 @@ class spell_ex_absorb_aura : public SpellScriptLoader
};
// function which creates AuraScript
- AuraScript* GetAuraScript() const
+ AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_ex_absorb_auraAuraScript();
}
@@ -408,14 +408,14 @@ class spell_ex_463 : public SpellScriptLoader
// in our script we allow only players to be affected
return target->GetTypeId() == TYPEID_PLAYER;
}
- void Register()
+ void Register() OVERRIDE
{
DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_ex_463AuraScript::CheckAreaTarget);
}
};
// function which creates AuraScript
- AuraScript* GetAuraScript() const
+ AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_ex_463AuraScript();
}
@@ -440,18 +440,18 @@ class spell_ex : public SpellScriptLoader
{
PrepareSpellScript(spell_ex_SpellScript);
- //bool Validate(SpellInfo const* spellEntry){return true;}
+ //bool Validate(SpellInfo const* spellEntry){return true;} OVERRIDE
//bool Load(){return true;}
//void Unload(){}
//void Function(SpellEffIndex effIndex) //OnEffect += SpellEffectFn(spell_ex_SpellScript::Function, EFFECT_ANY, SPELL_EFFECT_ANY);
//void Function() //OnHit += SpellEffectFn(spell_ex_SpellScript::Function);
- void Register()
+ void Register() OVERRIDE
{
}
};
- SpellScript* GetSpellScript() const
+ SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_ex_SpellScript();
}
@@ -467,7 +467,7 @@ class spell_ex : public SpellScriptLoader
class spell_ex_AuraScript : public AuraScript
{
PrepareAuraScript(spell_ex)
- //bool Validate(SpellInfo const* spellEntry){return true;}
+ //bool Validate(SpellInfo const* spellEntry){return true;} OVERRIDE
//bool Load(){return true;}
//void Unload(){}
@@ -478,12 +478,12 @@ class spell_ex : public SpellScriptLoader
//void spell_ex_SpellScript::Function(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated) //DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_ex_SpellScript::Function, EFFECT_ANY, SPELL_AURA_ANY);
//void spell_ex_SpellScript::Function(AuraEffect const* aurEff, bool& isPeriodic, int32& amplitude) //OnEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_ex_SpellScript::Function, EFFECT_ANY, SPELL_AURA_ANY);
//void spell_ex_SpellScript::Function(AuraEffect const* aurEff, SpellModifier*& spellMod) //OnEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_ex_SpellScript::Function, EFFECT_ANY, SPELL_AURA_ANY);
- void Register()
+ void Register() OVERRIDE
{
}
};
- AuraScript* GetAuraScript() const
+ AuraScript* GetAuraScript() const OVERRIDE
{
return new spell_ex_AuraScript();
}