From 0b6997b8af2ebd377b418235c62161e93a64ec5c Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 12 Jan 2013 00:14:12 -0330 Subject: [PATCH] Core/Scripting: Move Boss_Gatewatcher_Gyrokill to c++ scripting. Additional cleanup in Mechanar. --- .../2013_01_11_05_world_creature_text.sql | 13 ++ .../Mechanar/boss_gatewatcher_gyrokill.cpp | 127 +++++++++++-- .../Mechanar/boss_nethermancer_sepethrea.cpp | 134 +++++++------- .../boss_pathaleon_the_calculator.cpp | 168 ++++++++---------- .../Mechanar/instance_mechanar.cpp | 22 +-- .../Outland/TempestKeep/Mechanar/mechanar.h | 17 +- 6 files changed, 292 insertions(+), 189 deletions(-) create mode 100644 sql/updates/world/2013_01_11_05_world_creature_text.sql diff --git a/sql/updates/world/2013_01_11_05_world_creature_text.sql b/sql/updates/world/2013_01_11_05_world_creature_text.sql new file mode 100644 index 0000000000000..1283fd8610636 --- /dev/null +++ b/sql/updates/world/2013_01_11_05_world_creature_text.sql @@ -0,0 +1,13 @@ +-- NPC talk text for Gatewatcher Gyro-Kill +DELETE FROM `creature_text` WHERE `entry`=19218; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(19218,0,0, 'I predict a painful death.',14,0,100,0,0,11101, 'Gatewatcher Gyro-Kill - Aggro'), +(19218,1,0, 'Your strategy was flawed.',14,0,100,0,0,11102, 'Gatewatcher Gyro-Kill - On Kill'), +(19218,1,1, 'Yes, the only logical outcome.',12,0,100,0,0,11103, 'Gatewatcher Gyro-Kill - On Kill'), +(19218,2,0, 'Measure twice; cut once.',14,0,100,0,0,11104, 'Gatewatcher Gyro-Kill - Sawblades'), +(19218,2,1, 'If my division is correct you should be quite dead.',14,0,100,0,0,11105, 'Gatewatcher Gyro-Kill - Sawblades'), +(19218,3,0, 'An unforeseen... contingency.',14,0,100,0,0,11106, 'Gatewatcher Gyro-Kill - On Death'); + +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=19218; +DELETE FROM `creature_ai_texts` WHERE `entry` BETWEEN -86 AND -81; +UPDATE `creature_template` SET `AIName`='', `ScriptName`= 'Boss_Gatewatcher_Gyrokill' WHERE `entry`=19218; diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp index 3c72c8353aa28..796308d68f6ae 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * 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 @@ -25,18 +24,120 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "mechanar.h" -//not used -#define SAY_AGGRO -1554000 -#define SAY_SAW_ATTACK1 -1554001 -#define SAY_SAW_ATTACK2 -1554002 -#define SAY_SLAY1 -1554003 -#define SAY_SLAY2 -1554004 -#define SAY_DEATH -1554005 +enum Say +{ + SAY_AGGRO = 0, + SAY_SLAY = 1, + SAY_SAW_BLADEs = 2, + SAY_DEATH = 3 +}; -#define SPELL_STREAM_OF_MACHINE_FLUID 35311 -#define SPELL_SAW_BLADE 35318 -#define H_SPELL_SAW_BLADE 39192 -#define SPELL_SHADOW_POWER 35322 -#define H_SPELL_SHADOW_POWER 39193 +enum Spells +{ + SPELL_STREAM_OF_MACHINE_FLUID = 35311, + SPELL_SAW_BLADE = 35318, + H_SPELL_SAW_BLADE = 39192, + SPELL_SHADOW_POWER = 35322, + H_SPELL_SHADOW_POWER = 39193 +}; +enum Events +{ + EVENT_STREAM_OF_MACHINE_FLUID = 0, + EVENT_SAW_BLADE = 1, + EVENT_SHADOW_POWER = 2 +}; + +class Boss_Gatewatcher_Gyrokill : public CreatureScript +{ + public: Boss_Gatewatcher_Gyrokill() : CreatureScript("Boss_Gatewatcher_Gyrokill") { } + + struct Boss_Gatewatcher_GyrokillAI : public BossAI + { + 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); + + Talk(SAY_DEATH); + } + + void EnterCombat(Unit* /*who*/) + { + if (instance) + instance->SetData(DATA_GATEWATCHER_GYROKILL, IN_PROGRESS); + + events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, 10000); + events.ScheduleEvent(EVENT_SAW_BLADE, 20000); + events.ScheduleEvent(EVENT_SHADOW_POWER, 25000); + + Talk(SAY_AGGRO); + } + + void KilledUnit(Unit* /*victim*/) + { + Talk(SAY_SLAY); + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_STREAM_OF_MACHINE_FLUID: + DoCastVictim(SPELL_STREAM_OF_MACHINE_FLUID, true); + 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); + 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); + events.ScheduleEvent(EVENT_SAW_BLADE, urand(25000, 35000)); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new Boss_Gatewatcher_GyrokillAI (creature); + } +}; + +void AddSC_Boss_Gatewatcher_Gyrokill() +{ + new Boss_Gatewatcher_Gyrokill(); +} \ No newline at end of file diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp index 5a9e551375ba0..cdfb20b5f0d9c 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -36,59 +36,58 @@ enum eSays SAY_DEATH = 4 }; -enum eSpells +enum Spells { - SPELL_SUMMON_RAGIN_FLAMES = 35275, + SPELL_SUMMON_RAGIN_FLAMES = 35275, // Not scripted SPELL_FROST_ATTACK = 35263, SPELL_ARCANE_BLAST = 35314, SPELL_DRAGONS_BREATH = 35250, SPELL_KNOCKBACK = 37317, SPELL_SOLARBURN = 35267, - H_SPELL_SUMMON_RAGIN_FLAMES = 39084, - SPELL_INFERNO = 35268, - H_SPELL_INFERNO = 39346, - SPELL_FIRE_TAIL = 35278, + H_SPELL_SUMMON_RAGIN_FLAMES = 39084, // Not scripted + SPELL_INFERNO = 35268, // Not scripted + H_SPELL_INFERNO = 39346, // Not scripted + SPELL_FIRE_TAIL = 35278 // Not scripted +}; + +enum Events +{ + EVENT_FROST_ATTACK = 0, + EVENT_ARCANE_BLAST = 1, + EVENT_DRAGONS_BREATH = 2, + EVENT_KNOCKBACK = 3, + EVENT_SOLARBURN = 4 }; class boss_nethermancer_sepethrea : public CreatureScript { - public: + public: boss_nethermancer_sepethrea(): CreatureScript("boss_nethermancer_sepethrea") {} - boss_nethermancer_sepethrea() - : CreatureScript("boss_nethermancer_sepethrea") - { - } - struct boss_nethermancer_sepethreaAI : public ScriptedAI + struct boss_nethermancer_sepethreaAI : public BossAI { - boss_nethermancer_sepethreaAI(Creature* creature) : ScriptedAI(creature) + boss_nethermancer_sepethreaAI(Creature* creature) : BossAI(creature,DATA_NETHERMANCER_SEPRETHREA) { instance = creature->GetInstanceScript(); } InstanceScript* instance; - uint32 frost_attack_Timer; - uint32 arcane_blast_Timer; - uint32 dragons_breath_Timer; - uint32 knockback_Timer; - uint32 solarburn_Timer; - void Reset() { - frost_attack_Timer = urand(7000, 10000); - arcane_blast_Timer = urand(12000, 18000); - dragons_breath_Timer = urand(18000, 22000); - knockback_Timer = urand(22000, 28000); - solarburn_Timer = 30000; - if (instance) - instance->SetData(DATA_NETHERMANCER_EVENT, NOT_STARTED); + instance->SetData(DATA_NETHERMANCER_SEPRETHREA, NOT_STARTED); } void EnterCombat(Unit* who) { if (instance) - instance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS); + instance->SetData(DATA_NETHERMANCER_SEPRETHREA, IN_PROGRESS); + + 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); @@ -104,64 +103,49 @@ class boss_nethermancer_sepethrea : public CreatureScript { Talk(SAY_DEATH); if (instance) - instance->SetData(DATA_NETHERMANCER_EVENT, DONE); + instance->SetData(DATA_NETHERMANCER_SEPRETHREA, DONE); } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { - //Return since we have no target if (!UpdateVictim()) return; - //Frost Attack - if (frost_attack_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FROST_ATTACK); + events.Update(diff); - frost_attack_Timer = urand(7000, 10000); - } - else - frost_attack_Timer -= diff; + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - //Arcane Blast - if (arcane_blast_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCANE_BLAST); - arcane_blast_Timer = 15000; - } - else - arcane_blast_Timer -= diff; - //Dragons Breath - if (dragons_breath_Timer <= diff) + while (uint32 eventId = events.ExecuteEvent()) { - DoCast(me->getVictim(), SPELL_DRAGONS_BREATH); + switch (eventId) { - if (rand()%2) - return; - Talk(SAY_DRAGONS_BREATH); + case EVENT_FROST_ATTACK: + DoCastVictim(SPELL_FROST_ATTACK, true); + events.ScheduleEvent(EVENT_FROST_ATTACK, urand(7000, 10000)); + break; + case EVENT_ARCANE_BLAST: + DoCastVictim(SPELL_ARCANE_BLAST, true); + events.ScheduleEvent(EVENT_ARCANE_BLAST, 15000); + break; + case EVENT_DRAGONS_BREATH: + DoCastVictim(SPELL_DRAGONS_BREATH, true); + events.ScheduleEvent(EVENT_DRAGONS_BREATH, urand(12000, 22000)); + if (roll_chance_i(50)) + Talk(SAY_DRAGONS_BREATH); + break; + case EVENT_KNOCKBACK: + DoCastVictim(SPELL_KNOCKBACK, true); + events.ScheduleEvent(EVENT_KNOCKBACK, urand(15000, 25000)); + break; + case EVENT_SOLARBURN: + DoCastVictim(SPELL_SOLARBURN, true); + events.ScheduleEvent(EVENT_SOLARBURN, 30000); + break; + default: + break; } - dragons_breath_Timer = urand(12000, 22000); - } - else - dragons_breath_Timer -= diff; - - //Knockback - if (knockback_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKBACK); - knockback_Timer = urand(15000, 25000); } - else - knockback_Timer -= diff; - - //Solarburn - if (solarburn_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SOLARBURN); - solarburn_Timer = 30000; - } - else - solarburn_Timer -= diff; DoMeleeAttackIfReady(); } @@ -172,6 +156,7 @@ class boss_nethermancer_sepethrea : public CreatureScript return new boss_nethermancer_sepethreaAI(creature); } }; + class mob_ragin_flames : public CreatureScript { public: @@ -217,7 +202,7 @@ class mob_ragin_flames : public CreatureScript { if (instance) { - if (instance->GetData(DATA_NETHERMANCER_EVENT) != IN_PROGRESS) + if (instance->GetData(DATA_NETHERMANCER_SEPRETHREA) != IN_PROGRESS) { //remove me->setDeathState(JUST_DIED); @@ -259,6 +244,7 @@ class mob_ragin_flames : public CreatureScript return new mob_ragin_flamesAI(creature); } }; + void AddSC_boss_nethermancer_sepethrea() { new boss_nethermancer_sepethrea(); diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp index 41296daf1fafb..b78572391579e 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp @@ -25,8 +25,9 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "mechanar.h" -enum eSays +enum Says { SAY_AGGRO = 0, SAY_DOMINATION = 1, @@ -35,65 +36,65 @@ enum eSays SAY_SLAY = 4, SAY_DEATH = 5 }; -// Spells to be casted -enum eSpells + +enum Spells { SPELL_MANA_TAP = 36021, SPELL_ARCANE_TORRENT = 36022, SPELL_DOMINATION = 35280, H_SPELL_ARCANE_EXPLOSION = 15453, SPELL_FRENZY = 36992, - //Spells work, but not implemented - SPELL_SUMMON_NETHER_WRAITH_1 = 35285, - SPELL_SUMMON_NETHER_WRAITH_2 = 35286, - SPELL_SUMMON_NETHER_WRAITH_3 = 35287, - SPELL_SUMMON_NETHER_WRAITH_4 = 35288, - // Add Spells - SPELL_DETONATION = 35058, - SPELL_ARCANE_MISSILES = 35034, + SPELL_SUMMON_NETHER_WRAITH_1 = 35285, // Not scripted + SPELL_SUMMON_NETHER_WRAITH_2 = 35286, // Not scripted + SPELL_SUMMON_NETHER_WRAITH_3 = 35287, // Not scripted + SPELL_SUMMON_NETHER_WRAITH_4 = 35288, // Not scripted + SPELL_DETONATION = 35058, // Used by Nether Wraith + SPELL_ARCANE_MISSILES = 35034 // Used by Nether Wraith }; -class boss_pathaleon_the_calculator : public CreatureScript +enum Events { - public: + EVENT_SUMMON = 0, + EVENT_MANA_TAP = 1, + EVENT_ARCANE_TORRENT = 2, + EVENT_DOMINATION = 3, + EVENT_ARCANE_EXPLOSION = 4 +}; - boss_pathaleon_the_calculator() - : CreatureScript("boss_pathaleon_the_calculator") - { - } +class boss_pathaleon_the_calculator : public CreatureScript +{ + public: boss_pathaleon_the_calculator(): CreatureScript("boss_pathaleon_the_calculator") {} - struct boss_pathaleon_the_calculatorAI : public ScriptedAI + struct boss_pathaleon_the_calculatorAI : public BossAI { - boss_pathaleon_the_calculatorAI(Creature* creature) : ScriptedAI(creature), summons(me) - { - } + boss_pathaleon_the_calculatorAI(Creature* creature) : BossAI(creature,DATA_PATHALEON_THE_CALCULATOR), summons(me) {} - uint32 Summon_Timer; SummonList summons; - uint32 ManaTap_Timer; - uint32 ArcaneTorrent_Timer; - uint32 Domination_Timer; - uint32 ArcaneExplosion_Timer; - bool Enraged; - uint32 Counter; void Reset() { - Summon_Timer = 30000; - ManaTap_Timer = urand(12000, 20000); - ArcaneTorrent_Timer = urand(16000, 25000); - Domination_Timer = urand(25000, 40000); - ArcaneExplosion_Timer = urand(8000, 13000); + if (instance) + instance->SetData(DATA_PATHALEON_THE_CALCULATOR, NOT_STARTED); Enraged = false; - Counter = 0; summons.DespawnAll(); } + void EnterCombat(Unit* /*who*/) { + if (instance) + instance->SetData(DATA_PATHALEON_THE_CALCULATOR, IN_PROGRESS); + + 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)); + Talk(SAY_AGGRO); } @@ -107,84 +108,73 @@ class boss_pathaleon_the_calculator : public CreatureScript Talk(SAY_DEATH); summons.DespawnAll(); + + if (instance) + instance->SetData(DATA_PATHALEON_THE_CALCULATOR, DONE); } void JustSummoned(Creature* summon) { summons.Summon(summon); } + void SummonedCreatureDespawn(Creature* summon) { summons.Despawn(summon); } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { - //Return since we have no target if (!UpdateVictim()) return; - if (Summon_Timer <= diff) - { - for (uint8 i = 0; i < 3; ++i) - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); - Creature* Wraith = me->SummonCreature(21062, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - if (target && Wraith) - Wraith->AI()->AttackStart(target); - } - Talk(SAY_SUMMON); - Summon_Timer = urand(30000, 45000); - } - else - Summon_Timer -= diff; + events.Update(diff); - if (ManaTap_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_MANA_TAP); - ManaTap_Timer = urand(14000, 22000); - } - else - ManaTap_Timer -= diff; - - if (ArcaneTorrent_Timer <= diff) + if (!Enraged && HealthBelowPct(21)) { - DoCast(me->getVictim(), SPELL_ARCANE_TORRENT); - ArcaneTorrent_Timer = urand(12000, 18000); + DoCast(me, SPELL_FRENZY); + Talk(SAY_ENRAGE); + Enraged = true; } - else - ArcaneTorrent_Timer -= diff; - if (Domination_Timer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) - { - Talk(SAY_DOMINATION); - DoCast(target, SPELL_DOMINATION); - } - Domination_Timer = urand(25000, 30000); - } - else - Domination_Timer -= diff; + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - //Only casting if Heroic Mode is used - if (IsHeroic()) + while (uint32 eventId = events.ExecuteEvent()) { - if (ArcaneExplosion_Timer <= diff) + switch (eventId) { - DoCast(me->getVictim(), H_SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = urand(10000, 14000); + case EVENT_SUMMON: + for (uint8 i = 0; i < 3; ++i) + { + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); + Creature* Wraith = me->SummonCreature(21062, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + if (target && Wraith) + Wraith->AI()->AttackStart(target); + } + Talk(SAY_SUMMON); + events.ScheduleEvent(EVENT_SUMMON, urand(30000, 45000)); + break; + case EVENT_MANA_TAP: + DoCastVictim(SPELL_MANA_TAP, true); + events.ScheduleEvent(EVENT_MANA_TAP, urand(14000, 22000)); + break; + case EVENT_ARCANE_TORRENT: + DoCastVictim(SPELL_ARCANE_TORRENT, true); + events.ScheduleEvent(EVENT_ARCANE_TORRENT, urand(12000, 18000)); + break; + case EVENT_DOMINATION: + Talk(SAY_DOMINATION); + DoCastVictim(SPELL_DOMINATION, true); + events.ScheduleEvent(EVENT_DOMINATION, urand(25000, 30000)); + break; + case EVENT_ARCANE_EXPLOSION: // Heroic only + DoCastVictim(H_SPELL_ARCANE_EXPLOSION, true); + events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(10000, 14000)); + break; + default: + break; } - else - ArcaneExplosion_Timer -= diff; - } - - if (!Enraged && HealthBelowPct(21)) - { - DoCast(me, SPELL_FRENZY); - Talk(SAY_ENRAGE); - Enraged = true; - } DoMeleeAttackIfReady(); diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp index 1f9ddfcdd0b86..21fb085b26675 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp @@ -27,15 +27,9 @@ EndScriptData */ #include "InstanceScript.h" #include "mechanar.h" -#define MAX_ENCOUNTER 1 - class instance_mechanar : public InstanceMapScript { - public: - instance_mechanar() - : InstanceMapScript("instance_mechanar", 554) - { - } + public: instance_mechanar(): InstanceMapScript("instance_mechanar", 554) {} struct instance_mechanar_InstanceMapScript : public InstanceScript { @@ -45,7 +39,7 @@ class instance_mechanar : public InstanceMapScript void Initialize() { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + // memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); } bool IsEncounterInProgress() const @@ -61,7 +55,11 @@ class instance_mechanar : public InstanceMapScript { switch (type) { - case DATA_NETHERMANCER_EVENT: return m_auiEncounter[0]; + 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]; } return false; @@ -76,7 +74,11 @@ class instance_mechanar : public InstanceMapScript { switch (type) { - case DATA_NETHERMANCER_EVENT: m_auiEncounter[0] = data; break; + 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; } } }; diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h index c933c90afefaa..7aa4cca7f8e04 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * 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 @@ -19,6 +18,18 @@ #ifndef DEF_MECHANAR_H #define DEF_MECHANAR_H -#define DATA_NETHERMANCER_EVENT 1 -#endif +enum DataTypes +{ + DATA_GATEWATCHER_GYROKILL = 0, + DATA_IRON_HAND = 1, + DATA_MECHANOLORD_CAPACITUS = 2, + DATA_NETHERMANCER_SEPRETHREA = 3, + DATA_PATHALEON_THE_CALCULATOR = 4 +}; + +enum Misc +{ + MAX_ENCOUNTER = 5 +}; +#endif