mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Scripts/HoO: Rajh
This commit is contained in:
76
sql/updates/world/4.3.4/2017_11_23_00_world.sql
Normal file
76
sql/updates/world/4.3.4/2017_11_23_00_world.sql
Normal file
@@ -0,0 +1,76 @@
|
||||
-- Rajh
|
||||
UPDATE `creature_template` SET `difficulty_entry_1`= 48815, `mechanic_immune_mask`= 80297983, `scriptname`= 'boss_rajh' WHERE `entry`= 39378;
|
||||
UPDATE `creature_template` SET `minlevel`= 87, `maxlevel`= 87, `faction`= 16, `speed_walk`= 2, `type_flags`= 104, `exp`= 3, `faction`= 14,
|
||||
`unit_flags`= 32832, `unit_flags2`= 0, `vehicleId`= 790, `movementId`= 151, `mechanic_immune_mask`= 80297983, `flags_extra`= 1, `unit_class`= 4 WHERE `entry`= 48815;
|
||||
|
||||
-- Solar Winds Dummy
|
||||
UPDATE `creature_template` SET `minlevel`= 85, `maxlevel`= 85, `faction`= 35, `unit_flags`= 33554496, `flags_extra`= 128 WHERE `entry`= 39634;
|
||||
|
||||
-- Solar Winds
|
||||
UPDATE `creature_template` SET `scale`= 0.1, `minlevel`= 85, `maxlevel`= 85, `faction`= 16, `unit_flags`= 33554496, `flags_extra`= 128, `InhabitType`= 1, `scriptname`= 'npc_solar_winds' WHERE `entry`= 39635;
|
||||
|
||||
-- Solar Winds (Fire)
|
||||
UPDATE `creature_template` SET `minlevel`= 85, `maxlevel`= 85, `faction`= 16, `unit_flags`= 33554496, `flags_extra`= 128 WHERE `entry`= 47922;
|
||||
|
||||
-- Inferno Leap
|
||||
UPDATE `creature_template` SET `minlevel`= 85, `maxlevel`= 85, `faction`= 14, `unit_flags`= 33587200, `unit_flags2`= 34816, `flags_extra`= 128, `VehicleId`= 1233 WHERE `entry`= 47040;
|
||||
|
||||
-- Orb of the Sun
|
||||
UPDATE `creature_template` SET `minlevel`= 85, `maxlevel`= 85, `faction`= 14, `unit_flags`= 33587200, `unit_flags2`= 34816, `flags_extra`= 128, `vehicleId`= 787, `scale`= 0.1, `InhabitType`= 4, `scriptname`= 'npc_orb_of_the_sun' WHERE `entry`= 40835;
|
||||
|
||||
-- Blazing Inferno
|
||||
UPDATE `creature_template` SET `minlevel`= 85, `maxlevel`= 85, `faction`= 16, `unit_flags`= 33587200, `unit_flags2`= 34816, `flags_extra`= 128, `vehicleId`= 790 WHERE `entry`= 40927;
|
||||
|
||||
DELETE FROM `creature_text` WHERE `CreatureID`= 39378;
|
||||
INSERT INTO `creature_text` (`CreatureID`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `comment`) VALUES
|
||||
(39378, 0, 0, 'Defilers! Wretches! Fiends! Begone from here!', 14, 0, 100, 0, 0, 18911, 44757, 'Rajh'),
|
||||
(39378, 1, 0, 'Can you feel it? The blessed warmth of the sun?', 14, 0, 100, 0, 0, 18912, 44761, 'Rajh'),
|
||||
(39378, 2, 0, 'I send you to your deity.', 14, 0, 100, 0, 0, 18914, 44758, 'Rajh to Player'),
|
||||
(39378, 2, 1, 'I will take this life as an offering!', 14, 0, 100, 0, 0, 18913, 44759, 'Rajh to Player'),
|
||||
(39378, 3, 0, 'Blazing rays of light, take me!', 14, 0, 100, 0, 0, 18910, 44760, 'Rajh to Player');
|
||||
|
||||
DELETE FROM `creature_template_addon` WHERE `entry` IN (39635, 47922, 47040, 40835);
|
||||
INSERT INTO `creature_template_addon` (`entry`, `Auras`) VALUES
|
||||
(39635, '74109'),
|
||||
(47922, '89131'),
|
||||
(47040, '87645'),
|
||||
(40835, '73658');
|
||||
|
||||
DELETE FROM `conditions` WHERE `SourceEntry`= 87653;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ScriptName`, `Comment`) VALUES
|
||||
(13, 1, 87653, 0, 0, 31, 0, 3, 47040, 0, 0, 0, '', 'Inferno Leap - Target Inferno Leap');
|
||||
|
||||
-- Creature Inferno Leap 47040 SAI
|
||||
SET @ENTRY := 47040;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(@ENTRY, 0, 0, 0, 8, 0, 100, 1, 87653, 0, 0, 0, 67, 0, 500, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "On spell 87653 hit - Trigger timed event #0 in 500 - 500 ms // "),
|
||||
(@ENTRY, 0, 1, 0, 59, 0, 100, 0, 0, 0, 0, 0, 11, 87647, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On timed event 0 triggered - Self: Cast spell 87647 on Self // ");
|
||||
|
||||
-- Creature Blazing Inferno 40927 SAI
|
||||
SET @ENTRY := 40927;
|
||||
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY;
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(@ENTRY, 0, 0, 0, 8, 0, 100, 1, 43671, 0, 0, 0, 67, 0, 500, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "On spell 43671 hit - Trigger timed event #0 in 500 - 500 ms // "),
|
||||
(@ENTRY, 0, 1, 0, 59, 0, 100, 1, 0, 0, 0, 0, 11, 89877, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "On timed event 0 triggered - Self: Cast spell 89877 on Action invoker // ");
|
||||
|
||||
DELETE FROM `achievement_criteria_data` WHERE `criteria_id`= 15990;
|
||||
INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES
|
||||
(15990, 11, 0, 0, 'achievement_sun_of_a');
|
||||
|
||||
DELETE FROM `spell_dbc` WHERE `Id`= 76374;
|
||||
INSERT INTO `spell_dbc` (`Id`, `CastingTimeIndex`, `DurationIndex`, `Comment`) VALUES
|
||||
(76374, 0, 575, 'Summon Meteor');
|
||||
DELETE FROM `spelleffect_dbc` WHERE `Id`= 155916;
|
||||
INSERT INTO `spelleffect_dbc` (`Id`, `Effect`, `EffectMiscValue`, `EffectMiscValueB`, `EffectRadiusIndex`, `EffectRadiusIndexMax`, `EffectImplicitTargetA`, `EffectImplicitTargetB`, `EffectSpellId`, `EffectIndex`) VALUES
|
||||
(155916, 28, 40927, 64, 12, 12, 18, 18, 76374, 0);
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN
|
||||
('spell_rajh_summon_meteor',
|
||||
'spell_rajh_summon_sun_orb');
|
||||
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(76375, 'spell_rajh_summon_meteor'),
|
||||
(76338, 'spell_rajh_summon_sun_orb');
|
||||
@@ -80,6 +80,47 @@ void Vehicle::Install()
|
||||
_me->setPowerType(POWER_ENERGY);
|
||||
}
|
||||
|
||||
if (Creature* creature = _me->ToCreature())
|
||||
{
|
||||
switch (_vehicleInfo->m_powerDisplayId)
|
||||
{
|
||||
case POWER_STEAM:
|
||||
case POWER_HEAT:
|
||||
case POWER_BLOOD:
|
||||
case POWER_OOZE:
|
||||
case POWER_WRATH:
|
||||
case POWER_ARCANE_ENERGY:
|
||||
case POWER_LIFE_ENERGY:
|
||||
case POWER_SUN_ENERGY:
|
||||
case POWER_SWING_VELOCITY:
|
||||
case POWER_SHADOWFLAME_ENERGY:
|
||||
case POWER_BLUE_POWER:
|
||||
case POWER_PURPLE_POWER:
|
||||
case POWER_GREEN_POWER:
|
||||
case POWER_ORANGE_POWER:
|
||||
case POWER_ELECTRICAL_ENERGY:
|
||||
case POWER_ARCANE_ENERGY_2:
|
||||
case POWER_FUEL:
|
||||
case POWER_SUN_POWER:
|
||||
case POWER_TWILIGHT_ENERGY:
|
||||
_me->SetMaxPower(POWER_ENERGY, 100);
|
||||
_me->SetPower(POWER_ENERGY, 100);
|
||||
break;
|
||||
case POWER_PYRITE:
|
||||
_me->SetMaxPower(POWER_ENERGY, 50);
|
||||
_me->SetPower(POWER_ENERGY, 50);
|
||||
break;
|
||||
case POWER_WIND_POWER_1:
|
||||
case POWER_WIND_POWER_2:
|
||||
case POWER_WIND_POWER_3:
|
||||
_me->SetMaxPower(POWER_MANA, 90);
|
||||
_me->SetPower(POWER_MANA, 90);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
_status = STATUS_INSTALLED;
|
||||
if (GetBase()->GetTypeId() == TYPEID_UNIT)
|
||||
sScriptMgr->OnInstall(this);
|
||||
|
||||
@@ -42,8 +42,8 @@ enum PowerType
|
||||
POWER_PURPLE_POWER = 149,
|
||||
POWER_GREEN_POWER = 150,
|
||||
POWER_ORANGE_POWER = 151,
|
||||
POWER_ENERGY_2 = 153,
|
||||
POWER_ARCANEENERGY = 161,
|
||||
POWER_ELECTRICAL_ENERGY = 153,
|
||||
POWER_ARCANE_ENERGY_2 = 161,
|
||||
POWER_WIND_POWER_1 = 162,
|
||||
POWER_WIND_POWER_2 = 163,
|
||||
POWER_WIND_POWER_3 = 164,
|
||||
|
||||
@@ -3626,6 +3626,15 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
// Aura is refreshed at 3 seconds, and the tick should happen at the fourth.
|
||||
spellInfo->AttributesEx8 |= SPELL_ATTR8_DONT_RESET_PERIODIC_TIMER;
|
||||
break;
|
||||
// Rajh
|
||||
case 89133: // Solar Fire
|
||||
case 89878: // Solar Fire
|
||||
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_4_YARDS);
|
||||
break;
|
||||
case 74108: // Solar Winds
|
||||
case 89130: // Solar Winds
|
||||
spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_4_YARDS);
|
||||
break;
|
||||
case 24314: // Threatening Gaze
|
||||
spellInfo->AuraInterruptFlags |= AURA_INTERRUPT_FLAG_CAST | AURA_INTERRUPT_FLAG_MOVE | AURA_INTERRUPT_FLAG_JUMP;
|
||||
break;
|
||||
|
||||
487
src/server/scripts/Kalimdor/HallsOfOrigination/boss_rajh.cpp
Normal file
487
src/server/scripts/Kalimdor/HallsOfOrigination/boss_rajh.cpp
Normal file
@@ -0,0 +1,487 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2017 TrinityCore <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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "Player.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "halls_of_origination.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
// Rajh
|
||||
SPELL_SOLAR_WINDS_DUMMY = 74104,
|
||||
SPELL_SOLAR_WINDS_SUMMON = 74106,
|
||||
SPELL_SUMMON_SUN_ORB = 80352,
|
||||
SPELL_SUN_STRIKE = 73872,
|
||||
SPELL_BLESSING_OF_THE_SUN = 76352,
|
||||
SPELL_INFERNO_LEAP_DUMMY = 87650,
|
||||
SPELL_INFERNO_LEAP_VEHICLE = 87653,
|
||||
|
||||
// Solar Winds
|
||||
SPELL_SOLAR_WINDS_PERIODIC = 74107,
|
||||
|
||||
// Orb of the Sun
|
||||
SPELL_SUMMON_METEOR = 76375,
|
||||
SPELL_RIDE_VEHICLE = 43671,
|
||||
};
|
||||
|
||||
enum Texts
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_BLESSING_OF_THE_SUN = 1,
|
||||
SAY_SLAY = 2,
|
||||
SAY_DEATH = 3,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
// Rajh
|
||||
EVENT_SOLAR_WINDS = 1,
|
||||
EVENT_SUMMON_SOLAR_WINDS,
|
||||
EVENT_SUMMON_SUN_ORB,
|
||||
EVENT_SUN_STRIKE,
|
||||
EVENT_SUMMON_INFERNO_LEAP,
|
||||
EVENT_INFERNO_LEAP,
|
||||
EVENT_APPLY_IMMUNITY,
|
||||
EVENT_MOVE_TO_MIDDLE,
|
||||
EVENT_BLESSING_OF_THE_SUN,
|
||||
EVENT_TALK_BLESSING,
|
||||
EVENT_ATTACK,
|
||||
|
||||
// Solar Winds
|
||||
EVENT_GROW,
|
||||
EVENT_START_MOVING,
|
||||
EVENT_MOVE_ARROUND,
|
||||
|
||||
// Orb of the Sun
|
||||
EVENT_SUMMON_BLAZING_INFERNO,
|
||||
EVENT_RIDE_VEHICLE,
|
||||
};
|
||||
|
||||
enum Points
|
||||
{
|
||||
POINT_RAJH_CENTER = 1,
|
||||
};
|
||||
|
||||
enum AchievementData
|
||||
{
|
||||
DATA_SUN_OF_A = 1,
|
||||
};
|
||||
|
||||
Position const RajhMiddlePos = { -318.5936f, 192.8621f, 343.9443f };
|
||||
|
||||
class boss_rajh : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_rajh() : CreatureScript("boss_rajh") { }
|
||||
|
||||
struct boss_rajhAI : public BossAI
|
||||
{
|
||||
boss_rajhAI(Creature* creature) : BossAI(creature, DATA_RAJH) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
_energized = true;
|
||||
_achievementEnabled = true;
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetPower(POWER_ENERGY, 100);
|
||||
MakeInterruptable(false);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) override
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
events.ScheduleEvent(EVENT_SOLAR_WINDS, Seconds(5));
|
||||
events.ScheduleEvent(EVENT_SUMMON_SUN_ORB, Seconds(10));
|
||||
events.ScheduleEvent(EVENT_SUMMON_INFERNO_LEAP, Seconds(14));
|
||||
events.ScheduleEvent(EVENT_SUN_STRIKE, Seconds(20));
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
summons.Summon(summon);
|
||||
|
||||
if (summon->GetEntry() == NPC_INFERNO_LEAP)
|
||||
{
|
||||
MakeInterruptable(true);
|
||||
events.ScheduleEvent(EVENT_INFERNO_LEAP, 1);
|
||||
events.ScheduleEvent(EVENT_APPLY_IMMUNITY, Seconds(1) + Milliseconds(500));
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
_EnterEvadeMode();
|
||||
summons.DespawnAll();
|
||||
MakeInterruptable(false);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
_DespawnAtEvade();
|
||||
}
|
||||
void OnSpellCastInterrupt(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
MakeInterruptable(false);
|
||||
events.CancelEvent(EVENT_APPLY_IMMUNITY);
|
||||
}
|
||||
|
||||
void MakeInterruptable(bool apply)
|
||||
{
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_INTERRUPT, !apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, !apply);
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const override
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_SUN_OF_A:
|
||||
return _achievementEnabled;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 pointId) override
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
switch (pointId)
|
||||
{
|
||||
case POINT_RAJH_CENTER:
|
||||
events.ScheduleEvent(EVENT_BLESSING_OF_THE_SUN, 1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me->GetPower(POWER_ENERGY) <= 10 && _energized)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_MOVE_TO_MIDDLE, 1000);
|
||||
_energized = false;
|
||||
}
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SUN_STRIKE:
|
||||
DoCastVictim(SPELL_SUN_STRIKE);
|
||||
events.Repeat(Seconds(35), Seconds(37));
|
||||
break;
|
||||
case EVENT_SOLAR_WINDS:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
{
|
||||
DoCast(target, SPELL_SOLAR_WINDS_DUMMY);
|
||||
events.Repeat(Seconds(15), Seconds(21));
|
||||
events.ScheduleEvent(EVENT_SUMMON_SOLAR_WINDS, Seconds(1));
|
||||
}
|
||||
break;
|
||||
case EVENT_SUMMON_SOLAR_WINDS:
|
||||
DoCastSelf(SPELL_SOLAR_WINDS_SUMMON);
|
||||
break;
|
||||
case EVENT_SUMMON_SUN_ORB:
|
||||
MakeInterruptable(true);
|
||||
me->StopMoving();
|
||||
DoCastSelf(SPELL_SUMMON_SUN_ORB);
|
||||
events.Repeat(Seconds(35), Seconds(36));
|
||||
events.ScheduleEvent(EVENT_APPLY_IMMUNITY, Seconds(3));
|
||||
break;
|
||||
case EVENT_APPLY_IMMUNITY:
|
||||
MakeInterruptable(false);
|
||||
break;
|
||||
case EVENT_MOVE_TO_MIDDLE:
|
||||
events.Reset();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->AttackStop();
|
||||
me->ExitVehicle();
|
||||
me->GetMotionMaster()->MovePoint(POINT_RAJH_CENTER, RajhMiddlePos, true);
|
||||
break;
|
||||
case EVENT_BLESSING_OF_THE_SUN:
|
||||
DoCastSelf(SPELL_BLESSING_OF_THE_SUN);
|
||||
events.ScheduleEvent(EVENT_TALK_BLESSING, Seconds(1) + Milliseconds(500));
|
||||
events.ScheduleEvent(EVENT_ATTACK, Seconds(20));
|
||||
me->SetFacingTo(3.124139f);
|
||||
break;
|
||||
case EVENT_TALK_BLESSING:
|
||||
Talk(SAY_BLESSING_OF_THE_SUN);
|
||||
me->HandleEmoteCommand(EMOTE_STATE_READY_SPELL_OMNI);
|
||||
break;
|
||||
case EVENT_ATTACK:
|
||||
_achievementEnabled = false;
|
||||
_energized = true;
|
||||
events.ScheduleEvent(EVENT_SOLAR_WINDS, Seconds(5));
|
||||
events.ScheduleEvent(EVENT_SUMMON_SUN_ORB, Seconds(10));
|
||||
events.ScheduleEvent(EVENT_SUMMON_INFERNO_LEAP, Seconds(14));
|
||||
events.ScheduleEvent(EVENT_SUN_STRIKE, Seconds(20));
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
break;
|
||||
case EVENT_SUMMON_INFERNO_LEAP:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
DoCast(target, SPELL_INFERNO_LEAP_DUMMY, true);
|
||||
events.Repeat(Seconds(59), Seconds(60));
|
||||
break;
|
||||
case EVENT_INFERNO_LEAP:
|
||||
DoCastAOE(SPELL_INFERNO_LEAP_VEHICLE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
bool _energized;
|
||||
bool _achievementEnabled;
|
||||
};
|
||||
CreatureAI* GetAI(Creature *creature) const override
|
||||
{
|
||||
return GetHallsOfOriginationAI<boss_rajhAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_solar_winds : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_solar_winds() : CreatureScript("npc_solar_winds") { }
|
||||
|
||||
struct npc_solar_windsAI : public ScriptedAI
|
||||
{
|
||||
npc_solar_windsAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
|
||||
|
||||
void IsSummonedBy(Unit* /*summoner*/) override
|
||||
{
|
||||
me->SetWalk(true);
|
||||
_events.ScheduleEvent(EVENT_GROW, Seconds(1));
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon) override
|
||||
{
|
||||
if (Creature* rajh = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_RAJH)))
|
||||
rajh->AI()->JustSummoned(summon);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_GROW:
|
||||
me->SetObjectScale(1.0f);
|
||||
_events.ScheduleEvent(EVENT_START_MOVING, Seconds(2));
|
||||
break;
|
||||
case EVENT_START_MOVING:
|
||||
DoCastSelf(SPELL_SOLAR_WINDS_PERIODIC, true);
|
||||
_events.ScheduleEvent(EVENT_MOVE_ARROUND, 1);
|
||||
break;
|
||||
case EVENT_MOVE_ARROUND:
|
||||
{
|
||||
float o = me->GetOrientation() + frand(0.0f, float(M_PI * 2));
|
||||
float x = me->GetPositionX() + cos(o) * 20.0f;
|
||||
float y = me->GetPositionY() + sin(o) * 20.0f;
|
||||
float z = me->GetPositionZ();
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, z, true);
|
||||
_events.Repeat(Seconds(7));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetHallsOfOriginationAI<npc_solar_windsAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_orb_of_the_sun : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_orb_of_the_sun() : CreatureScript("npc_orb_of_the_sun") { }
|
||||
|
||||
struct npc_orb_of_the_sunAI : public ScriptedAI
|
||||
{
|
||||
npc_orb_of_the_sunAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { }
|
||||
|
||||
void IsSummonedBy(Unit* /*summoner*/) override
|
||||
{
|
||||
_events.ScheduleEvent(EVENT_GROW, Seconds(1));
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_GROW:
|
||||
me->SetObjectScale(1.0f);
|
||||
_events.ScheduleEvent(EVENT_SUMMON_BLAZING_INFERNO, Seconds(1));
|
||||
break;
|
||||
case EVENT_SUMMON_BLAZING_INFERNO:
|
||||
DoCastSelf(SPELL_SUMMON_METEOR);
|
||||
_events.ScheduleEvent(EVENT_RIDE_VEHICLE, Seconds(2));
|
||||
break;
|
||||
case EVENT_RIDE_VEHICLE:
|
||||
if (Creature* inferno = me->FindNearestCreature(NPC_BLAZING_INFERNO, 100.0f, true))
|
||||
DoCast(inferno, SPELL_RIDE_VEHICLE, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
InstanceScript* _instance;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetHallsOfOriginationAI<npc_orb_of_the_sunAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_rajh_summon_meteor : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rajh_summon_meteor() : SpellScriptLoader("spell_rajh_summon_meteor") { }
|
||||
|
||||
class spell_rajh_summon_meteor_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_rajh_summon_meteor_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
Trinity::Containers::RandomResize(targets, 1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_rajh_summon_meteor_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_rajh_summon_meteor_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_rajh_summon_sun_orb : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_rajh_summon_sun_orb() : SpellScriptLoader("spell_rajh_summon_sun_orb") { }
|
||||
|
||||
class spell_rajh_summon_sun_orb_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_rajh_summon_sun_orb_SpellScript);
|
||||
|
||||
void SetDestPosition(SpellEffIndex effIndex)
|
||||
{
|
||||
float x = GetExplTargetDest()->GetPositionX();
|
||||
float y = GetExplTargetDest()->GetPositionY();
|
||||
float z = 358.0276f;
|
||||
|
||||
const_cast<WorldLocation*>(GetExplTargetDest())->Relocate(x, y, z);
|
||||
GetHitDest()->Relocate(x, y, z);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectLaunch += SpellEffectFn(spell_rajh_summon_sun_orb_SpellScript::SetDestPosition, EFFECT_0, SPELL_EFFECT_SUMMON);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_rajh_summon_sun_orb_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_sun_of_a : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_sun_of_a() : AchievementCriteriaScript("achievement_sun_of_a") { }
|
||||
|
||||
bool OnCheck(Player* /*source*/, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
if (target->GetMap()->IsHeroic())
|
||||
return target->GetAI()->GetData(DATA_SUN_OF_A);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_rajh()
|
||||
{
|
||||
new boss_rajh();
|
||||
new npc_solar_winds();
|
||||
new npc_orb_of_the_sun();
|
||||
new spell_rajh_summon_meteor();
|
||||
new spell_rajh_summon_sun_orb();
|
||||
new achievement_sun_of_a();
|
||||
}
|
||||
@@ -71,6 +71,10 @@ enum HOOCreatures
|
||||
NPC_WATER_WARDEN = 39802,
|
||||
NPC_AIR_WARDEN = 39803,
|
||||
|
||||
BOSS_RAJH = 39378,
|
||||
NPC_INFERNO_LEAP = 47040,
|
||||
NPC_BLAZING_INFERNO = 40927,
|
||||
|
||||
WARDEN_ENTRY_DATA_DELTA = NPC_FIRE_WARDEN - DATA_FIRE_WARDEN,
|
||||
|
||||
NPC_BRANN_BRONZEBEARD_0 = 39908,
|
||||
|
||||
@@ -130,6 +130,9 @@ class instance_halls_of_origination : public InstanceMapScript
|
||||
case BOSS_ANRAPHET:
|
||||
AnraphetGUID = creature->GetGUID();
|
||||
break;
|
||||
case BOSS_RAJH:
|
||||
RajhGUID = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,6 +167,8 @@ class instance_halls_of_origination : public InstanceMapScript
|
||||
return BrannBronzebeardGUID;
|
||||
case DATA_ANRAPHET_GUID:
|
||||
return AnraphetGUID;
|
||||
case DATA_RAJH:
|
||||
return RajhGUID;
|
||||
}
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
@@ -225,6 +230,7 @@ class instance_halls_of_origination : public InstanceMapScript
|
||||
ObjectGuid AnraphetGUID;
|
||||
ObjectGuid AnraphetDoorGUID;
|
||||
ObjectGuid SunMirrorGUID;
|
||||
ObjectGuid RajhGUID;
|
||||
uint32 _deadElementals;
|
||||
};
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ void AddSC_instance_halls_of_origination(); //Halls of Origination
|
||||
void AddSC_boss_temple_guardian_anhuur();
|
||||
void AddSC_boss_earthrager_ptah();
|
||||
void AddSC_boss_anraphet();
|
||||
void AddSC_boss_rajh();
|
||||
void AddSC_vortex_pinnacle(); //Vortex Pinnacle
|
||||
void AddSC_instance_vortex_pinnacle();
|
||||
void AddSC_boss_grand_vizier_ertan();
|
||||
@@ -206,6 +207,7 @@ void AddKalimdorScripts()
|
||||
AddSC_boss_temple_guardian_anhuur();
|
||||
AddSC_boss_earthrager_ptah();
|
||||
AddSC_boss_anraphet();
|
||||
AddSC_boss_rajh();
|
||||
AddSC_vortex_pinnacle();
|
||||
AddSC_instance_vortex_pinnacle();
|
||||
AddSC_boss_grand_vizier_ertan();
|
||||
|
||||
Reference in New Issue
Block a user