diff options
8 files changed, 1027 insertions, 551 deletions
diff --git a/sql/updates/1421_world.sql b/sql/updates/1421_world.sql new file mode 100644 index 00000000000..28335c9fa30 --- /dev/null +++ b/sql/updates/1421_world.sql @@ -0,0 +1,170 @@ +-- Kil'jaeden -- + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` = 45909; +DELETE FROM `spell_script_target` WHERE `entry` IN (46589, 45839); +INSERT INTO `spell_script_target` () VALUES (46589, 1, 30598); +INSERT INTO `spell_script_target` () VALUES (46589, 1, 30614); +INSERT INTO `spell_script_target` () VALUES (45839, 1, 25653); + +DELETE FROM `creature_template` WHERE entry in (30598, 30614); +INSERT INTO `creature_template` () VALUES +(30598, 0, 4449, 0, 4449, 0, 'Spike Target', '', '', 70, 70, 1, 1, 0, 0, 0, 14, 14, 0, 1, 1, 0, 0, 0, 0, 0, 2600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 0, 1, 0, 0, 128, ''), +(30614, 0, 4449, 0, 4449, 0, 'Spike Target 2', '', '', 70, 70, 1, 1, 0, 0, 0, 14, 14, 0, 1, 1, 0, 0, 0, 0, 0, 2600, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 0, 1, 0, 0, 128, ''); + +UPDATE `creature_template` SET `flags_extra` = 128 WHERE `entry` IN (30614, 30598, 25735); +UPDATE `creature_template` SET `minlevel` = 73, `maxlevel` = 73, unit_flags = 33554432, minhealth=5000000, maxhealth=5000000 WHERE entry IN (26046, 25319); +UPDATE `creature_template` SET `minlevel` = 70, `unit_flags` = 33554432 WHERE entry = 26046; +UPDATE `creature_template` SET `minlevel` =70, `maxlevel` = 70, `unit_flags` = 33554432, spell1 = 45848, spell2 = 45862, spell3 = 45860, spell4 = 45856, minhealth = 5000000, maxhealth=5000000 WHERE entry=25653; +UPDATE `creature_template` SET `minlevel` = 70, `maxlevel` = 70, `minhealth` = 20000, maxhealth = 20000 WHERE entry = 25502; +UPDATE `creature_template` SET `minhealth` = 12600000, maxhealth = 12600000, minmana = 2000000, maxmana = 2000000 WHERE entry = 25315; +UPDATE `creature_template` SET `minhealth` = 110000, maxhealth = 110000, minmana = 100000, maxmana = 100000 WHERE entry =25708; +UPDATE `creature_template` SET `minlevel` = 73, `maxlevel` = 73 WHERE entry = 25735 + +DELETE FROM creature WHERE id IN (25319, 25588, 25608); +INSERT INTO creature (id, map, spawnMask, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint, curhealth, curmana, DeathState, MovementType) VALUES +(25319, 580, 1, 0, 0, 1701.7, 635.515, 72.2884, 4.65461, 25, 0, 0, 1, 0, 0, 0), +(25608, 580, 1, 0, 0, 1698.9, 627.877, 27.6233, 0.034907, 604800, 0, 0, 1, 0, 0, 0); + +DELETE FROM gameobject WHERE id=188415; +INSERT INTO gameobject (id, map, spawnMask, position_x, position_y, position_z, orientation, rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state) VALUES +(188415, 580, 1, 1653.12, 635.41, 28.0932, 0.0977725, 0, 0, 0.0488668, 0.998805, 25, 0, 1), +(188415, 580, 1, 1704.14, 583.591, 28.1696, 1.59003, 0, 0, 0.713874, 0.700274, 25, 0, 1), +(188415, 580, 1, 1745.68, 621.823, 28.0505, 2.93777, 0, 0, 0.994812, 0.101733, 25, 0, 1), +(188415, 580, 1, 1694.48, 674.29, 28.0502, 4.86985, 0, 0, 0.649302, -0.760531, 25, 0, 1); +UPDATE `gameobject_template` SET `type` = 1 WHERE `entry` = 188415; + +-- M'uru -- +UPDATE `creature_template` SET `modelid_A` = 23842 WHERE `entry` = 25744; +UPDATE `creature_template` SET `flags_extra` = 128 WHERE entry IN (25855, 25770); +UPDATE `creature_template` SET `spell1` = 46262, flags_extra = 128, scriptname = '' WHERE entry = 25879; + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (46242, 46228, 46228, 46262); +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (46242, 46247, 0, 'Black Hole Visual (Birth)'); +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (46228, 46235, 0, 'Black Hole Visual (Grown)'); +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (46228, -46247, 0, 'Black Hole Visual (Grown)'); +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (46262, 46265, 0, 'Void Zone Visual'); + +DELETE FROM `spell_script_target` WHERE `entry` IN (45976, 46177); +INSERT INTO `spell_script_target` VALUES (45976, 1, 25770); +INSERT INTO `spell_script_target` VALUES (46177, 1, 25770); + +-- EAI for Berserks FROM Megamage +DELETE FROM `eventai_scripts` WHERE `creature_id` = 25798; +INSERT INTO `eventai_scripts` (`id`, `creature_id`, `event_type`, `event_flags`,`event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_type`, `action1_param1`, `action1_param2`, `action1_param3`, `action2_type`, `action2_param1`, `action2_param2`, `action2_param3`, `action3_type`, `action3_param1`, `action3_param2`, `action3_param3`, `comment`, `event_chance`, `event_inverse_phase_mask`) VALUES +(2579800, 25798, 11, 0, 0*1000, 0*1000, 0*1000, 0*1000, 11, 45769, 0, 0, 20, 1, 0, 0, 21, 1, 0, 0,"Shadowsword Berserker - Sunwell Radiance", 100, 0), +(2579801, 25798, 0, 1, 10*1000, 12*1000, 10*1000, 15*1000, 11, 46160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadowsword Berserker - Cast Flurry', 70, 0), +(2579802, 25798, 1, 0, 180*1000, 180*1000, 0*1000, 0*1000, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Shadowsword Berserker - 180s OOC => Evade', 100, 0); + + +-- Brutallus -- +UPDATE `creature_template` SET `unit_flags` = 0 WHERE `entry` = 24882; + +-- Felmyst -- +UPDATE `creature_template` SET `modelid_H` = 22838 WHERE `entry` = 25038; + +DELETE FROM `script_texts` WHERE `entry` BETWEEN '-1580109' and '-1580036'; + +INSERT INTO `script_texts` (`entry`, `content_default`, `sound`, `type`, `comment`) VALUES +(-1580036, 'Glory to Kil\'jaeden! Death to all who oppose!', 12477, 1, 'felmyst - YELL_BIRTH'), +(-1580037, 'I kill for the master!', 12480, 1, 'felmyst - YELL_KILL1'), +(-1580038, 'The end has come!', 12481, 1, 'felmyst - YELL_KILL2'), +(-1580039, 'Choke on your final breath!', 12478, 1, 'felmyst - YELL_BREATH'), +(-1580040, 'I am stronger than ever before!', 12479, 1, 'felmyst- YELL_TAKEOFF'), +(-1580041, 'No more hesitation! Your fates are written!', 12482, 1, 'felmyst - YELL_BERSERK'), +(-1580042, 'Kil\'jaeden... will... prevail...', 12483, 1, 'felmyst - YELL_DEATH'), +(-1580043, 'Madrigosa deserved a far better fate. You did what had to be done, but this battle is far from over.', 12439, 1, 'felmyst - YELL_KALECGOS'), + +(-1580044, 'Fire to the aid of shadow!', 12489, 1, 'eredar - YELL_CANFLAGRATION'), +(-1580045, 'Sacrolash!', 12492, 1, 'eredar - YELL_SISTER_SACROLASH_DEAD'), +(-1580046, 'Fire consume.', 12490, 1, 'eredar - YELL_ALY_KILL_1'), +(-1580047, 'Ed-ir Halach!', 12491, 1, 'eredar - YELL_ALY_KILL_2'), +(-1580048, 'De-ek Anur!', 12494, 1, 'eredar - YELL_ALY_DEAD'), +(-1580049, 'Your luck has run its curse!', 12493, 1, 'eredar - YELL_BERSERK'), +(-1580050, 'Shadow to the aid of fire!', 12485, 1, 'eredar - YELL_SHADOW_NOVA'), +(-1580051, 'Alythess! Your fire burns within me!', 12488, 1, 'eredar - YELL_SISTER_ALYTHESS_DEAD'), +(-1580052, 'Shadow engulf.', 12486, 1, 'eredar - YELL_SAC_KILL_1'), +(-1580053, 'Ee-nok Kryul!', 12487, 1, 'eredar - YELL_SAC_KILL_2'), +(-1580054, 'I... fade.', 0, 1, 'eredar - YELL_SAC_DEAD'), +(-1580055, 'Time is a luxury you no longer possess!', 0, 1, 'eredar - YELL_ENRAGE'), + +(-1580056, 'Misery...', 12484, 1, 'eredar - YELL_INTRO_SAC_1'), +(-1580057, 'Depravity...', 0, 1, 'eredar - YELL_INTRO_ALY_2'), +(-1580058, 'Confusion...', 0, 1, 'eredar - YELL_INTRO_SAC_3'), +(-1580059, 'Hatred...', 0, 1, 'eredar - YELL_INTRO_ALY_4'), +(-1580060, 'Mistrust...', 0, 1, 'eredar - YELL_INTRO_SAC_5'), +(-1580061, 'Chaos...', 0, 1, 'eredar - YELL_INTRO_ALY_6'), +(-1580062, 'These are the hallmarks...', 0, 1, 'eredar - YELL_INTRO_SAC_7'), +(-1580063, 'These are the pillars...', 0, 1, 'eredar - YELL_INTRO_ALY_8'), +(-1580064, 'directs Shadow Nova at $N', 0, 3, 'eredar - emote shadow nova'), +(-1580065, 'directs Conflagration at $N', 0, 3, 'eredar - emote conflagration'), + +(-1580066, 'All my plans have led to this!', 12495, 1, 'KJ - SAY_KJ_OFFCOMBAT1'), +(-1580067, 'Stay on task! Do not waste tim!', 12496, 1, 'KJ - SAY_KJ_OFFCOMBAT2'), +(-1580068, 'I have waited long enough!', 12497, 1, 'KJ - SAY_KJ_OFFCOMBAT3'), +(-1580069, 'Fail me and suffer for eternity!', 12498, 1, 'KJ - SAY_KJ_OFFCOMBAT4'), +(-1580070, 'Drain the girl! Drain her power until there is nothing but a vacant shell!', 12499, 1, 'KJ - SAY_KJ_OFFCOMBAT5'), + +(-1580071, 'The expendible have perished... So be it! Now I shall succeed where Sargeras could not! I will bleed this wretched world and secure my place as the true master of the Burning Legion. The end has come! Let the unraveling of this world commence!', 12500, 1, 'KJ - SAY_KJ_EMERGE'), +(-1580072, 'Another step towards destruction!', 12501, 1, 'KJ - SAY_KJ_SLAY1'), +(-1580073, 'Anak-ky\'ri!', 12502, 1, 'KJ - SAY_KJ_SLAY2'), +(-1580074, 'Who can you trust?', 12503, 1, 'KJ - SAY_KJ_REFLECTION1'), +(-1580075, 'The enemy is among you.', 12504, 1, 'KJ - SAY_KJ_REFLECTION2'), +(-1580076, 'Chaos!', 12505, 1, 'KJ - SAY_KJ_DARKNESS1'), +(-1580077, 'Destruction!', 12506, 1, 'KJ - SAY_KJ_DARKNESS2'), +(-1580078, 'Oblivion!', 12507, 1, 'KJ - SAY_KJ_DARKNESS3'), +(-1580079, 'I will not be denied! This world shall fall!', 12508, 1, 'KJ - SAY_KJ_PHASE3'), +(-1580080, 'Do not harbor false hope. You cannot win!', 12509, 1, 'KJ - SAY_KJ_PHASE4'), +(-1580081, 'Aggghh! The powers of the Sunwell... turned... against me! What have you done? WHAT HAVE YOU DONE?', 12510, 1, 'KJ - SAY_KJ_PHASE5'), + +(-1580082, 'Anveena, you must awaken, this world needs you!', 12445, 1, 'KJ - SAY_KALECGOS_AWAKEN'), +(-1580083, 'I serve only the Master now.', 12511, 1, 'KJ - SAY_ANVEENA_IMPRISONED'), +(-1580084, 'You must let go! You must become what you were always meant to be! The time is now, Anveena!', 12446, 1, 'KJ - SAY_KALECGOS_LETGO'), +(-1580085, 'But I\'m... lost... I cannot find my way back!', 12512, 1, 'KJ - SAY_ANVEENA_LOST'), +(-1580086, 'Anveena, I love you! Focus on my voice, come back for me now! Only you can cleanse the Sunwell!', 12447, 1, 'KJ - SAY_KALECGOS_FOCUS'), +(-1580087, 'Kalec... Kalec?', 12513, 1, 'KJ - SAY_ANVEENA_KALEC'), +(-1580088, 'Yes, Anveena! Let fate embrace you now!', 12448, 1, 'KJ - SAY_KALECGOS_FATE'), +(-1580089, 'The nightmare is over, the spell is broken! Goodbye, Kalec, my love!', 12514, 1, 'KJ - SAY_ANVEENA_GOODBYE'), +(-1580090, 'Goodbye, Anveena, my love. Few will remember your name, yet this day you change the course of destiny. What was once corrupt is now pure. Heroes, do not let her sacrifice be in vain.', 12450, 1, 'KJ - SAY_KALECGOS_GOODBYE'), +(-1580091, 'Strike now, heroes, while he is weakened! Vanquish the Deceiver!', 12449, 1, 'KJ - SAY_KALECGOS_ENCOURAGE'), + +(-1580092, 'You are not alone. The Blue Dragonflight shall help you vanquish the Deceiver.', 12438, 1, 'KJ - SAY_KALECGOS_JOIN'), +(-1580093, 'Nooooooooooooo!', 12527, 1, 'KJ - SAY_KJ_DEATH'), +(-1580094, 'begins to channel dark energy', 0, 3, 'KJ - EMOTE_KJ_DARKNESS'), + +(-1580095, 'I will channel my power into the orbs, be ready!', 12440, 1, 'KJ - SAY_KALEC_ORB_READY1'), +(-1580096, 'I have empowered another orb! Use it quickly!', 12441, 1, 'KJ - SAY_KALEC_ORB_READY2'), +(-1580097, 'Another orb is ready! Make haste!', 12442, 1, 'KJ - SAY_KALEC_ORB_READY3'), +(-1580098, 'I have channeled all I can! The power is in your hands!', 12443, 1, 'KJ - SAY_KALEC_ORB_READY4'), + +(-1580099, 'Mortal heroes, your victory here today was foretold long ago. My brother\'s anguished cry of defeat will echo across the universe, bringing renewed hope to all those who still stand against the Burning Crusade.', 12515, 0, 'prophet velen - SAY1'), +(-1580100, 'As the Legion\'s final defeat draws ever-nearer, stand proud in the knowledge that you have saved worlds without number from the flame. Just as this day marks an ending, so too does it herald a new beginning...', 12516, 0, 'prophet velen - SAY2'), -- van mégegy hang 12517 ami ehhez tartozik +(-1580101, 'The creature Entropius, whom you were forced to destroy, was once the noble naaru, M\'uru. In life, M\'uru channeled vast energies of LIGHT and HOPE. For a time, a misguided few sought to steal those energies...', 12518, 0, 'prophet velen - SAY3'), +(-1580102, 'Then fortunate it is, that I have reclaimed the noble naaru\'s spark from where it fell! Where faith dwells, hope is never lost, young blood elf.', 12519, 0, 'prophet velen - SAY4'), +(-1580103, 'Gaze now, mortals - upon the HEART OF M\'URU! Unblemished. Bathed by the light of Creation - just as it was at the Dawn.', 12520, 0, 'prophet velen - SAY5'), +(-1580104, 'In time, the light and hope held within - will rebirth more than this mere fount of power... Mayhap, they will rebirth the soul of a nation.', 12521, 0, 'prophet velen - SAY6'), +(-1580105, 'Salvation, young one. It waits for us all.', 12522, 0, 'prophet velen - SAY7'), +(-1580106, 'Farewell...', 12523, 0, 'prophet velen - SAY8'), + +(-1580107, 'Our arrogance was unpardonable. We damned one of the most noble beings of all. We may never atone for this sin.', 12524, 0, 'lady liadrinn - SAY1'), +(-1580108, 'Can it be?', 12525, 0, 'lady liadrinn - SAY2'), +(-1580109, 'Blessed ancestors! I feel it... so much love... so much grace... there are... no words... impossible to describe...', 12525, 0, 'lady liadrinn - SAY3'); + +-- Kil'jaeden script -- +UPDATE `creature_template` SET `ScriptName` = 'boss_kiljaeden' WHERE `entry` = 25315; +UPDATE `creature_template` SET `ScriptName` = 'boss_kalecgosKJ' WHERE `entry` = 25319; +UPDATE `creature_template` SET `ScriptName` = 'mob_kiljaeden_controller' WHERE `entry` = 25608; +UPDATE `creature_template` SET `ScriptName` = 'mob_hand_of_the_deceiver' WHERE `entry` = 25588; +UPDATE `creature_template` SET `ScriptName` = 'mob_felfire_portal' WHERE `entry` = 25603; +UPDATE `creature_template` SET `ScriptName` = 'mob_volatile_felfire_fiend' WHERE `entry` = 25598; +UPDATE `creature_template` SET `ScriptName` = 'mob_armageddon' WHERE `entry` = 25735; +UPDATE `creature_template` SET `ScriptName` = 'mob_shield_orb' WHERE `entry` = 25502; +UPDATE `creature_template` SET `ScriptName` = 'mob_sinster_reflection' WHERE `entry` = 25708; +UPDATE `gameobject_template` SET `ScriptName` = 'go_orb_of_the_blue_flight' WHERE `entry` = 188415; + +-- M'uru& Entropius -- +UPDATE `creature_template` SET `ScriptName` = "npc_void_sentinel" WHERE `entry` = 25772; +UPDATE `creature_template` SET `ScriptName` = "npc_dark_fiend" WHERE `entry` = 25744; +UPDATE `creature_template` SET `ScriptName` = "boss_muru" WHERE `entry` = 25741; +UPDATE `creature_template` SET `ScriptName` = "boss_entropius" WHERE `entry` = 25840; +UPDATE `creature_template` SET `ScriptName` = "npc_muru_portal" WHERE `entry` = 25770; +UPDATE `creature_template` SET `ScriptName` = "mob_eventai" WHERE `entry` = 25798;
\ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp index 539548af9da..beed5619320 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp @@ -16,62 +16,75 @@ /* ScriptData SDName: Boss_Brutallus -SD%Complete: 50 -SDComment: Intro not made. Script for Madrigosa to be added here. +SD%Complete: 80 +SDComment: Find a way to start the intro, best code for the intro EndScriptData */ #include "precompiled.h" #include "def_sunwell_plateau.h" -#define YELL_INTRO -1580017 -#define YELL_INTRO_BREAK_ICE -1580018 -#define YELL_INTRO_CHARGE -1580019 -#define YELL_INTRO_KILL_MADRIGOSA -1580020 -#define YELL_INTRO_TAUNT -1580021 - -#define YELL_MADR_ICE_BARRIER -1580031 -#define YELL_MADR_INTRO -1580032 -#define YELL_MADR_ICE_BLOCK -1580033 -#define YELL_MADR_TRAP -1580034 -#define YELL_MADR_DEATH -1580035 - -#define YELL_AGGRO -1580022 -#define YELL_KILL1 -1580023 -#define YELL_KILL2 -1580024 -#define YELL_KILL3 -1580025 -#define YELL_LOVE1 -1580026 -#define YELL_LOVE2 -1580027 -#define YELL_LOVE3 -1580028 -#define YELL_BERSERK -1580029 -#define YELL_DEATH -1580030 - -#define SPELL_METEOR_SLASH 45150 -#define SPELL_BURN 45141 -#define SPELL_STOMP 45185 -#define SPELL_BERSERK 26662 -#define SPELL_DUAL_WIELD 42459 - -#define FREEZING 45203 -#define FROST_BOLT 44843 -#define ENCAPSULATE 45665 -#define ENCAPSULATE_CHANELLING 45661 +enum Quotes +{ + YELL_INTRO = -1580017, + YELL_INTRO_BREAK_ICE = -1580018, + YELL_INTRO_CHARGE = -1580019, + YELL_INTRO_KILL_MADRIGOSA = -1580020, + YELL_INTRO_TAUNT = -1580021, + + YELL_MADR_ICE_BARRIER = -1580031, + YELL_MADR_INTRO = -1580032, + YELL_MADR_ICE_BLOCK = -1580033, + YELL_MADR_TRAP = -1580034, + YELL_MADR_DEATH = -1580035, + + YELL_AGGRO = -1580022, + YELL_KILL1 = -1580023, + YELL_KILL2 = -1580024, + YELL_KILL3 = -1580025, + YELL_LOVE1 = -1580026, + YELL_LOVE2 = -1580027, + YELL_LOVE3 = -1580028, + YELL_BERSERK = -1580029, + YELL_DEATH = -1580030 +}; + +enum Spells +{ + SPELL_METEOR_SLASH = 45150, + SPELL_BURN = 46394, + SPELL_STOMP = 45185, + SPELL_BERSERK = 26662, + SPELL_DUAL_WIELD = 42459, + + SPELL_INTRO_FROST_BLAST = 45203, + SPELL_INTRO_FROSTBOLT = 44843, + SPELL_INTRO_ENCAPSULATE = 45665, + SPELL_INTRO_ENCAPSULATE_CHANELLING = 45661 +}; + +#define FELMYST 25038 struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI { - boss_brutallusAI(Creature *c) : ScriptedAI(c) - { + boss_brutallusAI(Creature *c) : ScriptedAI(c){ pInstance = ((ScriptedInstance*)c->GetInstanceData()); } ScriptedInstance* pInstance; + Unit* Madrigosa; uint32 SlashTimer; uint32 BurnTimer; uint32 StompTimer; uint32 BerserkTimer; - uint32 ConversationTimer; + uint32 IntroPhase; + uint32 IntroPhaseTimer; + uint32 IntroFrostBoltTimer; + bool Intro; + bool IsIntro; + bool Enraged; void Reset() { @@ -79,10 +92,31 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI StompTimer = 30000; BurnTimer = 60000; BerserkTimer = 360000; + + IntroPhase = 0; + IntroPhaseTimer = 0; + IntroFrostBoltTimer = 0; + + IsIntro = false; + Enraged = false; + Intro = true; //for debug + m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Madrigosa = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_MADRIGOSA)); + //Creature* boss = Unit::GetCreature((*m_creature),AzgalorGUID); + if(!Madrigosa) error_log("Madrigosa ist nicht zu finden"); + + if(Intro && Madrigosa){ + if(!Madrigosa->isAlive()) + EndIntro(); + else error_log("Madrigosa is Tod"); + } + else + EndIntro(); if(pInstance) - pInstance->SetData(DATA_BRUTALLUS, NOT_STARTED); + pInstance->SetData(DATA_BRUTALLUS_EVENT, NOT_STARTED); } void Aggro(Unit *who) @@ -90,16 +124,16 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI DoScriptText(YELL_AGGRO, m_creature); if(pInstance) - pInstance->SetData(DATA_BRUTALLUS, IN_PROGRESS); + pInstance->SetData(DATA_BRUTALLUS_EVENT, IN_PROGRESS); } void KilledUnit(Unit* victim) { switch(rand()%3) { - case 0: DoScriptText(YELL_KILL1, m_creature); break; - case 1: DoScriptText(YELL_KILL2, m_creature); break; - case 2: DoScriptText(YELL_KILL3, m_creature); break; + case 0: DoScriptText(YELL_KILL1, m_creature); break; + case 1: DoScriptText(YELL_KILL2, m_creature); break; + case 2: DoScriptText(YELL_KILL3, m_creature); break; } } @@ -107,18 +141,142 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI { DoScriptText(YELL_DEATH, m_creature); - if(pInstance) - pInstance->SetData(DATA_BRUTALLUS, DONE); + if(pInstance){ + pInstance->SetData(DATA_BRUTALLUS_EVENT, DONE); + float x,y,z; + m_creature->GetPosition(x,y,z); + m_creature->SummonCreature(FELMYST, x,y, z+30, m_creature->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0); + } } - void UpdateAI(const uint32 diff) + void StartIntro() + { + if(!Intro) + return; + if(Madrigosa){ + Madrigosa->setDeathState(ALIVE); + Madrigosa->setActive(true); + IsIntro = true; + } + error_log("Starte das Intro"); + } + + void EndIntro() + { + error_log("Beende das Intro"); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Intro = false; + IsIntro = false; + } + + void DoIntro() { - if (!UpdateVictim() ) + if(!Madrigosa) return; + switch(IntroPhase) + { + case 0: + DoScriptText(YELL_MADR_ICE_BARRIER, Madrigosa); + IntroPhaseTimer = 5000; + ++IntroPhase; + break; + case 1: + m_creature->SetInFront(Madrigosa); + Madrigosa->SetInFront(m_creature); + DoScriptText(YELL_MADR_INTRO, Madrigosa, m_creature); + IntroPhaseTimer = 9000; + ++IntroPhase; + break; + case 2: + DoScriptText(YELL_INTRO, m_creature, Madrigosa); + IntroPhaseTimer = 13000; + ++IntroPhase; + break; + case 3: + DoCast(m_creature, SPELL_INTRO_FROST_BLAST); + Madrigosa->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + IntroFrostBoltTimer = 3000; + IntroPhaseTimer = 28000; + ++IntroPhase; + break; + case 4: + DoScriptText(YELL_INTRO_BREAK_ICE, m_creature); + IntroPhaseTimer = 6000; + ++IntroPhase; + break; + case 5: + Madrigosa->CastSpell(m_creature, SPELL_INTRO_ENCAPSULATE_CHANELLING, false); + DoScriptText(YELL_MADR_TRAP, Madrigosa); + DoCast(m_creature, SPELL_INTRO_ENCAPSULATE); + IntroPhaseTimer = 11000; + ++IntroPhase; + break; + case 6: + m_creature->SetSpeed(MOVE_RUN, 4.0f, true); + DoScriptText(YELL_INTRO_CHARGE, m_creature); + IntroPhaseTimer = 3000; + ++IntroPhase; + break; + case 7: + m_creature->DealDamage(Madrigosa, Madrigosa->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, true); + DoScriptText(YELL_MADR_DEATH, Madrigosa); + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->AttackStop(); + m_creature->SetSpeed(MOVE_RUN, 1.0f, true); + IntroPhaseTimer = 3000; + ++IntroPhase; + break; + case 8: + DoScriptText(YELL_INTRO_KILL_MADRIGOSA, m_creature); + m_creature->SetOrientation(0.14); + Madrigosa->setDeathState(CORPSE); + IntroPhaseTimer = 5000; + ++IntroPhase; + break; + case 9: + DoScriptText(YELL_INTRO_TAUNT, m_creature); + IntroPhaseTimer = 5000; + ++IntroPhase; + break; + case 10: + EndIntro(); + break; + } + } + + void MoveInLineOfSight(Unit *who){ + if(pInstance && Intro) + pInstance->SetData(DATA_BRUTALLUS_EVENT, SPECIAL); + } + + void UpdateAI(const uint32 diff) + { + if(Intro && !IsIntro) + StartIntro(); + + if(IsIntro) + { + if(IntroPhaseTimer < diff){ + DoIntro(); + }else IntroPhaseTimer -= diff; + + if(IntroPhase == 3 + 1){ + if(IntroFrostBoltTimer < diff){ + if(Madrigosa){ + Madrigosa->CastSpell(m_creature, SPELL_INTRO_FROSTBOLT, false); + IntroFrostBoltTimer = 2000; + } + }else IntroFrostBoltTimer -= diff; + } + } + + if(!UpdateVictim() || IsIntro) + return; + if(SlashTimer < diff) { - DoCast(m_creature->getVictim(),SPELL_METEOR_SLASH); + DoCast(m_creature->getVictim(), SPELL_METEOR_SLASH); SlashTimer = 11000; }else SlashTimer -= diff; @@ -126,14 +284,11 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI { switch(rand()%3) { - case 0: DoScriptText(YELL_LOVE1, m_creature); break; - case 1: DoScriptText(YELL_LOVE2, m_creature); break; - case 2: DoScriptText(YELL_LOVE3, m_creature); break; + case 0: DoScriptText(YELL_LOVE1, m_creature); break; + case 1: DoScriptText(YELL_LOVE2, m_creature); break; + case 2: DoScriptText(YELL_LOVE3, m_creature); break; } - - Unit *Target = m_creature->getVictim(); - DoCast(Target,SPELL_STOMP); - if(Target->HasAura(45151,0)) Target->RemoveAura(45151,0); + DoCast(m_creature->getVictim(), SPELL_STOMP); StompTimer = 30000; }else StompTimer -= diff; @@ -142,33 +297,30 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) target->CastSpell(target,SPELL_BURN,true); BurnTimer = 60000; - } - else BurnTimer -= diff; + }else BurnTimer -= diff; - if(BerserkTimer < diff) + if(BerserkTimer < diff && !Enraged) { DoScriptText(YELL_BERSERK, m_creature); - DoCast(m_creature,SPELL_BERSERK); - BerserkTimer = 20000; - } - else BerserkTimer -= diff; + DoCast(m_creature, SPELL_BERSERK); + Enraged = true; + }else BerserkTimer -= diff; DoMeleeAttackIfReady(); } - }; CreatureAI* GetAI_boss_brutallus(Creature *_Creature) { return new boss_brutallusAI (_Creature); } - + void AddSC_boss_brutallus() { Script *newscript; + newscript = new Script; newscript->Name="boss_brutallus"; newscript->GetAI = &GetAI_boss_brutallus; newscript->RegisterSelf(); } - diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp index 0b013d8fe93..3f02911e5f3 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2009 Trinity <http://www.trinitycore.org/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -23,99 +23,98 @@ EndScriptData */ #include "precompiled.h" #include "def_sunwell_plateau.h" -//Intro -#define YELL_INTRO_SAC_1 "Misery..." -#define YELL_INTRO_ALY_2 "Depravity..." -#define YELL_INTRO_SAC_3 "Confusion..." -#define YELL_INTRO_ALY_4 "Hatred..." -#define YELL_INTRO_SAC_5 "Mistrust..." -#define YELL_INTRO_ALY_6 "Chaos..." -#define YELL_INTRO_SAC_7 "These are the hallmarks..." -#define YELL_INTRO_ALY_8 "These are the pillars..." - -// Lady Sacrolash -#define LADY_SACROLASH 25165 - -#define SPELL_DARK_TOUCHED 45347 -#define SPELL_SHADOW_BLADES 45248//10 secs -#define SPELL_DARK_STRIKE 45271 -#define SPELL_SHADOW_NOVA 45329//30-35 secs -#define SPELL_CONFOUNDING_BLOW 45256//25 secs - -#define MOB_SHADOW_IMAGE 25214 -#define SPELL_SHADOW_FURY 45270 -#define SPELL_IMAGE_VISUAL 45263 - -#define SOUND_INTRO 12484 -#define YELL_SHADOW_NOVA "Shadow to the aid of fire!" //only if Alythess is not dead -#define SOUND_SHADOW_NOVA 12485 -#define YELL_SISTER_ALYTHESS_DEAD "Alythess! Your fire burns within me!" -#define SOUND_SISTER_ALYTHESS_DEAD 12488 -#define YELL_SAC_KILL_1 "Shadow engulf." -#define SOUND_SAC_KILL_1 12486 -#define YELL_SAC_KILL_2 "Ee-nok Kryul!" -#define SOUND_SAC_KILL_2 12487 -#define SAY_SAC_DEAD "I... fade." -#define YELL_ENRAGE "Time is a luxury you no longer possess!" - -//enrage 6 minutes -#define SPELL_ENRAGE 46587 -//empower after sister is death -#define SPELL_EMPOWER 45366 - -//debuff prevents touched spell for 3 secounds -#define SPELL_DARK_FLAME 45345 - -//Grand Warlock Alythess -// Don't move only spamm spells ... -#define GRAND_WARLOCK_ALYTHESS 25166 - -#define SPELL_PYROGENICS 45230//15secs -#define SPELL_FLAME_TOUCHED 45348 -#define SPELL_CONFLAGRATION 45342//30-35 secs -#define SPELL_BLAZE 45235//on main target every 3 secs -#define SPELL_FLAME_SEAR 46771 -#define SPELL_BLAZE_SUMMON 45236 //187366 GO -#define SPELL_BLAZE_BURN 45246 - -#define YELL_CANFLAGRATION "Fire to the aid of shadow!" //only if Sacrolash is not dead -#define SOUND_CANFLAGRATION 12489 -#define YELL_SISTER_SACROLASH_DEAD "Sacrolash!" -#define SOUND_SISTER_SACROLASH_DEAD 12492 -#define YELL_ALY_KILL_1 "Fire consume." -#define SOUND_ALY_KILL_1 12490 -#define YELL_ALY_KILL_2 "Ed-ir Halach!" -#define SOUND_ALY_KILL_2 12491 -#define YELL_ALY_DEAD "De-ek Anur!" -#define SOUND_ALY_DEAD 12494 -#define YELL_BERSERK "Your luck has run its curse!" -#define SOUND_BERSERK 12493 +enum Quotes +{ + //Alytesh + YELL_CANFLAGRATION = -1580044, + YELL_SISTER_SACROLASH_DEAD = -1580045, + YELL_ALY_KILL_1 = -1580046, + YELL_ALY_KILL_2 = -1580047, + YELL_ALY_DEAD = -1580048, + YELL_BERSERK = -1580049, + + //Sacrolash + YELL_SHADOW_NOVA = -1580050, + YELL_SISTER_ALYTHESS_DEAD = -1580051, + YELL_SAC_KILL_1 = -1580052, + YELL_SAC_KILL_2 = -1580053, + SAY_SAC_DEAD = -1580054, + YELL_ENRAGE = -1580055, + + //Intro + YELL_INTRO_SAC_1 = -1580056, + YELL_INTRO_ALY_2 = -1580057, + YELL_INTRO_SAC_3 = -1580058, + YELL_INTRO_ALY_4 = -1580059, + YELL_INTRO_SAC_5 = -1580060, + YELL_INTRO_ALY_6 = -1580061, + YELL_INTRO_SAC_7 = -1580062, + YELL_INTRO_ALY_8 = -1580063, + + //Emote + EMOTE_SHADOW_NOVA = -1580064, + EMOTE_CONFLAGRATION = -1580065 +}; +enum Spells +{ + //Lady Sacrolash spells + SPELL_DARK_TOUCHED = 45347, + SPELL_SHADOW_BLADES = 45248, //10 secs + SPELL_DARK_STRIKE = 45271, + SPELL_SHADOW_NOVA = 45329, //30-35 secs + SPELL_CONFOUNDING_BLOW = 45256, //25 secs + + //Shadow Image spells + SPELL_SHADOW_FURY = 45270, + SPELL_IMAGE_VISUAL = 45263, + + //Misc spells + SPELL_ENRAGE = 46587, + SPELL_EMPOWER = 45366, + SPELL_DARK_FLAME = 45345, + + //Grand Warlock Alythess spells + SPELL_PYROGENICS = 45230, //15secs + SPELL_FLAME_TOUCHED = 45348, + SPELL_CONFLAGRATION = 45342, //30-35 secs + SPELL_BLAZE = 45235, //on main target every 3 secs + SPELL_FLAME_SEAR = 46771, + SPELL_BLAZE_SUMMON = 45236, //187366 GO + SPELL_BLAZE_BURN = 45246 +}; + +enum Creatures +{ + GRAND_WARLOCK_ALYTHESS = 25166, + MOB_SHADOW_IMAGE = 25214, + LADY_SACROLASH = 25165 +}; struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI { - boss_sacrolashAI(Creature *c) : ScriptedAI(c) - { + boss_sacrolashAI(Creature *c) : ScriptedAI(c){ pInstance = ((ScriptedInstance*)c->GetInstanceData()); } ScriptedInstance *pInstance; - bool InCombat; - bool sisterdeath; - - uint32 shadowblades_timer; - uint32 shadownova_timer; - uint32 confoundingblow_timer; - uint32 shadowimage_timer; - - uint32 conflagration_timer; + bool InCombat; + bool SisterDeath; + bool Enraged; - uint32 enrage_timer; + uint32 ShadowbladesTimer; + uint32 ShadownovaTimer; + uint32 ConfoundingblowTimer; + uint32 ShadowimageTimer; + uint32 ConflagrationTimer; + uint32 EnrageTimer; void Reset() { InCombat = false; + Enraged = false; + if(pInstance) { Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS)); @@ -135,26 +134,33 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI if(!InCombat) { - shadowblades_timer = 10000; - shadownova_timer = 30000; - confoundingblow_timer = 25000; - shadowimage_timer = 20000; - conflagration_timer = 30000; - sisterdeath = false; + ShadowbladesTimer = 10000; + ShadownovaTimer = 30000; + ConfoundingblowTimer = 25000; + ShadowimageTimer = 20000; + ConflagrationTimer = 30000; + EnrageTimer = 360000; - enrage_timer = 360000; + SisterDeath = false; } + if(pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED); } + void Aggro(Unit *who) { DoZoneInCombat(); + if(pInstance) { Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) ((Creature*)Temp)->AI()->AttackStart(who); } + + if(pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, IN_PROGRESS); } void KilledUnit(Unit *victim) @@ -163,14 +169,8 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI { switch (rand()%2) { - case 0: - DoPlaySoundToSet(m_creature,SOUND_SAC_KILL_1); - DoYell(YELL_SAC_KILL_1 ,LANG_UNIVERSAL,NULL); - break; - case 1: - DoPlaySoundToSet(m_creature,SOUND_SAC_KILL_2); - DoYell(YELL_SAC_KILL_2 ,LANG_UNIVERSAL,NULL); - break; + case 0: DoScriptText(YELL_SAC_KILL_1, m_creature); break; + case 1: DoScriptText(YELL_SAC_KILL_2, m_creature); break; } } } @@ -178,14 +178,15 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI void JustDied(Unit* Killer) { // only if ALY death - if (sisterdeath) + if (SisterDeath) { - DoYell(SAY_SAC_DEAD ,LANG_UNIVERSAL,NULL); + DoScriptText(SAY_SAC_DEAD, m_creature); + + if(pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE); } else - { m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } } void SpellHitTarget(Unit* target,const SpellEntry* spell) @@ -209,29 +210,23 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI switch(TouchedType) { case SPELL_FLAME_TOUCHED: - if(!target->HasAura(SPELL_DARK_FLAME,0)) + if(!target->HasAura(SPELL_DARK_FLAME, 0)) { - if(target->HasAura(SPELL_DARK_TOUCHED,0)) + if(target->HasAura(SPELL_DARK_TOUCHED, 0)) { target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED); - target->CastSpell(target,SPELL_DARK_FLAME,true); - }else - { - target->CastSpell(target,SPELL_FLAME_TOUCHED,true); - } + target->CastSpell(target, SPELL_DARK_FLAME, true); + }else target->CastSpell(target, SPELL_FLAME_TOUCHED, true); } break; case SPELL_DARK_TOUCHED: - if(!target->HasAura(SPELL_DARK_FLAME,0)) + if(!target->HasAura(SPELL_DARK_FLAME, 0)) { - if(target->HasAura(SPELL_FLAME_TOUCHED,0)) + if(target->HasAura(SPELL_FLAME_TOUCHED, 0)) { target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); - target->CastSpell(target,SPELL_DARK_FLAME,true); - }else - { - target->CastSpell(target,SPELL_DARK_TOUCHED,true); - } + target->CastSpell(target, SPELL_DARK_FLAME, true); + }else target->CastSpell(target, SPELL_DARK_TOUCHED, true); } break; } @@ -239,7 +234,7 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if(!sisterdeath) + if(!SisterDeath) { if (pInstance) { @@ -247,12 +242,10 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS)); if (Temp && Temp->isDead()) { - DoYell(YELL_SISTER_ALYTHESS_DEAD ,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SISTER_ALYTHESS_DEAD); - sisterdeath = true; - - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + DoScriptText(YELL_SISTER_ALYTHESS_DEAD, m_creature); DoCast(m_creature,SPELL_EMPOWER); + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + SisterDeath = true; } } } @@ -260,54 +253,52 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI if (!UpdateVictim()) return; - if(sisterdeath) + if(SisterDeath) { - if (conflagration_timer < diff) + if (ConflagrationTimer < diff) { if (!m_creature->IsNonMeleeSpellCasted(false)) { m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM, 0); - DoCast(target,SPELL_CONFLAGRATION); - conflagration_timer = 30000+(rand()%5000); + DoCast(target, SPELL_CONFLAGRATION); + ConflagrationTimer = 30000+(rand()%5000); } - }else conflagration_timer -= diff; + }else ConflagrationTimer -= diff; } else { - if(shadownova_timer < diff) + if(ShadownovaTimer < diff) { if (!m_creature->IsNonMeleeSpellCasted(false)) { Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM, 0); - DoCast(target,SPELL_SHADOW_NOVA); + DoCast(target, SPELL_SHADOW_NOVA); - if(!sisterdeath) + if(!SisterDeath) { - m_creature->MonsterTextEmote("directs Shadow Nova at $N",target->GetGUID(),true); - DoPlaySoundToSet(m_creature,SOUND_SHADOW_NOVA); - DoYell(YELL_SHADOW_NOVA,LANG_UNIVERSAL,NULL); + DoScriptText(EMOTE_SHADOW_NOVA, m_creature, target); + DoScriptText(YELL_SHADOW_NOVA, m_creature); } - - shadownova_timer= 30000+(rand()%5000); + ShadownovaTimer = 30000+(rand()%5000); } - }else shadownova_timer -=diff; + }else ShadownovaTimer -=diff; } - if(confoundingblow_timer < diff) + if(ConfoundingblowTimer < diff) { if (!m_creature->IsNonMeleeSpellCasted(false)) { Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM, 0); - DoCast(target,SPELL_CONFOUNDING_BLOW); - confoundingblow_timer = 20000 + (rand()%5000); + DoCast(target, SPELL_CONFOUNDING_BLOW); + ConfoundingblowTimer = 20000 + (rand()%5000); } - }else confoundingblow_timer -=diff; + }else ConfoundingblowTimer -=diff; - if(shadowimage_timer < diff) + if(ShadowimageTimer < diff) { Unit* target = NULL; Creature* temp = NULL; @@ -317,26 +308,25 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI temp = DoSpawnCreature(MOB_SHADOW_IMAGE,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN,10000); temp->AI()->AttackStart(target); } - shadowimage_timer = 20000; - }else shadowimage_timer -=diff; + ShadowimageTimer = 20000; + }else ShadowimageTimer -=diff; - if(shadowblades_timer < diff) + if(ShadowbladesTimer < diff) { if (!m_creature->IsNonMeleeSpellCasted(false)) { - DoCast(m_creature,SPELL_SHADOW_BLADES); - shadowblades_timer = 10000; - + DoCast(m_creature, SPELL_SHADOW_BLADES); + ShadowbladesTimer = 10000; } - }else shadowblades_timer -=diff; + }else ShadowbladesTimer -=diff; - if (enrage_timer < diff) + if (EnrageTimer < diff && !Enraged) { m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - DoYell(YELL_ENRAGE ,LANG_UNIVERSAL,NULL); + DoScriptText(YELL_ENRAGE, m_creature); DoCast(m_creature,SPELL_ENRAGE); - enrage_timer = 300000; - }else enrage_timer -= diff; + Enraged = true; + }else EnrageTimer -= diff; if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) { @@ -358,29 +348,32 @@ CreatureAI* GetAI_boss_sacrolash(Creature *_Creature) struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI { - boss_alythessAI(Creature *c) : Scripted_NoMovementAI(c) - { - pInstance = ((ScriptedInstance*)c->GetInstanceData()); IntroStepCounter = 10; + boss_alythessAI(Creature *c) : Scripted_NoMovementAI(c){ + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + IntroStepCounter = 10; } ScriptedInstance *pInstance; - bool InCombat; - bool sisterdeath; - uint32 IntroStepCounter; - uint32 IntroYell_Timer; - uint32 conflagration_timer; - uint32 blaze_timer; - uint32 pyrogenics_timer; + bool InCombat; + bool SisterDeath; + bool Enraged; - uint32 shadownova_timer; - uint32 flamesear_timer; + uint32 IntroStepCounter; + uint32 IntroYellTimer; - uint32 enrage_timer; + uint32 ConflagrationTimer; + uint32 BlazeTimer; + uint32 PyrogenicsTimer; + uint32 ShadownovaTimer; + uint32 FlamesearTimer; + uint32 EnrageTimer; void Reset() { InCombat = false; + Enraged = false; + if(pInstance) { Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH)); @@ -400,25 +393,34 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI if(!InCombat) { - conflagration_timer = 45000; - blaze_timer = 100; - pyrogenics_timer = 15000; - shadownova_timer = 40000; - sisterdeath = false; - enrage_timer = 360000; - flamesear_timer = 15000; - IntroYell_Timer = 10000; + ConflagrationTimer = 45000; + BlazeTimer = 100; + PyrogenicsTimer = 15000; + ShadownovaTimer = 40000; + EnrageTimer = 360000; + FlamesearTimer = 15000; + IntroYellTimer = 10000; + + SisterDeath = false; } + + if(pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED); } + void Aggro(Unit *who) { DoZoneInCombat(); + if(pInstance) { Unit* Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH)); if (Temp && Temp->isAlive() && !(Temp->getVictim())) ((Creature*)Temp)->AI()->AttackStart(who); } + + if(pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, IN_PROGRESS); } void AttackStart(Unit *who) @@ -460,29 +462,23 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI { switch (rand()%2) { - case 0: - DoPlaySoundToSet(m_creature,SOUND_ALY_KILL_1); - DoYell(YELL_ALY_KILL_1 ,LANG_UNIVERSAL,NULL); - break; - case 1: - DoPlaySoundToSet(m_creature,SOUND_ALY_KILL_2); - DoYell(YELL_ALY_KILL_2 ,LANG_UNIVERSAL,NULL); - break; + case 0: DoScriptText(YELL_ALY_KILL_1, m_creature); break; + case 1: DoScriptText(YELL_ALY_KILL_2, m_creature); break; } } } void JustDied(Unit* Killer) { - if (sisterdeath) + if (SisterDeath) { - DoYell(YELL_ALY_DEAD ,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_ALY_DEAD); + DoScriptText(YELL_ALY_DEAD, m_creature); + + if(pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, NOT_STARTED); } else - { m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } } void SpellHitTarget(Unit* target,const SpellEntry* spell) @@ -491,7 +487,7 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI { case SPELL_BLAZE: - target->CastSpell(target,SPELL_BLAZE_SUMMON,true); + target->CastSpell(target, SPELL_BLAZE_SUMMON, true); case SPELL_CONFLAGRATION: case SPELL_FLAME_SEAR: HandleTouchedSpells(target, SPELL_FLAME_TOUCHED); @@ -507,29 +503,26 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI switch(TouchedType) { case SPELL_FLAME_TOUCHED: - if(!target->HasAura(SPELL_DARK_FLAME,0)) + if(!target->HasAura(SPELL_DARK_FLAME, 0)) { - if(target->HasAura(SPELL_DARK_TOUCHED,0)) + if(target->HasAura(SPELL_DARK_TOUCHED, 0)) { target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED); - target->CastSpell(target,SPELL_DARK_FLAME,true); + target->CastSpell(target, SPELL_DARK_FLAME, true); }else { - target->CastSpell(target,SPELL_FLAME_TOUCHED,true); + target->CastSpell(target, SPELL_FLAME_TOUCHED, true); } } break; case SPELL_DARK_TOUCHED: - if(!target->HasAura(SPELL_DARK_FLAME,0)) + if(!target->HasAura(SPELL_DARK_FLAME, 0)) { - if(target->HasAura(SPELL_FLAME_TOUCHED,0)) + if(target->HasAura(SPELL_FLAME_TOUCHED, 0)) { target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); - target->CastSpell(target,SPELL_DARK_FLAME,true); - }else - { - target->CastSpell(target,SPELL_DARK_TOUCHED,true); - } + target->CastSpell(target, SPELL_DARK_FLAME, true); + }else target->CastSpell(target, SPELL_DARK_TOUCHED, true); } break; } @@ -537,38 +530,30 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI uint32 IntroStep(uint32 step) { - Creature* Sacrolash = Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_SACROLASH)); + Creature* Sacrolash = (Creature*)Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH)); switch (step) { - case 0: DoPlaySoundToSet(m_creature,SOUND_INTRO); return 0; - case 1: + case 0: return 0; + case 1: if(Sacrolash) - Sacrolash->Yell(YELL_INTRO_SAC_1, LANG_UNIVERSAL,NULL); - return 1000; - case 2: - m_creature->Yell(YELL_INTRO_ALY_2, LANG_UNIVERSAL,NULL); + DoScriptText(YELL_INTRO_SAC_1, Sacrolash); return 1000; + case 2: DoScriptText(YELL_INTRO_ALY_2, m_creature); return 1000; case 3: if(Sacrolash) - Sacrolash->Yell(YELL_INTRO_SAC_3, LANG_UNIVERSAL,NULL); + DoScriptText(YELL_INTRO_SAC_3, Sacrolash); return 2000; - case 4: - m_creature->Yell(YELL_INTRO_ALY_4, LANG_UNIVERSAL,NULL); - return 1000; + case 4: DoScriptText(YELL_INTRO_ALY_4, m_creature); return 1000; case 5: if(Sacrolash) - Sacrolash->Yell(YELL_INTRO_SAC_5, LANG_UNIVERSAL,NULL); + DoScriptText(YELL_INTRO_SAC_5, Sacrolash); return 2000; - case 6: - m_creature->Yell(YELL_INTRO_ALY_6, LANG_UNIVERSAL,NULL); - return 1000; - case 7: + case 6: DoScriptText(YELL_INTRO_ALY_6, m_creature); return 1000; + case 7: if(Sacrolash) - Sacrolash->Yell(YELL_INTRO_SAC_7, LANG_UNIVERSAL,NULL); + DoScriptText(YELL_INTRO_SAC_7, Sacrolash); return 3000; - case 8: - m_creature->Yell(YELL_INTRO_ALY_8, LANG_UNIVERSAL,NULL); - return 900000; + case 8: DoScriptText(YELL_INTRO_ALY_8, m_creature); return 900000; } return 10000; } @@ -577,13 +562,13 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI { if(IntroStepCounter < 9) { - if(IntroYell_Timer < diff) + if(IntroYellTimer < diff) { - IntroYell_Timer = IntroStep(IntroStepCounter++); - }else IntroYell_Timer -= diff; + IntroYellTimer = IntroStep(++IntroStepCounter); + }else IntroYellTimer -= diff; } - if(!sisterdeath) + if(!SisterDeath) { if (pInstance) { @@ -591,12 +576,10 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SACROLASH)); if (Temp && Temp->isDead()) { - DoYell(YELL_SISTER_SACROLASH_DEAD ,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SISTER_SACROLASH_DEAD); - sisterdeath = true; - - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - DoCast(m_creature,SPELL_EMPOWER); + DoScriptText(YELL_SISTER_SACROLASH_DEAD, m_creature); + DoCast(m_creature, SPELL_EMPOWER); + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + SisterDeath = true; } } } @@ -604,78 +587,76 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI if (!UpdateVictim()) return; - if(sisterdeath) + if(SisterDeath) { - if(shadownova_timer < diff) + if(ShadownovaTimer < diff) { if (!m_creature->IsNonMeleeSpellCasted(false)) { Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM, 0); - DoCast(target,SPELL_SHADOW_NOVA); - shadownova_timer= 30000+(rand()%5000); + DoCast(target, SPELL_SHADOW_NOVA); + ShadownovaTimer= 30000+(rand()%5000); } - }else shadownova_timer -=diff; + }else ShadownovaTimer -=diff; } else { - if (conflagration_timer < diff) + if(ConflagrationTimer < diff) { if (!m_creature->IsNonMeleeSpellCasted(false)) { m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); Unit* target = NULL; target = SelectUnit(SELECT_TARGET_RANDOM, 0); - DoCast(target,SPELL_CONFLAGRATION); - conflagration_timer = 30000+(rand()%5000); + DoCast(target, SPELL_CONFLAGRATION); + ConflagrationTimer = 30000+(rand()%5000); - if(!sisterdeath) + if(!SisterDeath) { - m_creature->MonsterTextEmote("directs Conflagration at $N",target->GetGUID(),true); - DoPlaySoundToSet(m_creature,SOUND_CANFLAGRATION); - DoYell(YELL_CANFLAGRATION,LANG_UNIVERSAL,NULL); + DoScriptText(EMOTE_CONFLAGRATION, m_creature, target); + DoScriptText(YELL_CANFLAGRATION, m_creature); } - blaze_timer = 4000; + BlazeTimer = 4000; } - }else conflagration_timer -= diff; + }else ConflagrationTimer -= diff; } - if (flamesear_timer < diff) + if(FlamesearTimer < diff) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if(!m_creature->IsNonMeleeSpellCasted(false)) { - DoCast(m_creature,SPELL_FLAME_SEAR); - flamesear_timer = 15000; + DoCast(m_creature, SPELL_FLAME_SEAR); + FlamesearTimer = 15000; } - }else flamesear_timer -=diff; + }else FlamesearTimer -=diff; - if (pyrogenics_timer < diff) + if (PyrogenicsTimer < diff) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if(!m_creature->IsNonMeleeSpellCasted(false)) { - DoCast(m_creature,SPELL_PYROGENICS,true); - pyrogenics_timer = 15000; + DoCast(m_creature, SPELL_PYROGENICS,true); + PyrogenicsTimer = 15000; } - }else pyrogenics_timer -= diff; + }else PyrogenicsTimer -= diff; - if (blaze_timer < diff) + if (BlazeTimer < diff) { - if (!m_creature->IsNonMeleeSpellCasted(false)) + if(!m_creature->IsNonMeleeSpellCasted(false)) { - DoCast(m_creature->getVictim(),SPELL_BLAZE); - blaze_timer = 3800; + DoCast(m_creature->getVictim(), SPELL_BLAZE); + BlazeTimer = 3800; } - }else blaze_timer -= diff; + }else BlazeTimer -= diff; - if (enrage_timer < diff) + if (EnrageTimer < diff && !Enraged) { m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - DoPlaySoundToSet(m_creature,SOUND_BERSERK); - DoYell(YELL_BERSERK ,LANG_UNIVERSAL,NULL); - DoCast(m_creature,SPELL_ENRAGE); - enrage_timer = 300000; - }else enrage_timer -= diff; + DoScriptText(YELL_BERSERK, m_creature); + DoCast(m_creature, SPELL_ENRAGE); + Enraged = true; + }else EnrageTimer -= diff; } }; @@ -688,16 +669,15 @@ struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI { mob_shadow_imageAI(Creature *c) : ScriptedAI(c) {} - uint32 shadowfury_timer; - uint32 kill_timer; - uint32 darkstrike_timer; + uint32 ShadowfuryTimer; + uint32 KillTimer; + uint32 DarkstrikeTimer; void Reset() { - shadowfury_timer = 5000 + (rand()%15000); - darkstrike_timer = 3000; - kill_timer = 15000; - + ShadowfuryTimer = 5000 + (rand()%15000); + DarkstrikeTimer = 3000; + KillTimer = 15000; } void Aggro(Unit *who){} @@ -709,16 +689,13 @@ struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI case SPELL_SHADOW_FURY: case SPELL_DARK_STRIKE: - if(!target->HasAura(SPELL_DARK_FLAME,0)) + if(!target->HasAura(SPELL_DARK_FLAME, 0)) { - if(target->HasAura(SPELL_FLAME_TOUCHED,0)) + if(target->HasAura(SPELL_FLAME_TOUCHED, 0)) { target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); - target->CastSpell(target,SPELL_DARK_FLAME,true); - }else - { - target->CastSpell(target,SPELL_DARK_TOUCHED,true); - } + target->CastSpell(target, SPELL_DARK_FLAME, true); + }else target->CastSpell(target,SPELL_DARK_TOUCHED,true); } break; } @@ -726,37 +703,35 @@ struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if(!m_creature->HasAura(SPELL_IMAGE_VISUAL,0)) - DoCast(m_creature,SPELL_IMAGE_VISUAL); + if(!m_creature->HasAura(SPELL_IMAGE_VISUAL, 0)) + DoCast(m_creature, SPELL_IMAGE_VISUAL); - if(kill_timer < diff) + if(KillTimer < diff) { m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - kill_timer = 9999999; - }else kill_timer -=diff; + KillTimer = 9999999; + }else KillTimer -=diff; if (!UpdateVictim()) return; - if(shadowfury_timer < diff) + if(ShadowfuryTimer < diff) { - DoCast(m_creature,SPELL_SHADOW_FURY); - shadowfury_timer = 10000; - }else shadowfury_timer -=diff; + DoCast(m_creature, SPELL_SHADOW_FURY); + ShadowfuryTimer = 10000; + }else ShadowfuryTimer -=diff; - if(darkstrike_timer < diff) + if(DarkstrikeTimer < diff) { if(!m_creature->IsNonMeleeSpellCasted(false)) { //If we are within range melee the target - if( m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - DoCast(m_creature->getVictim(),SPELL_DARK_STRIKE); - } + if( m_creature->IsWithinMeleeRange(m_creature->getVictim())) + DoCast(m_creature->getVictim(), SPELL_DARK_STRIKE); } - darkstrike_timer = 3000; + DarkstrikeTimer = 3000; } - else darkstrike_timer -= diff; + else DarkstrikeTimer -= diff; } }; @@ -768,6 +743,7 @@ CreatureAI* GetAI_mob_shadow_image(Creature *_Creature) void AddSC_boss_eredar_twins() { Script *newscript; + newscript = new Script; newscript->Name="boss_sacrolash"; newscript->GetAI = &GetAI_boss_sacrolash; @@ -783,4 +759,3 @@ void AddSC_boss_eredar_twins() newscript->GetAI = &GetAI_mob_shadow_image; newscript->RegisterSelf(); } - diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp index 68bb0ae8e44..4783473d56d 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp @@ -1,4 +1,4 @@ -/* Copyright ?2006,2007 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +/* Copyright (C) 2009 Trinity <http://www.trinitycore.org/> * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -22,76 +22,77 @@ EndScriptData */ #include "precompiled.h" #include "def_sunwell_plateau.h" -#include "Player.h" - -// AURA -#define AURA_SUNWELL_RADIANCE 45769 -#define AURA_NOXIOUS_FUMES 47002 -// LAND PHASE SPELL -#define SPELL_CLEAVE 19983 -#define SPELL_CORROSION 45866 -#define SPELL_GAS_NOVA 45855 -#define SPELL_ENCAPSULATE_CHANNEL 45661 -#define SPELL_ENCAPSULATE_EFFECT 45665 -#define SPELL_ENCAPSULATE_AOE 45662 -// FLIGHT PHASE SPELL -#define SPELL_VAPOR_SELECT 45391 // fel to player, force cast 45392, 50000y selete target -#define SPELL_VAPOR_SUMMON 45392 // player summon vapor, radius around caster, 5y, -#define SPELL_VAPOR_FORCE 45388 // vapor to fel, force cast 45389 -#define SPELL_VAPOR_CHANNEL 45389 // fel to vapor, green beam channel -#define SPELL_VAPOR_TRIGGER 45411 // linked to 45389, vapor to self, trigger 45410 and 46931 -#define SPELL_VAPOR_DAMAGE 46931 // vapor damage, 4000 -#define SPELL_TRAIL_SUMMON 45410 // vapor summon trail -#define SPELL_TRAIL_TRIGGER 45399 // trail to self, trigger 45402 -#define SPELL_TRAIL_DAMAGE 45402 // trail damage, 2000 + 2000 dot -#define SPELL_DEAD_SUMMON 45400 // summon blazing dead, 5min -#define SPELL_DEAD_PASSIVE 45415 -#define SPELL_FOG_BREATH 45495 // fel to self, speed burst -#define SPELL_FOG_TRIGGER 45582 // fog to self, trigger 45782 -#define SPELL_FOG_FORCE 45782 // fog to player, force cast 45714 -#define SPELL_FOG_INFORM 45714 // player let fel cast 45717, script effect -#define SPELL_FOG_CHARM 45717 // fel to player -#define SPELL_FOG_CHARM2 45726 // link to 45717 - -#define SPELL_TRANSFORM_TRIGGER 44885 // madrigosa to self, trigger 46350 -#define SPELL_TRANSFORM_VISUAL 46350 //46411stun? -#define SPELL_TRANSFORM_FELMYST 45068 // become fel -#define SPELL_FELMYST_SUMMON 45069 -// OTHER -#define SPELL_BERSERK 45078 -#define SPELL_CLOUD_VISUAL 45212 -#define SPELL_CLOUD_SUMMON 45884 - -//Creatures -#define MOB_FELMYST 25038 -#define MOB_BRUTALLUS -#define MOB_KALECGOS -#define MOB_DEAD 25268 -#define MOB_MADRIGOSA 25160 -#define MOB_FELMYST_VISUAL 25041 -#define MOB_FLIGHT_LEFT 25357 -#define MOB_FLIGHT_RIGHT 25358 -#define MOB_DEATH_CLOUD 25703 -#define MOB_VAPOR 25265 -#define MOB_VAPOR_TRAIL 25267 - -//Yells and Sounds -#define YELL_BIRTH "Glory to Kil'jaeden! Death to all who oppose!" -#define SOUND_BIRTH 12477 -#define YELL_KILL1 "I kill for the master!" -#define SOUND_KILL1 12480 -#define YELL_KILL2 "The end has come!" -#define SOUND_KILL2 12481 -#define YELL_BREATH "Choke on your final breath!" -#define SOUND_BREATH 12478 -#define YELL_TAKEOFF "I am stronger than ever before!" -#define SOUND_TAKEOFF 12479 -#define YELL_BERSERK "No more hesitation! Your fates are written!" -#define SOUND_BERSERK 12482 -#define YELL_DEATH "Kil'jaeden... will... prevail..." -#define SOUND_DEATH 12483 - -#define YELL_KALECGOS "Madrigosa deserved a far better fate. You did what had to be done, but this battle is far from over." + +enum Quotes +{ + YELL_BIRTH = -1580036, + YELL_KILL1 = -1580037, + YELL_KILL2 = -1580038, + YELL_BREATH = -1580039, + YELL_TAKEOFF = -1580040, + YELL_BERSERK = -1580041, + YELL_DEATH = -1580042, + YELL_KALECGOS = -1580043 //after felmyst's death spawned and say this +}; + +enum Spells +{ + //Aura + AURA_SUNWELL_RADIANCE = 45769, + AURA_NOXIOUS_FUMES = 47002, + + //Land phase + SPELL_CLEAVE = 19983, + SPELL_CORROSION = 45866, + SPELL_GAS_NOVA = 45855, + SPELL_ENCAPSULATE_CHANNEL = 45661, + SPELL_ENCAPSULATE_EFFECT = 45665, + SPELL_ENCAPSULATE_AOE = 45662, + + //Flight phase + SPELL_VAPOR_SELECT = 45391, // fel to player, force cast 45392, 50000y selete target + SPELL_VAPOR_SUMMON = 45392, // player summon vapor, radius around caster, 5y, + SPELL_VAPOR_FORCE = 45388, // vapor to fel, force cast 45389 + SPELL_VAPOR_CHANNEL = 45389, // fel to vapor, green beam channel + SPELL_VAPOR_TRIGGER = 45411, // linked to 45389, vapor to self, trigger 45410 and 46931 + SPELL_VAPOR_DAMAGE = 46931, // vapor damage, 4000 + SPELL_TRAIL_SUMMON = 45410, // vapor summon trail + SPELL_TRAIL_TRIGGER = 45399, // trail to self, trigger 45402 + SPELL_TRAIL_DAMAGE = 45402, // trail damage, 2000 + 2000 dot + SPELL_DEAD_SUMMON = 45400, // summon blazing dead, 5min + SPELL_DEAD_PASSIVE = 45415, + SPELL_FOG_BREATH = 45495, // fel to self, speed burst + SPELL_FOG_TRIGGER = 45582, // fog to self, trigger 45782 + SPELL_FOG_FORCE = 45782, // fog to player, force cast 45714 + SPELL_FOG_INFORM = 45714, // player let fel cast 45717, script effect + SPELL_FOG_CHARM = 45717, // fel to player + SPELL_FOG_CHARM2 = 45726, // link to 45717 + + SPELL_TRANSFORM_TRIGGER = 44885, // madrigosa to self, trigger 46350 + SPELL_TRANSFORM_VISUAL = 46350, //46411stun? + SPELL_TRANSFORM_FELMYST = 45068, // become fel + SPELL_FELMYST_SUMMON = 45069, + + //Other + SPELL_BERSERK = 45078, + SPELL_CLOUD_VISUAL = 45212, + SPELL_CLOUD_SUMMON = 45884 +}; + +enum Creatures +{ + MOB_FELMYST = 25038, + //MOB_BRUTALLUS = + //MOB_KALECGOS = + MOB_DEAD = 25268, + MOB_MADRIGOSA = 25160, + MOB_FELMYST_VISUAL = 25041, + MOB_FLIGHT_LEFT = 25357, + MOB_FLIGHT_RIGHT = 25358, + MOB_DEATH_CLOUD = 25703, + MOB_VAPOR = 25265, + MOB_VAPOR_TRAIL = 25267 +}; enum PhaseFelmyst { @@ -125,10 +126,11 @@ static EventFelmyst MaxTimer[]= struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI { - boss_felmystAI(Creature *c) : ScriptedAI(c) - { + boss_felmystAI(Creature *c) : ScriptedAI(c){ + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + // wait for core patch be accepted - SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ENCAPSULATE_EFFECT); + /*SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_ENCAPSULATE_EFFECT); if(TempSpell->SpellIconID == 2294) TempSpell->SpellIconID = 2295; TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_VAPOR_TRIGGER); @@ -136,9 +138,10 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI TempSpell->Attributes |= SPELL_ATTR_PASSIVE; TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_FOG_CHARM2); if((TempSpell->Attributes & SPELL_ATTR_PASSIVE) == 0) - TempSpell->Attributes |= SPELL_ATTR_PASSIVE; + TempSpell->Attributes |= SPELL_ATTR_PASSIVE;*/ } + ScriptedInstance *pInstance; PhaseFelmyst Phase; EventFelmyst Event; uint32 Timer[EVENT_FLIGHT + 1]; @@ -155,21 +158,27 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI Timer[EVENT_BERSERK] = 600000; FlightCount = 0; - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); DespawnSummons(MOB_VAPOR_TRAIL); - m_creature->setActive(false); + m_creature->setActive(false); + + if(pInstance) + pInstance->SetData(DATA_FELMYST_EVENT, NOT_STARTED); } void Aggro(Unit *who) { - m_creature->setActive(true); + m_creature->setActive(true); DoZoneInCombat(); m_creature->CastSpell(m_creature, AURA_SUNWELL_RADIANCE, true); m_creature->CastSpell(m_creature, AURA_NOXIOUS_FUMES, true); EnterPhase(PHASE_GROUND); + + if(pInstance) + pInstance->SetData(DATA_FELMYST_EVENT, IN_PROGRESS); } void AttackStart(Unit *who) @@ -188,21 +197,22 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI { switch(rand()%2) { - case 0: - DoYell(YELL_KILL1,LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_KILL1); - break; - case 1: - DoYell(YELL_KILL2,LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_KILL2); - break; + case 0: DoScriptText(YELL_KILL1, m_creature); break; + case 1: DoScriptText(YELL_KILL2, m_creature); break; } } + void JustRespawned() + { + DoScriptText(YELL_BIRTH, m_creature); + } + void JustDied(Unit* Killer) { - DoYell(YELL_DEATH, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_DEATH); + DoScriptText(YELL_DEATH, m_creature); + + if(pInstance) + pInstance->SetData(DATA_FELMYST_EVENT, DONE); } void SpellHit(Unit *caster, const SpellEntry *spell) @@ -279,21 +289,26 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI switch(FlightCount) { case 0: - m_creature->AttackStop(); + //m_creature->AttackStop(); + error_log("prevent fly phase"); m_creature->GetMotionMaster()->Clear(false); m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING + MOVEMENTFLAG_ONTRANSPORT); m_creature->StopMoving(); - DoYell(YELL_TAKEOFF, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_TAKEOFF); + DoScriptText(YELL_TAKEOFF, m_creature); Timer[EVENT_FLIGHT_SEQUENCE] = 2000; break; case 1: + error_log("Move to Fly point"); m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+1, m_creature->GetPositionY(), m_creature->GetPositionZ()+10); Timer[EVENT_FLIGHT_SEQUENCE] = 0; break; - case 2: - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 150, true)) + case 2:{ + error_log("Summon Vapor case 2"); + Unit* target; + target = SelectUnit(SELECT_TARGET_RANDOM, 0, 150, true); + if(!target) target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); + if(target) { Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); if(Vapor) @@ -305,11 +320,15 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI } }else EnterEvadeMode(); Timer[EVENT_FLIGHT_SEQUENCE] = 10000; - break; - case 3: + break;} + case 3: { DespawnSummons(MOB_VAPOR_TRAIL); + error_log("Summon Vapor case3"); //m_creature->CastSpell(m_creature, SPELL_VAPOR_SELECT); need core support - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 150, true)) + Unit* target; + target = SelectUnit(SELECT_TARGET_RANDOM, 0, 150, true); + if(!target) target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); + if(target) { //target->CastSpell(target, SPELL_VAPOR_SUMMON, true); need core support Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); @@ -322,13 +341,16 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI } }else EnterEvadeMode(); Timer[EVENT_FLIGHT_SEQUENCE] = 10000; - break; + break;} case 4: DespawnSummons(MOB_VAPOR_TRAIL); Timer[EVENT_FLIGHT_SEQUENCE] = 1; break; - case 5: - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0, 150, true)) + case 5:{ + Unit* target; + target = SelectUnit(SELECT_TARGET_RANDOM, 0, 150, true); + if(!target) target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); + if(target) { BreathX = target->GetPositionX(); BreathY = target->GetPositionY(); @@ -337,11 +359,11 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI m_creature->GetMotionMaster()->MovePoint(0, x, y, z+10); }else EnterEvadeMode(); Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; + break;} case 6: m_creature->SetOrientation(m_creature->GetAngle(BreathX, BreathY)); m_creature->StopMoving(); - DoTextEmote("takes a deep breath.", NULL); + //DoTextEmote("takes a deep breath.", NULL); Timer[EVENT_FLIGHT_SEQUENCE] = 10000; break; case 7: @@ -413,10 +435,9 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI switch(Event) { case EVENT_BERSERK: - DoYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_BERSERK); + DoScriptText(YELL_BERSERK, m_creature); m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - Timer[EVENT_BERSERK] = 0; + Timer[EVENT_BERSERK] = 10000; break; case EVENT_CLEAVE: m_creature->CastSpell(m_creature->getVictim(), SPELL_CLEAVE, false); @@ -451,8 +472,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI switch(Event) { case EVENT_BERSERK: - DoYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_BERSERK); + DoScriptText(YELL_BERSERK, m_creature); m_creature->CastSpell(m_creature, SPELL_BERSERK, true); Timer[EVENT_BERSERK] = 0; break; @@ -584,4 +604,3 @@ void AddSC_boss_felmyst() newscript->GetAI = &GetAI_mob_felmyst_trail; newscript->RegisterSelf(); } - diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp index 23c783ffa88..f7ccbe9a21c 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp @@ -24,70 +24,80 @@ EndScriptData */ #include "precompiled.h" #include "def_sunwell_plateau.h" -//kalecgos dragon form -#define SAY_EVIL_AGGRO -1580000 -#define SAY_EVIL_SPELL1 -1580001 -#define SAY_EVIL_SPELL2 -1580002 -#define SAY_EVIL_SLAY1 -1580003 -#define SAY_EVIL_SLAY2 -1580004 -#define SAY_EVIL_ENRAGE -1580005 -//kalecgos humanoid form -#define SAY_GOOD_AGGRO -1580006 -#define SAY_GOOD_NEAR_DEATH -1580007 -#define SAY_GOOD_NEAR_DEATH2 -1580008 -#define SAY_GOOD_PLRWIN -1580009 - -#define SAY_SATH_AGGRO -1580010 -#define SAY_SATH_DEATH -1580011 -#define SAY_SATH_SPELL1 -1580012 -#define SAY_SATH_SPELL2 -1580013 -#define SAY_SATH_SLAY1 -1580014 -#define SAY_SATH_SLAY2 -1580015 -#define SAY_SATH_ENRAGE -1580016 - -#define GO_FAILED "You are unable to use this currently." - -#define FLY_X 1679 -#define FLY_Y 900 -#define FLY_Z 82 - -#define CENTER_X 1705 -#define CENTER_Y 930 -#define RADIUS 30 - -#define AURA_SUNWELL_RADIANCE 45769 -#define AURA_SPECTRAL_EXHAUSTION 44867 -#define AURA_SPECTRAL_REALM 46021 -#define AURA_SPECTRAL_INVISIBILITY 44801 -#define AURA_DEMONIC_VISUAL 44800 +enum Quotes +{ + //Kalecgos dragon form + SAY_EVIL_AGGRO = -1580000, + SAY_EVIL_SPELL1 = -1580001, + SAY_EVIL_SPELL2 = -1580002, + SAY_EVIL_SLAY1 = -1580003, + SAY_EVIL_SLAY2 = -1580004, + SAY_EVIL_ENRAGE = -1580005, + + //Kalecgos humanoid form + SAY_GOOD_AGGRO = -1580006, + SAY_GOOD_NEAR_DEATH = -1580007, + SAY_GOOD_NEAR_DEATH2 = -1580008, + SAY_GOOD_PLRWIN = -1580009, + + //Shattrowar + SAY_SATH_AGGRO = -1580010, + SAY_SATH_DEATH = -1580011, + SAY_SATH_SPELL1 = -1580012, + SAY_SATH_SPELL2 = -1580013, + SAY_SATH_SLAY1 = -1580014, + SAY_SATH_SLAY2 = -1580015, + SAY_SATH_ENRAGE = -1580016 +}; -#define SPELL_SPECTRAL_BLAST 44869 -#define SPELL_TELEPORT_SPECTRAL 46019 -#define SPELL_ARCANE_BUFFET 45018 -#define SPELL_FROST_BREATH 44799 -#define SPELL_TAIL_LASH 45122 +enum SpellIds +{ + AURA_SUNWELL_RADIANCE = 45769, + AURA_SPECTRAL_EXHAUSTION = 44867, + AURA_SPECTRAL_REALM = 46021, + AURA_SPECTRAL_INVISIBILITY = 44801, + AURA_DEMONIC_VISUAL = 44800, + + SPELL_SPECTRAL_BLAST = 44869, + SPELL_TELEPORT_SPECTRAL = 46019, + SPELL_ARCANE_BUFFET = 45018, + SPELL_FROST_BREATH = 44799, + SPELL_TAIL_LASH = 45122, + + SPELL_BANISH = 44836, + SPELL_TRANSFORM_KALEC = 44670, + SPELL_ENRAGE = 44807, + + SPELL_CORRUPTION_STRIKE = 45029, + SPELL_AGONY_CURSE = 45032, + SPELL_SHADOW_BOLT = 45031, + + SPELL_HEROIC_STRIKE = 45026, + SPELL_REVITALIZE = 45027 +}; -#define SPELL_BANISH 44836 -#define SPELL_TRANSFORM_KALEC 44670 -#define SPELL_ENRAGE 44807 +enum Creatures +{ + MOB_KALECGOS = 24850, + MOB_KALEC = 24891, + MOB_SATHROVARR = 24892 +}; -#define SPELL_CORRUPTION_STRIKE 45029 -#define SPELL_AGONY_CURSE 45032 -#define SPELL_SHADOW_BOLT 45031 +#define GO_FAILED "You are unable to use this currently." -#define SPELL_HEROIC_STRIKE 45026 -#define SPELL_REVITALIZE 45027 +#define FLY_X 1679 +#define FLY_Y 900 +#define FLY_Z 82 -#define MOB_KALECGOS 24850 -#define MOB_KALEC 24891 -#define MOB_SATHROVARR 24892 +#define CENTER_X 1705 +#define CENTER_Y 930 +#define RADIUS 30 #define DRAGON_REALM_Z 53.079 #define DEMON_REALM_Z -74.558 uint32 WildMagic[]= { 44978, 45001, 45002, 45004, 45006, 45010 }; - struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI { boss_kalecgosAI(Creature *c) : ScriptedAI(c) @@ -162,6 +172,9 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI GameObject *Door = GameObject::GetGameObject(*m_creature, DoorGUID); if(Door) Door->SetLootState(GO_ACTIVATED); DoZoneInCombat(); + + if(pInstance) + pInstance->SetData(DATA_KALECGOS_EVENT, IN_PROGRESS); } void KilledUnit(Unit *victim) @@ -275,6 +288,9 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI ResetThreat = 1000; isEnraged = false; isBanished = false; + + if(pInstance) + pInstance->SetData(DATA_KALECGOS_EVENT, NOT_STARTED); } void Aggro(Unit* who) @@ -325,6 +341,9 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI ((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->TalkTimer = 1; ((boss_kalecgosAI*)((Creature*)Kalecgos)->AI())->isFriendly = true; } + + if(pInstance) + pInstance->SetData(DATA_KALECGOS_EVENT, DONE); } void TeleportAllPlayersBack() @@ -437,8 +456,7 @@ struct TRINITY_DLL_DECL boss_kalecAI : public ScriptedAI bool isEnraged; // if demon is enraged - boss_kalecAI(Creature *c) : ScriptedAI(c) - { + boss_kalecAI(Creature *c) : ScriptedAI(c){ pInstance = ((ScriptedInstance*)c->GetInstanceData()); } @@ -671,4 +689,3 @@ void AddSC_boss_kalecgos() newscript->pGOHello = &GOkalocegos_teleporter; newscript->RegisterSelf(); } - diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h b/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h index 0844d5dffe6..12e578d1591 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h @@ -6,36 +6,38 @@ #define DEF_SUNWELLPLATEAU_H /*** Encounters ***/ -#define DATA_KALECGOS_EVENT 0 -#define DATA_BRUTALLUS_EVENT 1 -#define DATA_FELMYST_EVENT 2 -#define DATA_EREDAR_TWINS_EVENT 3 -#define DATA_MURU_EVENT 4 -#define DATA_KILJAEDEN_EVENT 5 +#define DATA_KALECGOS_EVENT 1 +#define DATA_BRUTALLUS_EVENT 2 +#define DATA_FELMYST_EVENT 3 +#define DATA_EREDAR_TWINS_EVENT 4 +#define DATA_MURU_EVENT 5 +#define DATA_KILJAEDEN_EVENT 6 /*** Creatures ***/ -#define DATA_KALECGOS_DRAGON 6 -#define DATA_KALECGOS_HUMAN 7 -#define DATA_SATHROVARR 8 -#define DATA_BRUTALLUS 9 -#define DATA_MADRIGOSA 24 -#define DATA_FELMYST 10 -#define DATA_ALYTHESS 11 -#define DATA_SACROLASH 12 -#define DATA_MURU 13 -#define DATA_KILJAEDEN 14 -#define DATA_KILJAEDEN_CONTROLLER 15 -#define DATA_ANVEENA 16 +#define DATA_KALECGOS_DRAGON 7 +#define DATA_KALECGOS_HUMAN 8 +#define DATA_SATHROVARR 9 +#define DATA_BRUTALLUS 10 +#define DATA_MADRIGOSA 11 +#define DATA_FELMYST 12 +#define DATA_ALYTHESS 13 +#define DATA_SACROLASH 14 +#define DATA_MURU 15 +#define DATA_KILJAEDEN 16 +#define DATA_KILJAEDEN_CONTROLLER 17 +#define DATA_ANVEENA 18 +#define DATA_KALECGOS_KJ 19 /*** GameObjects ***/ -#define DATA_GO_FORCEFIELD 17 -#define DATA_GO_FIRE_BARRIER 18 -#define DATA_GATE_1 19 -#define DATA_GATE_2 20 -#define DATA_GATE_3 21 -#define DATA_GATE_4 22 -#define DATA_GATE_5 23 +#define DATA_GO_FORCEFIELD 20 +#define DATA_GO_FIRE_BARRIER 21 +#define DATA_GATE_1 22 +#define DATA_GATE_2 23 +#define DATA_GATE_3 24 +#define DATA_GATE_4 25 +#define DATA_GATE_5 26 /*** Misc ***/ +#define DATA_PLAYER_GUID 27 #endif diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp index fd93aa15d6c..74235f4151c 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp @@ -4,8 +4,8 @@ /* ScriptData SDName: Instance_Sunwell_Plateau -SD%Complete: 0 -SDComment: VERIFY SCRIPT +SD%Complete: 20 +SDComment: VERIFY SCRIPT, rename Gates SDCategory: Sunwell_Plateau EndScriptData */ @@ -14,6 +14,11 @@ EndScriptData */ #define ENCOUNTERS 6 +enum GoState{ +CLOSE = 1, +OPEN = 0 +}; + /* Sunwell Plateau: 0 - Kalecgos and Sathrovarr 1 - Brutallus @@ -42,6 +47,7 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance uint64 KilJaeden; uint64 KilJaedenController; uint64 Anveena; + uint64 KalecgosKJ; /** GameObjects **/ uint64 ForceField; // Kalecgos Encounter @@ -67,6 +73,7 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance KilJaeden = 0; KilJaedenController = 0; Anveena = 0; + KalecgosKJ = 0; /*** GameObjects ***/ ForceField = 0; @@ -94,6 +101,38 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance return false; } + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + Player* plr = itr->getSource(); + if (plr && !plr->HasAura(45839,0)) + return plr; + } + } + + debug_log("TSCR: Instance Sunwell Plateau: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void HandleGameObject(uint64 guid, uint32 state) + { + Player *player = GetPlayerInMap(); + + if (!player || !guid) + { + debug_log("TSCR: Sunwell Plateau: HandleGameObject fail"); + return; + } + + if (GameObject *go = GameObject::GetGameObject(*player,guid)) + go->SetGoState(state); + } + void OnCreatureCreate(Creature* creature, uint32 entry) { switch(entry) @@ -110,6 +149,7 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance case 25315: KilJaeden = creature->GetGUID(); break; case 25608: KilJaedenController = creature->GetGUID(); break; case 26046: Anveena = creature->GetGUID(); break; + case 25319: KalecgosKJ = creature->GetGUID(); break; } } @@ -158,6 +198,11 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance case DATA_KILJAEDEN: return KilJaeden; break; case DATA_KILJAEDEN_CONTROLLER: return KilJaedenController; break; case DATA_ANVEENA: return Anveena; break; + case DATA_KALECGOS_KJ: return KalecgosKJ; break; + case DATA_PLAYER_GUID: + Player* Target = GetPlayerInMap(); + return Target->GetGUID(); + break; } return 0; @@ -169,11 +214,32 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance { case DATA_KALECGOS_EVENT: Encounters[0] = data; break; case DATA_BRUTALLUS_EVENT: Encounters[1] = data; break; - case DATA_FELMYST_EVENT: Encounters[2] = data; break; + case DATA_FELMYST_EVENT: + if(data == DONE) + HandleGameObject(FireBarrier, 1); + Encounters[2] = data; break; case DATA_EREDAR_TWINS_EVENT: Encounters[3] = data; break; - case DATA_MURU_EVENT: Encounters[4] = data; break; + case DATA_MURU_EVENT: + switch(data){ + case DONE: + HandleGameObject(Gate[4], OPEN); + HandleGameObject(Gate[3], OPEN); + break; + case IN_PROGRESS: + HandleGameObject(Gate[4], CLOSE); + HandleGameObject(Gate[3], CLOSE); + break; + case NOT_STARTED: + HandleGameObject(Gate[4], CLOSE); + HandleGameObject(Gate[3], OPEN); + break; + } + Encounters[4] = data; break; case DATA_KILJAEDEN_EVENT: Encounters[5] = data; break; } + + if(data == DONE) + SaveToDB(); } void SetData64(uint32 id, uint64 guid) @@ -183,6 +249,41 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance void Update(uint32 diff) { } + + const char* Save() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << Encounters[0] << " " << Encounters[1] << " " << Encounters[2] << " " << Encounters[3] << " " + << Encounters[4] << " " << Encounters[5]; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if(out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + + return NULL; + } + + void Load(const char* in) + { + if(!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> Encounters[0] >> Encounters[1] >> Encounters[2] >> Encounters[3] + >> Encounters[4] >> Encounters[5]; + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if(Encounters[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + Encounters[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } }; InstanceData* GetInstanceData_instance_sunwell_plateau(Map* map) diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp index aa20c05d128..e68717857cb 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp @@ -15,12 +15,52 @@ */ /* ScriptData -SDName: sunwell_plateau +SDName: Sunwell_Plateau SD%Complete: 0 -SDComment: Placeholer -SDCategory: Sunwell_Plateau +SDComment: Placeholder, Epilogue after Kil'jaeden, Captain Selana Gossips EndScriptData */ +/* ContentData +npc_prophet_velen +npc_captain_selana +EndContentData */ + #include "precompiled.h" +#include "def_sunwell_plateau.h" + +/*###### +## npc_prophet_velen +######*/ + +enum ProphetSpeeches +{ + PROPHET_SAY1 = -1580099, + PROPHET_SAY2 = -1580100, + PROPHET_SAY3 = -1580101, + PROPHET_SAY4 = -1580102, + PROPHET_SAY5 = -1580103, + PROPHET_SAY6 = -1580104, + PROPHET_SAY7 = -1580105, + PROPHET_SAY8 = -1580106 +}; + +enum LiadrinnSpeeches +{ + LIADRIN_SAY1 = -1580107, + LIADRIN_SAY2 = -1580108, + LIADRIN_SAY3 = -1580109 +}; + + +/*###### +## npc_captain_selana +######*/ + +#define CS_GOSSIP1 "Give me a situation report, Captain." +#define CS_GOSSIP2 "What went wrong?" +#define CS_GOSSIP3 "Why did they stop?" +#define CS_GOSSIP4 "Your insight is appreciated." + void AddSC_sunwell_plateau() -{};
\ No newline at end of file +{ +} |