merging heads

--HG--
branch : trunk
This commit is contained in:
w12x
2008-12-22 23:12:38 +01:00
21 changed files with 1674 additions and 364 deletions
+2
View File
@@ -100,6 +100,8 @@ scripts/zone/black_temple/def_black_temple.h \
scripts/zone/black_temple/illidari_council.cpp \
scripts/zone/black_temple/instance_black_temple.cpp \
scripts/zone/blackrock_depths/blackrock_depths.cpp \
scripts/zone/blackrock_depths/instance_blackrock_depths.cpp \
scripts/zone/blackrock_depths/def_blackrock_depths.h \
scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp \
scripts/zone/blackrock_depths/boss_angerrel.cpp \
scripts/zone/blackrock_depths/boss_anubshiah.cpp \
@@ -2084,6 +2084,14 @@
RelativePath="..\scripts\zone\blackrock_depths\blackrock_depths.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\blackrock_depths\def_blackrock_depths.h"
>
</File>
<File
RelativePath="..\scripts\zone\blackrock_depths\instance_blackrock_depths.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_ambassador_flamelash.cpp"
>
@@ -2261,6 +2261,14 @@
RelativePath="..\scripts\zone\blackrock_depths\blackrock_depths.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\blackrock_depths\def_blackrock_depths.h"
>
</File>
<File
RelativePath="..\scripts\zone\blackrock_depths\instance_blackrock_depths.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\blackrock_depths\boss_ambassador_flamelash.cpp"
>
@@ -2318,6 +2318,14 @@
RelativePath="..\scripts\zone\blackrock_depths\boss_vilerel.cpp"
>
</File>
<File
RelativePath="..\scripts\zone\blackrock_depths\def_blackrock_depths.h"
>
</File>
<File
RelativePath="..\scripts\zone\blackrock_depths\instance_blackrock_depths.cpp"
>
</File>
</Filter>
<Filter
Name="Loch Modan"
@@ -28,6 +28,9 @@ npc_lokhtos_darkbargainer
EndContentData */
#include "precompiled.h"
#include "../../npc/npc_escortAI.h"
#include "def_blackrock_depths.h"
#include "GameObject.h"
/*######
## mob_phalanx
@@ -210,6 +213,560 @@ bool GossipSelect_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature,
return true;
}
/*######
## npc_dughal_stormwing
######*/
#define QUEST_JAIL_BREAK 4322
#define SAY_DUGHAL_FREE "Thank you, $N! I'm free!!!"
#define GOSSIP_DUGHAL "You're free, Dughal! Get out of here!"
ScriptedInstance *pInstance;
struct TRINITY_DLL_DECL npc_dughal_stormwingAI : public npc_escortAI
{
npc_dughal_stormwingAI(Creature *c) : npc_escortAI(c) { Reset(); }
void WaypointReached(uint32 i)
{
switch(i)
{
case 0:m_creature->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break;
case 1:pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break;
case 2:
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED);
break;
}
}
void Aggro(Unit* who) { }
void Reset() {}
void JustDied(Unit* killer)
{
if (IsBeingEscorted && killer == m_creature)
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_ENDED);
}
}
void UpdateAI(const uint32 diff)
{
if(pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
if( (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_ENDED )
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
else
{
m_creature->SetVisibility(VISIBILITY_ON);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
npc_escortAI::UpdateAI(diff);
}
};
CreatureAI* GetAI_npc_dughal_stormwing(Creature *_Creature)
{
npc_dughal_stormwingAI* dughal_stormwingAI = new npc_dughal_stormwingAI(_Creature);
dughal_stormwingAI->AddWaypoint(0, 280.42,-82.86, -77.12,0);
dughal_stormwingAI->AddWaypoint(1, 287.64,-87.01, -76.79,0);
dughal_stormwingAI->AddWaypoint(2, 354.63,-64.95, -67.53,0);
return (CreatureAI*)dughal_stormwingAI;
}
bool GossipHello_npc_dughal_stormwing(Player *player, Creature *_Creature)
{
if(player->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS )
{
player->ADD_GOSSIP_ITEM(0, GOSSIP_DUGHAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->SEND_GOSSIP_MENU(2846, _Creature->GetGUID());
}
return true;
}
bool GossipSelect_npc_dughal_stormwing(Player *player, Creature *_Creature, uint32 sender, uint32 action )
{
if (action == GOSSIP_ACTION_INFO_DEF + 1)
{
player->CLOSE_GOSSIP_MENU();
((npc_escortAI*)(_Creature->AI()))->Start(false, false, true, player->GetGUID());
_Creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS);
}
return true;
}
/*######
## npc_marshal_windsor
######*/
#define SAY_WINDSOR_AGGRO1 "You locked up the wrong Marshal. Prepare to be destroyed!"
#define SAY_WINDSOR_AGGRO2 "I bet you're sorry now, aren't you !?!!"
#define SAY_WINDSOR_AGGRO3 "You better hold me back $N or they are going to feel some prison house beatings."
#define SAY_WINDSOR_1 "Let's get a move on. My gear should be in the storage area up this way..."
#define SAY_WINDSOR_4_1 "Check that cell, $N. If someone is alive in there, we need to get them out."
#define SAY_WINDSOR_4_2 "Get him out of there!"
#define SAY_WINDSOR_4_3 "Good work! We're almost there, $N. This way."
#define SAY_WINDSOR_6 "This is it, $N. My stuff should be in that room. Cover me, I'm going in!"
#define SAY_WINDSOR_9 "Ah, there it is!"
#define MOB_ENTRY_REGINALD_WINDSOR 9682
Player* PlayerStart;
struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI
{
npc_marshal_windsorAI(Creature *c) : npc_escortAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
Reset();
}
void WaypointReached(uint32 i)
{
switch( i )
{
case 1:
m_creature->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID);
break;
case 7:
m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
m_creature->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 10:
m_creature->setFaction(534);
break;
case 12:
m_creature->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID);
pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS);
break;
case 13:
m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);/*EMOTE_STATE_WORK*/
break;
case 14:
pInstance->SetData(DATA_GATE_SR,0);
m_creature->setFaction(11);
break;
case 16:
m_creature->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID);
break;
case 17:
m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);/*EMOTE_STATE_WORK*/
break;
case 18:
pInstance->SetData(DATA_GATE_SC,0);
break;
case 19:
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
m_creature->SummonCreature(MOB_ENTRY_REGINALD_WINDSOR,403.61,-51.71,-63.92,3.600434,TEMPSUMMON_DEAD_DESPAWN ,0);
pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_ENDED);
break;
}
}
void Aggro(Unit* who)
{
switch(rand()%3)
{
case 0:m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);break;
case 1:m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);break;
case 2:m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID);break;
}
}
void Reset() {}
void JustDied(Unit *slayer)
{
pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_FAILED);
}
void UpdateAI(const uint32 diff)
{
if(pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
if(pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED)
IsOnHold = false;
if(!pInstance->GetData(DATA_GATE_D) && pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED )
{
m_creature->Say(SAY_WINDSOR_4_2, LANG_UNIVERSAL, PlayerGUID);
pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_BEFORE_START);
}
if( pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_OBJECTIVE_COMPLETED )
{
m_creature->Say(SAY_WINDSOR_4_3, LANG_UNIVERSAL, PlayerGUID);
pInstance->SetData(DATA_DUGHAL, ENCOUNTER_STATE_ENDED);
}
if( (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_SUPPLY_ROOM) == ENCOUNTER_STATE_ENDED )
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
else
{
m_creature->SetVisibility(VISIBILITY_ON);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
npc_escortAI::UpdateAI(diff);
}
};
CreatureAI* GetAI_npc_marshal_windsor(Creature *_Creature)
{
npc_marshal_windsorAI* marshal_windsorAI = new npc_marshal_windsorAI(_Creature);
marshal_windsorAI->AddWaypoint(0, 316.336,-225.528, -77.7258,7000);
marshal_windsorAI->AddWaypoint(1, 316.336,-225.528, -77.7258,2000);
marshal_windsorAI->AddWaypoint(2, 322.96,-207.13, -77.87,0);
marshal_windsorAI->AddWaypoint(3, 281.05,-172.16, -75.12,0);
marshal_windsorAI->AddWaypoint(4, 272.19,-139.14, -70.61,0);
marshal_windsorAI->AddWaypoint(5, 283.62,-116.09, -70.21,0);
marshal_windsorAI->AddWaypoint(6, 296.18,-94.30, -74.08,0);
marshal_windsorAI->AddWaypoint(7, 294.57,-93.11, -74.08,0);
marshal_windsorAI->AddWaypoint(8, 314.31,-74.31, -76.09,0);
marshal_windsorAI->AddWaypoint(9, 360.22,-62.93, -66.77,0);
marshal_windsorAI->AddWaypoint(10, 383.38,-69.40, -63.25,0);
marshal_windsorAI->AddWaypoint(11, 389.99,-67.86, -62.57,0);
marshal_windsorAI->AddWaypoint(12, 400.98,-72.01, -62.31,0);
marshal_windsorAI->AddWaypoint(13, 404.22,-62.30, -63.50,2300);
marshal_windsorAI->AddWaypoint(14, 404.22,-62.30, -63.50,1500);
marshal_windsorAI->AddWaypoint(154, 407.65,-51.86, -63.96,0);
marshal_windsorAI->AddWaypoint(16, 403.61,-51.71, -63.92,1000);
marshal_windsorAI->AddWaypoint(17, 403.61,-51.71, -63.92,2000);
marshal_windsorAI->AddWaypoint(18, 403.61,-51.71, -63.92,1000);
marshal_windsorAI->AddWaypoint(19, 403.61,-51.71, -63.92,0);
return (CreatureAI*)marshal_windsorAI;
}
bool QuestAccept_npc_marshal_windsor(Player *player, Creature *creature, Quest const *quest )
{
if( quest->GetQuestId() == 4322 )
{PlayerStart = player;
if( pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED )
{
((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_IN_PROGRESS);
creature->setFaction(11);
}
}
return false;
}
/*######
## npc_marshal_reginald_windsor
######*/
#define SAY_REGINALD_WINDSOR_0_1 "Can you feel the power, $N??? It's time to ROCK!"
#define SAY_REGINALD_WINDSOR_0_2 "Now we just have to free Tobias and we can get out of here. This way!"
#define SAY_REGINALD_WINDSOR_5_1 "Open it."
#define SAY_REGINALD_WINDSOR_5_2 "I never did like those two. Let's get moving."
#define SAY_REGINALD_WINDSOR_7_1 "Open it and be careful this time!"
#define SAY_REGINALD_WINDSOR_7_2 "That intolerant dirtbag finally got what was coming to him. Good riddance!"
#define SAY_REGINALD_WINDSOR_7_3 "Alright, let's go."
#define SAY_REGINALD_WINDSOR_13_1 "Open it. We need to hurry up. I can smell those Dark Irons coming a mile away and I can tell you one thing, they're COMING!"
#define SAY_REGINALD_WINDSOR_13_2 "Administering fists of fury on Crest Killer!"
#define SAY_REGINALD_WINDSOR_13_3 "He has to be in the last cell. Unless... they killed him."
#define SAY_REGINALD_WINDSOR_14_1 "Get him out of there!"
#define SAY_REGINALD_WINDSOR_14_2 "Excellent work, $N. Let's find the exit. I think I know the way. Follow me!"
#define SAY_REGINALD_WINDSOR_20_1 "We made it!"
#define SAY_REGINALD_WINDSOR_20_2 "Meet me at Maxwell's encampment. We'll go over the next stages of the plan there and figure out a way to decode my tablets without the decryption ring."
#define MOB_ENTRY_SHILL_DINGER 9678
#define MOB_ENTRY_CREST_KILLER 9680
int wp = 0;
struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI
{
npc_marshal_reginald_windsorAI(Creature *c) : npc_escortAI(c)
{
Reset();
}
void WaypointReached(uint32 i)
{
wp=i;
switch( i )
{
case 0:
m_creature->setFaction(11);
m_creature->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID);
break;
case 1:
m_creature->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID);
break;
case 7:
m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
m_creature->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 8:
m_creature->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID);
break;
case 11:
m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
m_creature->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 12:
m_creature->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID);
break;
case 13:
m_creature->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID);
break;
case 20:
m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
m_creature->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 21:
m_creature->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID);
break;
case 23:
m_creature->HandleEmoteCommand(EMOTE_STATE_POINT);
m_creature->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID);
IsOnHold=true;
break;
case 24:
m_creature->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID);
break;
case 31:
m_creature->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID);
break;
case 32:
m_creature->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID);
PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK,m_creature);
pInstance->SetData(DATA_SHILL,ENCOUNTER_STATE_ENDED);
break;
}
}
void MoveInLineOfSight(Unit *who)
{
if( IsBeingEscorted )
return;
if( who->GetTypeId() == TYPEID_PLAYER )
{
if( ((Player*)who)->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE )
{
float Radius = 10.0;
if( m_creature->IsWithinDistInMap(who, Radius) )
{
IsOnHold = false;
((npc_escortAI*)(m_creature->AI()))->Start(true, true, false, who->GetGUID());
}
}
}
}
void Aggro(Unit* who)
{
switch(rand()%3)
{
case 0:m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);break;
case 1:m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);break;
case 2:m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID);break;
}
}
void Reset() {}
void JustDied(Unit *slayer)
{
pInstance->SetData(DATA_QUEST_JAIL_BREAK,ENCOUNTER_STATE_FAILED);
}
void UpdateAI(const uint32 diff)
{
if(pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
if(wp==7)
{
if(!pInstance->GetData(DATA_GATE_J) && pInstance->GetData(DATA_JAZ) == ENCOUNTER_STATE_NOT_STARTED )
{
pInstance->SetData(DATA_CREATURE_JAZ,1);
pInstance->SetData(DATA_JAZ,ENCOUNTER_STATE_IN_PROGRESS);
}
if( pInstance->GetData(DATA_CREATURE_JAZ) && pInstance->GetData(DATA_CREATURE_OGRABISI) && pInstance->GetData(DATA_JAZ) == ENCOUNTER_STATE_IN_PROGRESS )
{
IsOnHold = false;
pInstance->SetData(DATA_JAZ,ENCOUNTER_STATE_ENDED);
}
}
else if(wp==11)
{
if(!pInstance->GetData(DATA_GATE_S) && pInstance->GetData(DATA_SHILL) == ENCOUNTER_STATE_NOT_STARTED )
{
pInstance->SetData(DATA_CREATURE_SHILL,1);
pInstance->SetData(DATA_SHILL,ENCOUNTER_STATE_IN_PROGRESS);
}
if( pInstance->GetData(DATA_CREATURE_SHILL) && pInstance->GetData(DATA_SHILL) == ENCOUNTER_STATE_IN_PROGRESS )
{
pInstance->SetData(DATA_SHILL,ENCOUNTER_STATE_ENDED);
IsOnHold = false;
}
}
else if(wp==20)
{
if(!pInstance->GetData(DATA_GATE_C) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_NOT_STARTED)
{
pInstance->SetData(DATA_CREATURE_CREST,1);
m_creature->Say(SAY_REGINALD_WINDSOR_13_2, LANG_UNIVERSAL, PlayerGUID);
pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_IN_PROGRESS);
}
if( pInstance->GetData(DATA_CREATURE_CREST) && pInstance->GetData(DATA_CREST) == ENCOUNTER_STATE_IN_PROGRESS )
{
IsOnHold = false;
pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_ENDED);
}
}
if( pInstance->GetData(DATA_TOBIAS)==ENCOUNTER_STATE_OBJECTIVE_COMPLETED ) IsOnHold = false;
npc_escortAI::UpdateAI(diff);
}
};
CreatureAI* GetAI_npc_marshal_reginald_windsor(Creature *_Creature)
{
npc_marshal_reginald_windsorAI* marshal_reginald_windsorAI = new npc_marshal_reginald_windsorAI(_Creature);
marshal_reginald_windsorAI->AddWaypoint(0, 403.61,-52.71, -63.92,4000);
marshal_reginald_windsorAI->AddWaypoint(1, 403.61,-52.71, -63.92,4000);
marshal_reginald_windsorAI->AddWaypoint(2, 406.33,-54.87, -63.95,0);
marshal_reginald_windsorAI->AddWaypoint(3, 407.99,-73.91, -62.26,0);
marshal_reginald_windsorAI->AddWaypoint(4, 557.03,-119.71, -61.83,0);
marshal_reginald_windsorAI->AddWaypoint(5, 573.40,-124.39, -65.07,0);
marshal_reginald_windsorAI->AddWaypoint(6, 593.91,-130.29, -69.25,0);
marshal_reginald_windsorAI->AddWaypoint(7, 593.21,-132.16, -69.25,0);
marshal_reginald_windsorAI->AddWaypoint(8, 593.21,-132.16, -69.25,3000);
marshal_reginald_windsorAI->AddWaypoint(9, 622.81,-135.55, -71.92,0);
marshal_reginald_windsorAI->AddWaypoint(10, 634.68,-151.29, -70.32,0);
marshal_reginald_windsorAI->AddWaypoint(11, 635.06,-153.25, -70.32,0);
marshal_reginald_windsorAI->AddWaypoint(12, 635.06,-153.25, -70.32,3000);
marshal_reginald_windsorAI->AddWaypoint(13, 635.06,-153.25, -70.32,1500);
marshal_reginald_windsorAI->AddWaypoint(14, 655.25,-172.39, -73.72,0);
marshal_reginald_windsorAI->AddWaypoint(15, 654.79,-226.30, -83.06,0);
marshal_reginald_windsorAI->AddWaypoint(16, 622.85,-268.85, -83.96,0);
marshal_reginald_windsorAI->AddWaypoint(17, 579.45,-275.56, -80.44,0);
marshal_reginald_windsorAI->AddWaypoint(18, 561.19,-266.85, -75.59,0);
marshal_reginald_windsorAI->AddWaypoint(19, 547.91,-253.92, -70.34,0);
marshal_reginald_windsorAI->AddWaypoint(20, 549.20,-252.40, -70.34,0);
marshal_reginald_windsorAI->AddWaypoint(21, 549.20,-252.40, -70.34,4000);
marshal_reginald_windsorAI->AddWaypoint(22, 555.33,-269.16, -74.40,0);
marshal_reginald_windsorAI->AddWaypoint(23, 554.31,-270.88, -74.40,0);
marshal_reginald_windsorAI->AddWaypoint(24, 554.31,-270.88, -74.40,4000);
marshal_reginald_windsorAI->AddWaypoint(25, 536.10,-249.60, -67.47,0);
marshal_reginald_windsorAI->AddWaypoint(26, 520.94,-216.65, -59.28,0);
marshal_reginald_windsorAI->AddWaypoint(27, 505.99,-148.74, -62.17,0);
marshal_reginald_windsorAI->AddWaypoint(28, 484.21,-56.24, -62.43,0);
marshal_reginald_windsorAI->AddWaypoint(29, 470.39,-6.01, -70.10,0);
marshal_reginald_windsorAI->AddWaypoint(30, 451.27,30.85, -70.07,0);
marshal_reginald_windsorAI->AddWaypoint(31, 452.45,29.85, -70.37,1500); //tezi trqbva da se opravqt
marshal_reginald_windsorAI->AddWaypoint(32, 452.45,29.85, -70.37,7000);
marshal_reginald_windsorAI->AddWaypoint(33, 452.45,29.85, -70.37,10000);
marshal_reginald_windsorAI->AddWaypoint(34, 451.27,31.85, -70.07,0);
return (CreatureAI*)marshal_reginald_windsorAI;
}
/*######
## npc_tobias_seecher
######*/
#define SAY_TOBIAS_FREE "Thank you! I will run for safety immediately!"
struct TRINITY_DLL_DECL npc_tobias_seecherAI : public npc_escortAI
{
npc_tobias_seecherAI(Creature *c) :npc_escortAI(c) {Reset();}
void Aggro(Unit* who) { }
void Reset() {}
void JustDied(Unit* killer)
{
if (IsBeingEscorted && killer == m_creature)
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED);
}
}
void WaypointReached(uint32 i)
{
switch(i)
{
case 0:m_creature->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break;
case 2:
pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break;
case 4:
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED);
break;
}
}
void UpdateAI(const uint32 diff)
{
if(pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_NOT_STARTED) return;
if( (pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_FAILED || pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_ENDED)&& pInstance->GetData(DATA_TOBIAS) == ENCOUNTER_STATE_ENDED )
{
m_creature->SetVisibility(VISIBILITY_OFF);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
else
{
m_creature->SetVisibility(VISIBILITY_ON);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
}
npc_escortAI::UpdateAI(diff);
}
};
CreatureAI* GetAI_npc_tobias_seecher(Creature *_Creature)
{
npc_tobias_seecherAI* tobias_seecherAI = new npc_tobias_seecherAI(_Creature);
tobias_seecherAI->AddWaypoint(0, 549.21, -281.07, -75.27);
tobias_seecherAI->AddWaypoint(1, 554.39, -267.39, -73.68);
tobias_seecherAI->AddWaypoint(2, 533.59, -249.38, -67.04);
tobias_seecherAI->AddWaypoint(3, 519.44, -217.02, -59.34);
tobias_seecherAI->AddWaypoint(4, 506.55, -153.49, -62.34);
return (CreatureAI*)tobias_seecherAI;
}
bool GossipHello_npc_tobias_seecher(Player *player, Creature *_Creature)
{
if(player->GetQuestStatus(QUEST_JAIL_BREAK) == QUEST_STATUS_INCOMPLETE && pInstance->GetData(DATA_QUEST_JAIL_BREAK) == ENCOUNTER_STATE_IN_PROGRESS )
{
player->ADD_GOSSIP_ITEM(0, "Get out of here, Tobias, you're free!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
player->SEND_GOSSIP_MENU(2847, _Creature->GetGUID());
}
return true;
}
bool GossipSelect_npc_tobias_seecher(Player *player, Creature *_Creature, uint32 sender, uint32 action )
{
if (action == GOSSIP_ACTION_INFO_DEF + 1)
{
player->CLOSE_GOSSIP_MENU();
((npc_escortAI*)(_Creature->AI()))->Start(false, false, true, player->GetGUID());
_Creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_IN_PROGRESS);
}
return true;
}
/*######
##
######*/
@@ -234,4 +791,29 @@ void AddSC_blackrock_depths()
newscript->pGossipHello = &GossipHello_npc_lokhtos_darkbargainer;
newscript->pGossipSelect = &GossipSelect_npc_lokhtos_darkbargainer;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_dughal_stormwing";
newscript->pGossipHello = &GossipHello_npc_dughal_stormwing;
newscript->pGossipSelect = &GossipSelect_npc_dughal_stormwing;
newscript->GetAI = &GetAI_npc_dughal_stormwing;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_tobias_seecher";
newscript->pGossipHello = &GossipHello_npc_tobias_seecher;
newscript->pGossipSelect = &GossipSelect_npc_tobias_seecher;
newscript->GetAI = &GetAI_npc_tobias_seecher;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_marshal_windsor";
newscript->pQuestAccept = &QuestAccept_npc_marshal_windsor;
newscript->GetAI = &GetAI_npc_marshal_windsor;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_marshal_reginald_windsor";
newscript->GetAI = &GetAI_npc_marshal_reginald_windsor;
newscript->RegisterSelf();
}
@@ -0,0 +1,35 @@
/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software licensed under GPL version 2
* Please see the included DOCS/LICENSE.TXT for more information */
#ifndef DEF_BLACKROCK_DEPTHS_H
#define DEF_BLACKROCK_DEPTHS_H
#define DATA_DUGHAL 0
#define DATA_SUPPLY_ROOM 1
#define DATA_JAZ 2
#define DATA_SHILL 3
#define DATA_CREST 4
#define DATA_TOBIAS 5
#define DATA_QUEST_JAIL_BREAK 6
#define ENCOUNTER_STATE_NOT_STARTED 100
#define ENCOUNTER_STATE_BEFORE_START 101
#define ENCOUNTER_STATE_IN_PROGRESS 102
#define ENCOUNTER_STATE_OBJECTIVE_COMPLETED 103
#define ENCOUNTER_STATE_ENDED 104
#define ENCOUNTER_STATE_FAILED 105
#define DATA_GATE_D 111
#define DATA_GATE_SR 112
#define DATA_GATE_J 113
#define DATA_GATE_S 114
#define DATA_GATE_C 115
#define DATA_GATE_T 116
#define DATA_GATE_SC 117
#define DATA_CREATURE_JAZ 118
#define DATA_CREATURE_OGRABISI 119
#define DATA_CREATURE_CREST 120
#define DATA_CREATURE_SHILL 121
#endif
@@ -0,0 +1,238 @@
/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* ScriptData
SDName: Instance_Blackrock_Depths
SD%Complete: 100
SDComment:
SDCategory: Blackrock Depths
EndScriptData */
/*
update `creature_template` set `npcflag`='1',`ScriptName`='npc_dughal_stormwing' where `entry`='9022';
update `creature_template` set `ScriptName`='npc_marshal_windsor' where `entry`='9023';
update `creature_template` set `ScriptName`='npc_marshal_reginald_windsor' where `entry`='9682';
update `creature_template` set `npcflag`='1',`ScriptName`='npc_tobias_seecher' where `entry`='9679';
update `instance_template` set `script`='instance_blackrock_depths' where `map`='230';
*/
#include "GameObject.h"
#include "precompiled.h"
#include "def_blackrock_depths.h"
#define ENCOUNTERS 7
struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance
{
instance_blackrock_depths(Map *map) : ScriptedInstance(map) {Initialize();};
uint64 GateDughal;
uint64 SupplyRoomGate;
uint64 GateJaz;
uint64 GateShill;
uint64 GateCrest;
uint64 GateTobias;
uint64 SupplyCrate;
uint64 Jaz;
uint64 Ograbisi;
uint64 ShillDinger;
uint64 CrestKiller;
bool Encounters[ENCOUNTERS];
void Initialize()
{
GateDughal = 0;
SupplyRoomGate = 0;
GateJaz = 0;
GateShill = 0;
GateCrest = 0;
GateTobias = 0;
SupplyCrate = 0;
Jaz = 0;
Ograbisi = 0;
ShillDinger = 0;
CrestKiller = 0;
for(uint8 i = 0; i < ENCOUNTERS; i++)
Encounters[i] = false;
}
bool IsEncounterInProgress() const
{
for(uint8 i = 0; i < ENCOUNTERS; i++)
if(Encounters[i]) return true;
return false;
}
void OpenGO(uint64 DoorGUID, bool open)
{
if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID))
Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
}
void CloseGO(uint64 DoorGUID, bool close)
{
if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID))
Door->SetUInt32Value(GAMEOBJECT_STATE, close ? 1 : 0);
}
uint32 GetData(uint32 type)
{
uint32 state = 0;
switch(type)
{
case DATA_DUGHAL: return Encounters[0];break;
case DATA_SUPPLY_ROOM: return Encounters[1];break;
case DATA_JAZ: return Encounters[2];break;
case DATA_SHILL: return Encounters[3];break;
case DATA_CREST: return Encounters[4];break;
case DATA_TOBIAS: return Encounters[5];break;
case DATA_QUEST_JAIL_BREAK: return Encounters[6];break;
case DATA_GATE_D: return GateDughal; break;
case DATA_GATE_T: return GateTobias; break;
case DATA_GATE_C: return GateCrest; break;
case DATA_GATE_J: return GateJaz; break;
case DATA_GATE_S: return GateShill; break;
case DATA_CREATURE_JAZ:
if((((Creature*)Jaz)->isDead()))
// state = 1;
//else
// state = 0;
break;
case DATA_CREATURE_OGRABISI:
if((((Creature*)Ograbisi)->isDead()))
// state = 1;
//else
// state = 0;
break;
case DATA_CREATURE_CREST:
if((((Creature*)CrestKiller)->isDead()))
// state = 1;
//else
// state = 0;
break;
case DATA_CREATURE_SHILL:
if((((Creature*)ShillDinger)->isDead()))
// state = 1;
//else
// state = 0;
break;
}
return state;
}
void OnObjectCreate(GameObject *go)
{
switch(go->GetEntry())
{
case 170561: SupplyRoomGate = go->GetGUID(); go->GetUInt32Value(GAMEOBJECT_STATE); break;
case 170562: GateDughal = go->GetGUID(); break;
case 170566: GateTobias = go->GetGUID(); break;
case 170567: GateCrest = go->GetGUID(); break;
case 170568: GateJaz = go->GetGUID(); break;
case 170569: GateShill = go->GetGUID(); break;
case 166872: SupplyCrate = go->GetGUID(); break;
}
}
void OnCreatureCreate(Creature *creature, uint32 creature_entry)
{
switch(creature_entry)
{
case 9680: CrestKiller = creature->GetGUID(); break;
case 9677: Ograbisi = creature->GetGUID(); break;
case 9681: Jaz = creature->GetGUID(); break;
case 9678: ShillDinger = creature->GetGUID(); break;
}
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_DUGHAL: Encounters[0] = data; break;
case DATA_SUPPLY_ROOM: Encounters[1] = data; break;
case DATA_JAZ: Encounters[2] = data; break;
case DATA_SHILL: Encounters[3] = data; break;
case DATA_CREST: Encounters[4] = data; break;
case DATA_TOBIAS: Encounters[5] = data; break;
case DATA_QUEST_JAIL_BREAK: Encounters[6] = data; break;
case DATA_GATE_SR:
if(SupplyRoomGate)
{
if(data == NOT_STARTED)
OpenGO(SupplyRoomGate, true);
else
CloseGO(SupplyRoomGate, true);
}
break;
case DATA_GATE_SC:
if(SupplyCrate)
{
if(data == NOT_STARTED)
OpenGO(SupplyCrate, true);
else
CloseGO(SupplyCrate, true);
}
break;
case DATA_CREATURE_JAZ:
if(data)
{
(((Creature*)Jaz)->setFaction(54));
(((Creature*)Ograbisi)->setFaction(54));
(((Creature*)Ograbisi)->Say("Ograbisi needs new hat", LANG_UNIVERSAL, NULL));
}
else
{
(((Creature*)Jaz)->setFaction(35));
(((Creature*)Ograbisi)->setFaction(35));
}
break;
case DATA_CREATURE_SHILL:
if(data)
(((Creature*)ShillDinger)->setFaction(54));
else
(((Creature*)ShillDinger)->setFaction(35));
break;
case DATA_CREATURE_CREST:
if(data)
(((Creature*)CrestKiller)->setFaction(54));
else
(((Creature*)CrestKiller)->setFaction(35));
break;
}
}
};
InstanceData* GetInstanceData_instance_blackrock_depths(Map* map)
{
return new instance_blackrock_depths(map);
}
void AddSC_instance_blackrock_depths()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_blackrock_depths";
newscript->GetInstanceData = &GetInstanceData_instance_blackrock_depths;
newscript->RegisterSelf();
}
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Ghostlands
SD%Complete: 100
SDComment: Quest support: 9692. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber
SDComment: Quest support: 9692, 9212. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber
SDCategory: Ghostlands
EndScriptData */
@@ -25,9 +25,11 @@ EndScriptData */
npc_blood_knight_dawnstar
npc_budd_nedreck
npc_rathis_tomber
npc_ranger_lilatha
EndContentData */
#include "precompiled.h"
#include "../../npc/npc_escortAI.h"
/*######
## npc_blood_knight_dawnstar
@@ -125,6 +127,209 @@ bool GOHello_gilded_brazier(Player *player, GameObject* _GO)
return true;
};
/*######
## npc_ranger_lilatha
######*/
#define SAY_START "Let's go."
#define SAY_PROGRESS1 "$N, let's use the antechamber to the right."
#define SAY_PROGRESS2 "I can see the light at the end of the tunnel!"
#define SAY_PROGRESS3 "There's Farstrider Enclave now, $C. Not far to go... Look out! Troll ambush!!"
#define SAY_END1 "Thank you for saving my life and bringing me back to safety, $N"
#define SAY_END2 "Captain Helios, I've been rescued from the Amani Catacombs. Reporting for duty, sir!"
#define CAPTAIN_ANSWER "Liatha, get someone to look at those injuries. Thank you for bringing her back safely."
#define QUEST_ESCAPE_FROM_THE_CATACOMBS 9212
#define GO_CAGE 181152
#define NPC_CAPTAIN_HELIOS 16220
struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI
{
npc_ranger_lilathaAI(Creature *c) : npc_escortAI(c) {Reset();}
std::list<GameObject*> CageList;
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);
setCage(true);
DoSay(SAY_START, LANG_UNIVERSAL, player);
break;
}
case 5:
DoSay(SAY_PROGRESS1, LANG_UNIVERSAL, player); break;
case 11:
DoSay(SAY_PROGRESS2, LANG_UNIVERSAL, player);
m_creature->SetOrientation(4.762841);
break;
case 18:
{
DoSay(SAY_PROGRESS3, LANG_UNIVERSAL, player);
Creature* Summ1 = m_creature->SummonCreature(16342, 7627.083984, -7532.538086, 152.128616, 1.082733, TEMPSUMMON_DEAD_DESPAWN, 0);
Creature* Summ2 = m_creature->SummonCreature(16343, 7620.432129, -7532.550293, 152.454865, 0.827478, TEMPSUMMON_DEAD_DESPAWN, 0);
Summ1->Attack(m_creature, true);
Summ2->Attack(player, true);
m_creature->AI()->AttackStart(Summ1);
break;
}
case 19:
m_creature->SetSpeed(MOVE_RUN, 1.5f); break;
case 25:
m_creature->SetSpeed(MOVE_WALK, 1.0f); break;
case 30:
if (player && player->GetTypeId() == TYPEID_PLAYER)
((Player*)player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS,m_creature);
break;
case 32:
m_creature->SetOrientation(2.978281);
DoSay(SAY_END1, LANG_UNIVERSAL, player);
break;
case 33:
m_creature->SetOrientation(5.858011);
DoSay(SAY_END2, LANG_UNIVERSAL, player);
captainAnswer();
break;
}
}
void Aggro(Unit* who) {}
void Reset()
{
if (!IsBeingEscorted)
m_creature->setFaction(1602);
setCage(false);
}
void JustDied(Unit* killer)
{
if (PlayerGUID)
{
Unit* player = Unit::GetUnit((*m_creature), PlayerGUID);
if (player)
((Player*)player)->FailQuest(QUEST_ESCAPE_FROM_THE_CATACOMBS);
}
}
void UpdateAI(const uint32 diff)
{
npc_escortAI::UpdateAI(diff);
}
void setCage(bool open)
{
CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::AllGameObjectsWithEntryInGrid go_check(GO_CAGE);
Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid> go_search(CageList, go_check);
TypeContainerVisitor
<Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInGrid>, GridTypeMapContainer> go_visit(go_search);
CellLock<GridReadGuard> cell_lock(cell, pair);
cell_lock->Visit(cell_lock, go_visit, *(m_creature->GetMap()));
if (!CageList.empty())
{
for(std::list<GameObject*>::iterator itr = CageList.begin(); itr != CageList.end(); ++itr)
{
if( open )
(*itr)->SetGoState(0);
else
(*itr)->SetGoState(1);
}
} else error_log("SD2 ERROR: CageList is empty!");
}
void captainAnswer()
{
CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
std::list<Creature*> NPCList;
Trinity::AllCreaturesOfEntryInRange check(m_creature, NPC_CAPTAIN_HELIOS, 100);
Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(NPCList, check);
TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher);
CellLock<GridReadGuard> cell_lock(cell, pair);
cell_lock->Visit(cell_lock, visitor, *(m_creature->GetMap()));
if (!NPCList.empty())
{
for(std::list<Creature*>::iterator itr = NPCList.begin(); itr != NPCList.end(); ++itr)
{
(*itr)->Say(CAPTAIN_ANSWER, LANG_UNIVERSAL, PlayerGUID);
}
}else error_log("SD2 ERROR: Captain Helios not found!");
}
};
bool QuestAccept_npc_ranger_lilatha(Player* player, Creature* creature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS)
{
creature->setFaction(1603);
((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID());
}
return true;
}
CreatureAI* GetAI_npc_ranger_lilathaAI(Creature *_Creature)
{
npc_ranger_lilathaAI* ranger_lilathaAI = new npc_ranger_lilathaAI(_Creature);
ranger_lilathaAI->AddWaypoint(0, 7545.07, -7359.87, 162.354, 4000); // Say0
ranger_lilathaAI->AddWaypoint(1, 7550.048340, -7362.237793, 162.235657);
ranger_lilathaAI->AddWaypoint(2, 7566.976074, -7364.315430, 161.738770);
ranger_lilathaAI->AddWaypoint(3, 7578.830566, -7361.677734, 161.738770);
ranger_lilathaAI->AddWaypoint(4, 7590.969238, -7359.053711, 162.257660);
ranger_lilathaAI->AddWaypoint(5, 7598.354004, -7362.815430, 162.256683, 4000); // Say1
ranger_lilathaAI->AddWaypoint(6, 7605.861328, -7380.424316, 161.937073);
ranger_lilathaAI->AddWaypoint(7, 7605.295410, -7387.382813, 157.253998);
ranger_lilathaAI->AddWaypoint(8, 7606.131836, -7393.893555, 156.941925);
ranger_lilathaAI->AddWaypoint(9, 7615.207520, -7400.187012, 157.142639);
ranger_lilathaAI->AddWaypoint(10, 7618.956543, -7402.652832, 158.202042);
ranger_lilathaAI->AddWaypoint(11, 7636.850586, -7401.756836, 162.144791);
ranger_lilathaAI->AddWaypoint(12, 7637.058105, -7404.944824, 162.206970, 4000);// Say2
ranger_lilathaAI->AddWaypoint(13, 7636.910645, -7412.585449, 162.366425);
ranger_lilathaAI->AddWaypoint(14, 7637.607910, -7425.591797, 162.630661);
ranger_lilathaAI->AddWaypoint(15, 7637.816895, -7459.057129, 163.302704);
ranger_lilathaAI->AddWaypoint(16, 7638.859863, -7470.902344, 162.517059);
ranger_lilathaAI->AddWaypoint(17, 7641.395996, -7488.217285, 157.381287);
ranger_lilathaAI->AddWaypoint(18, 7634.455566, -7505.451660, 154.682159);
ranger_lilathaAI->AddWaypoint(19, 7631.906738, -7516.948730, 153.597382); // say3
ranger_lilathaAI->AddWaypoint(20, 7622.231445, -7537.037598, 151.587112);
ranger_lilathaAI->AddWaypoint(21, 7610.921875, -7550.670410, 149.639374);
ranger_lilathaAI->AddWaypoint(22, 7598.229004, -7562.551758, 145.953888);
ranger_lilathaAI->AddWaypoint(23, 7588.509277, -7577.755371, 148.294479);
ranger_lilathaAI->AddWaypoint(24, 7567.339355, -7608.456055, 146.006485);
ranger_lilathaAI->AddWaypoint(25, 7562.547852, -7617.417969, 148.097504);
ranger_lilathaAI->AddWaypoint(26, 7561.508789, -7645.064453, 151.245163);
ranger_lilathaAI->AddWaypoint(27, 7563.337402, -7654.652344, 151.227158);
ranger_lilathaAI->AddWaypoint(28, 7565.533691, -7658.296387, 151.248886);
ranger_lilathaAI->AddWaypoint(29, 7571.155762, -7659.118652, 151.244568);
ranger_lilathaAI->AddWaypoint(30, 7579.119629, -7662.213867, 151.651505);
ranger_lilathaAI->AddWaypoint(31, 7603.768066, -7667.000488, 153.997726);
ranger_lilathaAI->AddWaypoint(32, 7603.768066, -7667.000488, 153.997726, 4000); // Say4 & Set orientation
ranger_lilathaAI->AddWaypoint(33, 7603.768066, -7667.000488, 153.997726, 8000); // Say5 & Set orientation
ranger_lilathaAI->AddWaypoint(34, 7603.768066, -7667.000488, 153.997726);
return (CreatureAI*)ranger_lilathaAI;
}
void AddSC_ghostlands()
{
Script *newscript;
@@ -151,4 +356,10 @@ void AddSC_ghostlands()
newscript->Name = "go_gilded_brazier";
newscript->pGOHello = &GOHello_gilded_brazier;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_ranger_lilatha";
newscript->GetAI = &GetAI_npc_ranger_lilathaAI;
newscript->pQuestAccept = &QuestAccept_npc_ranger_lilatha;
newscript->RegisterSelf();
}
@@ -17,12 +17,14 @@
/* ScriptData
SDName: Tirisfal_Glades
SD%Complete: 100
SDComment: Quest support: 590
SDComment: Quest support: 590, 1819
SDCategory: Tirisfal Glades
EndScriptData */
/* ContentData
npc_calvin_montague
go_mausoleum_door
go_mausoleum_trigger
EndContentData */
#include "precompiled.h"
@@ -76,6 +78,66 @@ bool QuestAccept_npc_calvin_montague(Player* player, Creature* creature, Quest c
return true;
}
/*######
## go_mausoleum_door
## go_mausoleum_trigger
######*/
#define QUEST_ULAG 1819
#define C_ULAG 6390
#define GO_TRIGGER 104593
#define GO_DOOR 176594
GameObject* SearchMausoleumGo(Unit *source, uint32 entry, float range)
{
GameObject* pGo = NULL;
CellPair pair(Trinity::ComputeCellPair(source->GetPositionX(), source->GetPositionY()));
Cell cell(pair);
cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*source, entry, range);
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> searcher(pGo, go_check);
TypeContainerVisitor<Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer> go_searcher(searcher);
CellLock<GridReadGuard> cell_lock(cell, pair);
cell_lock->Visit(cell_lock, go_searcher,*(source->GetMap()));
return pGo;
}
bool GOHello_go_mausoleum_door(Player *player, GameObject* _GO)
{
if (player->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE)
return false;
if (GameObject *trigger = SearchMausoleumGo(player, GO_TRIGGER, 30))
{
trigger->SetGoState(1);
player->SummonCreature(C_ULAG, 2390.26, 336.47, 40.01, 2.26, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000);
return false;
}
return false;
}
bool GOHello_go_mausoleum_trigger(Player *player, GameObject* _GO)
{
if (player->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE)
return false;
if (GameObject *door = SearchMausoleumGo(player, GO_DOOR, 30))
{
_GO->SetGoState(0);
door->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_INTERACT_COND);
return true;
}
return false;
}
void AddSC_tirisfal_glades()
{
Script *newscript;
@@ -84,5 +146,15 @@ void AddSC_tirisfal_glades()
newscript->Name="npc_calvin_montague";
newscript->GetAI = &GetAI_npc_calvin_montague;
newscript->pQuestAccept = &QuestAccept_npc_calvin_montague;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_mausoleum_door";
newscript->pGOHello = &GOHello_go_mausoleum_door;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_mausoleum_trigger";
newscript->pGOHello = &GOHello_go_mausoleum_trigger;
newscript->RegisterSelf();
}