mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 00:08:01 +00:00
refactor(CORE/Instance): Move Pandemonius script from SAI to Core script (#3165)
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1593176049024213800');
|
||||||
|
|
||||||
|
DELETE FROM `smart_scripts` WHERE `entryorguid` IN (18341, 1834100, 1834101);
|
||||||
|
UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'boss_pandemonius' WHERE `entry` = 18341;
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU GPL v2 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-GPL2
|
||||||
|
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
|
||||||
|
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "ScriptMgr.h"
|
||||||
|
#include "ScriptedCreature.h"
|
||||||
|
#include "Player.h"
|
||||||
|
|
||||||
|
enum Texts
|
||||||
|
{
|
||||||
|
SAY_AGGRO = 0,
|
||||||
|
SAY_KILL = 1,
|
||||||
|
SAY_DEATH = 2,
|
||||||
|
EMOTE_DARK_SHELL = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
enum Spells
|
||||||
|
{
|
||||||
|
SPELL_VOID_BLAST = 32325,
|
||||||
|
SPELL_DARK_SHELL = 32358
|
||||||
|
};
|
||||||
|
|
||||||
|
enum Events
|
||||||
|
{
|
||||||
|
EVENT_VOID_BLAST = 1,
|
||||||
|
EVENT_DARK_SHELL
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class boss_pandemonius : public CreatureScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
boss_pandemonius() : CreatureScript("boss_pandemonius") { }
|
||||||
|
|
||||||
|
CreatureAI* GetAI(Creature* creature) const
|
||||||
|
{
|
||||||
|
return new boss_pandemoniusAI(creature);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct boss_pandemoniusAI : public ScriptedAI
|
||||||
|
{
|
||||||
|
boss_pandemoniusAI(Creature* creature) : ScriptedAI(creature) { }
|
||||||
|
|
||||||
|
EventMap events;
|
||||||
|
|
||||||
|
void Reset()
|
||||||
|
{
|
||||||
|
events.Reset();
|
||||||
|
VoidBlastCounter = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EnterCombat(Unit*)
|
||||||
|
{
|
||||||
|
me->SetInCombatWithZone();
|
||||||
|
|
||||||
|
Talk(SAY_AGGRO);
|
||||||
|
|
||||||
|
events.ScheduleEvent(EVENT_DARK_SHELL, 20000);
|
||||||
|
events.ScheduleEvent(EVENT_VOID_BLAST, urand(8000, 23000));
|
||||||
|
}
|
||||||
|
|
||||||
|
void KilledUnit(Unit* victim)
|
||||||
|
{
|
||||||
|
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
Talk(SAY_KILL);
|
||||||
|
}
|
||||||
|
|
||||||
|
void JustDied(Unit* /*killer*/)
|
||||||
|
{
|
||||||
|
Talk(SAY_DEATH);
|
||||||
|
}
|
||||||
|
|
||||||
|
void UpdateAI(uint32 diff)
|
||||||
|
{
|
||||||
|
if (!UpdateVictim())
|
||||||
|
return;
|
||||||
|
|
||||||
|
events.Update(diff);
|
||||||
|
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch (events.GetEvent())
|
||||||
|
{
|
||||||
|
case EVENT_VOID_BLAST:
|
||||||
|
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||||
|
{
|
||||||
|
DoCast(target, SPELL_VOID_BLAST);
|
||||||
|
++VoidBlastCounter;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (VoidBlastCounter == 5)
|
||||||
|
{
|
||||||
|
VoidBlastCounter = 0;
|
||||||
|
events.RescheduleEvent(EVENT_VOID_BLAST, urand(15000, 25000));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
events.RescheduleEvent(EVENT_VOID_BLAST, 500);
|
||||||
|
events.DelayEvents(EVENT_DARK_SHELL, 500);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EVENT_DARK_SHELL:
|
||||||
|
if (me->IsNonMeleeSpellCast(false))
|
||||||
|
{
|
||||||
|
me->InterruptNonMeleeSpells(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Talk(EMOTE_DARK_SHELL);
|
||||||
|
DoCast(me, SPELL_DARK_SHELL);
|
||||||
|
events.RescheduleEvent(EVENT_DARK_SHELL, 20000);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
DoMeleeAttackIfReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
uint32 VoidBlastCounter;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
void AddSC_boss_pandemonius()
|
||||||
|
{
|
||||||
|
new boss_pandemonius();
|
||||||
|
}
|
||||||
@@ -81,6 +81,7 @@ set(scripts_STAT_SRCS
|
|||||||
${AC_SCRIPTS_DIR}/Outland/Auchindoun/AuchenaiCrypts/instance_auchenai_crypts.cpp
|
${AC_SCRIPTS_DIR}/Outland/Auchindoun/AuchenaiCrypts/instance_auchenai_crypts.cpp
|
||||||
${AC_SCRIPTS_DIR}/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h
|
${AC_SCRIPTS_DIR}/Outland/Auchindoun/AuchenaiCrypts/auchenai_crypts.h
|
||||||
${AC_SCRIPTS_DIR}/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp
|
${AC_SCRIPTS_DIR}/Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp
|
||||||
|
${AC_SCRIPTS_DIR}/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp
|
||||||
${AC_SCRIPTS_DIR}/Outland/Auchindoun/ManaTombs/instance_mana_tombs.cpp
|
${AC_SCRIPTS_DIR}/Outland/Auchindoun/ManaTombs/instance_mana_tombs.cpp
|
||||||
${AC_SCRIPTS_DIR}/Outland/Auchindoun/ManaTombs/mana_tombs.h
|
${AC_SCRIPTS_DIR}/Outland/Auchindoun/ManaTombs/mana_tombs.h
|
||||||
${AC_SCRIPTS_DIR}/Outland/Auchindoun/SethekkHalls/boss_talon_king_ikiss.cpp
|
${AC_SCRIPTS_DIR}/Outland/Auchindoun/SethekkHalls/boss_talon_king_ikiss.cpp
|
||||||
|
|||||||
@@ -472,6 +472,7 @@ void AddSC_boss_exarch_maladaar(); //Auchindoun Auchenai Crypts
|
|||||||
void AddSC_instance_auchenai_crypts();
|
void AddSC_instance_auchenai_crypts();
|
||||||
void AddSC_boss_shirrak_the_dead_watcher();
|
void AddSC_boss_shirrak_the_dead_watcher();
|
||||||
void AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs
|
void AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs
|
||||||
|
void AddSC_boss_pandemonius();
|
||||||
void AddSC_instance_mana_tombs();
|
void AddSC_instance_mana_tombs();
|
||||||
void AddSC_boss_talon_king_ikiss(); //Auchindoun Sekketh Halls
|
void AddSC_boss_talon_king_ikiss(); //Auchindoun Sekketh Halls
|
||||||
void AddSC_instance_sethekk_halls();
|
void AddSC_instance_sethekk_halls();
|
||||||
@@ -906,6 +907,7 @@ void AddOutlandScripts()
|
|||||||
AddSC_instance_auchenai_crypts();
|
AddSC_instance_auchenai_crypts();
|
||||||
AddSC_boss_shirrak_the_dead_watcher();
|
AddSC_boss_shirrak_the_dead_watcher();
|
||||||
AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs
|
AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs
|
||||||
|
AddSC_boss_pandemonius();
|
||||||
AddSC_instance_mana_tombs();
|
AddSC_instance_mana_tombs();
|
||||||
AddSC_boss_talon_king_ikiss(); //Auchindoun Sekketh Halls
|
AddSC_boss_talon_king_ikiss(); //Auchindoun Sekketh Halls
|
||||||
AddSC_instance_sethekk_halls();
|
AddSC_instance_sethekk_halls();
|
||||||
|
|||||||
Reference in New Issue
Block a user