diff options
| author | Nay <dnpd.dd@gmail.com> | 2013-07-14 16:10:20 +0100 |
|---|---|---|
| committer | Nay <dnpd.dd@gmail.com> | 2013-07-14 16:10:20 +0100 |
| commit | b56b282eeeba5e21bc256c2ce2ff27edef5f08d9 (patch) | |
| tree | 4cddec28bf8323dce18e451bf038c2bba6071c6b /src/server/scripts/Examples | |
| parent | f8ba2c066bc3dacafa98556aeabbfab04fc5f583 (diff) | |
| parent | bedb2e56e2ca35ad6790c2ef2c736a88b8f1fb16 (diff) | |
Merge remote-tracking branch 'origin/master' into 4.3.4
Conflicts:
src/server/game/Entities/Creature/GossipDef.cpp
src/server/game/Entities/Player/Player.cpp
src/server/game/Entities/Player/Player.h
src/server/game/Handlers/QuestHandler.cpp
src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
src/server/scripts/EasternKingdoms/ZulAman/boss_halazzi.cpp
src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
src/server/scripts/EasternKingdoms/ZulAman/boss_janalai.cpp
src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp
src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_grilek.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_hakkar.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_jeklik.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_jindo.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_kilnara.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_mandokir.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_venoxis.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp
src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp
src/server/scripts/EasternKingdoms/boss_kruul.cpp
src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp
src/server/scripts/EasternKingdoms/zone_ghostlands.cpp
src/server/scripts/EasternKingdoms/zone_hinterlands.cpp
src/server/scripts/EasternKingdoms/zone_ironforge.cpp
src/server/scripts/EasternKingdoms/zone_loch_modan.cpp
src/server/scripts/EasternKingdoms/zone_redridge_mountains.cpp
src/server/scripts/EasternKingdoms/zone_silverpine_forest.cpp
src/server/scripts/EasternKingdoms/zone_stormwind_city.cpp
src/server/scripts/EasternKingdoms/zone_swamp_of_sorrows.cpp
src/server/scripts/EasternKingdoms/zone_tirisfal_glades.cpp
src/server/scripts/Kalimdor/zone_azshara.cpp
src/server/scripts/Kalimdor/zone_darkshore.cpp
src/server/scripts/Kalimdor/zone_desolace.cpp
src/server/scripts/Kalimdor/zone_durotar.cpp
src/server/scripts/Kalimdor/zone_felwood.cpp
src/server/scripts/Kalimdor/zone_feralas.cpp
src/server/scripts/Kalimdor/zone_mulgore.cpp
src/server/scripts/Kalimdor/zone_orgrimmar.cpp
src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp
src/server/scripts/Kalimdor/zone_tanaris.cpp
src/server/scripts/Kalimdor/zone_thousand_needles.cpp
src/server/scripts/Kalimdor/zone_thunder_bluff.cpp
src/server/scripts/Kalimdor/zone_ungoro_crater.cpp
src/server/scripts/Northrend/zone_dalaran.cpp
src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
src/server/scripts/Spells/spell_druid.cpp
src/server/scripts/Spells/spell_generic.cpp
src/server/scripts/Spells/spell_mage.cpp
src/server/scripts/Spells/spell_paladin.cpp
src/server/scripts/Spells/spell_priest.cpp
src/server/scripts/Spells/spell_shaman.cpp
src/server/scripts/Spells/spell_warlock.cpp
src/server/scripts/Spells/spell_warrior.cpp
src/server/scripts/World/item_scripts.cpp
Diffstat (limited to 'src/server/scripts/Examples')
| -rw-r--r-- | src/server/scripts/Examples/example_commandscript.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Examples/example_creature.cpp | 20 | ||||
| -rw-r--r-- | src/server/scripts/Examples/example_escort.cpp | 38 | ||||
| -rw-r--r-- | src/server/scripts/Examples/example_gossip_codebox.cpp | 19 | ||||
| -rw-r--r-- | src/server/scripts/Examples/example_misc.cpp | 6 | ||||
| -rw-r--r-- | src/server/scripts/Examples/example_spell.cpp | 38 |
6 files changed, 66 insertions, 57 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 78c66750c5c..92c248c1fc9 100644 --- a/src/server/scripts/Examples/example_creature.cpp +++ b/src/server/scripts/Examples/example_creature.cpp @@ -72,7 +72,7 @@ enum Spells SPELL_BERSERK = 32965, }; -enum eEnums +enum Factions { // any other constants FACTION_WORGEN = 24 @@ -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 f4cb5c24e18..8cbd2fc4933 100644 --- a/src/server/scripts/Examples/example_escort.cpp +++ b/src/server/scripts/Examples/example_escort.cpp @@ -30,14 +30,8 @@ EndScriptData */ #include "Player.h" #include "CreatureTextMgr.h" -enum eEnums +enum Yells { - NPC_FELBOAR = 21878, - - SPELL_DEATH_COIL = 33130, - SPELL_ELIXIR_OF_FORTITUDE = 3593, - SPELL_BLUE_FIREWORK = 11540, - SAY_AGGRO1 = 0, SAY_AGGRO2 = 1, SAY_WP_1 = 2, @@ -52,6 +46,18 @@ enum eEnums SAY_RAND_2 = 11 }; +enum Spells +{ + SPELL_DEATH_COIL = 33130, + SPELL_ELIXIR_OF_FORTITUDE = 3593, + SPELL_BLUE_FIREWORK = 11540 +}; + +enum Creatures +{ + NPC_FELBOAR = 21878 +}; + #define GOSSIP_ITEM_1 "Click to Test Escort(Attack, Run)" #define GOSSIP_ITEM_2 "Click to Test Escort(NoAttack, Walk)" #define GOSSIP_ITEM_3 "Click to Test Escort(NoAttack, Run)" @@ -73,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) { @@ -102,7 +108,7 @@ class example_escort : public CreatureScript } } - void EnterCombat(Unit* /*who*/) + void EnterCombat(Unit* /*who*/) OVERRIDE { if (HasEscortState(STATE_ESCORT_ESCORTING)) { @@ -113,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)) { @@ -136,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); @@ -180,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); @@ -199,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 1cfc1ef23ae..90aae21f807 100644 --- a/src/server/scripts/Examples/example_gossip_codebox.cpp +++ b/src/server/scripts/Examples/example_gossip_codebox.cpp @@ -29,17 +29,20 @@ EndScriptData */ #include "Player.h" #include <cstring> -enum eEnums +enum Yells { - SPELL_POLYMORPH = 12826, - SPELL_MARK_OF_THE_WILD = 26990, - - //These texts must be added to the creature texts of the npc for which the script is assigned. + // These texts must be added to the creature texts of the npc for which the script is assigned. SAY_NOT_INTERESTED = 0, // "Normal select, guess you're not interested." SAY_WRONG = 1, // "Wrong!" SAY_CORRECT = 2 // "You're right, you are allowed to see my inner secrets." }; +enum Spells +{ + SPELL_POLYMORPH = 12826, + SPELL_MARK_OF_THE_WILD = 26990 +}; + #define GOSSIP_ITEM_1 "A quiz: what's your name?" #define GOSSIP_ITEM_2 "I'm not interested" @@ -52,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); @@ -62,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) @@ -75,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(); } |
