diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/scripts/Kalimdor/azuremyst_isle.cpp | 71 | ||||
-rwxr-xr-x | src/server/scripts/World/go_scripts.cpp | 27 |
2 files changed, 71 insertions, 27 deletions
diff --git a/src/server/scripts/Kalimdor/azuremyst_isle.cpp b/src/server/scripts/Kalimdor/azuremyst_isle.cpp index 131e91b65b3..ca35b48b970 100755 --- a/src/server/scripts/Kalimdor/azuremyst_isle.cpp +++ b/src/server/scripts/Kalimdor/azuremyst_isle.cpp @@ -669,6 +669,67 @@ CreatureAI* GetAI_npc_death_ravagerAI(Creature* pCreature) return new npc_death_ravagerAI(pCreature); } +/*######## +## Quest: The Prophecy of Akida +########*/ +enum BristlelimbCage +{ + QUEST_THE_PROPHECY_OF_AKIDA = 9544, + NPC_STILLPINE_CAPITIVE = 17375, + GO_BRISTELIMB_CAGE = 181714, + CAPITIVE_SAY_1 = -1000474, + CAPITIVE_SAY_2 = -1000475, + CAPITIVE_SAY_3 = -1000476 +}; + + +struct npc_stillpine_capitiveAI : public ScriptedAI +{ + npc_stillpine_capitiveAI(Creature *c) : ScriptedAI(c){} + + uint32 FleeTimer; + + void Reset() + { + FleeTimer = 0; + GameObject* cage = me->FindNearestGameObject(GO_BRISTELIMB_CAGE, 5.0f); + if(cage) + cage->ResetDoorOrButton(); + } + + void UpdateAI(const uint32 diff) + { + if(FleeTimer) + { + if(FleeTimer <= diff) + me->ForcedDespawn(); + else FleeTimer -= diff; + } + } +}; + +CreatureAI* GetAI_npc_stillpine_capitiveAI(Creature* pCreature) +{ + return new npc_stillpine_capitiveAI(pCreature); +} + +bool go_bristlelimb_cage(Player* pPlayer, GameObject* pGo) +{ + if(pPlayer->GetQuestStatus(QUEST_THE_PROPHECY_OF_AKIDA) == QUEST_STATUS_INCOMPLETE) + { + Creature* pCreature = pGo->FindNearestCreature(NPC_STILLPINE_CAPITIVE, 5.0f, true); + if(pCreature) + { + DoScriptText(RAND(CAPITIVE_SAY_1, CAPITIVE_SAY_2, CAPITIVE_SAY_3), pCreature, pPlayer); + pCreature->GetMotionMaster()->MoveFleeing(pPlayer, 3500); + pPlayer->KilledMonsterCredit(pCreature->GetEntry(), pCreature->GetGUID()); + CAST_AI(npc_stillpine_capitiveAI, pCreature->AI())->FleeTimer = 3500; + return false; + } + } + return true; +} + void AddSC_azuremyst_isle() { Script *newscript; @@ -716,5 +777,15 @@ void AddSC_azuremyst_isle() newscript->Name="go_ravager_cage"; newscript->pGOHello = &go_ravager_cage; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_stillpine_capitive"; + newscript->GetAI = &GetAI_npc_stillpine_capitiveAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="go_bristlelimb_cage"; + newscript->pGOHello = &go_bristlelimb_cage; + newscript->RegisterSelf(); } diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 84ce38dd243..ca7a136c2fb 100755 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -944,28 +944,6 @@ bool GOSelect_go_amberpine_outhouse(Player *pPlayer, GameObject *pGO, uint32 /*u } /*###### -## Quest 9544: The Prophecy of Akida -######*/ - -enum eProphecy -{ - QUEST_PROPHECY_OF_AKIDA = 9544, - NPC_STILLPINE_CAPTIVE = 17375 -}; - -bool GOHello_go_stillpine_cage(Player *pPlayer, GameObject *pGO) -{ - if (pPlayer->GetQuestStatus(QUEST_PROPHECY_OF_AKIDA) == QUEST_STATUS_INCOMPLETE) - if (Creature *pPrisoner = pGO->FindNearestCreature(NPC_STILLPINE_CAPTIVE,1.0f)) - { - pGO->UseDoorOrButton(); - pPrisoner->DisappearAndDie(); - pPlayer->KilledMonsterCredit(pPrisoner->GetEntry(),0); - } - return true; -} - -/*###### ## Quest 1126: Hive in the Tower ######*/ @@ -1161,11 +1139,6 @@ void AddSC_go_scripts() newscript->RegisterSelf(); newscript = new Script; - newscript->Name = "go_stillpine_cage"; - newscript->pGOHello = &GOHello_go_stillpine_cage; - newscript->RegisterSelf(); - - newscript = new Script; newscript->Name = "go_amberpine_outhouse"; newscript->pGOHello = &GOHello_go_amberpine_outhouse; newscript->pGOSelect = &GOSelect_go_amberpine_outhouse; |