mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
Core/Scripting: More updates to Mechanar
This commit is contained in:
@@ -17,8 +17,8 @@
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_Gatewatcher_Gyrokill
|
||||
SD%Complete: 0
|
||||
SDComment: Place Holder
|
||||
SD%Complete: 99%
|
||||
SDComment:
|
||||
SDCategory: Tempest Keep, The Mechanar
|
||||
EndScriptData */
|
||||
|
||||
@@ -58,29 +58,18 @@ class Boss_Gatewatcher_Gyrokill : public CreatureScript
|
||||
{
|
||||
Boss_Gatewatcher_GyrokillAI(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_GYROKILL) {}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_GATEWATCHER_GYROKILL, NOT_STARTED);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_GATEWATCHER_GYROKILL, DONE);
|
||||
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_GATEWATCHER_GYROKILL, IN_PROGRESS);
|
||||
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, 10000);
|
||||
events.ScheduleEvent(EVENT_SAW_BLADE, 20000);
|
||||
events.ScheduleEvent(EVENT_SHADOW_POWER, 25000);
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
@@ -108,18 +97,12 @@ class Boss_Gatewatcher_Gyrokill : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, urand(13000, 17000));
|
||||
break;
|
||||
case EVENT_SAW_BLADE:
|
||||
if (IsHeroic())
|
||||
DoCast(me, H_SPELL_SAW_BLADE);
|
||||
else
|
||||
DoCast(me, SPELL_SAW_BLADE);
|
||||
DoCast(me, SPELL_SAW_BLADE);
|
||||
Talk(SAY_SAW_BLADEs);
|
||||
events.ScheduleEvent(EVENT_SAW_BLADE, urand(20000, 30000));
|
||||
break;
|
||||
case EVENT_SHADOW_POWER:
|
||||
if (IsHeroic())
|
||||
DoCast(me, H_SPELL_SHADOW_POWER);
|
||||
else
|
||||
DoCast(me, SPELL_SHADOW_POWER);
|
||||
DoCast(me, SPELL_SHADOW_POWER);
|
||||
events.ScheduleEvent(EVENT_SAW_BLADE, urand(25000, 35000));
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -65,30 +65,16 @@ class boss_nethermancer_sepethrea : public CreatureScript
|
||||
|
||||
struct boss_nethermancer_sepethreaAI : public BossAI
|
||||
{
|
||||
boss_nethermancer_sepethreaAI(Creature* creature) : BossAI(creature,DATA_NETHERMANCER_SEPRETHREA)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_NETHERMANCER_SEPRETHREA, NOT_STARTED);
|
||||
}
|
||||
boss_nethermancer_sepethreaAI(Creature* creature) : BossAI(creature,DATA_NETHERMANCER_SEPRETHREA) {}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_NETHERMANCER_SEPRETHREA, IN_PROGRESS);
|
||||
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_FROST_ATTACK, urand(7000, 10000));
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, urand(12000, 18000));
|
||||
events.ScheduleEvent(EVENT_DRAGONS_BREATH, urand(18000, 22000));
|
||||
events.ScheduleEvent(EVENT_KNOCKBACK, urand(22000, 28000));
|
||||
events.ScheduleEvent(EVENT_SOLARBURN, 30000);
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
DoCast(who, SPELL_SUMMON_RAGIN_FLAMES);
|
||||
Talk(SAY_SUMMON);
|
||||
@@ -101,9 +87,8 @@ class boss_nethermancer_sepethrea : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
if (instance)
|
||||
instance->SetData(DATA_NETHERMANCER_SEPRETHREA, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 const diff)
|
||||
|
||||
@@ -75,9 +75,7 @@ class boss_pathaleon_the_calculator : public CreatureScript
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_PATHALEON_THE_CALCULATOR, NOT_STARTED);
|
||||
|
||||
_Reset();
|
||||
Enraged = false;
|
||||
Counter = 0;
|
||||
summons.DespawnAll();
|
||||
@@ -85,16 +83,12 @@ class boss_pathaleon_the_calculator : public CreatureScript
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_PATHALEON_THE_CALCULATOR, IN_PROGRESS);
|
||||
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_SUMMON, 30000);
|
||||
events.ScheduleEvent(EVENT_MANA_TAP, urand(12000, 20000));
|
||||
events.ScheduleEvent(EVENT_ARCANE_TORRENT, urand(16000, 25000));
|
||||
events.ScheduleEvent(EVENT_DOMINATION, urand(25000, 40000));
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(8000, 13000));
|
||||
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(8000, 13000));
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
@@ -105,12 +99,9 @@ class boss_pathaleon_the_calculator : public CreatureScript
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
summons.DespawnAll();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_PATHALEON_THE_CALCULATOR, DONE);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
|
||||
@@ -31,35 +31,29 @@ class instance_mechanar : public InstanceMapScript
|
||||
{
|
||||
public: instance_mechanar(): InstanceMapScript("instance_mechanar", 554) {}
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_mechanar_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_mechanar_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_mechanar_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
void Initialize()
|
||||
instance_mechanar_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
// memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
SetBossNumber(EncounterCount);
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_GATEWATCHER_GYROKILL: return m_auiEncounter[DATA_GATEWATCHER_GYROKILL];
|
||||
case DATA_IRON_HAND: return m_auiEncounter[DATA_IRON_HAND];
|
||||
case DATA_MECHANOLORD_CAPACITUS: return m_auiEncounter[DATA_MECHANOLORD_CAPACITUS];
|
||||
case DATA_NETHERMANCER_SEPRETHREA: return m_auiEncounter[DATA_NETHERMANCER_SEPRETHREA];
|
||||
case DATA_PATHALEON_THE_CALCULATOR: return m_auiEncounter[DATA_PATHALEON_THE_CALCULATOR];
|
||||
case DATA_GATEWATCHER_GYROKILL: return SetBossNumber[DATA_GATEWATCHER_GYROKILL];
|
||||
case DATA_IRON_HAND: return SetBossNumber[DATA_IRON_HAND];
|
||||
case DATA_MECHANOLORD_CAPACITUS: return SetBossNumber[DATA_MECHANOLORD_CAPACITUS];
|
||||
case DATA_NETHERMANCER_SEPRETHREA: return SetBossNumber[DATA_NETHERMANCER_SEPRETHREA];
|
||||
case DATA_PATHALEON_THE_CALCULATOR: return SetBossNumber[DATA_PATHALEON_THE_CALCULATOR];
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -70,23 +64,69 @@ class instance_mechanar : public InstanceMapScript
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case DATA_GATEWATCHER_GYROKILL: m_auiEncounter[DATA_GATEWATCHER_GYROKILL] = data; break;
|
||||
case DATA_IRON_HAND: m_auiEncounter[DATA_IRON_HAND] = data; break;
|
||||
case DATA_MECHANOLORD_CAPACITUS: m_auiEncounter[DATA_MECHANOLORD_CAPACITUS] = data; break;
|
||||
case DATA_NETHERMANCER_SEPRETHREA: m_auiEncounter[DATA_NETHERMANCER_SEPRETHREA] = data; break;
|
||||
case DATA_PATHALEON_THE_CALCULATOR: m_auiEncounter[DATA_PATHALEON_THE_CALCULATOR] = data; break;
|
||||
case DATA_GATEWATCHER_GYROKILL:
|
||||
case DATA_IRON_HAND:
|
||||
case DATA_MECHANOLORD_CAPACITUS:
|
||||
case DATA_NETHERMANCER_SEPRETHREA:
|
||||
case DATA_PATHALEON_THE_CALCULATOR:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "S O " << GetBossSaveData();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* str)
|
||||
{
|
||||
if (!str)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(str);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(str);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'S' && dataHead2 == 'O')
|
||||
{
|
||||
for (uint32 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;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_mechanar_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_mechanar()
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
#ifndef DEF_MECHANAR_H
|
||||
#define DEF_MECHANAR_H
|
||||
|
||||
uint32 const EncounterCount = 5;
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_GATEWATCHER_GYROKILL = 0,
|
||||
@@ -27,9 +29,4 @@ enum DataTypes
|
||||
DATA_PATHALEON_THE_CALCULATOR = 4
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
MAX_ENCOUNTER = 5
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user