mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Scripting: Fix up Hellfire Ramparts instance and add Instance save.
This commit is contained in:
@@ -26,6 +26,7 @@ EndScriptData */
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Player.h"
|
||||
#include "hellfire_ramparts.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
@@ -53,28 +54,15 @@ class boss_omor_the_unscarred : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
boss_omor_the_unscarred()
|
||||
: CreatureScript("boss_omor_the_unscarred")
|
||||
{
|
||||
}
|
||||
boss_omor_the_unscarred() : CreatureScript("boss_omor_the_unscarred") { }
|
||||
|
||||
struct boss_omor_the_unscarredAI : public ScriptedAI
|
||||
struct boss_omor_the_unscarredAI : public BossAI
|
||||
{
|
||||
boss_omor_the_unscarredAI(Creature* creature) : ScriptedAI(creature)
|
||||
boss_omor_the_unscarredAI(Creature* creature) : BossAI(creature, DATA_OMOR_THE_UNSCARRED)
|
||||
{
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
|
||||
uint32 OrbitalStrike_Timer;
|
||||
uint32 ShadowWhip_Timer;
|
||||
uint32 Aura_Timer;
|
||||
uint32 DemonicShield_Timer;
|
||||
uint32 Shadowbolt_Timer;
|
||||
uint32 Summon_Timer;
|
||||
uint32 SummonedCount;
|
||||
uint64 PlayerGUID;
|
||||
bool CanPullBack;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
Talk(SAY_WIPE);
|
||||
@@ -88,10 +76,13 @@ class boss_omor_the_unscarred : public CreatureScript
|
||||
SummonedCount = 0;
|
||||
PlayerGUID = 0;
|
||||
CanPullBack = false;
|
||||
|
||||
_Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
@@ -116,6 +107,7 @@ class boss_omor_the_unscarred : public CreatureScript
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_DIE);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -217,6 +209,17 @@ class boss_omor_the_unscarred : public CreatureScript
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 OrbitalStrike_Timer;
|
||||
uint32 ShadowWhip_Timer;
|
||||
uint32 Aura_Timer;
|
||||
uint32 DemonicShield_Timer;
|
||||
uint32 Shadowbolt_Timer;
|
||||
uint32 Summon_Timer;
|
||||
uint32 SummonedCount;
|
||||
uint64 PlayerGUID;
|
||||
bool CanPullBack;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
|
||||
@@ -26,6 +26,19 @@ EndScriptData */
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "hellfire_ramparts.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
|
||||
SAY_WIPE = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_KILL = 2,
|
||||
SAY_DIE = 3,
|
||||
|
||||
EMOTE = 0
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
@@ -42,62 +55,27 @@ enum Spells
|
||||
SPELL_FIRE_NOVA_VISUAL = 19823
|
||||
};
|
||||
|
||||
enum Units
|
||||
{
|
||||
ENTRY_HELLFIRE_SENTRY = 17517,
|
||||
ENTRY_VAZRUDEN_HERALD = 17307,
|
||||
ENTRY_VAZRUDEN = 17537,
|
||||
ENTRY_NAZAN = 17536,
|
||||
ENTRY_LIQUID_FIRE = 22515,
|
||||
ENTRY_REINFORCED_FEL_IRON_CHEST = 185168,
|
||||
ENTRY_REINFORCED_FEL_IRON_CHEST_H = 185169
|
||||
};
|
||||
const float VazrudenMiddle[3] = { -1406.5f, 1746.5f, 81.2f };
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
|
||||
SAY_WIPE = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_KILL = 2,
|
||||
SAY_DIE = 3,
|
||||
|
||||
EMOTE = 0
|
||||
};
|
||||
|
||||
const float VazrudenMiddle[3] = {-1406.5f, 1746.5f, 81.2f};
|
||||
const float VazrudenRing[2][3] =
|
||||
{
|
||||
{-1430, 1705, 112},
|
||||
{-1377, 1760, 112}
|
||||
{ -1430.0f, 1705.0f, 112.0f },
|
||||
{ -1377.0f, 1760.0f, 112.0f }
|
||||
};
|
||||
|
||||
class boss_nazan : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_nazan() : CreatureScript("boss_nazan") { }
|
||||
|
||||
boss_nazan()
|
||||
: CreatureScript("boss_nazan")
|
||||
struct boss_nazanAI : public BossAI
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_nazanAI : public ScriptedAI
|
||||
{
|
||||
boss_nazanAI(Creature* creature) : ScriptedAI(creature)
|
||||
boss_nazanAI(Creature* creature) : BossAI(creature, DATA_NAZAN)
|
||||
{
|
||||
VazrudenGUID = 0;
|
||||
flight = true;
|
||||
}
|
||||
|
||||
uint32 Fireball_Timer;
|
||||
uint32 ConeOfFire_Timer;
|
||||
uint32 BellowingRoar_Timer;
|
||||
uint32 Fly_Timer;
|
||||
uint32 Turn_Timer;
|
||||
bool flight;
|
||||
uint64 VazrudenGUID;
|
||||
SpellInfo* liquid_fire;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
Fireball_Timer = 4000;
|
||||
@@ -107,9 +85,15 @@ class boss_nazan : public CreatureScript
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE {}
|
||||
|
||||
void IsSummonedBy(Unit* summoner) OVERRIDE
|
||||
{
|
||||
if (summoner->GetEntry() == NPC_VAZRUDEN_HERALD)
|
||||
VazrudenGUID = summoner->GetGUID();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned) OVERRIDE
|
||||
{
|
||||
if (summoned && summoned->GetEntry() == ENTRY_LIQUID_FIRE)
|
||||
if (summoned && summoned->GetEntry() == NPC_LIQUID_FIRE)
|
||||
{
|
||||
summoned->SetLevel(me->getLevel());
|
||||
summoned->setFaction(me->getFaction());
|
||||
@@ -121,7 +105,7 @@ class boss_nazan : public CreatureScript
|
||||
void SpellHitTarget(Unit* target, const SpellInfo* entry) OVERRIDE
|
||||
{
|
||||
if (target && entry->Id == uint32(SPELL_FIREBALL))
|
||||
me->SummonCreature(ENTRY_LIQUID_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 30000);
|
||||
me->SummonCreature(NPC_LIQUID_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 30000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -193,6 +177,16 @@ class boss_nazan : public CreatureScript
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 Fireball_Timer;
|
||||
uint32 ConeOfFire_Timer;
|
||||
uint32 BellowingRoar_Timer;
|
||||
uint32 Fly_Timer;
|
||||
uint32 Turn_Timer;
|
||||
bool flight;
|
||||
uint64 VazrudenGUID;
|
||||
SpellInfo* liquid_fire;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
@@ -204,36 +198,29 @@ class boss_nazan : public CreatureScript
|
||||
class boss_vazruden : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_vazruden() : CreatureScript("boss_vazruden") { }
|
||||
|
||||
boss_vazruden()
|
||||
: CreatureScript("boss_vazruden")
|
||||
struct boss_vazrudenAI : public BossAI
|
||||
{
|
||||
}
|
||||
struct boss_vazrudenAI : public ScriptedAI
|
||||
{
|
||||
boss_vazrudenAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
uint32 Revenge_Timer;
|
||||
bool WipeSaid;
|
||||
uint32 UnsummonCheck;
|
||||
boss_vazrudenAI(Creature* creature) : BossAI(creature, DATA_VAZRUDEN) { }
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
Revenge_Timer = 4000;
|
||||
UnsummonCheck = 2000;
|
||||
WipeSaid = false;
|
||||
_Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
_EnterCombat();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) OVERRIDE
|
||||
{
|
||||
if (who && who->GetEntry() != ENTRY_VAZRUDEN)
|
||||
if (who && who->GetEntry() != NPC_VAZRUDEN)
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
@@ -241,6 +228,7 @@ class boss_vazruden : public CreatureScript
|
||||
{
|
||||
if (killer && killer != me)
|
||||
Talk(SAY_DIE);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -272,7 +260,13 @@ class boss_vazruden : public CreatureScript
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 Revenge_Timer;
|
||||
bool WipeSaid;
|
||||
uint32 UnsummonCheck;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new boss_vazrudenAI(creature);
|
||||
@@ -282,11 +276,7 @@ class boss_vazruden : public CreatureScript
|
||||
class boss_vazruden_the_herald : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
boss_vazruden_the_herald()
|
||||
: CreatureScript("boss_vazruden_the_herald")
|
||||
{
|
||||
}
|
||||
boss_vazruden_the_herald() : CreatureScript("boss_vazruden_the_herald") { }
|
||||
|
||||
struct boss_vazruden_the_heraldAI : public ScriptedAI
|
||||
{
|
||||
@@ -299,15 +289,6 @@ class boss_vazruden_the_herald : public CreatureScript
|
||||
VazrudenGUID = 0;
|
||||
}
|
||||
|
||||
uint32 phase;
|
||||
uint32 waypoint;
|
||||
uint32 check;
|
||||
bool sentryDown;
|
||||
uint64 NazanGUID;
|
||||
uint64 VazrudenGUID;
|
||||
bool summoned;
|
||||
bool lootSpawned;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
phase = 0;
|
||||
@@ -322,7 +303,7 @@ class boss_vazruden_the_herald : public CreatureScript
|
||||
{
|
||||
Creature* Nazan = Unit::GetCreature(*me, NazanGUID);
|
||||
if (!Nazan)
|
||||
Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000);
|
||||
Nazan = me->FindNearestCreature(NPC_NAZAN, 5000);
|
||||
if (Nazan)
|
||||
{
|
||||
Nazan->DisappearAndDie();
|
||||
@@ -331,7 +312,7 @@ class boss_vazruden_the_herald : public CreatureScript
|
||||
|
||||
Creature* Vazruden = Unit::GetCreature(*me, VazrudenGUID);
|
||||
if (!Vazruden)
|
||||
Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000);
|
||||
Vazruden = me->FindNearestCreature(NPC_VAZRUDEN, 5000);
|
||||
if (Vazruden)
|
||||
{
|
||||
Vazruden->DisappearAndDie();
|
||||
@@ -347,9 +328,9 @@ class boss_vazruden_the_herald : public CreatureScript
|
||||
{
|
||||
if (!summoned)
|
||||
{
|
||||
if (Creature* Vazruden = me->SummonCreature(ENTRY_VAZRUDEN, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000000))
|
||||
if (Creature* Vazruden = me->SummonCreature(NPC_VAZRUDEN, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000000))
|
||||
VazrudenGUID = Vazruden->GetGUID();
|
||||
if (Creature* Nazan = me->SummonCreature(ENTRY_NAZAN, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000000))
|
||||
if (Creature* Nazan = me->SummonCreature(NPC_NAZAN, VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000000))
|
||||
NazanGUID = Nazan->GetGUID();
|
||||
summoned = true;
|
||||
me->SetVisible(false);
|
||||
@@ -372,9 +353,8 @@ class boss_vazruden_the_herald : public CreatureScript
|
||||
if (!summoned)
|
||||
return;
|
||||
Unit* victim = me->GetVictim();
|
||||
if (summoned->GetEntry() == ENTRY_NAZAN)
|
||||
if (summoned->GetEntry() == NPC_NAZAN)
|
||||
{
|
||||
CAST_AI(boss_nazan::boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID;
|
||||
summoned->SetDisableGravity(true);
|
||||
summoned->SetSpeed(MOVE_FLIGHT, 2.5f);
|
||||
if (victim)
|
||||
@@ -440,7 +420,7 @@ class boss_vazruden_the_herald : public CreatureScript
|
||||
}
|
||||
else if (!lootSpawned)
|
||||
{
|
||||
me->SummonGameObject(DUNGEON_MODE(ENTRY_REINFORCED_FEL_IRON_CHEST, ENTRY_REINFORCED_FEL_IRON_CHEST_H), VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, 0, 0, 0, 0, 0);
|
||||
me->SummonGameObject(DUNGEON_MODE(GO_FEL_IRON_CHEST_NORMAL, GO_FEL_IRON_CHECT_HEROIC), VazrudenMiddle[0], VazrudenMiddle[1], VazrudenMiddle[2], 0, 0, 0, 0, 0, 0);
|
||||
me->SetLootRecipient(NULL); // don't think this is necessary..
|
||||
//me->Kill(me);
|
||||
lootSpawned = true;
|
||||
@@ -452,6 +432,16 @@ class boss_vazruden_the_herald : public CreatureScript
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 phase;
|
||||
uint32 waypoint;
|
||||
uint32 check;
|
||||
bool sentryDown;
|
||||
uint64 NazanGUID;
|
||||
uint64 VazrudenGUID;
|
||||
bool summoned;
|
||||
bool lootSpawned;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
@@ -463,17 +453,12 @@ class boss_vazruden_the_herald : public CreatureScript
|
||||
class npc_hellfire_sentry : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_hellfire_sentry() : CreatureScript("npc_hellfire_sentry") { }
|
||||
|
||||
npc_hellfire_sentry()
|
||||
: CreatureScript("npc_hellfire_sentry")
|
||||
{
|
||||
}
|
||||
struct npc_hellfire_sentryAI : public ScriptedAI
|
||||
{
|
||||
npc_hellfire_sentryAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
uint32 KidneyShot_Timer;
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
KidneyShot_Timer = urand(3000, 7000);
|
||||
@@ -483,7 +468,7 @@ class npc_hellfire_sentry : public CreatureScript
|
||||
|
||||
void JustDied(Unit* killer) OVERRIDE
|
||||
{
|
||||
if (Creature* herald = me->FindNearestCreature(ENTRY_VAZRUDEN_HERALD, 150))
|
||||
if (Creature* herald = me->FindNearestCreature(NPC_VAZRUDEN_HERALD, 150))
|
||||
CAST_AI(boss_vazruden_the_herald::boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(killer);
|
||||
}
|
||||
|
||||
@@ -503,7 +488,11 @@ class npc_hellfire_sentry : public CreatureScript
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 KidneyShot_Timer;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
{
|
||||
return new npc_hellfire_sentryAI(creature);
|
||||
|
||||
@@ -25,6 +25,7 @@ EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "hellfire_ramparts.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
@@ -47,24 +48,11 @@ enum Spells
|
||||
class boss_watchkeeper_gargolmar : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_watchkeeper_gargolmar() : CreatureScript("boss_watchkeeper_gargolmar") { }
|
||||
|
||||
boss_watchkeeper_gargolmar()
|
||||
: CreatureScript("boss_watchkeeper_gargolmar")
|
||||
struct boss_watchkeeper_gargolmarAI : public BossAI
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_watchkeeper_gargolmarAI : public ScriptedAI
|
||||
{
|
||||
boss_watchkeeper_gargolmarAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
uint32 Surge_Timer;
|
||||
uint32 MortalWound_Timer;
|
||||
uint32 Retaliation_Timer;
|
||||
|
||||
bool HasTaunted;
|
||||
bool YelledForHeal;
|
||||
boss_watchkeeper_gargolmarAI(Creature* creature) : BossAI(creature, DATA_WATCHKEEPER_GARGOLMAR) { }
|
||||
|
||||
void Reset() OVERRIDE
|
||||
{
|
||||
@@ -74,11 +62,14 @@ class boss_watchkeeper_gargolmar : public CreatureScript
|
||||
|
||||
HasTaunted = false;
|
||||
YelledForHeal = false;
|
||||
|
||||
_Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
_EnterCombat();
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) OVERRIDE
|
||||
@@ -111,6 +102,7 @@ class boss_watchkeeper_gargolmar : public CreatureScript
|
||||
void JustDied(Unit* /*killer*/) OVERRIDE
|
||||
{
|
||||
Talk(SAY_DIE);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) OVERRIDE
|
||||
@@ -160,6 +152,14 @@ class boss_watchkeeper_gargolmar : public CreatureScript
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 Surge_Timer;
|
||||
uint32 MortalWound_Timer;
|
||||
uint32 Retaliation_Timer;
|
||||
|
||||
bool HasTaunted;
|
||||
bool YelledForHeal;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const OVERRIDE
|
||||
|
||||
@@ -19,12 +19,29 @@
|
||||
#ifndef DEF_RAMPARTS_H
|
||||
#define DEF_RAMPARTS_H
|
||||
|
||||
#define MAX_ENCOUNTER 2
|
||||
uint32 const EncounterCount = 4;
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
TYPE_VAZRUDEN = 1,
|
||||
TYPE_NAZAN = 2
|
||||
DATA_WATCHKEEPER_GARGOLMAR = 1,
|
||||
DATA_OMOR_THE_UNSCARRED = 2,
|
||||
DATA_VAZRUDEN = 3,
|
||||
DATA_NAZAN = 4
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
{
|
||||
NPC_HELLFIRE_SENTRY = 17517,
|
||||
NPC_VAZRUDEN_HERALD = 17307,
|
||||
NPC_VAZRUDEN = 17537,
|
||||
NPC_NAZAN = 17536,
|
||||
NPC_LIQUID_FIRE = 22515
|
||||
};
|
||||
|
||||
enum GameobjectIds
|
||||
{
|
||||
GO_FEL_IRON_CHEST_NORMAL = 185168,
|
||||
GO_FEL_IRON_CHECT_HEROIC = 185169
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -30,65 +30,98 @@ EndScriptData */
|
||||
class instance_ramparts : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_ramparts()
|
||||
: InstanceMapScript("instance_ramparts", 543)
|
||||
{
|
||||
}
|
||||
instance_ramparts() : InstanceMapScript("instance_ramparts", 543) { }
|
||||
|
||||
struct instance_ramparts_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_ramparts_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint64 m_uiChestNGUID;
|
||||
uint64 m_uiChestHGUID;
|
||||
bool spawned;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
m_uiChestNGUID = 0;
|
||||
m_uiChestHGUID = 0;
|
||||
SetBossNumber(EncounterCount);
|
||||
chestNormalGUID = 0;
|
||||
chestHeroicGUID = 0;
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case 185168:
|
||||
m_uiChestNGUID = go->GetGUID();
|
||||
case GO_FEL_IRON_CHEST_NORMAL:
|
||||
chestNormalGUID = go->GetGUID();
|
||||
break;
|
||||
case 185169:
|
||||
m_uiChestHGUID = go->GetGUID();
|
||||
case GO_FEL_IRON_CHECT_HEROIC:
|
||||
chestHeroicGUID = go->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 uiType, uint32 uiData)
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
{
|
||||
TC_LOG_DEBUG(LOG_FILTER_TSCR, "Instance Ramparts: SetData received for type %u with data %u", uiType, uiData);
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
switch (uiType)
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_VAZRUDEN:
|
||||
if (uiData == DONE && m_auiEncounter[1] == DONE && !spawned)
|
||||
case DATA_VAZRUDEN:
|
||||
case DATA_NAZAN:
|
||||
if (GetBossState(DATA_VAZRUDEN) == DONE && GetBossState(DATA_NAZAN) == DONE && !spawned)
|
||||
{
|
||||
DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILLISECONDS);
|
||||
DoRespawnGameObject(instance->IsHeroic() ? chestHeroicGUID : chestNormalGUID, HOUR*IN_MILLISECONDS);
|
||||
spawned = true;
|
||||
}
|
||||
m_auiEncounter[0] = uiData;
|
||||
break;
|
||||
case TYPE_NAZAN:
|
||||
if (uiData == DONE && m_auiEncounter[0] == DONE && !spawned)
|
||||
{
|
||||
DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILLISECONDS);
|
||||
spawned = true;
|
||||
}
|
||||
m_auiEncounter[1] = uiData;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "H R " << GetBossSaveData();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* strIn)
|
||||
{
|
||||
if (!strIn)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(strIn);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(strIn);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'H' && dataHead2 == 'R')
|
||||
{
|
||||
for (uint8 i = 0; i < EncounterCount; ++i)
|
||||
{
|
||||
uint32 tmpState;
|
||||
loadStream >> tmpState;
|
||||
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
|
||||
tmpState = NOT_STARTED;
|
||||
SetBossState(i, EncounterState(tmpState));
|
||||
}
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
protected:
|
||||
uint64 chestNormalGUID;
|
||||
uint64 chestHeroicGUID;
|
||||
bool spawned;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
|
||||
@@ -158,7 +158,6 @@ class instance_shattered_halls : public InstanceMapScript
|
||||
}
|
||||
|
||||
protected:
|
||||
uint32 encounter[EncounterCount];
|
||||
uint64 nethekurseGUID;
|
||||
uint64 nethekurseDoor1GUID;
|
||||
uint64 nethekurseDoor2GUID;
|
||||
|
||||
Reference in New Issue
Block a user