From d38dfa82e02846b33b5e0690cf50b2ebe422bdc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Bla=C5=BEevi=C4=87?= Date: Thu, 20 Dec 2012 14:30:52 +0100 Subject: [PATCH 01/30] Script/AQ: Rewrite Skeram Add spell_target_position for Skeram Viscidus cosmetic fix Cosmetic fix Cosmetic fix .sql --- .../world/2012_12_20_00_world_skeram.sql | 5 + .../Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp | 421 +++++++----------- .../TempleOfAhnQiraj/boss_viscidus.cpp | 2 +- 3 files changed, 169 insertions(+), 259 deletions(-) create mode 100644 sql/updates/world/2012_12_20_00_world_skeram.sql diff --git a/sql/updates/world/2012_12_20_00_world_skeram.sql b/sql/updates/world/2012_12_20_00_world_skeram.sql new file mode 100644 index 00000000000..fb62da5e994 --- /dev/null +++ b/sql/updates/world/2012_12_20_00_world_skeram.sql @@ -0,0 +1,5 @@ +DELETE FROM `spell_target_position` WHERE id IN (4801,8195,20449); +INSERT INTO `spell_target_position` VALUES +(4801,531,-8306.68,2060.84,133.062,0), +(8195,531,-8344.97,2081.36,125.649,0), +(20449,531,-8330.63,2123.14,133.062,0); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index 99a304e3726..cc351c83324 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -16,284 +16,189 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Skeram -SD%Complete: 75 -SDComment: Mind Control buggy. -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.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, - - SPELL_ARCANE_EXPLOSION = 25679, - SPELL_EARTH_SHOCK = 26194, - SPELL_TRUE_FULFILLMENT = 785, - SPELL_BLINK = 28391 }; -class ov_mycoordinates +enum Spells { - public: - float x, y, z, r; - ov_mycoordinates(float cx, float cy, float cz, float cr) - { - x = cx; y = cy; z = cz; r = cr; - } + SPELL_ARCANE_EXPLOSION = 26192, + SPELL_EARTH_SHOCK = 26194, + SPELL_TRUE_FULFILLMENT = 785, + SPELL_INITIALIZE_IMAGE = 3730, + SPELL_SUMMON_IMAGES = 747 +}; + +enum Events +{ + EVENT_ARCANE_EXPLOSION = 0, + EVENT_FULLFILMENT = 1, + EVENT_BLINK = 2, + EVENT_EARTH_SHOCK = 3 +}; + +uint32 const BlinkSpells[3] = { 4801, 8195, 20449 }; +Position const BossPositions[3] = +{ + { -8306.68f, 2060.84f, 133.062f, 0.0f }, + { -8330.63f, 2123.14f, 133.062f, 0.0f }, + { -8344.97f, 2081.36f, 125.649f, 0.0f } }; class boss_skeram : public CreatureScript { -public: - boss_skeram() : CreatureScript("boss_skeram") { } + public: + boss_skeram() : CreatureScript("boss_skeram") { } + struct boss_skeramAI : public BossAI + { + boss_skeramAI(Creature* creature) : BossAI(creature, DATA_SKERAM) { } + + void Reset() + { + _flag = 0; + _hpct = 75.0f; + me->SetVisible(true); + } + + void KilledUnit(Unit* /*victim*/) + { + Talk(SAY_SLAY); + } + + void EnterEvadeMode() + { + ScriptedAI::EnterEvadeMode(); + if (me->isSummon()) + ((TempSummon*)me)->UnSummon(); + } + + void JustSummoned(Creature* creature) + { + // Shift the boss and images (Get it? *Shift*?) + uint8 Rand; + if (_flag != 0) + { + while (_flag & (1 << Rand)) + Rand = urand(0, 2); + me->SetPosition(BossPositions[Rand]); + _flag |= (1 << Rand); + _flag |= (1 << 7); + } + + while (_flag & (1 << Rand)) + Rand = urand(0, 2); + creature->SetPosition(BossPositions[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)); + } + + void JustDied(Unit* /*killer*/) + { + if (!me->isSummon()) + Talk(SAY_DEATH); + else + me->RemoveCorpse(); + } + + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + events.Reset(); + + 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, 1000); + + Talk(SAY_AGGRO); + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_ARCANE_EXPLOSION: + // TODO: For some weird reason boss does not cast this + DoCast(me, SPELL_ARCANE_EXPLOSION); + 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, 1000); + 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, 1000); + DoMeleeAttackIfReady(); + } + } + + private: + float _hpct; + uint8 _flag; + }; + CreatureAI* GetAI(Creature* creature) const { - return new boss_skeramAI (creature); + 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); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = urand(8000, 18000); - } else ArcaneExplosion_Timer -= diff; - - //If we are within range melee the target - if (me->IsWithinMeleeRange(me->getVictim())) - { - //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 - { - //EarthShock_Timer - if (EarthShock_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_EARTH_SHOCK); - EarthShock_Timer = 1000; - } else EarthShock_Timer -= diff; - } - - //Blink_Timer - if (Blink_Timer <= diff) - { - //DoCast(me, SPELL_BLINK); - switch (urand(0, 2)) - { - 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; - } - 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); - - //Invisible_Timer - if (Invisible) - { - 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; - } - - 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); - - ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3; - - 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; - } - - for (uint16 i = 0; i < 41; ++i) - { - if (Player* target = CAST_PLR(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))) - { - 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); - } - - break; - } - } - - 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(); - - switch (atPercent) - { - case 75: Images75 = true; break; - case 50: Images50 = true; break; - case 25: Images25 = true; break; - } - - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0); - - Creature* Image1 = me->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if (Image1) - { - 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; - } - - Creature* Image2 = me->SummonCreature(15263, i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if (Image2) - { - 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; - } - Invisible = true; - delete place1; - delete place2; - delete place3; - } - - }; - }; void AddSC_boss_skeram() diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index c97fd40929a..eecc5110512 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); } } } From 8b347928870e80aa098edf2f8c64fe863fb5a056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Bla=C5=BEevi=C4=87?= Date: Fri, 21 Dec 2012 14:59:40 +0100 Subject: [PATCH 02/30] Update --- .../Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index cc351c83324..b6ae1ed8591 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -46,12 +46,6 @@ enum Events }; uint32 const BlinkSpells[3] = { 4801, 8195, 20449 }; -Position const BossPositions[3] = -{ - { -8306.68f, 2060.84f, 133.062f, 0.0f }, - { -8330.63f, 2123.14f, 133.062f, 0.0f }, - { -8344.97f, 2081.36f, 125.649f, 0.0f } -}; class boss_skeram : public CreatureScript { @@ -89,14 +83,14 @@ class boss_skeram : public CreatureScript { while (_flag & (1 << Rand)) Rand = urand(0, 2); - me->SetPosition(BossPositions[Rand]); + DoCast(me, BlinkSpells[Rand]); _flag |= (1 << Rand); _flag |= (1 << 7); } while (_flag & (1 << Rand)) Rand = urand(0, 2); - creature->SetPosition(BossPositions[Rand]); + creature->CastSpell(creature, BlinkSpells[Rand]); _flag |= (1 << Rand); if (_flag & (1 << 7)) @@ -134,7 +128,7 @@ class boss_skeram : public CreatureScript 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, 1000); + events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000); Talk(SAY_AGGRO); } @@ -152,7 +146,7 @@ class boss_skeram : public CreatureScript { case EVENT_ARCANE_EXPLOSION: // TODO: For some weird reason boss does not cast this - DoCast(me, SPELL_ARCANE_EXPLOSION); + DoCastAOE(SPELL_ARCANE_EXPLOSION, true); events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(8000, 18000)); break; case EVENT_FULLFILMENT: @@ -169,7 +163,7 @@ class boss_skeram : public CreatureScript break; case EVENT_EARTH_SHOCK: DoCastVictim(SPELL_EARTH_SHOCK); - events.ScheduleEvent(EVENT_EARTH_SHOCK, 1000); + events.ScheduleEvent(EVENT_EARTH_SHOCK, 2000); break; } } @@ -185,7 +179,7 @@ class boss_skeram : public CreatureScript if (me->IsWithinMeleeRange(me->getVictim())) { - events.RescheduleEvent(EVENT_EARTH_SHOCK, 1000); + events.RescheduleEvent(EVENT_EARTH_SHOCK, 2000); DoMeleeAttackIfReady(); } } From 36ba35285bb103ed164d567dc003227f1cac07ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Bla=C5=BEevi=C4=87?= Date: Fri, 21 Dec 2012 18:24:21 +0100 Subject: [PATCH 03/30] Fix --- .../Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index b6ae1ed8591..17d72cea718 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -145,7 +145,6 @@ class boss_skeram : public CreatureScript switch (eventId) { case EVENT_ARCANE_EXPLOSION: - // TODO: For some weird reason boss does not cast this DoCastAOE(SPELL_ARCANE_EXPLOSION, true); events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(8000, 18000)); break; @@ -195,7 +194,47 @@ class boss_skeram : public CreatureScript } }; +class PlayerOrPetCheck +{ + public: + bool operator()(WorldObject* object) const + { + if (object->GetTypeId() != TYPEID_PLAYER) + if (!object->ToCreature()->isPet()) + return true; + + return false; + } +}; + +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); + + void FilterTargets(std::list& targets) + { + targets.remove_if(PlayerOrPetCheck()); + } + + void Register() + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_skeram_arcane_explosion_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_skeram_arcane_explosion_SpellScript(); + } +}; + void AddSC_boss_skeram() { new boss_skeram(); + new spell_skeram_arcane_explosion(); } From ab0d4624b8563380fe10b938f1b216fa7cb754e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Bla=C5=BEevi=C4=87?= Date: Sun, 23 Dec 2012 10:14:14 +0100 Subject: [PATCH 04/30] Script/AQ: Implement Buru the Gorger --- .../world/2012_12_23_02_world_buru.sql | 23 ++ .../Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp | 247 +++++++++++++++++- .../RuinsOfAhnQiraj/ruins_of_ahnqiraj.h | 1 + 3 files changed, 260 insertions(+), 11 deletions(-) create mode 100644 sql/updates/world/2012_12_23_02_world_buru.sql diff --git a/sql/updates/world/2012_12_23_02_world_buru.sql b/sql/updates/world/2012_12_23_02_world_buru.sql new file mode 100644 index 00000000000..daab88f6cea --- /dev/null +++ b/sql/updates/world/2012_12_23_02_world_buru.sql @@ -0,0 +1,23 @@ +UPDATE `creature_template` SET ScriptName='npc_buru_egg' WHERE entry=15514; +UPDATE `creature_template` SET `faction_A`=16,`faction_H`=16 WHERE `entry` IN (15514,15370); +DELETE FROM `creature` WHERE `id`=15521; -- because **** you, thats why +SET @GUID :=xxx; -- Change me plz +DELETE FROM `creature` WHERE `id`=15514; +INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES +(@GUID, 15514, 509, 1, 1, -9270.393, 1243.896, -63.76731, 2.722714, 7200, 0, 0), +(@GUID+1, 15514, 509, 1, 1, -9300.067, 1305.085, -63.69709, 4.18879, 7200, 0, 0), +(@GUID+2, 15514, 509, 1, 1, -9263.014, 1295.236, -63.80813, 1.797689, 7200, 0, 0), +(@GUID+3, 15514, 509, 1, 1, -9243.427, 1280.498, -63.59377, 3.822271, 7200, 0, 0), +(@GUID+4, 15514, 509, 1, 1, -9234.326, 1243.826, -63.52806, 3.490659, 7200, 0, 0), +(@GUID+5, 15514, 509, 1, 1, -9300.189, 1266.665, -63.74272, 0.2617994, 7200, 0, 0); +DELETE FROM `linked_respawn` WHERE `linkedGuid`=90873; +INSERT INTO `linked_respawn` (`guid`, `linkedGuid`, `linkType`) VALUES +(@GUID, 90873, 0), +(@GUID+1, 90873, 0), +(@GUID+2, 90873, 0), +(@GUID+3, 90873, 0), +(@GUID+4, 90873, 0), +(@GUID+5, 90873, 0); +DELETE FROM `spell_script_names` WHERE `spell_id`=19593; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(19593, 'spell_egg_explosion'); 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 . */ -/* 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 + 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 +{ + 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::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 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(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/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 From 0533d63a77785583d9a6c5d6025b4724ef93ef50 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 12:34:58 -0330 Subject: [PATCH 05/30] Core/Scripting: Gong Event updates --- .../ZulAman/instance_zulaman.cpp | 7 +- .../EasternKingdoms/ZulAman/zulaman.cpp | 71 ++++++++----------- 2 files changed, 33 insertions(+), 45 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp index 80f38dbd7cf..abd6b468b07 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/instance_zulaman.cpp @@ -182,9 +182,6 @@ class instance_zulaman : public InstanceMapScript void CheckInstanceStatus() { - if (m_auiEncounter[DATA_GONGEVENT] == DONE) - HandleGameObject(MassiveGateGUID, true); - if (BossKilled >= DATA_HALAZZIEVENT) HandleGameObject(HexLordGateGUID, true); @@ -228,9 +225,9 @@ class instance_zulaman : public InstanceMapScript { case DATA_GONGEVENT: m_auiEncounter[DATA_GONGEVENT] = data; - if (data == SPECIAL) + if (data == IN_PROGRESS) SaveToDB(); - if (data == DONE) + else if (data == DONE) QuestMinute = 21; break; case DATA_NALORAKKEVENT: diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index d140c349a4b..93dc88e572c 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -231,8 +231,7 @@ enum Events GONG_EVENT_8 = 8, GONG_EVENT_9 = 9, GONG_EVENT_10 = 10, - GONG_EVENT_11 = 11, - GONG_EVENT_12 = 12 + GONG_EVENT_11 = 11 }; enum Waypoints @@ -262,8 +261,6 @@ enum Weapons WEAPON_SPEAR = 13631 }; -Position const AmanishiGuardianLoc = {120.687f, 1674.0f, 42.0217f, 1.59044f}; - class npc_harrison_jones : public CreatureScript { public: @@ -304,7 +301,6 @@ class npc_harrison_jones : public CreatureScript me->SendMovementFlagUpdate(true); me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); Talk(SAY_HARRISON_0); - instance->SetData(DATA_GONGEVENT, IN_PROGRESS); _gongEvent = GONG_EVENT_1; _gongTimer = 4000; } @@ -335,8 +331,8 @@ class npc_harrison_jones : public CreatureScript { case GONG_EVENT_1: me->GetMotionMaster()->MovePath(HARRISON_MOVE_1,false); - _gongTimer = 12000; _gongEvent = GONG_EVENT_2; + _gongTimer = 12000; break; case GONG_EVENT_2: me->SetFacingTo(6.235659f); @@ -344,50 +340,50 @@ class npc_harrison_jones : public CreatureScript DoCast(me, SPELL_BANGING_THE_GONG); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_MACE)); me->SetSheath(SHEATH_STATE_MELEE); - _gongTimer = 4000; _gongEvent = GONG_EVENT_3; + _gongTimer = 4000; break; case GONG_EVENT_3: if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG))) gong->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_NOT_SELECTABLE); - _gongTimer = 105000; _gongEvent = GONG_EVENT_4; + _gongTimer = 10500; break; case GONG_EVENT_4: me->RemoveAura(SPELL_BANGING_THE_GONG); if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG))) gong->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_NOT_SELECTABLE); - // trigger or gong will need to be scripted to set SPECIAL if enough players click gong. + // trigger or gong will need to be scripted to set IN_PROGRESS after enough hits. // This is temp workaround. if (instance) - instance->SetData(DATA_GONGEVENT, SPECIAL); // to be removed. + instance->SetData(DATA_GONGEVENT, IN_PROGRESS); // to be removed. - if (instance->GetData(DATA_GONGEVENT) == SPECIAL) + if (instance->GetData(DATA_GONGEVENT) == IN_PROGRESS) { // Players are Now Saved to instance at SPECIAL (Player should be notified?) me->GetMotionMaster()->MovePath(HARRISON_MOVE_2,false); + _gongEvent = GONG_EVENT_5; _gongTimer = 5000; - _gongEvent = 5; } else { _gongTimer = 1000; - _gongEvent = 10; + _gongEvent = GONG_EVENT_9; } break; case GONG_EVENT_5: me->SetEntry(NPC_HARRISON_JONES_1); me->SetDisplayId(MODEL_HARRISON_JONES_1); Talk(SAY_HARRISON_2); - _gongTimer = 14000; - _gongEvent = 6; + _gongTimer = 12000; + _gongEvent = GONG_EVENT_6; break; case GONG_EVENT_6: me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING); Talk(SAY_HARRISON_3); _gongTimer = 7000; - _gongEvent = 7; + _gongEvent = GONG_EVENT_7; break; case GONG_EVENT_7: if (!uiTargetGUID) @@ -403,8 +399,14 @@ class npc_harrison_jones : public CreatureScript if (ptarget->GetPositionX() > 120) { ptarget->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_SPEAR)); + ptarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + ptarget->SetReactState(REACT_PASSIVE); ptarget->AI()->SetData(0,1); } + else + ptarget->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + ptarget->SetReactState(REACT_PASSIVE); + ptarget->AI()->SetData(0,2); } } } @@ -412,44 +414,33 @@ class npc_harrison_jones : public CreatureScript if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_MASSIVE_GATE))) gate->SetGoState(GO_STATE_ACTIVE); - _gongTimer = 1000; - _gongEvent = 8; + _gongTimer = 2000; + _gongEvent = GONG_EVENT_8; + break; case GONG_EVENT_8: DoCast(me, SPELL_STEALTH); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0)); - me->GetMotionMaster()->MovePath(HARRISON_MOVE_3,false); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - _gongTimer = 100; - _gongEvent = 9; - case GONG_EVENT_9: - // If player in 10.0f range - // Send setdata to SAI for previous target - // SAI BELOW - // move 23597, guid 86194 to be deleted - // path 138.2242 Y: 1586.994 Z: 43.5488 - // path 131.8407 Y: 1590.247 Z: 43.61384 - // Reach end of path turnto 2.024582 cast Spell ID: 43647 on self hits 24365 update UNIT_VIRTUAL_ITEM_SLOT_ID: 33979 - // wait 2 sec say text 0 - // Set below after complete above - _gongTimer = 0; + me->GetMotionMaster()->MovePath(HARRISON_MOVE_3,false); + _gongTimer = 1000; _gongEvent = 0; break; - case GONG_EVENT_10: + case GONG_EVENT_9: me->GetMotionMaster()->MovePoint(0, 120.687f, 1674.0f, 42.0217f); _gongTimer = 12000; - _gongEvent = 11; + _gongEvent = GONG_EVENT_10; + break; + case GONG_EVENT_10: + me->SetFacingTo(1.59044f); + _gongEvent = 11; + _gongTimer = 6000; break; case GONG_EVENT_11: - me->SetFacingTo(1.59044f); - _gongTimer = 6000; - _gongEvent = 12; - break; - case GONG_EVENT_12: me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); if (instance) instance->SetData(DATA_GONGEVENT, NOT_STARTED); - _gongTimer = 0; _gongEvent = 0; + _gongTimer = 1000; break; } } From c70b21437b76cdcf75d439b04de3e2cd4f5c8644 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 12:46:12 -0330 Subject: [PATCH 06/30] DB/SAI: Sai for gong event --- sql/updates/world/2013_01_07_00_world_sai.sql | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 sql/updates/world/2013_01_07_00_world_sai.sql diff --git a/sql/updates/world/2013_01_07_00_world_sai.sql b/sql/updates/world/2013_01_07_00_world_sai.sql new file mode 100644 index 00000000000..e289130ddef --- /dev/null +++ b/sql/updates/world/2013_01_07_00_world_sai.sql @@ -0,0 +1,24 @@ +-- SAI for Amani'shi Guardian +SET @ENTRY := 23597; +DELETE FROM `smart_scripts` WHERE `source_type`=0 AND `entryorguid`=@ENTRY AND `id`>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,2,0,38,0,100,2,0,1,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Amani''shi Guardian - On data set 1 - Set Phase 1'), +(@ENTRY,0,3,0,38,0,100,2,0,2,0,0,22,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Amani''shi Guardian - On data set 2 - Set Phase 2'), +-- Script 0 +(@ENTRY,0,4,0,1,1,100,3,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Amani''shi Guardian - Script - Set data 0'), +(@ENTRY,0,5,0,1,1,100,3,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Amani''shi Guardian - Script - Set Run on'), +(@ENTRY,0,6,0,1,1,100,3,2000,2000,2000,2000,69,0,0,0,0,0,0,8,0,0,0,138.2242,1586.994,43.5488,0, 'Amani''shi Guardian - Script - Move to'), +(@ENTRY,0,7,0,1,1,100,3,3000,3000,3000,3000,69,0,0,0,0,0,0,8,0,0,0,131.8407,1590.247,43.61384,0, 'Amani''shi Guardian - Script - Move to'), +(@ENTRY,0,8,0,1,1,100,3,4000,4000,4000,4000,66,0,0,0,0,0,0,8,0,0,0,0,0,0,2.024582, 'Amani''shi Guardian - Script - Turn to'), +(@ENTRY,0,9,0,1,1,100,3,5000,5000,5000,5000,11,43647,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Amani''shi Guardian - Script - Cast'), +(@ENTRY,0,10,0,1,1,100,3,5200,5200,5200,5200,71,0,1,33979,0,0,0,1,0,0,0,0,0,0,0, 'Amani''shi Guardian - Script - Change equipment'), +(@ENTRY,0,11,0,1,1,100,3,6000,6000,6000,6000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Amani''shi Guardian - Script - Say 0'), +(@ENTRY,0,12,0,1,1,100,3,6200,6200,6200,6200,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Amani''shi Guardian - Script - Remove Unit Flag'), +(@ENTRY,0,13,0,1,1,100,3,7000,7000,7000,7000,49,0,0,0,0,0,0,21,50,0,0,0,0,0,0, 'Amani''shi Guardian - Script - Attack Cloest player'), +-- Script 1 +(@ENTRY,0,14,0,1,2,100,3,0,0,0,0,45,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Amani''shi Guardian - Script - Set data 0'), +(@ENTRY,0,15,0,1,2,100,3,0,0,0,0,59,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Amani''shi Guardian - Script - Set Run on'), +(@ENTRY,0,16,0,1,2,100,3,6000,6000,6000,6000,69,0,0,0,0,0,0,8,0,0,0,107.7912,1586.498,43.61609,0, 'Amani''shi Guardian - Script - Move to'), +(@ENTRY,0,17,0,1,2,100,3,6800,6800,6800,6800,66,0,0,0,0,0,0,8,0,0,0,0,0,0,1.047198, 'Amani''shi Guardian - Script - Turn to'), +(@ENTRY,0,18,0,1,2,100,3,7600,7600,7600,7600,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Amani''shi Guardian - Script - Remove Unit Flag'), +(@ENTRY,0,19,0,1,2,100,3,7800,7800,7800,7800,49,0,0,0,0,0,0,21,50,0,0,0,0,0,0, 'Amani''shi Guardian - Script - Attack Cloest player'); From 1bb8b9325a6e1ab9ecb6fb57d24810353f0071bd Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 12:48:28 -0330 Subject: [PATCH 07/30] Core/Scripting: Script Updates --- .../EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp | 2 +- src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp index 15c7a10a125..14ef18aba58 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp @@ -156,7 +156,6 @@ class boss_kirtonos_the_herald : public CreatureScript _introEvent = 0; break; case INTRO_2: - me->SetWalk(true); me->GetMotionMaster()->MovePoint(0, 299.4884f, 92.76137f, 105.6335f); _introTimer = 1000; _introEvent = INTRO_3; @@ -185,6 +184,7 @@ class boss_kirtonos_the_herald : public CreatureScript _introTimer = 5000; _introEvent = INTRO_6; case INTRO_6: + // I don't know how to make him not swim across screen here. Tell me and I will fix. me->GetMotionMaster()->MovePoint(0, 314.8673f, 90.3021f, 101.6459f); _introTimer = 0; _introEvent = 0; diff --git a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp index 93dc88e572c..59997ebaa31 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp @@ -347,7 +347,7 @@ class npc_harrison_jones : public CreatureScript if (GameObject* gong = me->GetMap()->GetGameObject(instance->GetData64(GO_STRANGE_GONG))) gong->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_NOT_SELECTABLE); _gongEvent = GONG_EVENT_4; - _gongTimer = 10500; + _gongTimer = 105000; break; case GONG_EVENT_4: me->RemoveAura(SPELL_BANGING_THE_GONG); From 4d14c58dd4518a7e976b29015b1d2cbeb708d3bf Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Mon, 7 Jan 2013 17:37:39 +0100 Subject: [PATCH 08/30] DB/Creature: Remove creature_addon aura for Frost Armor for the NPCs that have SAI defined: if the creature requires Frost Armor then SAI should cast it. this should reduce some runtime errors for duplicate auras --- .../2013_01_07_01_world_creature_addon.sql | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 sql/updates/world/2013_01_07_01_world_creature_addon.sql diff --git a/sql/updates/world/2013_01_07_01_world_creature_addon.sql b/sql/updates/world/2013_01_07_01_world_creature_addon.sql new file mode 100644 index 00000000000..a83bd028343 --- /dev/null +++ b/sql/updates/world/2013_01_07_01_world_creature_addon.sql @@ -0,0 +1,30 @@ +DELETE FROM `creature_addon` WHERE `guid` IN ( + -- Defias Evoker +79171,79177,79281,79360,79374, + -- Defias Squallshaper +79302,79306,79313,79322,79327,79329,79335,79338,79351,79352,79354,79355, + -- Defias Rogue Wizard +80383,80389,80390,80744,81105,81170,81173,81176, + -- Shadowfang Whitescalp +3479,3480,3482,3483,11514,18308,18313, + -- Defias Enchanter +4279,4321,4874, + -- Skeletal Mage +5992,5996,5997,6000,6003,6004, + -- Defias Pillager +45549,53862,53962,54439,89667,90286,90291,90334,90356, + -- Mosshide Mistweaver +9822,9868,10490,10620, + -- Drywhisker Surveyor +11944,11946,11955, + -- Magistrate Henry Maleb +15322, + -- Hillsbrad Councilman +15642,15751,15957,15967,15986,15988,15989,15995, + -- Syndicate Wizard +16959,17007,17011,17012,17015,17016,17022,17023,17024,17025,17027, + -- Dalaran Wizard +17608,17609,17742,17743,17749,17750,17751,17753,17754,17837,17840,17843,17847,17852,17995,18009,18010,18122,18123,18124,18351,18357,18363,18368,18369,19213,19215,28321,28378,28409, +-- Vile Fin Tidehunter +17615,17616,17640,17668,17694,17715,17716,17728,17737,17764,17766,17805,17806,17818,17819,17820,17900,17932,17933,18213,18215,19043,19045,19054); + From 601f118f290a4e0beb010cedfe1084ef5afcf8d7 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 14:20:52 -0330 Subject: [PATCH 09/30] Core/Scripting: Move some text to creature text. --- .../2013_01_07_02_world_creature_text.sql | 15 +++ .../ScarletEnclave/chapter1.cpp | 92 ++++++++++++------- .../zone_the_scarlet_enclave.cpp | 14 ++- 3 files changed, 83 insertions(+), 38 deletions(-) create mode 100644 sql/updates/world/2013_01_07_02_world_creature_text.sql diff --git a/sql/updates/world/2013_01_07_02_world_creature_text.sql b/sql/updates/world/2013_01_07_02_world_creature_text.sql new file mode 100644 index 00000000000..3e916464615 --- /dev/null +++ b/sql/updates/world/2013_01_07_02_world_creature_text.sql @@ -0,0 +1,15 @@ +-- Texts for Valkyr Battle Maiden +DELETE FROM `creature_text` WHERE `entry`= 28534; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(28534,0,0, 'It is not yet your time, champion. Rise! Rise and fight once more!',15,0,100,0,0,0, 'Valkyr Battle Maiden'); + +-- Texts for Dark Rider of Acherus +DELETE FROM `creature_text` WHERE `entry`= 28654; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(28654,0,0, 'The realm of shadows awaits...',12,0,100,0,0,0, 'Dark Rider of Acherus'); + +-- Texts for Scarlet Miner +DELETE FROM `creature_text` WHERE `entry`= 28841; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(28841,0,0, 'Where''d this come from? I better get this down to the ships before the foreman sees it!',12,0,100,0,0,0, 'Scarlet Miner'), +(28841,1,0, "Now I can have a rest!",12,0,100,0,0,0, 'Scarlet Miner'); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index c22cec65ab7..97fe57c5434 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -146,7 +146,7 @@ public: me->CastSpell(me, SPELL_DK_INITIATE_VISUAL, true); if (Player* starter = Unit::GetPlayer(*me, playerGUID)) - sCreatureTextMgr->SendChat(me, SAY_EVENT_ATTACK, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, starter); + Talk(SAY_EVENT_ATTACK); phase = PHASE_TO_ATTACK; } @@ -165,7 +165,7 @@ public: anchor->GetContactPoint(me, anchorX, anchorY, z, 1.0f); playerGUID = target->GetGUID(); - sCreatureTextMgr->SendChat(me, SAY_EVENT_START, 0, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_NORMAL, 0, TEAM_OTHER, false, target); + Talk(SAY_EVENT_START); } void UpdateAI(const uint32 diff) @@ -330,15 +330,21 @@ public: #define GOSSIP_ACCEPT_DUEL "I challenge you, death knight!" -enum eDuelEnums +enum Spells_DKI { - SAY_DUEL = 0, - SPELL_DUEL = 52996, //SPELL_DUEL_TRIGGERED = 52990, SPELL_DUEL_VICTORY = 52994, SPELL_DUEL_FLAG = 52991, +}; +enum Says_VBM +{ + SAY_DUEL = 0, +}; + +enum Misc_VBN +{ QUEST_DEATH_CHALLENGE = 12733, FACTION_HOSTILE = 2068 }; @@ -501,8 +507,15 @@ public: ## npc_dark_rider_of_acherus ######*/ -#define DESPAWN_HORSE 52267 -#define SAY_DARK_RIDER "The realm of shadows awaits..." +enum Spells_DR +{ + SPELL_DESPAWN_HORSE = 51918 +}; + +enum Says_DR +{ + SAY_DARK_RIDER = 0 +}; class npc_dark_rider_of_acherus : public CreatureScript { @@ -547,7 +560,7 @@ public: break; case 1: if (Unit* target = Unit::GetUnit(*me, TargetGUID)) - DoCast(target, DESPAWN_HORSE, true); + DoCast(target, SPELL_DESPAWN_HORSE, true); PhaseTimer = 3000; Phase = 2; break; @@ -587,13 +600,13 @@ public: ## npc_salanar_the_horseman ######*/ -enum eSalanar +enum Spells_Salanar { - REALM_OF_SHADOWS = 52693, - EFFECT_STOLEN_HORSE = 52263, - DELIVER_STOLEN_HORSE = 52264, - CALL_DARK_RIDER = 52266, - SPELL_EFFECT_OVERTAKE = 52349 + SPELL_REALM_OF_SHADOWS = 52693, + SPELL_EFFECT_STOLEN_HORSE = 52263, + SPELL_DELIVER_STOLEN_HORSE = 52264, + SPELL_CALL_DARK_RIDER = 52266, + SPELL_EFFECT_OVERTAKE = 52349 }; class npc_salanar_the_horseman : public CreatureScript @@ -612,18 +625,18 @@ public: void SpellHit(Unit* caster, const SpellInfo* spell) { - if (spell->Id == DELIVER_STOLEN_HORSE) + if (spell->Id == SPELL_DELIVER_STOLEN_HORSE) { if (caster->GetTypeId() == TYPEID_UNIT && caster->IsVehicle()) { if (Unit* charmer = caster->GetCharmer()) { - if (charmer->HasAura(EFFECT_STOLEN_HORSE)) + if (charmer->HasAura(SPELL_EFFECT_STOLEN_HORSE)) { - charmer->RemoveAurasDueToSpell(EFFECT_STOLEN_HORSE); + charmer->RemoveAurasDueToSpell(SPELL_EFFECT_STOLEN_HORSE); caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); caster->setFaction(35); - DoCast(caster, CALL_DARK_RIDER, true); + DoCast(caster, SPELL_CALL_DARK_RIDER, true); if (Creature* Dark_Rider = me->FindNearestCreature(28654, 15)) CAST_AI(npc_dark_rider_of_acherus::npc_dark_rider_of_acherusAI, Dark_Rider->AI())->InitDespawnHorse(caster); } @@ -651,8 +664,8 @@ public: //CAST_CRE(who)->Respawn(true); } - if (CAST_PLR(charmer)->HasAura(REALM_OF_SHADOWS)) - charmer->RemoveAurasDueToSpell(REALM_OF_SHADOWS); + if (CAST_PLR(charmer)->HasAura(SPELL_REALM_OF_SHADOWS)) + charmer->RemoveAurasDueToSpell(SPELL_REALM_OF_SHADOWS); } } } @@ -715,10 +728,10 @@ public: }; // correct way: 52312 52314 52555 ... -enum SG +enum Creatures_SG { - GHOULS = 28845, - GHOSTS = 28846, + NPC_GHOULS = 28845, + NPC_GHOSTS = 28846, }; class npc_dkc1_gothik : public CreatureScript { @@ -738,7 +751,7 @@ public: { ScriptedAI::MoveInLineOfSight(who); - if (who->GetEntry() == GHOULS && me->IsWithinDistInMap(who, 10.0f)) + if (who->GetEntry() == NPC_GHOULS && me->IsWithinDistInMap(who, 10.0f)) { if (Unit* owner = who->GetOwner()) { @@ -753,7 +766,7 @@ public: CAST_CRE(who)->DespawnOrUnsummon(); if (CAST_PLR(owner)->GetQuestStatus(12698) == QUEST_STATUS_COMPLETE) - owner->RemoveAllMinionsByEntry(GHOULS); + owner->RemoveAllMinionsByEntry(NPC_GHOSTS); } } } @@ -786,7 +799,7 @@ public: void FindMinions(Unit* owner) { std::list MinionList; - owner->GetAllMinionsByEntry(MinionList, GHOULS); + owner->GetAllMinionsByEntry(MinionList, NPC_GHOULS); if (!MinionList.empty()) { @@ -812,7 +825,7 @@ public: Player* plrOwner = owner->ToPlayer(); if (plrOwner && plrOwner->isInCombat()) { - if (plrOwner->getAttackerForHelper() && plrOwner->getAttackerForHelper()->GetEntry() == GHOSTS) + if (plrOwner->getAttackerForHelper() && plrOwner->getAttackerForHelper()->GetEntry() == NPC_GHOSTS) AttackStart(plrOwner->getAttackerForHelper()); else FindMinions(owner); @@ -825,7 +838,7 @@ public: //ScriptedAI::UpdateAI(diff); //Check if we have a current target - if (me->getVictim()->GetEntry() == GHOSTS) + if (me->getVictim()->GetEntry() == NPC_GHOSTS) { if (me->isAttackReady()) { @@ -846,8 +859,11 @@ public: ## npc_scarlet_miner_cart ####*/ -#define SPELL_CART_CHECK 54173 -#define SPELL_CART_DRAG 52465 +enum Spells_SM +{ + SPELL_CART_CHECK = 54173, + SPELL_CART_DRAG = 52465 +}; class npc_scarlet_miner_cart : public CreatureScript { @@ -902,8 +918,11 @@ public: ## npc_scarlet_miner ####*/ -#define SAY_SCARLET_MINER1 "Where'd this come from? I better get this down to the ships before the foreman sees it!" -#define SAY_SCARLET_MINER2 "Now I can have a rest!" +enum Says_SM +{ + SAY_SCARLET_MINER_0 = 0, + SAY_SCARLET_MINER_1 = 1 +}; class npc_scarlet_miner : public CreatureScript { @@ -984,7 +1003,7 @@ public: me->SetInFront(car); me->SendMovementFlagUpdate(); } - me->MonsterSay(SAY_SCARLET_MINER1, LANG_UNIVERSAL, 0); + Talk(SAY_SCARLET_MINER_0); SetRun(true); IntroTimer = 4000; IntroPhase = 1; @@ -998,7 +1017,7 @@ public: car->StopMoving(); car->RemoveAura(SPELL_CART_DRAG); } - me->MonsterSay(SAY_SCARLET_MINER2, LANG_UNIVERSAL, 0); + Talk(SAY_SCARLET_MINER_1); break; default: break; @@ -1036,7 +1055,10 @@ public: ## go_inconspicuous_mine_car ######*/ -#define SPELL_CART_SUMM 52463 +enum Spells_Cart +{ + SPELL_CART_SUMM = 52463 +}; class go_inconspicuous_mine_car : public GameObjectScript { diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp index a86b15a7f5c..32ce484f715 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/zone_the_scarlet_enclave.cpp @@ -23,8 +23,16 @@ /*#### ## npc_valkyr_battle_maiden ####*/ -#define SPELL_REVIVE 51918 -#define VALK_WHISPER "It is not yet your time, champion. Rise! Rise and fight once more!" + +enum Spells_VBM +{ + SPELL_REVIVE = 51918 +}; + +enum Says_VBM +{ + WHISPER_REVIVE = 0 +}; class npc_valkyr_battle_maiden : public CreatureScript { @@ -96,7 +104,7 @@ public: { me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_01); DoCast(player, SPELL_REVIVE, true); - me->MonsterWhisper(VALK_WHISPER, player->GetGUID()); + Talk(WHISPER_REVIVE,player->GetGUID()); } FlyBackTimer = 5000; break; From 9d1ad8ab3afdb9701d005c8dffc7d33847d50903 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 15:31:38 -0330 Subject: [PATCH 10/30] Core/Scripts: Move text for Boss Akil'zon to db. --- .../2013_01_07_03_world_creature_text,sql | 10 +++ .../EasternKingdoms/ZulAman/boss_akilzon.cpp | 61 +++++++------------ 2 files changed, 33 insertions(+), 38 deletions(-) create mode 100644 sql/updates/world/2013_01_07_03_world_creature_text,sql diff --git a/sql/updates/world/2013_01_07_03_world_creature_text,sql b/sql/updates/world/2013_01_07_03_world_creature_text,sql new file mode 100644 index 00000000000..c006dc5ef99 --- /dev/null +++ b/sql/updates/world/2013_01_07_03_world_creature_text,sql @@ -0,0 +1,10 @@ +-- Texts for Akil'zon +DELETE FROM `creature_text` WHERE `entry`= 23574; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(23574,0,0, 'I be da predator! You da prey...',14,0,100,0,0,12013, 'Akil''zon On Aggro'), +(23574,1,0, 'Feed, me bruddahs!',14,0,100,0,0,12014, 'Akil''zon On Summon'), +(23574,2,0, 'Your death gonna be quick, strangers. You shoulda never have come to this place...',14,0,100,0,0,12015, 'Akil''zon Intro'), +(23574,3,0, 'All you be doing is wasting my time!',14,0,100,0,0,12016, 'Akil''zon On Enrage'), +(23574,4,0, 'Ya got nothin''!',14,0,100,0,0,12017, 'Akil''zon On Player Kill'), +(23574,4,1, 'Stop your cryin''!',14,0,100,0,0,12018, 'Akil''zon On Player Kill'), +(23574,5,0, 'You can''t... kill... me spirit!',14,0,100,0,0,12019, 'Akil''zon On Dearh'); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 89b14ff0f4d..1b2512ccf63 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -38,7 +38,7 @@ enum Spells { SPELL_STATIC_DISRUPTION = 43622, SPELL_STATIC_VISUAL = 45265, - SPELL_CALL_LIGHTNING = 43661, //Missing timer + SPELL_CALL_LIGHTNING = 43661, // Missing timer SPELL_GUST_OF_WIND = 43621, SPELL_ELECTRICAL_STORM = 43648, SPELL_BERSERK = 45078, @@ -46,25 +46,24 @@ enum Spells SPELL_EAGLE_SWOOP = 44732 }; -//"Your death gonna be quick, strangers. You shoulda never have come to this place..." -#define SAY_ONAGGRO "I be da predator! You da prey..." -#define SAY_ONDEATH "You can't... kill... me spirit!" -#define SAY_ONSLAY1 "Ya got nothin'!" -#define SAY_ONSLAY2 "Stop your cryin'!" -#define SAY_ONSUMMON "Feed, me bruddahs!" -#define SAY_ONENRAGE "All you be doing is wasting my time!" -#define SOUND_ONAGGRO 12013 -#define SOUND_ONDEATH 12019 -#define SOUND_ONSLAY1 12017 -#define SOUND_ONSLAY2 12018 -#define SOUND_ONSUMMON 12014 -#define SOUND_ONENRAGE 12016 +enum Says +{ + SAY_AGGRO = 0, + SAY_SUMMON = 1, + SAY_INTRO = 2, // Not used in script + SAY_ENRAGE = 3, + SAY_KILL = 4, + SAY_DEATH = 5 +}; -#define MOB_SOARING_EAGLE 24858 -#define SE_LOC_X_MAX 400 -#define SE_LOC_X_MIN 335 -#define SE_LOC_Y_MAX 1435 -#define SE_LOC_Y_MIN 1370 +enum Misc +{ + MOB_SOARING_EAGLE = 24858, + SE_LOC_X_MAX = 400, + SE_LOC_X_MIN = 335, + SE_LOC_Y_MAX = 1435, + SE_LOC_Y_MIN = 1370 +}; class boss_akilzon : public CreatureScript { @@ -130,8 +129,7 @@ class boss_akilzon : public CreatureScript void EnterCombat(Unit* /*who*/) { - me->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONAGGRO); + Talk(SAY_AGGRO); //DoZoneInCombat(); if (instance) instance->SetData(DATA_AKILZONEVENT, IN_PROGRESS); @@ -139,8 +137,7 @@ class boss_akilzon : public CreatureScript void JustDied(Unit* /*killer*/) { - me->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONDEATH); + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_AKILZONEVENT, DONE); DespawnSummons(); @@ -148,17 +145,7 @@ class boss_akilzon : public CreatureScript void KilledUnit(Unit* /*victim*/) { - switch (urand(0, 1)) - { - case 0: - me->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONSLAY1); - break; - case 1: - me->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONSLAY2); - break; - } + Talk(SAY_KILL); } void DespawnSummons() @@ -276,8 +263,7 @@ class boss_akilzon : public CreatureScript if (Enrage_Timer <= diff) { - me->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONENRAGE); + Talk(SAY_ENRAGE); DoCast(me, SPELL_BERSERK, true); Enrage_Timer = 600000; } else Enrage_Timer -= diff; @@ -351,8 +337,7 @@ class boss_akilzon : public CreatureScript if (SummonEagles_Timer <= diff) { - me->MonsterYell(SAY_ONSUMMON, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_ONSUMMON); + Talk(SAY_SUMMON); float x, y, z; me->GetPosition(x, y, z); From 74b4dbec3f34968577fa93ab533847330a25eba2 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 15:54:11 -0330 Subject: [PATCH 11/30] Core: Scripting: Convert Text for boss Archaedas to creature text --- ... => 2013_01_07_03_world_creature_text.sql} | 0 .../2013_01_07_04_world_creature_text.sql | 7 +++++ .../Uldaman/boss_archaedas.cpp | 30 +++++++------------ 3 files changed, 18 insertions(+), 19 deletions(-) rename sql/updates/world/{2013_01_07_03_world_creature_text,sql => 2013_01_07_03_world_creature_text.sql} (100%) create mode 100644 sql/updates/world/2013_01_07_04_world_creature_text.sql diff --git a/sql/updates/world/2013_01_07_03_world_creature_text,sql b/sql/updates/world/2013_01_07_03_world_creature_text.sql similarity index 100% rename from sql/updates/world/2013_01_07_03_world_creature_text,sql rename to sql/updates/world/2013_01_07_03_world_creature_text.sql diff --git a/sql/updates/world/2013_01_07_04_world_creature_text.sql b/sql/updates/world/2013_01_07_04_world_creature_text.sql new file mode 100644 index 00000000000..6fd1d3b95a7 --- /dev/null +++ b/sql/updates/world/2013_01_07_04_world_creature_text.sql @@ -0,0 +1,7 @@ +-- Texts for Archaedas +DELETE FROM `creature_text` WHERE `entry`= 2748; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(2748,0,0, 'Who dares awaken Archaedas? Who dares the wrath of the makers!',14,0,100,0,0,5855, 'Archaedas On Aggro'), +(2748,1,0, 'Awake ye servants, defend the discs!',14,0,100,0,0,5856, 'Archaedas On Summon Guardians'), +(2748,2,0, 'To my side, brothers. For the makers!',14,0,100,0,0,5857, 'Archaedas On Summon Vault Walkers'), +(2748,3,0, 'Reckless mortal.',14,0,100,0,0,5858, 'Archaedas On Player Kill'); diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 6d555a52eec..673b168970b 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -31,17 +31,13 @@ EndScriptData */ #include "uldaman.h" #include "Player.h" -#define SAY_AGGRO "Who dares awaken Archaedas? Who dares the wrath of the makers!" -#define SOUND_AGGRO 5855 - -#define SAY_SUMMON "Awake ye servants, defend the discs!" -#define SOUND_SUMMON 5856 - -#define SAY_SUMMON2 "To my side, brothers. For the makers!" -#define SOUND_SUMMON2 5857 - -#define SAY_KILL "Reckless mortal." -#define SOUND_KILL 5858 +enum Says +{ + SAY_AGGRO = 0, + SAY_SUMMON_GUARDIANS = 1, + SAY_SUMMON_VAULT_WALKERS = 2, + SAY_KILL = 3 +}; enum eSpells { @@ -122,8 +118,7 @@ class boss_archaedas : public CreatureScript // Being woken up from the altar, start the awaken sequence if (spell == sSpellMgr->GetSpellInfo(SPELL_ARCHAEDAS_AWAKEN)) { - me->MonsterYell(SAY_AGGRO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_AGGRO); + Talk(SAY_AGGRO); iAwakenTimer = 4000; bWakingUp = true; } @@ -131,8 +126,7 @@ class boss_archaedas : public CreatureScript void KilledUnit(Unit* /*victim*/) { - me->MonsterYell(SAY_KILL, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_KILL); + Talk(SAY_KILL); } void UpdateAI(const uint32 uiDiff) @@ -172,8 +166,7 @@ class boss_archaedas : public CreatureScript ActivateMinion(instance->GetData64(8), true); // EarthenGuardian4 ActivateMinion(instance->GetData64(9), true); // EarthenGuardian5 ActivateMinion(instance->GetData64(10), false); // EarthenGuardian6 - me->MonsterYell(SAY_SUMMON, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_SUMMON); + Talk(SAY_SUMMON_GUARDIANS); bGuardiansAwake = true; } @@ -184,8 +177,7 @@ class boss_archaedas : public CreatureScript ActivateMinion(instance->GetData64(2), true); // VaultWalker2 ActivateMinion(instance->GetData64(3), true); // VaultWalker3 ActivateMinion(instance->GetData64(4), false); // VaultWalker4 - me->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_SUMMON2); + Talk(SAY_SUMMON_VAULT_WALKERS); bVaultWalkersAwake = true; } From 609232dfbeb7940163bc00c4b6fa53d07afa47a8 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 16:12:49 -0330 Subject: [PATCH 12/30] Core/Scripting: Move Text for Archavon the Stone Watcher to creature text --- sql/updates/world/2013_01_07_05_world_creature_text.sql | 4 ++++ .../scripts/Northrend/VaultOfArchavon/boss_archavon.cpp | 6 ++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 sql/updates/world/2013_01_07_05_world_creature_text.sql diff --git a/sql/updates/world/2013_01_07_05_world_creature_text.sql b/sql/updates/world/2013_01_07_05_world_creature_text.sql new file mode 100644 index 00000000000..d9d91e784ba --- /dev/null +++ b/sql/updates/world/2013_01_07_05_world_creature_text.sql @@ -0,0 +1,4 @@ +-- Texts for Archavon the Stone Watcher +DELETE FROM `creature_text` WHERE `entry`= 31125 AND `groupid`=1; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(31125,1,0, 'Archavon the Stone Watcher lunges for $N!',16,0,100,0,0,0, 'Archavon the Stone Watcher Leap Emote'); diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp index dc9665ae27b..33e0619c7e5 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp @@ -21,7 +21,8 @@ enum { - EMOTE_BERSERK = 0 + EMOTE_BERSERK = 0, + EMOTE_LEAP = 1 // Not in use }; //Spells Archavon @@ -38,9 +39,6 @@ enum //4 Warders spawned #define ARCHAVON_WARDER 32353 //npc 32353 -//Yell -#define SAY_LEAP "Archavon the Stone Watcher lunges for $N!" //$N should be the target - enum Events { // Archavon From 3d1f61b2786cde8b4c7b64166bdd6d2d653d2089 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 16:29:20 -0330 Subject: [PATCH 13/30] Core/Scripting: Move Text for Ayamiss the Hunter to creature text --- .../world/2013_01_07_06_world_creature_text.sql | 4 ++++ .../Kalimdor/RuinsOfAhnQiraj/boss_ayamiss.cpp | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 sql/updates/world/2013_01_07_06_world_creature_text.sql diff --git a/sql/updates/world/2013_01_07_06_world_creature_text.sql b/sql/updates/world/2013_01_07_06_world_creature_text.sql new file mode 100644 index 00000000000..5c7d09f9887 --- /dev/null +++ b/sql/updates/world/2013_01_07_06_world_creature_text.sql @@ -0,0 +1,4 @@ +-- Texts for Ayamiss the Hunter +DELETE FROM `creature_text` WHERE `entry`= 15369; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(15369,0,0, '%s goes into a frenzy!',16,0,100,0,0,0, 'Ayamiss the Hunter Frenzy Emote'); 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: From 61fa397117d973995d120fe1ec9d7123201d2f7e Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 17:22:14 -0330 Subject: [PATCH 14/30] Core/Scripting: Move Text for Baron Rivendare to creature text. --- .../2013_01_07_07_world_creature_text.sql | 9 ++ .../Stratholme/boss_baron_rivendare.cpp | 87 ++++++++----------- .../Uldaman/boss_archaedas.cpp | 11 +-- 3 files changed, 46 insertions(+), 61 deletions(-) create mode 100644 sql/updates/world/2013_01_07_07_world_creature_text.sql diff --git a/sql/updates/world/2013_01_07_07_world_creature_text.sql b/sql/updates/world/2013_01_07_07_world_creature_text.sql new file mode 100644 index 00000000000..6f6a0b75713 --- /dev/null +++ b/sql/updates/world/2013_01_07_07_world_creature_text.sql @@ -0,0 +1,9 @@ +-- Texts for Baron Rivendare (Strathhome) +DELETE FROM `creature_text` WHERE `entry`= 15369; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(15369,0,0, 'Intruders! More pawns of the Argent Dawn, no doubt. I already count one of their number among my prisoners. Withdraw from my domain before she is executed!',14,0,100,0,0,0, 'Baron Rivendare - Baron Run Start'), +(15369,1,0, 'You''re still here? Your foolishness is amusing! The Argent Dawn wench needn''t suffer in vain. Leave at once and she shall be spared!',14,0,100,0,0,0, 'Baron Rivendare - Baron Run in progress random'), +(15369,1,1, 'I shall take great pleasure in taking this poor wretch''s life! It''s not too late, she needn''t suffer in vain. Turn back and her death shall be merciful!',14,0,100,0,0,0, 'Baron Rivendare - Baron Run in progress random'), +(15369,2,0, 'May this prisoner''s death serve as a warning. None shall defy the Scourge and live!',14,0,100,0,0,0, 'Baron Rivendare - Baron Run Fail'), +(15369,3,0, 'So you see fit to toy with the Lich King''s creations? Ramstein, be sure to give the intruders a proper greeting.',14,0,100,0,0,0, 'Baron Rivendare - Event Ramstein'), +(15369,4,0, 'Time to take matters into my own hands. Come. Enter my domain and challenge the might of the Scourge!',14,0,100,0,0,0, 'Baron Rivendare - Event Baron'); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp index 3517bc0e223..2357f59b65d 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_baron_rivendare.cpp @@ -27,56 +27,39 @@ EndScriptData */ #include "ScriptedCreature.h" #include "stratholme.h" -#define SAY_0 "Intruders! More pawns of the Argent Dawn, no doubt. I already count one of their number among my prisoners. Withdraw from my domain before she is executed!" -#define SAY_1 "You're still here? Your foolishness is amusing! The Argent Dawn wench needn't suffer in vain. Leave at once and she shall be spared!" -#define SAY_2 "I shall take great pleasure in taking this poor wretch's life! It's not too late, she needn't suffer in vain. Turn back and her death shall be merciful!" -#define SAY_3 "May this prisoner's death serve as a warning. None shall defy the Scourge and live!" -#define SAY_4 "So you see fit to toy with the Lich King's creations? Ramstein, be sure to give the intruders a proper greeting." -#define SAY_5 "Time to take matters into my own hands. Come. Enter my domain and challenge the might of the Scourge!" +enum Says +{ + SAY_BARON_RUN_START = 0, + SAY_BARON_RUN_BOSS_KILL = 1, + SAY_BARON_RUN_FAIL = 2, + SAY_EVENT_RAMSTEIN = 3, + SAY_EVENT_BARON = 4 +}; -#define ADD_1X 4017.403809f -#define ADD_1Y -3339.703369f -#define ADD_1Z 115.057655f -#define ADD_1O 5.487860f +enum Spells +{ + SPELL_SHADOWBOLT = 17393, + SPELL_CLEAVE = 15284, + SPELL_MORTALSTRIKE = 15708, -#define ADD_2X 4013.189209f -#define ADD_2Y -3351.808350f -#define ADD_2Z 115.052254f -#define ADD_2O 0.134280f + SPELL_UNHOLY_AURA = 15284, + SPELL_RAISEDEAD = 15708, //triggers death pact (17471) -#define ADD_3X 4017.738037f -#define ADD_3Y -3363.478016f -#define ADD_3Z 115.057274f -#define ADD_3O 0.723313f + SPELL_RAISE_DEAD1 = 17475, + SPELL_RAISE_DEAD2 = 17476, + SPELL_RAISE_DEAD3 = 17477, + SPELL_RAISE_DEAD4 = 17478, + SPELL_RAISE_DEAD5 = 17479, + SPELL_RAISE_DEAD6 = 17480, +}; -#define ADD_4X 4048.877197f -#define ADD_4Y -3363.223633f -#define ADD_4Z 115.054253f -#define ADD_4O 3.627735f - -#define ADD_5X 4051.777588f -#define ADD_5Y -3350.893311f -#define ADD_5Z 115.055351f -#define ADD_5O 3.066176f - -#define ADD_6X 4048.375977f -#define ADD_6Y -3339.966309f -#define ADD_6Z 115.055222f -#define ADD_6O 2.457497f - -#define SPELL_SHADOWBOLT 17393 -#define SPELL_CLEAVE 15284 -#define SPELL_MORTALSTRIKE 15708 - -#define SPELL_UNHOLY_AURA 17467 -#define SPELL_RAISEDEAD 17473 //triggers death pact (17471) - -#define SPELL_RAISE_DEAD1 17475 -#define SPELL_RAISE_DEAD2 17476 -#define SPELL_RAISE_DEAD3 17477 -#define SPELL_RAISE_DEAD4 17478 -#define SPELL_RAISE_DEAD5 17479 -#define SPELL_RAISE_DEAD6 17480 +// Define Add positions +Position const ADD_POS_1 = {4017.403809f, -3339.703369f, 115.057655f, 5.487860f}; +Position const ADD_POS_2 = {4013.189209f, -3351.808350f, 115.052254f, 0.134280f}; +Position const ADD_POS_3 = {4017.738037f, -3363.478016f, 115.057274f, 0.723313f}; +Position const ADD_POS_4 = {4048.877197f, -3363.223633f, 115.054253f, 3.627735f}; +Position const ADD_POS_5 = {4051.777588f, -3350.893311f, 115.055351f, 3.066176f}; +Position const ADD_POS_6 = {4048.375977f, -3339.966309f, 115.055222f, 2.457497f}; class boss_baron_rivendare : public CreatureScript { @@ -172,12 +155,12 @@ public: //SummonSkeletons if (SummonSkeletons_Timer <= diff) { - me->SummonCreature(11197, ADD_1X, ADD_1Y, ADD_1Z, ADD_1O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_2X, ADD_2Y, ADD_2Z, ADD_2O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_3X, ADD_3Y, ADD_3Z, ADD_3O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_4X, ADD_4Y, ADD_4Z, ADD_4O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_5X, ADD_5Y, ADD_5Z, ADD_5O, TEMPSUMMON_TIMED_DESPAWN, 29000); - me->SummonCreature(11197, ADD_6X, ADD_6Y, ADD_6Z, ADD_6O, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_1, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_2, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_3, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_4, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_5, TEMPSUMMON_TIMED_DESPAWN, 29000); + me->SummonCreature(11197, ADD_POS_6, TEMPSUMMON_TIMED_DESPAWN, 29000); //34 seconds until we should cast this again SummonSkeletons_Timer = 40000; diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index 673b168970b..87301f43745 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -39,7 +39,7 @@ enum Says SAY_KILL = 3 }; -enum eSpells +enum Spells { SPELL_GROUND_TREMOR = 6524, SPELL_ARCHAEDAS_AWAKEN = 10347, @@ -48,6 +48,7 @@ enum eSpells SPELL_SUB_BOSS_AGGRO = 11568, SPELL_AWAKEN_VAULT_WALKER = 10258, SPELL_AWAKEN_EARTHEN_GUARDIAN = 10252, + SPELL_SELF_DESTRUCT = 9874 }; class boss_archaedas : public CreatureScript @@ -216,8 +217,6 @@ SDComment: These mobs are initially frozen until Archaedas awakens them one at a time. EndScriptData */ -#define SPELL_ARCHAEDAS_AWAKEN 10347 - class mob_archaedas_minions : public CreatureScript { public: @@ -315,8 +314,6 @@ SDComment: After activating the altar of the keepers, the stone keepers will wake up one by one. EndScriptData */ -#define SPELL_SELF_DESTRUCT 9874 - class mob_stonekeepers : public CreatureScript { public: @@ -380,8 +377,6 @@ SDComment: Needs 1 person to activate the Archaedas script SDCategory: Uldaman EndScriptData */ -#define SPELL_BOSS_OBJECT_VISUAL 11206 - class go_altar_of_archaedas : public GameObjectScript { public: @@ -411,8 +406,6 @@ SDComment: Need 1 person to activate to open the altar. One by one the StoneKee SDCategory: Uldaman EndScriptData */ -#define SPELL_BOSS_OBJECT_VISUAL 11206 - class go_altar_of_the_keepers : public GameObjectScript { public: From 55d3e8adaa1ae37ada1429a8d2f17ca53f62bbd6 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 18:14:30 -0330 Subject: [PATCH 15/30] Core/Scripting: Move Text for Zul'jin to creature text --- .../2013_01_07_08_world_creature_text.sql | 14 ++ .../EasternKingdoms/ZulAman/boss_zuljin.cpp | 174 +++++++----------- 2 files changed, 84 insertions(+), 104 deletions(-) create mode 100644 sql/updates/world/2013_01_07_08_world_creature_text.sql diff --git a/sql/updates/world/2013_01_07_08_world_creature_text.sql b/sql/updates/world/2013_01_07_08_world_creature_text.sql new file mode 100644 index 00000000000..94ab4d925ee --- /dev/null +++ b/sql/updates/world/2013_01_07_08_world_creature_text.sql @@ -0,0 +1,14 @@ +-- Texts for Zul'jin +DELETE FROM `creature_text` WHERE `entry`= 23863; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(23863,0,0, 'Everybody always wanna take from us. Now we gonna start takin'' back. Anybody who get in our way...gonna drown in their own blood! De Amani empire be back now...seekin'' vengeance. And we gonna start...with you!',14,0,100,0,0,12090, 'Zul''jin YELL_INTRO'), +(23863,1,0, 'Nobody badduh dan me!',14,0,100,0,0,12091, 'Zul''jin YELL_AGGRO'), +(23863,2,0, 'Got me some new tricks...like me bruddah bear!',14,0,100,0,0,12092, 'Zul''jin YELL_TRANSFORM_TO_BEAR'), +(23863,3,0, 'Dere be no hidin'' from da eagle!',14,0,100,0,0,12093, 'Zul''jin YELL_TRANSFORM_TO_EAGLE'), +(23863,4,0, 'Let me introduce to you my new bruddahs: fang and claw!',14,0,100,0,0,12094, 'Zul''jin YELL_TRANSFORM_TO_LYNX'), +(23863,5,0, 'Ya don'' have to look to da sky to see da dragonhawk!',14,0,100,0,0,12095, 'Zul''jin YELL_TRANSFORM_TO_DRAGONHAWK'), +(23863,6,0, 'Fire kill you just as quick!',14,0,100,0,0,12096, 'Zul''jin YELL_FIRE_BREATH'), +(23863,7,0, 'You too slow! Me too strong!',14,0,100,0,0,12097, 'Zul''jin YELL_BERSERK'), +(23863,8,0, 'Da Amani de chuka!',14,0,100,0,0,12098, 'Zul''jin YELL_KILL'), +(23863,8,1, 'Lot more gonna fall like you!',14,0,100,0,0,12099, 'Zul''jin YELL_KILL'), +(23863,9,0, 'Mebbe me fall...but da Amani empire...never gonna die...',14,0,100,0,0,12100, 'Zul''jin YELL_DEATH'); diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp index a7764fc4c4c..2305c360fd2 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp @@ -27,86 +27,68 @@ EndScriptData */ #include "zulaman.h" #include "SpellInfo.h" -//Speech -const char* YELL_TRANSFORM_TO_LYNX = "Let me introduce to you my new bruddahs: fang and claw!"; -#define SOUND_TRANSFORM_TO_LYNX 12094 +enum Says +{ + YELL_INTRO = 0, + YELL_AGGRO = 1, + YELL_TRANSFORM_TO_BEAR = 2, + YELL_TRANSFORM_TO_EAGLE = 3, + YELL_TRANSFORM_TO_LYNX = 4, + YELL_TRANSFORM_TO_DRAGONHAWK = 5, + YELL_FIRE_BREATH = 6, + YELL_BERSERK = 7, + YELL_KILL = 8, + YELL_DEATH = 9 +}; -const char* YELL_TRANSFORM_TO_BEAR = "Got me some new tricks...like me bruddah bear!"; -#define SOUND_TRANSFORM_TO_BEAR 12092 +enum Spells +{ + // Troll Form + SPELL_WHIRLWIND = 17207, + SPELL_GRIEVOUS_THROW = 43093, // remove debuff after full healed + // Bear Form + SPELL_CREEPING_PARALYSIS = 43095, // should cast on the whole raid + SPELL_OVERPOWER = 43456, // use after melee attack dodged + // Eagle Form + SPELL_ENERGY_STORM = 43983, // enemy area aura, trigger 42577 + SPELL_ZAP_INFORM = 42577, + SPELL_ZAP_DAMAGE = 43137, // 1250 damage + SPELL_SUMMON_CYCLONE = 43112, // summon four feather vortex + CREATURE_FEATHER_VORTEX = 24136, + SPELL_CYCLONE_VISUAL = 43119, // trigger 43147 visual + SPELL_CYCLONE_PASSIVE = 43120, // trigger 43121 (4y aoe) every second + // Lynx Form + SPELL_CLAW_RAGE_HASTE = 42583, + SPELL_CLAW_RAGE_TRIGGER = 43149, + SPELL_CLAW_RAGE_DAMAGE = 43150, + SPELL_LYNX_RUSH_HASTE = 43152, + SPELL_LYNX_RUSH_DAMAGE = 43153, + // Dragonhawk Form + SPELL_FLAME_WHIRL = 43213, // trigger two spells + SPELL_FLAME_BREATH = 43215, + SPELL_SUMMON_PILLAR = 43216, // summon 24187 + CREATURE_COLUMN_OF_FIRE = 24187, + SPELL_PILLAR_TRIGGER = 43218, // trigger 43217 + // Cosmetic + SPELL_SPIRIT_AURA = 42466, + SPELL_SIPHON_SOUL = 43501, + // Transforms: + SPELL_SHAPE_OF_THE_BEAR = 42594, // 15% dmg + SPELL_SHAPE_OF_THE_EAGLE = 42606, + SPELL_SHAPE_OF_THE_LYNX = 42607, // haste melee 30% + SPELL_SHAPE_OF_THE_DRAGONHAWK = 42608, -const char* YELL_TRANSFORM_TO_DRAGONHAWK = "Ya don' have to look to da sky to see da dragonhawk!"; -#define SOUND_TRANSFORM_TO_DRAGONHAWK 12095 + SPELL_BERSERK = 45078 +}; -const char* YELL_TRANSFORM_TO_EAGLE = "Dere be no hidin' from da eagle!"; -#define SOUND_TRANSFORM_TO_EAGLE 12093 - -#define YELL_KILL_ONE "Da Amani de chuka!" -#define SOUND_KILL_ONE 12098 - -#define YELL_KILL_TWO "Lot more gonna fall like you!" -#define SOUND_KILL_TWO 12099 - -#define YELL_FIRE_BREATH "Fire kill you just as quick!" -#define SOUND_FIRE_BRETH 12096 - -#define YELL_AGGRO "Nobody badduh dan me!" -#define SOUND_AGGRO 12091 - -#define YELL_BERSERK "You too slow! Me too strong!" -#define SOUND_BERSERK 12097 - -#define YELL_DEATH "Mebbe me fall...but da Amani empire...never gonna die..." -#define SOUND_DEATH 12100 - -//Still not used, need more info -#define YELL_INTRO "Everybody always wanna take from us. Now we gonna start takin' back. Anybody who get in our way...gonna drown in their own blood! De Amani empire be back now...seekin' vengeance. And we gonna start...with you!" -#define SOUND_INTRO 12090 - -//Spells: -//====== Troll Form -#define SPELL_WHIRLWIND 17207 -#define SPELL_GRIEVOUS_THROW 43093 // remove debuff after full healed -//====== Bear Form -#define SPELL_CREEPING_PARALYSIS 43095 // should cast on the whole raid -#define SPELL_OVERPOWER 43456 // use after melee attack dodged -//====== Eagle Form -#define SPELL_ENERGY_STORM 43983 // enemy area aura, trigger 42577 -#define SPELL_ZAP_INFORM 42577 -#define SPELL_ZAP_DAMAGE 43137 // 1250 damage -#define SPELL_SUMMON_CYCLONE 43112 // summon four feather vortex -#define CREATURE_FEATHER_VORTEX 24136 -#define SPELL_CYCLONE_VISUAL 43119 // trigger 43147 visual -#define SPELL_CYCLONE_PASSIVE 43120 // trigger 43121 (4y aoe) every second -//Lynx Form -#define SPELL_CLAW_RAGE_HASTE 42583 -#define SPELL_CLAW_RAGE_TRIGGER 43149 -#define SPELL_CLAW_RAGE_DAMAGE 43150 -#define SPELL_LYNX_RUSH_HASTE 43152 -#define SPELL_LYNX_RUSH_DAMAGE 43153 -//Dragonhawk Form -#define SPELL_FLAME_WHIRL 43213 // trigger two spells -#define SPELL_FLAME_BREATH 43215 -#define SPELL_SUMMON_PILLAR 43216 // summon 24187 -#define CREATURE_COLUMN_OF_FIRE 24187 -#define SPELL_PILLAR_TRIGGER 43218 // trigger 43217 - -//cosmetic -#define SPELL_SPIRIT_AURA 42466 -#define SPELL_SIPHON_SOUL 43501 - -//Transforms: -#define SPELL_SHAPE_OF_THE_BEAR 42594 // 15% dmg -#define SPELL_SHAPE_OF_THE_EAGLE 42606 -#define SPELL_SHAPE_OF_THE_LYNX 42607 // haste melee 30% -#define SPELL_SHAPE_OF_THE_DRAGONHAWK 42608 - -#define SPELL_BERSERK 45078 - -#define PHASE_BEAR 0 -#define PHASE_EAGLE 1 -#define PHASE_LYNX 2 -#define PHASE_DRAGONHAWK 3 -#define PHASE_TROLL 4 +enum Phase +{ + PHASE_BEAR = 0, + PHASE_EAGLE = 1, + PHASE_LYNX = 2, + PHASE_DRAGONHAWK = 3, + PHASE_TROLL = 4 +}; //coords for going for changing form #define CENTER_X 120.148811f @@ -129,17 +111,16 @@ static SpiritInfoStruct SpiritInfo[4] = struct TransformStruct { - uint32 sound; - std::string text; + uint8 text; uint32 spell, unaura; }; static TransformStruct Transform[4] = { - {SOUND_TRANSFORM_TO_BEAR, YELL_TRANSFORM_TO_BEAR, SPELL_SHAPE_OF_THE_BEAR, SPELL_WHIRLWIND}, - {SOUND_TRANSFORM_TO_EAGLE, YELL_TRANSFORM_TO_EAGLE, SPELL_SHAPE_OF_THE_EAGLE, SPELL_SHAPE_OF_THE_BEAR}, - {SOUND_TRANSFORM_TO_LYNX, YELL_TRANSFORM_TO_LYNX, SPELL_SHAPE_OF_THE_LYNX, SPELL_SHAPE_OF_THE_EAGLE}, - {SOUND_TRANSFORM_TO_DRAGONHAWK, YELL_TRANSFORM_TO_DRAGONHAWK, SPELL_SHAPE_OF_THE_DRAGONHAWK, SPELL_SHAPE_OF_THE_LYNX} + {YELL_TRANSFORM_TO_BEAR, SPELL_SHAPE_OF_THE_BEAR, SPELL_WHIRLWIND}, + {YELL_TRANSFORM_TO_EAGLE, SPELL_SHAPE_OF_THE_EAGLE, SPELL_SHAPE_OF_THE_BEAR}, + {YELL_TRANSFORM_TO_LYNX, SPELL_SHAPE_OF_THE_LYNX, SPELL_SHAPE_OF_THE_EAGLE}, + {YELL_TRANSFORM_TO_DRAGONHAWK, SPELL_SHAPE_OF_THE_DRAGONHAWK, SPELL_SHAPE_OF_THE_LYNX} }; class boss_zuljin : public CreatureScript @@ -230,8 +211,7 @@ class boss_zuljin : public CreatureScript DoZoneInCombat(); - me->MonsterYell(YELL_INTRO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_INTRO); + Talk(YELL_INTRO); SpawnAdds(); EnterPhase(0); } @@ -241,17 +221,7 @@ class boss_zuljin : public CreatureScript if (Intro_Timer) return; - switch (urand(0, 1)) - { - case 0: - me->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_KILL_ONE); - break; - case 1: - me->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_KILL_TWO); - break; - } + Talk(YELL_KILL); } void JustDied(Unit* /*killer*/) @@ -259,8 +229,7 @@ class boss_zuljin : public CreatureScript if (instance) instance->SetData(DATA_ZULJINEVENT, DONE); - me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_DEATH); + Talk(YELL_DEATH); Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE); if (Unit* Temp = Unit::GetUnit(*me, SpiritGUID[3])) @@ -353,8 +322,7 @@ class boss_zuljin : public CreatureScript me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); me->RemoveAurasDueToSpell(Transform[Phase].unaura); DoCast(me, Transform[Phase].spell); - me->MonsterYell(Transform[Phase].text.c_str(), LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, Transform[Phase].sound); + Talk(Transform[Phase].text); if (Phase > 0) { if (Unit* Temp = Unit::GetUnit(*me, SpiritGUID[Phase - 1])) @@ -409,8 +377,7 @@ class boss_zuljin : public CreatureScript if (Berserk_Timer <= diff) { DoCast(me, SPELL_BERSERK, true); - me->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_BERSERK); + Talk(YELL_BERSERK); Berserk_Timer = 60000; } else Berserk_Timer -= diff; @@ -421,8 +388,7 @@ class boss_zuljin : public CreatureScript { if (Intro_Timer <= diff) { - me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(me, SOUND_AGGRO); + Talk(YELL_AGGRO); Intro_Timer = 0; } else Intro_Timer -= diff; } From a8374bd00187b8adb7a27b05348da9114f2a977f Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 18:39:30 -0330 Subject: [PATCH 16/30] Core/Scripting: Some cleanup --- .../SunkenTemple/instance_sunken_temple.cpp | 26 ++++++++++++------- .../ZulGurub/boss_wushoolay.cpp | 7 +++-- .../boss_watchkeeper_gargolmar.cpp | 2 +- .../botanica/boss_commander_sarannis.cpp | 2 +- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp index e28abc0fdcc..defe95c70a0 100644 --- a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp @@ -27,18 +27,24 @@ EndScriptData */ #include "InstanceScript.h" #include "sunken_temple.h" -#define GO_ATALAI_STATUE1 148830 -#define GO_ATALAI_STATUE2 148831 -#define GO_ATALAI_STATUE3 148832 -#define GO_ATALAI_STATUE4 148833 -#define GO_ATALAI_STATUE5 148834 -#define GO_ATALAI_STATUE6 148835 -#define GO_ATALAI_IDOL 148836 +enum Gameobject +{ + GO_ATALAI_STATUE1 = 148830, + GO_ATALAI_STATUE2 = 148831, + GO_ATALAI_STATUE3 = 148832, + GO_ATALAI_STATUE4 = 148833, + GO_ATALAI_STATUE5 = 148834, + GO_ATALAI_STATUE6 = 148835, + GO_ATALAI_IDOL = 148836, + GO_ATALAI_LIGHT1 = 148883, + GO_ATALAI_LIGHT2 = 148937 -#define GO_ATALAI_LIGHT1 148883 -#define GO_ATALAI_LIGHT2 148937 +}; -#define NPC_MALFURION_STORMRAGE 15362 +enum Creature +{ + NPC_MALFURION_STORMRAGE = 15362 +}; class instance_sunken_temple : public InstanceMapScript { diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp index 79528fa35ba..810ee5e900e 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_wushoolay.cpp @@ -27,8 +27,11 @@ EndScriptData */ #include "ScriptedCreature.h" #include "zulgurub.h" -#define SPELL_LIGHTNINGCLOUD 25033 -#define SPELL_LIGHTNINGWAVE 24819 +enum Spells +{ + SPELL_LIGHTNINGCLOUD = 25033, + SPELL_LIGHTNINGWAVE = 24819 +}; class boss_wushoolay : public CreatureScript { diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp index 1bd04abaa0f..7aae6cebff9 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp @@ -41,7 +41,7 @@ enum eSpells SPELL_MORTAL_WOUND = 30641, H_SPELL_MORTAL_WOUND = 36814, SPELL_SURGE = 34645, - SPELL_RETALIATION = 22857, + SPELL_RETALIATION = 22857 }; class boss_watchkeeper_gargolmar : public CreatureScript diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp index fe89925b6f9..20531f1f110 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_commander_sarannis.cpp @@ -38,7 +38,7 @@ enum Spells SPELL_SUMMON_REINFORCEMENTS = 34803 }; -enum +enum Events { EVENT_ARCANE_RESONANCE = 1, EVENT_ARCANE_DEVASTATION = 2 From 05e03e7634d257820d49e3d93aed4da374eee869 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 7 Jan 2013 23:09:34 +0100 Subject: [PATCH 17/30] SQL: Rename SQL merged in PR --- ...012_12_23_02_world_buru.sql => 2013_01_07_09_world_buru.sql} | 2 +- ...12_20_00_world_skeram.sql => 2013_01_07_10_world_skeram.sql} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename sql/updates/world/{2012_12_23_02_world_buru.sql => 2013_01_07_09_world_buru.sql} (97%) rename sql/updates/world/{2012_12_20_00_world_skeram.sql => 2013_01_07_10_world_skeram.sql} (100%) diff --git a/sql/updates/world/2012_12_23_02_world_buru.sql b/sql/updates/world/2013_01_07_09_world_buru.sql similarity index 97% rename from sql/updates/world/2012_12_23_02_world_buru.sql rename to sql/updates/world/2013_01_07_09_world_buru.sql index daab88f6cea..a7e1d5a0ef1 100644 --- a/sql/updates/world/2012_12_23_02_world_buru.sql +++ b/sql/updates/world/2013_01_07_09_world_buru.sql @@ -1,7 +1,7 @@ UPDATE `creature_template` SET ScriptName='npc_buru_egg' WHERE entry=15514; UPDATE `creature_template` SET `faction_A`=16,`faction_H`=16 WHERE `entry` IN (15514,15370); DELETE FROM `creature` WHERE `id`=15521; -- because **** you, thats why -SET @GUID :=xxx; -- Change me plz +SET @GUID :=61988; DELETE FROM `creature` WHERE `id`=15514; INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES (@GUID, 15514, 509, 1, 1, -9270.393, 1243.896, -63.76731, 2.722714, 7200, 0, 0), diff --git a/sql/updates/world/2012_12_20_00_world_skeram.sql b/sql/updates/world/2013_01_07_10_world_skeram.sql similarity index 100% rename from sql/updates/world/2012_12_20_00_world_skeram.sql rename to sql/updates/world/2013_01_07_10_world_skeram.sql From de3d507cc1e56c2de881d91f200b8499ef2fac21 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Tue, 8 Jan 2013 00:24:24 +0200 Subject: [PATCH 18/30] DB/SAI: Proper script for Snowfall Glade Pup SAI. --- sql/updates/world/2013_01_07_11_world_sai.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2013_01_07_11_world_sai.sql diff --git a/sql/updates/world/2013_01_07_11_world_sai.sql b/sql/updates/world/2013_01_07_11_world_sai.sql new file mode 100644 index 00000000000..bf4a1ed3c78 --- /dev/null +++ b/sql/updates/world/2013_01_07_11_world_sai.sql @@ -0,0 +1,9 @@ +-- Snowfall Glade Pup SAI +SET @ENTRY := 26200; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +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,1,8,0,100,0,39996,0,0,0,11,65208,2,0,0,0,0,1,0,0,0,0,0,0,0,"Snowfall Glade Pup - On Spellhit 40yd Dummy - Cast Self Stun"), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,11,46773,2,0,0,0,0,7,0,0,0,0,0,0,0,"Snowfall Glade Pup - On Spellhit 40yd Dummy - Cast Planning for the Future: Create Snowfall Glade Pup"), +(@ENTRY,0,2,0,61,0,100,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Snowfall Glade Pup - On Spellhit 40yd Dummy - Forced Despawn"); From 8f36383d3932c198c25dafce05275cdf29f6a7f5 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 7 Jan 2013 23:28:03 +0100 Subject: [PATCH 19/30] Core: Fix build --- ...{2012_01_05_00_world_sai.sql => 2013_01_07_12_world_sai.sql} | 0 .../EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename sql/updates/world/{2012_01_05_00_world_sai.sql => 2013_01_07_12_world_sai.sql} (100%) diff --git a/sql/updates/world/2012_01_05_00_world_sai.sql b/sql/updates/world/2013_01_07_12_world_sai.sql similarity index 100% rename from sql/updates/world/2012_01_05_00_world_sai.sql rename to sql/updates/world/2013_01_07_12_world_sai.sql diff --git a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp index defe95c70a0..ee0d9bb64f3 100644 --- a/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp +++ b/src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp @@ -41,7 +41,7 @@ enum Gameobject }; -enum Creature +enum CreatureIds { NPC_MALFURION_STORMRAGE = 15362 }; From 8c58184535600aeac2007945b837d0c7a5456afa Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 7 Jan 2013 23:40:20 +0100 Subject: [PATCH 20/30] Core: Fix non pch build --- src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index d32a19e4020..d5d36722618 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -18,6 +18,7 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" #include "temple_of_ahnqiraj.h" enum Yells From 5ce88118eee8cbb84a01b8db853bbb895b6a8f38 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 19:27:35 -0330 Subject: [PATCH 21/30] Core/Scripting: Move Text for Timmy the Cruel to creature text --- .../world/2013_01_07_13_world_creature_text.sql | 4 ++++ .../Stratholme/boss_timmy_the_cruel.cpp | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 sql/updates/world/2013_01_07_13_world_creature_text.sql diff --git a/sql/updates/world/2013_01_07_13_world_creature_text.sql b/sql/updates/world/2013_01_07_13_world_creature_text.sql new file mode 100644 index 00000000000..60d69e3c32a --- /dev/null +++ b/sql/updates/world/2013_01_07_13_world_creature_text.sql @@ -0,0 +1,4 @@ +-- Texts for Timmy the Cruel +DELETE FROM `creature_text` WHERE `entry`= 10808; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(10808,0,0, 'TIMMY!',14,0,100,0,0,0, 'Timmy the Cruel - Yell on Spawn'); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp index 8090c5a7d29..bd7c3519926 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_timmy_the_cruel.cpp @@ -26,9 +26,15 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" -#define SAY_SPAWN "TIMMY!" +enum Says +{ + SAY_SPAWN = 0 +}; -#define SPELL_RAVENOUSCLAW 17470 +enum Spells +{ + SPELL_RAVENOUSCLAW = 17470 +}; class boss_timmy_the_cruel : public CreatureScript { @@ -57,7 +63,7 @@ public: { if (!HasYelled) { - me->MonsterYell(SAY_SPAWN, LANG_UNIVERSAL, 0); + Talk(SAY_SPAWN); HasYelled = true; } } From 1c77eee9176cca37153c25757495ac738053db74 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 19:50:31 -0330 Subject: [PATCH 22/30] Core/Scripting: Move Text for Shirrak the Dead Watcher to creature text --- .../world/2013_01_07_14_world_creature_text.sql | 4 ++++ .../boss_shirrak_the_dead_watcher.cpp | 13 +++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 sql/updates/world/2013_01_07_14_world_creature_text.sql diff --git a/sql/updates/world/2013_01_07_14_world_creature_text.sql b/sql/updates/world/2013_01_07_14_world_creature_text.sql new file mode 100644 index 00000000000..d68eb93ff4e --- /dev/null +++ b/sql/updates/world/2013_01_07_14_world_creature_text.sql @@ -0,0 +1,4 @@ +-- Texts for Shirrak the Dead Watcher +DELETE FROM `creature_text` WHERE `entry`= 18371; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(18371,0,0, '%s focuses on $n!',41,0,100,0,0,0, 'Shirrak the Dead Watcher - Emote Focus'); diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index 1b0897f1d5e..8bb97fbe387 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -40,7 +40,10 @@ EndScriptData */ #define SPELL_FIERY_BLAST DUNGEON_MODE(N_SPELL_FIERY_BLAST, H_SPELL_FIERY_BLAST) #define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual -#define EMOTE_FOCUSES_ON "focuses on " +enum Emote +{ + EMOTE_FOCUSE = 0 +}; class boss_shirrak_the_dead_watcher : public CreatureScript { @@ -143,13 +146,7 @@ public: { FocusedTargetGUID = target->GetGUID(); me->SummonCreature(ENTRY_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 5500); - - // TODO: Find better way to handle emote - // Emote - std::string emote(EMOTE_FOCUSES_ON); - emote.append(target->GetName()); - emote.push_back('!'); - me->MonsterTextEmote(emote.c_str(), 0, true); + Talk(EMOTE_FOCUSE); } FocusFire_Timer = 15000+(rand()%5000); } else FocusFire_Timer -= diff; From c3134bc6cd8cb3f5554470f232f7330bf3c5b0f7 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Tue, 8 Jan 2013 00:45:44 +0100 Subject: [PATCH 23/30] DB/Creature: Remove ALOT of auras and creature_addon definitions, all these entries should be handled by SAI already, if not then SAI should be fixed --- .../2013_01_07_15_world_creature_addon.sql | 38 ++++++++ .../2013_01_07_16_world_creature_addon.sql | 96 +++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 sql/updates/world/2013_01_07_15_world_creature_addon.sql create mode 100644 sql/updates/world/2013_01_07_16_world_creature_addon.sql diff --git a/sql/updates/world/2013_01_07_15_world_creature_addon.sql b/sql/updates/world/2013_01_07_15_world_creature_addon.sql new file mode 100644 index 00000000000..2b5ec6c2413 --- /dev/null +++ b/sql/updates/world/2013_01_07_15_world_creature_addon.sql @@ -0,0 +1,38 @@ +DELETE FROM `creature_template_addon` WHERE `entry`IN (48,1027,1179,1708,3737,3749,3921,6221,7011,7396); +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +-- Removed Battle Stance Aura, it should be set via SAI, same for any fake mining emotes) +( 48,0,0,1114112,4097,0,''), -- Skeletal Warrior +(1027,0,0,1114112,4097,0,''), -- Bluegill Warrior +(1179,0,0,1114112,4097,0,''), -- Mogrosh Enforcer +(1708,0,0,1114112,4097,0,''), -- Defias Inmate +(3737,0,0,0,285216769,0,''), -- Saltspittle Puddlejumper +(3749,0,0,0,285216769,0,''), -- Foulweald Ursa +(3921,0,0,0,285216769,0,''), -- Thistlefur Ursa +(6221,0,0,1114112,4097,0,''), -- Addled Leper +(7011,0,0,1114112,4097,0,''), -- Earthen Rocksmasher +(7396,0,0,1114112,4097,0,''); -- Earthen Stonebreaker +-- Remove creature_addon templates in favor of general creature_template_addon ones, and possible SAI +DELETE FROM `creature_addon` WHERE `guid` IN ( +-- Skeletal Warrior +4914,5008,5968,5974,5984,5985,5986,5987,5988,5989,6005, +-- Bluegill Warrior +9543,9544,9545,9605,9607,9686,9690,9759,9788,9796,9823,10730,10925,10928,11055,11058, +-- Mogrosh Enforcer +8366,8789,9082,9211,9216,9217,9227,9376, +-- Defias Inmate +79082,79095,79097,79103,79106, +-- Saltspittle Puddlejumper +32919,32920,32921,32922,32923,32924,32925, +-- Foulweld Ursa +33080,33081,33082,33083, +-- Thistlefur Ursa +32440,32441,32442,32443,32445,32446,32447,32448, +-- Addled Leper +2446,2447,2448, +-- Earthen Rocksmasher +28369,28370,28371,28374,28376,28377,28532,28535,28536,28537,28538,28539,28541,28542,28543,28544,28546,28547,28784,28795,28796,28797,28798,28799,29384,29488,29573,29574, +-- Earthen Stonebreaker +27764,27766,27767,27770,27789,27790,27791,33505,33506,33507,33508); +-- Remove Battle Stance Aura as that should already be done via SAI: +UPDATE `creature_addon` SET `auras`='' WHERE `auras`='7165' AND `guid` IN (90212,32617,12218,2443); + diff --git a/sql/updates/world/2013_01_07_16_world_creature_addon.sql b/sql/updates/world/2013_01_07_16_world_creature_addon.sql new file mode 100644 index 00000000000..bd5c17c6f67 --- /dev/null +++ b/sql/updates/world/2013_01_07_16_world_creature_addon.sql @@ -0,0 +1,96 @@ +DELETE FROM `creature_addon` WHERE `guid` IN ( +-- --------------------------------------------------------------- +-- Lightning Shield (12550) +-- --------------------------------------------------------------- +-- Shadowpine Witch +81831,81833,81839,81842,81844,81896, +-- Deadwind Ogre Mage +3964,3980,3982,3994,3995,3996,3999,4038, +-- --------------------------------------------------------------- +-- Demon Armor (13787) +-- --------------------------------------------------------------- +-- Morganth +6268, + -- Shadowmoon Deathshaper +13234,13233,13232,13231,12891,12890, + -- Skeletal Guardian +52616,52620,52622,52643,52644,52647,52649,52650,52653,52683,52837,52852,52853,52934,52997,52998,52999,53000,53003,53005,53006,53007,53009,53010,53092,53093,53095, +-- --------------------------------------------------------------- +-- Chain Heal (1604) +-- --------------------------------------------------------------- +-- Crazed Mana-Wraith +126548,126552, +-- Scarlet Peasant +128784, +-- Scarlet Infantryman +129286,129287, +-- Flesh Behemoth +130392, +-- Marsh Fawn +133083, +-- --------------------------------------------------------------- +-- Stealth Detection (8279) +-- --------------------------------------------------------------- +-- Scarlet Sentinel +45391,45396,48219,48593,48617,48624,49992,51744,51745,52001,52245,52247,52510, +-- Eyeless Watcher +54277,56694,69687,69707,92177,92204,92518, +-- Unseen Servant +92527,92713, +-- --------------------------------------------------------------- +-- Retribution Aura (8990) +-- --------------------------------------------------------------- +-- Crimson Conjuror +54079,54082, +-- Crimson Gallant +54180,54201,54204,54205,54206,54207,54208,54219,54221,54222,54223,54224,54225,54227,54228,54229, +-- Crimson Battle Mage +54230,54231,54232,54233, +-- --------------------------------------------------------------- +-- Frost Armor (18100) +-- --------------------------------------------------------------- +-- Scarlet Archmage +54267,84783,84784,84963,86414,90955,92330,92436,92444,92452, +-- --------------------------------------------------------------- +-- Invisibility and Stealth Detection +-- --------------------------------------------------------------- +-- Ravaged Cadaver +52172,52171,52170,52169,52168,52167,52166,52165,52164,52163,52162,52161,52160,52159,52158,52157,52156,52155,52154,52153,52152,52173,52174,52175,52176,52177,52179,52180,52181,52182, +-- Mangled Cadaver +52183,52184,52185,52186,52187,52188,52189,52190,52191,52192,52193,52194,52195,52196,52197,52198,52199,52200,52201,52202,52203,52204,52205,52206,52207,52208,52209,52210,52211,52212,52213,52214,52215,52216,52217, +-- Ghoul Ravener +53678,53691,53692,53693,53694,53695,53696,53697,53698,53702,53706,53707,53708,53709,53715,53716,53726, +-- Fleshflayer Ghoul +53727,53728,53729,53761,53777,53778,53779,53780,53781,53782, +-- Bloodseeker Bat +49123,49124,49125,49127,49128,49139,49140,49143,49144,49145,49146,49150,49151,49156,49157,49158,49186,49187,49188,49190,49191,49192,51874,91548,91549,91551,91554, +-- Hooktooth Frenzy +49068,49069,49070,49071,49072,49073,49074,49075,49076,49722,49723,49724,49725,49727,49728,49730,49731,51443,51445,51446,51447,51449,51450,51963, +-- Ancient Core Hound +56675,56676,56742, +-- Embalming Slime +128103,128104,128105,128106,128107,128108,128109,128110,128111,128112,128113,128114,128115,128116,128117,128118, +-- Shade of Naxxramas +127755,127757, +-- Stoneskin Gargoyle +127776,127777,127778,127779,127780, +-- Argent Sentry +53857,53863,53864,53868,53869,53875,53895,53896,54751,54752,54753,54755,54756,54757,54758,68491,68500,68931,68963,69677,69679, +-- Aqueous Lord +12869,12868,12867,12866, +-- Amani'shi Guardian +86194,86204,86205,86239,86280,86307,86308,86906,86910,86914,89133,89134,89143,89165,89168,89170,89171,89192,89194,89195,89219,89220,89241,89243,89255,89331, +-- Amani'shi Savage +85580,86132,86162,86913,86915,86916,86918,86920, +-- Amani'shi Handler +86923,86927,89136,89138,89142,89174,89199, +-- Amani'shi Wind Walker +89207,86210, +-- Mage Slayer +126474,126475,126476,126477,126478,126479, +-- Savage Worg +125993,125994,125995,125996,125997,125998, +-- Vigilant Shade +128065); + + From 70977f30977316f14500561796b0276f40fcb1b6 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 20:18:47 -0330 Subject: [PATCH 24/30] Core/Scripting: Misc fixes --- .../ZulGurub/boss_renataki.cpp | 12 +++- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 55 ++++++++++--------- .../RubySanctum/boss_saviana_ragefire.cpp | 32 +++++------ .../boss_shirrak_the_dead_watcher.cpp | 4 +- .../underbog/boss_the_black_stalker.cpp | 22 +++++--- 5 files changed, 71 insertions(+), 54 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp index 87081b07e9d..d562b7cdf9b 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_renataki.cpp @@ -27,10 +27,16 @@ EndScriptData */ #include "ScriptedCreature.h" #include "zulgurub.h" -#define SPELL_AMBUSH 24337 -#define SPELL_THOUSANDBLADES 24649 +enum Spells +{ + SPELL_AMBUSH = 34794, + SPELL_THOUSANDBLADES = 34799 +}; -#define EQUIP_ID_MAIN_HAND 0 //was item display id 31818, but this id does not exist +enum Misc +{ + EQUIP_ID_MAIN_HAND = 0 //was item display id 31818, but this id does not exist +}; class boss_renataki : public CreatureScript { 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 +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 SPELL_EXPLODEBUG 804 -#define SPELL_MUTATE_BUG 802 +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 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 +enum Misc +{ + PULL_RANGE = 50, + ABUSE_BUG_RANGE = 20, + VEKLOR_DIST = 20, // VL will not come to melee when attacking + TELEPORTTIME = 30000 +}; -#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 -#define PULL_RANGE 50 -#define ABUSE_BUG_RANGE 20 -#define SPELL_BERSERK 26662 -#define TELEPORTTIME 30000 - -#define SPELL_UPPERCUT 26007 -#define SPELL_UNBALANCING_STRIKE 26613 - -#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/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp index 463a1a6c2e3..06743858ec0 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -21,10 +21,10 @@ enum Texts { - SAY_AGGRO = 0, // You will sssuffer for this intrusion! (17528) - SAY_CONFLAGRATION = 1, // Burn in the master's flame! (17532) - EMOTE_ENRAGED = 2, // %s becomes enraged! - SAY_KILL = 3, // Halion will be pleased. (17530) - As it should be.... (17529) + SAY_AGGRO = 0, // You will sssuffer for this intrusion! (17528) + SAY_CONFLAGRATION = 1, // Burn in the master's flame! (17532) + EMOTE_ENRAGED = 2, // %s becomes enraged! + SAY_KILL = 3, // Halion will be pleased. (17530) - As it should be.... (17529) }; enum Spells @@ -38,28 +38,28 @@ enum Spells enum Events { - EVENT_ENRAGE = 1, - EVENT_FLIGHT = 2, - EVENT_FLAME_BREATH = 3, - EVENT_CONFLAGRATION = 4, - EVENT_LAND_GROUND = 5, - EVENT_AIR_MOVEMENT = 6, + EVENT_ENRAGE = 1, + EVENT_FLIGHT = 2, + EVENT_FLAME_BREATH = 3, + EVENT_CONFLAGRATION = 4, + EVENT_LAND_GROUND = 5, + EVENT_AIR_MOVEMENT = 6, // Event group - EVENT_GROUP_LAND_PHASE = 1, + EVENT_GROUP_LAND_PHASE = 1, }; enum MovementPoints { - POINT_FLIGHT = 1, - POINT_LAND = 2, - POINT_TAKEOFF = 3, - POINT_LAND_GROUND = 4 + POINT_FLIGHT = 1, + POINT_LAND = 2, + POINT_TAKEOFF = 3, + POINT_LAND_GROUND = 4 }; enum Misc { - SOUND_ID_DEATH = 17531, + SOUND_ID_DEATH = 17531, }; Position const SavianaRagefireFlyOutPos = {3155.51f, 683.844f, 95.0f, 4.69f}; diff --git a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index 8bb97fbe387..edaff280937 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -40,7 +40,7 @@ EndScriptData */ #define SPELL_FIERY_BLAST DUNGEON_MODE(N_SPELL_FIERY_BLAST, H_SPELL_FIERY_BLAST) #define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual -enum Emote +enum Say { EMOTE_FOCUSE = 0 }; @@ -146,7 +146,7 @@ public: { FocusedTargetGUID = target->GetGUID(); me->SummonCreature(ENTRY_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 5500); - Talk(EMOTE_FOCUSE); + Talk(EMOTE_FOCUSE, FocusedTargetGUID); } FocusFire_Timer = 15000+(rand()%5000); } else FocusFire_Timer -= diff; diff --git a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp index c7f378ce2fe..1e8fd8b2676 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp @@ -26,15 +26,21 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" -#define SPELL_LEVITATE 31704 -#define SPELL_SUSPENSION 31719 -#define SPELL_LEVITATION_PULSE 31701 -#define SPELL_MAGNETIC_PULL 31705 -#define SPELL_CHAIN_LIGHTNING 31717 -#define SPELL_STATIC_CHARGE 31715 -#define SPELL_SUMMON_SPORE_STRIDER 38755 +enum Spells +{ + SPELL_LEVITATE = 31704, + SPELL_SUSPENSION = 31719, + SPELL_LEVITATION_PULSE = 31701, + SPELL_MAGNETIC_PULL = 31705, + SPELL_CHAIN_LIGHTNING = 31717, + SPELL_STATIC_CHARGE = 31715, + SPELL_SUMMON_SPORE_STRIDER = 38755 +}; -#define ENTRY_SPORE_STRIDER 22299 +enum CreatureIdS +{ + ENTRY_SPORE_STRIDER = 22299 +}; class boss_the_black_stalker : public CreatureScript { From 0105bc849fd062d2a8a8110e6c3cfefb70da0e16 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 21:47:38 -0330 Subject: [PATCH 25/30] Core/Scripting: Misc clean up and a warning fix --- .../boss_pyroguard_emberseer.cpp | 6 +-- .../boss_quartermaster_zigris.cpp | 4 +- .../Karazhan/boss_prince_malchezaar.cpp | 6 +-- .../MoltenCore/boss_ragnaros.cpp | 48 +++++++++---------- .../Scholomance/boss_ras_frostwhisper.cpp | 15 +++--- .../Stratholme/boss_ramstein_the_gorger.cpp | 14 ++++-- .../boss_rage_winterchill.cpp | 12 ++--- .../Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp | 20 ++++---- .../Ahnkahet/boss_prince_taldaram.cpp | 2 +- .../boss_professor_putricide.cpp | 12 ++--- 10 files changed, 74 insertions(+), 65 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp index be20e3d7dac..047ad3f7096 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_pyroguard_emberseer.cpp @@ -25,7 +25,7 @@ enum Text EMOTE_ONE_STACK = 0, EMOTE_TEN_STACK = 1, EMOTE_FREE_OF_BONDS = 2, - YELL_FREE_OF_BONDS = 3, + YELL_FREE_OF_BONDS = 3 }; enum Spells @@ -37,14 +37,14 @@ enum Spells SPELL_EMBERSEER_FULL_STRENGTH = 16047, // Emberseer Full Strength SPELL_FIRENOVA = 23462, // Combat SPELL_FLAMEBUFFET = 23341, // Combat - SPELL_PYROBLAST = 17274, // Combat + SPELL_PYROBLAST = 17274 // Combat }; enum Events { EVENT_FIRENOVA = 1, EVENT_FLAMEBUFFET = 2, - EVENT_PYROBLAST = 3, + EVENT_PYROBLAST = 3 }; diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp index 94764c94dcf..2f86c009d56 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_quartermaster_zigris.cpp @@ -25,13 +25,13 @@ enum Spells SPELL_SHOOT = 16496, SPELL_STUNBOMB = 16497, SPELL_HEALING_POTION = 15504, - SPELL_HOOKEDNET = 15609, + SPELL_HOOKEDNET = 15609 }; enum Events { EVENT_SHOOT = 1, - EVENT_STUN_BOMB = 2, + EVENT_STUN_BOMB = 2 }; class quartermaster_zigris : public CreatureScript diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 8fb86183428..3a026d23faa 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -88,12 +88,12 @@ enum PrinceMalchezaar SPELL_CLEAVE = 30131, //Same as Nightbane. SPELL_HELLFIRE = 30859, //Infenals' hellfire aura NETHERSPITE_INFERNAL = 17646, //The netherspite infernal creature - MALCHEZARS_AXE = 17650, //Malchezar's axes (creatures), summoned during phase 3 + MALCHEZARS_AXE = 17650, //Malchezar's axes (creatures), summoned during phase 3 - INFERNAL_MODEL_INVISIBLE = 11686, //Infernal Effects + INFERNAL_MODEL_INVISIBLE = 11686, //Infernal Effects SPELL_INFERNAL_RELAY = 30834, - EQUIP_ID_AXE = 33542, //Axes info + EQUIP_ID_AXE = 33542 //Axes info }; //---------Infernal code first diff --git a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp index a8d54f5f186..eecd9ae65f4 100644 --- a/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/MoltenCore/boss_ragnaros.cpp @@ -29,17 +29,17 @@ EndScriptData */ enum Texts { - SAY_SUMMON_MAJ = 0, - SAY_ARRIVAL1_RAG = 1, - SAY_ARRIVAL2_MAJ = 2, - SAY_ARRIVAL3_RAG = 3, - SAY_ARRIVAL5_RAG = 4, - SAY_REINFORCEMENTS1 = 5, - SAY_REINFORCEMENTS2 = 6, - SAY_HAND = 7, - SAY_WRATH = 8, - SAY_KILL = 9, - SAY_MAGMABURST = 10 + SAY_SUMMON_MAJ = 0, + SAY_ARRIVAL1_RAG = 1, + SAY_ARRIVAL2_MAJ = 2, + SAY_ARRIVAL3_RAG = 3, + SAY_ARRIVAL5_RAG = 4, + SAY_REINFORCEMENTS1 = 5, + SAY_REINFORCEMENTS2 = 6, + SAY_HAND = 7, + SAY_WRATH = 8, + SAY_KILL = 9, + SAY_MAGMABURST = 10 }; enum Spells @@ -53,24 +53,24 @@ enum Spells SPELL_RAGEMERGE = 20568, SPELL_MELT_WEAPON = 21388, SPELL_ELEMENTAL_FIRE = 20564, - SPELL_ERRUPTION = 17731, + SPELL_ERRUPTION = 17731 }; enum Events { - EVENT_ERUPTION = 1, - EVENT_WRATH_OF_RAGNAROS = 2, - EVENT_HAND_OF_RAGNAROS = 3, - EVENT_LAVA_BURST = 4, - EVENT_ELEMENTAL_FIRE = 5, - EVENT_MAGMA_BLAST = 6, - EVENT_SUBMERGE = 7, + EVENT_ERUPTION = 1, + EVENT_WRATH_OF_RAGNAROS = 2, + EVENT_HAND_OF_RAGNAROS = 3, + EVENT_LAVA_BURST = 4, + EVENT_ELEMENTAL_FIRE = 5, + EVENT_MAGMA_BLAST = 6, + EVENT_SUBMERGE = 7, - EVENT_INTRO_1 = 8, - EVENT_INTRO_2 = 9, - EVENT_INTRO_3 = 10, - EVENT_INTRO_4 = 11, - EVENT_INTRO_5 = 12, + EVENT_INTRO_1 = 8, + EVENT_INTRO_2 = 9, + EVENT_INTRO_3 = 10, + EVENT_INTRO_4 = 11, + EVENT_INTRO_5 = 12 }; class boss_ragnaros : public CreatureScript diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp index 40e0d3630d3..99f01ee96c3 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp @@ -26,12 +26,15 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" -#define SPELL_FROSTBOLT 21369 -#define SPELL_ICEARMOR 18100 //This is actually a buff he gives himself -#define SPELL_FREEZE 18763 -#define SPELL_FEAR 26070 -#define SPELL_CHILLNOVA 18099 -#define SPELL_FROSTVOLLEY 8398 +enum Spells +{ + SPELL_FROSTBOLT = 21369, + SPELL_ICEARMOR = 18100, // This is actually a buff he gives himself + SPELL_FREEZE = 18763, + SPELL_FEAR = 26070, + SPELL_CHILLNOVA = 18099, + SPELL_FROSTVOLLEY = 8398 +}; class boss_boss_ras_frostwhisper : public CreatureScript { diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp index 2af6a4d0f93..6d83093d13c 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_ramstein_the_gorger.cpp @@ -27,10 +27,16 @@ EndScriptData */ #include "ScriptedCreature.h" #include "stratholme.h" -#define SPELL_TRAMPLE 5568 -#define SPELL_KNOCKOUT 17307 +enum Spells +{ + SPELL_TRAMPLE = 5568, + SPELL_KNOCKOUT = 17307 +}; - #define C_MINDLESS_UNDEAD 11030 +enum CreatureId +{ + NPC_MINDLESS_UNDEAD = 11030 +}; class boss_ramstein_the_gorger : public CreatureScript { @@ -68,7 +74,7 @@ public: { for (uint8 i = 0; i < 30; ++i) { - if (Creature* mob = me->SummonCreature(C_MINDLESS_UNDEAD, 3969.35f+irand(-10, 10), -3391.87f+irand(-10, 10), 119.11f, 5.91f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000)) + if (Creature* mob = me->SummonCreature(NPC_MINDLESS_UNDEAD, 3969.35f+irand(-10, 10), -3391.87f+irand(-10, 10), 119.11f, 5.91f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000)) mob->AI()->AttackStart(me->SelectNearestTarget(100.0f)); } 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/TempleOfAhnQiraj/boss_skeram.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp index d5d36722618..1186459218c 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_skeram.cpp @@ -26,7 +26,7 @@ enum Yells SAY_AGGRO = 0, SAY_SLAY = 1, SAY_SPLIT = 2, - SAY_DEATH = 3, + SAY_DEATH = 3 }; enum Spells @@ -79,20 +79,20 @@ class boss_skeram : public CreatureScript void JustSummoned(Creature* creature) { // Shift the boss and images (Get it? *Shift*?) - uint8 Rand; + uint8 rand = 0; if (_flag != 0) { - while (_flag & (1 << Rand)) - Rand = urand(0, 2); - DoCast(me, BlinkSpells[Rand]); - _flag |= (1 << Rand); + while (_flag & (1 << rand)) + rand = urand(0, 2); + DoCast(me, BlinkSpells[rand]); + _flag |= (1 << rand); _flag |= (1 << 7); } - while (_flag & (1 << Rand)) - Rand = urand(0, 2); - creature->CastSpell(creature, BlinkSpells[Rand]); - _flag |= (1 << Rand); + while (_flag & (1 << rand)) + rand = urand(0, 2); + creature->CastSpell(creature, BlinkSpells[rand]); + _flag |= (1 << rand); if (_flag & (1 << 7)) _flag = 0; diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 0208edebef5..8f77cc7ec6f 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -57,7 +57,7 @@ enum Yells SAY_SLAY = 3, SAY_DEATH = 4, SAY_FEED = 5, - SAY_VANISH = 6, + SAY_VANISH = 6 }; enum CombatPhase { diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 95830916abd..05bf7b9794a 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -25,7 +25,7 @@ #include "Vehicle.h" #include "GridNotifiers.h" -enum ScriptTexts +enum Say { // Festergut SAY_FESTERGUT_GASEOUS_BLIGHT = 0, @@ -45,7 +45,7 @@ enum ScriptTexts EMOTE_CHOKING_GAS_BOMB = 10, SAY_KILL = 11, SAY_BERSERK = 12, - SAY_DEATH = 13, + SAY_DEATH = 13 }; enum Spells @@ -135,7 +135,7 @@ enum Events EVENT_CHOKING_GAS_BOMB = 12, EVENT_UNBOUND_PLAGUE = 13, EVENT_MUTATED_PLAGUE = 14, - EVENT_PHASE_TRANSITION = 15, + EVENT_PHASE_TRANSITION = 15 }; enum Phases @@ -148,14 +148,14 @@ enum Phases PHASE_COMBAT_3 = 6, PHASE_MASK_COMBAT = (1 << PHASE_COMBAT_1) | (1 << PHASE_COMBAT_2) | (1 << PHASE_COMBAT_3), - PHASE_MASK_NOT_SELF = (1 << PHASE_FESTERGUT) | (1 << PHASE_ROTFACE), + PHASE_MASK_NOT_SELF = (1 << PHASE_FESTERGUT) | (1 << PHASE_ROTFACE) }; enum Points { POINT_FESTERGUT = 366260, POINT_ROTFACE = 366270, - POINT_TABLE = 366780, + POINT_TABLE = 366780 }; Position const festergutWatchPos = {4324.820f, 3166.03f, 389.3831f, 3.316126f}; //emote 432 (release gas) @@ -169,7 +169,7 @@ enum PutricideData { DATA_EXPERIMENT_STAGE = 1, DATA_PHASE = 2, - DATA_ABOMINATION = 3, + DATA_ABOMINATION = 3 }; #define EXPERIMENT_STATE_OOZE false From 022604868683c88971fc27d5bbef49f6ba53d653 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 22:13:04 -0330 Subject: [PATCH 26/30] Core/Scripting: Update Script for Postmaster Malown --- .../2013_01_07_17_world_creature_text.sql | 4 + .../Stratholme/boss_postmaster_malown.cpp | 194 ++++++++---------- .../Stratholme/instance_stratholme.cpp | 50 ++--- .../EasternKingdoms/Stratholme/stratholme.h | 73 +++++-- 4 files changed, 167 insertions(+), 154 deletions(-) create mode 100644 sql/updates/world/2013_01_07_17_world_creature_text.sql diff --git a/sql/updates/world/2013_01_07_17_world_creature_text.sql b/sql/updates/world/2013_01_07_17_world_creature_text.sql new file mode 100644 index 00000000000..137308da214 --- /dev/null +++ b/sql/updates/world/2013_01_07_17_world_creature_text.sql @@ -0,0 +1,4 @@ +-- Texts for Postmaster Malown +DELETE FROM `creature_text` WHERE `entry`= 11143; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(11143,0,0, 'You just got MALOWNED!',14,0,100,0,0,0, 'Postmaster Malown - Yell on Kill'); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp index 6445019e5c8..5b0b39c1de2 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_postmaster_malown.cpp @@ -25,123 +25,109 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "stratholme.h" //Spell ID to summon this guy is 24627 "Summon Postmaster Malown" //He should be spawned along with three other elites once the third postbox has been opened -#define SAY_MALOWNED "You just got MALOWNED!" +enum Says +{ + SAY_KILL = 0 +}; -#define SPELL_WAILINGDEAD 7713 -#define SPELL_BACKHAND 6253 -#define SPELL_CURSEOFWEAKNESS 8552 -#define SPELL_CURSEOFTONGUES 12889 -#define SPELL_CALLOFTHEGRAVE 17831 +enum Spells +{ + SPELL_WAILINGDEAD = 7713, + SPELL_BACKHAND = 6253, + SPELL_CURSEOFWEAKNESS = 8552, + SPELL_CURSEOFTONGUES = 12889, + SPELL_CALLOFTHEGRAVE = 17831 +}; + +enum Events +{ + EVENT_WAILINGDEAD = 1, + EVENT_BACKHAND = 2, + EVENT_CURSEOFWEAKNESS = 3, + EVENT_CURSEOFTONGUES = 4, + EVENT_CALLOFTHEGRAVE = 5 +}; class boss_postmaster_malown : public CreatureScript { -public: - boss_postmaster_malown() : CreatureScript("boss_postmaster_malown") { } + public: boss_postmaster_malown() : CreatureScript("boss_postmaster_malown") { } - CreatureAI* GetAI(Creature* creature) const - { - return new boss_postmaster_malownAI (creature); - } - - struct boss_postmaster_malownAI : public ScriptedAI - { - boss_postmaster_malownAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 WailingDead_Timer; - uint32 Backhand_Timer; - uint32 CurseOfWeakness_Timer; - uint32 CurseOfTongues_Timer; - uint32 CallOfTheGrave_Timer; - bool HasYelled; - - void Reset() + struct boss_postmaster_malownAI : public BossAI { - WailingDead_Timer = 19000; //lasts 6 sec - Backhand_Timer = 8000; //2 sec stun - CurseOfWeakness_Timer = 20000; //lasts 2 mins - CurseOfTongues_Timer = 22000; - CallOfTheGrave_Timer = 25000; - HasYelled = false; - } + boss_postmaster_malownAI(Creature* creature) : BossAI(creature, TYPE_MALOWN) {} - void EnterCombat(Unit* /*who*/) + void Reset() {} + + void EnterCombat(Unit* /*who*/) + { + events.ScheduleEvent(EVENT_WAILINGDEAD, 19000); // lasts 6 sec + events.ScheduleEvent(EVENT_BACKHAND, 8000); // 2 sec stun + events.ScheduleEvent(EVENT_CURSEOFWEAKNESS, 20000); // lasts 2 mins + events.ScheduleEvent(EVENT_CURSEOFTONGUES, 22000); + events.ScheduleEvent(EVENT_CALLOFTHEGRAVE, 25000); + } + + void KilledUnit(Unit* /*victim*/) + { + Talk(SAY_KILL); + } + + 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_WAILINGDEAD: + if (rand()%100 < 65) //65% chance to cast + DoCastVictim(SPELL_WAILINGDEAD, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 19000); + break; + case EVENT_BACKHAND: + if (rand()%100 < 45) //45% chance to cast + DoCastVictim(SPELL_BACKHAND, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 8000); + break; + case EVENT_CURSEOFWEAKNESS: + if (rand()%100 < 3) //3% chance to cast + DoCastVictim(SPELL_CURSEOFWEAKNESS, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 20000); + break; + case EVENT_CURSEOFTONGUES: + if (rand()%100 < 3) //3% chance to cast + DoCastVictim(SPELL_CURSEOFTONGUES, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 22000); + break; + case EVENT_CALLOFTHEGRAVE: + if (rand()%100 < 5) //5% chance to cast + DoCastVictim(SPELL_CALLOFTHEGRAVE, true); + events.ScheduleEvent(EVENT_WAILINGDEAD, 25000); + break; + default: + break; + } + } + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const { + return new boss_postmaster_malownAI(creature); } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //WailingDead - if (WailingDead_Timer <= diff) - { - //Cast - if (rand()%100 < 65) //65% chance to cast - { - DoCast(me->getVictim(), SPELL_WAILINGDEAD); - } - //19 seconds until we should cast this again - WailingDead_Timer = 19000; - } else WailingDead_Timer -= diff; - - //Backhand - if (Backhand_Timer <= diff) - { - //Cast - if (rand()%100 < 45) //45% chance to cast - { - DoCast(me->getVictim(), SPELL_BACKHAND); - } - //8 seconds until we should cast this again - Backhand_Timer = 8000; - } else Backhand_Timer -= diff; - - //CurseOfWeakness - if (CurseOfWeakness_Timer <= diff) - { - //Cast - if (rand()%100 < 3) //3% chance to cast - { - DoCast(me->getVictim(), SPELL_CURSEOFWEAKNESS); - } - //20 seconds until we should cast this again - CurseOfWeakness_Timer = 20000; - } else CurseOfWeakness_Timer -= diff; - - //CurseOfTongues - if (CurseOfTongues_Timer <= diff) - { - //Cast - if (rand()%100 < 3) //3% chance to cast - { - DoCast(me->getVictim(), SPELL_CURSEOFTONGUES); - } - //22 seconds until we should cast this again - CurseOfTongues_Timer = 22000; - } else CurseOfTongues_Timer -= diff; - - //CallOfTheGrave - if (CallOfTheGrave_Timer <= diff) - { - //Cast - if (rand()%100 < 5) //5% chance to cast - { - DoCast(me->getVictim(), SPELL_CALLOFTHEGRAVE); - } - //25 seconds until we should cast this again - CallOfTheGrave_Timer = 25000; - } else CallOfTheGrave_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - }; void AddSC_boss_postmaster_malown() diff --git a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp index 38613385161..c3244c63de6 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/instance_stratholme.cpp @@ -29,33 +29,15 @@ EndScriptData */ #include "stratholme.h" #include "Player.h" -#define GO_SERVICE_ENTRANCE 175368 -#define GO_GAUNTLET_GATE1 175357 -#define GO_ZIGGURAT1 175380 //baroness -#define GO_ZIGGURAT2 175379 //nerub'enkan -#define GO_ZIGGURAT3 175381 //maleki -#define GO_ZIGGURAT4 175405 //rammstein -#define GO_ZIGGURAT5 175796 //baron -#define GO_PORT_GAUNTLET 175374 //port from gauntlet to slaugther -#define GO_PORT_SLAUGTHER 175373 //port at slaugther -#define GO_PORT_ELDERS 175377 //port at elders square - -#define C_CRYSTAL 10415 //three ziggurat crystals -#define C_BARON 10440 -#define C_YSIDA_TRIGGER 16100 - -#define C_RAMSTEIN 10439 -#define C_ABOM_BILE 10416 -#define C_ABOM_VENOM 10417 -#define C_BLACK_GUARD 10394 -#define C_YSIDA 16031 - -#define MAX_ENCOUNTER 6 +enum Misc +{ + MAX_ENCOUNTER = 6 +}; enum InstanceEvents { EVENT_BARON_RUN = 1, - EVENT_SLAUGHTER_SQUARE = 2, + EVENT_SLAUGHTER_SQUARE = 2 }; class instance_stratholme : public InstanceMapScript @@ -148,17 +130,17 @@ class instance_stratholme : public InstanceMapScript { switch (creature->GetEntry()) { - case C_BARON: + case NPC_BARON: baronGUID = creature->GetGUID(); break; - case C_YSIDA_TRIGGER: + case NPC_YSIDA_TRIGGER: ysidaTriggerGUID = creature->GetGUID(); break; - case C_CRYSTAL: + case NPC_CRYSTAL: crystalsGUID.insert(creature->GetGUID()); break; - case C_ABOM_BILE: - case C_ABOM_VENOM: + case NPC_ABOM_BILE: + case NPC_ABOM_VENOM: abomnationGUID.insert(creature->GetGUID()); break; } @@ -168,11 +150,11 @@ class instance_stratholme : public InstanceMapScript { switch (creature->GetEntry()) { - case C_CRYSTAL: + case NPC_CRYSTAL: crystalsGUID.erase(creature->GetGUID()); break; - case C_ABOM_BILE: - case C_ABOM_VENOM: + case NPC_ABOM_BILE: + case NPC_ABOM_VENOM: abomnationGUID.erase(creature->GetGUID()); break; } @@ -255,7 +237,7 @@ class instance_stratholme : public InstanceMapScript { Position ysidaPos; ysidaTrigger->GetPosition(&ysidaPos); - ysidaTrigger->SummonCreature(C_YSIDA, ysidaPos, TEMPSUMMON_TIMED_DESPAWN, 1800000); + ysidaTrigger->SummonCreature(NPC_YSIDA, ysidaPos, TEMPSUMMON_TIMED_DESPAWN, 1800000); } events.CancelEvent(EVENT_BARON_RUN); break; @@ -300,7 +282,7 @@ class instance_stratholme : public InstanceMapScript //a bit itchy, it should close the door after 10 secs, but it doesn't. skipping it for now. //UpdateGoState(ziggurat4GUID, 0, true); if (Creature* pBaron = instance->GetCreature(baronGUID)) - pBaron->SummonCreature(C_RAMSTEIN, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); + pBaron->SummonCreature(NPC_RAMSTEIN, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); sLog->outDebug(LOG_FILTER_TSCR, "Instance Stratholme: Ramstein spawned."); } else @@ -455,7 +437,7 @@ class instance_stratholme : public InstanceMapScript if (Creature* baron = instance->GetCreature(baronGUID)) { for (uint8 i = 0; i < 4; ++i) - baron->SummonCreature(C_BLACK_GUARD, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); + baron->SummonCreature(NPC_BLACK_GUARD, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); HandleGameObject(ziggurat4GUID, true); HandleGameObject(ziggurat5GUID, true); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h index d141f94ddf0..fc7630d7403 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.h @@ -19,24 +19,65 @@ #ifndef DEF_STRATHOLME_H #define DEF_STRATHOLME_H -#define TYPE_BARON_RUN 1 -#define TYPE_BARONESS 2 -#define TYPE_NERUB 3 -#define TYPE_PALLID 4 -#define TYPE_RAMSTEIN 5 -#define TYPE_BARON 6 +enum DataTypes +{ + TYPE_BARON_RUN = 1, + TYPE_BARONESS = 2, + TYPE_NERUB = 3, + TYPE_PALLID = 4, + TYPE_RAMSTEIN = 5, + TYPE_BARON = 6, -#define DATA_BARON 10 -#define DATA_YSIDA_TRIGGER 11 + TYPE_MALOWN = 7, -#define TYPE_SH_QUEST 20 -#define TYPE_SH_CATHELA 21 -#define TYPE_SH_GREGOR 22 -#define TYPE_SH_NEMAS 23 -#define TYPE_SH_VICAR 24 -#define TYPE_SH_AELMAR 25 + DATA_BARON = 10, + DATA_YSIDA_TRIGGER = 11, + + TYPE_SH_QUEST = 20, + TYPE_SH_CATHELA = 21, + TYPE_SH_GREGOR = 22, + TYPE_SH_NEMAS = 23, + TYPE_SH_VICAR = 24, + TYPE_SH_AELMAR = 25 +}; + +enum CreatureIds +{ + NPC_CRYSTAL = 10415, // ziggurat crystal + NPC_BARON = 10440, // ziggurat crystal + NPC_YSIDA_TRIGGER = 16100, // ziggurat crystal + + NPC_RAMSTEIN = 10439, + NPC_ABOM_BILE = 10416, + NPC_ABOM_VENOM = 10417, + NPC_BLACK_GUARD = 10394, + NPC_YSIDA = 16031, +}; + +enum GameobjectIds +{ + GO_DOOR_HALAZZI = 186303, + GO_SERVICE_ENTRANCE = 175368, + GO_GAUNTLET_GATE1 = 175357, + GO_ZIGGURAT1 = 175380, // baroness + GO_ZIGGURAT2 = 175379, // nerub'enkan + GO_ZIGGURAT3 = 175381, // maleki + GO_ZIGGURAT4 = 175405, // rammstein + GO_ZIGGURAT5 = 175796, // baron + GO_PORT_GAUNTLET = 175374, // port from gauntlet to slaugther + GO_PORT_SLAUGTHER = 175373, // port at slaugther + GO_PORT_ELDERS = 175377 // port at elders square +}; + +enum QuestIds +{ + QUEST_DEAD_MAN_PLEA = 8945 +}; + +enum SpellIds +{ + SPELL_BARON_ULTIMATUM = 27861 +}; -#define QUEST_DEAD_MAN_PLEA 8945 -#define SPELL_BARON_ULTIMATUM 27861 #endif From 2a9fc5198b69157a048101b7bf234492bd870260 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 22:44:09 -0330 Subject: [PATCH 27/30] Core/Scripting: Move Nightbane text to creature text --- .../2013_01_07_18_world_creature_text.sql | 9 ++++ .../Karazhan/boss_nightbane.cpp | 49 ++++++++++--------- 2 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 sql/updates/world/2013_01_07_18_world_creature_text.sql diff --git a/sql/updates/world/2013_01_07_18_world_creature_text.sql b/sql/updates/world/2013_01_07_18_world_creature_text.sql new file mode 100644 index 00000000000..b9c6ef8d0c1 --- /dev/null +++ b/sql/updates/world/2013_01_07_18_world_creature_text.sql @@ -0,0 +1,9 @@ +-- Texts for Nightbane +DELETE FROM `creature_text` WHERE `entry`= 17225; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17225,0,0, 'An ancient being awakens in the distance...',16,0,100,0,0,0, 'Nightbane - EMOTE_SUMMON'), +(17225,1,0, 'What fools! I shall bring a quick end to your suffering!',14,0,100,0,0,0, 'Nightbane - YELL_AGGRO'), +(17225,2,0, 'Miserable vermin. I shall exterminate you from the air!',14,0,100,0,0,0, 'Nightbane - YELL_FLY_PHASE'), +(17225,3,0, 'Enough! I shall land and crush you myself!',14,0,100,0,0,0, 'Nightbane - YELL_LAND_PHASE'), +(17225,3,1, 'Insects! Let me show you my strength up close!',14,0,100,0,0,0, 'Nightbane - YELL_LAND_PHASE'), +(17225,4,0, 'takes a deep breath.',16,0,100,0,0,0, 'Nightbane - EMOTE_BREATH'); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index a60d151f2d8..6d9a1f98e93 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -27,25 +27,30 @@ EndScriptData */ #include "ScriptedCreature.h" #include "karazhan.h" -//phase 1 -#define SPELL_BELLOWING_ROAR 39427 -#define SPELL_CHARRED_EARTH 30129 -#define SPELL_DISTRACTING_ASH 30130 -#define SPELL_SMOLDERING_BREATH 30210 -#define SPELL_TAIL_SWEEP 25653 -//phase 2 -#define SPELL_RAIN_OF_BONES 37098 -#define SPELL_SMOKING_BLAST 37057 -#define SPELL_FIREBALL_BARRAGE 30282 -#define SPELL_SEARING_CINDERS 30127 -#define SPELL_SUMMON_SKELETON 30170 +enum Spells +{ + // phase 1 + SPELL_BELLOWING_ROAR = 39427, + SPELL_CHARRED_EARTH = 30129, + SPELL_DISTRACTING_ASH = 30130, + SPELL_SMOLDERING_BREATH = 30210, + SPELL_TAIL_SWEEP = 25653, + // phase 2 + SPELL_RAIN_OF_BONES = 37098, + SPELL_SMOKING_BLAST = 37057, + SPELL_FIREBALL_BARRAGE = 30282, + SPELL_SEARING_CINDERS = 30127, + SPELL_SUMMON_SKELETON = 30170 +}; -#define EMOTE_SUMMON "An ancient being awakens in the distance..." -#define YELL_AGGRO "What fools! I shall bring a quick end to your suffering!" -#define YELL_FLY_PHASE "Miserable vermin. I shall exterminate you from the air!" -#define YELL_LAND_PHASE_1 "Enough! I shall land and crush you myself!" -#define YELL_LAND_PHASE_2 "Insects! Let me show you my strength up close!" -#define EMOTE_BREATH "takes a deep breath." +enum Says +{ + EMOTE_SUMMON = 0, // Not used in script + YELL_AGGRO = 1, + YELL_FLY_PHASE = 2, + YELL_LAND_PHASE = 3, + EMOTE_BREATH = 4 +}; float IntroWay[8][3] = { @@ -161,7 +166,7 @@ public: instance->SetData(TYPE_NIGHTBANE, IN_PROGRESS); HandleTerraceDoors(false); - me->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, 0); + Talk(YELL_AGGRO); } void AttackStart(Unit* who) @@ -205,7 +210,7 @@ public: { if (id == 0) { - me->MonsterTextEmote(EMOTE_BREATH, 0, true); + Talk(EMOTE_BREATH); Flying = false; Phase = 2; return; @@ -237,7 +242,7 @@ public: void TakeOff() { - me->MonsterYell(YELL_FLY_PHASE, LANG_UNIVERSAL, 0); + Talk(YELL_FLY_PHASE); me->InterruptSpell(CURRENT_GENERIC_SPELL); me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); @@ -403,7 +408,7 @@ public: if (FlyTimer <= diff) //landing { - me->MonsterYell(RAND(*YELL_LAND_PHASE_1, *YELL_LAND_PHASE_2), LANG_UNIVERSAL, 0); + Talk(YELL_LAND_PHASE); me->GetMotionMaster()->Clear(false); me->GetMotionMaster()->MovePoint(3, IntroWay[3][0], IntroWay[3][1], IntroWay[3][2]); From 43d73bebd081f52b05f360886653ece9a17fb9c9 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 22:48:40 -0330 Subject: [PATCH 28/30] Core/Scripting: Some cleanup --- .../boss_overlord_wyrmthalak.cpp | 7 ++--- .../Stratholme/boss_nerubenkan.cpp | 11 +++++--- .../Stratholme/boss_order_of_silver_hand.cpp | 23 +++++++++------ .../Kalimdor/OnyxiasLair/boss_onyxia.cpp | 4 +-- .../RuinsOfAhnQiraj/boss_ossirian.cpp | 6 ++-- .../Kalimdor/TempleOfAhnQiraj/boss_ouro.cpp | 14 ++++++---- .../boss_shirrak_the_dead_watcher.cpp | 4 +-- .../boss_omor_the_unscarred.cpp | 28 +++++++++---------- 8 files changed, 54 insertions(+), 43 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp index aeb5f81a59e..ff68462ffb5 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockSpire/boss_overlord_wyrmthalak.cpp @@ -25,7 +25,7 @@ enum Spells SPELL_BLASTWAVE = 11130, SPELL_SHOUT = 23511, SPELL_CLEAVE = 20691, - SPELL_KNOCKAWAY = 20686, + SPELL_KNOCKAWAY = 20686 }; enum Events @@ -33,14 +33,13 @@ enum Events EVENT_BLAST_WAVE = 1, EVENT_SHOUT = 2, EVENT_CLEAVE = 3, - EVENT_KNOCK_AWAY = 4, + EVENT_KNOCK_AWAY = 4 }; enum Adds { NPC_SPIRESTONE_WARLORD = 9216, - NPC_SMOLDERTHORN_BERSERKER = 9268, - + NPC_SMOLDERTHORN_BERSERKER = 9268 }; const Position SummonLocation1 = { -39.355f, -513.456f, 88.472f, 4.679f }; diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp index dd2d4ae85fa..75bdd2b06de 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_nerubenkan.cpp @@ -27,10 +27,13 @@ EndScriptData */ #include "ScriptedCreature.h" #include "stratholme.h" -#define SPELL_ENCASINGWEBS 4962 -#define SPELL_PIERCEARMOR 6016 -#define SPELL_CRYPT_SCARABS 31602 -#define SPELL_RAISEUNDEADSCARAB 17235 +enum Spells +{ + SPELL_ENCASINGWEBS = 4962, + SPELL_PIERCEARMOR = 6016, + SPELL_CRYPT_SCARABS = 31602, + SPELL_RAISEUNDEADSCARAB = 17235 +}; class boss_nerubenkan : public CreatureScript { diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp index 90e69f91aa6..a92d4778670 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp @@ -35,15 +35,22 @@ EndScriptData */ # Once Aurius is defeated, he should be the one summoning the ghosts. #####*/ -#define SH_GREGOR 17910 -#define SH_CATHELA 17911 -#define SH_NEMAS 17912 -#define SH_AELMAR 17913 -#define SH_VICAR 17914 -#define SH_QUEST_CREDIT 17915 +enum CreatureIds +{ + SH_GREGOR = 17910, + SH_CATHELA = 17911, + SH_NEMAS = 17912, + SH_AELMAR = 17913, + SH_VICAR = 17914, + SH_QUEST_CREDIT = 17915 +}; + +enum Spells +{ + SPELL_HOLY_LIGHT = 25263, + SPELL_DIVINE_SHIELD = 13874 +}; -#define SPELL_HOLY_LIGHT 25263 -#define SPELL_DIVINE_SHIELD 13874 class boss_silver_hand_bosses : public CreatureScript { public: 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_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/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/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp index edaff280937..7509f6331f7 100644 --- a/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp +++ b/src/server/scripts/Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp @@ -42,7 +42,7 @@ EndScriptData */ enum Say { - EMOTE_FOCUSE = 0 + EMOTE_FOCUSED = 0 }; class boss_shirrak_the_dead_watcher : public CreatureScript @@ -146,7 +146,7 @@ public: { FocusedTargetGUID = target->GetGUID(); me->SummonCreature(ENTRY_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 5500); - Talk(EMOTE_FOCUSE, FocusedTargetGUID); + Talk(EMOTE_FOCUSED, FocusedTargetGUID); } FocusFire_Timer = 15000+(rand()%5000); } else FocusFire_Timer -= diff; diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp index df60c924285..b83307d8dcc 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp @@ -29,24 +29,24 @@ EndScriptData */ enum eSays { - SAY_AGGRO = 0, - SAY_SUMMON = 1, - SAY_CURSE = 2, - SAY_KILL_1 = 3, - SAY_DIE = 4, - SAY_WIPE = 5, + SAY_AGGRO = 0, + SAY_SUMMON = 1, + SAY_CURSE = 2, + SAY_KILL_1 = 3, + SAY_DIE = 4, + SAY_WIPE = 5 }; enum eSpells { - SPELL_ORBITAL_STRIKE = 30637, - SPELL_SHADOW_WHIP = 30638, - SPELL_TREACHEROUS_AURA = 30695, - H_SPELL_BANE_OF_TREACHERY = 37566, - SPELL_DEMONIC_SHIELD = 31901, - SPELL_SHADOW_BOLT = 30686, - H_SPELL_SHADOW_BOLT = 39297, - SPELL_SUMMON_FIENDISH_HOUND= 30707, + SPELL_ORBITAL_STRIKE = 30637, + SPELL_SHADOW_WHIP = 30638, + SPELL_TREACHEROUS_AURA = 30695, + H_SPELL_BANE_OF_TREACHERY = 37566, + SPELL_DEMONIC_SHIELD = 31901, + SPELL_SHADOW_BOLT = 30686, + H_SPELL_SHADOW_BOLT = 39297, + SPELL_SUMMON_FIENDISH_HOUND = 30707 }; class boss_omor_the_unscarred : public CreatureScript From f81f8ec41bf25843457df5a8ed9228a3c0ad38b4 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 7 Jan 2013 23:02:17 -0330 Subject: [PATCH 29/30] Core/Scripting: Compile fix --- .../EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp index a92d4778670..e52fd3402e7 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/boss_order_of_silver_hand.cpp @@ -35,7 +35,7 @@ EndScriptData */ # Once Aurius is defeated, he should be the one summoning the ghosts. #####*/ -enum CreatureIds +enum SH_CreatureIds { SH_GREGOR = 17910, SH_CATHELA = 17911, From 7c5597a69700959d3df7a0f6538db3526ecac7ad Mon Sep 17 00:00:00 2001 From: Malcrom Date: Tue, 8 Jan 2013 00:47:20 -0330 Subject: [PATCH 30/30] Core/Scripting: Update Scholomance Scripts --- .../boss_doctor_theolen_krastinov.cpp | 127 +++++----- .../Scholomance/boss_illucia_barov.cpp | 157 ++++++------ .../Scholomance/boss_instructor_malicia.cpp | 224 +++++++++--------- .../Scholomance/boss_kirtonos_the_herald.cpp | 7 +- .../Scholomance/boss_lord_alexei_barov.cpp | 120 +++++----- .../Scholomance/boss_lorekeeper_polkelt.cpp | 154 ++++++------ .../Scholomance/boss_the_ravenian.cpp | 157 ++++++------ .../Scholomance/instance_scholomance.cpp | 12 +- .../EasternKingdoms/Scholomance/scholomance.h | 12 +- 9 files changed, 496 insertions(+), 474 deletions(-) diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp index dc52ec6c29e..ea60b0ce333 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_doctor_theolen_krastinov.cpp @@ -27,94 +27,97 @@ EndScriptData */ #include "ScriptedCreature.h" #include "scholomance.h" -enum eEnums +enum Say { EMOTE_FRENZY_KILL = 0, +}; + +enum Spells +{ SPELL_REND = 16509, SPELL_BACKHAND = 18103, SPELL_FRENZY = 8269 }; +enum Events +{ + EVENT_REND = 1, + EVENT_BACKHAND = 2, + EVENT_FRENZY = 3 +}; + class boss_doctor_theolen_krastinov : public CreatureScript { -public: - boss_doctor_theolen_krastinov() : CreatureScript("boss_doctor_theolen_krastinov") { } + public: boss_doctor_theolen_krastinov() : CreatureScript("boss_doctor_theolen_krastinov") { } - CreatureAI* GetAI(Creature* creature) const - { - return new boss_theolenkrastinovAI (creature); - } - - struct boss_theolenkrastinovAI : public ScriptedAI - { - boss_theolenkrastinovAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 m_uiRend_Timer; - uint32 m_uiBackhand_Timer; - uint32 m_uiFrenzy_Timer; - - void Reset() + struct boss_theolenkrastinovAI : public BossAI { - m_uiRend_Timer = 8000; - m_uiBackhand_Timer = 9000; - m_uiFrenzy_Timer = 1000; - } + boss_theolenkrastinovAI(Creature* creature) : BossAI(creature, DATA_DOCTORTHEOLENKRASTINOV) {} - void JustDied(Unit* /*killer*/) - { - InstanceScript* instance = me->GetInstanceScript(); - if (instance) + void Reset() {} + + void JustDied(Unit* /*killer*/) { - instance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0); - - if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) + InstanceScript* instance = me->GetInstanceScript(); + if (instance) { - instance->SetData(TYPE_GANDLING, IN_PROGRESS); - me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + instance->SetData(DATA_DOCTORTHEOLENKRASTINOV, DONE); + + if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) + { + instance->SetData(TYPE_GANDLING, IN_PROGRESS); + me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + } } } - } - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - //Rend_Timer - if (m_uiRend_Timer <= uiDiff) + void EnterCombat(Unit* /*who*/) { - DoCast(me->getVictim(), SPELL_REND); - m_uiRend_Timer = 10000; + events.ScheduleEvent(EVENT_REND, 8000); + events.ScheduleEvent(EVENT_BACKHAND, 9000); + events.ScheduleEvent(EVENT_FRENZY, 1000); } - else - m_uiRend_Timer -= uiDiff; - //Backhand_Timer - if (m_uiBackhand_Timer <= uiDiff) + void UpdateAI(uint32 const diff) { - DoCast(me->getVictim(), SPELL_BACKHAND); - m_uiBackhand_Timer = 10000; - } - else - m_uiBackhand_Timer -= uiDiff; + if (!UpdateVictim()) + return; - //Frenzy_Timer - if (HealthBelowPct(26)) - { - if (m_uiFrenzy_Timer <= uiDiff) + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) { - DoCast(me, SPELL_FRENZY); - Talk(EMOTE_FRENZY_KILL); - - m_uiFrenzy_Timer = 120000; + switch (eventId) + { + case EVENT_REND: + DoCastVictim(SPELL_REND, true); + events.ScheduleEvent(EVENT_REND, 10000); + break; + case EVENT_BACKHAND: + DoCastVictim(SPELL_BACKHAND, true); + events.ScheduleEvent(EVENT_BACKHAND, 10000); + break; + case EVENT_FRENZY: + DoCast(me, SPELL_FRENZY, true); + Talk(EMOTE_FRENZY_KILL); + events.ScheduleEvent(EVENT_FRENZY, 120000); + break; + default: + break; + } } - else - m_uiFrenzy_Timer -= uiDiff; - } - DoMeleeAttackIfReady(); + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_theolenkrastinovAI (creature); } - }; }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp index cc81687c5d1..54fc9e4a17e 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_illucia_barov.cpp @@ -27,97 +27,98 @@ EndScriptData */ #include "ScriptedCreature.h" #include "scholomance.h" -#define SPELL_CURSEOFAGONY 18671 -#define SPELL_SHADOWSHOCK 20603 -#define SPELL_SILENCE 15487 -#define SPELL_FEAR 6215 +enum Spells +{ + SPELL_CURSEOFAGONY = 34794, + SPELL_SHADOWSHOCK = 34799, + SPELL_SILENCE = 34803, + SPELL_FEAR = 34803 +}; + +enum Events +{ + EVENT_CURSEOFAGONY = 1, + EVENT_SHADOWSHOCK = 2, + EVENT_SILENCE = 3, + EVENT_FEAR = 4 +}; class boss_illucia_barov : public CreatureScript { -public: - boss_illucia_barov() : CreatureScript("boss_illucia_barov") { } + public: boss_illucia_barov() : CreatureScript("boss_illucia_barov") { } - CreatureAI* GetAI(Creature* creature) const - { - return new boss_illuciabarovAI (creature); - } - - struct boss_illuciabarovAI : public ScriptedAI - { - boss_illuciabarovAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 CurseOfAgony_Timer; - uint32 ShadowShock_Timer; - uint32 Silence_Timer; - uint32 Fear_Timer; - - void Reset() + struct boss_illuciabarovAI : public BossAI { - CurseOfAgony_Timer = 18000; - ShadowShock_Timer = 9000; - Silence_Timer = 5000; - Fear_Timer = 30000; - } + boss_illuciabarovAI(Creature* creature) : BossAI(creature,DATA_LADYILLUCIABAROV) {} - void JustDied(Unit* /*killer*/) - { - InstanceScript* instance = me->GetInstanceScript(); - if (instance) + void Reset() {} + + void JustDied(Unit* /*killer*/) { - instance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0); - - if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) + InstanceScript* instance = me->GetInstanceScript(); + if (instance) { - instance->SetData(TYPE_GANDLING, IN_PROGRESS); - me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + instance->SetData(DATA_LADYILLUCIABAROV, DONE); + + if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) + { + instance->SetData(TYPE_GANDLING, IN_PROGRESS); + me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + } } } - } - void EnterCombat(Unit* /*who*/) + void EnterCombat(Unit* /*who*/) + { + events.ScheduleEvent(EVENT_CURSEOFAGONY, 18000); + events.ScheduleEvent(EVENT_SHADOWSHOCK, 9000); + events.ScheduleEvent(EVENT_SILENCE, 5000); + events.ScheduleEvent(EVENT_FEAR, 30000); + } + + 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_CURSEOFAGONY: + DoCastVictim(SPELL_CURSEOFAGONY, true); + events.ScheduleEvent(EVENT_CURSEOFAGONY, 30000); + break; + case EVENT_SHADOWSHOCK: + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_SHADOWSHOCK,true); + events.ScheduleEvent(EVENT_SHADOWSHOCK, 12000); + break; + case EVENT_SILENCE: + DoCastVictim(SPELL_SILENCE, true); + events.ScheduleEvent(EVENT_SILENCE, 14000); + break; + case EVENT_FEAR: + DoCastVictim(SPELL_FEAR, true); + events.ScheduleEvent(EVENT_FEAR, 30000); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const { + return new boss_illuciabarovAI (creature); } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //CurseOfAgony_Timer - if (CurseOfAgony_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CURSEOFAGONY); - CurseOfAgony_Timer = 30000; - } else CurseOfAgony_Timer -= diff; - - //ShadowShock_Timer - if (ShadowShock_Timer <= diff) - { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) DoCast(target, SPELL_SHADOWSHOCK); - - ShadowShock_Timer = 12000; - } else ShadowShock_Timer -= diff; - - //Silence_Timer - if (Silence_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SILENCE); - Silence_Timer = 14000; - } else Silence_Timer -= diff; - - //Fear_Timer - if (Fear_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_FEAR); - Fear_Timer = 30000; - } else Fear_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - }; void AddSC_boss_illuciabarov() diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp index 54dc75dd905..daf03f41db5 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_instructor_malicia.cpp @@ -27,133 +27,133 @@ EndScriptData */ #include "ScriptedCreature.h" #include "scholomance.h" -#define SPELL_CALLOFGRAVES 17831 -#define SPELL_CORRUPTION 11672 -#define SPELL_FLASHHEAL 10917 -#define SPELL_RENEW 10929 -#define SPELL_HEALINGTOUCH 9889 +enum Spells +{ + SPELL_CALLOFGRAVES = 17831, + SPELL_CORRUPTION = 11672, + SPELL_FLASHHEAL = 10917, + SPELL_RENEW = 10929, + SPELL_HEALINGTOUCH = 9889 +}; + +enum Events +{ + EVENT_CALLOFGRAVES = 1, + EVENT_CORRUPTION = 2, + EVENT_FLASHHEAL = 3, + EVENT_RENEW = 4, + EVENT_HEALINGTOUCH = 5 +}; class boss_instructor_malicia : public CreatureScript { -public: - boss_instructor_malicia() : CreatureScript("boss_instructor_malicia") { } + public: boss_instructor_malicia() : CreatureScript("boss_instructor_malicia") { } - CreatureAI* GetAI(Creature* creature) const - { - return new boss_instructormaliciaAI (creature); - } - - struct boss_instructormaliciaAI : public ScriptedAI - { - boss_instructormaliciaAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 CallOfGraves_Timer; - uint32 Corruption_Timer; - uint32 FlashHeal_Timer; - uint32 Renew_Timer; - uint32 HealingTouch_Timer; - uint32 FlashCounter; - uint32 TouchCounter; - - void Reset() + struct boss_instructormaliciaAI : public BossAI { - CallOfGraves_Timer = 4000; - Corruption_Timer = 8000; - FlashHeal_Timer = 38000; - Renew_Timer = 32000; - HealingTouch_Timer = 45000; - FlashCounter = 0; - TouchCounter = 0; - } + boss_instructormaliciaAI(Creature* creature) : BossAI(creature, DATA_INSTRUCTORMALICIA) {} - void JustDied(Unit* /*killer*/) - { - InstanceScript* instance = me->GetInstanceScript(); - if (instance) + uint32 FlashCounter; + uint32 TouchCounter; + + void Reset() { - instance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0); + FlashCounter = 0; + TouchCounter = 0; + } - if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) + void JustDied(Unit* /*killer*/) + { + InstanceScript* instance = me->GetInstanceScript(); + if (instance) { - instance->SetData(TYPE_GANDLING, IN_PROGRESS); - me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + instance->SetData(DATA_INSTRUCTORMALICIA, DONE); + + if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) + { + instance->SetData(TYPE_GANDLING, IN_PROGRESS); + me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + } } } - } - void EnterCombat(Unit* /*who*/) + void EnterCombat(Unit* /*who*/) + { + events.ScheduleEvent(EVENT_CALLOFGRAVES, 4000); + events.ScheduleEvent(EVENT_CORRUPTION, 8000); + events.ScheduleEvent(EVENT_RENEW, 32000); + events.ScheduleEvent(EVENT_FLASHHEAL, 38000); + events.ScheduleEvent(EVENT_HEALINGTOUCH, 45000); + } + + 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_CALLOFGRAVES: + DoCastVictim(SPELL_CALLOFGRAVES, true); + events.ScheduleEvent(EVENT_CALLOFGRAVES, 65000); + break; + case EVENT_CORRUPTION: + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_CORRUPTION,true); + events.ScheduleEvent(EVENT_CORRUPTION, 24000); + break; + case EVENT_RENEW: + DoCast(me, SPELL_RENEW); + events.ScheduleEvent(EVENT_RENEW, 10000); + break; + case EVENT_FLASHHEAL: + //5 Flashheals will be casted + DoCast(me, SPELL_FLASHHEAL); + if (FlashCounter < 2) + { + events.ScheduleEvent(EVENT_FLASHHEAL, 5000); + ++FlashCounter; + } + else + { + FlashCounter=0; + events.ScheduleEvent(EVENT_FLASHHEAL, 30000); + } + break; + case EVENT_HEALINGTOUCH: + //3 Healing Touch will be casted + DoCast(me, SPELL_HEALINGTOUCH); + if (TouchCounter < 2) + { + events.ScheduleEvent(EVENT_HEALINGTOUCH, 5500); + ++TouchCounter; + } + else + { + TouchCounter=0; + events.ScheduleEvent(EVENT_HEALINGTOUCH, 30000); + } + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const { + return new boss_instructormaliciaAI (creature); } - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //CallOfGraves_Timer - if (CallOfGraves_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CALLOFGRAVES); - CallOfGraves_Timer = 65000; - } else CallOfGraves_Timer -= diff; - - //Corruption_Timer - if (Corruption_Timer <= diff) - { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) DoCast(target, SPELL_CORRUPTION); - - Corruption_Timer = 24000; - } else Corruption_Timer -= diff; - - //Renew_Timer - if (Renew_Timer <= diff) - { - DoCast(me, SPELL_RENEW); - Renew_Timer = 10000; - } else Renew_Timer -= diff; - - //FlashHeal_Timer - if (FlashHeal_Timer <= diff) - { - DoCast(me, SPELL_FLASHHEAL); - - //5 Flashheals will be casted - if (FlashCounter < 2) - { - FlashHeal_Timer = 5000; - ++FlashCounter; - } - else - { - FlashCounter=0; - FlashHeal_Timer = 30000; - } - } else FlashHeal_Timer -= diff; - - //HealingTouch_Timer - if (HealingTouch_Timer <= diff) - { - DoCast(me, SPELL_HEALINGTOUCH); - - //3 Healingtouchs will be casted - if (HealingTouch_Timer < 2) - { - HealingTouch_Timer = 5500; - ++TouchCounter; - } - else - { - TouchCounter=0; - HealingTouch_Timer = 30000; - } - } else HealingTouch_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - }; void AddSC_boss_instructormalicia() diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp index 14ef18aba58..68d7dcdebe8 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kirtonos_the_herald.cpp @@ -103,7 +103,8 @@ class boss_kirtonos_the_herald : public CreatureScript brazier->ResetDoorOrButton(); brazier->SetGoState(GO_STATE_READY); } - _JustDied(); + if (instance) + instance->SetData(TYPE_KIRTONOS, DONE); } void EnterEvadeMode() @@ -173,6 +174,7 @@ class boss_kirtonos_the_herald : public CreatureScript me->SetWalk(true); me->SetDisableGravity(false); DoCast(me, SPELL_KIRTONOS_TRANSFORM); + me->SetCanFly(false); _introTimer = 1000; _introEvent = INTRO_5; break; @@ -184,7 +186,6 @@ class boss_kirtonos_the_herald : public CreatureScript _introTimer = 5000; _introEvent = INTRO_6; case INTRO_6: - // I don't know how to make him not swim across screen here. Tell me and I will fix. me->GetMotionMaster()->MovePoint(0, 314.8673f, 90.3021f, 101.6459f); _introTimer = 0; _introEvent = 0; @@ -240,11 +241,13 @@ class boss_kirtonos_the_herald : public CreatureScript { me->RemoveAura(SPELL_KIRTONOS_TRANSFORM); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(0)); + me->SetCanFly(false); } else { DoCast(me, SPELL_KIRTONOS_TRANSFORM); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_KIRTONOS_STAFF)); + me->SetCanFly(true); } events.ScheduleEvent(EVENT_KIRTONOS_TRANSFORM, urand(16000, 18000)); break; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp index dc83e0e20cb..55ef0605c31 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lord_alexei_barov.cpp @@ -27,79 +27,87 @@ EndScriptData */ #include "ScriptedCreature.h" #include "scholomance.h" -#define SPELL_IMMOLATE 20294 // Old ID was 15570 -#define SPELL_VEILOFSHADOW 17820 +enum Spells +{ + SPELL_IMMOLATE = 20294, // Old ID was 15570 + SPELL_VEILOFSHADOW = 17820 +}; + +enum Events +{ + EVENT_IMMOLATE = 1, + EVENT_VEILOFSHADOW = 2 +}; class boss_lord_alexei_barov : public CreatureScript { -public: - boss_lord_alexei_barov() : CreatureScript("boss_lord_alexei_barov") { } + public: boss_lord_alexei_barov() : CreatureScript("boss_lord_alexei_barov") { } - CreatureAI* GetAI(Creature* creature) const - { - return new boss_lordalexeibarovAI (creature); - } - - struct boss_lordalexeibarovAI : public ScriptedAI - { - boss_lordalexeibarovAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 Immolate_Timer; - uint32 VeilofShadow_Timer; - - void Reset() + struct boss_lordalexeibarovAI : public BossAI { - Immolate_Timer = 7000; - VeilofShadow_Timer = 15000; + boss_lordalexeibarovAI(Creature* creature) : BossAI(creature, DATA_LORDALEXEIBAROV) {} - me->LoadCreaturesAddon(); - } - - void JustDied(Unit* /*killer*/) - { - InstanceScript* instance = me->GetInstanceScript(); - if (instance) + void Reset() { - instance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0); + me->LoadCreaturesAddon(); + } - if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) + void JustDied(Unit* /*killer*/) + { + InstanceScript* instance = me->GetInstanceScript(); + if (instance) { - instance->SetData(TYPE_GANDLING, IN_PROGRESS); - me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + instance->SetData(DATA_LORDALEXEIBAROV, DONE); + + if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) + { + instance->SetData(TYPE_GANDLING, IN_PROGRESS); + me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + } } } - } - void EnterCombat(Unit* /*who*/) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Immolate_Timer - if (Immolate_Timer <= diff) + void EnterCombat(Unit* /*who*/) { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0); - if (target) DoCast(target, SPELL_IMMOLATE); + events.ScheduleEvent(EVENT_IMMOLATE, 7000); + events.ScheduleEvent(EVENT_VEILOFSHADOW, 15000); + } - Immolate_Timer = 12000; - } else Immolate_Timer -= diff; - - //VeilofShadow_Timer - if (VeilofShadow_Timer <= diff) + void UpdateAI(uint32 const diff) { - DoCast(me->getVictim(), SPELL_VEILOFSHADOW); - VeilofShadow_Timer = 20000; - } else VeilofShadow_Timer -= diff; + if (!UpdateVictim()) + return; - DoMeleeAttackIfReady(); + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_IMMOLATE: + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0, 100, true),SPELL_IMMOLATE,true); + events.ScheduleEvent(EVENT_IMMOLATE, 12000); + break; + case EVENT_VEILOFSHADOW: + DoCastVictim(SPELL_VEILOFSHADOW, true); + events.ScheduleEvent(EVENT_VEILOFSHADOW, 20000); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_lordalexeibarovAI (creature); } - }; - }; void AddSC_boss_lordalexeibarov() diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp index e296ae7143d..cc9180ded76 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_lorekeeper_polkelt.cpp @@ -27,94 +27,98 @@ EndScriptData */ #include "ScriptedCreature.h" #include "scholomance.h" -#define SPELL_VOLATILEINFECTION 24928 -#define SPELL_DARKPLAGUE 18270 -#define SPELL_CORROSIVEACID 23313 -#define SPELL_NOXIOUSCATALYST 18151 +enum Spells +{ + SPELL_VOLATILEINFECTION = 24928, + SPELL_DARKPLAGUE = 18270, + SPELL_CORROSIVEACID = 23313, + SPELL_NOXIOUSCATALYST = 18151 +}; + +enum Events +{ + EVENT_VOLATILEINFECTION = 1, + EVENT_DARKPLAGUE = 2, + EVENT_CORROSIVEACID = 3, + EVENT_NOXIOUSCATALYST = 4 +}; class boss_lorekeeper_polkelt : public CreatureScript { -public: - boss_lorekeeper_polkelt() : CreatureScript("boss_lorekeeper_polkelt") { } + public: boss_lorekeeper_polkelt() : CreatureScript("boss_lorekeeper_polkelt") { } - CreatureAI* GetAI(Creature* creature) const - { - return new boss_lorekeeperpolkeltAI (creature); - } - - struct boss_lorekeeperpolkeltAI : public ScriptedAI - { - boss_lorekeeperpolkeltAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 VolatileInfection_Timer; - uint32 Darkplague_Timer; - uint32 CorrosiveAcid_Timer; - uint32 NoxiousCatalyst_Timer; - - void Reset() + struct boss_lorekeeperpolkeltAI : public BossAI { - VolatileInfection_Timer = 38000; - Darkplague_Timer = 8000; - CorrosiveAcid_Timer = 45000; - NoxiousCatalyst_Timer = 35000; - } + boss_lorekeeperpolkeltAI(Creature* creature) : BossAI(creature, DATA_LOREKEEPERPOLKELT) {} - void JustDied(Unit* /*killer*/) - { - InstanceScript* instance = me->GetInstanceScript(); - if (instance) + void Reset() {} + + void JustDied(Unit* /*killer*/) { - instance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0); - - if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) + InstanceScript* instance = me->GetInstanceScript(); + if (instance) { - instance->SetData(TYPE_GANDLING, IN_PROGRESS); - me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + instance->SetData(DATA_LOREKEEPERPOLKELT, DONE); + + if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) + { + instance->SetData(TYPE_GANDLING, IN_PROGRESS); + me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + } } } - } - void EnterCombat(Unit* /*who*/) + void EnterCombat(Unit* /*who*/) + { + events.ScheduleEvent(EVENT_VOLATILEINFECTION, 38000); + events.ScheduleEvent(EVENT_DARKPLAGUE, 8000); + events.ScheduleEvent(EVENT_CORROSIVEACID, 45000); + events.ScheduleEvent(EVENT_NOXIOUSCATALYST, 35000); + } + + 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_VOLATILEINFECTION: + DoCastVictim(SPELL_VOLATILEINFECTION, true); + events.ScheduleEvent(EVENT_VOLATILEINFECTION, 32000); + break; + case EVENT_DARKPLAGUE: + DoCastVictim(SPELL_DARKPLAGUE, true); + events.ScheduleEvent(EVENT_DARKPLAGUE, 8000); + break; + case EVENT_CORROSIVEACID: + DoCastVictim(SPELL_CORROSIVEACID, true); + events.ScheduleEvent(EVENT_CORROSIVEACID, 25000); + break; + case EVENT_NOXIOUSCATALYST: + DoCastVictim(SPELL_NOXIOUSCATALYST, true); + events.ScheduleEvent(EVENT_NOXIOUSCATALYST, 38000); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const { + return new boss_lorekeeperpolkeltAI (creature); } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //VolatileInfection_Timer - if (VolatileInfection_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_VOLATILEINFECTION); - VolatileInfection_Timer = 32000; - } else VolatileInfection_Timer -= diff; - - //Darkplague_Timer - if (Darkplague_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_DARKPLAGUE); - Darkplague_Timer = 8000; - } else Darkplague_Timer -= diff; - - //CorrosiveAcid_Timer - if (CorrosiveAcid_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CORROSIVEACID); - CorrosiveAcid_Timer = 25000; - } else CorrosiveAcid_Timer -= diff; - - //NoxiousCatalyst_Timer - if (NoxiousCatalyst_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_NOXIOUSCATALYST); - NoxiousCatalyst_Timer = 38000; - } else NoxiousCatalyst_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - }; void AddSC_boss_lorekeeperpolkelt() diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp index ded2f66e95d..5a6f5d436c4 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_the_ravenian.cpp @@ -27,96 +27,99 @@ EndScriptData */ #include "ScriptedCreature.h" #include "scholomance.h" -#define SPELL_TRAMPLE 15550 -#define SPELL_CLEAVE 20691 -#define SPELL_SUNDERINCLEAVE 25174 -#define SPELL_KNOCKAWAY 10101 +enum Spells +{ + SPELL_TRAMPLE = 15550, + SPELL_CLEAVE = 20691, + SPELL_SUNDERINCLEAVE = 25174, + SPELL_KNOCKAWAY = 10101 +}; + +enum Events +{ + EVENT_TRAMPLE = 1, + EVENT_CLEAVE = 2, + EVENT_SUNDERINCLEAVE = 3, + EVENT_KNOCKAWAY = 4 +}; + class boss_the_ravenian : public CreatureScript { -public: - boss_the_ravenian() : CreatureScript("boss_the_ravenian") { } + public: boss_the_ravenian() : CreatureScript("boss_the_ravenian") { } - CreatureAI* GetAI(Creature* creature) const - { - return new boss_theravenianAI (creature); - } - - struct boss_theravenianAI : public ScriptedAI - { - boss_theravenianAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 Trample_Timer; - uint32 Cleave_Timer; - uint32 SunderingCleave_Timer; - uint32 KnockAway_Timer; - bool HasYelled; - - void Reset() + struct boss_theravenianAI : public BossAI { - Trample_Timer = 24000; - Cleave_Timer = 15000; - SunderingCleave_Timer = 40000; - KnockAway_Timer = 32000; - HasYelled = false; - } + boss_theravenianAI(Creature* creature) : BossAI(creature, DATA_THERAVENIAN) {} - void JustDied(Unit* /*killer*/) - { - InstanceScript* instance = me->GetInstanceScript(); - if (instance) + void Reset() {} + + void JustDied(Unit* /*killer*/) { - instance->SetData(DATA_THERAVENIAN_DEATH, 0); - - if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) + InstanceScript* instance = me->GetInstanceScript(); + if (instance) { - instance->SetData(TYPE_GANDLING, IN_PROGRESS); - me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + instance->SetData(DATA_THERAVENIAN, DONE); + + if (instance->GetData(TYPE_GANDLING) == IN_PROGRESS) + { + instance->SetData(TYPE_GANDLING, IN_PROGRESS); + me->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + } } } - } - void EnterCombat(Unit* /*who*/) + void EnterCombat(Unit* /*who*/) + { + events.ScheduleEvent(EVENT_TRAMPLE, 24000); + events.ScheduleEvent(EVENT_CLEAVE, 15000); + events.ScheduleEvent(EVENT_SUNDERINCLEAVE, 40000); + events.ScheduleEvent(EVENT_KNOCKAWAY, 32000); + } + + 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_TRAMPLE: + DoCastVictim(SPELL_TRAMPLE, true); + events.ScheduleEvent(EVENT_TRAMPLE, 10000); + break; + case EVENT_CLEAVE: + DoCastVictim(SPELL_CLEAVE, true); + events.ScheduleEvent(EVENT_CLEAVE, 7000); + break; + case EVENT_SUNDERINCLEAVE: + DoCastVictim(SPELL_SUNDERINCLEAVE, true); + events.ScheduleEvent(EVENT_SUNDERINCLEAVE, 20000); + break; + case EVENT_KNOCKAWAY: + DoCastVictim(SPELL_KNOCKAWAY, true); + events.ScheduleEvent(EVENT_KNOCKAWAY, 12000); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const { + return new boss_theravenianAI (creature); } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Trample_Timer - if (Trample_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_TRAMPLE); - Trample_Timer = 10000; - } else Trample_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 7000; - } else Cleave_Timer -= diff; - - //SunderingCleave_Timer - if (SunderingCleave_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_SUNDERINCLEAVE); - SunderingCleave_Timer = 20000; - } else SunderingCleave_Timer -= diff; - - //KnockAway_Timer - if (KnockAway_Timer <= diff) - { - DoCast(me->getVictim(), SPELL_KNOCKAWAY); - KnockAway_Timer = 12000; - } else KnockAway_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }; - }; void AddSC_boss_theravenian() diff --git a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp index fc966c4bbb9..04a12ae2bd2 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/instance_scholomance.cpp @@ -93,22 +93,22 @@ public: { switch (type) { - case DATA_LORDALEXEIBAROV_DEATH: + case DATA_LORDALEXEIBAROV: IsBossDied[0] = true; break; - case DATA_DOCTORTHEOLENKRASTINOV_DEATH: + case DATA_DOCTORTHEOLENKRASTINOV: IsBossDied[1] = true; break; - case DATA_THERAVENIAN_DEATH: + case DATA_THERAVENIAN: IsBossDied[2] = true; break; - case DATA_LOREKEEPERPOLKELT_DEATH: + case DATA_LOREKEEPERPOLKELT: IsBossDied[3] = true; break; - case DATA_INSTRUCTORMALICIA_DEATH: + case DATA_INSTRUCTORMALICIA: IsBossDied[4] = true; break; - case DATA_LADYILLUCIABAROV_DEATH: + case DATA_LADYILLUCIABAROV: IsBossDied[5] = true; break; case TYPE_GANDLING: diff --git a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h index 20b782fd43a..f89f36d91e5 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h +++ b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h @@ -24,12 +24,12 @@ uint32 const MAX_ENCOUNTER = 2; enum DataTypes { TYPE_GANDLING = 1, - DATA_DOCTORTHEOLENKRASTINOV_DEATH = 2, - DATA_INSTRUCTORMALICIA_DEATH = 3, - DATA_LADYILLUCIABAROV_DEATH = 4, - DATA_LORDALEXEIBAROV_DEATH = 5, - DATA_LOREKEEPERPOLKELT_DEATH = 6, - DATA_THERAVENIAN_DEATH = 7, + DATA_DOCTORTHEOLENKRASTINOV = 2, + DATA_INSTRUCTORMALICIA = 3, + DATA_LADYILLUCIABAROV = 4, + DATA_LORDALEXEIBAROV = 5, + DATA_LOREKEEPERPOLKELT = 6, + DATA_THERAVENIAN = 7, TYPE_KIRTONOS = 8 };