diff options
| -rw-r--r-- | src/server/scripts/EasternKingdoms/arathi_highlands.cpp | 140 |
1 files changed, 72 insertions, 68 deletions
diff --git a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp index 5a5d229a109..8ded637e312 100644 --- a/src/server/scripts/EasternKingdoms/arathi_highlands.cpp +++ b/src/server/scripts/EasternKingdoms/arathi_highlands.cpp @@ -51,84 +51,88 @@ enum eEnums MOB_VENGEFUL_SURGE = 2776 }; -struct npc_professor_phizzlethorpeAI : public npc_escortAI +class npc_professor_phizzlethorpe : public CreatureScript { - npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {} + public: - void WaypointReached(uint32 uiPointId) - { - Player* pPlayer = GetPlayerForEscort(); - - if (!pPlayer) - return; + npc_professor_phizzlethorpe() + : CreatureScript("npc_professor_phizzlethorpe") + { + } - switch(uiPointId) + struct npc_professor_phizzlethorpeAI : public npc_escortAI { - case 4:DoScriptText(SAY_PROGRESS_2, me, pPlayer);break; - case 5:DoScriptText(SAY_PROGRESS_3, me, pPlayer);break; - case 8:DoScriptText(EMOTE_PROGRESS_4, me);break; - case 9: + npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {} + + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(uiPointId) + { + case 4:DoScriptText(SAY_PROGRESS_2, me, pPlayer);break; + case 5:DoScriptText(SAY_PROGRESS_3, me, pPlayer);break; + case 8:DoScriptText(EMOTE_PROGRESS_4, me);break; + case 9: + { + me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + break; + } + case 10:DoScriptText(SAY_PROGRESS_5, me, pPlayer);break; + case 11: + DoScriptText(SAY_PROGRESS_6, me, pPlayer); + SetRun(); + break; + case 19:DoScriptText(SAY_PROGRESS_7, me, pPlayer); break; + case 20: + DoScriptText(EMOTE_PROGRESS_8, me); + DoScriptText(SAY_PROGRESS_9, me, pPlayer); + if (pPlayer) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(me); + } + + void EnterCombat(Unit* /*pWho*/) + { + DoScriptText(SAY_AGGRO, me); + } + + void UpdateAI(const uint32 diff) { - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - break; + npc_escortAI::UpdateAI(diff); } - case 10:DoScriptText(SAY_PROGRESS_5, me, pPlayer);break; - case 11: - DoScriptText(SAY_PROGRESS_6, me, pPlayer); - SetRun(); - break; - case 19:DoScriptText(SAY_PROGRESS_7, me, pPlayer); break; - case 20: - DoScriptText(EMOTE_PROGRESS_8, me); - DoScriptText(SAY_PROGRESS_9, me, pPlayer); - if (pPlayer) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me); - break; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_professor_phizzlethorpeAI(creature); } - } - - void JustSummoned(Creature* pSummoned) - { - pSummoned->AI()->AttackStart(me); - } - - void EnterCombat(Unit* /*pWho*/) - { - DoScriptText(SAY_AGGRO, me); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; -bool QuestAccept_npc_professor_phizzlethorpe(Player* pPlayer, Creature* pCreature, Quest const* pQuest) -{ - if (pQuest->GetQuestId() == QUEST_SUNKEN_TREASURE) - { - DoScriptText(SAY_PROGRESS_1, pCreature, pPlayer); - if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (pCreature->AI()))) - pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); - - pCreature->setFaction(113); - } - return true; -} + bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) + { + if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE) + { + DoScriptText(SAY_PROGRESS_1, creature, player); + if (npc_escortAI* pEscortAI = CAST_AI(npc_professor_phizzlethorpeAI, (creature->AI()))) + pEscortAI->Start(false, false, player->GetGUID(), quest); -CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature* pCreature) -{ - return new npc_professor_phizzlethorpeAI(pCreature); -} + creature->setFaction(113); + } + return true; + } +}; void AddSC_arathi_highlands() { - Script * newscript; - - newscript = new Script; - newscript->Name = "npc_professor_phizzlethorpe"; - newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI; - newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe; - newscript->RegisterSelf(); + new npc_professor_phizzlethorpe(); } |
