From 0b6997b8af2ebd377b418235c62161e93a64ec5c Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 12 Jan 2013 00:14:12 -0330 Subject: Core/Scripting: Move Boss_Gatewatcher_Gyrokill to c++ scripting. Additional cleanup in Mechanar. --- sql/updates/world/2013_01_11_05_world_creature_text.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 sql/updates/world/2013_01_11_05_world_creature_text.sql (limited to '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 00000000000..1283fd86106 --- /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; -- cgit v1.2.3 From 1d6c6f55c778c0be65cb09cf4b88ae0ef71dee11 Mon Sep 17 00:00:00 2001 From: Gacko Date: Sat, 12 Jan 2013 12:40:39 +0100 Subject: DB/SAI: Hulking Abomination --- sql/updates/world/2013_01_12_01_00_world_smart_scripts.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2013_01_12_01_00_world_smart_scripts.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_12_01_00_world_smart_scripts.sql b/sql/updates/world/2013_01_12_01_00_world_smart_scripts.sql new file mode 100644 index 00000000000..06562cbd122 --- /dev/null +++ b/sql/updates/world/2013_01_12_01_00_world_smart_scripts.sql @@ -0,0 +1,7 @@ +-- Hulking Abomination +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=31140; +DELETE FROM `smart_scripts` WHERE `entryorguid`=31140 AND `source_type`=0; +INSERT INTO `smart_scripts`(`entryorguid`,`id`,`event_type`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`target_type`,`comment`) VALUES +(31140,0,6,0,0,0,0,0,11,58995,2,1,'Hulking Abomination - Just died - Cast Exploding Corpse'), +(31140,1,9,1,8,40,0,0,11,50335,0,7,'Hulking Abomination - Invoker in range of 8 to 40 yards - Cast Scourge Hook'), +(31140,2,0,0,3000,3000,7000,7000,11,40504,0,2,'Hulking Abomination - In combat - Cast Cleave'); -- cgit v1.2.3 From d8b2954507d3cba335aba8c2571f580d095639ed Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Sat, 12 Jan 2013 14:26:30 +0200 Subject: Core/Tickets: Allow viewing of ticket response(if any) when using .ticket viewid or .ticket viewname. Fix an sql name. --- sql/updates/world/2013_01_12_00_world_smart_scripts.sql | 7 +++++++ sql/updates/world/2013_01_12_01_00_world_smart_scripts.sql | 7 ------- sql/updates/world/2013_01_12_01_world_string.sql | 3 +++ src/server/game/Miscellaneous/Language.h | 1 + src/server/game/Tickets/TicketMgr.cpp | 2 ++ 5 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 sql/updates/world/2013_01_12_00_world_smart_scripts.sql delete mode 100644 sql/updates/world/2013_01_12_01_00_world_smart_scripts.sql create mode 100644 sql/updates/world/2013_01_12_01_world_string.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_12_00_world_smart_scripts.sql b/sql/updates/world/2013_01_12_00_world_smart_scripts.sql new file mode 100644 index 00000000000..06562cbd122 --- /dev/null +++ b/sql/updates/world/2013_01_12_00_world_smart_scripts.sql @@ -0,0 +1,7 @@ +-- Hulking Abomination +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=31140; +DELETE FROM `smart_scripts` WHERE `entryorguid`=31140 AND `source_type`=0; +INSERT INTO `smart_scripts`(`entryorguid`,`id`,`event_type`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`target_type`,`comment`) VALUES +(31140,0,6,0,0,0,0,0,11,58995,2,1,'Hulking Abomination - Just died - Cast Exploding Corpse'), +(31140,1,9,1,8,40,0,0,11,50335,0,7,'Hulking Abomination - Invoker in range of 8 to 40 yards - Cast Scourge Hook'), +(31140,2,0,0,3000,3000,7000,7000,11,40504,0,2,'Hulking Abomination - In combat - Cast Cleave'); diff --git a/sql/updates/world/2013_01_12_01_00_world_smart_scripts.sql b/sql/updates/world/2013_01_12_01_00_world_smart_scripts.sql deleted file mode 100644 index 06562cbd122..00000000000 --- a/sql/updates/world/2013_01_12_01_00_world_smart_scripts.sql +++ /dev/null @@ -1,7 +0,0 @@ --- Hulking Abomination -UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=31140; -DELETE FROM `smart_scripts` WHERE `entryorguid`=31140 AND `source_type`=0; -INSERT INTO `smart_scripts`(`entryorguid`,`id`,`event_type`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`target_type`,`comment`) VALUES -(31140,0,6,0,0,0,0,0,11,58995,2,1,'Hulking Abomination - Just died - Cast Exploding Corpse'), -(31140,1,9,1,8,40,0,0,11,50335,0,7,'Hulking Abomination - Invoker in range of 8 to 40 yards - Cast Scourge Hook'), -(31140,2,0,0,3000,3000,7000,7000,11,40504,0,2,'Hulking Abomination - In combat - Cast Cleave'); diff --git a/sql/updates/world/2013_01_12_01_world_string.sql b/sql/updates/world/2013_01_12_01_world_string.sql new file mode 100644 index 00000000000..8766e97231d --- /dev/null +++ b/sql/updates/world/2013_01_12_01_world_string.sql @@ -0,0 +1,3 @@ +DELETE FROM `trinity_string` WHERE `entry`=2029; +INSERT INTO `trinity_string` (`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`) VALUES +(2029,'|cff00ff00Ticket Response|r: [%s]|r',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index f116d695e17..292833c3955 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -928,6 +928,7 @@ enum TrinityStrings LANG_COMMAND_TICKETSHOWESCALATEDLIST = 2026, LANG_COMMAND_TICKETPENDING = 2027, LANG_COMMAND_TICKETRESET = 2028, + LANG_COMMAND_TICKETLISTRESPONSE = 2029, // Trinity strings 5000-9999 LANG_COMMAND_FREEZE = 5000, diff --git a/src/server/game/Tickets/TicketMgr.cpp b/src/server/game/Tickets/TicketMgr.cpp index 1b7ecd34051..fe10b81b09d 100644 --- a/src/server/game/Tickets/TicketMgr.cpp +++ b/src/server/game/Tickets/TicketMgr.cpp @@ -182,6 +182,8 @@ std::string GmTicket::FormatMessageString(ChatHandler& handler, bool detailed) c ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTMESSAGE, _message.c_str()); if (!_comment.empty()) ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTCOMMENT, _comment.c_str()); + if (!_response.empty()) + ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTRESPONSE, _response.c_str()); } return ss.str(); } -- cgit v1.2.3 From bf7f58365f5a2b2be24f27b328a66049cb03348e Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sat, 12 Jan 2013 19:35:11 +0100 Subject: Scripts/Misc: Some cleanups --- .../2013_01_12_02_world_creature_template.sql | 1 + .../Scholomance/instance_scholomance.cpp | 16 ------ .../Mechanar/boss_gatewatcher_gyrokill.cpp | 18 +++---- .../Mechanar/boss_nethermancer_sepethrea.cpp | 6 +-- .../Mechanar/boss_pathaleon_the_calculator.cpp | 62 ++++++++-------------- .../TempestKeep/Mechanar/instance_mechanar.cpp | 1 - 6 files changed, 33 insertions(+), 71 deletions(-) create mode 100644 sql/updates/world/2013_01_12_02_world_creature_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_12_02_world_creature_template.sql b/sql/updates/world/2013_01_12_02_world_creature_template.sql new file mode 100644 index 00000000000..f9c15b34423 --- /dev/null +++ b/sql/updates/world/2013_01_12_02_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`= 'boss_gatewatcher_gyrokill' WHERE `entry`=19218; \ No newline at end of file diff --git a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp index c43c1e18811..0da31fbe428 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp @@ -15,13 +15,6 @@ * with this program. If not, see . */ -/* ScriptData -Name: Instance_Scholomance -%Complete: 100 -Comment: -Category: Scholomance -EndScriptData */ - #include "ScriptMgr.h" #include "InstanceScript.h" #include "Player.h" @@ -119,31 +112,22 @@ class instance_scholomance : public InstanceMapScript { case GO_GATE_KIRTONOS: return GateKirtonosGUID; - break; case GO_GATE_GANDLING: return GateGandlingGUID; - break; case GO_GATE_MALICIA: return GateMiliciaGUID; - break; case GO_GATE_THEOLEN: return GateTheolenGUID; - break; case GO_GATE_POLKELT: return GatePolkeltGUID; - break; case GO_GATE_RAVENIAN: return GateRavenianGUID; - break; case GO_GATE_BAROV: return GateBarovGUID; - break; case GO_GATE_ILLUCIA: return GateIlluciaGUID; - break; case GO_BRAZIER_OF_THE_HERALD: return BrazierOfTheHeraldGUID; - break; default: break; } 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 60d42c38c50..00cce1ecebc 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp @@ -16,7 +16,7 @@ */ /* ScriptData -SDName: Boss_Gatewatcher_Gyrokill +SDName: boss_gatewatcher_gyrokill SD%Complete: 99% SDComment: SDCategory: Tempest Keep, The Mechanar @@ -50,13 +50,13 @@ enum Events EVENT_SHADOW_POWER = 2 }; -class Boss_Gatewatcher_Gyrokill : public CreatureScript +class boss_gatewatcher_gyrokill : public CreatureScript { - public: Boss_Gatewatcher_Gyrokill() : CreatureScript("Boss_Gatewatcher_Gyrokill") { } + public: boss_gatewatcher_gyrokill() : CreatureScript("boss_gatewatcher_gyrokill") { } - struct Boss_Gatewatcher_GyrokillAI : public BossAI + struct boss_gatewatcher_gyrokillAI : public BossAI { - Boss_Gatewatcher_GyrokillAI(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_GYROKILL) {} + boss_gatewatcher_gyrokillAI(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_GYROKILL) {} void JustDied(Unit* /*killer*/) { @@ -116,11 +116,11 @@ class Boss_Gatewatcher_Gyrokill : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new Boss_Gatewatcher_GyrokillAI (creature); + return new boss_gatewatcher_gyrokillAI (creature); } }; -void AddSC_Boss_Gatewatcher_Gyrokill() +void AddSC_boss_gatewatcher_gyrokill() { - new Boss_Gatewatcher_Gyrokill(); -} \ No newline at end of file + new boss_gatewatcher_gyrokill(); +} 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 4f71a020f83..0b2370e1b17 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -145,10 +145,7 @@ class boss_nethermancer_sepethrea : public CreatureScript class mob_ragin_flames : public CreatureScript { public: - mob_ragin_flames() - : CreatureScript("mob_ragin_flames") - { - } + mob_ragin_flames() : CreatureScript("mob_ragin_flames") { } struct mob_ragin_flamesAI : public ScriptedAI { @@ -235,4 +232,3 @@ void AddSC_boss_nethermancer_sepethrea() new boss_nethermancer_sepethrea(); new mob_ragin_flames(); } - 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 94daedfdc43..09b3403f5c2 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 @@ -61,25 +61,18 @@ enum Events EVENT_ARCANE_EXPLOSION = 4 }; +enum Creatures +{ + NPC_NETHER_WRAITH = 21062 +}; + class boss_pathaleon_the_calculator : public CreatureScript { public: boss_pathaleon_the_calculator(): CreatureScript("boss_pathaleon_the_calculator") {} struct boss_pathaleon_the_calculatorAI : public BossAI { - boss_pathaleon_the_calculatorAI(Creature* creature) : BossAI(creature,DATA_PATHALEON_THE_CALCULATOR), summons(me) {} - - SummonList summons; - bool Enraged; - uint32 Counter; - - void Reset() - { - _Reset(); - Enraged = false; - Counter = 0; - summons.DespawnAll(); - } + boss_pathaleon_the_calculatorAI(Creature* creature) : BossAI(creature, DATA_PATHALEON_THE_CALCULATOR) { } void EnterCombat(Unit* /*who*/) { @@ -101,17 +94,15 @@ class boss_pathaleon_the_calculator : public CreatureScript { _JustDied(); Talk(SAY_DEATH); - summons.DespawnAll(); - } - - void JustSummoned(Creature* summon) - { - summons.Summon(summon); } - void SummonedCreatureDespawn(Creature* summon) + void DamageTaken(Unit* /*attacker*/, uint32& damage) { - summons.Despawn(summon); + if (me->HealthBelowPctDamaged(20, damage) && !me->HasAura(SPELL_FRENZY)) + { + DoCast(me, SPELL_FRENZY); + Talk(SAY_ENRAGE); + } } void UpdateAI(uint32 const diff) @@ -121,13 +112,6 @@ class boss_pathaleon_the_calculator : public CreatureScript events.Update(diff); - if (!Enraged && HealthBelowPct(21)) - { - DoCast(me, SPELL_FRENZY); - Talk(SAY_ENRAGE); - Enraged = true; - } - if (me->HasUnitState(UNIT_STATE_CASTING)) return; @@ -138,10 +122,11 @@ class boss_pathaleon_the_calculator : public CreatureScript 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); + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + { + if (Creature* Wraith = me->SummonCreature(NPC_NETHER_WRAITH, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000)) + Wraith->AI()->AttackStart(target); + } } Talk(SAY_SUMMON); events.ScheduleEvent(EVENT_SUMMON, urand(30000, 45000)); @@ -172,20 +157,17 @@ class boss_pathaleon_the_calculator : public CreatureScript } }; - CreatureAI* GetAI(Creature* creature) const - { - return new boss_pathaleon_the_calculatorAI (creature); - } + CreatureAI* GetAI(Creature* creature) const + { + return new boss_pathaleon_the_calculatorAI (creature); + } }; class mob_nether_wraith : public CreatureScript { public: - mob_nether_wraith() - : CreatureScript("mob_nether_wraith") - { - } + mob_nether_wraith() : CreatureScript("mob_nether_wraith") { } struct mob_nether_wraithAI : public ScriptedAI { diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp index ac8efb83822..250959a1468 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp @@ -112,4 +112,3 @@ void AddSC_instance_mechanar() { new instance_mechanar(); } - -- cgit v1.2.3 From 9e91bcfe40df06698300e879f6515c70e05aee5d Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sat, 12 Jan 2013 19:38:48 +0100 Subject: SQL: Fix "No newline at end of file" in bf7f58365f5a2b2be24f27b328a66049cb03348e --- sql/updates/world/2013_01_12_02_world_creature_template.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/updates/world/2013_01_12_02_world_creature_template.sql b/sql/updates/world/2013_01_12_02_world_creature_template.sql index f9c15b34423..608af749f15 100644 --- a/sql/updates/world/2013_01_12_02_world_creature_template.sql +++ b/sql/updates/world/2013_01_12_02_world_creature_template.sql @@ -1 +1 @@ -UPDATE `creature_template` SET `ScriptName`= 'boss_gatewatcher_gyrokill' WHERE `entry`=19218; \ No newline at end of file +UPDATE `creature_template` SET `ScriptName`= 'boss_gatewatcher_gyrokill' WHERE `entry`=19218; -- cgit v1.2.3 From df2e54f587ce350bdd3e349a82b694649edd2dc3 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 12 Jan 2013 19:35:14 -0330 Subject: Core/Scripting: More cleanup to Mechanar scripts. Added missing doors and handling to instance. --- .../world/2013_01_12_03_world_gameobject.sql | 7 + src/server/game/Scripting/ScriptLoader.cpp | 2 + .../Mechanar/boss_gatewatcher_gyrokill.cpp | 4 +- .../Mechanar/boss_gatewatcher_ironhand.cpp | 144 ++++++++++----------- .../Mechanar/boss_mechano_lord_capacitus.cpp | 5 +- .../Mechanar/boss_nethermancer_sepethrea.cpp | 2 + .../TempestKeep/Mechanar/instance_mechanar.cpp | 68 +++++++++- .../Outland/TempestKeep/Mechanar/mechanar.h | 9 +- 8 files changed, 151 insertions(+), 90 deletions(-) create mode 100644 sql/updates/world/2013_01_12_03_world_gameobject.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_12_03_world_gameobject.sql b/sql/updates/world/2013_01_12_03_world_gameobject.sql new file mode 100644 index 00000000000..a7a914fceec --- /dev/null +++ b/sql/updates/world/2013_01_12_03_world_gameobject.sql @@ -0,0 +1,7 @@ +-- Add missing doors to mechanar +SET @GUID := 6032; +DELETE FROM `gameobject` WHERE `guid` BETWEEN @GUID AND @GUID+2; +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(@GUID,184632,554,3,1,236.4597,52.36356,1.653544,3.141593,0,0,-1,0,120,0,1), +(@GUID+1,184322,554,3,1,242.874,52.314810,1.596334,3.141593,0,0,-1,0,120,0,1), +(@GUID+2,184449,554,3,1,267.9281,52.31481,27.04254,3.141593,0,0,-1,0,120,0,1); diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 479979f177f..3e30e95639f 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -590,6 +590,7 @@ void AddSC_boss_high_astromancer_solarian(); void AddSC_instance_the_eye(); void AddSC_the_eye(); void AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar +void AddSC_boss_gatewatcher_gyrokill(); void AddSC_boss_nethermancer_sepethrea(); void AddSC_boss_pathaleon_the_calculator(); void AddSC_boss_mechano_lord_capacitus(); @@ -1073,6 +1074,7 @@ void AddOutlandScripts() AddSC_instance_the_eye(); AddSC_the_eye(); AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar + AddSC_boss_gatewatcher_gyrokill(); AddSC_boss_nethermancer_sepethrea(); AddSC_boss_pathaleon_the_calculator(); AddSC_boss_mechano_lord_capacitus(); 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 00cce1ecebc..22aff78f441 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp @@ -52,7 +52,7 @@ enum Events class boss_gatewatcher_gyrokill : public CreatureScript { - public: boss_gatewatcher_gyrokill() : CreatureScript("boss_gatewatcher_gyrokill") { } + public: boss_gatewatcher_gyrokill() : CreatureScript("boss_gatewatcher_gyrokill") {} struct boss_gatewatcher_gyrokillAI : public BossAI { @@ -62,6 +62,8 @@ class boss_gatewatcher_gyrokill : public CreatureScript { _JustDied(); Talk(SAY_DEATH); + if (GameObject* door = me->GetMap()->GetGameObject(instance->GetData64(GO_DOOR_MOARG_2))) + door->SetGoState(GO_STATE_ACTIVE); } void EnterCombat(Unit* /*who*/) diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp index 09ff6cf8e49..c613b3a67bb 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp @@ -25,8 +25,9 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "mechanar.h" -enum eSays +enum Says { SAY_AGGRO = 0, SAY_HAMMER = 1, @@ -35,106 +36,91 @@ enum eSays EMOTE_HAMMER = 4 }; -enum eSpells +enum Spells { - // Spells to be casted SPELL_SHADOW_POWER = 35322, H_SPELL_SHADOW_POWER = 39193, SPELL_HAMMER_PUNCH = 35326, SPELL_JACKHAMMER = 35327, H_SPELL_JACKHAMMER = 39194, - SPELL_STREAM_OF_MACHINE_FLUID = 35311, + SPELL_STREAM_OF_MACHINE_FLUID = 35311 +}; + +enum Events +{ + EVENT_STREAM_OF_MACHINE_FLUID = 0, + EVENT_JACKHAMMER = 1, + EVENT_SHADOW_POWER = 2 }; class boss_gatewatcher_iron_hand : public CreatureScript { - public: + public: boss_gatewatcher_iron_hand(): CreatureScript("boss_gatewatcher_iron_hand") {} - boss_gatewatcher_iron_hand() - : CreatureScript("boss_gatewatcher_iron_hand") + struct boss_gatewatcher_iron_handAI : public BossAI { - } - // Gatewatcher Iron-Hand AI - struct boss_gatewatcher_iron_handAI : public ScriptedAI - { - boss_gatewatcher_iron_handAI(Creature* creature) : ScriptedAI(creature) - { - } - - uint32 Shadow_Power_Timer; - uint32 Jackhammer_Timer; - uint32 Stream_of_Machine_Fluid_Timer; - - void Reset() - { - Shadow_Power_Timer = 25000; - Jackhammer_Timer = 45000; - Stream_of_Machine_Fluid_Timer = 55000; + boss_gatewatcher_iron_handAI(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_IRON_HAND) {} - } - void EnterCombat(Unit* /*who*/) - { - Talk(SAY_AGGRO); - } - - void KilledUnit(Unit* /*victim*/) - { - if (rand()%2) - return; + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, 55000); + events.ScheduleEvent(EVENT_JACKHAMMER, 45000); + events.ScheduleEvent(EVENT_SHADOW_POWER, 25000); + Talk(SAY_AGGRO); + } + void KilledUnit(Unit* /*victim*/) + { + if (roll_chance_i(50)) Talk(SAY_SLAY); - } - - void JustDied(Unit* /*killer*/) - { - Talk(SAY_DEATH); - //TODO: Add door check/open code - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Shadow Power - if (Shadow_Power_Timer <= diff) - { - DoCast(me, SPELL_SHADOW_POWER); - Shadow_Power_Timer = urand(20000, 28000); - } - else - Shadow_Power_Timer -= diff; + } - //Jack Hammer - if (Jackhammer_Timer <= diff) - { - //TODO: expect cast this about 5 times in a row (?), announce it by emote only once - Talk(EMOTE_HAMMER); - DoCast(me->getVictim(), SPELL_JACKHAMMER); + void JustDied(Unit* /*killer*/) + { + _JustDied(); + Talk(SAY_DEATH); + if (GameObject* door = me->GetMap()->GetGameObject(instance->GetData64(GO_DOOR_MOARG_1))) + door->SetGoState(GO_STATE_ACTIVE); + } - //chance to yell, but not same time as emote (after spell in fact casted) - if (rand()%2) - return; + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; - Talk(SAY_HAMMER); - Jackhammer_Timer = 30000; - } - else - Jackhammer_Timer -= diff; + events.Update(diff); - //Stream of Machine Fluid - if (Stream_of_Machine_Fluid_Timer <= diff) + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) { - DoCast(me->getVictim(), SPELL_STREAM_OF_MACHINE_FLUID); - Stream_of_Machine_Fluid_Timer = urand(35000, 50000); + case EVENT_STREAM_OF_MACHINE_FLUID: + DoCastVictim(SPELL_STREAM_OF_MACHINE_FLUID, true); + events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, urand(35000, 50000)); + break; + case EVENT_JACKHAMMER: + Talk(EMOTE_HAMMER); + //TODO: expect cast this about 5 times in a row (?), announce it by emote only once + DoCastVictim(SPELL_JACKHAMMER, true); + if (roll_chance_i(50)) + Talk(SAY_HAMMER); + events.ScheduleEvent(EVENT_JACKHAMMER, 30000); + break; + case EVENT_SHADOW_POWER: + DoCast(me, SPELL_SHADOW_POWER); + events.ScheduleEvent(EVENT_SHADOW_POWER, urand(20000, 28000)); + break; + default: + break; } - else - Stream_of_Machine_Fluid_Timer -= diff; - - DoMeleeAttackIfReady(); } - }; + + DoMeleeAttackIfReady(); + } + }; CreatureAI* GetAI(Creature* creature) const { diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp index f8c44471b30..e71be639999 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp @@ -29,13 +29,12 @@ enum Spells SPELL_POSITIVE_CHARGE = 39090, SPELL_NEGATIVE_POLARITY = 39091, SPELL_NEGATIVE_CHARGE_STACK = 39092, - SPELL_NEGATIVE_CHARGE = 39093, + SPELL_NEGATIVE_CHARGE = 39093 }; class spell_capacitus_polarity_charge : public SpellScriptLoader { - public: - spell_capacitus_polarity_charge() : SpellScriptLoader("spell_capacitus_polarity_charge") { } + public: spell_capacitus_polarity_charge() : SpellScriptLoader("spell_capacitus_polarity_charge") { } class spell_capacitus_polarity_charge_SpellScript : public SpellScript { 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 0b2370e1b17..fcf32e5c341 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -89,6 +89,8 @@ class boss_nethermancer_sepethrea : public CreatureScript { _JustDied(); Talk(SAY_DEATH); + if (GameObject* door = me->GetMap()->GetGameObject(instance->GetData64(GO_DOOR_NETHERMANCER))) + door->SetGoState(GO_STATE_ACTIVE); } void UpdateAI(uint32 const diff) diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp index 250959a1468..66424fb9e10 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp @@ -31,11 +31,67 @@ 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) { SetBossNumber(EncounterCount); + DoorMoArg1GUID = 0; + DoorMoArg2GUID = 0; + DoorNethermancerGUID = 0; + } + + void OnGameObjectCreate(GameObject* go) + { + switch (go->GetEntry()) + { + case GO_DOOR_MOARG_1: + DoorMoArg1GUID = go->GetGUID(); + break; + case GO_DOOR_MOARG_2: + DoorMoArg2GUID = go->GetGUID(); + break; + case GO_DOOR_NETHERMANCER: + DoorNethermancerGUID = go->GetGUID(); + break; + default: + break; + } + CheckInstanceStatus(); + } + + void CheckInstanceStatus() + { + if (GetBossState(DATA_GATEWATCHER_IRON_HAND) == DONE) + HandleGameObject(DoorMoArg1GUID, true); + + if (GetBossState(DATA_GATEWATCHER_GYROKILL) == DONE) + HandleGameObject(DoorMoArg2GUID, true); + + if (GetBossState(DATA_NETHERMANCER_SEPRETHREA) == DONE) + HandleGameObject(DoorNethermancerGUID, true); + } + + uint64 GetData64(uint32 type) const + { + switch (type) + { + case GO_DOOR_MOARG_1: + return DoorMoArg1GUID; + case GO_DOOR_MOARG_2: + return DoorMoArg2GUID; + case GO_DOOR_NETHERMANCER: + return DoorNethermancerGUID; + default: + break; + } + + return 0; } bool SetBossState(uint32 type, EncounterState state) @@ -46,7 +102,7 @@ class instance_mechanar : public InstanceMapScript switch (type) { case DATA_GATEWATCHER_GYROKILL: - case DATA_IRON_HAND: + case DATA_GATEWATCHER_IRON_HAND: case DATA_MECHANOLORD_CAPACITUS: case DATA_NETHERMANCER_SEPRETHREA: case DATA_PATHALEON_THE_CALCULATOR: @@ -100,12 +156,12 @@ class instance_mechanar : public InstanceMapScript OUT_LOAD_INST_DATA_COMPLETE; } - }; - InstanceScript* GetInstanceScript(InstanceMap* map) const - { - return new instance_mechanar_InstanceMapScript(map); - } + protected: + uint64 DoorMoArg1GUID; + uint64 DoorMoArg2GUID; + uint64 DoorNethermancerGUID; + }; }; void AddSC_instance_mechanar() diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h index b1c7cf8e25c..0d3a4ea241d 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/mechanar.h @@ -23,10 +23,17 @@ uint32 const EncounterCount = 5; enum DataTypes { DATA_GATEWATCHER_GYROKILL = 0, - DATA_IRON_HAND = 1, + DATA_GATEWATCHER_IRON_HAND = 1, DATA_MECHANOLORD_CAPACITUS = 2, DATA_NETHERMANCER_SEPRETHREA = 3, DATA_PATHALEON_THE_CALCULATOR = 4 }; +enum GameobjectIds +{ + GO_DOOR_MOARG_1 = 184632, + GO_DOOR_MOARG_2 = 184322, + GO_DOOR_NETHERMANCER = 184449 +}; + #endif -- cgit v1.2.3 From 4fb60031f8f8c79c94dac8cc8c2ecdbdaddfce39 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sat, 12 Jan 2013 20:16:16 -0330 Subject: DB/Waypoints: Fix waypoints for Mechano-Lord Capacitus --- .../world/2013_01_12_03_world_waypoints.sql | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 sql/updates/world/2013_01_12_03_world_waypoints.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_12_03_world_waypoints.sql b/sql/updates/world/2013_01_12_03_world_waypoints.sql new file mode 100644 index 00000000000..3903e383ae8 --- /dev/null +++ b/sql/updates/world/2013_01_12_03_world_waypoints.sql @@ -0,0 +1,53 @@ +-- Pathing for Mechano-Lord Capacitus Entry: 19219 +SET @NPC := 83160; +SET @PATH := @NPC * 10; +UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=207.2308,`position_y`=-14.30226,`position_z`=-2.192125 WHERE `guid`=@NPC; +DELETE FROM `creature_addon` WHERE `guid`=@NPC; +INSERT INTO `creature_addon` (`guid`,`path_id`,`bytes2`,`mount`,`auras`) VALUES (@NPC,@PATH,1,0, ''); +DELETE FROM `waypoint_data` WHERE `id`=@PATH; +INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES +(@PATH,1,207.2308,-14.30226,-2.192125,0,7000,0,0,100,0), +(@PATH,2,204.4302,-15.78992,-2.192125,0,1000,0,0,100,0), +(@PATH,3,207.7613,-18.93377,-2.192125,0,0,0,0,100,0), +(@PATH,4,208.2819,-16.48228,-2.192125,0,1000,0,0,100,0), +(@PATH,5,228.1113,-0.829701,-0.8854336,0,0,0,0,100,0), +(@PATH,6,226.6032,19.45208,-1.726556,0,14000,0,0,100,0), +(@PATH,7,209.7744,-12.69758,-2.192125,0,1000,0,0,100,0), +(@PATH,8,209.7744,-12.69758,-2.192125,3.141593,1000,0,0,100,0), +(@PATH,9,228.1113,-0.829701,-0.8854336,0,0,0,0,100,0), +(@PATH,10,226.6032,19.45208,-1.726556,0,0,0,0,100,0), +(@PATH,11,204.9646,26.38312,-0.005853632,0,13000,0,0,100,0), +(@PATH,12,209.7744,-12.69758,-2.192125,0,1000,0,0,100,0), +(@PATH,13,209.7744,-12.69758,-2.192125,3.141593,1000,0,0,100,0), +(@PATH,14,224.3664,-23.35326,-2.192125,0,0,0,0,100,0), +(@PATH,15,231.1084,-38.22675,8.909556E-07,0,15000,0,0,100,0), +(@PATH,16,209.7744,-12.69758,-2.192125,0,0,0,0,100,0), +(@PATH,17,209.7744,-12.69758,-2.192125,3.141593,1000,0,0,100,0), +(@PATH,18,189.2316,-17.36449,-2.192126,0,0,0,0,100,0), +(@PATH,19,185.7177,-4.297129,-1.142366,0,0,0,0,100,0), +(@PATH,20,191.9589,6.435908,-0.7838742,0,0,0,0,100,0), +(@PATH,21,196.1359,21.01234,-1.426585,0,0,0,0,100,0), +(@PATH,22,207.8954,18.24695,-2.192125,0,0,0,0,100,0), +(@PATH,23,213.9077,10.01895,-2.192125,0,11000,0,0,100,0), +(@PATH,24,209.7744,-12.69758,-2.192125,0,0,0,0,100,0), +(@PATH,25,209.7744,-12.69758,-2.192125,3.141593,2000,0,0,100,0), +(@PATH,26,203.706,-11.63055,-2.192125,0,10000,0,0,100,0), +(@PATH,27,206.4484,-14.27736,-2.192125,0,0,0,0,100,0), +(@PATH,28,208.3172,-13.38252,-2.192125,0,0,0,0,100,0), +(@PATH,29,209.3133,-12.82924,-2.192125,0,7000,0,0,100,0), +(@PATH,30,204.3208,-10.91346,-2.192125,0,0,0,0,100,0), +(@PATH,31,207.38,-13.36442,-2.192125,0,0,0,0,100,0), +(@PATH,32,207.7303,-11.56095,-2.192125,0,7000,0,0,100,0), +(@PATH,33,195.6332,-15.0944,-2.192125,0,0,0,0,100,0), +(@PATH,34,195.4723,-29.45176,-2.192125,0,0,0,0,100,0), +(@PATH,35,202.765,-41.79265,-2.192125,0,7000,0,0,100,0), +(@PATH,36,209.7744,-12.69758,-2.192125,0,1000,0,0,100,0), +(@PATH,37,209.7744,-12.69758,-2.192125,3.141593,1000,0,0,100,0), +(@PATH,38,189.2316,-17.36449,-2.192126,0,0,0,0,100,0), +(@PATH,39,185.7177,-4.297129,-1.142366,0,0,0,0,100,0), +(@PATH,40,191.9589,6.435908,-0.7838742,0,0,0,0,100,0), +(@PATH,41,196.1359,21.01234,-1.426585,0,0,0,0,100,0), +(@PATH,42,207.8954,18.24695,-2.192125,0,0,0,0,100,0), +(@PATH,43,213.9077,10.01895,-2.192125,0,6000,0,0,100,0), +(@PATH,44,209.7744,-12.69758,-2.192125,0,20000,0,0,100,0), +(@PATH,45,210.4122,-9.19214,-2.192125,0,0,0,0,100,0); -- cgit v1.2.3 From abe4b656c8775c2fe25649e83c135510442dc2b8 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sun, 13 Jan 2013 01:04:59 +0100 Subject: Scripts/Mechanar: * cleanup for door system * Convert mechano lord capacitus in c++ --- sql/updates/world/2013_01_12_04_world_misc.sql | 28 +++++ .../Mechanar/boss_gatewatcher_gyrokill.cpp | 5 +- .../Mechanar/boss_gatewatcher_ironhand.cpp | 16 +-- .../Mechanar/boss_mechano_lord_capacitus.cpp | 131 ++++++++++++++++++++- .../Mechanar/boss_nethermancer_sepethrea.cpp | 2 - .../Mechanar/boss_pathaleon_the_calculator.cpp | 3 +- .../TempestKeep/Mechanar/instance_mechanar.cpp | 71 ++++------- 7 files changed, 192 insertions(+), 64 deletions(-) create mode 100644 sql/updates/world/2013_01_12_04_world_misc.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_12_04_world_misc.sql b/sql/updates/world/2013_01_12_04_world_misc.sql new file mode 100644 index 00000000000..5ba81aa39f1 --- /dev/null +++ b/sql/updates/world/2013_01_12_04_world_misc.sql @@ -0,0 +1,28 @@ +UPDATE `creature_template` SET `AIName` = '',`ScriptName` = 'boss_mechano_lord_capacitus' WHERE `entry` =19219; +UPDATE `creature_template` SET `unit_flags`=`unit_flags` |2 |33554432 WHERE `entry` IN (20405,21534); -- Nether Charge + +DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (19219,20405); +DELETE FROM `creature_ai_texts` WHERE `entry` BETWEEN -92 AND -87; + +DELETE FROM `creature_template_addon` WHERE `entry` IN (20405,21534); +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(20405,0,0,0,0,0,'37670 35150'), -- Nether Charge +(21534,0,0,0,0,0,'37670 35150'); -- Nether Charge (1) + +SET @ENTRY := 20405; -- Nether Charge + +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY; +UPDATE creature_template SET AIName="SmartAI" WHERE entry=@ENTRY LIMIT 1; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ENTRY,0,0,0,0,0,100,0,14000,14000,1000,1000,11,35151,0,0,0,0,0,0,0,0,0,0.0,0.0,0.0,0.0,"Nether Bomb - Nether Charge Pulse"), +(@ENTRY,0,1,0,0,0,100,0,0,0,0,0,20,0,0,0,0,0,0,0,0,0,0,0.0,0.0,0.0,0.0,"Nether Charge - No Melee"), +(@ENTRY,0,2,0,0,0,100,0,0,0,14000,14000,21,0,0,0,0,0,0,0,0,0,0,0.0,0.0,0.0,0.0,"Nether Charge - Prevent Combat Movement When Start..."); + +DELETE FROM `creature_text` WHERE `entry` = 19219; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(19219, 0, 0, 'You should split while you can.', 14, 0, 100, 0, 0, 11162, 'Mechano-Lord Capacitus - Aggro'), +(19219, 1, 0, 'Go ahead, gimme your best shot. I can take it!', 14, 0, 100, 0, 0, 11166, 'Mechano-Lord Capacitus - Yells'), -- Reflective Damage Shield +(19219, 2, 0, 'Think you can hurt me, huh? Think I''m afraid a'' you?', 14, 0, 100, 0, 0, 11165, 'Mechano-Lord Capacitus - Yells'), -- Reflective Magic Shield +(19219, 3, 0, 'Can''t say I didn''t warn you!', 14, 0, 100, 0, 0, 11163, 'Mechano-Lord Capacitus - Killing a player'), +(19219, 3, 1, 'Damn, I''m good!', 14, 0, 100, 0, 0, 11164, 'Mechano-Lord Capacitus - Killing a player'), +(19219, 4, 0, 'Bully!', 14, 0, 100, 0, 0, 11167, 'Mechano-Lord Capacitus - Death'); 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 22aff78f441..dc9940c87b8 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp @@ -52,7 +52,8 @@ enum Events class boss_gatewatcher_gyrokill : public CreatureScript { - public: boss_gatewatcher_gyrokill() : CreatureScript("boss_gatewatcher_gyrokill") {} + public: + boss_gatewatcher_gyrokill() : CreatureScript("boss_gatewatcher_gyrokill") {} struct boss_gatewatcher_gyrokillAI : public BossAI { @@ -62,8 +63,6 @@ class boss_gatewatcher_gyrokill : public CreatureScript { _JustDied(); Talk(SAY_DEATH); - if (GameObject* door = me->GetMap()->GetGameObject(instance->GetData64(GO_DOOR_MOARG_2))) - door->SetGoState(GO_STATE_ACTIVE); } void EnterCombat(Unit* /*who*/) diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp index c613b3a67bb..440e17a29cf 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp @@ -55,7 +55,8 @@ enum Events class boss_gatewatcher_iron_hand : public CreatureScript { - public: boss_gatewatcher_iron_hand(): CreatureScript("boss_gatewatcher_iron_hand") {} + public: + boss_gatewatcher_iron_hand(): CreatureScript("boss_gatewatcher_iron_hand") {} struct boss_gatewatcher_iron_handAI : public BossAI { @@ -80,8 +81,6 @@ class boss_gatewatcher_iron_hand : public CreatureScript { _JustDied(); Talk(SAY_DEATH); - if (GameObject* door = me->GetMap()->GetGameObject(instance->GetData64(GO_DOOR_MOARG_1))) - door->SetGoState(GO_STATE_ACTIVE); } void UpdateAI(uint32 const diff) @@ -93,7 +92,8 @@ class boss_gatewatcher_iron_hand : public CreatureScript if (me->HasUnitState(UNIT_STATE_CASTING)) return; - while (uint32 eventId = events.ExecuteEvent()) + + while (uint32 eventId = events.ExecuteEvent()) { switch (eventId) { @@ -122,10 +122,10 @@ class boss_gatewatcher_iron_hand : public CreatureScript } }; - CreatureAI* GetAI(Creature* creature) const - { - return new boss_gatewatcher_iron_handAI(creature); - } + CreatureAI* GetAI(Creature* creature) const + { + return new boss_gatewatcher_iron_handAI(creature); + } }; void AddSC_boss_gatewatcher_iron_hand() diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp index e71be639999..1a43798ccef 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp @@ -15,26 +15,150 @@ * with this program. If not, see . */ -//! TODO - Boss not scripted, just ported required spellscript from core - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellScript.h" +#include "mechanar.h" #include "Player.h" enum Spells { + SPELL_HEADCRACK = 35161, + SPELL_REFLECTIVE_MAGIC_SHIELD = 35158, + SPELL_REFLECTIVE_DAMAGE_SHIELD = 35159, + SPELL_POLARITY_SHIFT = 39096, + SPELL_BERSERK = 26662, + SPELL_NETHER_CHARGE_TIMER = 37670, + SPELL_NETHER_CHARGE_PASSIVE = 37670, + SPELL_POSITIVE_POLARITY = 39088, SPELL_POSITIVE_CHARGE_STACK = 39089, SPELL_POSITIVE_CHARGE = 39090, + SPELL_NEGATIVE_POLARITY = 39091, SPELL_NEGATIVE_CHARGE_STACK = 39092, SPELL_NEGATIVE_CHARGE = 39093 }; +enum Yells +{ + YELL_AGGRO = 0, + YELL_REFLECTIVE_MAGIC_SHIELD = 1, + YELL_REFLECTIVE_DAMAGE_SHIELD = 2, + YELL_KILL = 3, + YELL_DEATH = 4 +}; + +enum Creatures +{ + NPC_NETHER_CHARGE = 20405 +}; + +enum Events +{ + EVENT_NONE = 0, + + EVENT_HEADCRACK = 1, + EVENT_REFLECTIVE_DAMAGE_SHIELD = 2, + EVENT_REFLECTIVE_MAGIE_SHIELD = 3, + EVENT_POSITIVE_SHIFT = 4, + EVENT_SUMMON_NETHER_CHARGE = 5, + EVENT_BERSERK = 6 +}; + +class boss_mechano_lord_capacitus : public CreatureScript +{ + public: + boss_mechano_lord_capacitus() : CreatureScript("boss_mechano_lord_capacitus") { } + + struct boss_mechano_lord_capacitusAI : public BossAI + { + boss_mechano_lord_capacitusAI(Creature* creature) : BossAI(creature, DATA_MECHANOLORD_CAPACITUS) { } + + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + Talk(YELL_AGGRO); + events.ScheduleEvent(EVENT_HEADCRACK, 10 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_REFLECTIVE_DAMAGE_SHIELD, 15 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, 10 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_BERSERK, 3 * MINUTE * IN_MILLISECONDS); + + if (IsHeroic()) + events.ScheduleEvent(EVENT_POSITIVE_SHIFT, 15 * IN_MILLISECONDS); + } + + void KilledUnit(Unit* /*victim*/) + { + Talk(YELL_KILL); + } + + void JustDied(Unit* /*victim*/) + { + _JustDied(); + Talk(YELL_DEATH); + } + + 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_HEADCRACK: + DoCastVictim(SPELL_HEADCRACK); + events.ScheduleEvent(EVENT_HEADCRACK, 10 * IN_MILLISECONDS); + break; + case EVENT_REFLECTIVE_DAMAGE_SHIELD: + Talk(YELL_REFLECTIVE_DAMAGE_SHIELD); + DoCast(me, SPELL_REFLECTIVE_DAMAGE_SHIELD); + events.ScheduleEvent(EVENT_REFLECTIVE_MAGIE_SHIELD, 30 * IN_MILLISECONDS); + break; + case EVENT_REFLECTIVE_MAGIE_SHIELD: + Talk(YELL_REFLECTIVE_MAGIC_SHIELD); + DoCast(me, SPELL_REFLECTIVE_MAGIC_SHIELD); + events.ScheduleEvent(EVENT_REFLECTIVE_DAMAGE_SHIELD, 30 * IN_MILLISECONDS); + break; + case EVENT_POSITIVE_SHIFT: + DoCastAOE(SPELL_POLARITY_SHIFT); + events.ScheduleEvent(EVENT_POSITIVE_SHIFT, urand(45, 60) * IN_MILLISECONDS); + break; + case EVENT_SUMMON_NETHER_CHARGE: + Position pos; + me->GetRandomNearPosition(pos, 5.0f); + me->SummonCreature(NPC_NETHER_CHARGE, pos, TEMPSUMMON_TIMED_DESPAWN, 18000); + events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, 10 * IN_MILLISECONDS); + break; + case EVENT_BERSERK: + DoCast(me, SPELL_BERSERK); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_mechano_lord_capacitusAI(creature); + } +}; + class spell_capacitus_polarity_charge : public SpellScriptLoader { - public: spell_capacitus_polarity_charge() : SpellScriptLoader("spell_capacitus_polarity_charge") { } + public: + spell_capacitus_polarity_charge() : SpellScriptLoader("spell_capacitus_polarity_charge") { } class spell_capacitus_polarity_charge_SpellScript : public SpellScript { @@ -137,6 +261,7 @@ class spell_capacitus_polarity_shift : public SpellScriptLoader void AddSC_boss_mechano_lord_capacitus() { + new boss_mechano_lord_capacitus(); new spell_capacitus_polarity_charge(); new spell_capacitus_polarity_shift(); } 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 fcf32e5c341..0b2370e1b17 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp @@ -89,8 +89,6 @@ class boss_nethermancer_sepethrea : public CreatureScript { _JustDied(); Talk(SAY_DEATH); - if (GameObject* door = me->GetMap()->GetGameObject(instance->GetData64(GO_DOOR_NETHERMANCER))) - door->SetGoState(GO_STATE_ACTIVE); } void UpdateAI(uint32 const diff) 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 09b3403f5c2..9d894e41b60 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 @@ -68,7 +68,8 @@ enum Creatures class boss_pathaleon_the_calculator : public CreatureScript { - public: boss_pathaleon_the_calculator(): CreatureScript("boss_pathaleon_the_calculator") {} + public: + boss_pathaleon_the_calculator(): CreatureScript("boss_pathaleon_the_calculator") {} struct boss_pathaleon_the_calculatorAI : public BossAI { diff --git a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp index 66424fb9e10..e6cb05084ad 100644 --- a/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp +++ b/src/server/scripts/Outland/TempestKeep/Mechanar/instance_mechanar.cpp @@ -16,82 +16,59 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Instance_Mechanar -SD%Complete: 100 -SDComment: -SDCategory: Mechanar -EndScriptData */ #include "ScriptMgr.h" #include "InstanceScript.h" #include "mechanar.h" -class instance_mechanar : public InstanceMapScript +static DoorData const doorData[] = { - public: instance_mechanar(): InstanceMapScript("instance_mechanar", 554) { } + { GO_DOOR_MOARG_1, DATA_GATEWATCHER_IRON_HAND, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + { GO_DOOR_MOARG_2, DATA_GATEWATCHER_GYROKILL, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + { GO_DOOR_NETHERMANCER, DATA_NETHERMANCER_SEPRETHREA, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + {0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } +}; - InstanceScript* GetInstanceScript(InstanceMap* map) const - { - return new instance_mechanar_InstanceMapScript(map); - } +class instance_mechanar : public InstanceMapScript +{ + public: + instance_mechanar(): InstanceMapScript("instance_mechanar", 554) { } struct instance_mechanar_InstanceMapScript : public InstanceScript { instance_mechanar_InstanceMapScript(Map* map) : InstanceScript(map) { SetBossNumber(EncounterCount); - DoorMoArg1GUID = 0; - DoorMoArg2GUID = 0; - DoorNethermancerGUID = 0; + LoadDoorData(doorData); } + - void OnGameObjectCreate(GameObject* go) + void OnGameObjectCreate(GameObject* gameObject) { - switch (go->GetEntry()) + switch (gameObject->GetEntry()) { case GO_DOOR_MOARG_1: - DoorMoArg1GUID = go->GetGUID(); - break; case GO_DOOR_MOARG_2: - DoorMoArg2GUID = go->GetGUID(); - break; case GO_DOOR_NETHERMANCER: - DoorNethermancerGUID = go->GetGUID(); + AddDoor(gameObject, true); break; default: break; } - CheckInstanceStatus(); - } - - void CheckInstanceStatus() - { - if (GetBossState(DATA_GATEWATCHER_IRON_HAND) == DONE) - HandleGameObject(DoorMoArg1GUID, true); - - if (GetBossState(DATA_GATEWATCHER_GYROKILL) == DONE) - HandleGameObject(DoorMoArg2GUID, true); - - if (GetBossState(DATA_NETHERMANCER_SEPRETHREA) == DONE) - HandleGameObject(DoorNethermancerGUID, true); } - uint64 GetData64(uint32 type) const + void OnGameObjectRemove(GameObject* gameObject) { - switch (type) + switch (gameObject->GetEntry()) { case GO_DOOR_MOARG_1: - return DoorMoArg1GUID; case GO_DOOR_MOARG_2: - return DoorMoArg2GUID; case GO_DOOR_NETHERMANCER: - return DoorNethermancerGUID; + AddDoor(gameObject, false); + break; default: break; } - - return 0; } bool SetBossState(uint32 type, EncounterState state) @@ -156,12 +133,12 @@ class instance_mechanar : public InstanceMapScript OUT_LOAD_INST_DATA_COMPLETE; } - - protected: - uint64 DoorMoArg1GUID; - uint64 DoorMoArg2GUID; - uint64 DoorNethermancerGUID; }; + + InstanceScript* GetInstanceScript(InstanceMap* map) const + { + return new instance_mechanar_InstanceMapScript(map); + } }; void AddSC_instance_mechanar() -- cgit v1.2.3