diff options
author | Malcrom <malcromdev@gmail.com> | 2013-12-24 00:56:15 -0330 |
---|---|---|
committer | Malcrom <malcromdev@gmail.com> | 2013-12-24 00:56:15 -0330 |
commit | 8f4011cf6e0aad2af07b47b39a3672583acba2ad (patch) | |
tree | 20a8593159ef1b04ba0aef65dbccb6eff5a8adc6 | |
parent | fd6167cf66d3acf56f11bdcfac0d395e33c9a242 (diff) |
Scripting/Zones: Some cleanup.
-rw-r--r-- | src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp | 61 | ||||
-rw-r--r-- | src/server/scripts/EasternKingdoms/zone_duskwood.cpp | 132 | ||||
-rw-r--r-- | src/server/scripts/Kalimdor/zone_darkshore.cpp | 161 | ||||
-rw-r--r-- | src/server/scripts/Kalimdor/zone_desolace.cpp | 91 | ||||
-rw-r--r-- | src/server/scripts/Kalimdor/zone_durotar.cpp | 6 | ||||
-rw-r--r-- | src/server/scripts/Northrend/zone_crystalsong_forest.cpp | 16 | ||||
-rw-r--r-- | src/server/scripts/Northrend/zone_dalaran.cpp | 16 |
7 files changed, 249 insertions, 234 deletions
diff --git a/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp index 5a61663a0bb..c5e0c5a1391 100644 --- a/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp +++ b/src/server/scripts/EasternKingdoms/zone_burning_steppes.cpp @@ -49,11 +49,43 @@ EndContentData */ #define GOSSIP_SELECT10 "Ahh... Ironfoe" #define GOSSIP_SELECT11 "Thanks, Ragged John. Your story was very uplifting and informative" +enum RaggedJohn +{ + QUEST_THE_TRUE_MASTERS = 4224, + QUEST_MOTHERS_MILK = 4866, + SPELL_MOTHERS_MILK = 16468, + SPELL_WICKED_MILKING = 16472 +}; + class npc_ragged_john : public CreatureScript { public: npc_ragged_john() : CreatureScript("npc_ragged_john") { } + struct npc_ragged_johnAI : public ScriptedAI + { + npc_ragged_johnAI(Creature* creature) : ScriptedAI(creature) { } + + void Reset() OVERRIDE { } + + void MoveInLineOfSight(Unit* who) OVERRIDE + { + if (who->HasAura(SPELL_MOTHERS_MILK)) + { + if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(me)) + { + DoCast(who, SPELL_WICKED_MILKING); + if (Player* player = who->ToPlayer()) + player->AreaExploredOrEventHappens(QUEST_MOTHERS_MILK); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit* /*who*/) OVERRIDE { } + }; + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE { player->PlayerTalkClass->ClearMenus(); @@ -105,7 +137,7 @@ public: break; case GOSSIP_ACTION_INFO_DEF+11: player->CLOSE_GOSSIP_MENU(); - player->AreaExploredOrEventHappens(4224); + player->AreaExploredOrEventHappens(QUEST_THE_TRUE_MASTERS); break; } return true; @@ -116,7 +148,7 @@ public: if (creature->IsQuestGiver()) player->PrepareQuestMenu(creature->GetGUID()); - if (player->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE) + if (player->GetQuestStatus(QUEST_THE_TRUE_MASTERS) == QUEST_STATUS_INCOMPLETE) player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); player->SEND_GOSSIP_MENU(2713, creature->GetGUID()); @@ -127,31 +159,6 @@ public: { return new npc_ragged_johnAI(creature); } - - struct npc_ragged_johnAI : public ScriptedAI - { - npc_ragged_johnAI(Creature* creature) : ScriptedAI(creature) { } - - void Reset() OVERRIDE { } - - void MoveInLineOfSight(Unit* who) OVERRIDE - - { - if (who->HasAura(16468)) - { - if (who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(me)) - { - DoCast(who, 16472); - if (Player* player = who->ToPlayer()) - player->AreaExploredOrEventHappens(4866); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit* /*who*/) OVERRIDE { } - }; }; void AddSC_burning_steppes() diff --git a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp index a7fa73fa4a5..7c9e33c98b7 100644 --- a/src/server/scripts/EasternKingdoms/zone_duskwood.cpp +++ b/src/server/scripts/EasternKingdoms/zone_duskwood.cpp @@ -27,81 +27,45 @@ EndScriptData */ #include "ScriptedCreature.h" #include "Player.h" -enum Yells -{ - YELL_TWILIGHTCORRUPTOR_RESPAWN = 0, - YELL_TWILIGHTCORRUPTOR_AGGRO = 1, - YELL_TWILIGHTCORRUPTOR_KILL = 2, -}; - - -/*###### -# at_twilight_grove -######*/ - -class at_twilight_grove : public AreaTriggerScript +enum TwilightCorrupter { -public: - at_twilight_grove() : AreaTriggerScript("at_twilight_grove") { } + ITEM_FRAGMENT = 21149, + NPC_TWILIGHT_CORRUPTER = 15625, + YELL_TWILIGHTCORRUPTOR_RESPAWN = 0, + YELL_TWILIGHTCORRUPTOR_AGGRO = 1, + YELL_TWILIGHTCORRUPTOR_KILL = 2, + SPELL_SOUL_CORRUPTION = 25805, + SPELL_CREATURE_OF_NIGHTMARE = 25806, + SPELL_LEVEL_UP = 24312, - bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) OVERRIDE - { - if (player->HasQuestForItem(21149)) - { - if (Unit* TCorrupter = player->SummonCreature(15625, -10328.16f, -489.57f, 49.95f, 0, TEMPSUMMON_MANUAL_DESPAWN, 60000)) - { - TCorrupter->setFaction(14); - TCorrupter->SetMaxHealth(832750); - } - if (Creature* CorrupterSpeaker = player->SummonCreature(1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()-1, 0, TEMPSUMMON_TIMED_DESPAWN, 15000)) - { - CorrupterSpeaker->SetName("Twilight Corrupter"); - CorrupterSpeaker->SetVisible(true); - CorrupterSpeaker->AI()->Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, player); - } - } - return false; - }; + EVENT_SOUL_CORRUPTION = 1, + EVENT_CREATURE_OF_NIGHTMARE = 2, + FACTION_HOSTILE = 14 }; /*###### # boss_twilight_corrupter ######*/ -enum TwilightCorrupter -{ - SPELL_SOUL_CORRUPTION = 25805, - SPELL_CREATURE_OF_NIGHTMARE = 25806, - SPELL_LEVEL_UP = 24312 -}; - class boss_twilight_corrupter : public CreatureScript { public: boss_twilight_corrupter() : CreatureScript("boss_twilight_corrupter") { } - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new boss_twilight_corrupterAI(creature); - } - struct boss_twilight_corrupterAI : public ScriptedAI { boss_twilight_corrupterAI(Creature* creature) : ScriptedAI(creature) { } - uint32 SoulCorruption_Timer; - uint32 CreatureOfNightmare_Timer; - uint8 KillCount; - void Reset() OVERRIDE { - SoulCorruption_Timer = 15000; - CreatureOfNightmare_Timer = 30000; - KillCount = 0; + KillCount = 0; } + void EnterCombat(Unit* /*who*/) OVERRIDE { Talk(YELL_TWILIGHTCORRUPTOR_AGGRO); + _events.ScheduleEvent(EVENT_SOUL_CORRUPTION, 15000); + _events.ScheduleEvent(EVENT_CREATURE_OF_NIGHTMARE, 30000); } void KilledUnit(Unit* victim) OVERRIDE @@ -123,19 +87,63 @@ public: { if (!UpdateVictim()) return; - if (SoulCorruption_Timer <= diff) - { - DoCastVictim(SPELL_SOUL_CORRUPTION); - SoulCorruption_Timer = rand()%4000+15000; //gotta confirm Timers - } else SoulCorruption_Timer-=diff; - if (CreatureOfNightmare_Timer <= diff) + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) { - DoCastVictim(SPELL_CREATURE_OF_NIGHTMARE); - CreatureOfNightmare_Timer = 45000; //gotta confirm Timers - } else CreatureOfNightmare_Timer-=diff; + switch (eventId) + { + case EVENT_SOUL_CORRUPTION: + DoCastVictim(SPELL_SOUL_CORRUPTION); + _events.ScheduleEvent(EVENT_SOUL_CORRUPTION, rand()%4000+15000); + break; + case EVENT_CREATURE_OF_NIGHTMARE: + DoCastVictim(SPELL_CREATURE_OF_NIGHTMARE); + _events.ScheduleEvent(EVENT_CREATURE_OF_NIGHTMARE, 45000); + break; + default: + break; + } + } DoMeleeAttackIfReady(); - }; + } + + private: + EventMap _events; + uint8 KillCount; + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new boss_twilight_corrupterAI(creature); + } +}; + +/*###### +# at_twilight_grove +######*/ + +class at_twilight_grove : public AreaTriggerScript +{ +public: + at_twilight_grove() : AreaTriggerScript("at_twilight_grove") { } + + bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) OVERRIDE + { + if (player->HasQuestForItem(ITEM_FRAGMENT)) + { + if (Unit* corrupter = player->SummonCreature(NPC_TWILIGHT_CORRUPTER, -10328.16f, -489.57f, 49.95f, 0, TEMPSUMMON_MANUAL_DESPAWN, 60000)) + corrupter->setFaction(FACTION_HOSTILE); + + if (Creature* CorrupterSpeaker = player->SummonCreature(1, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()-1, 0, TEMPSUMMON_TIMED_DESPAWN, 15000)) + { + CorrupterSpeaker->SetName("Twilight Corrupter"); + CorrupterSpeaker->SetVisible(true); + CorrupterSpeaker->AI()->Talk(YELL_TWILIGHTCORRUPTOR_RESPAWN, player); + } + } + return false; }; }; diff --git a/src/server/scripts/Kalimdor/zone_darkshore.cpp b/src/server/scripts/Kalimdor/zone_darkshore.cpp index b9b436002b8..5bb1a937035 100644 --- a/src/server/scripts/Kalimdor/zone_darkshore.cpp +++ b/src/server/scripts/Kalimdor/zone_darkshore.cpp @@ -63,26 +63,6 @@ class npc_kerlonian : public CreatureScript public: npc_kerlonian() : CreatureScript("npc_kerlonian") { } - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) OVERRIDE - { - if (quest->GetQuestId() == QUEST_SLEEPER_AWAKENED) - { - if (npc_kerlonianAI* pKerlonianAI = CAST_AI(npc_kerlonian::npc_kerlonianAI, creature->AI())) - { - creature->SetStandState(UNIT_STAND_STATE_STAND); - creature->AI()->Talk(SAY_KER_START, player); - pKerlonianAI->StartFollow(player, FACTION_KER_ESCORTEE, quest); - } - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_kerlonianAI(creature); - } - struct npc_kerlonianAI : public FollowerAI { npc_kerlonianAI(Creature* creature) : FollowerAI(creature) { } @@ -144,7 +124,7 @@ public: SetFollowPaused(false); } - void UpdateFollowerAI(uint32 Diff) OVERRIDE + void UpdateFollowerAI(uint32 diff) OVERRIDE { if (!UpdateVictim()) { @@ -153,13 +133,13 @@ public: if (!HasFollowState(STATE_FOLLOW_PAUSED)) { - if (FallAsleepTimer <= Diff) + if (FallAsleepTimer <= diff) { SetSleeping(); FallAsleepTimer = urand(25000, 90000); } else - FallAsleepTimer -= Diff; + FallAsleepTimer -= diff; } return; @@ -169,6 +149,25 @@ public: } }; + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) OVERRIDE + { + if (quest->GetQuestId() == QUEST_SLEEPER_AWAKENED) + { + if (npc_kerlonianAI* pKerlonianAI = CAST_AI(npc_kerlonian::npc_kerlonianAI, creature->AI())) + { + creature->SetStandState(UNIT_STAND_STATE_STAND); + creature->AI()->Talk(SAY_KER_START, player); + pKerlonianAI->StartFollow(player, FACTION_KER_ESCORTEE, quest); + } + } + + return true; + } + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_kerlonianAI(creature); + } }; /*#### @@ -203,27 +202,23 @@ class npc_prospector_remtravel : public CreatureScript public: npc_prospector_remtravel() : CreatureScript("npc_prospector_remtravel") { } - bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) OVERRIDE + struct npc_prospector_remtravelAI : public npc_escortAI { - if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2) - { - if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI())) - pEscortAI->Start(false, false, player->GetGUID()); - - creature->setFaction(FACTION_ESCORTEE); - } + npc_prospector_remtravelAI(Creature* creature) : npc_escortAI(creature) { } - return true; - } + void Reset() OVERRIDE { } - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_prospector_remtravelAI(creature); - } + void EnterCombat(Unit* who) OVERRIDE + { + if (urand(0, 1)) + Talk(SAY_REM_AGGRO, who); + } - struct npc_prospector_remtravelAI : public npc_escortAI - { - npc_prospector_remtravelAI(Creature* creature) : npc_escortAI(creature) { } + void JustSummoned(Creature* /*pSummoned*/) OVERRIDE + { + //unsure if it should be any + //pSummoned->AI()->AttackStart(me); + } void WaypointReached(uint32 waypointId) OVERRIDE { @@ -285,22 +280,25 @@ public: } } } + }; - void Reset() OVERRIDE { } - - void EnterCombat(Unit* who) OVERRIDE + bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) OVERRIDE + { + if (quest->GetQuestId() == QUEST_ABSENT_MINDED_PT2) { - if (urand(0, 1)) - Talk(SAY_REM_AGGRO, who); - } + if (npc_escortAI* pEscortAI = CAST_AI(npc_prospector_remtravel::npc_prospector_remtravelAI, creature->AI())) + pEscortAI->Start(false, false, player->GetGUID()); - void JustSummoned(Creature* /*pSummoned*/) OVERRIDE - { - //unsure if it should be any - //pSummoned->AI()->AttackStart(me); + creature->setFaction(FACTION_ESCORTEE); } - }; + return true; + } + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_prospector_remtravelAI(creature); + } }; /*#### @@ -323,37 +321,6 @@ class npc_threshwackonator : public CreatureScript public: npc_threshwackonator() : CreatureScript("npc_threshwackonator") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - - if (npc_threshwackonatorAI* pThreshAI = CAST_AI(npc_threshwackonator::npc_threshwackonatorAI, creature->AI())) - { - creature->AI()->Talk(EMOTE_START); - pThreshAI->StartFollow(player); - } - } - - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) OVERRIDE - { - if (player->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_threshwackonatorAI(creature); - } - struct npc_threshwackonatorAI : public FollowerAI { npc_threshwackonatorAI(Creature* creature) : FollowerAI(creature) { } @@ -386,6 +353,36 @@ public: } }; + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE + { + player->PlayerTalkClass->ClearMenus(); + if (action == GOSSIP_ACTION_INFO_DEF+1) + { + player->CLOSE_GOSSIP_MENU(); + + if (npc_threshwackonatorAI* pThreshAI = CAST_AI(npc_threshwackonator::npc_threshwackonatorAI, creature->AI())) + { + creature->AI()->Talk(EMOTE_START); + pThreshAI->StartFollow(player); + } + } + + return true; + } + + bool OnGossipHello(Player* player, Creature* creature) OVERRIDE + { + if (player->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE) + player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + return true; + } + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_threshwackonatorAI(creature); + } }; void AddSC_darkshore() diff --git a/src/server/scripts/Kalimdor/zone_desolace.cpp b/src/server/scripts/Kalimdor/zone_desolace.cpp index b748db4592c..07609dac61f 100644 --- a/src/server/scripts/Kalimdor/zone_desolace.cpp +++ b/src/server/scripts/Kalimdor/zone_desolace.cpp @@ -61,18 +61,6 @@ class npc_aged_dying_ancient_kodo : public CreatureScript public: npc_aged_dying_ancient_kodo() : CreatureScript("npc_aged_dying_ancient_kodo") { } - bool OnGossipHello(Player* player, Creature* creature) OVERRIDE - { - if (player->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && creature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF)) - { - player->TalkedToCreature(creature->GetEntry(), 0); - player->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF); - } - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - struct npc_aged_dying_ancient_kodoAI : public ScriptedAI { npc_aged_dying_ancient_kodoAI(Creature* creature) : ScriptedAI(creature) { } @@ -111,6 +99,18 @@ public: } }; + bool OnGossipHello(Player* player, Creature* creature) OVERRIDE + { + if (player->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && creature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF)) + { + player->TalkedToCreature(creature->GetEntry(), 0); + player->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF); + } + + player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); + return true; + } + CreatureAI* GetAI(Creature* creature) const OVERRIDE { return new npc_aged_dying_ancient_kodoAI(creature); @@ -126,7 +126,7 @@ public: enum Iruxos { QUEST_HAND_IRUXOS = 5381, - NPC_DEMON_SPIRIT = 11876, + NPC_DEMON_SPIRIT = 11876 }; class go_iruxos : public GameObjectScript @@ -157,28 +157,21 @@ class npc_dalinda : public CreatureScript public: npc_dalinda() : CreatureScript("npc_dalinda") { } - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE - { - if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL) - { - if (npc_escortAI* escortAI = CAST_AI(npc_dalinda::npc_dalindaAI, creature->AI())) - { - escortAI->Start(true, false, player->GetGUID()); - creature->setFaction(113); - } - } - return true; - } - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_dalindaAI(creature); - } - struct npc_dalindaAI : public npc_escortAI { npc_dalindaAI(Creature* creature) : npc_escortAI(creature) { } + void Reset() OVERRIDE { } + + void EnterCombat(Unit* /*who*/) OVERRIDE { } + + void JustDied(Unit* /*killer*/) OVERRIDE + { + if (Player* player = GetPlayerForEscort()) + player->FailQuest(QUEST_RETURN_TO_VAHLARRIEL); + return; + } + void WaypointReached(uint32 waypointId) OVERRIDE { Player* player = GetPlayerForEscort(); @@ -195,25 +188,34 @@ public: } } - void EnterCombat(Unit* /*who*/) OVERRIDE { } - - void Reset() OVERRIDE { } - - void JustDied(Unit* /*killer*/) OVERRIDE + void UpdateAI(uint32 diff) OVERRIDE { - if (Player* player = GetPlayerForEscort()) - player->FailQuest(QUEST_RETURN_TO_VAHLARRIEL); - return; - } + npc_escortAI::UpdateAI(diff); - void UpdateAI(uint32 Diff) OVERRIDE - { - npc_escortAI::UpdateAI(Diff); if (!UpdateVictim()) return; + DoMeleeAttackIfReady(); } }; + + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE + { + if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL) + { + if (npc_escortAI* escortAI = CAST_AI(npc_dalinda::npc_dalindaAI, creature->AI())) + { + escortAI->Start(true, false, player->GetGUID()); + creature->setFaction(113); + } + } + return true; + } + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_dalindaAI(creature); + } }; /*###### @@ -223,8 +225,7 @@ public: enum DemonPortal { NPC_DEMON_GUARDIAN = 11937, - - QUEST_PORTAL_OF_THE_LEGION = 5581, + QUEST_PORTAL_OF_THE_LEGION = 5581 }; class go_demon_portal : public GameObjectScript diff --git a/src/server/scripts/Kalimdor/zone_durotar.cpp b/src/server/scripts/Kalimdor/zone_durotar.cpp index f6d3a5c5e4c..2074598e304 100644 --- a/src/server/scripts/Kalimdor/zone_durotar.cpp +++ b/src/server/scripts/Kalimdor/zone_durotar.cpp @@ -87,17 +87,17 @@ public: } } - void UpdateAI(uint32 Diff) OVERRIDE + void UpdateAI(uint32 diff) OVERRIDE { if (work == true) me->HandleEmoteCommand(EMOTE_ONESHOT_WORK_CHOPWOOD); - if (RebuffTimer <= Diff) + if (RebuffTimer <= diff) { DoCast(me, SPELL_BUFF_SLEEP); RebuffTimer = 300000; //Rebuff agian in 5 minutes } else - RebuffTimer -= Diff; + RebuffTimer -= diff; if (!UpdateVictim()) return; DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp index 34a217b6418..5c4efcc2430 100644 --- a/src/server/scripts/Northrend/zone_crystalsong_forest.cpp +++ b/src/server/scripts/Northrend/zone_crystalsong_forest.cpp @@ -56,21 +56,21 @@ public: SetCombatMovement(false); } - uint64 uiTargetGUID; + uint64 targetGUID; void Reset() OVERRIDE { - uiTargetGUID = 0; + targetGUID = 0; } - void UpdateAI(uint32 /*uiDiff*/) OVERRIDE + void UpdateAI(uint32 /*diff*/) OVERRIDE { if (me->IsNonMeleeSpellCasted(false)) return; if (me->GetEntry() == NPC_WARMAGE_SARINA) { - if (!uiTargetGUID) + if (!targetGUID) { std::list<Creature*> orbList; GetCreatureListWithEntryInGrid(orbList, me, NPC_TRANSITUS_SHIELD_DUMMY, 32.0f); @@ -82,7 +82,7 @@ public: { if (pOrb->GetPositionY() < 1000) { - uiTargetGUID = pOrb->GetGUID(); + targetGUID = pOrb->GetGUID(); break; } } @@ -91,13 +91,13 @@ public: } }else { - if (!uiTargetGUID) + if (!targetGUID) if (Creature* pOrb = GetClosestCreatureWithEntry(me, NPC_TRANSITUS_SHIELD_DUMMY, 32.0f)) - uiTargetGUID = pOrb->GetGUID(); + targetGUID = pOrb->GetGUID(); } - if (Creature* pOrb = me->GetCreature(*me, uiTargetGUID)) + if (Creature* pOrb = me->GetCreature(*me, targetGUID)) DoCast(pOrb, SPELL_TRANSITUS_SHIELD_BEAM); } diff --git a/src/server/scripts/Northrend/zone_dalaran.cpp b/src/server/scripts/Northrend/zone_dalaran.cpp index 083b4f879ee..cf66ef4fb47 100644 --- a/src/server/scripts/Northrend/zone_dalaran.cpp +++ b/src/server/scripts/Northrend/zone_dalaran.cpp @@ -35,8 +35,8 @@ Script Data End */ enum Spells { - SPELL_TRESPASSER_A = 54028, - SPELL_TRESPASSER_H = 54029, + SPELL_TRESPASSER_A = 54028, + SPELL_TRESPASSER_H = 54029, SPELL_SUNREAVER_DISGUISE_FEMALE = 70973, SPELL_SUNREAVER_DISGUISE_MALE = 70974, @@ -46,8 +46,10 @@ enum Spells enum NPCs // All outdoor guards are within 35.0f of these NPCs { - NPC_APPLEBOUGH_A = 29547, - NPC_SWEETBERRY_H = 29715, + NPC_APPLEBOUGH_A = 29547, + NPC_SWEETBERRY_H = 29715, + NPC_SILVER_COVENANT_GUARDIAN_MAGE = 29254, + NPC_SUNREAVER_GUARDIAN_MAGE = 29255, }; class npc_mageguard_dalaran : public CreatureScript @@ -89,7 +91,7 @@ public: switch (me->GetEntry()) { - case 29254: + case NPC_SILVER_COVENANT_GUARDIAN_MAGE: if (player->GetTeam() == HORDE) // Horde unit found in Alliance area { if (GetClosestCreatureWithEntry(me, NPC_APPLEBOUGH_A, 32.0f)) @@ -101,7 +103,7 @@ public: DoCast(who, SPELL_TRESPASSER_A); // Teleport the Horde unit out } break; - case 29255: + case NPC_SUNREAVER_GUARDIAN_MAGE: if (player->GetTeam() == ALLIANCE) // Alliance unit found in Horde area { if (GetClosestCreatureWithEntry(me, NPC_SWEETBERRY_H, 32.0f)) @@ -133,7 +135,7 @@ public: enum HiraSnowdawn { - SPELL_COLD_WEATHER_FLYING = 54197 + SPELL_COLD_WEATHER_FLYING = 54197 }; #define GOSSIP_TEXT_TRAIN_HIRA "I seek training to ride a steed." |