Add support for quest 1440 (Return to Vahlarriel) - patch by Supabad

Closes issue #323

--HG--
branch : trunk
This commit is contained in:
click
2010-05-01 09:12:52 +02:00
parent bcbb52f507
commit 593d962665
3 changed files with 91 additions and 0 deletions
@@ -0,0 +1 @@
UPDATE `creature_template` SET `ScriptName`='npc_dalinda', `flags_extra`='2', `faction_A`=35, `faction_H`=14 WHERE `creature_template`.`entry`=5644;
@@ -0,0 +1,18 @@
DELETE FROM `script_waypoint` WHERE `entry`=5644;
INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES
(5644, 1, -339.679, 1752.04, 139.482, 0, '0'),
(5644, 2, -328.957, 1734.95, 139.327, 0, '0'),
(5644, 3, -350.747, 1731.12, 139.338, 0, '0'),
(5644, 4, -365.064, 1739.04, 139.376, 0, '0'),
(5644, 5, -371.105, 1746.03, 139.374, 0, '0'),
(5644, 6, -383.141, 1738.62, 138.93, 0, '0'),
(5644, 7, -390.445, 1733.98, 136.353, 0, '0'),
(5644, 8, -401.368, 1726.77, 131.071, 0, '0'),
(5644, 9, -416.016, 1721.19, 129.807, 0, '0'),
(5644, 10, -437.139, 1709.82, 126.342, 0, '0'),
(5644, 11, -459.862, 1687.92, 116.059, 0, '0'),
(5644, 12, -460.686, 1679.55, 111.976, 0, '0'),
(5644, 13, -461.485, 1670.94, 109.033, 0, '0'),
(5644, 14, -468.53, 1645.51, 102.811, 0, '0'),
(5644, 15, -474.529, 1615.97, 97.228, 0, '0'),
(5644, 16, -474.329, 1590.01, 94.4982, 0, '0');
+72
View File
@@ -26,6 +26,7 @@ npc_aged_dying_ancient_kodo
EndContentData */ EndContentData */
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "ScriptedEscortAI.h"
enum eDyingKodo enum eDyingKodo
{ {
@@ -169,6 +170,70 @@ bool GOHello_go_iruxos(Player *pPlayer, GameObject* /*pGO*/)
return true; return true;
} }
/*######
## npc_dalinda_malem. Quest 1440
######*/
#define QUEST_RETURN_TO_VAHLARRIEL 1440
struct npc_dalindaAI : public npc_escortAI
{
npc_dalindaAI(Creature* pCreature) : npc_escortAI(pCreature) { }
void WaypointReached(uint32 i)
{
Player* pPlayer = GetPlayerForEscort();
switch (i)
{
case 1:
me->IsStandState();
break;
case 15:
if (pPlayer)
pPlayer->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me);
break;
}
}
void EnterCombat(Unit* pWho) { }
void Reset() {}
void JustDied(Unit* pKiller)
{
Player* pPlayer = GetPlayerForEscort();
if (pPlayer)
pPlayer->FailQuest(QUEST_RETURN_TO_VAHLARRIEL);
return;
}
void UpdateAI(const uint32 uiDiff)
{
npc_escortAI::UpdateAI(uiDiff);
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_npc_dalinda(Creature* pCreature)
{
return new npc_dalindaAI(pCreature);
}
bool QuestAccept_npc_dalinda(Player* pPlayer, Creature* pCreature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_RETURN_TO_VAHLARRIEL)
{
if (npc_escortAI* pEscortAI = CAST_AI(npc_dalindaAI, pCreature->AI()))
{
pEscortAI->Start(true, false, pPlayer->GetGUID());
pCreature->setFaction(113);
}
}
return true;
}
void AddSC_desolace() void AddSC_desolace()
{ {
Script *newscript; Script *newscript;
@@ -184,4 +249,11 @@ void AddSC_desolace()
newscript->Name = "go_iruxos"; newscript->Name = "go_iruxos";
newscript->pGOHello = &GOHello_go_iruxos; newscript->pGOHello = &GOHello_go_iruxos;
newscript->RegisterSelf(); newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_dalinda";
newscript->GetAI = &GetAI_npc_dalinda;
newscript->pQuestAccept = &QuestAccept_npc_dalinda;
newscript->RegisterSelf();
} }