*Adding parts for quest 4322 for future development.

--HG--
branch : trunk
This commit is contained in:
Blaymoira
2008-12-22 21:10:15 +01:00
parent 7c509e465f
commit 22413c016e
6 changed files with 879 additions and 0 deletions
@@ -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();
}