Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Copyright (C) 2017-2018 AshamaneProject <https://github.com/AshamaneProject>
- *
- * 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/>.
- */
- #include "AreaTrigger.h"
- #include "AreaTriggerAI.h"
- #include "ScriptedCreature.h"
- #include "ScriptMgr.h"
- #include "SpellAuras.h"
- #include "SpellScript.h"
- #include "tomb_of_sargeras.h"
- enum BossSpells
- {
- BUFF_EGVINE = 236420,
- // bombs
- SPELL_CAST_BOMBS = 235267,
- AURA_BOBM = 235117,
- // teleportation boss
- SPELL_TELEPORT = 0,
- SPELL_STUN = 248812,
- AURA_SHIELD = 235028,
- FRAGMENTS = 236061,
- // buff for players
- BUFF_WHITE = 235534,
- BUFF_INFUSION = 235538,
- // cast wrath of the crators
- SPELL_CAST_WRATH_OF_THE_CREATORS = 234891,
- SPELL_TRIGGER_WHITE = 234917,
- SPELL_TRIGGER_INFUSION_FEL = 236433,
- AURA_WRATH_OF_THE_CREATORS = 237339,
- SPELL_EXTINGUISH_LIFE = 238475,
- // cast infusion
- SPELL_INFUSION = 235271,
- AURA_WHITE = 235213,
- AURA_FEL_INFUSION = 235240,
- // hammers
- SPELL_HAMMER_OF_OBLITERATION = 241636,
- SPELL_HAMMER_OF_CREATION = 241635,
- SPELL_BERSERK = 64238
- };
- enum BossYells
- {
- BOSS_PULL = 0,
- BOSS_DEAD = 1,
- BOSS_TELEPORT = 2,
- BOSS_KILL_PLAYERS_INFUSION = 3,
- BOSS_KILL_PLAYERS_WHITE = 4,
- BOSS_CAST_DEBUFF_ONE = 5,
- BOSS_CAST_DEBUFF_TWO = 6,
- BOSS_CAST_WRATH_OF_THE_CREATORS = 7,
- BOSS_10_PCT_HP = 8,
- BOSS_EVADE = 9
- };
- enum Events
- {
- EVENT_INFUSION = 0,
- EVENT_CAST_BOMBS = 1,
- EVENT_AURA_BOMBS = 2,
- EVENT_HUMMER = 3,
- EVENT_TELEPORT = 4,
- EVENT_TELEPORT_PHASE = 5,
- EVENT_BERSERK = 6
- };
- // 118289
- class boss_maiden_of_vigilance : public CreatureScript
- {
- public:
- boss_maiden_of_vigilance() : CreatureScript("boss_maiden_of_vigilance") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new boss_maiden_of_vigilanceAI(creature);
- }
- struct boss_maiden_of_vigilanceAI : public ScriptedAI
- {
- boss_maiden_of_vigilanceAI(Creature* creature) : ScriptedAI(creature)
- {
- Reset();
- }
- void EnterEvadeMode(EvadeReason why) override
- {
- ScriptedAI::EnterEvadeMode(why);
- Reset();
- Talk(BOSS_EVADE);
- }
- void JustDied(Unit* killer) override
- {
- Talk(BOSS_DEAD);
- Reset();
- }
- void Reset() override
- {
- events.Reset();
- phase = false;
- castSpell = false;
- molot = false;
- me->SetReactState(REACT_DEFENSIVE);
- }
- void EnterCombat(Unit* who) override
- {
- Reset();
- Talk(BOSS_PULL);
- EventOneStart();
- }
- void EventOneStart()
- {
- events.Reset();
- events.ScheduleEvent(EVENT_INFUSION, Seconds(10));
- events.ScheduleEvent(EVENT_HUMMER, Seconds(12));
- events.ScheduleEvent(EVENT_CAST_BOMBS, Seconds(22));
- events.ScheduleEvent(EVENT_TELEPORT, Seconds(40));
- events.ScheduleEvent(EVENT_BERSERK, Minutes(8));
- }
- void SayDebuff(bool phase)
- {
- if (phase)
- Talk(BOSS_CAST_DEBUFF_ONE);
- else
- Talk(BOSS_CAST_DEBUFF_TWO);
- }
- void UpdateAI(uint32 diff) override
- {
- if (!UpdateVictim())
- return;
- events.Update(diff);
- while (uint32 eventId = events.ExecuteEvent())
- {
- switch (eventId)
- {
- case EVENT_BERSERK:
- {
- DoCastSelf(SPELL_BERSERK);
- break;
- }
- case EVENT_CAST_BOMBS:
- {
- DoCastSelf(SPELL_CAST_BOMBS);
- events.ScheduleEvent(EVENT_AURA_BOMBS, Seconds(2));
- break;
- }
- case EVENT_AURA_BOMBS:
- {
- UnitList targetList;
- SelectTargetList(targetList, 3, SELECT_TARGET_RANDOM, 200.0f, true);
- for (Unit* target : targetList)
- DoCast(target, AURA_BOBM, true);
- break;
- }
- case EVENT_HUMMER:
- {
- if (molot)
- {
- DoCast(SelectTarget(SELECT_TARGET_TOPAGGRO), SPELL_HAMMER_OF_OBLITERATION);
- molot = false;
- }
- else
- {
- DoCast(SelectTarget(SELECT_TARGET_TOPAGGRO), SPELL_HAMMER_OF_CREATION);
- molot = true;
- }
- events.ScheduleEvent(EVENT_HUMMER, Seconds(18));
- break;
- }
- case EVENT_INFUSION:
- {
- Talk(BOSS_CAST_WRATH_OF_THE_CREATORS);
- DoCast(SPELL_INFUSION);
- DoCastSelf(SPELL_BERSERK);
- break;
- }
- case EVENT_TELEPORT:
- {
- break;
- }
- case EVENT_TELEPORT_PHASE:
- {
- break;
- }
- }
- }
- if (HealthBelowPct(10))
- Talk(BOSS_10_PCT_HP);
- if (me->GetAuraCount(AURA_WRATH_OF_THE_CREATORS) == 30)
- DoCastAOE(SPELL_EXTINGUISH_LIFE);
- DoMeleeAttackIfReady();
- }
- private:
- bool phase = false;
- bool castSpell = false;
- bool molot = false;
- };
- };
- // 118640 & 118643
- class fragments : public CreatureScript
- {
- public:
- fragments() : CreatureScript("fragments") { }
- CreatureAI* GetAI(Creature* creature) const
- {
- return new fragmentsAI(creature);
- }
- struct fragmentsAI : public ScriptedAI
- {
- fragmentsAI(Creature* creature) : ScriptedAI(creature)
- {
- Initialize();
- }
- void Initialize()
- {
- }
- void UpdateAI(uint32 diff)
- {
- if (!UpdateVictim())
- return;
- events.Update(diff);
- }
- };
- };
- class spell_cast wrath_of_the_crators : public SpellScript
- {
- PrepareSpellScript(spell_cast wrath_of_the_crators);
- void Register() override
- {
- }
- };
- void AddSC_boss_maiden_of_vigilance()
- {
- new boss_maiden_of_vigilance();
- new fragments();
- RegisterSpellScript(spell_cast wrath_of_the_crators);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement