* Implement proper script support for quest "The Prophecy of Akida" (9544)

* Script by antihrist

--HG--
branch : trunk
This commit is contained in:
Brian
2010-07-08 02:22:20 -06:00
parent 668de35042
commit e761d578da
6 changed files with 82 additions and 27 deletions

View File

@@ -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();
}

View File

@@ -943,28 +943,6 @@ bool GOSelect_go_amberpine_outhouse(Player *pPlayer, GameObject *pGO, uint32 /*u
return false;
}
/*######
## 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
######*/
@@ -1160,11 +1138,6 @@ void AddSC_go_scripts()
newscript->pGOHello = &GOHello_go_black_cage;
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;