Add support for quest 9446 (Tomb of the Lightbringer) - closes #197

Patch by Supabad

--HG--
branch : trunk
This commit is contained in:
click
2010-05-01 00:19:04 +02:00
parent 6feda6605b
commit 3eccb81ee3
3 changed files with 160 additions and 0 deletions
@@ -0,0 +1 @@
UPDATE `creature_template` SET `MovementType` = '2',`ScriptName` = 'npc_anchorite_truuen' WHERE `creature_template`.`entry` =17238;
@@ -0,0 +1,28 @@
DELETE FROM `script_waypoint` WHERE `entry`=17238;
INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES
(17238, 1, 953.061, -1432.52, 63.2255, 0, '0'),
(17238, 2, 969.607, -1438.15, 65.3669, 0, '0'),
(17238, 3, 980.073, -1441.5, 65.3997, 0, '0'),
(17238, 4, 995.001, -1450.47, 61.3227, 0, '0'),
(17238, 5, 1032.7, -1473.49, 63.7699, 0, '0'),
(17238, 6, 1039.69, -1491.42, 65.2801, 0, '0'),
(17238, 7, 1038.8, -1523.32, 64.4661, 0, '0'),
(17238, 8, 1035.43, -1572.97, 61.5412, 0, '0'),
(17238, 9, 1034.45, -1612.83, 61.6186, 0, '0'),
(17238, 10, 1040.12, -1663.41, 60.923, 0, '0'),
(17238, 11, 1059.75, -1703.75, 60.5768, 0, '0'),
(17238, 12, 1091.83, -1735.24, 60.8057, 0, '0'),
(17238, 13, 1131.75, -1755.32, 61.0073, 0, '0'),
(17238, 14, 1159.77, -1762.64, 60.5699, 0, '0'),
(17238, 15, 1153.79, -1772, 60.6475, 0, '0'),
(17238, 16, 1115.4, -1787.21, 61.0759, 0, '0'),
(17238, 17, 1091.88, -1799.06, 61.6055, 0, '0'),
(17238, 18, 1056.22, -1805.65, 71.8112, 0, '0'),
(17238, 19, 1024.03, -1807.93, 77.025, 0, '0'),
(17238, 20, 1012.74, -1811.67, 77.5636, 0, '0'),
(17238, 21, 1006.74, -1813.59, 80.4872, 0, '0'),
(17238, 22, 983.15, -1823.05, 80.4872, 0, '0'),
(17238, 23, 974.954, -1825.33, 81.3482, 5000, '0'),
(17238, 24, 974.954, -1825.33, 81.3482, 5000, '0'),
(17238, 25, 974.954, -1825.33, 81.3482, 5000, '0'),
(17238, 26, 974.954, -1825.33, 81.3482, 5000, '0');
@@ -29,6 +29,7 @@ npc_andorhal_tower
EndContentData */
#include "ScriptedPch.h"
#include "ScriptedEscortAI.h"
/*######
## npcs_dithers_and_arbington
@@ -233,6 +234,130 @@ CreatureAI* GetAI_npc_andorhal_tower(Creature* pCreature)
return new npc_andorhal_towerAI (pCreature);
}
/*######
## npc_anchorite_truuen
######*/
enum eTruuen
{
NPC_GHOST_UTHER = 17233,
NPC_THEL_DANIS = 1854,
NPC_GHOUL = 1791, //ambush
QUEST_TOMB_LIGHTBRINGER = 9446,
SAY_WP_0 = -1999981, //Beware! We are attacked!
SAY_WP_1 = -1999982, //It must be the purity of the Mark of the Lightbringer that is drawing forth the Scourge to attack us. We must proceed with caution lest we be overwhelmed!
SAY_WP_2 = -1999983, //This land truly needs to be cleansed by the Light! Let us continue on to the tomb. It isn't far now...
SAY_WP_3 = -1999984, //Be welcome, friends!
SAY_WP_4 = -1999985, //Thank you for coming here in remembrance of me. Your efforts in recovering that symbol, while unnecessary, are certainly touching to an old man's heart.
SAY_WP_5 = -1999986, //Please, rise my friend. Keep the Blessing as a symbol of the strength of the Light and how heroes long gone might once again rise in each of us to inspire.
SAY_WP_6 = -1999987 //Thank you my friend for making this possible. This is a day that I shall never forget! I think I will stay a while. Please return to High Priestess MacDonnell at the camp. I know that she'll be keenly interested to know of what has transpired here.
};
struct npc_anchorite_truuenAI : public npc_escortAI
{
npc_anchorite_truuenAI(Creature* pCreature) : npc_escortAI(pCreature) { }
uint32 m_uiChatTimer;
uint64 UghostGUID;
uint64 TheldanisGUID;
Creature* Ughost;
Creature* Theldanis;
void Reset()
{
m_uiChatTimer = 7000;
}
void JustSummoned(Creature* pSummoned)
{
if (pSummoned->GetEntry() == NPC_GHOUL)
pSummoned->AI()->AttackStart(me);
}
void WaypointReached(uint32 i)
{
Player* pPlayer = GetPlayerForEscort();
switch (i)
{
case 8:
DoScriptText(SAY_WP_0, me);
me->SummonCreature(NPC_GHOUL, me->GetPositionX()+7.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
me->SummonCreature(NPC_GHOUL, me->GetPositionX()+5.0f, me->GetPositionY()+5.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
break;
case 9:
DoScriptText(SAY_WP_1, me);
break;
case 14:
me->SummonCreature(NPC_GHOUL, me->GetPositionX()+7.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
me->SummonCreature(NPC_GHOUL, me->GetPositionX()+5.0f, me->GetPositionY()+5.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
me->SummonCreature(NPC_GHOUL, me->GetPositionX()+10.0f, me->GetPositionY()+10.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
me->SummonCreature(NPC_GHOUL, me->GetPositionX()+8.0f, me->GetPositionY()+8.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 90000);
break;
case 15:
DoScriptText(SAY_WP_2, me);
case 21:
Theldanis = GetClosestCreatureWithEntry(me, NPC_THEL_DANIS, 150);
DoScriptText(SAY_WP_3, Theldanis);
break;
case 22:
break;
case 23:
Ughost = me->SummonCreature(NPC_GHOST_UTHER, 971.86,-1825.42 ,81.99 , 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
Ughost->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
DoScriptText(SAY_WP_4, Ughost, me);
m_uiChatTimer = 4000;
break;
case 24:
DoScriptText(SAY_WP_5, Ughost, me);
m_uiChatTimer = 4000;
break;
case 25:
DoScriptText(SAY_WP_6, Ughost, me);
m_uiChatTimer = 4000;
break;
case 26:
if (pPlayer)
pPlayer->GroupEventHappens(QUEST_TOMB_LIGHTBRINGER, me);
break;
}
}
void EnterCombat(Unit* pWho){}
void JustDied(Unit* pKiller)
{
Player* pPlayer = GetPlayerForEscort();
if (pPlayer)
pPlayer->FailQuest(QUEST_TOMB_LIGHTBRINGER);
}
void UpdateAI(const uint32 uiDiff)
{
npc_escortAI::UpdateAI(uiDiff);
DoMeleeAttackIfReady();
if (HasEscortState(STATE_ESCORT_ESCORTING))
m_uiChatTimer = 6000;
}
};
CreatureAI* GetAI_npc_anchorite_truuen(Creature* pCreature)
{
return new npc_anchorite_truuenAI(pCreature);
}
bool QuestAccept_npc_anchorite_truuen(Player* pPlayer, Creature* pCreature, Quest const *quest)
{
npc_escortAI* pEscortAI = CAST_AI(npc_anchorite_truuenAI, pCreature->AI());
if (quest->GetQuestId() == QUEST_TOMB_LIGHTBRINGER)
pEscortAI->Start(true, true, pPlayer->GetGUID());
return false;
}
/*######
##
######*/
@@ -262,4 +387,10 @@ void AddSC_western_plaguelands()
newscript->Name = "npc_andorhal_tower";
newscript->GetAI = &GetAI_npc_andorhal_tower;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_anchorite_truuen";
newscript->GetAI = &GetAI_npc_anchorite_truuen;
newscript->pQuestAccept = &QuestAccept_npc_anchorite_truuen;
newscript->RegisterSelf();
}