*Azjol'Nerub - Register instance script & GO handling for first boss door, by Tartalo

*Krik'thir the Gatewatcher - Fix compile on *nix + merge npc AIs, by Tartalo
*Halls of Stone - Merge from SD2, scripting by ckegg, merge by Tartalo

--HG--
branch : trunk
This commit is contained in:
maximius committed 2009-10-01 20:08:14 -07:00
1 parent 340db23ea9
commit b00b00ab9a
14 files changed
+1848 -79

No files matched your search

+1
View File
@@ -359,6 +359,7 @@ SET(trinityscript_LIB_SRCS
scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp
scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp
scripts/northrend/ulduar/halls_of_stone/def_halls_of_stone.h
scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp
scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp
scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp
scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp
@@ -63,7 +63,35 @@ enum Yells
SAY_SWARM_2 = -1601008,
SAY_PREFIGHT_1 = -1601009,
SAY_PREFIGHT_2 = -1601010,
SAY_PREFIGHT_3 = -1601011
SAY_PREFIGHT_3 = -1601011,
//npc spells
H_SPELL_ACID_SPLASH = 59363,
SPELL_ACID_SPLASH = 52446,
SPELL_CHARGE = 16979,//maybe is another spell
SPELL_BACKSTAB = 52540,
SPELL_SHADOW_BOLT = 52534,
H_SPELL_SHADOW_BOLT = 59357,
SPELL_SHADOW_NOVA = 52535,
H_SPELL_SHADOW_NOVA = 59358,
SPELL_STRIKE = 52532,
SPELL_CLEAVE = 49806,
SPELL_ENRAGE = 52470,
SPELL_INFECTED_BITE = 52469,
H_SPELL_INFECTED_BITE = 59364,
SPELL_WEB_WRAP = 52086,//the spell is not working propperly
SPELL_BLINDING_WEBS = 52524,
H_SPELL_BLINDING_WEBS = 59365,
SPELL_POSION_SPRAY = 52493,
H_SPELL_POSION_SPRAY = 59366,
};
@@ -173,7 +201,11 @@ struct TRINITY_DLL_DECL boss_krik_thirAI : public ScriptedAI
if (victim == m_creature)
return;
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2), m_creature);
switch (rand()%2)
{
case 0: DoScriptText(SAY_SLAY_1, m_creature); break;
case 1: DoScriptText(SAY_SLAY_1, m_creature); break;
}
}
void JustSummoned(Creature* summoned)
@@ -183,11 +215,338 @@ struct TRINITY_DLL_DECL boss_krik_thirAI : public ScriptedAI
}
};
struct TRINITY_DLL_DECL npc_skittering_infectorAI : public ScriptedAI
{
npc_skittering_infectorAI(Creature *c) : ScriptedAI(c) {}
void JustDied(Unit* killer)
{ //The spell is not working propperly
DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_ACID_SPLASH : SPELL_ACID_SPLASH,true);
}
};
struct TRINITY_DLL_DECL npc_anub_ar_skirmisherAI : public ScriptedAI
{
npc_anub_ar_skirmisherAI(Creature *c) : ScriptedAI(c) {}
uint32 ChargeTimer;
uint32 BackstabTimer;
void Reset()
{
ChargeTimer = 15000;
BackstabTimer = 7000;
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if(ChargeTimer < diff)
{
Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0);
while (target && target->GetTypeId() != TYPEID_PLAYER)
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if (target)
{
DoResetThreat();
m_creature->AddThreat(target,1.0f);
DoCast(target,SPELL_CHARGE,true);
}
ChargeTimer = 15000;
}else ChargeTimer -= diff;
if(BackstabTimer < diff)
{
DoCast(m_creature->getVictim(),SPELL_BACKSTAB);
BackstabTimer = 7000;
}else BackstabTimer -= diff;
DoMeleeAttackIfReady();
}
};
struct TRINITY_DLL_DECL npc_anub_ar_shadowcasterAI : public ScriptedAI
{
npc_anub_ar_shadowcasterAI(Creature *c) : ScriptedAI(c) {}
uint32 ShadowBoltTimer;
uint32 ShadowNovaTimer;
void Reset()
{
ShadowBoltTimer = 6000;
ShadowNovaTimer = 20000;
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if(ShadowBoltTimer < diff)
{
Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0);
while (target && target->GetTypeId() != TYPEID_PLAYER)
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if (target)
DoCast(target, HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT,true);
ShadowBoltTimer = 6000;
}else ShadowBoltTimer -= diff;
if(ShadowNovaTimer < diff)
{
DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_SHADOW_NOVA : SPELL_SHADOW_NOVA,true);
ShadowNovaTimer = 20000;
}else ShadowNovaTimer -= diff;
DoMeleeAttackIfReady();
}
};
struct TRINITY_DLL_DECL npc_anub_ar_warriorAI : public ScriptedAI
{
npc_anub_ar_warriorAI(Creature *c) : ScriptedAI(c){}
uint32 CleaveTimer;
uint32 StrikeTimer;
void Reset()
{
CleaveTimer = 15000;
StrikeTimer = 6000;
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if(StrikeTimer < diff)
{
m_creature->CastSpell(m_creature->getVictim(),SPELL_STRIKE,true);
StrikeTimer = 6000;
}else StrikeTimer -= diff;
if(CleaveTimer < diff)
{
m_creature->CastSpell(m_creature->getVictim(), SPELL_CLEAVE ,true);
CleaveTimer = 15000;
}else CleaveTimer -= diff;
DoMeleeAttackIfReady();
}
};
struct TRINITY_DLL_DECL npc_watcher_gashraAI : public ScriptedAI
{
npc_watcher_gashraAI(Creature *c) : ScriptedAI(c) {}
uint32 WebWrapTimer;
uint32 InfectedBiteTimer;
void Reset()
{
WebWrapTimer = 12000;
InfectedBiteTimer = 5000;
}
void EnterCombat(Unit* who)
{
m_creature->CastSpell(m_creature,SPELL_ENRAGE,true);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if(WebWrapTimer < diff)
{
Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0);
while (target && target->GetTypeId() != TYPEID_PLAYER)
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if (target)
m_creature->CastSpell(target, SPELL_WEB_WRAP,true);
WebWrapTimer = 15000;
}else WebWrapTimer -= diff;
if(InfectedBiteTimer < diff)
{
DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_INFECTED_BITE : SPELL_INFECTED_BITE,true);
InfectedBiteTimer = 6000;
}else InfectedBiteTimer -= diff;
DoMeleeAttackIfReady();
}
};
struct TRINITY_DLL_DECL npc_watcher_narjilAI : public ScriptedAI
{
npc_watcher_narjilAI(Creature *c) : ScriptedAI(c) {}
uint32 WebWrapTimer;
uint32 InfectedBiteTimer;
uint32 BlindingWebsTimer;
void Reset()
{
WebWrapTimer = 16000;
InfectedBiteTimer = 12000;
BlindingWebsTimer = 10000;
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if(WebWrapTimer < diff)
{
Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0);
while (target && target->GetTypeId() != TYPEID_PLAYER)
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if (target)
DoCast(target, SPELL_WEB_WRAP,true);
WebWrapTimer = 16000;
}else WebWrapTimer -= diff;
if(InfectedBiteTimer < diff)
{
DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_INFECTED_BITE : SPELL_INFECTED_BITE,true);
InfectedBiteTimer = 12000;
}else InfectedBiteTimer -= diff;
if(BlindingWebsTimer < diff)
{
DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_BLINDING_WEBS : SPELL_BLINDING_WEBS, true);
BlindingWebsTimer = 10000;
}else BlindingWebsTimer -= diff;
DoMeleeAttackIfReady();
}
};
struct TRINITY_DLL_DECL npc_watcher_silthikAI : public ScriptedAI
{
npc_watcher_silthikAI(Creature *c) : ScriptedAI(c) {}
uint32 WebWrapTimer;
uint32 InfectedBiteTimer;
uint32 PosionSprayTimer;
void Reset()
{
WebWrapTimer = 12000;
InfectedBiteTimer = 8000;
PosionSprayTimer = 5000;
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if(WebWrapTimer < diff)
{
Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0);
while (target && target->GetTypeId() != TYPEID_PLAYER)
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if (target)
DoCast(target, SPELL_WEB_WRAP,true);
WebWrapTimer = 12000;
}else WebWrapTimer -= diff;
if(InfectedBiteTimer < diff)
{
DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_INFECTED_BITE : SPELL_INFECTED_BITE,true);
InfectedBiteTimer = 8000;
}else InfectedBiteTimer -= diff;
if(PosionSprayTimer < diff)
{
DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_POSION_SPRAY : SPELL_POSION_SPRAY ,true);
PosionSprayTimer = 5000;
}else PosionSprayTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_krik_thir(Creature* pCreature)
{
return new boss_krik_thirAI (pCreature);
}
CreatureAI* GetAI_npc_anub_ar_skirmisher (Creature* pCreature)
{
return new npc_anub_ar_skirmisherAI (pCreature);
}
CreatureAI* GetAI_npc_skittering_infector (Creature* pCreature)
{
return new npc_skittering_infectorAI (pCreature);
}
CreatureAI* GetAI_npc_anub_ar_shadowcaster (Creature* pCreature)
{
return new npc_anub_ar_shadowcasterAI (pCreature);
}
CreatureAI* GetAI_npc_anub_ar_warrior (Creature* pCreature)
{
return new npc_anub_ar_warriorAI (pCreature);
}
CreatureAI* GetAI_npc_watcher_gashra (Creature* pCreature)
{
return new npc_watcher_gashraAI (pCreature);
}
CreatureAI* GetAI_npc_watcher_narjil (Creature* pCreature)
{
return new npc_watcher_narjilAI (pCreature);
}
CreatureAI* GetAI_npc_watcher_silthik (Creature* pCreature)
{
return new npc_watcher_silthikAI (pCreature);
}
void AddSC_boss_krik_thir()
{
Script *newscript;
@@ -196,4 +555,39 @@ void AddSC_boss_krik_thir()
newscript->Name="boss_krik_thir";
newscript->GetAI = &GetAI_boss_krik_thir;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_skittering_infector";
newscript->GetAI = &GetAI_npc_skittering_infector;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_anub_ar_skirmisher";
newscript->GetAI = &GetAI_npc_anub_ar_skirmisher;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_anub_ar_shadowcaster";
newscript->GetAI = &GetAI_npc_anub_ar_shadowcaster;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_watcher_gashra";
newscript->GetAI = &GetAI_npc_watcher_gashra;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_anub_ar_warrior";
newscript->GetAI = &GetAI_npc_anub_ar_warrior;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_watcher_silthik";
newscript->GetAI = &GetAI_npc_watcher_silthik;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="npc_watcher_narjil";
newscript->GetAI = &GetAI_npc_watcher_narjil;
newscript->RegisterSelf();
}
@@ -41,6 +41,8 @@ struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance
uint64 m_uiKrikthir;
uint64 m_uiHadronox;
uint64 m_uiAnubarak;
uint64 m_uiKrikthirDoor;
uint32 m_auiEncounter[MAX_ENCOUNTER];
@@ -51,6 +53,7 @@ struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance
m_uiKrikthir = 0;
m_uiHadronox = 0;
m_uiAnubarak =0;
m_uiKrikthirDoor = 0;
}
bool IsEncounterInProgress() const
@@ -72,6 +75,18 @@ struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance
}
}
void OnGameObjectCreate(GameObject* pGo, bool add)
{
switch (pGo->GetEntry())
{
case 192395:
m_uiKrikthirDoor = pGo->GetGUID();
if (m_auiEncounter[0] == DONE)
HandleGameObject(NULL,true,pGo);
break;
}
}
uint64 GetData64(uint32 identifier)
{
@@ -90,7 +105,10 @@ struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance
switch(type)
{
case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT:
m_auiEncounter[0] = data;break;
m_auiEncounter[0] = data;
if (data == DONE)
HandleGameObject(m_uiKrikthirDoor,true);
break;
case DATA_HADRONOX_EVENT:
m_auiEncounter[1] = data; break;
case DATA_ANUBARAK_EVENT:
@@ -10,46 +10,126 @@ Script Data End */
update creature_template set scriptname = 'boss_krystallus' where entry = '';
*** SQL END ***/
#include "precompiled.h"
#include "def_halls_of_stone.h"
//Spells
#define SPELL_BOULDER_TOSS 50843
#define SPELL_BOULDER_TOSS_2 59742
#define SPELL_GROUND_SPIKE 59750
#define SPELL_SHATTER 50810
#define SPELL_SHATTER_2 61546
#define SPELL_STOMP 48131
#define SPELL_STOMP_2 59744
enum Spells
{
SPELL_BOULDER_TOSS = 50843,
H_SPELL_BOULDER_TOSS = 59742,
SPELL_GROUND_SPIKE = 59750,
SPELL_GROUND_SLAM = 50827,
SPELL_SHATTER = 50810,
H_SPELL_SHATTER = 61546,
SPELL_STOMP = 48131,
H_SPELL_STOMP = 59744
};
//not in db
//Yell
#define SAY_AGGRO -1599000
#define SAY_KILL -1599001
#define SAY_DEATH -1599002
#define SAY_SHATTER -1599003
enum Yells
{
SAY_AGGRO = -1603007,
SAY_KILL = -1603008,
SAY_DEATH = -1603009,
SAY_SHATTER = -1603010
};
struct TRINITY_DLL_DECL boss_krystallusAI : public ScriptedAI
{
boss_krystallusAI(Creature *c) : ScriptedAI(c) {}
boss_krystallusAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
uint32 uiBoulderTossTimer;
uint32 uiGroundSpikeTimer;
uint32 uiGroundSlamTimer;
uint32 uiShatterTimer;
uint32 uiStompTimer;
bool bIsSlam;
ScriptedInstance* pInstance;
void Reset() {}
void Reset()
{
bIsSlam = false;
uiBoulderTossTimer = 3000 + rand()%6000;
uiGroundSpikeTimer = 9000 + rand()%5000;
uiGroundSlamTimer = 15000 + rand()%3000;
uiStompTimer = 20000 + rand()%9000;
uiShatterTimer = 0;
if (pInstance)
pInstance->SetData(DATA_KRYSTALLUS_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
if (pInstance)
pInstance->SetData(DATA_KRYSTALLUS_EVENT, IN_PROGRESS);
}
void AttackStart(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiBoulderTossTimer < diff)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
while (pTarget && pTarget->GetTypeId() != TYPEID_PLAYER)
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget)
DoCast(pTarget, HeroicMode ? H_SPELL_BOULDER_TOSS : SPELL_BOULDER_TOSS);
uiBoulderTossTimer = 9000 + rand()%6000;
} else uiBoulderTossTimer -= diff;
if (uiGroundSpikeTimer < diff)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
while (pTarget && pTarget->GetTypeId() != TYPEID_PLAYER)
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget)
DoCast(pTarget, SPELL_GROUND_SPIKE);
uiBoulderTossTimer = 12000 + rand()%5000;
} else uiGroundSpikeTimer < diff;
if (uiStompTimer < diff)
{
DoCast(m_creature, HeroicMode ? H_SPELL_STOMP : SPELL_STOMP);
uiStompTimer = 20000 + rand()%9000;
} else uiStompTimer -= diff;
if (uiGroundSlamTimer < diff)
{
DoCast(m_creature, SPELL_GROUND_SLAM);
bIsSlam = true;
uiShatterTimer = 10000;
uiGroundSlamTimer = 15000 + rand()%3000;
} else uiGroundSlamTimer -= diff;
if (bIsSlam)
{
if(uiShatterTimer < diff)
{
DoCast(m_creature, HeroicMode ? H_SPELL_SHATTER : SPELL_SHATTER);
bIsSlam = false;
} else uiShatterTimer -= diff;
}
DoMeleeAttackIfReady();
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
pInstance->SetData(DATA_KRYSTALLUS_EVENT, DONE);
}
void KilledUnit(Unit *victim)
{
if (victim == m_creature)
@@ -10,24 +10,29 @@ Script Data End */
update creature_template set scriptname = 'boss_maiden_of_grief' where entry = '';
*** SQL END ***/
#include "precompiled.h"
#include "def_halls_of_stone.h"
//Spell
#define SPELL_PARTING_SORROW 59723
#define SPELL_STORM_OF_GRIEF_N 50752
#define SPELL_STORM_OF_GRIEF_H 59772
#define SPELL_SHOCK_OF_SORROW_N 50760
#define SPELL_SHOCK_OF_SORROW_H 59726
#define SPELL_PILLAR_OF_WOE_N 50761
#define SPELL_PILLAR_OF_WOE_H 59727
enum Spells
{
SPELL_PARTING_SORROW = 59723,
SPELL_STORM_OF_GRIEF_N = 50752,
SPELL_STORM_OF_GRIEF_H = 59772,
SPELL_SHOCK_OF_SORROW_N = 50760,
SPELL_SHOCK_OF_SORROW_H = 59726,
SPELL_PILLAR_OF_WOE_N = 50761,
SPELL_PILLAR_OF_WOE_H = 59727
};
//Yell
#define SAY_AGGRO -1603000
#define SAY_SLAY_1 -1603001
#define SAY_SLAY_2 -1603002
#define SAY_SLAY_3 -1603003
#define SAY_SLAY_4 -1603004
#define SAY_DEATH -1603005
#define SAY_STUN -1603006
enum Yells
{
SAY_AGGRO = -1603000,
SAY_SLAY_1 = -1603001,
SAY_SLAY_2 = -1603002,
SAY_SLAY_3 = -1603003,
SAY_SLAY_4 = -1603004,
SAY_DEATH = -1603005,
SAY_STUN = -1603006
};
struct TRINITY_DLL_DECL boss_maiden_of_griefAI : public ScriptedAI
{
@@ -52,14 +57,16 @@ struct TRINITY_DLL_DECL boss_maiden_of_griefAI : public ScriptedAI
ShockOfSorrowTimer = 20000+rand()%5000;
PillarOfWoeTimer = 5000 + rand()%10000;
//Missing support for instance data (and door?)
if (pInstance)
pInstance->SetData(DATA_MAIDEN_OF_GRIEF_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
//Missing support for instance data (and door?)
if (pInstance)
pInstance->SetData(DATA_MAIDEN_OF_GRIEF_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
@@ -113,7 +120,8 @@ struct TRINITY_DLL_DECL boss_maiden_of_griefAI : public ScriptedAI
{
DoScriptText(SAY_DEATH, m_creature);
//Missing support for instance data (and door?)
if (pInstance)
pInstance->SetData(DATA_MAIDEN_OF_GRIEF_EVENT, DONE);
}
void KilledUnit(Unit *victim)
{
@@ -10,61 +10,172 @@ Script Data End */
update creature_template set scriptname = 'boss_sjonnir' where entry = '';
*** SQL END ***/
#include "precompiled.h"
#include "def_halls_of_stone.h"
//Spells
#define SPELL_LIGHTING_RING_1 50840 //Periodic Trigger (interval 2s) spell = 50841
#define SPELL_LIGHTING_RING_2 51849 //Periodic Trigger (interval 2s) spell = 50841
#define SPELL_LIGHTING_RING_2 59848 //Periodic Trigger (interval 2s) spell = 59849
#define SPELL_LIGHTING_RING_3 59861 //Periodic Trigger (interval 2s) spell = 59849
#define SPELL_STATIC_CHARGE_1 50834 //Periodic Trigger 2s interval, spell =50835
#define SPELL_STATIC_CHARGE_2 59846 //Periodic Trigger 2s interval, spell =50847
#define SPELL_CHAIN_LIGHTING_1 50830
#define SPELL_CHAIN_LIGHTING_2 59844
#define SPELL_LIGHTING_SHIELD_1 50831
#define SPELL_LIGHTING_SHIELD_2 59845
#define SPELL_FRENZY 28747
enum Spells
{
SPELL_LIGHTING_RING = 51849, //Periodic Trigger (interval 2s) spell = 50841
H_SPELL_LIGHTING_RING = 59861, //Periodic Trigger (interval 2s) spell = 59849
SPELL_LIGHTING_RING_1 = 50840, //Periodic Trigger (interval 2s) spell = 50841
H_SPELL_LIGHTING_RING_1 = 59848, //Periodic Trigger (interval 2s) spell = 59849
SPELL_STATIC_CHARGE = 50834, //Periodic Trigger 2s interval, spell =50835
H_SPELL_STATIC_CHARGE = 59846, //Periodic Trigger 2s interval, spell =50847
SPELL_CHAIN_LIGHTING = 50830,
H_SPELL_CHAIN_LIGHTING = 59844,
SPELL_LIGHTING_SHIELD = 50831,
H_SPELL_LIGHTING_SHIELD = 59845,
SPELL_FRENZY = 28747
};
//not in db
//Yell
#define SAY_AGGRO -1599011
#define SAY_SLAY_1 -1599012
#define SAY_SLAY_2 -1599013
#define SAY_SLAY_3 -1599014
#define SAY_DEATH -1599015
enum Yells
{
SAY_AGGRO = -1603011,
SAY_SLAY_1 = -1603012,
SAY_SLAY_2 = -1603013,
SAY_SLAY_3 = -1603014,
SAY_DEATH = -1603015
};
#define EMOTE_GENERIC_FRENZY -1000002
enum Creatures
{
CREATURE_FORGED_IRON_TROGG = 27979,
CREATURE_MALFORMED_OOZE = 27981,
CREATURE_FORGED_IRON_DWARF = 27982
};
struct Locations
{
float x, y, z;
};
static Locations PipeLocations[] =
{
{1295.44, 734.07, 200.3}, //left
{1297.7, 595.6, 199.9} //right
};
struct TRINITY_DLL_DECL boss_sjonnirAI : public ScriptedAI
{
boss_sjonnirAI(Creature *c) : ScriptedAI(c) {}
boss_sjonnirAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
}
bool bIsFrenzy;
uint32 uiChainLightningTimer;
uint32 uiLightningShieldTimer;
uint32 uiStaticChargeTimer;
uint32 uiLightningRingTimer;
uint32 uiSummonTimer;
uint32 uiFrenzyTimer;
ScriptedInstance* pInstance;
void Reset() {}
void Reset()
{
bIsFrenzy = false;
uiChainLightningTimer = 3000 + rand()%5000;
uiLightningShieldTimer = 20000 + rand()%5000;
uiStaticChargeTimer = 20000 + rand()%5000;
uiLightningRingTimer = 30000 + rand()%5000;
uiSummonTimer = 5000;
uiFrenzyTimer = 300000; //5 minutes
if (pInstance)
pInstance->SetData(DATA_SJONNIR_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* who)
{
DoScriptText(SAY_AGGRO, m_creature);
if (pInstance)
pInstance->SetData(DATA_SJONNIR_EVENT, IN_PROGRESS);
}
void AttackStart(Unit* who) {}
void MoveInLineOfSight(Unit* who) {}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
if (uiChainLightningTimer < diff)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
while (pTarget && pTarget->GetTypeId() != TYPEID_PLAYER)
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
DoCast(pTarget, HeroicMode ? H_SPELL_CHAIN_LIGHTING : SPELL_CHAIN_LIGHTING);
uiChainLightningTimer = 10000 + rand()%5000;
} else uiChainLightningTimer -= diff;
if (uiLightningShieldTimer < diff)
{
DoCast(m_creature, HeroicMode ? H_SPELL_LIGHTING_SHIELD : SPELL_LIGHTING_SHIELD);
uiLightningShieldTimer -= diff;
}
if (uiStaticChargeTimer < diff)
{
DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_STATIC_CHARGE : SPELL_STATIC_CHARGE);
uiStaticChargeTimer = 20000 + rand()%5000;
} uiStaticChargeTimer -= diff;
if (uiLightningRingTimer < diff)
{
if (m_creature->IsNonMeleeSpellCasted(false))
m_creature->InterruptNonMeleeSpells(false);
DoCast(m_creature, HeroicMode ? H_SPELL_LIGHTING_RING : SPELL_LIGHTING_RING);
uiLightningRingTimer = 30000 + rand()%5000;
} else uiLightningRingTimer -= diff;
if (uiSummonTimer < diff)
{
uint32 uiSummonPipe = rand()%2;
m_creature->SummonCreature(RAND(CREATURE_FORGED_IRON_DWARF,CREATURE_FORGED_IRON_TROGG,CREATURE_MALFORMED_OOZE),
PipeLocations[uiSummonPipe].x, PipeLocations[uiSummonPipe].y, PipeLocations[uiSummonPipe].z, 0.0f,
TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
uiSummonTimer = 20000;
} else uiSummonTimer -= diff;
if (!bIsFrenzy)
{
if (uiFrenzyTimer < diff)
{
DoCast(m_creature, SPELL_FRENZY);
bIsFrenzy = true;
}
else uiFrenzyTimer -= diff;
}
DoMeleeAttackIfReady();
}
void JustSummoned(Creature* summon)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
while (pTarget && pTarget->GetTypeId() != TYPEID_PLAYER)
pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
if (pTarget)
summon->AI()->AttackStart(pTarget);
}
void JustDied(Unit* killer)
{
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
pInstance->SetData(DATA_SJONNIR_EVENT, DONE);
}
void KilledUnit(Unit *victim)
{
if (victim == m_creature)
return;
switch(rand()%3)
{
case 0: DoScriptText(SAY_SLAY_1, m_creature);break;
case 1: DoScriptText(SAY_SLAY_2, m_creature);break;
case 2: DoScriptText(SAY_SLAY_3, m_creature);break;
}
DoScriptText(RAND(SAY_SLAY_1,SAY_SLAY_2,SAY_SLAY_3), m_creature);
}
};
@@ -1,4 +1,24 @@
#ifndef DEF_HALLS_OF_STONE_H
#define DEF_HALLS_OF_STONE_H
enum Data
{
DATA_KRYSTALLUS_EVENT,
DATA_MAIDEN_OF_GRIEF_EVENT,
DATA_SJONNIR_EVENT,
DATA_BRANN_EVENT
};
enum Data64
{
DATA_KRYSTALLUS,
DATA_MAIDEN_OF_GRIEF,
DATA_SJONNIR,
DATA_KADDRAK,
DATA_MARNAK,
DATA_ABEDNEUM,
DATA_GO_TRIBUNAL_CONSOLE,
DATA_GO_KADDRAK,
DATA_GO_MARNAK,
DATA_GO_ABEDNEUM,
DATA_GO_SKY_FLOOR
};
#endif
@@ -0,0 +1,691 @@
#include "precompiled.h"
#include "escort_ai.h"
#include "def_halls_of_stone.h"
enum Texts
{
SAY_KILL_1 = -1603012,
SAY_KILL_2 = -1603013,
SAY_KILL_3 = -1603014,
SAY_LOW_HEALTH = -1603015,
SAY_DEATH = -1603016,
SAY_PLAYER_DEATH_1 = -1603017,
SAY_PLAYER_DEATH_2 = -1603018,
SAY_PLAYER_DEATH_3 = -1603019,
SAY_ESCORT_START = -1603020,
SAY_SPAWN_DWARF = -1603021,
SAY_SPAWN_TROGG = -1603022,
SAY_SPAWN_OOZE = -1603023,
SAY_SPAWN_EARTHEN = -1603024,
SAY_EVENT_INTRO_1 = -1603025,
SAY_EVENT_INTRO_2 = -1603026,
SAY_EVENT_INTRO_3_ABED = -1603027,
SAY_EVENT_A_1 = -1603028,
SAY_EVENT_A_2_KADD = -1603029,
SAY_EVENT_A_3 = -1603030,
SAY_EVENT_B_1 = -1603031,
SAY_EVENT_B_2_MARN = -1603032,
SAY_EVENT_B_3 = -1603033,
SAY_EVENT_C_1 = -1603034,
SAY_EVENT_C_2_ABED = -1603035,
SAY_EVENT_C_3 = -1603036,
SAY_EVENT_D_1 = -1603037,
SAY_EVENT_D_2_ABED = -1603038,
SAY_EVENT_D_3 = -1603039,
SAY_EVENT_D_4_ABED = -1603040,
SAY_EVENT_END_01 = -1603041,
SAY_EVENT_END_02 = -1603042,
SAY_EVENT_END_03_ABED = -1603043,
SAY_EVENT_END_04 = -1603044,
SAY_EVENT_END_05_ABED = -1603045,
SAY_EVENT_END_06 = -1603046,
SAY_EVENT_END_07_ABED = -1603047,
SAY_EVENT_END_08 = -1603048,
SAY_EVENT_END_09_KADD = -1603049,
SAY_EVENT_END_10 = -1603050,
SAY_EVENT_END_11_KADD = -1603051,
SAY_EVENT_END_12 = -1603052,
SAY_EVENT_END_13_KADD = -1603053,
SAY_EVENT_END_14 = -1603054,
SAY_EVENT_END_15_MARN = -1603055,
SAY_EVENT_END_16 = -1603056,
SAY_EVENT_END_17_MARN = -1603057,
SAY_EVENT_END_18 = -1603058,
SAY_EVENT_END_19_MARN = -1603059,
SAY_EVENT_END_20 = -1603060,
SAY_EVENT_END_21_ABED = -1603061,
SAY_VICTORY_SJONNIR_1 = -1603062,
SAY_VICTORY_SJONNIR_2 = -1603063,
SAY_ENTRANCE_MEET = -1603064,
TEXT_ID_START = 13100,
TEXT_ID_PROGRESS = 13101
};
enum Creatures
{
CREATURE_TRIBUNAL_OF_THE_AGES = 28234,
CREATURE_BRANN_BRONZEBEARD = 28070,
CREATURE_DARK_MATTER_TARGET = 28237,
CREATURE_SEARING_GAZE_TARGET = 28265,
CREATURE_DARK_RUNE_PROTECTOR = 27983,
CREATURE_DARK_RUNE_STORMCALLER = 27984,
CREATURE_IRON_GOLEM_CUSTODIAN = 27985,
CREATURE_KADDRAK = 30898
};
enum Spells
{
SPELL_STEALTH = 58506,
//Kadrak
SPELL_GLARE_OF_THE_TRIBUNAL = 50988,
H_SPELL_GLARE_OF_THE_TRIBUNAL = 59868,
//Marnak
SPELL_DARK_MATTER = 51012,
H_SPELL_DARK_MATTER = 59868,
//Abedneum
SPELL_SEARING_GAZE = 51136,
H_SPELL_SEARING_GAZE = 59867
};
enum Quests
{
QUEST_HALLS_OF_STONE = 13207
};
#define GOSSIP_ITEM_START "Brann, it would be our honor!"
#define GOSSIP_ITEM_PROGRESS "Let's move Brann, enough of the history lessons!"
struct Locations
{
float x, y, z;
};
static Locations SpawnLocations[]=
{
{946.992, 397.016, 208.374},
{960.748, 382.944, 208.374},
};
struct TRINITY_DLL_DECL mob_tribuna_controllerAI : public ScriptedAI
{
mob_tribuna_controllerAI(Creature *c) : ScriptedAI(c)
{
pInstance = c->GetInstanceData();
SetCombatMovement(false);
}
ScriptedInstance* pInstance;
uint32 uiKaddrakEncounterTimer;
uint32 uiMarnakEncounterTimer;
uint32 uiAbedneumEncounterTimer;
bool bKaddrakActivated;
bool bMarnakActivated;
bool bAbedneumActivated;
std::list<Creature*> lKaddrakGUIDList;
void Reset()
{
uiKaddrakEncounterTimer = 1500;
uiMarnakEncounterTimer = 10000;
uiAbedneumEncounterTimer = 10000;
bKaddrakActivated = false;
bMarnakActivated = false;
bAbedneumActivated = false;
lKaddrakGUIDList.clear();
}
void UpdateFacesList()
{
/*GetCreatureListWithEntryInGrid(lKaddrakGUIDList, m_creature, CREATURE_KADDRAK, 50.0f);
if (!lKaddrakGUIDList.empty())
{
uint32 uiPositionCounter = 0;
for(std::list<Creature*>::iterator itr = lKaddrakGUIDList.begin(); itr != lKaddrakGUIDList.end(); ++itr)
{
if ((*itr)->isAlive())
{
if (uiPositionCounter == 0)
{
(*itr)->GetMap()->CreatureRelocation((*itr), 927.265, 333.200, 218.780, (*itr)->GetOrientation());
(*itr)->SendMonsterMove(927.265, 333.200, 218.780, 0, (*itr)->GetMovementFlags(), 1);
}
else
{
(*itr)->GetMap()->CreatureRelocation((*itr), 921.745, 328.076, 218.780, (*itr)->GetOrientation());
(*itr)->SendMonsterMove(921.745, 328.076, 218.780, 0, (*itr)->GetMovementFlags(), 1);
}
}
++uiPositionCounter;
}
}*/
}
void UpdateAI(const uint32 diff)
{
if(bKaddrakActivated)
{
if (uiKaddrakEncounterTimer < diff)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
while (pTarget && pTarget->GetTypeId() != TYPEID_PLAYER)
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget && !lKaddrakGUIDList.empty())
for(std::list<Creature*>::iterator itr = lKaddrakGUIDList.begin(); itr != lKaddrakGUIDList.end(); ++itr)
if ((*itr)->isAlive())
(*itr)->CastSpell(pTarget, HeroicMode ? H_SPELL_GLARE_OF_THE_TRIBUNAL : SPELL_GLARE_OF_THE_TRIBUNAL, true);
uiKaddrakEncounterTimer = 1500;
} else uiKaddrakEncounterTimer -= diff;
}
if (bMarnakActivated)
{
if (uiMarnakEncounterTimer < diff)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
while (pTarget && pTarget->GetTypeId() != TYPEID_PLAYER)
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget)
{
if (Creature* pSummon = m_creature->SummonCreature(CREATURE_DARK_MATTER_TARGET, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
{
pSummon->SetDisplayId(11686);
pSummon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pSummon->CastSpell(pTarget, HeroicMode ? H_SPELL_DARK_MATTER : SPELL_DARK_MATTER, true);
}
}
uiMarnakEncounterTimer = 30000 + rand()%1000;
} else uiMarnakEncounterTimer -= diff;
}
if (bAbedneumActivated)
{
if (uiAbedneumEncounterTimer < diff)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
while (pTarget && pTarget->GetTypeId() != TYPEID_PLAYER)
pTarget = SelectUnit(SELECT_TARGET_RANDOM,0);
if (pTarget)
{
if (Creature* pSummon = m_creature->SummonCreature(CREATURE_SEARING_GAZE_TARGET, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1000))
{
pSummon->SetDisplayId(11686);
pSummon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
pSummon->CastSpell(pTarget, HeroicMode ? H_SPELL_SEARING_GAZE : SPELL_SEARING_GAZE, true);
}
}
uiAbedneumEncounterTimer = 30000 + rand()%1000;
} else uiAbedneumEncounterTimer -= diff;
}
}
};
struct TRINITY_DLL_DECL npc_brann_hosAI : public npc_escortAI
{
npc_brann_hosAI(Creature *c) : npc_escortAI(c)
{
pInstance = c->GetInstanceData();
}
uint32 uiStep;
uint32 uiPhaseTimer;
uint64 uiControllerGUID;
std::list<uint64> lDwarfGUIDList;
ScriptedInstance* pInstance;
bool bIsBattle;
bool bIsLowHP;
void Reset()
{
if (!IsBeingEscorted)
{
bIsLowHP = false;
bIsBattle = false;
uiStep = 0;
uiPhaseTimer = 0;
uiControllerGUID = 0;
DespawnDwarf();
if (pInstance)
pInstance->SetData(DATA_BRANN_EVENT, NOT_STARTED);
}
}
void DespawnDwarf()
{
if (lDwarfGUIDList.empty())
return;
for (std::list<uint64>::iterator itr = lDwarfGUIDList.begin(); itr != lDwarfGUIDList.end(); ++itr)
{
Creature* pTemp = Unit::GetCreature(*m_creature, pInstance ? (*itr) : 0);
if (pTemp && pTemp->isAlive())
pTemp->ForcedDespawn();
}
lDwarfGUIDList.clear();
}
void WaypointReached(uint32 uiPointId)
{
switch(uiPointId)
{
case 7:
if (Creature* pCreature = GetClosestCreatureWithEntry(m_creature, CREATURE_TRIBUNAL_OF_THE_AGES, 100.0f))
{
if (!pCreature->isAlive())
pCreature->Respawn();
((mob_tribuna_controllerAI*)pCreature->AI())->UpdateFacesList();
uiControllerGUID = pCreature->GetGUID();
}
break;
case 13:
DoScriptText(SAY_EVENT_INTRO_1, m_creature);
IsOnHold = true;
SetRun(true);
JumpToNextStep(20000);
break;
case 17:
DoScriptText(SAY_EVENT_INTRO_2, m_creature);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_TRIBUNAL_CONSOLE),true);
m_creature->SetStandState(UNIT_STAND_STATE_KNEEL);
IsOnHold = true;
JumpToNextStep(8500);
break;
case 18:
IsOnHold = true;
break;
}
}
void SpawnDwarf(uint32 uiType)
{
switch(uiType)
{
case 1:
{
uint32 uiSpawnNumber = (HeroicMode ? 3 : 2);
for (uint8 i = 0; i < uiSpawnNumber; ++i)
m_creature->SummonCreature(CREATURE_DARK_RUNE_PROTECTOR, SpawnLocations[0].x, SpawnLocations[0].y, SpawnLocations[0].z, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
m_creature->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[0].x, SpawnLocations[0].y, SpawnLocations[0].z, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
break;
}
case 2:
for (uint8 i = 0; i < 2; ++i)
m_creature->SummonCreature(CREATURE_DARK_RUNE_STORMCALLER, SpawnLocations[1].x, SpawnLocations[1].y, SpawnLocations[1].z, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
break;
case 3:
m_creature->SummonCreature(CREATURE_IRON_GOLEM_CUSTODIAN, SpawnLocations[1].x, SpawnLocations[1].y, SpawnLocations[1].z, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
break;
}
}
void JustSummoned(Creature* pSummoned)
{
lDwarfGUIDList.push_back(pSummoned->GetGUID());
pSummoned->AddThreat(m_creature, 0.0f);
pSummoned->AI()->AttackStart(m_creature);
}
void JumpToNextStep(uint32 uiTimer)
{
uiPhaseTimer = uiTimer;
uiStep++;
}
void StartWP()
{
m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
IsOnHold = false;
uiStep = 1;
}
void UpdateEscortAI(const uint32 uiDiff)
{
if (uiPhaseTimer < uiDiff)
{
switch(uiStep)
{
case 1:
if (pInstance)
{
if (pInstance->GetData(DATA_BRANN_EVENT) != NOT_STARTED)
return;
pInstance->SetData(DATA_BRANN_EVENT, IN_PROGRESS);
}
bIsBattle = false;
DoScriptText(SAY_ESCORT_START, m_creature);
JumpToNextStep(0);
break;
case 3:
IsOnHold = false;
JumpToNextStep(0);
break;
case 5:
if (pInstance)
if (Creature* pTemp = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM))))
DoScriptText(SAY_EVENT_INTRO_3_ABED, pTemp);
JumpToNextStep(8500);
break;
case 6:
DoScriptText(SAY_EVENT_A_1, m_creature);
JumpToNextStep(6500);
break;
case 7:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
DoScriptText(SAY_EVENT_A_2_KADD, pTemp);
JumpToNextStep(12500);
break;
case 8:
DoScriptText(SAY_EVENT_A_3, m_creature);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_KADDRAK),true);
if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
((mob_tribuna_controllerAI*)pTemp->AI())->bKaddrakActivated = true;
JumpToNextStep(5000);
break;
case 9:
SpawnDwarf(1);
JumpToNextStep(20000);
break;
case 10:
DoScriptText(SAY_EVENT_B_1, m_creature);
JumpToNextStep(6000);
break;
case 11:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
DoScriptText(SAY_EVENT_B_2_MARN, pTemp);
SpawnDwarf(1);
JumpToNextStep(20000);
break;
case 12:
DoScriptText(SAY_EVENT_B_3, m_creature);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_MARNAK),true);
if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
((mob_tribuna_controllerAI*)pTemp->AI())->bMarnakActivated = true;
JumpToNextStep(10000);
break;
case 13:
SpawnDwarf(1);
JumpToNextStep(10000);
break;
case 14:
SpawnDwarf(2);
JumpToNextStep(20000);
break;
case 15:
DoScriptText(SAY_EVENT_C_1, m_creature);
SpawnDwarf(1);
JumpToNextStep(10000);
break;
case 16:
SpawnDwarf(2);
JumpToNextStep(20000);
break;
case 17:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_C_2_ABED, pTemp);
SpawnDwarf(1);
JumpToNextStep(20000);
break;
case 18:
DoScriptText(SAY_EVENT_C_3, m_creature);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_ABEDNEUM),true);
if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
((mob_tribuna_controllerAI*)pTemp->AI())->bAbedneumActivated = true;
JumpToNextStep(5000);
break;
case 19:
SpawnDwarf(2);
JumpToNextStep(10000);
break;
case 20:
SpawnDwarf(1);
JumpToNextStep(15000);
break;
case 21:
DoScriptText(SAY_EVENT_D_1, m_creature);
SpawnDwarf(3);
JumpToNextStep(20000);
break;
case 22:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_D_2_ABED, pTemp);
SpawnDwarf(1);
JumpToNextStep(5000);
break;
case 23:
SpawnDwarf(2);
JumpToNextStep(15000);
break;
case 24:
DoScriptText(SAY_EVENT_D_3, m_creature);
SpawnDwarf(3);
JumpToNextStep(5000);
break;
case 25:
SpawnDwarf(1);
JumpToNextStep(5000);
break;
case 26:
SpawnDwarf(2);
JumpToNextStep(10000);
break;
case 27:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_D_4_ABED, pTemp);
SpawnDwarf(1);
JumpToNextStep(10000);
break;
case 28:
DoScriptText(SAY_EVENT_END_01, m_creature);
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
if (pInstance)
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_SKY_FLOOR),true);
if (Creature* pTemp = Unit::GetCreature(*m_creature, uiControllerGUID))
pTemp->DealDamage(pTemp, pTemp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
bIsBattle = true;
IsOnHold = false;
JumpToNextStep(6500);
break;
case 29:
DoScriptText(SAY_EVENT_END_02, m_creature);
JumpToNextStep(5500);
break;
case 30:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_END_03_ABED, pTemp);
JumpToNextStep(8500);
break;
case 31:
DoScriptText(SAY_EVENT_END_04, m_creature);
JumpToNextStep(11500);
break;
case 32:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_END_05_ABED, pTemp);
JumpToNextStep(11500);
break;
case 33:
DoScriptText(SAY_EVENT_END_06, m_creature);
JumpToNextStep(4500);
break;
case 34:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_END_07_ABED, pTemp);
JumpToNextStep(22500);
break;
case 35:
DoScriptText(SAY_EVENT_END_08, m_creature);
JumpToNextStep(7500);
break;
case 36:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
DoScriptText(SAY_EVENT_END_09_KADD, pTemp);
JumpToNextStep(18500);
break;
case 37:
DoScriptText(SAY_EVENT_END_10, m_creature);
JumpToNextStep(5500);
break;
case 38:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
DoScriptText(SAY_EVENT_END_11_KADD, pTemp);
JumpToNextStep(20500);
break;
case 39:
DoScriptText(SAY_EVENT_END_12, m_creature);
JumpToNextStep(2500);
break;
case 40:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KADDRAK)))
DoScriptText(SAY_EVENT_END_13_KADD, pTemp);
JumpToNextStep(19500);
break;
case 41:
DoScriptText(SAY_EVENT_END_14, m_creature);
JumpToNextStep(10500);
break;
case 42:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
DoScriptText(SAY_EVENT_END_15_MARN, pTemp);
JumpToNextStep(6500);
break;
case 43:
DoScriptText(SAY_EVENT_END_16, m_creature);
JumpToNextStep(6500);
break;
case 44:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
DoScriptText(SAY_EVENT_END_17_MARN, pTemp);
JumpToNextStep(25500);
break;
case 45:
DoScriptText(SAY_EVENT_END_18, m_creature);
JumpToNextStep(23500);
break;
case 46:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_MARNAK)))
DoScriptText(SAY_EVENT_END_19_MARN, pTemp);
JumpToNextStep(3500);
break;
case 47:
DoScriptText(SAY_EVENT_END_20, m_creature);
JumpToNextStep(8500);
break;
case 48:
if (pInstance)
if (Creature* pTemp = Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ABEDNEUM)))
DoScriptText(SAY_EVENT_END_21_ABED, pTemp);
JumpToNextStep(5500);
break;
case 49:
{
if (pInstance)
{
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_KADDRAK),true);
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_MARNAK),true);
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_ABEDNEUM),true);
pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_SKY_FLOOR),true);
pInstance->SetData(DATA_BRANN_EVENT, DONE);
}
Player* pPlayer = GetPlayerForEscort();
if (pPlayer)
pPlayer->GroupEventHappens(QUEST_HALLS_OF_STONE, m_creature);
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
JumpToNextStep(180000);
break;
}
case 50:
IsOnHold = false;
break;
}
} else uiPhaseTimer -= uiDiff;
if (!bIsLowHP && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 30)
{
DoScriptText(SAY_LOW_HEALTH, m_creature);
bIsLowHP = true;
} else if (bIsLowHP && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 30)
bIsLowHP = false;
}
};
bool GossipHello_npc_brann_hos(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_START, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(TEXT_ID_START, pCreature->GetGUID());
}
bool GossipSelect_npc_brann_hos(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction)
{
if (uiAction == GOSSIP_ACTION_INFO_DEF+1 || uiAction == GOSSIP_ACTION_INFO_DEF+2)
{
pPlayer->CLOSE_GOSSIP_MENU();
((npc_brann_hosAI*)pCreature->AI())->StartWP();
}
return true;
}
CreatureAI* GetAI_mob_tribuna_controller(Creature* pCreature)
{
return new mob_tribuna_controllerAI(pCreature);
}
CreatureAI* GetAI_npc_brann_hos(Creature* pCreature)
{
return new npc_brann_hosAI(pCreature);
}
void AddSC_halls_of_stone()
{
Script *newscript;
newscript = new Script;
newscript->Name = "npc_brann_hos";
newscript->GetAI = &GetAI_npc_brann_hos;
newscript->pGossipHello = &GossipHello_npc_brann_hos;
newscript->pGossipSelect = &GossipSelect_npc_brann_hos;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_tribuna_controller";
newscript->GetAI = &GetAI_mob_tribuna_controller;
newscript->RegisterSelf();
}
@@ -1,9 +1,232 @@
#include "precompiled.h"
#include "def_halls_of_stone.h"
#define MAX_ENCOUNTER 4
/* Halls of Stone encounters:
0- Krystallus
1- Maiden of Grief
2- Escort Event
3- Sjonnir The Ironshaper
*/
struct TRINITY_DLL_DECL instance_halls_of_stone : public ScriptedInstance
{
instance_halls_of_stone(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
uint64 uiMaidenOfGrief;
uint64 uiKrystallus;
uint64 uiSjonnir;
uint64 uiKaddrak;
uint64 uiAbedneum;
uint64 uiMarnak;
uint64 uiBrann;
uint64 uiMaidenOfGriefDoor;
uint64 uiSjonnirDoor;
uint64 uiBrannDoor;
uint64 uiTribunalConsole;
uint64 uiTribunalChest;
uint64 uiTribunalSkyFloor;
uint64 uiKaddrakGo;
uint64 uiAbedneumGo;
uint64 uiMarnakGo;
uint32 m_auiEncounter[MAX_ENCOUNTER];
std::string str_data;
void Initialize()
{
uiMaidenOfGrief = 0;
uiKrystallus = 0;
uiSjonnir = 0;
uiKaddrak = 0;
uiMarnak = 0;
uiAbedneum = 0;
uiBrann = 0;
uiMaidenOfGriefDoor = 0;
uiSjonnirDoor = 0;
uiBrannDoor = 0;
uiKaddrakGo = 0;
uiMarnakGo = 0;
uiAbedneumGo = 0;
uiTribunalConsole = 0;
uiTribunalChest = 0;
uiTribunalSkyFloor = 0;
for(uint8 i = 0; i < MAX_ENCOUNTER; ++i)
m_auiEncounter[i] = NOT_STARTED;
}
void OnCreatureCreate(Creature* pCreature, bool add)
{
switch(pCreature->GetEntry())
{
case 27975: uiMaidenOfGrief = pCreature->GetGUID(); break;
case 27977: uiKrystallus = pCreature->GetGUID(); break;
case 27978: uiSjonnir = pCreature->GetGUID(); break;
case 30897: uiMarnak = pCreature->GetGUID(); break;
case 30898: uiKaddrak = pCreature->GetGUID(); break;
case 30099: uiAbedneum = pCreature->GetGUID(); break;
case 28070: uiBrann = pCreature->GetGUID(); break;
}
}
void OnGameObjectCreate(GameObject* pGo, bool add)
{
switch(pGo->GetEntry())
{
case 191669:
uiAbedneumGo = pGo->GetGUID();
break;
case 192170:
uiMarnakGo = pGo->GetGUID();
break;
case 192171:
uiKaddrakGo = pGo->GetGUID();
break;
case 191292:
uiMaidenOfGriefDoor = pGo->GetGUID();
if (m_auiEncounter[0] == DONE)
pGo->SetGoState(GO_STATE_ACTIVE);
else
pGo->SetGoState(GO_STATE_READY);
break;
case 191295:
uiBrannDoor = pGo->GetGUID();
if (m_auiEncounter[1] == DONE)
pGo->SetGoState(GO_STATE_ACTIVE);
else
pGo->SetGoState(GO_STATE_READY);
break;
case 191296:
uiSjonnirDoor = pGo->GetGUID();
if (m_auiEncounter[2] == DONE)
pGo->SetGoState(GO_STATE_ACTIVE);
else
pGo->SetGoState(GO_STATE_READY);
break;
case 193907:
uiTribunalConsole = pGo->GetGUID();
break;
case 190586:
uiTribunalChest = pGo->GetGUID();
break;
case 191527:
uiTribunalSkyFloor = pGo->GetGUID();
break;
}
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_MAIDEN_OF_GRIEF_EVENT:
m_auiEncounter[1] = data;
if (m_auiEncounter[1] == DONE)
HandleGameObject(uiBrannDoor,true);
break;
case DATA_KRYSTALLUS_EVENT:
m_auiEncounter[0] = data;
if (m_auiEncounter[0] == DONE)
HandleGameObject(uiMaidenOfGriefDoor,true);
break;
case DATA_SJONNIR_EVENT:
m_auiEncounter[3] = data;
break;
case DATA_BRANN_EVENT:
m_auiEncounter[2] = data;
if (m_auiEncounter[2] == DONE)
HandleGameObject(uiSjonnirDoor,true);
break;
}
if (data == DONE)
SaveToDB();
}
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_MAIDEN_OF_GRIEF_EVENT: return m_auiEncounter[0];
case DATA_KRYSTALLUS_EVENT: return m_auiEncounter[1];
case DATA_SJONNIR_EVENT: return m_auiEncounter[2];
case DATA_BRANN_EVENT: return m_auiEncounter[3];
}
return 0;
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_MAIDEN_OF_GRIEF: return uiMaidenOfGrief;
case DATA_KRYSTALLUS: return uiKrystallus;
case DATA_SJONNIR: return uiSjonnir;
case DATA_KADDRAK: return uiKaddrak;
case DATA_MARNAK: return uiMarnak;
case DATA_ABEDNEUM: return uiAbedneum;
case DATA_GO_TRIBUNAL_CONSOLE: return uiTribunalConsole;
case DATA_GO_KADDRAK: return uiKaddrakGo;
case DATA_GO_ABEDNEUM: return uiAbedneumGo;
case DATA_GO_MARNAK: return uiMarnakGo;
case DATA_GO_SKY_FLOOR: return uiTribunalSkyFloor;
}
return 0;
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << "H S " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3];
str_data = saveStream.str();
OUT_SAVE_INST_DATA_COMPLETE;
return str_data;
}
void Load(const char* in)
{
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
char dataHead1, dataHead2;
uint16 data0, data1, data2, data3;
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3;
if (dataHead1 == 'H' && dataHead2 == 'S')
{
m_auiEncounter[0] = data0;
m_auiEncounter[1] = data1;
m_auiEncounter[2] = data2;
m_auiEncounter[3] = data3;
for(uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
m_auiEncounter[i] = NOT_STARTED;
} else OUT_LOAD_INST_DATA_FAIL;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
InstanceData* GetInstanceData_instance_halls_of_stone(Map* pMap)
+12 -2
View File
@@ -267,8 +267,9 @@ extern void AddSC_boss_drakkari_colossus();
extern void AddSC_boss_gal_darah();
extern void AddSC_boss_eck();
extern void AddSC_instance_gundrak();
extern void AddSC_boss_krik_thir(); //Azjol-Nerub
extern void AddSC_instance_azjol_nerub();
extern void AddSC_instance_ahnkahet(); //Azjol-Nerub Ahn'kahet
extern void AddSC_boss_krik_thir();
extern void AddSC_boss_taldaram();
extern void AddSC_boss_elder_nadox();
extern void AddSC_boss_volazj();
@@ -301,6 +302,10 @@ extern void AddSC_boss_ionar();
extern void AddSC_boss_volkhan();
extern void AddSC_instance_halls_of_lightning();
extern void AddSC_boss_maiden_of_grief(); //Ulduar Halls of Stone
extern void AddSC_boss_krystallus();
extern void AddSC_boss_sjonnir();
extern void AddSC_instance_halls_of_stone();
extern void AddSC_halls_of_stone();
extern void AddSC_boss_auriaya(); //Ulduar Ulduar
extern void AddSC_boss_flame_leviathan();
extern void AddSC_boss_ignis();
@@ -685,7 +690,8 @@ void AddScripts()
AddSC_boss_elder_nadox();
AddSC_boss_volazj();
AddSC_instance_ahnkahet();
AddSC_boss_krik_thir(); //Azjol-Nerub Azjol-Nerub
AddSC_boss_krik_thir(); //Azjol-Nerub Azjol-Nerub
AddSC_instance_azjol_nerub();
AddSC_boss_anubrekhan(); //Naxxramas
AddSC_boss_maexxna();
AddSC_boss_patchwerk();
@@ -715,6 +721,10 @@ void AddScripts()
AddSC_boss_volkhan();
AddSC_instance_halls_of_lightning();
AddSC_boss_maiden_of_grief(); //Ulduar Halls of Stone
AddSC_boss_krystallus();
AddSC_boss_sjonnir();
AddSC_instance_halls_of_stone();
AddSC_halls_of_stone();
AddSC_boss_auriaya(); //Ulduar Ulduar
AddSC_boss_flame_leviathan();
AddSC_boss_ignis();