aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/1421_world.sql170
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp68
-rw-r--r--src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp321
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp278
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp527
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp233
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp129
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp1294
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp628
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h52
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp109
-rw-r--r--src/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp47
-rw-r--r--src/game/Player.cpp3
-rw-r--r--src/game/Spell.cpp7
-rw-r--r--src/game/SpellEffects.cpp13
-rw-r--r--src/game/TicketMgr.cpp6
16 files changed, 2987 insertions, 898 deletions
diff --git a/sql/updates/1421_world.sql b/sql/updates/1421_world.sql
new file mode 100644
index 00000000000..d5fb628114e
--- /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;
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp
index 9ce2ac28d45..d40d060dd88 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp
@@ -405,17 +405,6 @@ void hyjalAI::Reset()
//Visibility
DoHide = true;
-
- //CreatureList.clear();
- //If Jaina evades, reset the visibility of all other creatures in the grid.
- /*if(CreatureList.empty())
- return;
-
- for(std::list<uint64>::iterator itr = CreatureList.begin(); itr != CreatureList.end(); ++itr)
- if(Creature* cr = (Unit::GetCreature(*m_creature, *itr)))
- cr->SetVisibility(VISIBILITY_ON);
-
- CreatureList.clear();*/
}
void hyjalAI::EnterEvadeMode()
@@ -505,9 +494,6 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3])
++EnemyCount;
pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
- //pCreature->GetMotionMaster()->MovePoint(0, AttackLoc[0],AttackLoc[1],AttackLoc[2]);
- //pCreature->AddThreat(m_creature, 0.0f);
- //DoZoneInCombat(pCreature);
pCreature->setActive(true);
switch(entry)
{
@@ -675,44 +661,10 @@ void hyjalAI::UpdateWorldState(uint32 id, uint32 state)
player->SendUpdateWorldState(id,state);
}
}else debug_log("TSCR: HyjalAI: UpdateWorldState, but PlayerList is empty");
-
- //remove everything above this line only when/if the core patch for this is accepted and needed
- //m_creature->GetMap()->UpdateWorldState(field, value);
}
void hyjalAI::Retreat()
-{
- /*CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
- Cell cell(pair);
- cell.data.Part.reserved = ALL_DISTRICT;
- cell.SetNoCreate();
-
- // First get all creatures.
- std::list<Creature*> creatures;
- Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature);
- Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid> creature_searcher(m_creature, creatures, creature_check);
- TypeContainerVisitor
- <Trinity::CreatureListSearcher<Trinity::AllFriendlyCreaturesInGrid>,
- GridTypeMapContainer> creature_visitor(creature_searcher);
-
- CellLock<GridReadGuard> cell_lock(cell, pair);
- // Get Creatures
- cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap()));
-
- CreatureList.clear();
- if(!creatures.empty())
- {
- for(std::list<Creature*>::iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
- {
- (*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true);
- (*itr)->setFaction(35);//make them friendly so mobs won't attack them
- CreatureList.push_back((*itr)->GetGUID());
- }
-
- DoCast(m_creature, SPELL_TELEPORT_VISUAL);
- bRetreat = true;
- RetreatTimer = 1000;
- }*/
+{
if(pInstance)
{
if(Faction == 0)
@@ -732,8 +684,6 @@ void hyjalAI::Retreat()
JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
((hyjalAI*)JainaDummy->AI())->IsDummy = true;
DummyGuid = JainaDummy->GetGUID();
- //((hyjalAI*)JainaDummy->AI())->MassTeleportTimer = 20000;
- //((hyjalAI*)JainaDummy->AI())->DoMassTeleport = true;
}
AddWaypoint(0,JainaDummySpawn[1][0],JainaDummySpawn[1][1],JainaDummySpawn[1][2]);
Start(false, false, false);
@@ -867,11 +817,6 @@ void hyjalAI::UpdateAI(const uint32 diff)
}
if(Overrun)
DoOverrun(Faction, diff);
- /* if(m_creature->GetEntry() == 17772)
- {
- if(!m_creature->HasAura(SPELL_BRILLIANCE_AURA,0))
- DoCast(m_creature, SPELL_BRILLIANCE_AURA, true);
- }*/
if(bRetreat)
{
if(RetreatTimer < diff)
@@ -890,14 +835,7 @@ void hyjalAI::UpdateAI(const uint32 diff)
HideNearPos(5603.75, -2853.12);
break;
}
- m_creature->SetVisibility(VISIBILITY_OFF);
- /*if(CreatureList.empty())
- return;
-
- for(std::list<uint64>::iterator itr = CreatureList.begin(); itr != CreatureList.end(); ++itr)
- if(Unit* pUnit = Unit::GetUnit(*m_creature, *itr))
- pUnit->SetVisibility(VISIBILITY_OFF);
- CreatureList.clear();*/
+ m_creature->SetVisibility(VISIBILITY_OFF);
}else RetreatTimer -= diff;
}
@@ -1026,14 +964,12 @@ void hyjalAI::HideNearPos(float x, float y)
// Get Creatures
cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap()));
- //CreatureList.clear();
if(!creatures.empty())
{
for(std::list<Creature*>::iterator itr = creatures.begin(); itr != creatures.end(); ++itr)
{
(*itr)->SetVisibility(VISIBILITY_OFF);
(*itr)->setFaction(35);//make them friendly so mobs won't attack them
- //CreatureList.push_back((*itr)->GetGUID());
}
}
}
diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp
index 22626f48cf5..d46b9f7a77e 100644
--- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp
+++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp
@@ -78,20 +78,20 @@ float AllianceOverrunWP[55][3]=//waypoints in the alliance base used in the end
{5043.42,-1853.75,1324.52},//19
{5053.02,-1864.13,1330.36},//20
{5062.49,-1852.47,1330.49},//21
+ {5015.27, -1738.77, 1324.83},//35//start 22
+ {5027.97, -1775.25, 1321.87},//34 23
+ {5015.94, -1821.24, 1321.86},//33 24
+ {4983.25, -1857.4, 1320.48},//32 25
+ {4981.51, -1883.7, 1322.34},//31 26
+ {5002.33, -1893.98, 1325.88},//30 27
+ {5049.32, -1886.54, 1331.69},//29 28
+ {5089.68, -1846.88, 1328.99},//28 29
+ {5127.90, -1825.14, 1335.58},//27 30
+ {5163.27, -1789.08, 1337.04},//26 31
+ {5138.97, -1755.88, 1334.57},//25 32
+ {5096.63, -1742.22, 1329.61},//24 33
+ {5065.81, -1729.43, 1325.66},//23 34
{5049.32, -1726.31, 1320.64},//22 start
- {5065.81, -1729.43, 1325.66},//23
- {5096.63, -1742.22, 1329.61},//24
- {5138.97, -1755.88, 1334.57},//25
- {5163.27, -1789.08, 1337.04},//26
- {5127.90, -1825.14, 1335.58},//27
- {5089.68, -1846.88, 1328.99},//28
- {5049.32, -1886.54, 1331.69},//29
- {5002.33, -1893.98, 1325.88},//30
- {4981.51, -1883.7, 1322.34},//31
- {4983.25, -1857.4, 1320.48},//32
- {5015.94, -1821.24, 1321.86},//33
- {5027.97, -1775.25, 1321.87},//34
- {5015.27, -1738.77, 1324.83},//35
{5081.07, -1902.10, 1346.36},//36 abo start
{5107.65, -1912.03, 1356.49},//37
{5132.83, -1927.07, 1362.42},//38
@@ -173,45 +173,9 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
{
if(m_creature->GetEntry() == GARGOYLE)
{
- switch(OverrunType)
- {
- case 0:
- {
- DummyTarget[0] = AllianceOverrunWP[50][0];
- DummyTarget[1] = AllianceOverrunWP[50][1];
- DummyTarget[2] = AllianceOverrunWP[50][2];
- }
- break;
- case 1:
- {
- DummyTarget[0] = AllianceOverrunWP[51][0];
- DummyTarget[1] = AllianceOverrunWP[51][1];
- DummyTarget[2] = AllianceOverrunWP[51][2];
- }
- break;
- case 2:
- {
- DummyTarget[0] = AllianceOverrunWP[52][0];
- DummyTarget[1] = AllianceOverrunWP[52][1];
- DummyTarget[2] = AllianceOverrunWP[52][2];
- }
- break;
- case 3:
- {
- DummyTarget[0] = AllianceOverrunWP[53][0];
- DummyTarget[1] = AllianceOverrunWP[53][1];
- DummyTarget[2] = AllianceOverrunWP[53][2];
- }
- break;
- case 4:
- {
- DummyTarget[0] = AllianceOverrunWP[54][0];
- DummyTarget[1] = AllianceOverrunWP[54][1];
- DummyTarget[2] = AllianceOverrunWP[54][2];
- }
- break;
- }
-
+ DummyTarget[0] = AllianceOverrunWP[50+OverrunType][0]; //+OverrunType 0 - 4
+ DummyTarget[1] = AllianceOverrunWP[50+OverrunType][1];
+ DummyTarget[2] = AllianceOverrunWP[50+OverrunType][2];
}
if(m_creature->GetEntry() == ABOMINATION)
{
@@ -220,13 +184,14 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
switch(OverrunType)
{
case 0:
- AddWaypoint( 4, AllianceOverrunWP[35][0]+irand(-3,3), AllianceOverrunWP[35][1]+irand(-3,3), AllianceOverrunWP[35][2]);
- AddWaypoint( 5, AllianceOverrunWP[34][0]+irand(-3,3), AllianceOverrunWP[34][1]+irand(-3,3), AllianceOverrunWP[34][2]);
- AddWaypoint( 6, AllianceOverrunWP[33][0]+irand(-3,3), AllianceOverrunWP[33][1]+irand(-3,3), AllianceOverrunWP[33][2]);
- AddWaypoint( 7, AllianceOverrunWP[32][0]+irand(-3,3), AllianceOverrunWP[32][1]+irand(-3,3), AllianceOverrunWP[32][2]);
- AddWaypoint( 8, AllianceOverrunWP[31][0]+irand(-3,3), AllianceOverrunWP[31][1]+irand(-3,3), AllianceOverrunWP[31][2]);
- AddWaypoint( 9, AllianceOverrunWP[30][0]+irand(-3,3), AllianceOverrunWP[30][1]+irand(-3,3), AllianceOverrunWP[30][2]);
- AddWaypoint(10, AllianceOverrunWP[29][0]+irand(-3,3), AllianceOverrunWP[29][1]+irand(-3,3), AllianceOverrunWP[29][2]);
+ AddWaypoint( 4, AllianceOverrunWP[22][0]+irand(-3,3), AllianceOverrunWP[22][1]+irand(-3,3), AllianceOverrunWP[22][2]);
+ AddWaypoint( 5, AllianceOverrunWP[23][0]+irand(-3,3), AllianceOverrunWP[23][1]+irand(-3,3), AllianceOverrunWP[23][2]);
+ AddWaypoint( 6, AllianceOverrunWP[24][0]+irand(-3,3), AllianceOverrunWP[24][1]+irand(-3,3), AllianceOverrunWP[24][2]);
+ AddWaypoint( 7, AllianceOverrunWP[25][0]+irand(-3,3), AllianceOverrunWP[25][1]+irand(-3,3), AllianceOverrunWP[25][2]);
+ AddWaypoint( 8, AllianceOverrunWP[26][0]+irand(-3,3), AllianceOverrunWP[26][1]+irand(-3,3), AllianceOverrunWP[26][2]);
+ AddWaypoint( 9, AllianceOverrunWP[27][0]+irand(-3,3), AllianceOverrunWP[27][1]+irand(-3,3), AllianceOverrunWP[27][2]);
+ AddWaypoint(10, AllianceOverrunWP[28][0]+irand(-3,3), AllianceOverrunWP[28][1]+irand(-3,3), AllianceOverrunWP[28][2]);
+
AddWaypoint(11, AllianceOverrunWP[36][0]+irand(-3,3), AllianceOverrunWP[36][1]+irand(-3,3), AllianceOverrunWP[36][2]);
AddWaypoint(12, AllianceOverrunWP[37][0]+irand(-3,3), AllianceOverrunWP[37][1]+irand(-3,3), AllianceOverrunWP[37][2]);
AddWaypoint(13, AllianceOverrunWP[38][0]+irand(-3,3), AllianceOverrunWP[38][1]+irand(-3,3), AllianceOverrunWP[38][2]);
@@ -241,13 +206,14 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
Start(true, true, true);
break;
case 1:
- AddWaypoint( 4, AllianceOverrunWP[35][0]+irand(-3,3), AllianceOverrunWP[35][1]+irand(-3,3), AllianceOverrunWP[35][2]);
- AddWaypoint( 5, AllianceOverrunWP[34][0]+irand(-3,3), AllianceOverrunWP[34][1]+irand(-3,3), AllianceOverrunWP[34][2]);
- AddWaypoint( 6, AllianceOverrunWP[33][0]+irand(-3,3), AllianceOverrunWP[33][1]+irand(-3,3), AllianceOverrunWP[33][2]);
- AddWaypoint( 7, AllianceOverrunWP[32][0]+irand(-3,3), AllianceOverrunWP[32][1]+irand(-3,3), AllianceOverrunWP[32][2]);
- AddWaypoint( 8, AllianceOverrunWP[31][0]+irand(-3,3), AllianceOverrunWP[31][1]+irand(-3,3), AllianceOverrunWP[31][2]);
- AddWaypoint( 9, AllianceOverrunWP[30][0]+irand(-3,3), AllianceOverrunWP[30][1]+irand(-3,3), AllianceOverrunWP[30][2]);
- AddWaypoint(10, AllianceOverrunWP[29][0]+irand(-3,3), AllianceOverrunWP[29][1]+irand(-3,3), AllianceOverrunWP[29][2]);
+ AddWaypoint( 4, AllianceOverrunWP[22][0]+irand(-3,3), AllianceOverrunWP[22][1]+irand(-3,3), AllianceOverrunWP[22][2]);
+ AddWaypoint( 5, AllianceOverrunWP[23][0]+irand(-3,3), AllianceOverrunWP[23][1]+irand(-3,3), AllianceOverrunWP[23][2]);
+ AddWaypoint( 6, AllianceOverrunWP[24][0]+irand(-3,3), AllianceOverrunWP[24][1]+irand(-3,3), AllianceOverrunWP[24][2]);
+ AddWaypoint( 7, AllianceOverrunWP[25][0]+irand(-3,3), AllianceOverrunWP[25][1]+irand(-3,3), AllianceOverrunWP[25][2]);
+ AddWaypoint( 8, AllianceOverrunWP[26][0]+irand(-3,3), AllianceOverrunWP[26][1]+irand(-3,3), AllianceOverrunWP[26][2]);
+ AddWaypoint( 9, AllianceOverrunWP[27][0]+irand(-3,3), AllianceOverrunWP[27][1]+irand(-3,3), AllianceOverrunWP[27][2]);
+ AddWaypoint(10, AllianceOverrunWP[28][0]+irand(-3,3), AllianceOverrunWP[28][1]+irand(-3,3), AllianceOverrunWP[28][2]);
+
AddWaypoint(11, AllianceOverrunWP[36][0]+irand(-3,3), AllianceOverrunWP[36][1]+irand(-3,3), AllianceOverrunWP[36][2]);
AddWaypoint(12, AllianceOverrunWP[37][0]+irand(-3,3), AllianceOverrunWP[37][1]+irand(-3,3), AllianceOverrunWP[37][2]);
AddWaypoint(13, AllianceOverrunWP[38][0]+irand(-3,3), AllianceOverrunWP[38][1]+irand(-3,3), AllianceOverrunWP[38][2]);
@@ -262,21 +228,9 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
Start(true, true, true);
break;
default:
- AddWaypoint( 4, AllianceOverrunWP[35][0]+irand(-3,3), AllianceOverrunWP[35][1]+irand(-3,3), AllianceOverrunWP[35][2]);
- AddWaypoint( 5, AllianceOverrunWP[34][0]+irand(-3,3), AllianceOverrunWP[34][1]+irand(-3,3), AllianceOverrunWP[34][2]);
- AddWaypoint( 6, AllianceOverrunWP[33][0]+irand(-3,3), AllianceOverrunWP[33][1]+irand(-3,3), AllianceOverrunWP[33][2]);
- AddWaypoint( 7, AllianceOverrunWP[32][0]+irand(-3,3), AllianceOverrunWP[32][1]+irand(-3,3), AllianceOverrunWP[32][2]);
- AddWaypoint( 8, AllianceOverrunWP[31][0]+irand(-3,3), AllianceOverrunWP[31][1]+irand(-3,3), AllianceOverrunWP[31][2]);
- AddWaypoint( 9, AllianceOverrunWP[30][0]+irand(-3,3), AllianceOverrunWP[30][1]+irand(-3,3), AllianceOverrunWP[30][2]);
- AddWaypoint(10, AllianceOverrunWP[29][0]+irand(-3,3), AllianceOverrunWP[29][1]+irand(-3,3), AllianceOverrunWP[29][2]);
- AddWaypoint(11, AllianceOverrunWP[28][0]+irand(-3,3), AllianceOverrunWP[28][1]+irand(-3,3), AllianceOverrunWP[28][2]);
- AddWaypoint(12, AllianceOverrunWP[27][0]+irand(-3,3), AllianceOverrunWP[27][1]+irand(-3,3), AllianceOverrunWP[27][2]);
- AddWaypoint(13, AllianceOverrunWP[26][0]+irand(-3,3), AllianceOverrunWP[26][1]+irand(-3,3), AllianceOverrunWP[26][2]);
- AddWaypoint(14, AllianceOverrunWP[25][0]+irand(-3,3), AllianceOverrunWP[25][1]+irand(-3,3), AllianceOverrunWP[25][2]);
- AddWaypoint(15, AllianceOverrunWP[24][0]+irand(-3,3), AllianceOverrunWP[24][1]+irand(-3,3), AllianceOverrunWP[24][2]);
- AddWaypoint(16, AllianceOverrunWP[23][0]+irand(-3,3), AllianceOverrunWP[23][1]+irand(-3,3), AllianceOverrunWP[23][2]);
- AddWaypoint(17, AllianceOverrunWP[22][0]+irand(-3,3), AllianceOverrunWP[22][1]+irand(-3,3), AllianceOverrunWP[22][2]);
- //m_creature->SetHomePosition(AllianceOverrunWP[0][0]+irand(-3,3), AllianceOverrunWP[0][1]+irand(-3,3), AllianceOverrunWP[0][2],0);
+ for(uint8 i = 22; i < 36; i++)
+ AddWaypoint( i-18, AllianceOverrunWP[i][0]+irand(-3,3), AllianceOverrunWP[i][1]+irand(-3,3), AllianceOverrunWP[i][2]);
+
SetDespawnAtEnd(true);
LastOverronPos = 17;
Start(true, true, true);
@@ -347,21 +301,8 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
Start(true, true, true);
break;
default:
- AddWaypoint( 4, AllianceOverrunWP[35][0]+irand(-3,3), AllianceOverrunWP[35][1]+irand(-3,3), AllianceOverrunWP[35][2]);
- AddWaypoint( 5, AllianceOverrunWP[34][0]+irand(-3,3), AllianceOverrunWP[34][1]+irand(-3,3), AllianceOverrunWP[34][2]);
- AddWaypoint( 6, AllianceOverrunWP[33][0]+irand(-3,3), AllianceOverrunWP[33][1]+irand(-3,3), AllianceOverrunWP[33][2]);
- AddWaypoint( 7, AllianceOverrunWP[32][0]+irand(-3,3), AllianceOverrunWP[32][1]+irand(-3,3), AllianceOverrunWP[32][2]);
- AddWaypoint( 8, AllianceOverrunWP[31][0]+irand(-3,3), AllianceOverrunWP[31][1]+irand(-3,3), AllianceOverrunWP[31][2]);
- AddWaypoint( 9, AllianceOverrunWP[30][0]+irand(-3,3), AllianceOverrunWP[30][1]+irand(-3,3), AllianceOverrunWP[30][2]);
- AddWaypoint(10, AllianceOverrunWP[29][0]+irand(-3,3), AllianceOverrunWP[29][1]+irand(-3,3), AllianceOverrunWP[29][2]);
- AddWaypoint(11, AllianceOverrunWP[28][0]+irand(-3,3), AllianceOverrunWP[28][1]+irand(-3,3), AllianceOverrunWP[28][2]);
- AddWaypoint(12, AllianceOverrunWP[27][0]+irand(-3,3), AllianceOverrunWP[27][1]+irand(-3,3), AllianceOverrunWP[27][2]);
- AddWaypoint(13, AllianceOverrunWP[26][0]+irand(-3,3), AllianceOverrunWP[26][1]+irand(-3,3), AllianceOverrunWP[26][2]);
- AddWaypoint(14, AllianceOverrunWP[25][0]+irand(-3,3), AllianceOverrunWP[25][1]+irand(-3,3), AllianceOverrunWP[25][2]);
- AddWaypoint(15, AllianceOverrunWP[24][0]+irand(-3,3), AllianceOverrunWP[24][1]+irand(-3,3), AllianceOverrunWP[24][2]);
- AddWaypoint(16, AllianceOverrunWP[23][0]+irand(-3,3), AllianceOverrunWP[23][1]+irand(-3,3), AllianceOverrunWP[23][2]);
- AddWaypoint(17, AllianceOverrunWP[22][0]+irand(-3,3), AllianceOverrunWP[22][1]+irand(-3,3), AllianceOverrunWP[22][2]);
- //m_creature->SetHomePosition(AllianceOverrunWP[0][0]+irand(-3,3), AllianceOverrunWP[0][1]+irand(-3,3), AllianceOverrunWP[0][2],0);
+ for(uint8 i = 22; i < 36; i++)
+ AddWaypoint( i-18, AllianceOverrunWP[i][0]+irand(-3,3), AllianceOverrunWP[i][1]+irand(-3,3), AllianceOverrunWP[i][2]);
SetDespawnAtEnd(true);
LastOverronPos = 17;
Start(true, true, true);
@@ -398,25 +339,10 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
Start(true, true, true);
break;
default:
- AddWaypoint( 5, HordeOverrunWP[0][0]+irand(-10,10), HordeOverrunWP[0][1]+irand(-10,10), HordeOverrunWP[0][2]);
- AddWaypoint( 6, HordeOverrunWP[1][0]+irand(-10,10), HordeOverrunWP[1][1]+irand(-10,10), HordeOverrunWP[1][2]);
- AddWaypoint( 7, HordeOverrunWP[2][0]+irand(-10,10), HordeOverrunWP[2][1]+irand(-10,10), HordeOverrunWP[2][2]);
- AddWaypoint( 8, HordeOverrunWP[3][0]+irand(-10,10), HordeOverrunWP[3][1]+irand(-10,10), HordeOverrunWP[3][2]);
- AddWaypoint( 9, HordeOverrunWP[4][0]+irand(-10,10), HordeOverrunWP[4][1]+irand(-10,10), HordeOverrunWP[4][2]);
- AddWaypoint(10, HordeOverrunWP[5][0]+irand(-10,10), HordeOverrunWP[5][1]+irand(-10,10), HordeOverrunWP[5][2]);
- AddWaypoint(11, HordeOverrunWP[6][0]+irand(-10,10), HordeOverrunWP[6][1]+irand(-10,10), HordeOverrunWP[6][2]);
- AddWaypoint(12, HordeOverrunWP[7][0]+irand(-10,10), HordeOverrunWP[7][1]+irand(-10,10), HordeOverrunWP[7][2]);
- AddWaypoint(13, HordeOverrunWP[8][0]+irand(-10,10), HordeOverrunWP[8][1]+irand(-10,10), HordeOverrunWP[8][2]);
- AddWaypoint(14, HordeOverrunWP[9][0]+irand(-10,10), HordeOverrunWP[9][1]+irand(-10,10), HordeOverrunWP[9][2]);
- AddWaypoint(15, HordeOverrunWP[10][0]+irand(-10,10), HordeOverrunWP[10][1]+irand(-10,10), HordeOverrunWP[10][2]);
- AddWaypoint(16, HordeOverrunWP[11][0]+irand(-10,10), HordeOverrunWP[11][1]+irand(-10,10), HordeOverrunWP[11][2]);
- AddWaypoint(17, HordeOverrunWP[12][0]+irand(-10,10), HordeOverrunWP[12][1]+irand(-10,10), HordeOverrunWP[12][2]);
- AddWaypoint(18, HordeOverrunWP[13][0]+irand(-10,10), HordeOverrunWP[13][1]+irand(-10,10), HordeOverrunWP[13][2]);
- AddWaypoint(19, HordeOverrunWP[14][0]+irand(-10,10), HordeOverrunWP[14][1]+irand(-10,10), HordeOverrunWP[14][2]);
- AddWaypoint(20, HordeOverrunWP[15][0]+irand(-10,10), HordeOverrunWP[15][1]+irand(-10,10), HordeOverrunWP[15][2]);
- //m_creature->SetHomePosition(AllianceOverrunWP[2][0]+irand(-10,10), AllianceOverrunWP[2][1]+irand(-10,10), AllianceOverrunWP[2][2],0);
+ for(uint8 i = 0; i < 16; i++)
+ AddWaypoint( i+6, HordeOverrunWP[i][0]+irand(-10,10), HordeOverrunWP[i][1]+irand(-10,10), HordeOverrunWP[i][2]);
SetDespawnAtEnd(true);
- LastOverronPos = 20;
+ LastOverronPos = 21;
Start(true, true, true);
break;
}
@@ -425,32 +351,11 @@ void hyjal_trashAI::UpdateAI(const uint32 diff)
{
for(uint8 i = 0; i < 6; i++)
AddWaypoint(i, HordeWPs[i][0]+irand(-10,10), HordeWPs[i][1]+irand(-10,10), HordeWPs[i][2]);
- switch(OverrunType)
- {
- case 0:
- default:
- AddWaypoint( 5, HordeOverrunWP[0][0]+irand(-10,10), HordeOverrunWP[0][1]+irand(-10,10), HordeOverrunWP[0][2]);
- AddWaypoint( 6, HordeOverrunWP[1][0]+irand(-10,10), HordeOverrunWP[1][1]+irand(-10,10), HordeOverrunWP[1][2]);
- AddWaypoint( 7, HordeOverrunWP[2][0]+irand(-10,10), HordeOverrunWP[2][1]+irand(-10,10), HordeOverrunWP[2][2]);
- AddWaypoint( 8, HordeOverrunWP[3][0]+irand(-10,10), HordeOverrunWP[3][1]+irand(-10,10), HordeOverrunWP[3][2]);
- AddWaypoint( 9, HordeOverrunWP[4][0]+irand(-10,10), HordeOverrunWP[4][1]+irand(-10,10), HordeOverrunWP[4][2]);
- AddWaypoint(10, HordeOverrunWP[5][0]+irand(-10,10), HordeOverrunWP[5][1]+irand(-10,10), HordeOverrunWP[5][2]);
- AddWaypoint(11, HordeOverrunWP[6][0]+irand(-10,10), HordeOverrunWP[6][1]+irand(-10,10), HordeOverrunWP[6][2]);
- AddWaypoint(12, HordeOverrunWP[7][0]+irand(-10,10), HordeOverrunWP[7][1]+irand(-10,10), HordeOverrunWP[7][2]);
- AddWaypoint(13, HordeOverrunWP[8][0]+irand(-10,10), HordeOverrunWP[8][1]+irand(-10,10), HordeOverrunWP[8][2]);
- AddWaypoint(14, HordeOverrunWP[9][0]+irand(-10,10), HordeOverrunWP[9][1]+irand(-10,10), HordeOverrunWP[9][2]);
- AddWaypoint(15, HordeOverrunWP[10][0]+irand(-10,10), HordeOverrunWP[10][1]+irand(-10,10), HordeOverrunWP[10][2]);
- AddWaypoint(16, HordeOverrunWP[11][0]+irand(-10,10), HordeOverrunWP[11][1]+irand(-10,10), HordeOverrunWP[11][2]);
- AddWaypoint(17, HordeOverrunWP[12][0]+irand(-10,10), HordeOverrunWP[12][1]+irand(-10,10), HordeOverrunWP[12][2]);
- AddWaypoint(18, HordeOverrunWP[13][0]+irand(-10,10), HordeOverrunWP[13][1]+irand(-10,10), HordeOverrunWP[13][2]);
- AddWaypoint(19, HordeOverrunWP[14][0]+irand(-10,10), HordeOverrunWP[14][1]+irand(-10,10), HordeOverrunWP[14][2]);
- AddWaypoint(20, HordeOverrunWP[15][0]+irand(-10,10), HordeOverrunWP[15][1]+irand(-10,10), HordeOverrunWP[15][2]);
- //m_creature->SetHomePosition(AllianceOverrunWP[2][0]+irand(-10,10), AllianceOverrunWP[2][1]+irand(-10,10), AllianceOverrunWP[2][2],0);
- SetDespawnAtEnd(true);
- LastOverronPos = 20;
- Start(true, true, true);
- break;
- }
+ for(uint8 i = 0; i < 16; i++)
+ AddWaypoint( i+6, HordeOverrunWP[i][0]+irand(-10,10), HordeOverrunWP[i][1]+irand(-10,10), HordeOverrunWP[i][2]);
+ SetDespawnAtEnd(true);
+ LastOverronPos = 21;
+ Start(true, true, true);
}
}
}
@@ -464,25 +369,6 @@ void hyjal_trashAI::JustDied(Unit *victim)
if((pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !m_creature->isWorldBoss()) || (damageTaken < m_creature->GetMaxHealth()/4 && m_creature->isWorldBoss()))
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot
-
- if(IsOverrun)
- {
- float x,y,z,o;
- m_creature->GetHomePosition(x,y,z,o);
- Creature* pUnit = m_creature->SummonCreature(m_creature->GetEntry(),x,y,z,o, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
- if(pUnit)
- {
- ((hyjal_trashAI*)pUnit->AI())->faction = faction;
- ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true;
- ((hyjal_trashAI*)pUnit->AI())->OverrunType = OverrunType;
- ((hyjal_trashAI*)pUnit->AI())->SetupOverrun = true;
- ((hyjal_trashAI*)pUnit->AI())->DummyTarget[0] = DummyTarget[0];
- ((hyjal_trashAI*)pUnit->AI())->DummyTarget[1] = DummyTarget[1];
- ((hyjal_trashAI*)pUnit->AI())->DummyTarget[2] = DummyTarget[2];
- pUnit->setActive(true);
- pUnit->AI()->EnterEvadeMode();
- }
- }
}
struct mob_giant_infernalAI : public hyjal_trashAI
@@ -563,8 +449,6 @@ struct mob_giant_infernalAI : public hyjal_trashAI
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID));
CanMove = true;
- /*if (m_creature->getVictim())
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());*/
if (pInstance)
{
if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && !pInstance->GetData(DATA_HORDE_RETREAT))
@@ -654,32 +538,13 @@ struct mob_abominationAI : public hyjal_trashAI
if (target && target->isAlive())
m_creature->AddThreat(target,0.0);
}
- }
+ }
if (i == LastOverronPos && IsOverrun)
{
- if(faction == 0 && LastOverronPos == 17)//alliance round
+ if((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21))
{
- Creature* pUnit = m_creature->SummonCreature(m_creature->GetEntry(),4928.48+irand(-10,10), -1526.38+irand(-10,10), 1326.83,0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
- if(pUnit)
- {
- ((hyjal_trashAI*)pUnit->AI())->faction = faction;
- ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true;
- ((hyjal_trashAI*)pUnit->AI())->OverrunType = 2;//default
- ((hyjal_trashAI*)pUnit->AI())->SetupOverrun = false;
- pUnit->setActive(true);
- }
- }
- if(faction == 1 && LastOverronPos == 20)//horde round
- {
- Creature* pUnit = m_creature->SummonCreature(m_creature->GetEntry(),5458.01+irand(-10,10),-2340.27+irand(-10,10),1459.60,0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
- if(pUnit)
- {
- ((hyjal_trashAI*)pUnit->AI())->faction = faction;
- ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true;
- ((hyjal_trashAI*)pUnit->AI())->OverrunType = 10;//default
- ((hyjal_trashAI*)pUnit->AI())->SetupOverrun = false;
- pUnit->setActive(true);
- }
+ m_creature->setDeathState(DEAD);
+ m_creature->RemoveCorpse();
}
}
}
@@ -721,7 +586,7 @@ struct mob_abominationAI : public hyjal_trashAI
if(KnockDownTimer<diff)
{
DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN);
- KnockDownTimer = 30000+rand()%25000;
+ KnockDownTimer = 15000+rand()%10000;
}else KnockDownTimer -= diff;
DoMeleeAttackIfReady();
}
@@ -776,30 +641,12 @@ struct mob_ghoulAI : public hyjal_trashAI
if (i == LastOverronPos && IsOverrun)
{
m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED);
- if(faction == 0 && LastOverronPos == 17)//alliance round
- {
- Creature* pUnit = m_creature->SummonCreature(m_creature->GetEntry(),4928.48+irand(-10,10), -1526.38+irand(-10,10), 1326.83,0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
- if(pUnit)
- {
- ((hyjal_trashAI*)pUnit->AI())->faction = faction;
- ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true;
- ((hyjal_trashAI*)pUnit->AI())->OverrunType = 6;//default
- ((hyjal_trashAI*)pUnit->AI())->SetupOverrun = false;
- pUnit->setActive(true);
- }
- }
- if(faction == 1 && LastOverronPos == 20)//horde round
+ if((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21))
{
- Creature* pUnit = m_creature->SummonCreature(m_creature->GetEntry(),5458.01+irand(-10,10), -2340.27+irand(-10,10), 1459.60,0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000);
- if(pUnit)
- {
- ((hyjal_trashAI*)pUnit->AI())->faction = faction;
- ((hyjal_trashAI*)pUnit->AI())->IsOverrun = true;
- ((hyjal_trashAI*)pUnit->AI())->OverrunType = 10;//default
- ((hyjal_trashAI*)pUnit->AI())->SetupOverrun = false;
- pUnit->setActive(true);
- }
+ m_creature->setDeathState(DEAD);
+ m_creature->RemoveCorpse();
}
+
}
}
@@ -898,19 +745,6 @@ struct mob_necromancerAI : public hyjal_trashAI
if (target && target->isAlive())
m_creature->AddThreat(target,0.0);
}
- }
- if (i == LastOverronPos && IsOverrun)
- {
- Creature* pUnit = m_creature->SummonCreature(17931, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 2*60*1000);
- if(pUnit)
- {
- pUnit->SetVisibility(VISIBILITY_OFF);
- pUnit->SetMaxHealth(10000000);
- pUnit->SetHealth(10000000);
- pUnit->setFaction(17772);
- pUnit->Attack(m_creature, true);
- m_creature->AddThreat(pUnit,0);
- }
}
}
@@ -1024,19 +858,6 @@ struct mob_bansheeAI : public hyjal_trashAI
if (target && target->isAlive())
m_creature->AddThreat(target,0.0);
}
- }
- if (i == LastOverronPos && IsOverrun)
- {
- Creature* pUnit = m_creature->SummonCreature(17931, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 2*60*1000);
- if(pUnit)
- {
- pUnit->SetVisibility(VISIBILITY_OFF);
- pUnit->SetMaxHealth(10000000);
- pUnit->SetHealth(10000000);
- pUnit->setFaction(17772);
- pUnit->Attack(m_creature, true);
- m_creature->AddThreat(pUnit,0);
- }
}
}
@@ -1132,19 +953,6 @@ struct mob_crypt_fiendAI : public hyjal_trashAI
if (target && target->isAlive())
m_creature->AddThreat(target,0.0);
}
- }
- if (i == LastOverronPos && IsOverrun)
- {
- Creature* pUnit = m_creature->SummonCreature(17931, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 2*60*1000);
- if(pUnit)
- {
- pUnit->SetVisibility(VISIBILITY_OFF);
- pUnit->SetMaxHealth(10000000);
- pUnit->SetHealth(10000000);
- pUnit->setFaction(17772);
- pUnit->Attack(m_creature, true);
- m_creature->AddThreat(pUnit,0);
- }
}
}
@@ -1231,19 +1039,6 @@ struct mob_fel_stalkerAI : public hyjal_trashAI
if (target && target->isAlive())
m_creature->AddThreat(target,0.0);
}
- }
- if (i == LastOverronPos && IsOverrun)
- {
- Creature* pUnit = m_creature->SummonCreature(17931, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 2*60*1000);
- if(pUnit)
- {
- pUnit->SetVisibility(VISIBILITY_OFF);
- pUnit->SetMaxHealth(10000000);
- pUnit->SetHealth(10000000);
- pUnit->setFaction(17772);
- pUnit->Attack(m_creature, true);
- m_creature->AddThreat(pUnit,0);
- }
}
}
@@ -1447,14 +1242,6 @@ struct mob_gargoyleAI : public hyjal_trashAI
DoCast(target,SPELL_GARGOYLE_STRIKE,true);
}
}
- if (IsOverrun && i == LastOverronPos)
- {
- AddWaypoint(0, 5536.65+irand(-80,80), -2710.66+irand(-80,80), 1504.45+irand(-10,10));
- AddWaypoint(1, 5536.65+irand(-80,80), -2710.66+irand(-80,80), 1504.45+irand(-10,10));
- SetDespawnAtEnd(false);
- LastOverronPos = 1;
- Start(false, true, true);
- }
}
void JustDied(Unit *victim)
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 481f14f1a7d..6c5020e574c 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 EnterCombat(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 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(!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 (!UpdateVictim() )
+ 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,36 +284,30 @@ 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)) Target->RemoveAura(45151);
+ DoCast(m_creature->getVictim(), SPELL_STOMP);
StompTimer = 30000;
}else StompTimer -= diff;
if(BurnTimer < diff)
{
if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0))
- target->CastSpell(target,SPELL_BURN,true);
+ DoCast(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)
@@ -166,9 +318,9 @@ CreatureAI* GetAI_boss_brutallus(Creature *_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 95c0fe29502..044f29a11aa 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 - 2009 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 EnterCombat(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)
@@ -214,11 +215,8 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
if(target->HasAura(SPELL_DARK_TOUCHED))
{
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:
@@ -227,11 +225,8 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
if(target->HasAura(SPELL_FLAME_TOUCHED))
{
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 EnterCombat(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)
@@ -458,29 +460,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, DONE);
}
else
- {
m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
- }
}
void SpellHitTarget(Unit* target,const SpellEntry* spell)
@@ -489,7 +485,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);
@@ -510,10 +506,10 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
if(target->HasAura(SPELL_DARK_TOUCHED))
{
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;
@@ -523,11 +519,8 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
if(target->HasAura(SPELL_FLAME_TOUCHED))
{
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;
}
@@ -535,38 +528,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 0: return 0;
case 1:
if(Sacrolash)
- Sacrolash->MonsterYell(YELL_INTRO_SAC_1, LANG_UNIVERSAL,NULL);
- return 1000;
- case 2:
- m_creature->MonsterYell(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->MonsterYell(YELL_INTRO_SAC_3, LANG_UNIVERSAL,NULL);
+ DoScriptText(YELL_INTRO_SAC_3, Sacrolash);
return 2000;
- case 4:
- m_creature->MonsterYell(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->MonsterYell(YELL_INTRO_SAC_5, LANG_UNIVERSAL,NULL);
+ DoScriptText(YELL_INTRO_SAC_5, Sacrolash);
return 2000;
- case 6:
- m_creature->MonsterYell(YELL_INTRO_ALY_6, LANG_UNIVERSAL,NULL);
- return 1000;
+ case 6: DoScriptText(YELL_INTRO_ALY_6, m_creature); return 1000;
case 7:
if(Sacrolash)
- Sacrolash->MonsterYell(YELL_INTRO_SAC_7, LANG_UNIVERSAL,NULL);
+ DoScriptText(YELL_INTRO_SAC_7, Sacrolash);
return 3000;
- case 8:
- m_creature->MonsterYell(YELL_INTRO_ALY_8, LANG_UNIVERSAL,NULL);
- return 900000;
+ case 8: DoScriptText(YELL_INTRO_ALY_8, m_creature); return 900000;
}
return 10000;
}
@@ -575,13 +560,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)
{
@@ -589,12 +574,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;
-
+ DoScriptText(YELL_SISTER_SACROLASH_DEAD, m_creature);
+ DoCast(m_creature, SPELL_EMPOWER);
m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- DoCast(m_creature,SPELL_EMPOWER);
+ SisterDeath = true;
}
}
}
@@ -602,78 +585,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;
}
};
@@ -686,16 +667,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 EnterCombat(Unit *who){}
@@ -712,11 +692,8 @@ struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI
if(target->HasAura(SPELL_FLAME_TOUCHED))
{
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;
}
@@ -725,36 +702,34 @@ struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(!m_creature->HasAura(SPELL_IMAGE_VISUAL))
- DoCast(m_creature,SPELL_IMAGE_VISUAL);
+ 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);
- }
+ DoCast(m_creature->getVictim(), SPELL_DARK_STRIKE);
}
- darkstrike_timer = 3000;
+ DarkstrikeTimer = 3000;
}
- else darkstrike_timer -= diff;
+ else DarkstrikeTimer -= diff;
}
};
@@ -766,6 +741,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;
@@ -781,4 +757,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 b9bda8fa422..468d6801414 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);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
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 EnterCombat(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);
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 ef7cd79f9c0..aa818826d40 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 EnterCombat(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/boss_kiljaeden.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp
index 12f7e7b46b7..2ac90b87c35 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp
@@ -16,12 +16,1300 @@
/* ScriptData
SDName: Boss_Kiljaeden
-SD%Complete: 0
-SDComment: Placeholer
+SD%Complete: 70
+SDComment: Phase4, Phase5, Shadow Spike, Armageddon
SDCategory: Sunwell_Plateau
EndScriptData */
+//TODO rewrite Amagedon
+//TODO Remove blue visual from Orbs on reset and if it is used
+
#include "precompiled.h"
+#include "def_sunwell_plateau.h"
+#include <math.h>
+
+/*** Speech and sounds***/
+enum Speeches
+{
+ // These are used throughout Sunwell and Magisters(?). Players can hear this while running through the instances.
+ SAY_KJ_OFFCOMBAT1 = -1580066,
+ SAY_KJ_OFFCOMBAT2 = -1580067,
+ SAY_KJ_OFFCOMBAT3 = -1580068,
+ SAY_KJ_OFFCOMBAT4 = -1580069,
+ SAY_KJ_OFFCOMBAT5 = -1580070,
+
+ // Encounter speech and sounds
+ SAY_KJ_EMERGE = -1580071,
+ SAY_KJ_SLAY1 = -1580072,
+ SAY_KJ_SLAY2 = -1580073,
+ SAY_KJ_REFLECTION1 = -1580074,
+ SAY_KJ_REFLECTION2 = -1580075,
+ SAY_KJ_DARKNESS1 = -1580076,
+ SAY_KJ_DARKNESS2 = -1580077,
+ SAY_KJ_DARKNESS3 = -1580078,
+ SAY_KJ_PHASE3 = -1580079,
+ SAY_KJ_PHASE4 = -1580080,
+ SAY_KJ_PHASE5 = -1580081,
+ SAY_KJ_DEATH = -1580093,
+ EMOTE_KJ_DARKNESS = -1580094,
+
+ /*** Kalecgos - Anveena speech at the beginning of Phase 5; Anveena's sacrifice ***/
+ SAY_KALECGOS_AWAKEN = -1580082,
+ SAY_ANVEENA_IMPRISONED = -1580083,
+ SAY_KALECGOS_LETGO = -1580084,
+ SAY_ANVEENA_LOST = -1580085,
+ SAY_KALECGOS_FOCUS = -1580086,
+ SAY_ANVEENA_KALEC = -1580087,
+ SAY_KALECGOS_FATE = -1580088,
+ SAY_ANVEENA_GOODBYE = -1580089,
+ SAY_KALECGOS_GOODBYE = -1580090,
+ SAY_KALECGOS_ENCOURAGE = -1580091,
+
+ /*** Kalecgos says throughout the fight ***/
+ SAY_KALECGOS_JOIN = -1580092,
+ SAY_KALEC_ORB_READY1 = -1580095,
+ SAY_KALEC_ORB_READY2 = -1580096,
+ SAY_KALEC_ORB_READY3 = -1580097,
+ SAY_KALEC_ORB_READY4 = -1580098
+};
+
+/*** Spells used during the encounter ***/
+enum SpellIds
+{
+ /* Hand of the Deceiver's spells and cosmetics */
+ SPELL_SHADOW_BOLT_VOLLEY = 45770, // ~30 yard range Shadow Bolt Volley for ~2k(?) damage
+ SPELL_SHADOW_INFUSION = 45772, // They gain this at 20% - Immunity to Stun/Silence and makes them look angry!
+ SPELL_FELFIRE_PORTAL = 46875, // Creates a portal that spawns Felfire Fiends (LIVE FOR THE SWARM!1 FOR THE OVERMIND!)
+ SPELL_SHADOW_CHANNELING = 46757, // Channeling animation out of combat
+
+ /* Volatile Felfire Fiend's spells */
+ SPELL_FELFIRE_FISSION = 45779, // Felfire Fiends explode when they die or get close to target.
+
+ /* Kil'Jaeden's spells and cosmetics */
+ SPELL_TRANS = 23188, // Surprisingly, this seems to be the right spell.. (Where is it used?)
+ SPELL_REBIRTH = 44200, // Emerge from the Sunwell
+ SPELL_SOUL_FLAY = 45442, // 9k Shadow damage over 3 seconds. Spammed throughout all the fight.
+ SPELL_SOUL_FLAY_SLOW = 47106,
+ SPELL_LEGION_LIGHTNING = 45664, // Chain Lightning, 4 targets, ~3k Shadow damage, 1.5k mana burn
+ SPELL_FIRE_BLOOM = 45641, // Places a debuff on 5 raid members, which causes them to deal 2k Fire damage to nearby allies and selves. MIGHT NOT WORK
+
+ SPELL_SINISTER_REFLECTION = 45785, // Summon shadow copies of 5 raid members that fight against KJ's enemies
+ SPELL_COPY_WEAPON = 41055, // }
+ SPELL_COPY_WEAPON2 = 41054, // }
+ SPELL_COPY_OFFHAND = 45206, // }- Spells used in Sinister Reflection creation
+ SPELL_COPY_OFFHAND_WEAPON = 45205, // }
+
+ SPELL_SHADOW_SPIKE = 46680, // Bombard random raid members with Shadow Spikes (Very similar to Void Reaver orbs)
+ SPELL_FLAME_DART = 45737, // Bombards the raid with flames every 3(?) seconds
+ SPELL_DARKNESS_OF_A_THOUSAND_SOULS = 46605, // Begins a 8-second channeling, after which he will deal 50'000 damage to the raid
+ SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE = 45657,
+
+ /* Armageddon spells wrong visual */
+ SPELL_ARMAGEDDON_TRIGGER = 45909, // Meteor spell trigger missile should cast creature on himself
+ SPELL_ARMAGEDDON_VISUAL = 45911, // Does the hellfire visual to indicate where the meteor missle lands
+ SPELL_ARMAGEDDON_VISUAL2 = 45914, // Does the light visual to indicate where the meteor missle lands
+ SPELL_ARMAGEDDON_VISUAL3 = 24207, // This shouldn't correct but same as seen on the movie
+ SPELL_ARMAGEDDON_SUMMON_TRIGGER = 45921, // Summons the triggers that cast the spells on himself need random target select
+ SPELL_ARMAGEDDON_DAMAGE = 45915, // This does the area damage
+
+ /* Shield Orb Spells*/
+ SPELL_SHADOW_BOLT = 45680, //45679 would be correct but triggers to often //TODO fix console error
+
+
+ /* Anveena's spells and cosmetics (Or, generally, everything that has "Anveena" in name) */
+ SPELL_ANVEENA_PRISON = 46367, // She hovers locked within a bubble
+ SPELL_ANVEENA_ENERGY_DRAIN = 46410, // Sunwell energy glow animation (Control mob uses this)
+ SPELL_SACRIFICE_OF_ANVEENA = 46474, // This is cast on Kil'Jaeden when Anveena sacrifices herself into the Sunwell
+
+ /* Sinister Reflection Spells */
+ SPELL_SR_CURSE_OF_AGONY = 46190,
+ SPELL_SR_SHADOW_BOLT = 47076,
+
+ SPELL_SR_EARTH_SHOCK = 47071,
+
+ SPELL_SR_FIREBALL = 47074,
+
+ SPELL_SR_HEMORRHAGE = 45897,
+
+ SPELL_SR_HOLY_SHOCK = 38921,
+ SPELL_SR_HAMMER_OF_JUSTICE = 37369,
+
+ SPELL_SR_HOLY_SMITE = 47077,
+ SPELL_SR_RENEW = 47079,
+
+ SPELL_SR_SHOOT = 16496,
+ SPELL_SR_MULTI_SHOT = 48098,
+ SPELL_SR_WING_CLIP = 40652,
+
+ SPELL_SR_WHIRLWIND = 17207,
+
+ SPELL_SR_MOONFIRE = 47072,
+ //SPELL_SR_PLAGU STRIKE = 58843, Dk Spell!
+
+ /*** Other Spells (used by players, etc) ***/
+ SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT = 45839, // Possess the blue dragon from the orb to help the raid.
+ SPELL_ENTROPIUS_BODY = 46819, // Visual for Entropius at the Epilogue
+ SPELL_RING_OF_BLUE_FLAMES = 45825 //Cast this spell when the go is activated
+};
+
+enum CreatureIds
+{
+ CREATURE_ANVEENA = 26046, // Embodiment of the Sunwell
+ CREATURE_KALECGOS = 25319, // Helps the raid throughout the fight
+ CREATURE_PROPHET = 26246, // Outro
+ CREATURE_KILJAEDEN = 25315, // Give it to 'em KJ!
+ CREATURE_HAND_OF_THE_DECEIVER = 25588, // Adds found before KJ emerges
+ CREATURE_FELFIRE_PORTAL = 25603, // Portal spawned be Hand of the Deceivers
+ CREATURE_VOLATILE_FELFIRE_FIEND = 25598, // Fiends spawned by the above portal
+ CREATURE_ARMAGEDDON_TARGET = 25735, // This mob casts meteor on itself.. I think
+ CREATURE_SHIELD_ORB = 25502, // Shield orbs circle the room raining shadow bolts on raid
+ CREATURE_THE_CORE_OF_ENTROPIUS = 26262, // Used in the ending cinematic?
+ CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT = 25653, // NPC that players possess when using the Orb of the Blue Dragonflight
+ CREATURE_SPIKE_TARGET1 = 30598, //Should summon these under Shadow Spike Channel on targets place
+ CREATURE_SPIKE_TARGET2 = 30614,
+ CREATURE_SINISTER_REFLECTION = 25708 //Sinister Relection spawnd on Phase swichtes
+};
+
+/*** GameObjects ***/
+#define GAMEOBJECT_ORB_OF_THE_BLUE_DRAGONFLIGHT 188415
+
+/*** Error messages ***/
+#define ERROR_KJ_NOT_SUMMONED "TSCR ERROR: Unable to summon Kil'Jaeden for some reason"
+
+/*** Others ***/
+#define FLOOR_Z 28.050388
+#define SHIELD_ORB_Z 45.000
+
+enum Phase
+{
+ PHASE_DECEIVERS = 1, // Fight 3 adds
+ PHASE_NORMAL = 2, // Kil'Jaeden emerges from the sunwell
+ PHASE_DARKNESS = 3, // At 85%, he gains few abilities; Kalecgos joins the fight
+ PHASE_ARMAGEDDON = 4, // At 55%, he gains even more abilities
+ PHASE_SACRIFICE = 5, // At 25%, Anveena sacrifices herself into the Sunwell; at this point he becomes enraged and has *significally* shorter cooldowns.
+};
+
+//Timers
+enum KilJaedenTimers {
+ TIMER_KALEC_JOIN = 0,
+
+ //Phase 2 Timer
+ TIMER_SOUL_FLAY = 1,
+ TIMER_LEGION_LIGHTNING = 2,
+ TIMER_FIRE_BLOOM = 3,
+ TIMER_SUMMON_SHILEDORB = 4,
+
+ //Phase 3 Timer
+ TIMER_SHADOW_SPIKE = 5,
+ TIMER_FLAME_DART = 6,
+ TIMER_DARKNESS = 7,
+ TIMER_ORBS_EMPOWER = 8,
+
+ //Phase 4 Timer
+ TIMER_ARMAGEDDON = 9
+};
+
+// Locations of the Hand of Deceiver adds
+float DeceiverLocations[3][3]=
+{
+ {1682.045, 631.299, 5.936},
+ {1684.099, 618.848, 0.589},
+ {1694.170, 612.272, 1.416},
+};
+
+// Locations, where Shield Orbs will spawn
+float ShieldOrbLocations[4][2]=
+{
+ {1698.900, 627.870}, //middle pont of Sunwell
+ {12, 3.14}, // First one spawns northeast of KJ
+ {12, 3.14/0.7}, // Second one spawns southeast
+ {12, 3.14*3.8} // Third one spawns (?)
+};
+
+float OrbLocations[4][5] = {
+ (1694.48, 674.29, 28.0502, 4.86985),
+ (1745.68, 621.823, 28.0505, 2.93777),
+ (1704.14, 583.591, 28.1696, 1.59003),
+ (1653.12, 635.41, 28.0932, 0.0977725),
+};
+
+struct Speech
+{
+ int32 textid;
+ uint32 creature, timer;
+};
+// TODO: Timers
+static Speech Sacrifice[]=
+{
+ {SAY_KALECGOS_AWAKEN, CREATURE_KALECGOS, 5000},
+ {SAY_ANVEENA_IMPRISONED, CREATURE_ANVEENA, 5000},
+ {SAY_KALECGOS_LETGO, CREATURE_KALECGOS, 8000},
+ {SAY_ANVEENA_LOST, CREATURE_ANVEENA, 5000},
+ {SAY_KALECGOS_FOCUS, CREATURE_KALECGOS, 7000},
+ {SAY_ANVEENA_KALEC, CREATURE_ANVEENA, 2000},
+ {SAY_KALECGOS_FATE, CREATURE_KALECGOS, 3000},
+ {SAY_ANVEENA_GOODBYE, CREATURE_ANVEENA, 6000},
+ {SAY_KALECGOS_GOODBYE, CREATURE_KALECGOS, 12000},
+ {SAY_KJ_PHASE5, CREATURE_KILJAEDEN, 8000},
+ {SAY_KALECGOS_ENCOURAGE, CREATURE_KALECGOS, 5000}
+};
+
+class AllOrbsInGrid
+{
+public:
+ AllOrbsInGrid() {}
+ bool operator() (GameObject* go)
+ {
+ if(go->GetEntry() == GAMEOBJECT_ORB_OF_THE_BLUE_DRAGONFLIGHT)
+ return true;
+ return false;
+ }
+};
+
+bool GOHello_go_orb_of_the_blue_flight(Player *plr, GameObject* go)
+{
+ if(go->GetUInt32Value(GAMEOBJECT_FACTION) == 35){
+ ScriptedInstance* pInstance = ((ScriptedInstance*)go->GetInstanceData());
+ float x,y,z, dx,dy,dz;
+ go->SummonCreature(CREATURE_POWER_OF_THE_BLUE_DRAGONFLIGHT, plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 121000);
+ plr->CastSpell(plr, SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT, true);
+ go->SetUInt32Value(GAMEOBJECT_FACTION, 0);
+ Unit* Kalec = ((Creature*)Unit::GetUnit(*plr, pInstance->GetData64(DATA_KALECGOS_KJ)));
+ //Kalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
+ go->GetPosition(x,y,z);
+ for(uint8 i = 0; i < 4; ++i){
+ DynamicObject* Dyn = Kalec->GetDynObject(SPELL_RING_OF_BLUE_FLAMES);
+ if(Dyn){
+ Dyn->GetPosition(dx,dy,dz);
+ if(x == dx && dy == y && dz == z){
+ Dyn->RemoveFromWorld();
+ break;
+ }
+ }
+ }
+ go->Refresh();
+ }
+ return true;
+}
+
+//AI for Kalecgos
+struct TRINITY_DLL_DECL boss_kalecgosKJAI : public ScriptedAI
+{
+ boss_kalecgosKJAI(Creature* c) : ScriptedAI(c){
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+
+ GameObject* Orb[4];
+ ScriptedInstance* pInstance;
+ uint8 OrbsEmpowered;
+ uint8 EmpowerCount;
+
+ bool Searched;
+
+ void InitializeAI(){
+ for(uint8 i = 0; i < 4; ++i)
+ Orb[i] = NULL;
+ FindOrbs();
+ OrbsEmpowered = 0;
+ EmpowerCount = 0;
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->setActive(true);
+ Searched = false;
+ FindOrbs();
+ }
+
+ void Reset(){}
+
+ void Aggro(Unit* who) {}
+
+ void FindOrbs()
+ {
+ CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
+ Cell cell(pair);
+ cell.data.Part.reserved = ALL_DISTRICT;
+ cell.SetNoCreate();
+ std::list<GameObject*> orbList;
+ AllOrbsInGrid check;
+ Trinity::GameObjectListSearcher<AllOrbsInGrid> searcher(orbList, check);
+ TypeContainerVisitor<Trinity::GameObjectListSearcher<AllOrbsInGrid>, GridTypeMapContainer> visitor(searcher);
+ CellLock<GridReadGuard> cell_lock(cell, pair);
+ cell_lock->Visit(cell_lock, visitor, *(m_creature->GetMap()));
+ if(orbList.empty())
+ return;
+ uint8 i = 0;
+ for(std::list<GameObject*>::iterator itr = orbList.begin(); itr != orbList.end(); ++itr, ++i){
+ Orb[i] = GameObject::GetGameObject(*m_creature, (*itr)->GetGUID());
+ }
+ }
+
+ void ResetOrbs(){
+ m_creature->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
+ for(uint8 i = 0; i < 4; ++i)
+ if(Orb[i]) Orb[i]->SetUInt32Value(GAMEOBJECT_FACTION, 0);
+ }
+
+ void EmpowerOrb(bool all)
+ {
+ if(!Orb[OrbsEmpowered])
+ return;
+ uint8 random = rand()%3;
+ if(all){
+ m_creature->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES);
+ for(uint8 i = 0; i < 4; ++i){
+ if(!Orb[i]) return;
+ Orb[i]->CastSpell(m_creature, SPELL_RING_OF_BLUE_FLAMES);
+ Orb[i]->SetUInt32Value(GAMEOBJECT_FACTION, 35);
+ Orb[i]->setActive(true);
+ Orb[i]->Refresh();
+ }
+ }else{
+ float x,y,z, dx,dy,dz;
+ Orb[random]->GetPosition(x,y,z);
+ for(uint8 i = 0; i < 4; ++i){
+ DynamicObject* Dyn = m_creature->GetDynObject(SPELL_RING_OF_BLUE_FLAMES);
+ if(Dyn){
+ Dyn->GetPosition(dx,dy,dz);
+ if(x == dx && dy == y && dz == z){
+ Dyn->RemoveFromWorld();
+ break;
+ }
+ }
+ }
+ Orb[random]->CastSpell(m_creature, SPELL_RING_OF_BLUE_FLAMES);
+ Orb[random]->SetUInt32Value(GAMEOBJECT_FACTION, 35);
+ Orb[random]->setActive(true);
+ Orb[random]->Refresh();
+ ++OrbsEmpowered;
+ }
+ ++EmpowerCount;
+
+ switch(EmpowerCount){
+ case 1: DoScriptText(SAY_KALEC_ORB_READY1, m_creature); break;
+ case 2: DoScriptText(SAY_KALEC_ORB_READY2, m_creature); break;
+ case 3: DoScriptText(SAY_KALEC_ORB_READY3, m_creature); break;
+ case 4: DoScriptText(SAY_KALEC_ORB_READY4, m_creature); break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff){
+ if(!Searched){
+ FindOrbs();
+ Searched = true;
+ }
+
+ if(OrbsEmpowered == 4) OrbsEmpowered = 0;
+ }
+};
+
+CreatureAI* GetAI_boss_kalecgosKJ(Creature *_Creature)
+{
+ return new boss_kalecgosKJAI (_Creature);
+}
+
+//AI for Kil'jaeden
+struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI
+{
+ boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), Summons(m_creature){
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+
+ ScriptedInstance* pInstance;
+ SummonList Summons;
+ Creature* Kalec;
+ Unit* randomPlayer;
+
+ uint8 Phase;
+ uint8 ActiveTimers;
+
+ uint32 Timer[10];
+ uint32 WaitTimer;
+
+ /* Boolean */
+ bool IsKalecJoined;
+ bool IsInDarkness;
+ bool TimerIsDeactiveted[10];
+ bool IsWaiting;
+ bool OrbActivated;
+
+ void Reset()
+ {
+ // TODO: Fix timers
+ Timer[TIMER_KALEC_JOIN] = 26000;
+
+ //Phase 2 Timer
+ Timer[TIMER_SOUL_FLAY] = 20000;
+ Timer[TIMER_LEGION_LIGHTNING] = 40000;
+ Timer[TIMER_FIRE_BLOOM] = 30000;
+ Timer[TIMER_SUMMON_SHILEDORB] = 45000;
+
+ //Phase 3 Timer
+ Timer[TIMER_SHADOW_SPIKE] = 4000;
+ Timer[TIMER_FLAME_DART] = 3000;
+ Timer[TIMER_DARKNESS] = 45000;
+ Timer[TIMER_ORBS_EMPOWER] = 35000;
+
+ //Phase 4 Timer
+ Timer[TIMER_ARMAGEDDON] = 2000;
+
+ ActiveTimers = 5;
+ WaitTimer = 0;
+
+ Phase = PHASE_DECEIVERS;
+
+ IsKalecJoined = false;
+ IsInDarkness = false;
+ IsWaiting = false;
+ OrbActivated = false;
+
+ Kalec = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_KJ)));
+ ChangeTimers(false, 0);
+ }
+
+ void ChangeTimers(bool status, uint32 WTimer){
+ for(uint8 i = 0; i < 10;++i)
+ TimerIsDeactiveted[i] = status;
+ TimerIsDeactiveted[TIMER_KALEC_JOIN] = IsKalecJoined;
+
+ if(WTimer > 0){
+ IsWaiting = true;
+ WaitTimer = WTimer;
+ }
+
+ if(OrbActivated) TimerIsDeactiveted[TIMER_ORBS_EMPOWER] = true;
+ if(Timer[TIMER_SHADOW_SPIKE] == 0) TimerIsDeactiveted[TIMER_SHADOW_SPIKE] = true;
+ if(Phase == PHASE_SACRIFICE) TimerIsDeactiveted[TIMER_SUMMON_SHILEDORB] = true;
+ }
+
+ void JustSummoned(Creature* summoned)
+ {
+ if(summoned->GetEntry() == CREATURE_ARMAGEDDON_TARGET)
+ {
+ summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }else{
+ summoned->SetLevel(m_creature->getLevel());
+ }
+ summoned->setFaction(m_creature->getFaction());
+ Summons.Summon(summoned);
+ }
+
+ void JustDied(Unit* killer)
+ {
+ DoScriptText(SAY_KJ_DEATH, m_creature);
+
+ if(pInstance)
+ pInstance->SetData(DATA_KILJAEDEN_EVENT, DONE);
+ }
+
+ void KilledUnit(Unit* victim)
+ {
+ switch(rand()%2)
+ {
+ case 0: DoScriptText(SAY_KJ_SLAY1, m_creature); break;
+ case 1: DoScriptText(SAY_KJ_SLAY2, m_creature); break;
+ }
+ }
+
+ void EnterEvadeMode()
+ {
+ Scripted_NoMovementAI::EnterEvadeMode();
+ Summons.DespawnAll();
+
+ // Reset the controller
+ if(pInstance){
+ Creature* Control = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)));
+ if(Control)
+ ((Scripted_NoMovementAI*)Control->AI())->Reset();
+ }
+ }
+
+ void Aggro(Unit* who){
+ DoZoneInCombat();
+ DoScriptText(SAY_KJ_EMERGE, m_creature);
+ }
+
+ void CastSinisterReflection()
+ {
+ switch(rand()%2){
+ case 0: DoScriptText(SAY_KJ_REFLECTION1, m_creature); break;
+ case 1: DoScriptText(SAY_KJ_REFLECTION2, m_creature); break;
+ }
+ DoCast(m_creature, SPELL_SINISTER_REFLECTION, true);
+ for(uint8 i = 0; i < 4; i++){
+ float x,y,z;
+ Unit* target;
+ for(uint8 z = 0; z < 6; ++z){
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true);
+ if (!target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break;
+ }
+ target->GetPosition(x,y,z);
+ Creature* SinisterReflection = m_creature->SummonCreature(CREATURE_SINISTER_REFLECTION, x,y,z,0, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ SinisterReflection->AI()->AttackStart(target);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!UpdateVictim() || Phase < PHASE_NORMAL)
+ return;
+
+ if(IsWaiting){
+ if(WaitTimer < diff){
+ IsWaiting = false;
+ ChangeTimers(false, 0);
+ }
+ else WaitTimer -= diff;
+ }
+
+ for(uint8 t = 0; t < ActiveTimers; ++t){
+ if(Timer[t] < diff && !TimerIsDeactiveted[t]){
+ switch(t){
+ case TIMER_KALEC_JOIN:
+ if(Kalec){
+ DoScriptText(SAY_KALECGOS_JOIN, Kalec);
+ IsKalecJoined = true;
+ TimerIsDeactiveted[TIMER_KALEC_JOIN] = true;
+ }
+ break;
+ case TIMER_SOUL_FLAY:
+ if(!m_creature->IsNonMeleeSpellCasted(false)){
+ m_creature->CastSpell(m_creature->getVictim(), SPELL_SOUL_FLAY, false);
+ m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_SOUL_FLAY_SLOW, true);
+ Timer[TIMER_SOUL_FLAY] = 3500;
+ }
+ break;
+ case TIMER_LEGION_LIGHTNING:
+ if(!m_creature->IsNonMeleeSpellCasted(false)){
+ m_creature->RemoveAurasDueToSpell(SPELL_SOUL_FLAY);
+ for(uint8 z = 0; z < 6; ++z){
+ randomPlayer = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true);
+ if (!randomPlayer->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break;
+ }
+ if(randomPlayer)DoCast(randomPlayer, SPELL_LEGION_LIGHTNING, false);
+ else error_log("try to cast SPELL_LEGION_LIGHTNING on invalid target");
+ Timer[TIMER_LEGION_LIGHTNING] = (Phase == PHASE_SACRIFICE) ? 18000 : 30000; // 18 seconds in PHASE_SACRIFICE
+ Timer[TIMER_SOUL_FLAY] = 2500;
+ }
+ break;
+ case TIMER_FIRE_BLOOM:
+ if(!m_creature->IsNonMeleeSpellCasted(false)){
+ m_creature->RemoveAurasDueToSpell(SPELL_SOUL_FLAY);
+ DoCastAOE(SPELL_FIRE_BLOOM, false);
+ Timer[TIMER_FIRE_BLOOM] = (Phase == PHASE_SACRIFICE) ? 25000 : 40000; // 25 seconds in PHASE_SACRIFICE
+ Timer[TIMER_SOUL_FLAY] = 1000;
+ }
+ break;
+ case TIMER_SUMMON_SHILEDORB:
+ for(uint8 i = 1; i < Phase; ++i){
+ float sx, sy;
+ sx = ShieldOrbLocations[0][0] + sin(ShieldOrbLocations[i][0]);
+ sy = ShieldOrbLocations[0][1] + sin(ShieldOrbLocations[i][1]);
+ m_creature->SummonCreature(CREATURE_SHIELD_ORB, sx, sy, SHIELD_ORB_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000);
+ }
+ Timer[TIMER_SUMMON_SHILEDORB] = 30000+rand()%30*1000; // 30-60seconds cooldown
+ Timer[TIMER_SOUL_FLAY] = 2000;
+ break;
+ case TIMER_SHADOW_SPIKE: //Phase 3
+ if(!m_creature->IsNonMeleeSpellCasted(false)){
+ DoCastAOE(SPELL_SHADOW_SPIKE, false);
+ Timer[TIMER_SHADOW_SPIKE] = 0;
+ TimerIsDeactiveted[TIMER_SHADOW_SPIKE] = true;
+ ChangeTimers(true, 30000);
+ }
+ break;
+ case TIMER_FLAME_DART: //Phase 3
+ DoCastAOE(SPELL_FLAME_DART, false);
+ Timer[TIMER_FLAME_DART] = 3000; //TODO Timer
+ break;
+ case TIMER_DARKNESS: //Phase 3
+ if(!m_creature->IsNonMeleeSpellCasted(false)){
+ // Begins to channel for 8 seconds, then deals 50'000 damage to all raid members.
+ if(!IsInDarkness){
+ DoScriptText(EMOTE_KJ_DARKNESS, m_creature);
+ DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS, false);
+ ChangeTimers(true, 9000);
+ Timer[TIMER_DARKNESS] = 8750;
+ TimerIsDeactiveted[TIMER_DARKNESS] = false;
+ if(Phase == PHASE_SACRIFICE) TimerIsDeactiveted[TIMER_ARMAGEDDON] = false;
+ IsInDarkness = true;
+ }else{
+ Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? 20000 + rand()%15000 : 40000 + rand()%30000;
+ IsInDarkness = false;
+ DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE);
+ switch(rand()%3){
+ case 0: DoScriptText(SAY_KJ_DARKNESS1, m_creature); break;
+ case 1: DoScriptText(SAY_KJ_DARKNESS2, m_creature); break;
+ case 2: DoScriptText(SAY_KJ_DARKNESS3, m_creature); break;
+ }
+ }
+ Timer[TIMER_SOUL_FLAY] = 9000;
+ }
+ break;
+ case TIMER_ORBS_EMPOWER: //Phase 3
+ if(Phase == PHASE_SACRIFICE){
+ if(Kalec)((boss_kalecgosKJAI*)Kalec->AI())->EmpowerOrb(true);
+ }else if(Kalec)((boss_kalecgosKJAI*)Kalec->AI())->EmpowerOrb(false);
+ Timer[TIMER_ORBS_EMPOWER]= (Phase == PHASE_SACRIFICE) ? 45000 : 35000;
+ OrbActivated = true;
+ TimerIsDeactiveted[TIMER_ORBS_EMPOWER] = true;
+ break;
+ case TIMER_ARMAGEDDON: //Phase 4
+ Unit* target;
+ for(uint8 z = 0; z < 6; ++z){
+ target = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true);
+ if (!target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break;
+ }
+ if(target){
+ float x, y, z;
+ target->GetPosition(x, y, z);
+ m_creature->SummonCreature(CREATURE_ARMAGEDDON_TARGET, x,y,z,0, TEMPSUMMON_TIMED_DESPAWN,15000);
+ }
+ Timer[TIMER_ARMAGEDDON] = 2000; // No, I'm not kidding
+ break;
+ }
+ break;
+ }
+ }
+ //Time runs over!
+ for(uint8 i = 0; i < ActiveTimers; ++i)
+ if(!TimerIsDeactiveted[i]){
+ Timer[i] -= diff;
+ if(((int32)Timer[i]) < 0) Timer[i] = 0;
+ }
+
+ //Phase 3
+ if(Phase <= PHASE_NORMAL){
+ if(Phase == PHASE_NORMAL && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 85)){
+ CastSinisterReflection();
+ DoScriptText(SAY_KJ_PHASE3, m_creature);
+ Phase = PHASE_DARKNESS;
+ OrbActivated = false;
+ ActiveTimers = 9;
+ }
+ else return;
+ }
+
+ //Phase 4
+ if(Phase <= PHASE_DARKNESS){
+ if(Phase == PHASE_DARKNESS && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 55)){
+ DoScriptText(SAY_KJ_PHASE4, m_creature);
+ Phase = PHASE_ARMAGEDDON;
+ OrbActivated = false;
+ ActiveTimers = 10;
+ }
+ else return;
+ }
+
+ //Phase 5 specific spells all we can
+ if(Phase <= PHASE_ARMAGEDDON){
+ if(Phase == PHASE_ARMAGEDDON && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)){
+ Phase = PHASE_SACRIFICE;
+ Creature* Anveena = (Creature*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANVEENA)));
+ if (Anveena)Anveena->CastSpell(m_creature, SPELL_SACRIFICE_OF_ANVEENA, false);
+ OrbActivated = false;
+ ChangeTimers(true, 10000);// He shouldn't cast spells for ~10 seconds after Anveena's sacrifice. This will be done within Anveena's script
+ }
+ else return;
+ }
+
+}
+};
+
+CreatureAI* GetAI_boss_kiljaeden(Creature *_Creature)
+{
+ return new boss_kiljaedenAI (_Creature);
+}
+
+//AI for Kil'jaeden Event Controller
+struct TRINITY_DLL_DECL mob_kiljaeden_controllerAI : public Scripted_NoMovementAI
+{
+ mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), Summons(m_creature){
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+
+ ScriptedInstance* pInstance;
+ Creature* KalecKJ;
+ SummonList Summons;
+
+ bool SummonedDeceivers;
+ bool KiljaedenDeath;
+
+ uint32 RandomSayTimer;
+ uint32 Phase;
+ uint8 DeceiverDeathCount;
+
+ void InitializeAI(){
+ KalecKJ = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KALECGOS_KJ));
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ m_creature->addUnitState(UNIT_STAT_STUNNED);
+ }
+
+ void Reset(){
+ Phase = PHASE_DECEIVERS;
+ if(KalecKJ)((boss_kalecgosKJAI*)KalecKJ->AI())->ResetOrbs();
+ DeceiverDeathCount = 0;
+ SummonedDeceivers = false;
+ KiljaedenDeath = false;
+ RandomSayTimer = 30000;
+ Summons.DespawnAll();
+ }
+
+ void JustSummoned(Creature* summoned){
+ switch(summoned->GetEntry()){
+ case CREATURE_HAND_OF_THE_DECEIVER:
+ summoned->CastSpell(summoned, SPELL_SHADOW_CHANNELING, false);
+ break;
+ case CREATURE_ANVEENA:
+ summoned->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
+ summoned->CastSpell(summoned, SPELL_ANVEENA_PRISON, true);
+ summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ break;
+ case CREATURE_KILJAEDEN:
+ summoned->CastSpell(summoned, SPELL_REBIRTH, false);
+ ((boss_kiljaedenAI*)summoned->AI())->Phase=PHASE_NORMAL;
+ summoned->AddThreat(m_creature->getVictim(), 1.0f);
+ break;
+ }
+ Summons.Summon(summoned);
+ }
+
+ void Aggro(Unit* who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(RandomSayTimer < diff && pInstance->GetData(DATA_MURU_EVENT) != DONE && pInstance->GetData(DATA_KILJAEDEN_EVENT) == NOT_STARTED){
+ switch(rand()%5){
+ case 0: DoScriptText(SAY_KJ_OFFCOMBAT1, m_creature); break;
+ case 1: DoScriptText(SAY_KJ_OFFCOMBAT2, m_creature); break;
+ case 2: DoScriptText(SAY_KJ_OFFCOMBAT3, m_creature); break;
+ case 3: DoScriptText(SAY_KJ_OFFCOMBAT4, m_creature); break;
+ case 4: DoScriptText(SAY_KJ_OFFCOMBAT5, m_creature); break;
+ }
+ RandomSayTimer = 30000;
+ }else RandomSayTimer -= diff;
+
+ if(!SummonedDeceivers){
+ for(uint8 i = 0; i < 3; ++i)
+ m_creature->SummonCreature(CREATURE_HAND_OF_THE_DECEIVER, DeceiverLocations[i][0], DeceiverLocations[i][1], FLOOR_Z, DeceiverLocations[i][2], TEMPSUMMON_DEAD_DESPAWN, 0);
+
+ DoSpawnCreature(CREATURE_ANVEENA, 0, 0, 40, 0, TEMPSUMMON_DEAD_DESPAWN, 0);
+ DoCast(m_creature, SPELL_ANVEENA_ENERGY_DRAIN);
+ SummonedDeceivers = true;
+ }
+
+ if(DeceiverDeathCount > 2 && Phase == PHASE_DECEIVERS){
+ m_creature->RemoveAurasDueToSpell(SPELL_ANVEENA_ENERGY_DRAIN) ;
+ Phase = PHASE_NORMAL;
+ DoSpawnCreature(CREATURE_KILJAEDEN, 0, 0,0, 0, TEMPSUMMON_MANUAL_DESPAWN, 0);
+ }
+ }
+};
+
+CreatureAI* GetAI_mob_kiljaeden_controller(Creature *_Creature)
+{
+ return new mob_kiljaeden_controllerAI (_Creature);
+}
+
+//AI for Hand of the Deceiver
+struct TRINITY_DLL_DECL mob_hand_of_the_deceiverAI : public ScriptedAI
+{
+ mob_hand_of_the_deceiverAI(Creature* c) : ScriptedAI(c){
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+ ScriptedInstance* pInstance;
+
+ uint32 ShadowBoltVolleyTimer;
+ uint32 FelfirePortalTimer;
+
+ void Reset(){
+ // TODO: Timers!
+ ShadowBoltVolleyTimer = 8000 + rand()%6000; // So they don't all cast it in the same moment.
+ FelfirePortalTimer = 20000;
+ if(pInstance)pInstance->SetData(DATA_KILJAEDEN_EVENT, NOT_STARTED);
+ }
+
+ void JustSummoned(Creature* summoned){
+ summoned->setFaction(m_creature->getFaction());
+ summoned->SetLevel(m_creature->getLevel());
+ }
+
+ void Aggro(Unit* who){
+ if(pInstance){
+ pInstance->SetData(DATA_KILJAEDEN_EVENT, IN_PROGRESS);
+ Creature* Control = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)));
+ if(Control)
+ Control->AddThreat(who, 1.0f);
+ }
+ m_creature->InterruptNonMeleeSpells(true);
+ }
+
+ void JustDied(Unit* killer){
+ if(!pInstance)
+ return;
+
+ Creature* Control = ((Creature*)Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER)));
+ if(Control)
+ ((mob_kiljaeden_controllerAI*)Control->AI())->DeceiverDeathCount++;
+ }
+
+ void UpdateAI(const uint32 diff){
+ if(!InCombat)
+ DoCast(m_creature, SPELL_SHADOW_CHANNELING);
+
+ if(!UpdateVictim())
+ return;
+
+ // Gain Shadow Infusion at 20% health
+ if(((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) && !m_creature->HasAura(SPELL_SHADOW_INFUSION, 0))
+ DoCast(m_creature, SPELL_SHADOW_INFUSION, true);
+
+ // Shadow Bolt Volley - Shoots Shadow Bolts at all enemies within 30 yards, for ~2k Shadow damage.
+ if(ShadowBoltVolleyTimer < diff){
+ DoCast(m_creature->getVictim(), SPELL_SHADOW_BOLT_VOLLEY);
+ ShadowBoltVolleyTimer = 12000;
+ }else ShadowBoltVolleyTimer -= diff;
+
+ // Felfire Portal - Creatres a portal, that spawns Volatile Felfire Fiends, which do suicide bombing.
+ if(FelfirePortalTimer < diff){
+ Creature* Portal = DoSpawnCreature(CREATURE_FELFIRE_PORTAL, 0, 0,0, 0, TEMPSUMMON_TIMED_DESPAWN, 20000);
+ if(Portal)
+ {
+ std::list<HostilReference*>::iterator itr;
+ for(itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
+ {
+ Unit* pUnit = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
+ if(pUnit)
+ Portal->AddThreat(pUnit, 1.0f);
+ }
+ }
+ FelfirePortalTimer = 20000;
+ }else FelfirePortalTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_mob_hand_of_the_deceiver(Creature *_Creature)
+{
+ return new mob_hand_of_the_deceiverAI (_Creature);
+}
+
+//AI for Felfire Portal
+struct TRINITY_DLL_DECL mob_felfire_portalAI : public Scripted_NoMovementAI
+{
+ mob_felfire_portalAI(Creature* c) : Scripted_NoMovementAI(c) {}
+
+ uint32 SpawnFiendTimer;
+
+ void InitializeAI(){
+ SpawnFiendTimer = 5000;
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
+ }
+
+ // TODO: Timers
+ void Reset() {
+
+ }
+
+ void Aggro(Unit* who) {}
+
+ void JustSummoned(Creature* summoned)
+ {
+ summoned->setFaction(m_creature->getFaction());
+ summoned->SetLevel(m_creature->getLevel());
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!UpdateVictim())
+ return;
+
+ if(SpawnFiendTimer < diff)
+ {
+ Creature* Fiend = DoSpawnCreature(CREATURE_VOLATILE_FELFIRE_FIEND, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000);
+ if(Fiend)
+ Fiend->AddThreat(SelectUnit(SELECT_TARGET_RANDOM,0), 100000.0f);
+ SpawnFiendTimer = 4000 + rand()%4000;
+ }else SpawnFiendTimer -= diff;
+ }
+};
+
+CreatureAI* GetAI_mob_felfire_portal(Creature *_Creature)
+{
+ return new mob_felfire_portalAI (_Creature);
+}
+
+//AI for Felfire Fiend
+struct TRINITY_DLL_DECL mob_volatile_felfire_fiendAI : public ScriptedAI
+{
+ mob_volatile_felfire_fiendAI(Creature* c) : ScriptedAI(c) {}
+
+ uint32 ExplodeTimer;
+
+ bool LockedTarget;
+
+ void Reset()
+ {
+ ExplodeTimer = 2000;
+ LockedTarget = false;
+ }
+
+ void Aggro(Unit* who) {}
+
+ void DamageTaken(Unit *done_by, uint32 &damage)
+ {
+ if(damage > m_creature->GetHealth())
+ DoCast(m_creature, SPELL_FELFIRE_FISSION, true);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!UpdateVictim())
+ return;
+
+ if(!LockedTarget){
+ m_creature->AddThreat(m_creature->getVictim(), 10000000.0f);
+ LockedTarget = true;
+ }
+
+ if(ExplodeTimer){
+ if(ExplodeTimer < diff)
+ ExplodeTimer = 0;
+ else ExplodeTimer -= diff;
+ }
+ else if(m_creature->IsWithinDistInMap(m_creature->getVictim(), 3)) // Explode if it's close enough to it's target
+ {
+ DoCast(m_creature->getVictim(), SPELL_FELFIRE_FISSION);
+ m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ }
+ }
+};
+
+CreatureAI* GetAI_mob_volatile_felfire_fiend(Creature *_Creature)
+{
+ return new mob_volatile_felfire_fiendAI (_Creature);
+}
+
+//AI for Armageddon target
+struct TRINITY_DLL_DECL mob_armageddonAI : public Scripted_NoMovementAI
+{
+ mob_armageddonAI(Creature* c) : Scripted_NoMovementAI(c) {}
+
+ uint8 Spell;
+ uint32 Timer;
+
+ void Reset(){
+ Spell = 0;
+ Timer = 0;
+ }
+
+ void Aggro(Unit* who){}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(Timer < diff){
+ switch(Spell){
+ case 0:
+ DoCast(m_creature, SPELL_ARMAGEDDON_VISUAL, true);
+ ++Spell;
+ break;
+ case 1:
+ DoCast(m_creature, SPELL_ARMAGEDDON_VISUAL2, true);
+ Timer = 9000;
+ ++Spell;
+ break;
+ case 2:
+ DoCast(m_creature, SPELL_ARMAGEDDON_TRIGGER, true);
+ ++Spell;
+ Timer = 5000;
+ break;
+ case 3:
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveCorpse();
+ break;
+ }
+ }else Timer -=diff;
+ }
+};
+
+CreatureAI* GetAI_mob_armageddon(Creature *_Creature)
+{
+ return new mob_armageddonAI (_Creature);
+}
+
+//AI for Shield Orbs
+struct TRINITY_DLL_DECL mob_shield_orbAI : public ScriptedAI
+{
+ mob_shield_orbAI(Creature* c) : ScriptedAI(c) {
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+
+ bool PointReached;
+ bool Clockwise;
+ uint32 Timer;
+ uint32 CheckTimer;
+ ScriptedInstance* pInstance;
+ float x, y, r, c, mx, my;
+
+ void InitializeAI(){
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
+ PointReached = true;
+ Timer = 500+ rand()%500;
+ CheckTimer = 1000;
+ r = 17;
+ c = 0;
+ mx = ShieldOrbLocations[0][0];
+ my = ShieldOrbLocations[0][1];
+ if(rand()%2 == 0)Clockwise = true;
+ else Clockwise = false;
+ }
+
+ void Reset(){
+ }
+
+ void Aggro(Unit* who){}
+
+ void UpdateAI(const uint32 diff){
+ if(PointReached){
+ if(Clockwise){
+ y = my - r * sin(c);
+ x = mx - r * cos(c);
+ }else{
+ y = my + r * sin(c);
+ x = mx + r * cos(c);
+ }
+ PointReached = false;
+ CheckTimer = 1000;
+ m_creature->GetMotionMaster()->MovePoint(1,x, y, SHIELD_ORB_Z);
+ c += 3.1415926535/32;
+ if(c > 2*3.1415926535) c = 0;
+ }else{
+ if (CheckTimer < diff){
+ DoTeleportTo(x,y,SHIELD_ORB_Z);
+ PointReached = true;
+ }else CheckTimer -= diff;
+
+ }
+
+ if (Timer < diff){
+ Unit* random = (Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)));
+ if (random)DoCast(random, SPELL_SHADOW_BOLT, false);
+ Timer = 500+ rand()%500;
+ }else Timer -= diff;
+ }
+
+ void MovementInform(uint32 type, uint32 id){
+ if(type != POINT_MOTION_TYPE)
+ return;
+
+ PointReached = true;
+ }
+};
+
+CreatureAI* GetAI_mob_shield_orb(Creature *_Creature)
+{
+ return new mob_shield_orbAI (_Creature);
+}
+
+//AI for Sinister Reflection
+struct TRINITY_DLL_DECL mob_sinster_reflectionAI : public ScriptedAI
+{
+ mob_sinster_reflectionAI(Creature* c) : ScriptedAI(c) {}
+
+ uint8 Class;
+ uint32 Timer[3];
+
+ void Reset(){
+ Timer[0] = 0;
+ Timer[1] = 0;
+ Timer[2] = 0;
+ Class = 0;
+ }
+
+ void Aggro(Unit* who){}
+
+ void UpdateAI(const uint32 diff){
+
+ if(Class == 0){
+ Class = m_creature->getVictim()->getClass();
+ switch(Class){
+ case CLASS_DRUID:
+ break;
+ case CLASS_HUNTER:
+ break;
+ case CLASS_MAGE:
+ break;
+ case CLASS_WARLOCK:
+ break;
+ case CLASS_WARRIOR:
+ m_creature->SetCanDualWield(true);
+ break;
+ case CLASS_PALADIN:
+ break;
+ case CLASS_PRIEST:
+ break;
+ case CLASS_SHAMAN:
+ m_creature->SetCanDualWield(true);
+ break;
+ case CLASS_ROGUE:
+ m_creature->SetCanDualWield(true);
+ break;
+ }
+ }
+
+ switch(Class){
+ case CLASS_DRUID:
+ if(Timer[1] < diff){
+ DoCast(m_creature->getVictim(), SPELL_SR_MOONFIRE, false);
+ Timer[1] = 3000;
+ }
+ DoMeleeAttackIfReady();
+ break;
+ case CLASS_HUNTER:
+ if(Timer[1] < diff){
+ DoCast(m_creature->getVictim(), SPELL_SR_MULTI_SHOT, false);
+ Timer[1] = 9000;
+ }
+ if(Timer[2] < diff){
+ DoCast(m_creature->getVictim(), SPELL_SR_SHOOT, false);
+ Timer[2] = 5000;
+ }
+ if(m_creature->IsWithinMeleeRange(m_creature->getVictim(), 6)){
+ if(Timer[3] < diff){
+ DoCast(m_creature->getVictim(), SPELL_SR_MULTI_SHOT, false);
+ Timer[3] = 7000;
+ }
+ DoMeleeAttackIfReady();
+ }
+ break;
+ case CLASS_MAGE:
+ if(Timer[1] < diff){
+ DoCast(m_creature->getVictim(), SPELL_SR_FIREBALL, false);
+ Timer[1] = 3000;
+ }
+ DoMeleeAttackIfReady();
+ break;
+ case CLASS_WARLOCK:
+ if(Timer[1] < diff){
+ DoCast(m_creature->getVictim(), SPELL_SR_SHADOW_BOLT, false);
+ Timer[1] = 4000;
+ }
+ if(Timer[2] < diff){
+ DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_SR_CURSE_OF_AGONY, true);
+ Timer[2] = 3000;
+ }
+ DoMeleeAttackIfReady();
+ break;
+ case CLASS_WARRIOR:
+ if(Timer[1] < diff){
+ DoCast(m_creature->getVictim(), SPELL_SR_WHIRLWIND, false);
+ Timer[1] = 10000;
+ }
+ DoMeleeAttackIfReady();
+ break;
+ case CLASS_PALADIN:
+ if(Timer[1] < diff){
+ DoCast(m_creature->getVictim(), SPELL_SR_HAMMER_OF_JUSTICE, false);
+ Timer[1] = 7000;
+ }
+ if(Timer[2] < diff){
+ DoCast(m_creature->getVictim(), SPELL_SR_HOLY_SHOCK, false);
+ Timer[2] = 3000;
+ }
+ DoMeleeAttackIfReady();
+ break;
+ case CLASS_PRIEST:
+ if(Timer[1] < diff){
+ DoCast(m_creature->getVictim(), SPELL_SR_HOLY_SMITE, false);
+ Timer[1] = 5000;
+ }
+ if(Timer[2] < diff){
+ DoCast(m_creature, SPELL_SR_RENEW, false);
+ Timer[2] = 7000;
+ }
+ DoMeleeAttackIfReady();
+ break;
+ case CLASS_SHAMAN:
+ if(Timer[1] < diff){
+ DoCast(m_creature->getVictim(), SPELL_SR_EARTH_SHOCK, false);
+ Timer[1] = 5000;
+ }
+ DoMeleeAttackIfReady();
+ break;
+ case CLASS_ROGUE:
+ if(Timer[1] < diff){
+ DoCast(m_creature->getVictim(), SPELL_SR_HEMORRHAGE, true);
+ Timer[1] = 5000;
+ }
+ DoMeleeAttackIfReady();
+ break;
+ }
+ debug_log("Sinister-Timer");
+ for(uint8 i = 0; i < 3; ++i)
+ Timer[i] -= diff;
+ }
+
+};
+
+CreatureAI* GetAI_mob_sinster_reflection(Creature *_Creature)
+{
+ return new mob_sinster_reflectionAI (_Creature);
+}
void AddSC_boss_kiljaeden()
-{};
+{
+ Script* newscript;
+
+ newscript = new Script;
+ newscript->pGOHello = &GOHello_go_orb_of_the_blue_flight;
+ newscript->Name = "go_orb_of_the_blue_flight";
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->GetAI = &GetAI_boss_kalecgosKJ;
+ newscript->Name = "boss_kalecgosKJ";
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->GetAI = &GetAI_boss_kiljaeden;
+ newscript->Name = "boss_kiljaeden";
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->GetAI = &GetAI_mob_kiljaeden_controller;
+ newscript->Name = "mob_kiljaeden_controller";
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->GetAI = &GetAI_mob_hand_of_the_deceiver;
+ newscript->Name = "mob_hand_of_the_deceiver";
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->GetAI = &GetAI_mob_felfire_portal;
+ newscript->Name = "mob_felfire_portal";
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->GetAI = &GetAI_mob_volatile_felfire_fiend;
+ newscript->Name = "mob_volatile_felfire_fiend";
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->GetAI = &GetAI_mob_armageddon;
+ newscript->Name = "mob_armageddon";
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->GetAI = &GetAI_mob_shield_orb;
+ newscript->Name = "mob_shield_orb";
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->GetAI = &GetAI_mob_sinster_reflection;
+ newscript->Name = "mob_sinster_reflection";
+ newscript->RegisterSelf();
+};
diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp
index fd9a8886962..6000ee474e0 100644
--- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp
+++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp
@@ -1,27 +1,617 @@
/* 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
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation; either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
/* ScriptData
SDName: Boss_Muru
-SD%Complete: 0
-SDComment: Placeholer
-SDCategory: Sunwell_Plateau
-EndScriptData */
+SD%Complete: 80
+SDComment: all sounds, black hole effect triggers to often (46228)
+*/
#include "precompiled.h"
+#include "def_sunwell_plateau.h"
+
+// Muru & Entropius's spells
+enum Spells
+{
+ SPELL_ENRAGE = 26662,
+
+ // Muru's spells
+ SPELL_NEGATIVE_ENERGY = 46009, //(this trigger 46008)
+ SPELL_DARKNESS = 45999,
+ SPELL_OPEN_ALL_PORTALS = 46177,
+ SPELL_OPEN_PORTAL = 45977,
+ SPELL_OPEN_PORTAL_2 = 45976,
+ SPELL_SUMMON_BERSERKER = 46037,
+ SPELL_SUMNON_FURY_MAGE = 46038,
+ SPELL_SUMMON_VOID_SENTINEL = 45988,
+ SPELL_SUMMON_ENTROPIUS = 46217,
+
+ // Entropius's spells
+ SPELL_DARKNESS_E = 46269,
+ SPELL_BLACKHOLE = 46282,
+ SPELL_NEGATIVE_ENERGY_E = 46284,
+ SPELL_ENTROPIUS_SPAWN = 46223,
+
+ // Shadowsword Berserker's spells
+ SPELL_FLURRY = 46160,
+ SPELL_DUAL_WIELD = 29651,
+
+ // Shadowsword Fury Mage's spells
+ SPELL_FEL_FIREBALL = 46101,
+ SPELL_SPELL_FURY = 46102,
+
+ // Void Sentinel's spells
+ SPELL_SHADOW_PULSE = 46087,
+ SPELL_VOID_BLAST = 46161,
+
+ // Void Spawn's spells
+ SPELL_SHADOW_BOLT_VOLLEY = 46082,
+
+ //Dark Fiend Spells
+ SPELL_DARKFIEND_AOE = 45944,
+ SPELL_DARKFIEND_VISUAL = 45936,
+ SPELL_DARKFIEND_SKIN = 45934,
+
+ //Black Hole Spells
+ SPELL_BLACKHOLE_SPAWN = 46242,
+ SPELL_BLACKHOLE_GROW = 46228
+};
+
+enum Creatures
+{
+ CREATURE_DARKNESS = 25879,
+ CREATURE_DARK_FIENDS = 25744,
+ CREATURE_BERSERKER = 25798,
+ CREATURE_FURY_MAGE = 25799,
+ CREATURE_VOID_SENTINEL = 25772,
+ CREATURE_VOID_SPAWN = 25824,
+ CREATURE_BLACK_HOLE = 25855,
+ BOSS_MURU = 25741,
+ BOSS_ENTROPIUS = 25840
+};
+
+enum BossTimers{
+ TIMER_DARKNESS = 0,
+ TIMER_HUMANOIDES = 1,
+ TIMER_PHASE = 2,
+ TIMER_SENTINEL = 3
+};
+
+float DarkFiends[8][4] =
+{
+ {1819.9, 609.80, 69.74, 1.94},
+ {1829.39, 617.89, 69.73, 2.61},
+ {1801.98, 633.62, 69.74, 5.71},
+ {1830.88, 629.99, 69.73, 3.52},
+ {1800.38, 621.41, 69.74, 0.22},
+ {1808.3 , 612.45, 69.73, 1.02},
+ {1823.9 , 639.69, 69.74, 4.12},
+ {1811.85, 640.46, 69.73, 4.97}
+};
+
+float Humanoides[6][5] =
+{
+ {CREATURE_FURY_MAGE, 1780.16, 666.83, 71.19, 5.21},
+ {CREATURE_FURY_MAGE, 1847.93, 600.30, 71.30, 2.57},
+ {CREATURE_BERSERKER, 1779.97, 660.64, 71.19, 5.28},
+ {CREATURE_BERSERKER, 1786.2 , 661.01, 71.19, 4.51},
+ {CREATURE_BERSERKER, 1845.17, 602.63, 71.28, 2.43},
+ {CREATURE_BERSERKER, 1842.91, 599.93, 71.23, 2.44}
+};
+
+uint32 EnrageTimer = 600000;
+struct TRINITY_DLL_DECL boss_entropiusAI : public ScriptedAI
+{
+ boss_entropiusAI(Creature *c) : ScriptedAI(c), Summons(m_creature){
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ Combat = false;
+ }
+
+ ScriptedInstance* pInstance;
+ SummonList Summons;
+
+ bool Combat;
+ uint32 BlackHoleSummonTimer;
+
+ void Reset() {
+ if (!Combat){
+ BlackHoleSummonTimer = 15000;
+ DoCastAOE(SPELL_NEGATIVE_ENERGY_E, false);
+ }else{
+ if(pInstance)
+ pInstance->SetData(DATA_MURU_EVENT, NOT_STARTED);
+ Summons.DespawnAll();
+ }
+ }
+
+ void Aggro(Unit *who) {
+ DoCastAOE(SPELL_NEGATIVE_ENERGY_E, true);
+ DoCast(m_creature, SPELL_ENTROPIUS_SPAWN, false);
+ }
+
+ void JustSummoned(Creature* summoned)
+ {
+ switch(summoned->GetEntry()){
+ case CREATURE_DARK_FIENDS:
+ summoned->CastSpell(summoned,SPELL_DARKFIEND_VISUAL,false);
+ break;
+ case CREATURE_DARKNESS:
+ summoned->addUnitState(UNIT_STAT_STUNNED);
+ float x,y,z,o;
+ summoned->GetHomePosition(x,y,z,o);
+ m_creature->SummonCreature(CREATURE_DARK_FIENDS, x,y,z,o, TEMPSUMMON_CORPSE_DESPAWN, 0);
+ break;
+ }
+ summoned->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM,0, 50, true));
+ Summons.Summon(summoned);
+ }
+
+ void KilledUnit(Unit* victim){
+
+ }
+
+ void JustDied(Unit* killer){
+ if(pInstance)pInstance->SetData(DATA_MURU_EVENT, DONE);
+ Summons.DespawnAll();
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!UpdateVictim())
+ return;
+
+ if(!Combat)Combat = true;
+
+ if(EnrageTimer < diff && !m_creature->HasAura(SPELL_ENRAGE, 0)){
+ DoCast(m_creature,SPELL_ENRAGE, false);
+ }else EnrageTimer -= diff;
+
+ if(BlackHoleSummonTimer < diff){
+ Unit* random = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true);
+ if(!random)return;
+ DoCast(random, SPELL_DARKNESS_E, false);
+ random = SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true);
+ if(!random)return;
+ random->CastSpell(random, SPELL_BLACKHOLE, false);
+ BlackHoleSummonTimer = 15000;
+ }else BlackHoleSummonTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+};
+
+CreatureAI* GetAI_boss_entropius(Creature *_Creature)
+{
+ return new boss_entropiusAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL boss_muruAI : public Scripted_NoMovementAI
+{
+ boss_muruAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature){
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+
+ ScriptedInstance* pInstance;
+ SummonList Summons;
+
+ uint8 Phase;
+ uint32 Timer[4];
+
+ bool DarkFiend;
+
+ void Reset()
+ {
+ DarkFiend = false;
+ Phase = 1;
+
+ EnrageTimer = 600000;
+ Timer[TIMER_DARKNESS] = 45000;
+ Timer[TIMER_HUMANOIDES] = 10000;
+ Timer[TIMER_PHASE] = 2000;
+ Timer[TIMER_SENTINEL] = 31500;
+ Summons.DespawnAll();
+ m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ m_creature->SetVisibility(VISIBILITY_ON);
+ if(pInstance)
+ pInstance->SetData(DATA_MURU_EVENT, NOT_STARTED);
+ }
+
+ void Aggro(Unit *who)
+ {
+ if(pInstance)
+ pInstance->SetData(DATA_MURU_EVENT, IN_PROGRESS);
+ DoCastAOE(SPELL_NEGATIVE_ENERGY,false);
+ }
+
+ void KilledUnit(Unit* victim){}
+
+ void DamageTaken(Unit *done_by, uint32 &damage) {
+ if(damage > m_creature->GetHealth() && Phase == 1){
+ damage = 0;
+ Phase = 2;
+ m_creature->RemoveAllAuras();
+ DoCast(m_creature, SPELL_OPEN_ALL_PORTALS, false);
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ }
+ if(Phase > 1 && Phase < 4)damage = 0;
+ }
+
+ void JustSummoned(Creature* summoned)
+ {
+ switch(summoned->GetEntry()){
+ case BOSS_ENTROPIUS:
+ m_creature->SetVisibility(VISIBILITY_OFF);
+ break;
+ case CREATURE_DARK_FIENDS:
+ summoned->CastSpell(summoned,SPELL_DARKFIEND_VISUAL,false);
+ break;
+ }
+ summoned->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM,0, 50, true));
+ Summons.Summon(summoned);
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!UpdateVictim())
+ return;
+
+ if(Phase == 3){
+ if(Timer[TIMER_PHASE] <diff){
+ switch(pInstance->GetData(DATA_MURU_EVENT)){
+ case NOT_STARTED:
+ Reset();
+ break;
+ case DONE:
+ Phase = 4;
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveCorpse();
+ break;
+ }
+ Timer[TIMER_PHASE] = 3000;
+ }else Timer[TIMER_PHASE] -= diff;
+ return;
+ }
+
+ if (EnrageTimer < diff && !m_creature->HasAura(SPELL_ENRAGE, 0))
+ DoCast(m_creature, SPELL_ENRAGE, false);
+ else EnrageTimer -= diff;
+
+ for (uint8 i = 0; i < 4; ++i){
+ if(Timer[i] < diff){
+ switch(i){
+ case TIMER_DARKNESS:
+ if(!DarkFiend){
+ DoCastAOE(SPELL_DARKNESS, false);
+ Timer[TIMER_DARKNESS] = 3000;
+ DarkFiend = true;
+ }else{
+ DarkFiend = false;
+ for(uint8 i = 0; i < 8; ++i)
+ m_creature->SummonCreature(CREATURE_DARK_FIENDS,DarkFiends[i][0],DarkFiends[i][1],DarkFiends[i][2], DarkFiends[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0);
+ Timer[TIMER_DARKNESS] = 42000;
+ }
+ break;
+
+ case TIMER_HUMANOIDES:
+ for(uint8 i = 0; i < 6; ++i)
+ m_creature->SummonCreature(Humanoides[i][0],Humanoides[i][1],Humanoides[i][2],Humanoides[i][3], Humanoides[i][4], TEMPSUMMON_CORPSE_DESPAWN, 0);
+ Timer[TIMER_HUMANOIDES] = 60000;
+ break;
+
+ case TIMER_PHASE:
+ m_creature->RemoveAllAuras();
+ DoCast(m_creature, SPELL_SUMMON_ENTROPIUS, false);
+ Timer[TIMER_PHASE] = 3000;
+ Phase = 3;
+ return;
+
+ case TIMER_SENTINEL:
+ DoCastAOE(SPELL_OPEN_PORTAL_2, false);
+ Timer[TIMER_SENTINEL] = 30000;
+ break;
+ }break;}
+ }
+
+ //Timer
+ for(uint8 i = 0; i < 4; ++i){
+ if(i != TIMER_PHASE)Timer[i] -= diff;
+ else if(Phase == 2) Timer[i] -= diff;
+ }
+ }
+
+};
+
+CreatureAI* GetAI_boss_muru(Creature *_Creature)
+{
+ return new boss_muruAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL npc_muru_portalAI : public Scripted_NoMovementAI
+{
+ npc_muru_portalAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature){
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+
+ ScriptedInstance* pInstance;
+ SummonList Summons;
+ Creature* Muru;
+ bool SummonSentinel;
+ bool InAction;
+ uint32 SummonTimer;
+
+ void Reset(){
+ m_creature->addUnitState(UNIT_STAT_STUNNED);
+ SummonTimer = 5000;
+ InAction = false;
+ SummonSentinel = false;
+ Summons.DespawnAll();
+ }
+
+ void Aggro(Unit *who) {}
+
+ void JustSummoned(Creature* summoned){
+ Player* Target;
+ Target = (Player*)(Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)));
+ if(Target)summoned->AI()->AttackStart(Target);
+ Summons.Summon(summoned);
+ }
+
+ void SpellHit(Unit* caster, const SpellEntry* Spell){
+ float x,y,z,o;
+ m_creature->GetHomePosition(x,y,z,o);
+ DoTeleportTo(x,y,z);
+ InAction = true;
+ switch(Spell->Id){
+ case SPELL_OPEN_ALL_PORTALS:
+ DoCastAOE(SPELL_OPEN_PORTAL, false);
+ break;
+ case SPELL_OPEN_PORTAL_2:
+ DoCastAOE(SPELL_OPEN_PORTAL, false);
+ SummonSentinel = true;
+ break;
+ }
+ }
+
+ void UpdateAI(const uint32 diff){
+ if(!SummonSentinel){
+ if(InAction && pInstance->GetData(DATA_MURU_EVENT) == NOT_STARTED)Reset();
+ return;
+ }
+ if(SummonTimer < diff){
+ DoCastAOE(SPELL_SUMMON_VOID_SENTINEL, false);
+ SummonTimer = 5000;
+ SummonSentinel = false;
+ }else SummonTimer -= diff;
+ }
+
+
+};
+
+CreatureAI* GetAI_npc_muru_portal(Creature *_Creature)
+{
+ return new npc_muru_portalAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL npc_dark_fiendAI : public ScriptedAI
+{
+ npc_dark_fiendAI(Creature *c) : ScriptedAI(c){
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+
+ ScriptedInstance* pInstance;
+ bool InAction;
+ uint32 WaitTimer;
+
+ void Reset() {
+ WaitTimer = 2000;
+ InAction = false;
+ m_creature->addUnitState(UNIT_STAT_STUNNED);
+ };
+
+ void Aggro(Unit *who) {}
+
+ void SpellHit(Unit* caster, const SpellEntry* Spell){
+ for(uint8 i = 0; i < 3; ++i)
+ if(Spell->Effect[i] == 38){
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveCorpse();
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(!UpdateVictim())
+ return;
+
+ if (WaitTimer < diff)
+ if(!InAction){
+ m_creature->clearUnitState(UNIT_STAT_STUNNED);
+ DoCastAOE(SPELL_DARKFIEND_SKIN, false);
+ AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0, 100, true));
+ InAction = true;
+ WaitTimer = 500;
+ }else{
+ if(m_creature->GetDistance(m_creature->getVictim()) < 5){
+ DoCastAOE(SPELL_DARKFIEND_AOE, false);
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveCorpse();
+ }
+ WaitTimer = 500;
+ }
+ else WaitTimer -= diff;
+ }
+
+};
+
+CreatureAI* GetAI_npc_dark_fiend(Creature *_Creature)
+{
+ return new npc_dark_fiendAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL npc_void_sentinelAI : public ScriptedAI
+{
+ npc_void_sentinelAI(Creature *c) : ScriptedAI(c){
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 PulseTimer;
+ uint32 VoidBlastTimer;
+
+
+ void Reset() {
+ PulseTimer = 3000;
+ VoidBlastTimer = 45000; //is this a correct timer?
+ float x,y,z,o;
+ m_creature->GetHomePosition(x,y,z,o);
+ DoTeleportTo(x,y,71);
+ };
+
+ void Aggro(Unit *who) {}
+
+ void JustDied(Unit* killer){
+ for (uint8 i = 0; i < 8; ++i){
+ m_creature->SummonCreature(CREATURE_VOID_SPAWN, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(), rand()%6, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000);
+ }
+
+ }
+ void UpdateAI(const uint32 diff)
+ {
+ if(!UpdateVictim())
+ return;
+
+ if(PulseTimer < diff){
+ DoCastAOE(SPELL_SHADOW_PULSE, true);
+ PulseTimer = 3000;
+ }else PulseTimer -= diff;
+
+ if(VoidBlastTimer < diff){
+ DoCast(m_creature->getVictim(), SPELL_VOID_BLAST, false);
+ VoidBlastTimer = 45000;
+ }else VoidBlastTimer -= diff;
+
+ DoMeleeAttackIfReady();
+ }
+
+};
+
+CreatureAI* GetAI_npc_void_sentinel(Creature *_Creature)
+{
+ return new npc_void_sentinelAI (_Creature);
+}
+
+struct TRINITY_DLL_DECL npc_blackholeAI : public ScriptedAI
+{
+ npc_blackholeAI(Creature *c) : ScriptedAI(c){
+ pInstance = ((ScriptedInstance*)c->GetInstanceData());
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 DespawnTimer;
+ uint32 SpellTimer;
+ uint8 Phase;
+ uint8 NeedForAHack;
+
+ void Reset(){
+ DespawnTimer = 15000;
+ SpellTimer = 5000;
+ Phase = 0;
+ m_creature->addUnitState(UNIT_STAT_STUNNED);
+ DoCastAOE(SPELL_BLACKHOLE_SPAWN, true);
+ }
+
+ void Aggro(Unit *who) {}
+
+ void UpdateAI(const uint32 diff)
+ {
+ if(SpellTimer < diff){
+ Unit* Victim = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID));
+ switch(NeedForAHack){
+ case 0:
+ m_creature->clearUnitState(UNIT_STAT_STUNNED);
+ DoCastAOE(SPELL_BLACKHOLE_GROW, false);
+ if(Victim)AttackStart(Victim);
+ SpellTimer = 700;
+ NeedForAHack = 2;
+ break;
+ case 1:
+ m_creature->AddAura(SPELL_BLACKHOLE_GROW, m_creature);
+ NeedForAHack = 2;
+ SpellTimer = 600;
+ break;
+ case 2:
+ SpellTimer = 400;
+ NeedForAHack = 3;
+ m_creature->RemoveAura(SPELL_BLACKHOLE_GROW, 1);
+ break;
+ case 3:
+ SpellTimer = 400+rand()%500;
+ NeedForAHack = 1;
+ Unit* Temp = m_creature->getVictim();
+ if(!Temp) return;
+ if(Temp->GetPositionZ() > 73 && Victim)
+ AttackStart(Victim);
+ }
+ }else SpellTimer -= diff;
+
+ if (DespawnTimer < diff){
+ m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ m_creature->RemoveCorpse();
+ }else DespawnTimer -= diff;
+ }
+};
+
+CreatureAI* GetAI_npc_blackhole(Creature *_Creature)
+{
+ return new npc_blackholeAI (_Creature);
+}
void AddSC_boss_muru()
-{};
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name="boss_muru";
+ newscript->GetAI = &GetAI_boss_muru;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="boss_entropius";
+ newscript->GetAI = &GetAI_boss_entropius;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="npc_muru_portal";
+ newscript->GetAI = &GetAI_npc_muru_portal;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="npc_dark_fiend";
+ newscript->GetAI = &GetAI_npc_dark_fiend;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="npc_void_sentinel";
+ newscript->GetAI = &GetAI_npc_void_sentinel;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name="npc_blackhole";
+ newscript->GetAI = &GetAI_npc_blackhole;
+ newscript->RegisterSelf();
+} \ No newline at end of file
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 8ae61602616..9fbb5de7300 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 cd4f62584f0..ee4ceb61780 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 c2608f2bd1e..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,13 +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
+{
+}
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index e17afc32fd9..a3751ea2345 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -17251,6 +17251,9 @@ void Player::ProhibitSpellScholl(SpellSchoolMask idSchoolMask, uint32 unTimeMs )
if (spellInfo->Attributes & SPELL_ATTR_DISABLED_WHILE_ACTIVE)
continue;
+ if(spellInfo->PreventionType != SPELL_PREVENTION_TYPE_SILENCE)
+ continue;
+
if((idSchoolMask & GetSpellSchoolMask(spellInfo)) && GetSpellCooldownDelay(unSpellId) < unTimeMs )
{
data << unSpellId;
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 7b5bfca3a05..28cbd541b00 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1410,9 +1410,10 @@ void Spell::SearchChainTarget(std::list<Unit*> &TagUnitMap, float max_range, uin
if(cur->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS)
break;
- while(!cur->IsWithinLOSInMap(*next)
- || m_spellInfo->DmgClass==SPELL_DAMAGE_CLASS_MELEE
- && !m_caster->isInFront(*next, max_range))
+ while(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE
+ && !m_caster->isInFront(*next, max_range)
+ || !m_caster->canSeeOrDetect(*next, false)
+ || !cur->IsWithinLOSInMap(*next))
{
++next;
if(next == tempUnitMap.end() || cur->GetDistance(*next) > CHAIN_SPELL_JUMP_RADIUS)
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index b96eb399fc2..9fd70cb676e 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -4788,7 +4788,18 @@ void Spell::EffectScriptEffect(uint32 effIndex)
unitTarget->CastSpell(unitTarget, 44870, true);
break;
- }
+ }
+ // spell of Brutallus - Stomp
+ case 45185:
+ {
+ if(!unitTarget)
+ return;
+
+ if(unitTarget->HasAura(46394)) // spell of Brutallus - Burn
+ unitTarget->RemoveAurasDueToSpell(46394);
+
+ break;
+ }
// Negative Energy
case 46289:
{
diff --git a/src/game/TicketMgr.cpp b/src/game/TicketMgr.cpp
index 69022b7dd27..52cf1ff0db6 100644
--- a/src/game/TicketMgr.cpp
+++ b/src/game/TicketMgr.cpp
@@ -60,12 +60,10 @@ GM_Ticket* TicketMgr::GetGMTicketByName(const char* name)
if(!normalizePlayerName(pname))
return NULL;
- Player *plr = objmgr.GetPlayer(pname.c_str());
- if(!plr)
+ uint64 playerGuid = objmgr.GetPlayerGUIDByName(pname.c_str());
+ if(!playerGuid)
return NULL;
- uint64 playerGuid = plr->GetGUID();
-
for(GmTicketList::iterator i = GM_TicketList.begin(); i != GM_TicketList.end();)
{
if((*i)->playerGuid == playerGuid && (*i)->closed == 0)