*Support for quest 6482 - by arcx
*Line endings --HG-- branch : trunk
This commit is contained in:
@@ -0,0 +1 @@
|
||||
UPDATE `creature_template` SET `ScriptName` = 'npc_ruul_snowhoof' WHERE `entry` = 12818;
|
||||
@@ -17,12 +17,13 @@
|
||||
/* ScriptData
|
||||
SDName: Ashenvale
|
||||
SD%Complete: 70
|
||||
SDComment: Quest support: 6544
|
||||
SDComment: Quest support: 6544, 6482
|
||||
SDCategory: Ashenvale Forest
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_torek
|
||||
npc_ruul_snowhoof
|
||||
EndContentData */
|
||||
|
||||
#include "precompiled.h"
|
||||
@@ -175,6 +176,124 @@ CreatureAI* GetAI_npc_torek(Creature *_Creature)
|
||||
return (CreatureAI*)thisAI;
|
||||
}
|
||||
|
||||
/*####
|
||||
# npc_ruul_snowhoof
|
||||
####*/
|
||||
|
||||
#define QUEST_FREEDOM_TO_RUUL 6482
|
||||
#define GO_CAGE 178147
|
||||
|
||||
struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI
|
||||
{
|
||||
npc_ruul_snowhoofAI(Creature *c) : npc_escortAI(c) {Reset();}
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
switch(i)
|
||||
{
|
||||
case 0: {
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
|
||||
GameObject* Cage = FindGameObject(GO_CAGE, 99);
|
||||
if(Cage)
|
||||
Cage->SetGoState(0);
|
||||
break;}
|
||||
case 13:
|
||||
m_creature->SummonCreature(3922, 3449.218018, -587.825073, 174.978867, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
|
||||
m_creature->SummonCreature(3921, 3446.384521, -587.830872, 175.186279, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
|
||||
m_creature->SummonCreature(3926, 3444.218994, -587.835327, 175.380600, 4.714445, TEMPSUMMON_DEAD_DESPAWN, 60000);
|
||||
break;
|
||||
case 19:
|
||||
m_creature->SummonCreature(3922, 3508.344482, -492.024261, 186.929031, 4.145029, TEMPSUMMON_DEAD_DESPAWN, 60000);
|
||||
m_creature->SummonCreature(3921, 3506.265625, -490.531006, 186.740128, 4.239277, TEMPSUMMON_DEAD_DESPAWN, 60000);
|
||||
m_creature->SummonCreature(3926, 3503.682373, -489.393799, 186.629684, 4.349232, TEMPSUMMON_DEAD_DESPAWN, 60000);
|
||||
break;
|
||||
|
||||
case 21:{
|
||||
if (player && player->GetTypeId() == TYPEID_PLAYER)
|
||||
((Player*)player)->GroupEventHappens(QUEST_FREEDOM_TO_RUUL,m_creature);
|
||||
|
||||
break; }
|
||||
}
|
||||
}
|
||||
|
||||
void Aggro(Unit* who) {}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (!IsBeingEscorted)
|
||||
m_creature->setFaction(1602);
|
||||
|
||||
GameObject* Cage = FindGameObject(GO_CAGE, 99);
|
||||
if(Cage)
|
||||
Cage->SetGoState(1);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
summoned->AI()->AttackStart(m_creature);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
if (PlayerGUID)
|
||||
{
|
||||
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
|
||||
if (player)
|
||||
((Player*)player)->FailQuest(QUEST_FREEDOM_TO_RUUL);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
}
|
||||
};
|
||||
|
||||
bool QuestAccept_npc_ruul_snowhoof(Player* player, Creature* creature, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL)
|
||||
{
|
||||
creature->setFaction(1603);
|
||||
((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_npc_ruul_snowhoofAI(Creature *_Creature)
|
||||
{
|
||||
npc_ruul_snowhoofAI* ruul_snowhoofAI = new npc_ruul_snowhoofAI(_Creature);
|
||||
|
||||
ruul_snowhoofAI->AddWaypoint(0, 3347.250089, -694.700989, 159.925995);
|
||||
ruul_snowhoofAI->AddWaypoint(1, 3341.527039, -694.725891, 161.124542, 4000);
|
||||
ruul_snowhoofAI->AddWaypoint(2, 3338.351074, -686.088138, 163.444000);
|
||||
ruul_snowhoofAI->AddWaypoint(3, 3352.744873, -677.721741, 162.316269);
|
||||
ruul_snowhoofAI->AddWaypoint(4, 3370.291016, -669.366943, 160.751358);
|
||||
ruul_snowhoofAI->AddWaypoint(5, 3381.479492, -659.449097, 162.545303);
|
||||
ruul_snowhoofAI->AddWaypoint(6, 3389.554199, -648.500000, 163.651825);
|
||||
ruul_snowhoofAI->AddWaypoint(7, 3396.645020, -641.508911, 164.216019);
|
||||
ruul_snowhoofAI->AddWaypoint(8, 3410.498535, -634.299622, 165.773453);
|
||||
ruul_snowhoofAI->AddWaypoint(9, 3418.461426, -631.791992, 166.477615);
|
||||
ruul_snowhoofAI->AddWaypoint(10, 3429.500000, -631.588745, 166.921265);
|
||||
ruul_snowhoofAI->AddWaypoint(11,3434.950195, -629.245483, 168.333969);
|
||||
ruul_snowhoofAI->AddWaypoint(12,3438.927979, -618.503235, 171.503143);
|
||||
ruul_snowhoofAI->AddWaypoint(13,3444.217529, -609.293640, 173.077972, 1000); // Ambush 1
|
||||
ruul_snowhoofAI->AddWaypoint(14,3460.505127, -593.794189, 174.342255);
|
||||
ruul_snowhoofAI->AddWaypoint(15,3480.283203, -578.210327, 176.652313);
|
||||
ruul_snowhoofAI->AddWaypoint(16,3492.912842, -562.335449, 181.396301);
|
||||
ruul_snowhoofAI->AddWaypoint(17,3495.230957, -550.977600, 184.652267);
|
||||
ruul_snowhoofAI->AddWaypoint(18,3496.247070, -529.194214, 188.172028);
|
||||
ruul_snowhoofAI->AddWaypoint(19,3497.619385, -510.411499, 188.345322, 1000); // Ambush 2
|
||||
ruul_snowhoofAI->AddWaypoint(20,3498.498047, -497.787506, 185.806274);
|
||||
ruul_snowhoofAI->AddWaypoint(21,3484.218750, -489.717529, 182.389862, 4000); // End
|
||||
|
||||
return (CreatureAI*)ruul_snowhoofAI;
|
||||
}
|
||||
|
||||
void AddSC_ashenvale()
|
||||
{
|
||||
Script *newscript;
|
||||
@@ -184,4 +303,10 @@ void AddSC_ashenvale()
|
||||
newscript->GetAI = &GetAI_npc_torek;
|
||||
newscript->pQuestAccept = &QuestAccept_npc_torek;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "npc_ruul_snowhoof";
|
||||
newscript->GetAI = &GetAI_npc_ruul_snowhoofAI;
|
||||
newscript->pQuestAccept = &QuestAccept_npc_ruul_snowhoof;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
Reference in New Issue
Block a user