*Support for quest 435

--HG--
branch : trunk
This commit is contained in:
Blaymoira
2008-12-27 16:44:14 +01:00
parent 46aa1294aa
commit 5d842d667b
2 changed files with 132 additions and 1 deletions

View File

@@ -0,0 +1 @@
update creature_template set scriptname='npc_deathstalker_erland' where entry=1978;

View File

@@ -17,15 +17,17 @@
/* ScriptData
SDName: Silverpine_Forest
SD%Complete: 100
SDComment: Quest support: 1886
SDComment: Quest support: 1886, 435
SDCategory: Silverpine Forest
EndScriptData */
/* ContentData
npc_astor_hadren
npc_deathstalker_erland
EndContentData */
#include "precompiled.h"
#include "../../npc/npc_escortAI.h"
/*######
## npc_astor_hadren
@@ -83,6 +85,128 @@ bool GossipSelect_npc_astor_hadren(Player *player, Creature *_Creature, uint32 s
return true;
}
/*######
## npc_deathstalker_erland
######*/
#define SAY_QUESTACCEPT "Let's get to the others, and keep an eye open for those wolves cutside..."
#define SAY_START "Be careful, $N. Those wolves like to hide among the trees."
#define SAY_AGGRO_1 "A Mottled Worg attacks!"
#define SAY_AGGRO_2 "Beware! I am under attack!"
#define SAY_LAST "We're almost there!"
#define SAY_THANKS "We made it! Thanks, $N. I couldn't have gotten without you."
#define SAY_RANE "It's good to see you again, Erland. What is your report?"
#define SAY_ANSWER "Masses of wolves are to the east, and whoever lived at Malden's Orchard is gone."
#define SAY_MOVE_QUINN "If I am excused, then I'd like to check on Quinn..."
#define SAY_GREETINGS "Hello, Quinn. How are you faring?"
#define SAY_QUINN "I've been better. Ivar the Foul got the better of me..."
#define SAY_ON_BYE "Try to take better care of yourself, Quinn. You were lucky this time."
#define QUEST_ESCORTING 435
#define NPC_RANE 1950
#define NPC_QUINN 1951
struct TRINITY_DLL_DECL npc_deathstalker_erlandAI : public npc_escortAI
{
npc_deathstalker_erlandAI(Creature *c) : npc_escortAI(c) {Reset();}
void WaypointReached(uint32 i)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
if (!player)
return;
switch(i)
{
case 1: DoSay(SAY_START, LANG_UNIVERSAL, player);break;
case 13:
DoSay(SAY_LAST, LANG_UNIVERSAL, player);
((Player*)player)->GroupEventHappens(QUEST_ESCORTING, m_creature);break;
case 14: DoSay(SAY_THANKS, LANG_UNIVERSAL, player);break;
case 15: {
Unit* Rane = FindCreature(NPC_RANE, 20);
if(Rane)
((Creature*)Rane)->Say(SAY_RANE, LANG_UNIVERSAL, NULL);
break;}
case 16: DoSay(SAY_ANSWER, LANG_UNIVERSAL, NULL);break;
case 17: DoSay(SAY_MOVE_QUINN, LANG_UNIVERSAL, NULL); break;
case 24: DoSay(SAY_GREETINGS, LANG_UNIVERSAL, NULL);break;
case 25: {
Unit* Quinn = FindCreature(NPC_QUINN, 20);
if(Quinn)
((Creature*)Quinn)->Say(SAY_QUINN, LANG_GUTTERSPEAK, NULL);
break;}
case 26: DoSay(SAY_ON_BYE, LANG_UNIVERSAL, NULL);break;
}
}
void Reset() {}
void Aggro(Unit* who)
{
switch(rand()%2)
{
case 0: DoSay(SAY_AGGRO_1, LANG_UNIVERSAL, who);break;
case 1: DoSay(SAY_AGGRO_2, LANG_UNIVERSAL, who);break;
}
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
};
bool QuestAccept_npc_deathstalker_erland(Player* player, Creature* creature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_ESCORTING)
{
creature->Say(SAY_QUESTACCEPT, LANG_UNIVERSAL, player->GetGUID());
((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
}
return true;
}
CreatureAI* GetAI_npc_deathstalker_erlandAI(Creature *_Creature)
{
npc_deathstalker_erlandAI* deathstalker_erlandAI = new npc_deathstalker_erlandAI(_Creature);
deathstalker_erlandAI->AddWaypoint(0, 1406.32, 1083.10, 52.55);
deathstalker_erlandAI->AddWaypoint(1, 1400.49, 1080.42, 52.50); //first say
deathstalker_erlandAI->AddWaypoint(2, 1388.48, 1083.10, 52.52);
deathstalker_erlandAI->AddWaypoint(3, 1370.16, 1084.02, 52.30);
deathstalker_erlandAI->AddWaypoint(4, 1359.02, 1080.85, 52.46);
deathstalker_erlandAI->AddWaypoint(5, 1341.43, 1087.39, 52.69);
deathstalker_erlandAI->AddWaypoint(6, 1321.93, 1090.51, 50.66);
deathstalker_erlandAI->AddWaypoint(7, 1312.98, 1095.91, 47.49);
deathstalker_erlandAI->AddWaypoint(8, 1301.09, 1102.94, 47.76);
deathstalker_erlandAI->AddWaypoint(9, 1297.73, 1106.35, 50.18);
deathstalker_erlandAI->AddWaypoint(10, 1295.49, 1124.32, 50.49);
deathstalker_erlandAI->AddWaypoint(11, 1294.84, 1137.25, 51.75);
deathstalker_erlandAI->AddWaypoint(12, 1292.89, 1158.99, 52.65);
deathstalker_erlandAI->AddWaypoint(13, 1290.75, 1168.67, 52.56, 1000); //complete quest and say last
deathstalker_erlandAI->AddWaypoint(14, 1287.12, 1203.49, 52.66, 5000);
deathstalker_erlandAI->AddWaypoint(15, 1287.12, 1203.49, 52.66, 4000);
deathstalker_erlandAI->AddWaypoint(16, 1287.12, 1203.49, 52.66, 5000);
deathstalker_erlandAI->AddWaypoint(17, 1287.12, 1203.49, 52.66, 4000);
deathstalker_erlandAI->AddWaypoint(18, 1290.72, 1207.44, 52.69);
deathstalker_erlandAI->AddWaypoint(19, 1297.50, 1207.18, 53.74);
deathstalker_erlandAI->AddWaypoint(20, 1301.32, 1220.90, 53.74);
deathstalker_erlandAI->AddWaypoint(21, 1298.55, 1220.43, 53.74);
deathstalker_erlandAI->AddWaypoint(22, 1297.59, 1211.23, 58.47);
deathstalker_erlandAI->AddWaypoint(23, 1305.01, 1206.10, 58.51);
deathstalker_erlandAI->AddWaypoint(24, 1310.51, 1207.36, 58.51, 5000);
deathstalker_erlandAI->AddWaypoint(25, 1310.51, 1207.36, 58.51, 5000);
deathstalker_erlandAI->AddWaypoint(26, 1310.51, 1207.36, 58.51, 2000);
return (CreatureAI*)deathstalker_erlandAI;
}
/*######
## AddSC
######*/
@@ -97,4 +221,10 @@ void AddSC_silverpine_forest()
newscript->pGossipSelect = &GossipSelect_npc_astor_hadren;
newscript->GetAI = &GetAI_npc_astor_hadren;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_deathstalker_erland";
newscript->GetAI = &GetAI_npc_deathstalker_erlandAI;
newscript->pQuestAccept = &QuestAccept_npc_deathstalker_erland;
newscript->RegisterSelf();
}