diff options
| author | Malcrom <malcromdev@gmail.com> | 2013-11-10 10:53:43 -0330 |
|---|---|---|
| committer | Malcrom <malcromdev@gmail.com> | 2013-11-10 10:53:43 -0330 |
| commit | 8332cee0522b9166bd73903b85a3220a84b57a5f (patch) | |
| tree | 1183a2c15f70d92d56df23ba3007c3f6a860e093 /src/server/scripts | |
| parent | c2db6d49ced143f951b83185dfc525e5493d35b9 (diff) | |
Scripting/The Slave Pens: Moved boss_mennu_the_betrayer from EAI to CPP.
Diffstat (limited to 'src/server/scripts')
4 files changed, 180 insertions, 2 deletions
diff --git a/src/server/scripts/Outland/CMakeLists.txt b/src/server/scripts/Outland/CMakeLists.txt index 45db8a80a26..e07424a77d2 100644 --- a/src/server/scripts/Outland/CMakeLists.txt +++ b/src/server/scripts/Outland/CMakeLists.txt @@ -43,9 +43,11 @@ set(scripts_STAT_SRCS Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp + Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h + Outland/CoilfangReservoir/TheSlavePens/boss_mennu_the_betrayer.cpp + Outland/CoilfangReservoir/TheUnderbog/instance_the_underbog.cpp Outland/CoilfangReservoir/TheUnderbog/boss_hungarfen.cpp Outland/CoilfangReservoir/TheUnderbog/boss_the_black_stalker.cpp - Outland/CoilfangReservoir/TheUnderbog/instance_the_underbog.cpp Outland/zone_shattrath_city.cpp Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_mennu_the_betrayer.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_mennu_the_betrayer.cpp new file mode 100644 index 00000000000..d015919d978 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_mennu_the_betrayer.cpp @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * + * 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 + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +/* ScriptData +SDName: boss_mennu_the_betrayer +SD%Complete: 100% +SDComment: +SDCategory: Coilfang Reservoir, The Slave Pens +EndScriptData */ + +#include "ScriptMgr.h" +#include "ScriptedCreature.h" +#include "the_slave_pens.h" + +enum Say +{ + SAY_AGGRO = 0, + SAY_SLAY = 1, + SAY_DEATH = 2 +}; + +enum Spells +{ + SPELL_TAINTED_STONESKIN_TOTEM = 31985, + SPELL_TAINTED_EARTHGRAB_TOTEM = 31981, + SPELL_CORRUPTED_NOVA_TOTEM = 31991, + SPELL_MENNUS_HEALING_WARD = 34980, + SPELL_LIGHTNING_BOLT = 35010 +}; + +enum Events +{ + EVENT_TAINTED_STONESKIN_TOTEM = 1, + EVENT_TAINTED_EARTHGRAB_TOTEM = 2, + EVENT_CORRUPTED_NOVA_TOTEM = 3, + EVENT_LIGHTNING_BOLT = 4 +}; + +class boss_mennu_the_betrayer : public CreatureScript +{ + public: + boss_mennu_the_betrayer() : CreatureScript("boss_mennu_the_betrayer") { } + + struct boss_mennu_the_betrayerAI : public BossAI + { + boss_mennu_the_betrayerAI(Creature* creature) : BossAI(creature, DATA_MENNU_THE_BETRAYER) { } + + void Reset() OVERRIDE + { + _Reset(); + healingWardDropped = false; + } + + void JustDied(Unit* /*killer*/) OVERRIDE + { + _JustDied(); + Talk(SAY_DEATH); + } + + void EnterCombat(Unit* /*who*/) OVERRIDE + { + _EnterCombat(); + events.ScheduleEvent(EVENT_TAINTED_STONESKIN_TOTEM, 18000); + events.ScheduleEvent(EVENT_TAINTED_EARTHGRAB_TOTEM, 19000); + events.ScheduleEvent(EVENT_CORRUPTED_NOVA_TOTEM, 20000); + events.ScheduleEvent(EVENT_LIGHTNING_BOLT, urand(5000, 8000)); + Talk(SAY_AGGRO); + } + + void KilledUnit(Unit* /*victim*/) OVERRIDE + { + Talk(SAY_SLAY); + } + + void UpdateAI(uint32 diff) OVERRIDE + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_TAINTED_STONESKIN_TOTEM: + DoCast(me, SPELL_TAINTED_STONESKIN_TOTEM); + break; + case EVENT_TAINTED_EARTHGRAB_TOTEM: + DoCast(me, SPELL_TAINTED_EARTHGRAB_TOTEM); + break; + case EVENT_CORRUPTED_NOVA_TOTEM: + DoCast(me, SPELL_CORRUPTED_NOVA_TOTEM); + break; + case EVENT_LIGHTNING_BOLT: + DoCastVictim(SPELL_LIGHTNING_BOLT, true); + events.ScheduleEvent(EVENT_LIGHTNING_BOLT, urand(7000, 11000)); + break; + default: + break; + } + } + + if (HealthBelowPct(60) && !healingWardDropped) + { + DoCast(me, SPELL_MENNUS_HEALING_WARD); + healingWardDropped = true; + } + + DoMeleeAttackIfReady(); + } + + private: + bool healingWardDropped; + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new boss_mennu_the_betrayerAI(creature); + } +}; + +void AddSC_boss_mennu_the_betrayer() +{ + new boss_mennu_the_betrayer(); +} diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp index cd11e2e1bf1..1c31bee7d4f 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/instance_the_slave_pens.cpp @@ -24,11 +24,12 @@ gets instead the deserter debuff. #include "ScriptMgr.h" #include "InstanceScript.h" +#include "the_slave_pens.h" class instance_the_slave_pens : public InstanceMapScript { public: - instance_the_slave_pens() : InstanceMapScript("instance_the_slave_pens", 547) { } + instance_the_slave_pens() : InstanceMapScript(SPScriptName, 547) { } InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE { diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h new file mode 100644 index 00000000000..624ead7ef08 --- /dev/null +++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/the_slave_pens.h @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/> + * + * 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 + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef SLAVE_PENS_H +#define SLAVE_PENS_H + +uint32 const EncounterCount = 3; + +#define SPScriptName "instance_the_slave_pens" + +enum DataTypes +{ + DATA_MENNU_THE_BETRAYER = 1, + DATA_ROKMAR_THE_CRACKLER = 2, + DATA_QUAGMIRRAN = 3 +}; + +#endif // SLAVE_PENS_H |
