* 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

@@ -423,6 +423,9 @@ INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1`
(23861,-1000471,'It was... terrible... the demon...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,''),
(23864,-1000472,'This land was mine long before your wretched kind set foot here.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,0,''),
(23864,-1000473,'All who venture here belong to me, including you!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,1,0,0,''),
(17375, -1000474, '[Fulborg] The Stillpine furbolgs will not soon forget your bravery!', 0, 0, 'Stillpine Capitive free say text 1'),
(17375, -1000475, '[Fulborg] Thank you, $N', 0, 0, 'Stillpine Capitive free say text 2'),
(17375, -1000476, '[Fulborg] Those remaining at Stillpine Hold will welcome you as a hero!', 0, 0, 'Stillpine Capitive free say text 3');
(26588,-1800001, 'Um... I think one of those wolves is back...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0, '12027'),
(26588,-1800002, 'He''s going for Mr. Floppy! ',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0, '12027'),
(26588,-1800003, 'Oh, no! Look, it''s another wolf, and it''s a biiiiiig one!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0, '12027'),

View File

@@ -274,6 +274,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_geezle' WHERE `entry`=17318;
UPDATE `creature_template` SET `ScriptName`='npc_nestlewood_owlkin' WHERE `entry`=16518;
UPDATE `creature_template` SET `ScriptName`='npc_draenei_survivor' WHERE `entry`=16483;
UPDATE `creature_template` SET `ScriptName`='npc_death_ravager' WHERE `entry`=17556;
UPDATE `creature_template` SET `ScriptName`='npc_stillpine_capitive' where `entry`=17375;
UPDATE `gameobject_template` SET `ScriptName`='go_ravager_cage' WHERE `entry`=181849;
UPDATE `gameobject_template` SET `ScriptName`='go_stillpine_cage' WHERE `entry`=181714;

View File

@@ -0,0 +1,5 @@
DELETE FROM script_texts where entry IN (-1000474, -1000475, -1000476);
INSERT INTO script_texts (`npc_entry`, `entry`, `content_default`, `type`, `language`, `comment`) VALUE
(17375, -1000474, '[Fulborg] The Stillpine furbolgs will not soon forget your bravery!', 0, 0, 'Stillpine Capitive free say text 1'),
(17375, -1000475, '[Fulborg] Thank you, $N', 0, 0, 'Stillpine Capitive free say text 2'),
(17375, -1000476, '[Fulborg] Those remaining at Stillpine Hold will welcome you as a hero!', 0, 0, 'Stillpine Capitive free say text 3');

View File

@@ -0,0 +1,2 @@
UPDATE `creature_template` SET `ScriptName`='npc_stillpine_capitive' where `entry`=17375;
UPDATE `gameobject_template` SET `ScriptName`='go_stillpine_cage' WHERE `entry`=181714;

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;