diff options
| author | Vincent_Michael <Vincent_Michael@gmx.de> | 2013-01-08 16:32:54 +0100 |
|---|---|---|
| committer | Vincent_Michael <Vincent_Michael@gmx.de> | 2013-01-08 16:32:54 +0100 |
| commit | db330750b7b0b0bf774089df60c0651b327d9c76 (patch) | |
| tree | bdf2ae7be60e9c9e3c46bbd8db298df09484a75f /src/server/scripts/Kalimdor | |
| parent | ecedb798aa3094f02bedaadf459cfec7cb7c58a4 (diff) | |
| parent | 7c5597a69700959d3df7a0f6538db3526ecac7ad (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp
src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp
Diffstat (limited to 'src/server/scripts/Kalimdor')
10 files changed, 458 insertions, 284 deletions
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 2dfa62f36a1..84ef05779ee 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -25,16 +25,16 @@ enum Spells SPELL_FROST_ARMOR = 31256, SPELL_DEATH_AND_DECAY = 31258, SPELL_FROST_NOVA = 31250, - SPELL_ICEBOLT = 31249, + SPELL_ICEBOLT = 31249 }; enum Texts { - SAY_ONDEATH = 0, - SAY_ONSLAY = 1, - SAY_DECAY = 2, - SAY_NOVA = 3, - SAY_ONAGGRO = 4, + SAY_ONDEATH = 0, + SAY_ONSLAY = 1, + SAY_DECAY = 2, + SAY_NOVA = 3, + SAY_ONAGGRO = 4 }; class boss_rage_winterchill : public CreatureScript diff --git a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp index 43b647ff962..4724794d03b 100644 --- a/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp +++ b/src/server/scripts/Kalimdor/OnyxiasLair/boss_onyxia.cpp @@ -42,7 +42,7 @@ enum Yells SAY_PHASE_3_TRANS = 3, // Emote - EMOTE_BREATH = 4, + EMOTE_BREATH = 4 }; enum Spells @@ -72,7 +72,7 @@ enum Spells //SPELL_BREATH = 21131, // 8x in "array", different initial cast than the other arrays // Phase 3 spells - SPELL_BELLOWING_ROAR = 18431, + SPELL_BELLOWING_ROAR = 18431 }; struct OnyxMove diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp index 2ff0bc61448..e72e6dff9cf 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp @@ -21,20 +21,22 @@ #include "ScriptedCreature.h" #include "ruins_of_ahnqiraj.h" -enum eAyamiss +enum Spells { SPELL_STINGERSPRAY = 25749, - SPELL_POISONSTINGER = 25748, //only used in phase1 + SPELL_POISONSTINGER = 25748, // Only used in phase 1 SPELL_PARALYZE = 25725, SPELL_TRASH = 3391, - SPELL_FRENZY = 8269, + SPELL_FRENZY = 8269, // Not used SPELL_LASH = 25852, - - EMOTE_FRENZY = -1000002, - SPELL_FEED = 25721, }; +enum Says +{ + EMOTE_FRENZY = 0 // Not used +}; + class boss_ayamiss : public CreatureScript { public: diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp index bf23ee421c4..e26cba9cb6e 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp @@ -16,20 +16,48 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Buru -SD%Complete: 0 -SDComment: Place Holder -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" #include "ruins_of_ahnqiraj.h" -enum Yells +enum Emotes +{ + EMOTE_TARGET = 0 +}; + +enum Spells +{ + SPELL_CREEPING_PLAGUE = 20512, + SPELL_DISMEMBER = 96, + SPELL_GATHERING_SPEED = 1834, + SPELL_FULL_SPEED = 1557, + SPELL_THORNS = 25640, + SPELL_BURU_TRANSFORM = 24721, + SPELL_SUMMON_HATCHLING = 1881, + SPELL_EXPLODE = 19593, + SPELL_EXPLODE_2 = 5255, + SPELL_BURU_EGG_TRIGGER = 26646 +}; + +enum Events +{ + EVENT_DISMEMBER = 0, + EVENT_GATHERING_SPEED = 1, + EVENT_FULL_SPEED = 2, + EVENT_CREEPING_PLAGUE = 3, + EVENT_RESPAWN_EGG = 4 +}; + +enum Phases { - EMOTE_TARGET = 0 + PHASE_EGG = 0, + PHASE_TRANSFORM = 1 +}; + +enum Actions +{ + ACTION_EXPLODE = 0 }; class boss_buru : public CreatureScript @@ -37,11 +65,125 @@ class boss_buru : public CreatureScript public: boss_buru() : CreatureScript("boss_buru") { } - struct boss_buruAI : public ScriptedAI + struct boss_buruAI : public BossAI { - boss_buruAI(Creature* creature) : ScriptedAI(creature) + boss_buruAI(Creature* creature) : BossAI(creature, DATA_BURU) + { + } + + void EnterEvadeMode() + { + BossAI::EnterEvadeMode(); + + for (std::list<uint64>::iterator i = Eggs.begin(); i != Eggs.end(); ++i) + if (Creature* egg = me->GetMap()->GetCreature(*Eggs.begin())) + egg->Respawn(); + + Eggs.clear(); + } + + void EnterCombat(Unit* who) + { + _EnterCombat(); + Talk(EMOTE_TARGET, who->GetGUID()); + DoCast(me, SPELL_THORNS); + + events.ScheduleEvent(EVENT_DISMEMBER, 5000); + events.ScheduleEvent(EVENT_GATHERING_SPEED, 9000); + events.ScheduleEvent(EVENT_FULL_SPEED, 60000); + + _phase = PHASE_EGG; + } + + void DoAction(int32 const action) + { + if (action == ACTION_EXPLODE) + if (_phase == PHASE_EGG) + me->DealDamage(me, 45000); + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + ChaseNewVictim(); + } + + void ChaseNewVictim() { + if (_phase != PHASE_EGG) + return; + + me->RemoveAurasDueToSpell(SPELL_FULL_SPEED); + me->RemoveAurasDueToSpell(SPELL_GATHERING_SPEED); + events.ScheduleEvent(EVENT_GATHERING_SPEED, 9000); + events.ScheduleEvent(EVENT_FULL_SPEED, 60000); + + if (Unit* victim = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) + { + DoResetThreat(); + AttackStart(victim); + Talk(EMOTE_TARGET, victim->GetGUID()); + } } + + void ManageRespawn(uint64 EggGUID) + { + ChaseNewVictim(); + Eggs.push_back(EggGUID); + events.ScheduleEvent(EVENT_RESPAWN_EGG, 100000); + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_DISMEMBER: + DoCastVictim(SPELL_DISMEMBER); + events.ScheduleEvent(EVENT_DISMEMBER, 5000); + break; + case EVENT_GATHERING_SPEED: + DoCast(me, SPELL_GATHERING_SPEED); + events.ScheduleEvent(EVENT_GATHERING_SPEED, 9000); + break; + case EVENT_FULL_SPEED: + DoCast(me, SPELL_FULL_SPEED); + break; + case EVENT_CREEPING_PLAGUE: + DoCast(me, SPELL_CREEPING_PLAGUE); + events.ScheduleEvent(EVENT_CREEPING_PLAGUE, 6000); + break; + case EVENT_RESPAWN_EGG: + if (Creature* egg = me->GetMap()->GetCreature(*Eggs.begin())) + { + egg->Respawn(); + Eggs.pop_front(); + } + break; + default: + break; + } + } + + if (me->GetHealthPct() < 20.0f && _phase == PHASE_EGG) + { + DoCast(me, SPELL_BURU_TRANSFORM); // Enrage + DoCast(me, SPELL_FULL_SPEED, true); + me->RemoveAurasDueToSpell(SPELL_THORNS); + _phase = PHASE_TRANSFORM; + } + + DoMeleeAttackIfReady(); + } + private: + uint8 _phase; + std::list<uint64> Eggs; }; CreatureAI* GetAI(Creature* creature) const @@ -50,7 +192,90 @@ class boss_buru : public CreatureScript } }; +class npc_buru_egg : public CreatureScript +{ + public: + npc_buru_egg() : CreatureScript("npc_buru_egg") { } + + struct npc_buru_eggAI : public Scripted_NoMovementAI + { + npc_buru_eggAI(Creature* creature) : Scripted_NoMovementAI(creature) + { + _instance = me->GetInstanceScript(); + } + + void EnterCombat(Unit* attacker) + { + if (Creature* buru = me->GetMap()->GetCreature(_instance->GetData64(DATA_BURU))) + if (!buru->isInCombat()) + buru->AI()->AttackStart(attacker); + } + + void JustSummoned(Creature* who) + { + if (who->GetEntry() == NPC_HATCHLING) + if (Creature* buru = me->GetMap()->GetCreature(_instance->GetData64(DATA_BURU))) + if (Unit* target = buru->AI()->SelectTarget(SELECT_TARGET_RANDOM)) + who->AI()->AttackStart(target); + } + + void JustDied(Unit* /*killer*/) + { + DoCastAOE(SPELL_EXPLODE, true); + DoCastAOE(SPELL_EXPLODE_2, true); // Unknown purpose + DoCast(me, SPELL_SUMMON_HATCHLING, true); + + if (Creature* buru = me->GetMap()->GetCreature(_instance->GetData64(DATA_BURU))) + if (boss_buru::boss_buruAI* buruAI = dynamic_cast<boss_buru::boss_buruAI*>(buru->AI())) + buruAI->ManageRespawn(me->GetGUID()); + } + private: + InstanceScript* _instance; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_buru_eggAI(creature); + } +}; + +class spell_egg_explosion : public SpellScriptLoader +{ + public: + spell_egg_explosion() : SpellScriptLoader("spell_egg_explosion") { } + + class spell_egg_explosion_SpellScript : public SpellScript + { + PrepareSpellScript(spell_egg_explosion_SpellScript); + + void HandleAfterCast() + { + if (Creature* buru = GetCaster()->FindNearestCreature(NPC_BURU, 5.f)) + buru->AI()->DoAction(ACTION_EXPLODE); + } + + void HandleDummyHitTarget(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + GetCaster()->DealDamage(target, -16 * GetCaster()->GetDistance(target) + 500); + } + + void Register() + { + AfterCast += SpellCastFn(spell_egg_explosion_SpellScript::HandleAfterCast); + OnEffectHitTarget += SpellEffectFn(spell_egg_explosion_SpellScript::HandleDummyHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_egg_explosion_SpellScript(); + } +}; + void AddSC_boss_buru() { new boss_buru(); + new npc_buru_egg(); + new spell_egg_explosion(); } diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp index b471c207868..fcb6364244e 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_ossirian.cpp @@ -29,7 +29,7 @@ enum Texts SAY_INTRO = 1, SAY_AGGRO = 2, SAY_SLAY = 3, - SAY_DEATH = 4, + SAY_DEATH = 4 }; enum Spells @@ -40,12 +40,12 @@ enum Spells SPELL_SUPREME = 25176, SPELL_SUMMON = 20477, SPELL_SAND_STORM = 25160, - SPELL_SUMMON_CRYSTAL = 25192, + SPELL_SUMMON_CRYSTAL = 25192 }; enum Actions { - ACTION_TRIGGER_WEAKNESS = 1, + ACTION_TRIGGER_WEAKNESS = 1 }; enum Events diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h index 7581470dce6..6ece21f627b 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/ruins_of_ahnqiraj.h @@ -42,6 +42,7 @@ enum Creatures NPC_HIVEZARA_LARVA = 15555, NPC_SAND_VORTEX = 15428, NPC_OSSIRIAN_TRIGGER = 15590, + NPC_HATCHLING = 15521 }; enum GameObjects diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp index 39b005db541..53242d4cdc6 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp @@ -27,12 +27,14 @@ EndScriptData */ #include "ScriptedCreature.h" #include "temple_of_ahnqiraj.h" -#define SPELL_SWEEP 26103 -#define SPELL_SANDBLAST 26102 -#define SPELL_GROUND_RUPTURE 26100 -#define SPELL_BIRTH 26262 //The Birth Animation - -#define SPELL_DIRTMOUND_PASSIVE 26092 +enum Spells +{ + SPELL_SWEEP = 26103, + SPELL_SANDBLAST = 26102, + SPELL_GROUND_RUPTURE = 26100, + SPELL_BIRTH = 26262, // The Birth Animation + SPELL_DIRTMOUND_PASSIVE = 26092 +}; class boss_ouro : public CreatureScript { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 9573d495524..1186459218c 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -16,287 +16,226 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Skeram -SD%Complete: 75 -SDComment: Mind Control buggy. -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" #include "temple_of_ahnqiraj.h" -#include "Group.h" -#include "Player.h" -enum Skeram +enum Yells { SAY_AGGRO = 0, SAY_SLAY = 1, SAY_SPLIT = 2, - SAY_DEATH = 3, + SAY_DEATH = 3 +}; - SPELL_ARCANE_EXPLOSION = 25679, +enum Spells +{ + SPELL_ARCANE_EXPLOSION = 26192, SPELL_EARTH_SHOCK = 26194, SPELL_TRUE_FULFILLMENT = 785, - SPELL_BLINK = 28391 + SPELL_INITIALIZE_IMAGE = 3730, + SPELL_SUMMON_IMAGES = 747 }; -class ov_mycoordinates +enum Events { - public: - float x, y, z, r; - ov_mycoordinates(float cx, float cy, float cz, float cr) - { - x = cx; y = cy; z = cz; r = cr; - } + EVENT_ARCANE_EXPLOSION = 0, + EVENT_FULLFILMENT = 1, + EVENT_BLINK = 2, + EVENT_EARTH_SHOCK = 3 }; +uint32 const BlinkSpells[3] = { 4801, 8195, 20449 }; + class boss_skeram : public CreatureScript { -public: - boss_skeram() : CreatureScript("boss_skeram") { } - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_skeramAI (creature); - } - - struct boss_skeramAI : public ScriptedAI - { - boss_skeramAI(Creature* creature) : ScriptedAI(creature) - { - IsImage = false; - } - - uint32 ArcaneExplosion_Timer; - uint32 EarthShock_Timer; - uint32 FullFillment_Timer; - uint32 Blink_Timer; - uint32 Invisible_Timer; - - bool Images75; - bool Images50; - bool Images25; - bool IsImage; - bool Invisible; - - void Reset() - { - ArcaneExplosion_Timer = urand(6000, 12000); - EarthShock_Timer = 2000; - FullFillment_Timer = 15000; - Blink_Timer = urand(8000, 20000); - Invisible_Timer = 500; - - Images75 = false; - Images50 = false; - Images25 = false; - Invisible = false; - - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetVisible(true); - - if (IsImage) - me->setDeathState(JUST_DIED); - } - - void KilledUnit(Unit* /*victim*/) - { - Talk(SAY_SLAY); - } - - void JustDied(Unit* /*killer*/) - { - if (!IsImage) - Talk(SAY_DEATH); - } - - void EnterCombat(Unit* /*who*/) - { - if (IsImage || Images75) - return; - Talk(SAY_AGGRO); - } + public: + boss_skeram() : CreatureScript("boss_skeram") { } - void UpdateAI(const uint32 diff) + struct boss_skeramAI : public BossAI { - //Return since we have no target - if (!UpdateVictim()) - return; + boss_skeramAI(Creature* creature) : BossAI(creature, DATA_SKERAM) { } - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer <= diff) + void Reset() { - DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = urand(8000, 18000); - } else ArcaneExplosion_Timer -= diff; + _flag = 0; + _hpct = 75.0f; + me->SetVisible(true); + } - //If we are within range melee the target - if (me->IsWithinMeleeRange(me->getVictim())) + void KilledUnit(Unit* /*victim*/) { - //Make sure our attack is ready and we arn't currently casting - if (me->isAttackReady() && !me->IsNonMeleeSpellCasted(false)) - { - me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); - } - }else + Talk(SAY_SLAY); + } + + void EnterEvadeMode() { - //EarthShock_Timer - if (EarthShock_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_EARTH_SHOCK); - EarthShock_Timer = 1000; - } else EarthShock_Timer -= diff; + ScriptedAI::EnterEvadeMode(); + if (me->isSummon()) + ((TempSummon*)me)->UnSummon(); } - //Blink_Timer - if (Blink_Timer <= diff) + void JustSummoned(Creature* creature) { - //DoCast(me, SPELL_BLINK); - switch (urand(0, 2)) + // Shift the boss and images (Get it? *Shift*?) + uint8 rand = 0; + if (_flag != 0) { - case 0: - me->SetPosition(-8340.782227f, 2083.814453f, 125.648788f, 0.0f); - DoResetThreat(); - break; - case 1: - me->SetPosition(-8341.546875f, 2118.504639f, 133.058151f, 0.0f); - DoResetThreat(); - break; - case 2: - me->SetPosition(-8318.822266f, 2058.231201f, 133.058151f, 0.0f); - DoResetThreat(); - break; + while (_flag & (1 << rand)) + rand = urand(0, 2); + DoCast(me, BlinkSpells[rand]); + _flag |= (1 << rand); + _flag |= (1 << 7); } - DoStopAttack(); - - Blink_Timer= urand(20000, 40000); - } else Blink_Timer -= diff; - int procent = (int) (me->GetHealthPct() + 0.5f); - - //Summoning 2 Images and teleporting to a random position on 75% health - if ((!Images75 && !IsImage) && (procent <= 75 && procent > 70)) - DoSplit(75); - - //Summoning 2 Images and teleporting to a random position on 50% health - if ((!Images50 && !IsImage) && (procent <= 50 && procent > 45)) - DoSplit(50); - - //Summoning 2 Images and teleporting to a random position on 25% health - if ((!Images25 && !IsImage) && (procent <= 25 && procent > 20)) - DoSplit(25); + while (_flag & (1 << rand)) + rand = urand(0, 2); + creature->CastSpell(creature, BlinkSpells[rand]); + _flag |= (1 << rand); + + if (_flag & (1 << 7)) + _flag = 0; + + if (Unit* Target = SelectTarget(SELECT_TARGET_RANDOM)) + creature->AI()->AttackStart(Target); + + float ImageHealthPct; + + if (me->GetHealthPct() < 25.0f) + ImageHealthPct = 0.50f; + else if (me->GetHealthPct() < 50.0f) + ImageHealthPct = 0.20f; + else + ImageHealthPct = 0.10f; + + creature->SetMaxHealth(me->GetMaxHealth() * ImageHealthPct); + creature->SetHealth(creature->GetMaxHealth() * (me->GetHealthPct() / 100.0f)); + } - //Invisible_Timer - if (Invisible) + void JustDied(Unit* /*killer*/) { - if (Invisible_Timer <= diff) - { - //Making Skeram visible after telporting - me->SetVisible(true); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - Invisible_Timer = 2500; - Invisible = false; - } else Invisible_Timer -= diff; + if (!me->isSummon()) + Talk(SAY_DEATH); + else + me->RemoveCorpse(); } - DoMeleeAttackIfReady(); - } - - void DoSplit(int atPercent /* 75 50 25 */) - { - Talk(SAY_SPLIT); - - ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227f, 2083.814453f, 125.648788f, 0); - ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875f, 2118.504639f, 133.058151f, 0); - ov_mycoordinates *place3 = new ov_mycoordinates(-8318.822266f, 2058.231201f, 133.058151f, 0); + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + events.Reset(); - ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3; + events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(6000, 12000)); + events.ScheduleEvent(EVENT_FULLFILMENT, 15000); + events.ScheduleEvent(EVENT_BLINK, urand(30000, 45000)); + events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000); - switch (urand(0, 2)) - { - case 0: - bossc=place1; - i1=place2; - i2=place3; - break; - case 1: - bossc=place2; - i1=place1; - i2=place3; - break; - case 2: - bossc=place3; - i1=place1; - i2=place2; - break; + Talk(SAY_AGGRO); } - for (uint16 i = 0; i < 41; ++i) + void UpdateAI(uint32 const diff) { - if (Player* target = CAST_PLR(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))) + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) { - if (Group* pGrp = target->GetGroup()) - for (uint8 ico = 0; ico < TARGETICONCOUNT; ++ico) - { - //if (grp->m_targetIcons[ico] == me->GetGUID()) -- private member :( - pGrp->SetTargetIcon(ico, 0, 0); - } + switch (eventId) + { + case EVENT_ARCANE_EXPLOSION: + DoCastAOE(SPELL_ARCANE_EXPLOSION, true); + events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(8000, 18000)); + break; + case EVENT_FULLFILMENT: + // TODO: For some weird reason boss does not cast this + // Spell actually works, tested in duel + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true), SPELL_TRUE_FULFILLMENT, true); + events.ScheduleEvent(EVENT_FULLFILMENT, urand(20000, 30000)); + break; + case EVENT_BLINK: + DoCast(me, BlinkSpells[urand(0, 2)]); + DoResetThreat(); + me->SetVisible(true); + events.ScheduleEvent(EVENT_BLINK, urand(10000, 30000)); + break; + case EVENT_EARTH_SHOCK: + DoCastVictim(SPELL_EARTH_SHOCK); + events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000); + break; + } + } - break; + if (!me->isSummon() && me->GetHealthPct() < _hpct) + { + DoCast(me, SPELL_SUMMON_IMAGES); + Talk(SAY_SPLIT); + _hpct -= 25.0f; + me->SetVisible(false); + events.RescheduleEvent(EVENT_BLINK, 2000); + } + + if (me->IsWithinMeleeRange(me->getVictim())) + { + events.RescheduleEvent(EVENT_EARTH_SHOCK, 2000); + DoMeleeAttackIfReady(); } } + + private: + float _hpct; + uint8 _flag; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_skeramAI(creature); + } +}; - me->RemoveAllAuras(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetVisible(false); - me->SetPosition(bossc->x, bossc->y, bossc->z, bossc->r); - Invisible = true; - DoResetThreat(); - DoStopAttack(); +class PlayerOrPetCheck +{ + public: + bool operator()(WorldObject* object) const + { + if (object->GetTypeId() != TYPEID_PLAYER) + if (!object->ToCreature()->isPet()) + return true; - switch (atPercent) - { - case 75: Images75 = true; break; - case 50: Images50 = true; break; - case 25: Images25 = true; break; - } + return false; + } +}; - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); +class spell_skeram_arcane_explosion : public SpellScriptLoader +{ + public: + spell_skeram_arcane_explosion() : SpellScriptLoader("spell_skeram_arcane_explosion") { } + + class spell_skeram_arcane_explosion_SpellScript : public SpellScript + { + PrepareSpellScript(spell_skeram_arcane_explosion_SpellScript); - Creature* Image1 = me->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if (Image1) + void FilterTargets(std::list<WorldObject*>& targets) { - Image1->SetMaxHealth(me->GetMaxHealth() / 5); - Image1->SetHealth(me->GetHealth() / 5); - if (target) - Image1->AI()->AttackStart(target); - CAST_AI(boss_skeram::boss_skeramAI, Image1->AI())->IsImage = true; + targets.remove_if(PlayerOrPetCheck()); } - Creature* Image2 = me->SummonCreature(15263, i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if (Image2) + void Register() { - Image2->SetMaxHealth(me->GetMaxHealth() / 5); - Image2->SetHealth(me->GetHealth() / 5); - if (target) - Image2->AI()->AttackStart(target); - CAST_AI(boss_skeram::boss_skeramAI, Image2->AI())->IsImage = true; + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_skeram_arcane_explosion_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); } - Invisible = true; - delete place1; - delete place2; - delete place3; - } - - }; + }; + SpellScript* GetSpellScript() const + { + return new spell_skeram_arcane_explosion_SpellScript(); + } }; void AddSC_boss_skeram() { new boss_skeram(); + new spell_skeram_arcane_explosion(); } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index 66160c03d9b..d623963e929 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -27,38 +27,43 @@ EndScriptData */ #include "ScriptedCreature.h" #include "temple_of_ahnqiraj.h" #include "WorldPacket.h" - #include "Item.h" #include "Spell.h" -#define SPELL_HEAL_BROTHER 7393 -#define SPELL_TWIN_TELEPORT 800 // CTRA watches for this spell to start its teleport timer -#define SPELL_TWIN_TELEPORT_VISUAL 26638 // visual - -#define SPELL_EXPLODEBUG 804 -#define SPELL_MUTATE_BUG 802 - -#define SOUND_VN_DEATH 8660 //8660 - Death - Feel -#define SOUND_VN_AGGRO 8661 //8661 - Aggro - Let none -#define SOUND_VN_KILL 8662 //8661 - Kill - your fate - -#define SOUND_VL_AGGRO 8657 //8657 - Aggro - To Late -#define SOUND_VL_KILL 8658 //8658 - Kill - You will not -#define SOUND_VL_DEATH 8659 //8659 - Death +enum Spells +{ + SPELL_HEAL_BROTHER = 7393, + SPELL_TWIN_TELEPORT = 800, // CTRA watches for this spell to start its teleport timer + SPELL_TWIN_TELEPORT_VISUAL = 26638, // visual + SPELL_EXPLODEBUG = 804, + SPELL_MUTATE_BUG = 802, + SPELL_BERSERK = 26662, + SPELL_UPPERCUT = 26007, + SPELL_UNBALANCING_STRIKE = 26613, + SPELL_SHADOWBOLT = 26006, + SPELL_BLIZZARD = 26607, + SPELL_ARCANEBURST = 568, +}; -#define PULL_RANGE 50 -#define ABUSE_BUG_RANGE 20 -#define SPELL_BERSERK 26662 -#define TELEPORTTIME 30000 +enum Sound +{ + SOUND_VL_AGGRO = 8657, //8657 - Aggro - To Late + SOUND_VL_KILL = 8658, //8658 - Kill - You will not + SOUND_VL_DEATH = 8659, //8659 - Death + SOUND_VN_DEATH = 8660, //8660 - Death - Feel + SOUND_VN_AGGRO = 8661, //8661 - Aggro - Let none + SOUND_VN_KILL = 8662, //8661 - Kill - your fate +}; -#define SPELL_UPPERCUT 26007 -#define SPELL_UNBALANCING_STRIKE 26613 +enum Misc +{ + PULL_RANGE = 50, + ABUSE_BUG_RANGE = 20, + VEKLOR_DIST = 20, // VL will not come to melee when attacking + TELEPORTTIME = 30000 +}; -#define VEKLOR_DIST 20 // VL will not come to melee when attacking -#define SPELL_SHADOWBOLT 26006 -#define SPELL_BLIZZARD 26607 -#define SPELL_ARCANEBURST 568 struct boss_twinemperorsAI : public ScriptedAI { diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index 5649253fa4e..fcbe3a84d62 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp @@ -279,7 +279,7 @@ class npc_glob_of_viscidus : public CreatureScript else { Viscidus->SetHealth(Viscidus->GetHealth() - Viscidus->GetMaxHealth() / 20); - Viscidus->GetAI()->DoCast(Viscidus, SPELL_VISCIDUS_SHRINKS); + Viscidus->CastSpell(Viscidus, SPELL_VISCIDUS_SHRINKS); } } } |
