mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
Merge branch 'master' into Playerbot
This commit is contained in:
27
data/sql/updates/db_world/2024_06_22_03.sql
Normal file
27
data/sql/updates/db_world/2024_06_22_03.sql
Normal file
@@ -0,0 +1,27 @@
|
||||
-- DB update 2024_06_22_02 -> 2024_06_22_03
|
||||
--
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_mother_shahraz_random_periodic_aura' WHERE `spell_id`=40867;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_mother_shahraz_beam_periodic_aura' WHERE `spell_id` IN (40862,40863,40865,40866);
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_mother_shahraz_saber_lash_aura' WHERE `spell_id`=40816;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_illidari_council_balance_of_power_aura' WHERE `spell_id`=41341;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_illidari_council_reflective_shield_aura' WHERE `spell_id`=41475;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_illidari_council_deadly_strike_aura' WHERE `spell_id`=41480;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_reliquary_of_souls_aura_of_suffering_aura' WHERE `spell_id`=41292;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_reliquary_of_souls_aura_of_desire_aura' WHERE `spell_id`=41350;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_reliquary_of_souls_aura_of_anger_aura' WHERE `spell_id`=41337;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_reliquary_of_souls_spite_aura' WHERE `spell_id`=41376;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_black_template_harpooners_mark_aura' WHERE `spell_id`=40084;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_black_temple_curse_of_the_bleakheart_aura' WHERE `spell_id`=41170;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_black_temple_skeleton_shot_aura' WHERE `spell_id`=41171;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_black_temple_wyvern_sting_aura' WHERE `spell_id`=41186;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_black_temple_charge_rage_aura' WHERE `spell_id`=39575;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_black_temple_shadow_inferno_aura' WHERE `spell_id`=39645;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_black_temple_spell_absorption_aura' WHERE `spell_id`=41034;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_black_temple_consuming_strikes_aura' WHERE `spell_id`=41248;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_black_temple_curse_of_vitality_aura' WHERE `spell_id`=41351;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_black_temple_dementia_aura' WHERE `spell_id`=41404;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_illidan_parasitic_shadowfiend_aura' WHERE `spell_id`=41917;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_illidan_tear_of_azzinoth_summon_channel_aura' WHERE `spell_id`=39857;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_illidan_demon_transform1_aura' WHERE `spell_id`=40511;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_illidan_demon_transform2_aura' WHERE `spell_id`=40398;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_illidan_cage_trap_stun_aura' WHERE `spell_id`=40760;
|
||||
6
data/sql/updates/db_world/2024_06_22_04.sql
Normal file
6
data/sql/updates/db_world/2024_06_22_04.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
-- DB update 2024_06_22_03 -> 2024_06_22_04
|
||||
--
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_the_eye_countercharge_aura' WHERE `spell_id`=35035;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_botanica_call_of_the_falcon_aura' WHERE `spell_id`=34852;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_botanica_shift_form_aura' WHERE `spell_id`=34201;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_arcatraz_soul_steal_aura' WHERE `spell_id`=36778;
|
||||
3
data/sql/updates/db_world/2024_06_22_05.sql
Normal file
3
data/sql/updates/db_world/2024_06_22_05.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
-- DB update 2024_06_22_04 -> 2024_06_22_05
|
||||
--
|
||||
UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask`|33554432 WHERE `entry` = 23330;
|
||||
3
data/sql/updates/db_world/2024_06_22_06.sql
Normal file
3
data/sql/updates/db_world/2024_06_22_06.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
-- DB update 2024_06_22_05 -> 2024_06_22_06
|
||||
--
|
||||
DELETE FROM `spell_group` WHERE `spell_id` IN (28486, 28488);
|
||||
3
data/sql/updates/db_world/2024_06_22_07.sql
Normal file
3
data/sql/updates/db_world/2024_06_22_07.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
-- DB update 2024_06_22_06 -> 2024_06_22_07
|
||||
--
|
||||
UPDATE `creature_template` SET `flags_extra` = `flags_extra` |256 WHERE `entry` IN (23030, 23330);
|
||||
7
data/sql/updates/db_world/2024_06_22_08.sql
Normal file
7
data/sql/updates/db_world/2024_06_22_08.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
-- DB update 2024_06_22_07 -> 2024_06_22_08
|
||||
--
|
||||
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 13) AND (`SourceEntry` = 16609);
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
|
||||
(13, 7, 16609, 0, 0, 6, 0, 67, 0, 0, 0, 0, 0, '', 'Warchief\'s Blessing - Player must be Horde'),
|
||||
(13, 7, 16609, 0, 0, 27, 0, 63, 4, 0, 0, 0, 0, '', 'Warchief\'s Blessing - Player must be level 63 or lower'),
|
||||
(13, 7, 16609, 0, 0, 5, 0, 76, 240, 0, 0, 0, 0, '', 'Warchief\'s Blessing - Player must be at least Friendly with Orgrimmar');
|
||||
6
data/sql/updates/db_world/2024_06_22_09.sql
Normal file
6
data/sql/updates/db_world/2024_06_22_09.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
-- DB update 2024_06_22_08 -> 2024_06_22_09
|
||||
--
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_hodir_storm_power_aura' WHERE `spell_id` IN (63711,65134);
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_hodir_storm_cloud_aura' WHERE `spell_id` IN (65123,65133);
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_hodir_toasty_fire_aura' WHERE `spell_id`=62821;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_hodir_starlight_aura' WHERE `spell_id`=62807;
|
||||
38
data/sql/updates/db_world/2024_06_23_00.sql
Normal file
38
data/sql/updates/db_world/2024_06_23_00.sql
Normal file
@@ -0,0 +1,38 @@
|
||||
-- DB update 2024_06_22_09 -> 2024_06_23_00
|
||||
--
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_azjol_nerub_web_wrap_aura' WHERE `spell_id`=52086;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_hadronox_summon_periodic_crypt_fiend_aura' WHERE `spell_id`=53037;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_hadronox_leech_poison_aura' WHERE `spell_id` IN (53030,59417);
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_reflective_shield_aura' WHERE `spell_id`=66515;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_dtk_raise_dead_aura' WHERE `spell_id` IN (48597,48605);
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_trollgore_corpse_explode_aura' WHERE `spell_id` IN (49555,59807);
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_novos_crystal_handler_death_aura' WHERE `spell_id`=47336;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_tharon_ja_curse_of_life_aura' WHERE `spell_id` IN (49527,59972);
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_tharon_ja_dummy_aura' WHERE `spell_id`=49551;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_dred_grievious_bite_aura' WHERE `spell_id`=48920;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_moorabi_mojo_frenzy_aura' WHERE `spell_id`=55163;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_sladran_grip_of_sladran_aura' WHERE `spell_id`=55093;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_oculus_stop_time_aura' WHERE `spell_id`=49838;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_oculus_evasive_maneuvers_aura' WHERE `spell_id`=50240;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_oculus_temporal_rift_aura' WHERE `spell_id`=49592;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_oculus_dream_funnel_aura' WHERE `spell_id`=50344;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_oculus_ride_ruby_emerald_amber_drake_que_aura' WHERE `spell_id` IN (49427,49459,49463);
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_oculus_evasive_charges_aura' WHERE `spell_id`=50241;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_oculus_soar_aura' WHERE `spell_id`=50325;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_oculus_drake_flag_aura' WHERE `spell_id`=53797;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_boss_magus_telestra_summon_telestra_clones_aura' WHERE `spell_id`=47710;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_ticking_time_bomb_aura' WHERE `spell_id`=59686;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_frost_tomb_aura' WHERE `spell_id`=42672;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_optic_link_aura' WHERE `spell_id`=54396;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_destroy_door_seal_aura' WHERE `spell_id`=58040;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_shield_of_bones_aura' WHERE `spell_id` IN (69069,70207);
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_wailing_souls_periodic_aura' WHERE `spell_id`=68875;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_bronjahm_soulstorm_channel_ooc_aura' WHERE `spell_id`=69008;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_bronjahm_soulstorm_visual_aura' WHERE `spell_id`=68870;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_krick_explosive_barrage_aura' WHERE `spell_id`=69012;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_exploding_orb_auto_grow_aura' WHERE `spell_id`=69020;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_pos_empowered_blizzard_aura' WHERE `spell_id`=70132;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_pos_blight_aura' WHERE `spell_id` IN (69603,69604,70285,70286);
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_pos_glacial_strike_aura' WHERE `spell_id` IN (70292,71316,71317);
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_hor_gunship_cannon_fire_aura' WHERE `spell_id`=70017;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_hor_shared_suffering_aura' WHERE `spell_id` IN (72368,72369);
|
||||
6
data/sql/updates/db_world/2024_06_24_00.sql
Normal file
6
data/sql/updates/db_world/2024_06_24_00.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
-- DB update 2024_06_23_00 -> 2024_06_24_00
|
||||
-- 16606 'Midsummer Bonfire Despawner'
|
||||
-- add TRIGGER flag
|
||||
UPDATE `creature_template` SET `flags_extra` = (`flags_extra` | 128) WHERE (`entry` = 16606);
|
||||
-- Script
|
||||
UPDATE `creature_template` SET `ScriptName` = 'npc_midsummer_bonfire_despawner' WHERE (`entry` = 16606);
|
||||
4
data/sql/updates/db_world/2024_06_24_01.sql
Normal file
4
data/sql/updates/db_world/2024_06_24_01.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
-- DB update 2024_06_24_00 -> 2024_06_24_01
|
||||
--
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_hadronox_summon_periodic_champion_aura' WHERE `spell_id`=53035;
|
||||
UPDATE `spell_script_names` SET `ScriptName`='spell_hadronox_summon_periodic_necromancer_aura' WHERE `spell_id`=53036;
|
||||
3
data/sql/updates/db_world/2024_06_24_02.sql
Normal file
3
data/sql/updates/db_world/2024_06_24_02.sql
Normal file
@@ -0,0 +1,3 @@
|
||||
-- DB update 2024_06_24_01 -> 2024_06_24_02
|
||||
-- Torek
|
||||
UPDATE `smart_scripts` SET `target_type` = 16, `comment` = 'Torek - On Quest Accept - Store Party Targetlist' WHERE (`entryorguid` = 12858) AND (`source_type` = 0) AND (`id` = 1);
|
||||
@@ -31,6 +31,7 @@
|
||||
|
||||
enum eBonfire
|
||||
{
|
||||
GO_MIDSUMMER_BONFIRE_SPELL_FOCUS = 181371,
|
||||
GO_MIDSUMMER_BONFIRE_CAMPFIRE_SPELL_FOCUS = 181377,
|
||||
GO_AHUNE_BONFIRE = 188073,
|
||||
|
||||
@@ -182,6 +183,10 @@ struct npc_midsummer_bonfire : public ScriptedAI
|
||||
{
|
||||
npc_midsummer_bonfire(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
// Midsummer Bonfire Spawn Trap also spawns this NPC (currently unwanted)
|
||||
if (me->ToTempSummon())
|
||||
me->DespawnOrUnsummon();
|
||||
|
||||
_isStampedOut = nullptr;
|
||||
_teamId = TEAM_NEUTRAL;
|
||||
_type = BONFIRE_TYPE_NONE;
|
||||
@@ -300,6 +305,7 @@ struct npc_midsummer_bonfire : public ScriptedAI
|
||||
if ((_bonfire = me->FindNearestGameObject(GoBonfireCity[i], 10.0f)))
|
||||
{
|
||||
_type = BONFIRE_TYPE_CITY;
|
||||
Ignite();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -362,6 +368,23 @@ private:
|
||||
GameObject* _bonfire;
|
||||
};
|
||||
|
||||
struct npc_midsummer_bonfire_despawner : public ScriptedAI
|
||||
{
|
||||
npc_midsummer_bonfire_despawner(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
std::list<GameObject*> gobjList;
|
||||
me->GetGameObjectListWithEntryInGrid(gobjList, GO_MIDSUMMER_BONFIRE_SPELL_FOCUS, 10.0f);
|
||||
for (std::list<GameObject*>::const_iterator itr = gobjList.begin(); itr != gobjList.end(); ++itr)
|
||||
{
|
||||
// spawnID is 0 for temp spawns
|
||||
if (0 == (*itr)->GetSpawnId())
|
||||
(*itr)->DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
};
|
||||
|
||||
enum torchToss
|
||||
{
|
||||
GO_TORCH_TARGET_BRAZIER = 187708,
|
||||
@@ -1265,6 +1288,7 @@ void AddSC_event_midsummer_scripts()
|
||||
|
||||
// NPCs
|
||||
RegisterCreatureAI(npc_midsummer_bonfire);
|
||||
RegisterCreatureAI(npc_midsummer_bonfire_despawner);
|
||||
RegisterCreatureAI(npc_midsummer_torch_target);
|
||||
RegisterCreatureAI(npc_midsummer_ribbon_pole_target);
|
||||
|
||||
|
||||
@@ -323,50 +323,41 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hadronox_summon_periodic : public SpellScriptLoader
|
||||
class spell_hadronox_summon_periodic_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hadronox_summon_periodic_aura);
|
||||
|
||||
public:
|
||||
spell_hadronox_summon_periodic(const char* name, uint32 delay, uint32 spellEntry) : SpellScriptLoader(name), _delay(delay), _spellEntry(spellEntry) { }
|
||||
spell_hadronox_summon_periodic_aura(uint32 delay, uint32 spellEntry) : _delay(delay), _spellEntry(spellEntry) { }
|
||||
|
||||
class spell_hadronox_summon_periodic_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
public:
|
||||
spell_hadronox_summon_periodic_AuraScript(uint32 delay, uint32 spellEntry) : _delay(delay), _spellEntry(spellEntry) { }
|
||||
PrepareAuraScript(spell_hadronox_summon_periodic_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_WEB_FRONT_DOORS });
|
||||
}
|
||||
|
||||
void HandlePeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
Unit* owner = GetUnitOwner();
|
||||
if (InstanceScript* instance = owner->GetInstanceScript())
|
||||
if (instance->GetBossState(DATA_HADRONOX_EVENT) != DONE)
|
||||
{
|
||||
if (!owner->HasAura(SPELL_WEB_FRONT_DOORS))
|
||||
owner->CastSpell(owner, _spellEntry, true);
|
||||
else if (!instance->IsEncounterInProgress())
|
||||
owner->RemoveAurasDueToSpell(SPELL_WEB_FRONT_DOORS);
|
||||
}
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* auraEffect, AuraEffectHandleModes)
|
||||
{
|
||||
GetAura()->GetEffect(auraEffect->GetEffIndex())->SetPeriodicTimer(_delay);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hadronox_summon_periodic_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_hadronox_summon_periodic_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _delay;
|
||||
uint32 _spellEntry;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandlePeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
return new spell_hadronox_summon_periodic_AuraScript(_delay, _spellEntry);
|
||||
PreventDefaultAction();
|
||||
Unit* owner = GetUnitOwner();
|
||||
if (InstanceScript* instance = owner->GetInstanceScript())
|
||||
if (instance->GetBossState(DATA_HADRONOX_EVENT) != DONE)
|
||||
{
|
||||
if (!owner->HasAura(SPELL_WEB_FRONT_DOORS))
|
||||
owner->CastSpell(owner, _spellEntry, true);
|
||||
else if (!instance->IsEncounterInProgress())
|
||||
owner->RemoveAurasDueToSpell(SPELL_WEB_FRONT_DOORS);
|
||||
}
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* auraEffect, AuraEffectHandleModes)
|
||||
{
|
||||
GetAura()->GetEffect(auraEffect->GetEffIndex())->SetPeriodicTimer(_delay);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hadronox_summon_periodic_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_hadronox_summon_periodic_aura::OnApply, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -374,31 +365,25 @@ private:
|
||||
uint32 _spellEntry;
|
||||
};
|
||||
|
||||
class spell_hadronox_leech_poison : public SpellScriptLoader
|
||||
class spell_hadronox_leech_poison_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_hadronox_leech_poison() : SpellScriptLoader("spell_hadronox_leech_poison") { }
|
||||
PrepareAuraScript(spell_hadronox_leech_poison_aura);
|
||||
|
||||
class spell_hadronox_leech_poison_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_hadronox_leech_poison_AuraScript)
|
||||
return ValidateSpellInfo({ SPELL_LEECH_POISON_HEAL });
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, SPELL_LEECH_POISON_HEAL, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_hadronox_leech_poison_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_LEECH, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_hadronox_leech_poison_AuraScript();
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, SPELL_LEECH_POISON_HEAL, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_hadronox_leech_poison_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_LEECH, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -422,10 +407,10 @@ void AddSC_boss_hadronox()
|
||||
{
|
||||
new boss_hadronox();
|
||||
new npc_anub_ar_crusher();
|
||||
new spell_hadronox_summon_periodic("spell_hadronox_summon_periodic_champion", 15000, SPELL_SUMMON_ANUBAR_CHAMPION);
|
||||
new spell_hadronox_summon_periodic("spell_hadronox_summon_periodic_necromancer", 10000, SPELL_SUMMON_ANUBAR_NECROMANCER);
|
||||
new spell_hadronox_summon_periodic("spell_hadronox_summon_periodic_crypt_fiend", 5000, SPELL_SUMMON_ANUBAR_CRYPT_FIEND);
|
||||
new spell_hadronox_leech_poison();
|
||||
RegisterSpellScriptWithArgs(spell_hadronox_summon_periodic_aura, "spell_hadronox_summon_periodic_champion_aura", 15000, SPELL_SUMMON_ANUBAR_CHAMPION);
|
||||
RegisterSpellScriptWithArgs(spell_hadronox_summon_periodic_aura, "spell_hadronox_summon_periodic_necromancer_aura", 10000, SPELL_SUMMON_ANUBAR_NECROMANCER);
|
||||
RegisterSpellScriptWithArgs(spell_hadronox_summon_periodic_aura, "spell_hadronox_summon_periodic_crypt_fiend_aura", 5000, SPELL_SUMMON_ANUBAR_CRYPT_FIEND);
|
||||
RegisterSpellScript(spell_hadronox_leech_poison_aura);
|
||||
new achievement_hadronox_denied();
|
||||
}
|
||||
|
||||
|
||||
@@ -114,65 +114,48 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_azjol_nerub_fixate : public SpellScriptLoader
|
||||
class spell_azjol_nerub_fixate : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_azjol_nerub_fixate() : SpellScriptLoader("spell_azjol_nerub_fixate") { }
|
||||
PrepareSpellScript(spell_azjol_nerub_fixate);
|
||||
|
||||
class spell_azjol_nerub_fixate_SpellScript : public SpellScript
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_azjol_nerub_fixate_SpellScript);
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), GetEffectValue(), true);
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), GetEffectValue(), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_azjol_nerub_fixate_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_azjol_nerub_fixate_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_azjol_nerub_fixate::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_azjol_nerub_web_wrap : public SpellScriptLoader
|
||||
class spell_azjol_nerub_web_wrap_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_azjol_nerub_web_wrap() : SpellScriptLoader("spell_azjol_nerub_web_wrap") { }
|
||||
PrepareAuraScript(spell_azjol_nerub_web_wrap_aura);
|
||||
|
||||
class spell_azjol_nerub_web_wrap_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_azjol_nerub_web_wrap_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_WEB_WRAP_TRIGGER });
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (!target->HasAura(SPELL_WEB_WRAP_TRIGGER))
|
||||
target->CastSpell(target, SPELL_WEB_WRAP_TRIGGER, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_azjol_nerub_web_wrap_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_ROOT, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_azjol_nerub_web_wrap_AuraScript();
|
||||
Unit* target = GetTarget();
|
||||
if (!target->HasAura(SPELL_WEB_WRAP_TRIGGER))
|
||||
target->CastSpell(target, SPELL_WEB_WRAP_TRIGGER, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_azjol_nerub_web_wrap_aura::OnRemove, EFFECT_0, SPELL_AURA_MOD_ROOT, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_azjol_nerub()
|
||||
{
|
||||
new instance_azjol_nerub();
|
||||
new spell_azjol_nerub_fixate();
|
||||
new spell_azjol_nerub_web_wrap();
|
||||
RegisterSpellScript(spell_azjol_nerub_fixate);
|
||||
RegisterSpellScript(spell_azjol_nerub_web_wrap_aura);
|
||||
}
|
||||
|
||||
@@ -734,104 +734,81 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_eadric_radiance : public SpellScriptLoader
|
||||
class spell_eadric_radiance : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_eadric_radiance() : SpellScriptLoader("spell_eadric_radiance") { }
|
||||
PrepareSpellScript(spell_eadric_radiance);
|
||||
|
||||
class spell_eadric_radiance_SpellScript : public SpellScript
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_eadric_radiance_SpellScript);
|
||||
std::list<WorldObject*> tmplist;
|
||||
for( std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||
if( (*itr)->ToUnit()->HasInArc(M_PI, GetCaster()) )
|
||||
tmplist.push_back(*itr);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
std::list<WorldObject*> tmplist;
|
||||
for( std::list<WorldObject*>::const_iterator itr = targets.begin(); itr != targets.end(); ++itr)
|
||||
if( (*itr)->ToUnit()->HasInArc(M_PI, GetCaster()) )
|
||||
tmplist.push_back(*itr);
|
||||
targets.clear();
|
||||
for( std::list<WorldObject*>::iterator itr = tmplist.begin(); itr != tmplist.end(); ++itr )
|
||||
targets.push_back(*itr);
|
||||
}
|
||||
|
||||
targets.clear();
|
||||
for( std::list<WorldObject*>::iterator itr = tmplist.begin(); itr != tmplist.end(); ++itr )
|
||||
targets.push_back(*itr);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_eadric_radiance_SpellScript();
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eadric_radiance::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_toc5_light_rain : public SpellScriptLoader
|
||||
class spell_toc5_light_rain : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_toc5_light_rain() : SpellScriptLoader("spell_toc5_light_rain") { }
|
||||
PrepareSpellScript(spell_toc5_light_rain);
|
||||
|
||||
class spell_toc5_light_rain_SpellScript : public SpellScript
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_toc5_light_rain_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
for( std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); )
|
||||
{
|
||||
for( std::list<WorldObject*>::iterator itr = targets.begin(); itr != targets.end(); )
|
||||
{
|
||||
if ((*itr)->GetTypeId() == TYPEID_UNIT)
|
||||
if ((*itr)->ToCreature()->GetEntry() == NPC_FOUNTAIN_OF_LIGHT)
|
||||
{
|
||||
targets.erase(itr);
|
||||
itr = targets.begin();
|
||||
continue;
|
||||
}
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_toc5_light_rain_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_toc5_light_rain_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_reflective_shield : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_reflective_shield() : SpellScriptLoader("spell_reflective_shield") { }
|
||||
|
||||
class spell_reflective_shield_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_reflective_shield_AuraScript)
|
||||
|
||||
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
if( Unit* attacker = dmgInfo.GetAttacker() )
|
||||
if( GetOwner() && attacker->GetGUID() != GetOwner()->GetGUID() )
|
||||
if ((*itr)->GetTypeId() == TYPEID_UNIT)
|
||||
if ((*itr)->ToCreature()->GetEntry() == NPC_FOUNTAIN_OF_LIGHT)
|
||||
{
|
||||
int32 damage = (int32)(absorbAmount * 0.25f);
|
||||
GetOwner()->ToUnit()->CastCustomSpell(attacker, 33619, &damage, nullptr, nullptr, true);
|
||||
targets.erase(itr);
|
||||
itr = targets.begin();
|
||||
continue;
|
||||
}
|
||||
++itr;
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_reflective_shield_AuraScript::HandleAfterEffectAbsorb, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_reflective_shield_AuraScript();
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_toc5_light_rain::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||
}
|
||||
};
|
||||
|
||||
enum ReflectiveShield
|
||||
{
|
||||
SPELL_REFLECTIVE_SHIELD_DAMAGE = 33619
|
||||
};
|
||||
|
||||
class spell_reflective_shield_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_reflective_shield_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_REFLECTIVE_SHIELD_DAMAGE });
|
||||
}
|
||||
|
||||
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
if( Unit* attacker = dmgInfo.GetAttacker() )
|
||||
if( GetOwner() && attacker->GetGUID() != GetOwner()->GetGUID() )
|
||||
{
|
||||
int32 damage = (int32)(absorbAmount * 0.25f);
|
||||
GetOwner()->ToUnit()->CastCustomSpell(attacker, SPELL_REFLECTIVE_SHIELD_DAMAGE, &damage, nullptr, nullptr, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_reflective_shield_aura::HandleAfterEffectAbsorb, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -841,8 +818,8 @@ void AddSC_boss_argent_challenge()
|
||||
new boss_paletress();
|
||||
new npc_memory();
|
||||
new npc_argent_soldier();
|
||||
new spell_eadric_radiance();
|
||||
new spell_toc5_light_rain();
|
||||
new spell_reflective_shield();
|
||||
RegisterSpellScript(spell_eadric_radiance);
|
||||
RegisterSpellScript(spell_toc5_light_rain);
|
||||
RegisterSpellScript(spell_reflective_shield_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -155,60 +155,38 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_dred_grievious_bite : public SpellScriptLoader
|
||||
class spell_dred_grievious_bite_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_dred_grievious_bite() : SpellScriptLoader("spell_dred_grievious_bite") { }
|
||||
PrepareAuraScript(spell_dred_grievious_bite_aura);
|
||||
|
||||
class spell_dred_grievious_bite_AuraScript : public AuraScript
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PrepareAuraScript(spell_dred_grievious_bite_AuraScript);
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetHealth() == target->GetMaxHealth())
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetHealth() == target->GetMaxHealth())
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_dred_grievious_bite_AuraScript::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_dred_grievious_bite_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_dred_grievious_bite_aura::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_dred_raptor_call : public SpellScriptLoader
|
||||
class spell_dred_raptor_call : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_dred_raptor_call() : SpellScriptLoader("spell_dred_raptor_call") { }
|
||||
PrepareSpellScript(spell_dred_raptor_call);
|
||||
|
||||
class spell_dred_raptor_call_SpellScript : public SpellScript
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_dred_raptor_call_SpellScript);
|
||||
GetCaster()->SummonCreature(RAND(NPC_DRAKKARI_GUTRIPPER, NPC_DRAKKARI_SCYTHECLAW), -522.02f, -718.89f, 30.26f, 2.41f);
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetCaster()->SummonCreature(RAND(NPC_DRAKKARI_GUTRIPPER, NPC_DRAKKARI_SCYTHECLAW), -522.02f, -718.89f, 30.26f, 2.41f);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_dred_raptor_call_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_dred_raptor_call_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_dred_raptor_call::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -231,7 +209,7 @@ public:
|
||||
void AddSC_boss_dred()
|
||||
{
|
||||
new boss_dred();
|
||||
new spell_dred_grievious_bite();
|
||||
new spell_dred_raptor_call();
|
||||
RegisterSpellScript(spell_dred_grievious_bite_aura);
|
||||
RegisterSpellScript(spell_dred_raptor_call);
|
||||
new achievement_better_off_dred();
|
||||
}
|
||||
|
||||
@@ -268,85 +268,62 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_novos_despawn_crystal_handler : public SpellScriptLoader
|
||||
class spell_novos_despawn_crystal_handler : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_novos_despawn_crystal_handler() : SpellScriptLoader("spell_novos_despawn_crystal_handler") { }
|
||||
PrepareSpellScript(spell_novos_despawn_crystal_handler);
|
||||
|
||||
class spell_novos_despawn_crystal_handler_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_novos_despawn_crystal_handler_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_BEAM_CHANNEL });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), SPELL_BEAM_CHANNEL, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_novos_despawn_crystal_handler_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_novos_despawn_crystal_handler_SpellScript();
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), SPELL_BEAM_CHANNEL, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_novos_despawn_crystal_handler::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_novos_crystal_handler_death : public SpellScriptLoader
|
||||
class spell_novos_crystal_handler_death_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_novos_crystal_handler_death() : SpellScriptLoader("spell_novos_crystal_handler_death") { }
|
||||
PrepareAuraScript(spell_novos_crystal_handler_death_aura);
|
||||
|
||||
class spell_novos_crystal_handler_death_AuraScript : public AuraScript
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_novos_crystal_handler_death_AuraScript)
|
||||
GetUnitOwner()->InterruptNonMeleeSpells(false);
|
||||
if (GameObject* crystal = GetUnitOwner()->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_DOOR, 5.0f))
|
||||
crystal->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->InterruptNonMeleeSpells(false);
|
||||
if (GameObject* crystal = GetUnitOwner()->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_DOOR, 5.0f))
|
||||
crystal->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_novos_crystal_handler_death_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_novos_crystal_handler_death_AuraScript();
|
||||
OnEffectApply += AuraEffectApplyFn(spell_novos_crystal_handler_death_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_novos_summon_minions : public SpellScriptLoader
|
||||
class spell_novos_summon_minions : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_novos_summon_minions() : SpellScriptLoader("spell_novos_summon_minions") { }
|
||||
PrepareSpellScript(spell_novos_summon_minions);
|
||||
|
||||
class spell_novos_summon_minions_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_novos_summon_minions_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_COPY_OF_SUMMON_MINIONS });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
GetCaster()->CastSpell((Unit*)nullptr, SPELL_COPY_OF_SUMMON_MINIONS, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_novos_summon_minions_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_novos_summon_minions_SpellScript();
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
GetCaster()->CastSpell((Unit*)nullptr, SPELL_COPY_OF_SUMMON_MINIONS, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_novos_summon_minions::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -364,8 +341,8 @@ public:
|
||||
void AddSC_boss_novos()
|
||||
{
|
||||
new boss_novos();
|
||||
new spell_novos_despawn_crystal_handler();
|
||||
new spell_novos_crystal_handler_death();
|
||||
new spell_novos_summon_minions();
|
||||
RegisterSpellScript(spell_novos_despawn_crystal_handler);
|
||||
RegisterSpellScript(spell_novos_crystal_handler_death_aura);
|
||||
RegisterSpellScript(spell_novos_summon_minions);
|
||||
new achievement_oh_novos();
|
||||
}
|
||||
|
||||
@@ -208,107 +208,79 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_tharon_ja_curse_of_life : public SpellScriptLoader
|
||||
class spell_tharon_ja_curse_of_life_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_tharon_ja_curse_of_life() : SpellScriptLoader("spell_tharon_ja_curse_of_life") { }
|
||||
PrepareAuraScript(spell_tharon_ja_curse_of_life_aura);
|
||||
|
||||
class spell_tharon_ja_curse_of_life_AuraScript : public AuraScript
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PrepareAuraScript(spell_tharon_ja_curse_of_life_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
if (GetUnitOwner()->HealthBelowPct(50))
|
||||
{
|
||||
if (GetUnitOwner()->HealthBelowPct(50))
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
}
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_tharon_ja_curse_of_life_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_tharon_ja_curse_of_life_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_tharon_ja_curse_of_life_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_tharon_ja_dummy : public SpellScriptLoader
|
||||
class spell_tharon_ja_dummy_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_tharon_ja_dummy() : SpellScriptLoader("spell_tharon_ja_dummy") { }
|
||||
PrepareAuraScript(spell_tharon_ja_dummy_aura);
|
||||
|
||||
class spell_tharon_ja_dummy_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_tharon_ja_dummy_AuraScript)
|
||||
return ValidateSpellInfo({ SPELL_FLESH_VISUAL, SPELL_GIFT_OF_THARON_JA, SPELL_TURN_BONES });
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_FLESH_VISUAL, true);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_GIFT_OF_THARON_JA, true);
|
||||
GetUnitOwner()->SetDisplayId(GetUnitOwner()->GetNativeDisplayId() + 1);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->GetThreatMgr().ResetAllThreat();
|
||||
GetUnitOwner()->GetMotionMaster()->Clear();
|
||||
GetUnitOwner()->CastSpell((Unit*)nullptr, SPELL_TURN_BONES, false);
|
||||
GetUnitOwner()->GetAI()->DoAction(ACTION_TURN_BONES);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_tharon_ja_dummy_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_tharon_ja_dummy_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_tharon_ja_dummy_AuraScript();
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_FLESH_VISUAL, true);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_GIFT_OF_THARON_JA, true);
|
||||
GetUnitOwner()->SetDisplayId(GetUnitOwner()->GetNativeDisplayId() + 1);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->GetThreatMgr().ResetAllThreat();
|
||||
GetUnitOwner()->GetMotionMaster()->Clear();
|
||||
GetUnitOwner()->CastSpell((Unit*)nullptr, SPELL_TURN_BONES, false);
|
||||
GetUnitOwner()->GetAI()->DoAction(ACTION_TURN_BONES);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_tharon_ja_dummy_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_tharon_ja_dummy_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_tharon_ja_clear_gift_of_tharon_ja : public SpellScriptLoader
|
||||
class spell_tharon_ja_clear_gift_of_tharon_ja : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_tharon_ja_clear_gift_of_tharon_ja() : SpellScriptLoader("spell_tharon_ja_clear_gift_of_tharon_ja") { }
|
||||
PrepareSpellScript(spell_tharon_ja_clear_gift_of_tharon_ja);
|
||||
|
||||
class spell_tharon_ja_clear_gift_of_tharon_ja_SpellScript : public SpellScript
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_tharon_ja_clear_gift_of_tharon_ja_SpellScript);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->RemoveAura(SPELL_GIFT_OF_THARON_JA);
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->RemoveAura(SPELL_GIFT_OF_THARON_JA);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_tharon_ja_clear_gift_of_tharon_ja_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_tharon_ja_clear_gift_of_tharon_ja_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_tharon_ja_clear_gift_of_tharon_ja::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_tharon_ja()
|
||||
{
|
||||
new boss_tharon_ja();
|
||||
new spell_tharon_ja_curse_of_life();
|
||||
new spell_tharon_ja_dummy();
|
||||
new spell_tharon_ja_clear_gift_of_tharon_ja();
|
||||
RegisterSpellScript(spell_tharon_ja_curse_of_life_aura);
|
||||
RegisterSpellScript(spell_tharon_ja_dummy_aura);
|
||||
RegisterSpellScript(spell_tharon_ja_clear_gift_of_tharon_ja);
|
||||
}
|
||||
|
||||
|
||||
@@ -171,92 +171,69 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_trollgore_consume : public SpellScriptLoader
|
||||
class spell_trollgore_consume : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_trollgore_consume() : SpellScriptLoader("spell_trollgore_consume") { }
|
||||
PrepareSpellScript(spell_trollgore_consume);
|
||||
|
||||
class spell_trollgore_consume_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_trollgore_consume_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_CONSUME_AURA });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), SPELL_CONSUME_AURA, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_trollgore_consume_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_trollgore_consume_SpellScript();
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), SPELL_CONSUME_AURA, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_trollgore_consume::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_trollgore_corpse_explode : public SpellScriptLoader
|
||||
class spell_trollgore_corpse_explode_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_trollgore_corpse_explode() : SpellScriptLoader("spell_trollgore_corpse_explode") { }
|
||||
PrepareAuraScript(spell_trollgore_corpse_explode_aura);
|
||||
|
||||
class spell_trollgore_corpse_explode_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_trollgore_corpse_explode_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_CORPSE_EXPLODE_DAMAGE });
|
||||
}
|
||||
|
||||
void PeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
if (aurEff->GetTickNumber() == 2)
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetTarget(), SPELL_CORPSE_EXPLODE_DAMAGE, true);
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Creature* target = GetTarget()->ToCreature())
|
||||
target->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_trollgore_corpse_explode_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_trollgore_corpse_explode_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void PeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
return new spell_trollgore_corpse_explode_AuraScript();
|
||||
if (aurEff->GetTickNumber() == 2)
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetTarget(), SPELL_CORPSE_EXPLODE_DAMAGE, true);
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Creature* target = GetTarget()->ToCreature())
|
||||
target->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_trollgore_corpse_explode_aura::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_trollgore_corpse_explode_aura::HandleRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_trollgore_invader_taunt : public SpellScriptLoader
|
||||
class spell_trollgore_invader_taunt : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_trollgore_invader_taunt() : SpellScriptLoader("spell_trollgore_invader_taunt") { }
|
||||
PrepareSpellScript(spell_trollgore_invader_taunt);
|
||||
|
||||
class spell_trollgore_invader_taunt_SpellScript : public SpellScript
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_trollgore_invader_taunt_SpellScript);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_trollgore_invader_taunt_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_trollgore_invader_taunt_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_trollgore_invader_taunt::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -279,8 +256,8 @@ public:
|
||||
void AddSC_boss_trollgore()
|
||||
{
|
||||
new boss_trollgore();
|
||||
new spell_trollgore_consume();
|
||||
new spell_trollgore_corpse_explode();
|
||||
new spell_trollgore_invader_taunt();
|
||||
RegisterSpellScript(spell_trollgore_consume);
|
||||
RegisterSpellScript(spell_trollgore_corpse_explode_aura);
|
||||
RegisterSpellScript(spell_trollgore_invader_taunt);
|
||||
new achievement_consumption_junction();
|
||||
}
|
||||
|
||||
@@ -77,67 +77,50 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_dtk_raise_dead : public SpellScriptLoader
|
||||
class spell_dtk_raise_dead_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_dtk_raise_dead() : SpellScriptLoader("spell_dtk_raise_dead") { }
|
||||
PrepareAuraScript(spell_dtk_raise_dead_aura);
|
||||
|
||||
class spell_dtk_raise_dead_AuraScript : public AuraScript
|
||||
bool Load() override
|
||||
{
|
||||
PrepareAuraScript(spell_dtk_raise_dead_AuraScript)
|
||||
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->ToCreature()->DespawnOrUnsummon(1);
|
||||
GetUnitOwner()->SummonCreature(NPC_RISEN_DRAKKARI_WARRIOR, *GetUnitOwner());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dtk_raise_dead_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_dtk_raise_dead_AuraScript();
|
||||
GetUnitOwner()->ToCreature()->DespawnOrUnsummon(1);
|
||||
GetUnitOwner()->SummonCreature(NPC_RISEN_DRAKKARI_WARRIOR, *GetUnitOwner());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_dtk_raise_dead_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_dtk_summon_random_drakkari : public SpellScriptLoader
|
||||
class spell_dtk_summon_random_drakkari : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_dtk_summon_random_drakkari() : SpellScriptLoader("spell_dtk_summon_random_drakkari") { }
|
||||
PrepareSpellScript(spell_dtk_summon_random_drakkari);
|
||||
|
||||
class spell_dtk_summon_random_drakkari_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_dtk_summon_random_drakkari_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_SUMMON_DRAKKARI_SHAMAN, SPELL_SUMMON_DRAKKARI_GUARDIAN });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetCaster()->CastSpell(GetCaster(), RAND(SPELL_SUMMON_DRAKKARI_SHAMAN, SPELL_SUMMON_DRAKKARI_GUARDIAN), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_dtk_summon_random_drakkari_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_dtk_summon_random_drakkari_SpellScript();
|
||||
GetCaster()->CastSpell(GetCaster(), RAND(SPELL_SUMMON_DRAKKARI_SHAMAN, SPELL_SUMMON_DRAKKARI_GUARDIAN), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_dtk_summon_random_drakkari::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_drak_tharon_keep()
|
||||
{
|
||||
new instance_drak_tharon_keep();
|
||||
new spell_dtk_raise_dead();
|
||||
new spell_dtk_summon_random_drakkari();
|
||||
RegisterSpellScript(spell_dtk_raise_dead_aura);
|
||||
RegisterSpellScript(spell_dtk_summon_random_drakkari);
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ enum eSpells
|
||||
SPELL_TELEPORT_VISUAL = 52096,
|
||||
|
||||
SPELL_SOULSTORM_VISUAL = 68870,
|
||||
SPELL_SOULSTORM_VISUAL2 = 68904,
|
||||
SPELL_SOULSTORM = 68872,
|
||||
};
|
||||
|
||||
@@ -263,136 +264,102 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_bronjahm_magic_bane : public SpellScriptLoader
|
||||
class spell_bronjahm_magic_bane : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_bronjahm_magic_bane() : SpellScriptLoader("spell_bronjahm_magic_bane") { }
|
||||
PrepareSpellScript(spell_bronjahm_magic_bane);
|
||||
|
||||
class spell_bronjahm_magic_bane_SpellScript : public SpellScript
|
||||
void RecalculateDamage()
|
||||
{
|
||||
PrepareSpellScript(spell_bronjahm_magic_bane_SpellScript);
|
||||
if (GetHitUnit()->getPowerType() != POWER_MANA)
|
||||
return;
|
||||
|
||||
void RecalculateDamage()
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (GetHitUnit()->getPowerType() != POWER_MANA)
|
||||
return;
|
||||
const int32 maxDamage = caster->GetMap()->GetSpawnMode() == 1 ? 15000 : 10000;
|
||||
int32 newDamage = GetHitDamage();
|
||||
newDamage += GetHitUnit()->GetMaxPower(POWER_MANA) / 2;
|
||||
newDamage = std::min<int32>(maxDamage, newDamage);
|
||||
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
const int32 maxDamage = caster->GetMap()->GetSpawnMode() == 1 ? 15000 : 10000;
|
||||
int32 newDamage = GetHitDamage();
|
||||
newDamage += GetHitUnit()->GetMaxPower(POWER_MANA) / 2;
|
||||
newDamage = std::min<int32>(maxDamage, newDamage);
|
||||
|
||||
SetHitDamage(newDamage);
|
||||
}
|
||||
SetHitDamage(newDamage);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnHit += SpellHitFn(spell_bronjahm_magic_bane_SpellScript::RecalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_bronjahm_magic_bane_SpellScript();
|
||||
OnHit += SpellHitFn(spell_bronjahm_magic_bane::RecalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_bronjahm_soulstorm_channel_ooc : public SpellScriptLoader
|
||||
class spell_bronjahm_soulstorm_channel_ooc_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_bronjahm_soulstorm_channel_ooc() : SpellScriptLoader("spell_bronjahm_soulstorm_channel_ooc") { }
|
||||
PrepareAuraScript(spell_bronjahm_soulstorm_channel_ooc_aura);
|
||||
|
||||
class spell_bronjahm_soulstorm_channel_ooc_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_bronjahm_soulstorm_channel_ooc_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_SOULSTORM_VISUAL2, SPELL_SOULSTORM_VISUAL2+1, SPELL_SOULSTORM_VISUAL2+2, SPELL_SOULSTORM_VISUAL2+3 });
|
||||
}
|
||||
|
||||
void HandlePeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), 68904 + (aurEff->GetTickNumber() % 4), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_bronjahm_soulstorm_channel_ooc_AuraScript::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandlePeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
return new spell_bronjahm_soulstorm_channel_ooc_AuraScript();
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SOULSTORM_VISUAL2 + (aurEff->GetTickNumber() % 4), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_bronjahm_soulstorm_channel_ooc_aura::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_bronjahm_soulstorm_visual : public SpellScriptLoader
|
||||
class spell_bronjahm_soulstorm_visual_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_bronjahm_soulstorm_visual() : SpellScriptLoader("spell_bronjahm_soulstorm_visual") { }
|
||||
PrepareAuraScript(spell_bronjahm_soulstorm_visual_aura);
|
||||
|
||||
class spell_bronjahm_soulstorm_visual_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_bronjahm_soulstorm_visual_AuraScript);
|
||||
return ValidateSpellInfo({ 68886, 68896, 68897, 68898 });
|
||||
}
|
||||
|
||||
void HandlePeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
uint32 spellId = 0;
|
||||
switch (aurEff->GetTickNumber() % 4)
|
||||
{
|
||||
case 0:
|
||||
spellId = 68886;
|
||||
break;
|
||||
case 1:
|
||||
spellId = 68896;
|
||||
break;
|
||||
case 2:
|
||||
spellId = 68897;
|
||||
break;
|
||||
case 3:
|
||||
spellId = 68898;
|
||||
break;
|
||||
}
|
||||
GetTarget()->CastSpell(GetTarget(), spellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_bronjahm_soulstorm_visual_AuraScript::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandlePeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
return new spell_bronjahm_soulstorm_visual_AuraScript();
|
||||
PreventDefaultAction();
|
||||
uint32 spellId = 0;
|
||||
switch (aurEff->GetTickNumber() % 4)
|
||||
{
|
||||
case 0:
|
||||
spellId = 68886;
|
||||
break;
|
||||
case 1:
|
||||
spellId = 68896;
|
||||
break;
|
||||
case 2:
|
||||
spellId = 68897;
|
||||
break;
|
||||
case 3:
|
||||
spellId = 68898;
|
||||
break;
|
||||
}
|
||||
GetTarget()->CastSpell(GetTarget(), spellId, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_bronjahm_soulstorm_visual_aura::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_bronjahm_soulstorm_targeting : public SpellScriptLoader
|
||||
class spell_bronjahm_soulstorm_targeting : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_bronjahm_soulstorm_targeting() : SpellScriptLoader("spell_bronjahm_soulstorm_targeting") { }
|
||||
PrepareSpellScript(spell_bronjahm_soulstorm_targeting);
|
||||
|
||||
class spell_bronjahm_soulstorm_targeting_SpellScript : public SpellScript
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_bronjahm_soulstorm_targeting_SpellScript);
|
||||
targets.remove_if(Acore::AllWorldObjectsInExactRange(GetCaster(), 10.0f, false));
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Acore::AllWorldObjectsInExactRange(GetCaster(), 10.0f, false));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_bronjahm_soulstorm_targeting_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_bronjahm_soulstorm_targeting_SpellScript();
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_bronjahm_soulstorm_targeting::FilterTargets, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -401,9 +368,9 @@ void AddSC_boss_bronjahm()
|
||||
new boss_bronjahm();
|
||||
new npc_fos_corrupted_soul_fragment();
|
||||
|
||||
new spell_bronjahm_magic_bane();
|
||||
new spell_bronjahm_soulstorm_channel_ooc();
|
||||
new spell_bronjahm_soulstorm_visual();
|
||||
new spell_bronjahm_soulstorm_targeting();
|
||||
RegisterSpellScript(spell_bronjahm_magic_bane);
|
||||
RegisterSpellScript(spell_bronjahm_soulstorm_channel_ooc_aura);
|
||||
RegisterSpellScript(spell_bronjahm_soulstorm_visual_aura);
|
||||
RegisterSpellScript(spell_bronjahm_soulstorm_targeting);
|
||||
}
|
||||
|
||||
|
||||
@@ -308,73 +308,67 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_wailing_souls_periodic : public SpellScriptLoader
|
||||
class spell_wailing_souls_periodic_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_wailing_souls_periodic() : SpellScriptLoader("spell_wailing_souls_periodic") { }
|
||||
PrepareAuraScript(spell_wailing_souls_periodic_aura);
|
||||
|
||||
class spell_wailing_souls_periodic_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_wailing_souls_periodic_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_WAILING_SOULS_DMG_N });
|
||||
}
|
||||
|
||||
int8 dir;
|
||||
int8 dir;
|
||||
|
||||
bool Load() override
|
||||
bool Load() override
|
||||
{
|
||||
dir = urand(0, 1) ? 1 : -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandlePeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* t = GetTarget())
|
||||
{
|
||||
dir = urand(0, 1) ? 1 : -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandlePeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* t = GetTarget())
|
||||
if (aurEff->GetTickNumber() < 30)
|
||||
{
|
||||
if (aurEff->GetTickNumber() < 30)
|
||||
{
|
||||
// spinning, casting, etc.
|
||||
float diff = (2 * M_PI) / (4 * 30);
|
||||
float new_o = t->GetOrientation() + diff * dir;
|
||||
if (new_o >= 2 * M_PI)
|
||||
new_o -= 2 * M_PI;
|
||||
else if (new_o < 0)
|
||||
new_o += 2 * M_PI;
|
||||
t->UpdateOrientation(new_o);
|
||||
t->SetFacingTo(new_o);
|
||||
t->CastSpell(t, SPELL_WAILING_SOULS_DMG_N, true);
|
||||
}
|
||||
else if (aurEff->GetTickNumber() == 33)
|
||||
{
|
||||
t->SetControlled(false, UNIT_STATE_ROOT);
|
||||
t->DisableRotate(false);
|
||||
if (t->GetTypeId() == TYPEID_UNIT)
|
||||
t->ToCreature()->SetReactState(REACT_AGGRESSIVE);
|
||||
if (t->GetVictim())
|
||||
{
|
||||
t->SetGuidValue(UNIT_FIELD_TARGET, t->GetVictim()->GetGUID());
|
||||
t->GetMotionMaster()->MoveChase(t->GetVictim());
|
||||
}
|
||||
}
|
||||
else if (aurEff->GetTickNumber() >= 34)
|
||||
Remove(AURA_REMOVE_BY_EXPIRE);
|
||||
// spinning, casting, etc.
|
||||
float diff = (2 * M_PI) / (4 * 30);
|
||||
float new_o = t->GetOrientation() + diff * dir;
|
||||
if (new_o >= 2 * M_PI)
|
||||
new_o -= 2 * M_PI;
|
||||
else if (new_o < 0)
|
||||
new_o += 2 * M_PI;
|
||||
t->UpdateOrientation(new_o);
|
||||
t->SetFacingTo(new_o);
|
||||
t->CastSpell(t, SPELL_WAILING_SOULS_DMG_N, true);
|
||||
}
|
||||
else if (aurEff->GetTickNumber() == 33)
|
||||
{
|
||||
t->SetControlled(false, UNIT_STATE_ROOT);
|
||||
t->DisableRotate(false);
|
||||
if (t->GetTypeId() == TYPEID_UNIT)
|
||||
t->ToCreature()->SetReactState(REACT_AGGRESSIVE);
|
||||
if (t->GetVictim())
|
||||
{
|
||||
t->SetGuidValue(UNIT_FIELD_TARGET, t->GetVictim()->GetGUID());
|
||||
t->GetMotionMaster()->MoveChase(t->GetVictim());
|
||||
}
|
||||
}
|
||||
else if (aurEff->GetTickNumber() >= 34)
|
||||
Remove(AURA_REMOVE_BY_EXPIRE);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_wailing_souls_periodic_AuraScript::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_wailing_souls_periodic_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_wailing_souls_periodic_aura::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_devourer_of_souls()
|
||||
{
|
||||
new boss_devourer_of_souls();
|
||||
new spell_wailing_souls_periodic();
|
||||
RegisterSpellScript(spell_wailing_souls_periodic_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -256,45 +256,44 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_shield_of_bones : public SpellScriptLoader
|
||||
enum ShieldOfBones
|
||||
{
|
||||
public:
|
||||
spell_shield_of_bones() : SpellScriptLoader("spell_shield_of_bones") { }
|
||||
SPELL_SHIELD_OF_BONES_DAMAGE = 69642
|
||||
};
|
||||
|
||||
class spell_shield_of_bones_AuraScript : public AuraScript
|
||||
class spell_shield_of_bones_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_shield_of_bones_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_shield_of_bones_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_SHIELD_OF_BONES_DAMAGE });
|
||||
}
|
||||
|
||||
int32 amount;
|
||||
bool fired;
|
||||
int32 amount;
|
||||
bool fired;
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
fired = false;
|
||||
amount = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
|
||||
{
|
||||
amount += absorbAmount;
|
||||
if (!fired && amount >= GetSpellInfo()->Effects[EFFECT_0].BasePoints + 1)
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
fired = true;
|
||||
caster->CastSpell(caster, 69642, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_shield_of_bones_AuraScript::HandleAfterEffectAbsorb, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
bool Load() override
|
||||
{
|
||||
return new spell_shield_of_bones_AuraScript();
|
||||
fired = false;
|
||||
amount = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleAfterEffectAbsorb(AuraEffect* /*aurEff*/, DamageInfo& /*dmgInfo*/, uint32& absorbAmount)
|
||||
{
|
||||
amount += absorbAmount;
|
||||
if (!fired && amount >= GetSpellInfo()->Effects[EFFECT_0].BasePoints + 1)
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
fired = true;
|
||||
caster->CastSpell(caster, SPELL_SHIELD_OF_BONES_DAMAGE, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_shield_of_bones_aura::HandleAfterEffectAbsorb, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -302,6 +301,6 @@ void AddSC_forge_of_souls()
|
||||
{
|
||||
new npc_fos_leader();
|
||||
new npc_fos_leader_second();
|
||||
new spell_shield_of_bones();
|
||||
RegisterSpellScript(spell_shield_of_bones_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -169,50 +169,49 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hor_shared_suffering : public SpellScriptLoader
|
||||
enum SharedSufferingAura
|
||||
{
|
||||
public:
|
||||
spell_hor_shared_suffering() : SpellScriptLoader("spell_hor_shared_suffering") { }
|
||||
SPELL_SHARED_SUFFERING_DAMAGE = 72373
|
||||
};
|
||||
|
||||
class spell_hor_shared_sufferingAuraScript : public AuraScript
|
||||
class spell_hor_shared_suffering_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hor_shared_suffering_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_hor_shared_sufferingAuraScript);
|
||||
return ValidateSpellInfo({ SPELL_SHARED_SUFFERING_DAMAGE });
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL) // dispelled
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Map* map = caster->FindMap())
|
||||
if (Aura* a = aurEff->GetBase())
|
||||
{
|
||||
uint32 count = 0;
|
||||
uint32 ticks = 0;
|
||||
uint32 dmgPerTick = a->GetSpellInfo()->Effects[0].BasePoints;
|
||||
Map::PlayerList const& pl = map->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
|
||||
if (Player* p = itr->GetSource())
|
||||
if (p->IsAlive())
|
||||
++count;
|
||||
ticks = (a->GetDuration() / int32(a->GetSpellInfo()->Effects[0].Amplitude)) + 1;
|
||||
int32 dmg = (ticks * dmgPerTick) / count;
|
||||
caster->CastCustomSpell(GetTarget(), 72373, nullptr, &dmg, nullptr, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_hor_shared_sufferingAuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_hor_shared_sufferingAuraScript();
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL) // dispelled
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Map* map = caster->FindMap())
|
||||
if (Aura* a = aurEff->GetBase())
|
||||
{
|
||||
uint32 count = 0;
|
||||
uint32 ticks = 0;
|
||||
uint32 dmgPerTick = a->GetSpellInfo()->Effects[0].BasePoints;
|
||||
Map::PlayerList const& pl = map->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
|
||||
if (Player* p = itr->GetSource())
|
||||
if (p->IsAlive())
|
||||
++count;
|
||||
ticks = (a->GetDuration() / int32(a->GetSpellInfo()->Effects[0].Amplitude)) + 1;
|
||||
int32 dmg = (ticks * dmgPerTick) / count;
|
||||
caster->CastCustomSpell(GetTarget(), SPELL_SHARED_SUFFERING_DAMAGE, nullptr, &dmg, nullptr, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_hor_shared_suffering_aura::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_marwyn()
|
||||
{
|
||||
new boss_marwyn();
|
||||
new spell_hor_shared_suffering();
|
||||
RegisterSpellScript(spell_hor_shared_suffering_aura);
|
||||
}
|
||||
|
||||
@@ -2315,34 +2315,33 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hor_gunship_cannon_fire : public SpellScriptLoader
|
||||
enum GunshipCannonFire
|
||||
{
|
||||
public:
|
||||
spell_hor_gunship_cannon_fire() : SpellScriptLoader("spell_hor_gunship_cannon_fire") { }
|
||||
SPELL_GUNSHIP_CANNON_FIRE = 70021
|
||||
};
|
||||
|
||||
class spell_hor_gunship_cannon_fireAuraScript : public AuraScript
|
||||
class spell_hor_gunship_cannon_fire_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hor_gunship_cannon_fire_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_hor_gunship_cannon_fireAuraScript)
|
||||
return ValidateSpellInfo({ SPELL_GUNSHIP_CANNON_FIRE });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Creature* c = caster->SummonCreature(WORLD_TRIGGER, CannonFirePos[caster->GetEntry() == NPC_JAINA_PART2 ? 0 : 1][urand(0, 2)], TEMPSUMMON_TIMED_DESPAWN, 1))
|
||||
{
|
||||
c->CastSpell((Unit*)nullptr, 70021, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hor_gunship_cannon_fireAuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
return new spell_hor_gunship_cannon_fireAuraScript();
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Creature* creature = caster->SummonCreature(WORLD_TRIGGER, CannonFirePos[caster->GetEntry() == NPC_JAINA_PART2 ? 0 : 1][urand(0, 2)], TEMPSUMMON_TIMED_DESPAWN, 1))
|
||||
{
|
||||
creature->CastSpell((Unit*)nullptr, SPELL_GUNSHIP_CANNON_FIRE, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hor_gunship_cannon_fire_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2403,7 +2402,7 @@ void AddSC_halls_of_reflection()
|
||||
new npc_hor_raging_ghoul();
|
||||
new npc_hor_risen_witch_doctor();
|
||||
new npc_hor_lumbering_abomination();
|
||||
new spell_hor_gunship_cannon_fire();
|
||||
RegisterSpellScript(spell_hor_gunship_cannon_fire_aura);
|
||||
|
||||
new at_hor_battered_hilt_start();
|
||||
new at_hor_battered_hilt_throw();
|
||||
|
||||
@@ -299,78 +299,67 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_garfrost_permafrost : public SpellScriptLoader
|
||||
class spell_garfrost_permafrost : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_garfrost_permafrost() : SpellScriptLoader("spell_garfrost_permafrost") { }
|
||||
PrepareSpellScript(spell_garfrost_permafrost);
|
||||
|
||||
class spell_garfrost_permafrost_SpellScript : public SpellScript
|
||||
std::list<WorldObject*> targetList;
|
||||
|
||||
void Unload() override
|
||||
{
|
||||
PrepareSpellScript(spell_garfrost_permafrost_SpellScript);
|
||||
targetList.clear();
|
||||
}
|
||||
|
||||
std::list<WorldObject*> targetList;
|
||||
|
||||
void Unload() override
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
targetList.clear();
|
||||
}
|
||||
std::list<GameObject*> blockList;
|
||||
caster->GetGameObjectListWithEntryInGrid(blockList, GO_SARONITE_ROCK, 100.0f);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (!blockList.empty())
|
||||
{
|
||||
std::list<GameObject*> blockList;
|
||||
caster->GetGameObjectListWithEntryInGrid(blockList, GO_SARONITE_ROCK, 100.0f);
|
||||
|
||||
if (!blockList.empty())
|
||||
{
|
||||
for (std::list<WorldObject*>::iterator itrU = targets.begin(); itrU != targets.end(); ++itrU)
|
||||
if (WorldObject* target = (*itrU))
|
||||
for (std::list<WorldObject*>::iterator itrU = targets.begin(); itrU != targets.end(); ++itrU)
|
||||
if (WorldObject* target = (*itrU))
|
||||
{
|
||||
bool valid = true;
|
||||
if (!caster->IsWithinMeleeRange(target->ToUnit()))
|
||||
for (std::list<GameObject*>::const_iterator itr = blockList.begin(); itr != blockList.end(); ++itr)
|
||||
if (!(*itr)->IsInvisibleDueToDespawn())
|
||||
if ((*itr)->IsInBetween(caster, target, 4.0f))
|
||||
{
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
if (valid)
|
||||
{
|
||||
bool valid = true;
|
||||
if (!caster->IsWithinMeleeRange(target->ToUnit()))
|
||||
for (std::list<GameObject*>::const_iterator itr = blockList.begin(); itr != blockList.end(); ++itr)
|
||||
if (!(*itr)->IsInvisibleDueToDespawn())
|
||||
if ((*itr)->IsInBetween(caster, target, 4.0f))
|
||||
{
|
||||
valid = false;
|
||||
break;
|
||||
}
|
||||
if (valid)
|
||||
{
|
||||
if (Aura* aur = target->ToUnit()->GetAura(70336))
|
||||
if (aur->GetStackAmount() >= 10 && caster->GetTypeId() == TYPEID_UNIT)
|
||||
caster->ToCreature()->AI()->SetData(1, aur->GetStackAmount());
|
||||
targetList.push_back(*itrU);
|
||||
}
|
||||
if (Aura* aur = target->ToUnit()->GetAura(70336))
|
||||
if (aur->GetStackAmount() >= 10 && caster->GetTypeId() == TYPEID_UNIT)
|
||||
caster->ToCreature()->AI()->SetData(1, aur->GetStackAmount());
|
||||
targetList.push_back(*itrU);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
targetList = targets;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
targetList = targets;
|
||||
return;
|
||||
}
|
||||
|
||||
targets = targetList;
|
||||
}
|
||||
|
||||
void FilterTargetsNext(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets = targetList;
|
||||
}
|
||||
targets = targetList;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_garfrost_permafrost_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_garfrost_permafrost_SpellScript::FilterTargetsNext, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_garfrost_permafrost_SpellScript::FilterTargetsNext, EFFECT_2, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void FilterTargetsNext(std::list<WorldObject*>& targets)
|
||||
{
|
||||
return new spell_garfrost_permafrost_SpellScript();
|
||||
targets = targetList;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_garfrost_permafrost::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_garfrost_permafrost::FilterTargetsNext, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_garfrost_permafrost::FilterTargetsNext, EFFECT_2, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -378,6 +367,6 @@ void AddSC_boss_garfrost()
|
||||
{
|
||||
new boss_garfrost();
|
||||
|
||||
new spell_garfrost_permafrost();
|
||||
RegisterSpellScript(spell_garfrost_permafrost);
|
||||
}
|
||||
|
||||
|
||||
@@ -458,74 +458,62 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_krick_explosive_barrage : public SpellScriptLoader
|
||||
class spell_krick_explosive_barrage_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_krick_explosive_barrage() : SpellScriptLoader("spell_krick_explosive_barrage") { }
|
||||
PrepareAuraScript(spell_krick_explosive_barrage_aura);
|
||||
|
||||
class spell_krick_explosive_barrage_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_krick_explosive_barrage_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_EXPLOSIVE_BARRAGE_SUMMON });
|
||||
}
|
||||
|
||||
void HandlePeriodicTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
if (caster->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
Map::PlayerList const& players = caster->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
if (player->IsWithinDist(caster, 100.0f))
|
||||
caster->CastSpell(player, SPELL_EXPLOSIVE_BARRAGE_SUMMON, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_krick_explosive_barrage_AuraScript::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandlePeriodicTick(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
return new spell_krick_explosive_barrage_AuraScript();
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
if (caster->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
Map::PlayerList const& players = caster->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
if (player->IsWithinDist(caster, 100.0f))
|
||||
caster->CastSpell(player, SPELL_EXPLOSIVE_BARRAGE_SUMMON, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_krick_explosive_barrage_aura::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_exploding_orb_auto_grow : public SpellScriptLoader
|
||||
class spell_exploding_orb_auto_grow_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_exploding_orb_auto_grow() : SpellScriptLoader("spell_exploding_orb_auto_grow") { }
|
||||
PrepareAuraScript(spell_exploding_orb_auto_grow_aura);
|
||||
|
||||
class spell_exploding_orb_auto_grow_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_exploding_orb_auto_grow_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_EXPLOSIVE_BARRAGE_DAMAGE, SPELL_HASTY_GROW, SPELL_AUTO_GROW, SPELL_EXPLODING_ORB_VISUAL });
|
||||
}
|
||||
|
||||
void HandlePeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
if (aurEff->GetTickNumber() >= 16)
|
||||
if (Unit* target = GetTarget())
|
||||
{
|
||||
PreventDefaultAction();
|
||||
target->CastSpell(target, SPELL_EXPLOSIVE_BARRAGE_DAMAGE, false);
|
||||
target->RemoveAurasDueToSpell(SPELL_HASTY_GROW);
|
||||
target->RemoveAurasDueToSpell(SPELL_AUTO_GROW);
|
||||
target->RemoveAurasDueToSpell(SPELL_EXPLODING_ORB_VISUAL);
|
||||
if (target->GetTypeId() == TYPEID_UNIT)
|
||||
target->ToCreature()->DespawnOrUnsummon(2000);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_exploding_orb_auto_grow_AuraScript::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandlePeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
return new spell_exploding_orb_auto_grow_AuraScript();
|
||||
if (aurEff->GetTickNumber() >= 16)
|
||||
if (Unit* target = GetTarget())
|
||||
{
|
||||
PreventDefaultAction();
|
||||
target->CastSpell(target, SPELL_EXPLOSIVE_BARRAGE_DAMAGE, false);
|
||||
target->RemoveAurasDueToSpell(SPELL_HASTY_GROW);
|
||||
target->RemoveAurasDueToSpell(SPELL_AUTO_GROW);
|
||||
target->RemoveAurasDueToSpell(SPELL_EXPLODING_ORB_VISUAL);
|
||||
if (target->GetTypeId() == TYPEID_UNIT)
|
||||
target->ToCreature()->DespawnOrUnsummon(2000);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_exploding_orb_auto_grow_aura::HandlePeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -534,7 +522,7 @@ void AddSC_boss_ick()
|
||||
new boss_ick();
|
||||
new boss_krick();
|
||||
|
||||
new spell_krick_explosive_barrage();
|
||||
new spell_exploding_orb_auto_grow();
|
||||
RegisterSpellScript(spell_krick_explosive_barrage_aura);
|
||||
RegisterSpellScript(spell_exploding_orb_auto_grow_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -1301,31 +1301,30 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pos_empowered_blizzard : public SpellScriptLoader
|
||||
enum EmpoweredBlizzard
|
||||
{
|
||||
public:
|
||||
spell_pos_empowered_blizzard() : SpellScriptLoader("spell_pos_empowered_blizzard") { }
|
||||
SPELL_EMPOWERED_BLIZZARD = 70131
|
||||
};
|
||||
|
||||
class spell_pos_empowered_blizzardAuraScript : public AuraScript
|
||||
class spell_pos_empowered_blizzard_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pos_empowered_blizzard_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_pos_empowered_blizzardAuraScript)
|
||||
return ValidateSpellInfo({ SPELL_EMPOWERED_BLIZZARD });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell((float)urand(447, 480), (float)urand(200, 235), 528.71f, 70131, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_pos_empowered_blizzardAuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
return new spell_pos_empowered_blizzardAuraScript();
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell((float)urand(447, 480), (float)urand(200, 235), 528.71f, SPELL_EMPOWERED_BLIZZARD, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_pos_empowered_blizzard_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1364,138 +1363,99 @@ private:
|
||||
Creature& _owner;
|
||||
};
|
||||
|
||||
class spell_pos_slave_trigger_closest : public SpellScriptLoader
|
||||
class spell_pos_slave_trigger_closest : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_pos_slave_trigger_closest() : SpellScriptLoader("spell_pos_slave_trigger_closest") { }
|
||||
PrepareSpellScript(spell_pos_slave_trigger_closest);
|
||||
|
||||
class spell_pos_slave_trigger_closestSpellScript : public SpellScript
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_pos_slave_trigger_closestSpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (target->GetUInt32Value(UNIT_NPC_EMOTESTATE)) // prevent using multiple times
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Player* p = caster->ToPlayer())
|
||||
{
|
||||
p->RewardPlayerAndGroupAtEvent(36764, caster); // alliance
|
||||
p->RewardPlayerAndGroupAtEvent(36770, caster); // horde
|
||||
|
||||
target->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
|
||||
if (Creature* c = target->ToCreature())
|
||||
{
|
||||
c->DespawnOrUnsummon(7000);
|
||||
c->AI()->Talk(0, p);
|
||||
c->m_Events.AddEvent(new SlaveRunEvent(*c), c->m_Events.CalculateTime(3000));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pos_slave_trigger_closestSpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_pos_slave_trigger_closestSpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pos_rimefang_frost_nova : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_pos_rimefang_frost_nova() : SpellScriptLoader("spell_pos_rimefang_frost_nova") { }
|
||||
|
||||
class spell_pos_rimefang_frost_novaSpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_pos_rimefang_frost_novaSpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (target->GetUInt32Value(UNIT_NPC_EMOTESTATE)) // prevent using multiple times
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
Unit::Kill(caster, target);
|
||||
if (target->GetTypeId() == TYPEID_UNIT)
|
||||
target->ToCreature()->DespawnOrUnsummon(30000);
|
||||
}
|
||||
}
|
||||
if (Player* p = caster->ToPlayer())
|
||||
{
|
||||
p->RewardPlayerAndGroupAtEvent(36764, caster); // alliance
|
||||
p->RewardPlayerAndGroupAtEvent(36770, caster); // horde
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pos_rimefang_frost_novaSpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
target->SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
|
||||
if (Creature* c = target->ToCreature())
|
||||
{
|
||||
c->DespawnOrUnsummon(7000);
|
||||
c->AI()->Talk(0, p);
|
||||
c->m_Events.AddEvent(new SlaveRunEvent(*c), c->m_Events.CalculateTime(3000));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_pos_rimefang_frost_novaSpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pos_slave_trigger_closest::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pos_blight : public SpellScriptLoader
|
||||
class spell_pos_rimefang_frost_nova : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_pos_blight() : SpellScriptLoader("spell_pos_blight") { }
|
||||
PrepareSpellScript(spell_pos_rimefang_frost_nova);
|
||||
|
||||
class spell_pos_blightAuraScript : public AuraScript
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareAuraScript(spell_pos_blightAuraScript)
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
Unit::Kill(caster, target);
|
||||
if (target->GetTypeId() == TYPEID_UNIT)
|
||||
target->ToCreature()->DespawnOrUnsummon(30000);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (aurEff->GetTotalTicks() >= 0 && aurEff->GetTickNumber() == uint32(aurEff->GetTotalTicks()))
|
||||
if (Unit* target = GetTarget())
|
||||
target->CastSpell(target, 69604, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_pos_blightAuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_pos_blightAuraScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pos_rimefang_frost_nova::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pos_glacial_strike : public SpellScriptLoader
|
||||
class spell_pos_blight_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_pos_glacial_strike() : SpellScriptLoader("spell_pos_glacial_strike") { }
|
||||
PrepareAuraScript(spell_pos_blight_aura);
|
||||
|
||||
class spell_pos_glacial_strikeAuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_pos_glacial_strikeAuraScript)
|
||||
return ValidateSpellInfo({ 69604 });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (aurEff->GetTotalTicks() >= 0 && aurEff->GetTickNumber() == uint32(aurEff->GetTotalTicks()))
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetHealth() == target->GetMaxHealth())
|
||||
{
|
||||
PreventDefaultAction();
|
||||
aurEff->GetBase()->Remove(AURA_REMOVE_BY_EXPIRE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
target->CastSpell(target, 69604, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_pos_glacial_strikeAuraScript::HandleEffectPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE_PERCENT);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_pos_glacial_strikeAuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_pos_blight_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_pos_glacial_strike_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pos_glacial_strike_aura);
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetHealth() == target->GetMaxHealth())
|
||||
{
|
||||
PreventDefaultAction();
|
||||
aurEff->GetBase()->Remove(AURA_REMOVE_BY_EXPIRE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_pos_glacial_strike_aura::HandleEffectPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE_PERCENT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1537,11 +1497,11 @@ void AddSC_pit_of_saron()
|
||||
new npc_pos_freed_slave();
|
||||
new npc_pos_leader_second();
|
||||
|
||||
new spell_pos_empowered_blizzard();
|
||||
new spell_pos_slave_trigger_closest();
|
||||
new spell_pos_rimefang_frost_nova();
|
||||
new spell_pos_blight();
|
||||
new spell_pos_glacial_strike();
|
||||
RegisterSpellScript(spell_pos_empowered_blizzard_aura);
|
||||
RegisterSpellScript(spell_pos_slave_trigger_closest);
|
||||
RegisterSpellScript(spell_pos_rimefang_frost_nova);
|
||||
RegisterSpellScript(spell_pos_blight_aura);
|
||||
RegisterSpellScript(spell_pos_glacial_strike_aura);
|
||||
|
||||
new at_tyrannus_event_starter();
|
||||
}
|
||||
|
||||
@@ -406,86 +406,63 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_drakkari_colossus_emerge : public SpellScriptLoader
|
||||
class spell_drakkari_colossus_emerge : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_drakkari_colossus_emerge() : SpellScriptLoader("spell_drakkari_colossus_emerge") { }
|
||||
PrepareSpellScript(spell_drakkari_colossus_emerge);
|
||||
|
||||
class spell_drakkari_colossus_emerge_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_drakkari_colossus_emerge_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_FREEZE_ANIM });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_FREEZE_ANIM, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_drakkari_colossus_emerge_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_drakkari_colossus_emerge_SpellScript();
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_FREEZE_ANIM, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_drakkari_colossus_emerge::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_drakkari_colossus_surge : public SpellScriptLoader
|
||||
class spell_drakkari_colossus_surge : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_drakkari_colossus_surge() : SpellScriptLoader("spell_drakkari_colossus_surge") { }
|
||||
PrepareSpellScript(spell_drakkari_colossus_surge);
|
||||
|
||||
class spell_drakkari_colossus_surge_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_drakkari_colossus_surge_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_SURGE_DAMAGE });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target, SPELL_SURGE_DAMAGE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_drakkari_colossus_surge_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_drakkari_colossus_surge_SpellScript();
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target, SPELL_SURGE_DAMAGE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_drakkari_colossus_surge::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_drakkari_colossus_face_me : public SpellScriptLoader
|
||||
class spell_drakkari_colossus_face_me : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_drakkari_colossus_face_me() : SpellScriptLoader("spell_drakkari_colossus_face_me") { }
|
||||
PrepareSpellScript(spell_drakkari_colossus_face_me);
|
||||
|
||||
class spell_drakkari_colossus_face_me_SpellScript : public SpellScript
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_drakkari_colossus_face_me_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
GetCaster()->SetInFront(target);
|
||||
GetCaster()->SetFacingTo(GetCaster()->GetAngle(target));
|
||||
}
|
||||
GetCaster()->SetInFront(target);
|
||||
GetCaster()->SetFacingTo(GetCaster()->GetAngle(target));
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_drakkari_colossus_face_me_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_drakkari_colossus_face_me_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_drakkari_colossus_face_me::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -494,8 +471,8 @@ void AddSC_boss_drakkari_colossus()
|
||||
new boss_drakkari_colossus();
|
||||
new boss_drakkari_elemental();
|
||||
new npc_living_mojo();
|
||||
new spell_drakkari_colossus_emerge();
|
||||
new spell_drakkari_colossus_surge();
|
||||
new spell_drakkari_colossus_face_me();
|
||||
RegisterSpellScript(spell_drakkari_colossus_emerge);
|
||||
RegisterSpellScript(spell_drakkari_colossus_surge);
|
||||
RegisterSpellScript(spell_drakkari_colossus_face_me);
|
||||
}
|
||||
|
||||
|
||||
@@ -219,57 +219,45 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_galdarah_impaling_charge : public SpellScriptLoader
|
||||
class spell_galdarah_impaling_charge : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_galdarah_impaling_charge() : SpellScriptLoader("spell_galdarah_impaling_charge") { }
|
||||
PrepareSpellScript(spell_galdarah_impaling_charge);
|
||||
|
||||
class spell_galdarah_impaling_charge_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_galdarah_impaling_charge_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_IMPALING_CHARGE_VEHICLE });
|
||||
}
|
||||
|
||||
void HandleApplyAura(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), SPELL_IMPALING_CHARGE_VEHICLE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_galdarah_impaling_charge_SpellScript::HandleApplyAura, EFFECT_1, SPELL_EFFECT_APPLY_AURA);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleApplyAura(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_galdarah_impaling_charge_SpellScript();
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), SPELL_IMPALING_CHARGE_VEHICLE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_galdarah_impaling_charge::HandleApplyAura, EFFECT_1, SPELL_EFFECT_APPLY_AURA);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_galdarah_transform : public SpellScriptLoader
|
||||
class spell_galdarah_transform : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_galdarah_transform() : SpellScriptLoader("spell_galdarah_transform") { }
|
||||
PrepareSpellScript(spell_galdarah_transform);
|
||||
|
||||
class spell_galdarah_transform_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_galdarah_transform_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_TRANSFORM_TO_RHINO });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->RemoveAurasDueToSpell(SPELL_TRANSFORM_TO_RHINO);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_galdarah_transform_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_galdarah_transform_SpellScript();
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->RemoveAurasDueToSpell(SPELL_TRANSFORM_TO_RHINO);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_galdarah_transform::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -292,7 +280,7 @@ public:
|
||||
void AddSC_boss_gal_darah()
|
||||
{
|
||||
new boss_gal_darah();
|
||||
new spell_galdarah_impaling_charge();
|
||||
new spell_galdarah_transform();
|
||||
RegisterSpellScript(spell_galdarah_impaling_charge);
|
||||
RegisterSpellScript(spell_galdarah_transform);
|
||||
new achievement_share_the_love();
|
||||
}
|
||||
|
||||
@@ -170,34 +170,23 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_moorabi_mojo_frenzy : public SpellScriptLoader
|
||||
class spell_moorabi_mojo_frenzy_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_moorabi_mojo_frenzy() : SpellScriptLoader("spell_moorabi_mojo_frenzy") { }
|
||||
PrepareAuraScript(spell_moorabi_mojo_frenzy_aura);
|
||||
|
||||
class spell_moorabi_mojo_frenzy_AuraScript : public AuraScript
|
||||
void HandlePeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PrepareAuraScript(spell_moorabi_mojo_frenzy_AuraScript);
|
||||
PreventDefaultAction();
|
||||
|
||||
void HandlePeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (GetUnitOwner()->GetMap()->IsHeroic())
|
||||
GetUnitOwner()->SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f * (GetUnitOwner()->GetHealthPct()*GetUnitOwner()->GetHealthPct() / 10000.0f));
|
||||
else
|
||||
GetUnitOwner()->SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f * (GetUnitOwner()->GetHealthPct() / 100.0f));
|
||||
}
|
||||
|
||||
if (GetUnitOwner()->GetMap()->IsHeroic())
|
||||
GetUnitOwner()->SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f * (GetUnitOwner()->GetHealthPct()*GetUnitOwner()->GetHealthPct() / 10000.0f));
|
||||
else
|
||||
GetUnitOwner()->SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f * (GetUnitOwner()->GetHealthPct() / 100.0f));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_moorabi_mojo_frenzy_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_moorabi_mojo_frenzy_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_moorabi_mojo_frenzy_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -217,6 +206,6 @@ public:
|
||||
void AddSC_boss_moorabi()
|
||||
{
|
||||
new boss_moorabi();
|
||||
new spell_moorabi_mojo_frenzy();
|
||||
RegisterSpellScript(spell_moorabi_mojo_frenzy_aura);
|
||||
new achievement_less_rabi();
|
||||
}
|
||||
|
||||
@@ -200,34 +200,28 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_sladran_grip_of_sladran : public SpellScriptLoader
|
||||
class spell_sladran_grip_of_sladran_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_sladran_grip_of_sladran() : SpellScriptLoader("spell_sladran_grip_of_sladran") { }
|
||||
PrepareAuraScript(spell_sladran_grip_of_sladran_aura);
|
||||
|
||||
class spell_sladran_grip_of_sladran_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_sladran_grip_of_sladran_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_SNAKE_WRAP });
|
||||
}
|
||||
|
||||
void HandlePeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (GetStackAmount() >= 5)
|
||||
{
|
||||
SetDuration(0);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SNAKE_WRAP, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sladran_grip_of_sladran_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandlePeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
return new spell_sladran_grip_of_sladran_AuraScript();
|
||||
PreventDefaultAction();
|
||||
if (GetStackAmount() >= 5)
|
||||
{
|
||||
SetDuration(0);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SNAKE_WRAP, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sladran_grip_of_sladran_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -250,6 +244,6 @@ public:
|
||||
void AddSC_boss_slad_ran()
|
||||
{
|
||||
new boss_slad_ran();
|
||||
new spell_sladran_grip_of_sladran();
|
||||
RegisterSpellScript(spell_sladran_grip_of_sladran_aura);
|
||||
new achievement_snakes_whyd_it_have_to_be_snakes();
|
||||
}
|
||||
|
||||
@@ -1877,6 +1877,9 @@ public:
|
||||
case EVENT_FESTERGUT_VALVE_USED:
|
||||
if (!(PutricideEventProgress & PUTRICIDE_EVENT_FLAG_FESTERGUT_VALVE))
|
||||
{
|
||||
if (GameObject* goGas = instance->GetGameObject(GasReleaseValveGUID))
|
||||
goGas->SetGameObjectFlag(GO_FLAG_INTERACT_COND | GO_FLAG_NOT_SELECTABLE);
|
||||
|
||||
PutricideEventProgress |= PUTRICIDE_EVENT_FLAG_FESTERGUT_VALVE;
|
||||
if (PutricideEventProgress & PUTRICIDE_EVENT_FLAG_ROTFACE_VALVE)
|
||||
{
|
||||
@@ -1894,6 +1897,9 @@ public:
|
||||
case EVENT_ROTFACE_VALVE_USED:
|
||||
if (!(PutricideEventProgress & PUTRICIDE_EVENT_FLAG_ROTFACE_VALVE))
|
||||
{
|
||||
if (GameObject* goOoze = instance->GetGameObject(OozeReleaseValveGUID))
|
||||
goOoze->SetGameObjectFlag(GO_FLAG_INTERACT_COND | GO_FLAG_NOT_SELECTABLE);
|
||||
|
||||
PutricideEventProgress |= PUTRICIDE_EVENT_FLAG_ROTFACE_VALVE;
|
||||
if (PutricideEventProgress & PUTRICIDE_EVENT_FLAG_FESTERGUT_VALVE)
|
||||
{
|
||||
|
||||
@@ -1488,59 +1488,48 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_eoe_ph3_surge_of_power : public SpellScriptLoader
|
||||
class spell_eoe_ph3_surge_of_power : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_eoe_ph3_surge_of_power() : SpellScriptLoader("spell_eoe_ph3_surge_of_power") { }
|
||||
PrepareSpellScript(spell_eoe_ph3_surge_of_power);
|
||||
|
||||
class spell_eoe_ph3_surge_of_power_SpellScript : public SpellScript
|
||||
ObjectGuid DrakeGUID[3];
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
PrepareSpellScript(spell_eoe_ph3_surge_of_power_SpellScript);
|
||||
|
||||
ObjectGuid DrakeGUID[3];
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Creature* c = caster->ToCreature())
|
||||
{
|
||||
uint8 i = 0;
|
||||
std::list<Unit*> drakes;
|
||||
c->AI()->SelectTargetList(drakes, (c->GetMap()->GetSpawnMode() == 0 ? 1 : 3), SelectTargetMethod::Random, 0, 0.0f, false, true, 57403 /*only drakes have this aura*/);
|
||||
for (std::list<Unit*>::iterator itr = drakes.begin(); itr != drakes.end() && i < 3; ++itr)
|
||||
{
|
||||
DrakeGUID[i++] = (*itr)->GetGUID();
|
||||
if (Vehicle* v = (*itr)->GetVehicleKit())
|
||||
if (Unit* p = v->GetPassenger(0))
|
||||
if (Player* plr = p->ToPlayer())
|
||||
c->AI()->Talk(EMOTE_SURGE_OF_POWER_WARNING_P3, plr);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Creature* c = caster->ToCreature())
|
||||
{
|
||||
targets.clear();
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
if (DrakeGUID[i])
|
||||
if (Unit* u = ObjectAccessor::GetUnit(*caster, DrakeGUID[i]))
|
||||
targets.push_back(u);
|
||||
uint8 i = 0;
|
||||
std::list<Unit*> drakes;
|
||||
c->AI()->SelectTargetList(drakes, (c->GetMap()->GetSpawnMode() == 0 ? 1 : 3), SelectTargetMethod::Random, 0, 0.0f, false, true, 57403 /*only drakes have this aura*/);
|
||||
for (std::list<Unit*>::iterator itr = drakes.begin(); itr != drakes.end() && i < 3; ++itr)
|
||||
{
|
||||
DrakeGUID[i++] = (*itr)->GetGUID();
|
||||
if (Vehicle* v = (*itr)->GetVehicleKit())
|
||||
if (Unit* p = v->GetPassenger(0))
|
||||
if (Player* plr = p->ToPlayer())
|
||||
c->AI()->Talk(EMOTE_SURGE_OF_POWER_WARNING_P3, plr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eoe_ph3_surge_of_power_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
return true;
|
||||
}
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
return new spell_eoe_ph3_surge_of_power_SpellScript();
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
targets.clear();
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
if (DrakeGUID[i])
|
||||
if (Unit* u = ObjectAccessor::GetUnit(*caster, DrakeGUID[i]))
|
||||
targets.push_back(u);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_eoe_ph3_surge_of_power::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1556,5 +1545,5 @@ void AddSC_boss_malygos()
|
||||
new npc_hover_disk();
|
||||
new npc_eoe_wyrmrest_skytalon();
|
||||
|
||||
new spell_eoe_ph3_surge_of_power();
|
||||
RegisterSpellScript(spell_eoe_ph3_surge_of_power);
|
||||
}
|
||||
|
||||
@@ -230,99 +230,82 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_boss_magus_telestra_summon_telestra_clones : public SpellScriptLoader
|
||||
class spell_boss_magus_telestra_summon_telestra_clones_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_boss_magus_telestra_summon_telestra_clones() : SpellScriptLoader("spell_boss_magus_telestra_summon_telestra_clones") { }
|
||||
PrepareAuraScript(spell_boss_magus_telestra_summon_telestra_clones_aura);
|
||||
|
||||
class spell_boss_magus_telestra_summon_telestra_clones_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_boss_magus_telestra_summon_telestra_clones_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_FIRE_MAGUS_SUMMON, SPELL_FROST_MAGUS_SUMMON, SPELL_ARCANE_MAGUS_SUMMON });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_FIRE_MAGUS_SUMMON, true);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_FROST_MAGUS_SUMMON, true);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_ARCANE_MAGUS_SUMMON, true);
|
||||
|
||||
GetUnitOwner()->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
GetUnitOwner()->SetControlled(true, UNIT_STATE_STUNNED);
|
||||
GetUnitOwner()->ToCreature()->LoadEquipment(0, true);
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
GetUnitOwner()->SetControlled(false, UNIT_STATE_STUNNED);
|
||||
GetUnitOwner()->ToCreature()->LoadEquipment(1, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_boss_magus_telestra_summon_telestra_clones_AuraScript::HandleApply, EFFECT_1, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_boss_magus_telestra_summon_telestra_clones_AuraScript::HandleRemove, EFFECT_1, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
bool Load() override
|
||||
{
|
||||
return new spell_boss_magus_telestra_summon_telestra_clones_AuraScript();
|
||||
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_FIRE_MAGUS_SUMMON, true);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_FROST_MAGUS_SUMMON, true);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_ARCANE_MAGUS_SUMMON, true);
|
||||
|
||||
GetUnitOwner()->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
GetUnitOwner()->SetControlled(true, UNIT_STATE_STUNNED);
|
||||
GetUnitOwner()->ToCreature()->LoadEquipment(0, true);
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
|
||||
GetUnitOwner()->SetControlled(false, UNIT_STATE_STUNNED);
|
||||
GetUnitOwner()->ToCreature()->LoadEquipment(1, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_boss_magus_telestra_summon_telestra_clones_aura::HandleApply, EFFECT_1, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_boss_magus_telestra_summon_telestra_clones_aura::HandleRemove, EFFECT_1, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_boss_magus_telestra_gravity_well : public SpellScriptLoader
|
||||
class spell_boss_magus_telestra_gravity_well : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_boss_magus_telestra_gravity_well() : SpellScriptLoader("spell_boss_magus_telestra_gravity_well") { }
|
||||
PrepareSpellScript(spell_boss_magus_telestra_gravity_well);
|
||||
|
||||
class spell_boss_magus_telestra_gravity_well_SpellScript : public SpellScript
|
||||
void SelectTarget(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_boss_magus_telestra_gravity_well_SpellScript);
|
||||
targets.remove_if(Acore::RandomCheck(50));
|
||||
}
|
||||
|
||||
void SelectTarget(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Acore::RandomCheck(50));
|
||||
}
|
||||
|
||||
void HandlePull(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
Unit* target = GetHitUnit();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
Position pos;
|
||||
if (target->GetDistance(GetCaster()) < 5.0f)
|
||||
{
|
||||
pos.Relocate(GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ() + 1.0f);
|
||||
float o = frand(0, 2 * M_PI);
|
||||
target->MovePositionToFirstCollision(pos, 20.0f, o);
|
||||
pos.m_positionZ += frand(5.0f, 15.0f);
|
||||
}
|
||||
else
|
||||
pos.Relocate(GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ() + 1.0f);
|
||||
|
||||
float speedXY = float(GetSpellInfo()->Effects[effIndex].MiscValue) * 0.1f;
|
||||
float speedZ = target->GetDistance(pos) / speedXY * 0.5f * Movement::gravity;
|
||||
|
||||
target->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_boss_magus_telestra_gravity_well_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_boss_magus_telestra_gravity_well_SpellScript::HandlePull, EFFECT_0, SPELL_EFFECT_PULL_TOWARDS_DEST);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandlePull(SpellEffIndex effIndex)
|
||||
{
|
||||
return new spell_boss_magus_telestra_gravity_well_SpellScript();
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
Unit* target = GetHitUnit();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
Position pos;
|
||||
if (target->GetDistance(GetCaster()) < 5.0f)
|
||||
{
|
||||
pos.Relocate(GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ() + 1.0f);
|
||||
float o = frand(0, 2 * M_PI);
|
||||
target->MovePositionToFirstCollision(pos, 20.0f, o);
|
||||
pos.m_positionZ += frand(5.0f, 15.0f);
|
||||
}
|
||||
else
|
||||
pos.Relocate(GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), GetCaster()->GetPositionZ() + 1.0f);
|
||||
|
||||
float speedXY = float(GetSpellInfo()->Effects[effIndex].MiscValue) * 0.1f;
|
||||
float speedZ = target->GetDistance(pos) / speedXY * 0.5f * Movement::gravity;
|
||||
|
||||
target->GetMotionMaster()->MoveJump(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), speedXY, speedZ);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_boss_magus_telestra_gravity_well::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_boss_magus_telestra_gravity_well::HandlePull, EFFECT_0, SPELL_EFFECT_PULL_TOWARDS_DEST);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -345,7 +328,7 @@ public:
|
||||
void AddSC_boss_magus_telestra()
|
||||
{
|
||||
new boss_magus_telestra();
|
||||
new spell_boss_magus_telestra_summon_telestra_clones();
|
||||
new spell_boss_magus_telestra_gravity_well();
|
||||
RegisterSpellScript(spell_boss_magus_telestra_summon_telestra_clones_aura);
|
||||
RegisterSpellScript(spell_boss_magus_telestra_gravity_well);
|
||||
new achievement_split_personality();
|
||||
}
|
||||
|
||||
@@ -532,486 +532,374 @@ public:
|
||||
};
|
||||
|
||||
// 49838 - Stop Time
|
||||
class spell_oculus_stop_time : public SpellScriptLoader
|
||||
class spell_oculus_stop_time_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_oculus_stop_time() : SpellScriptLoader("spell_oculus_stop_time") { }
|
||||
PrepareAuraScript(spell_oculus_stop_time_aura);
|
||||
|
||||
class spell_oculus_stop_time_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_oculus_stop_time_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_AMBER_SHOCK_CHARGE });
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_AMBER_SHOCK_CHARGE });
|
||||
}
|
||||
|
||||
void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Unit* target = GetTarget();
|
||||
for (uint32 i = 0; i < 5; ++i)
|
||||
caster->CastSpell(target, SPELL_AMBER_SHOCK_CHARGE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_oculus_stop_time_AuraScript::Apply, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Apply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_oculus_stop_time_AuraScript();
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Unit* target = GetTarget();
|
||||
for (uint32 i = 0; i < 5; ++i)
|
||||
caster->CastSpell(target, SPELL_AMBER_SHOCK_CHARGE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_oculus_stop_time_aura::Apply, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
// 50240 - Evasive Maneuvers
|
||||
class spell_oculus_evasive_maneuvers : public SpellScriptLoader
|
||||
class spell_oculus_evasive_maneuvers_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_oculus_evasive_maneuvers() : SpellScriptLoader("spell_oculus_evasive_maneuvers") { }
|
||||
PrepareAuraScript(spell_oculus_evasive_maneuvers_aura);
|
||||
|
||||
class spell_oculus_evasive_maneuvers_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_oculus_evasive_maneuvers_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_RUBY_EVASIVE_CHARGES });
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_RUBY_EVASIVE_CHARGES });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->RemoveAuraFromStack(SPELL_RUBY_EVASIVE_CHARGES);
|
||||
if (!GetTarget()->HasAura(SPELL_RUBY_EVASIVE_CHARGES))
|
||||
SetDuration(0);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_oculus_evasive_maneuvers_AuraScript::HandleProc, EFFECT_2, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
return new spell_oculus_evasive_maneuvers_AuraScript();
|
||||
PreventDefaultAction();
|
||||
GetTarget()->RemoveAuraFromStack(SPELL_RUBY_EVASIVE_CHARGES);
|
||||
if (!GetTarget()->HasAura(SPELL_RUBY_EVASIVE_CHARGES))
|
||||
SetDuration(0);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_oculus_evasive_maneuvers_aura::HandleProc, EFFECT_2, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
// 49840 - Shock Lance
|
||||
class spell_oculus_shock_lance : public SpellScriptLoader
|
||||
class spell_oculus_shock_lance : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_oculus_shock_lance() : SpellScriptLoader("spell_oculus_shock_lance") { }
|
||||
PrepareSpellScript(spell_oculus_shock_lance);
|
||||
|
||||
class spell_oculus_shock_lance_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_oculus_shock_lance_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_AMBER_SHOCK_CHARGE });
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_AMBER_SHOCK_CHARGE });
|
||||
}
|
||||
|
||||
void CalcDamage()
|
||||
{
|
||||
int32 damage = GetHitDamage();
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (Aura* aura = target->GetAura(SPELL_AMBER_SHOCK_CHARGE, GetCaster()->GetGUID())) // shock charges from same caster
|
||||
{
|
||||
damage += aura->GetStackAmount() * 6525;
|
||||
aura->Remove();
|
||||
}
|
||||
|
||||
SetHitDamage(damage);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnHit += SpellHitFn(spell_oculus_shock_lance_SpellScript::CalcDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void CalcDamage()
|
||||
{
|
||||
return new spell_oculus_shock_lance_SpellScript();
|
||||
int32 damage = GetHitDamage();
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (Aura* aura = target->GetAura(SPELL_AMBER_SHOCK_CHARGE, GetCaster()->GetGUID())) // shock charges from same caster
|
||||
{
|
||||
damage += aura->GetStackAmount() * 6525;
|
||||
aura->Remove();
|
||||
}
|
||||
|
||||
SetHitDamage(damage);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnHit += SpellHitFn(spell_oculus_shock_lance::CalcDamage);
|
||||
}
|
||||
};
|
||||
|
||||
// 49592 - Temporal Rift
|
||||
class spell_oculus_temporal_rift : public SpellScriptLoader
|
||||
class spell_oculus_temporal_rift_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_oculus_temporal_rift() : SpellScriptLoader("spell_oculus_temporal_rift") { }
|
||||
PrepareAuraScript(spell_oculus_temporal_rift_aura);
|
||||
|
||||
class spell_oculus_temporal_rift_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_oculus_temporal_rift_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_AMBER_SHOCK_CHARGE });
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_AMBER_SHOCK_CHARGE });
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int32 amount = aurEff->GetAmount() + damageInfo->GetDamage();
|
||||
|
||||
uint8 num = amount / 15000;
|
||||
if (amount >= 15000)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
for (uint8 i = 0; i < num; ++i )
|
||||
caster->CastSpell(GetTarget(), SPELL_AMBER_SHOCK_CHARGE, true);
|
||||
}
|
||||
|
||||
const_cast<AuraEffect*>(aurEff)->SetAmount(amount - 15000 * num);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_oculus_temporal_rift_AuraScript::HandleProc, EFFECT_2, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
|
||||
{
|
||||
return new spell_oculus_temporal_rift_AuraScript();
|
||||
PreventDefaultAction();
|
||||
|
||||
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
|
||||
|
||||
if (!damageInfo || !damageInfo->GetDamage())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int32 amount = aurEff->GetAmount() + damageInfo->GetDamage();
|
||||
|
||||
uint8 num = amount / 15000;
|
||||
if (amount >= 15000)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
for (uint8 i = 0; i < num; ++i )
|
||||
caster->CastSpell(GetTarget(), SPELL_AMBER_SHOCK_CHARGE, true);
|
||||
}
|
||||
|
||||
const_cast<AuraEffect*>(aurEff)->SetAmount(amount - 15000 * num);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_oculus_temporal_rift_aura::HandleProc, EFFECT_2, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 50341 - Touch the Nightmare
|
||||
class spell_oculus_touch_the_nightmare : public SpellScriptLoader
|
||||
class spell_oculus_touch_the_nightmare : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_oculus_touch_the_nightmare() : SpellScriptLoader("spell_oculus_touch_the_nightmare") { }
|
||||
PrepareSpellScript(spell_oculus_touch_the_nightmare);
|
||||
|
||||
class spell_oculus_touch_the_nightmare_SpellScript : public SpellScript
|
||||
void HandleDamageCalc(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_oculus_touch_the_nightmare_SpellScript);
|
||||
SetHitDamage(int32(GetCaster()->CountPctFromMaxHealth(30)));
|
||||
}
|
||||
|
||||
void HandleDamageCalc(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
SetHitDamage(int32(GetCaster()->CountPctFromMaxHealth(30)));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_oculus_touch_the_nightmare_SpellScript::HandleDamageCalc, EFFECT_2, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_oculus_touch_the_nightmare_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_oculus_touch_the_nightmare::HandleDamageCalc, EFFECT_2, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
// 50344 - Dream Funnel
|
||||
class spell_oculus_dream_funnel : public SpellScriptLoader
|
||||
class spell_oculus_dream_funnel_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_oculus_dream_funnel() : SpellScriptLoader("spell_oculus_dream_funnel") { }
|
||||
PrepareAuraScript(spell_oculus_dream_funnel_aura);
|
||||
|
||||
class spell_oculus_dream_funnel_AuraScript : public AuraScript
|
||||
void HandleEffectCalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
|
||||
{
|
||||
PrepareAuraScript(spell_oculus_dream_funnel_AuraScript);
|
||||
if (Unit* caster = GetCaster())
|
||||
amount = int32(caster->CountPctFromMaxHealth(5));
|
||||
|
||||
void HandleEffectCalcAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
amount = int32(caster->CountPctFromMaxHealth(5));
|
||||
canBeRecalculated = false;
|
||||
}
|
||||
|
||||
canBeRecalculated = false;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_oculus_dream_funnel_AuraScript::HandleEffectCalcAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_oculus_dream_funnel_AuraScript::HandleEffectCalcAmount, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_oculus_dream_funnel_AuraScript();
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_oculus_dream_funnel_aura::HandleEffectCalcAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_oculus_dream_funnel_aura::HandleEffectCalcAmount, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_oculus_call_ruby_emerald_amber_drake : public SpellScriptLoader
|
||||
class spell_oculus_call_ruby_emerald_amber_drake : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_oculus_call_ruby_emerald_amber_drake() : SpellScriptLoader("spell_oculus_call_ruby_emerald_amber_drake") { }
|
||||
PrepareSpellScript(spell_oculus_call_ruby_emerald_amber_drake);
|
||||
|
||||
class spell_oculus_call_ruby_emerald_amber_drake_SpellScript : public SpellScript
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
PrepareSpellScript(spell_oculus_call_ruby_emerald_amber_drake_SpellScript);
|
||||
// Adjust effect summon position
|
||||
Position const offset = { 0.0f, 0.0f, 12.0f, 0.0f };
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
// Adjust effect summon position
|
||||
Position const offset = { 0.0f, 0.0f, 12.0f, 0.0f };
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_oculus_call_ruby_emerald_amber_drake_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_FRONT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_oculus_call_ruby_emerald_amber_drake_SpellScript();
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_oculus_call_ruby_emerald_amber_drake::SetDest, EFFECT_0, TARGET_DEST_CASTER_FRONT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_oculus_ride_ruby_emerald_amber_drake_que : public SpellScriptLoader
|
||||
class spell_oculus_ride_ruby_emerald_amber_drake_que_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_oculus_ride_ruby_emerald_amber_drake_que() : SpellScriptLoader("spell_oculus_ride_ruby_emerald_amber_drake_que") { }
|
||||
PrepareAuraScript(spell_oculus_ride_ruby_emerald_amber_drake_que_aura);
|
||||
|
||||
class spell_oculus_ride_ruby_emerald_amber_drake_que_AuraScript : public AuraScript
|
||||
void HandlePeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PrepareAuraScript(spell_oculus_ride_ruby_emerald_amber_drake_que_AuraScript);
|
||||
// caster of the triggered spell is wrong for an unknown reason, handle it here correctly
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
GetTarget()->CastSpell(caster, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void HandlePeriodic(AuraEffect const* aurEff)
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_oculus_ride_ruby_emerald_amber_drake_que_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_oculus_evasive_charges_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_oculus_evasive_charges_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_RUBY_EVASIVE_MANEUVERS });
|
||||
}
|
||||
|
||||
void HandleOnEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->ModifyAuraState(AURA_STATE_UNKNOWN22, true);
|
||||
}
|
||||
|
||||
void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
// caster of the triggered spell is wrong for an unknown reason, handle it here correctly
|
||||
caster->RemoveAurasDueToSpell(SPELL_RUBY_EVASIVE_MANEUVERS);
|
||||
caster->ModifyAuraState(AURA_STATE_UNKNOWN22, false);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_oculus_evasive_charges_aura::HandleOnEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_oculus_evasive_charges_aura::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_oculus_soar_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_oculus_soar_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_SOAR_BUFF });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
if (!caster->getAttackers().empty())
|
||||
{
|
||||
if (caster->HasAura(SPELL_SOAR_BUFF))
|
||||
caster->RemoveAurasDueToSpell(SPELL_SOAR_BUFF);
|
||||
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
GetTarget()->CastSpell(caster, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
|
||||
return;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_oculus_ride_ruby_emerald_amber_drake_que_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
if (!caster->HasAura(SPELL_SOAR_BUFF))
|
||||
caster->CastSpell(caster, SPELL_SOAR_BUFF, true);
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
// We handle the health regen here, normal heal regen isn't working....
|
||||
if (caster->GetHealth() < caster->GetMaxHealth())
|
||||
caster->SetHealth(caster->GetHealth() + (uint32)((double)caster->GetMaxHealth() * 0.2));
|
||||
}
|
||||
|
||||
void HandleOnEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_oculus_ride_ruby_emerald_amber_drake_que_AuraScript();
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
if (!caster->HasAura(SPELL_SOAR_BUFF))
|
||||
caster->CastSpell(caster, SPELL_SOAR_BUFF, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_oculus_soar_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_oculus_soar_aura::HandleOnEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_oculus_evasive_charges : public SpellScriptLoader
|
||||
class spell_oculus_rider_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_oculus_evasive_charges() : SpellScriptLoader("spell_oculus_evasive_charges") { }
|
||||
PrepareAuraScript(spell_oculus_rider_aura);
|
||||
|
||||
class spell_oculus_evasive_chargesAuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_oculus_evasive_chargesAuraScript);
|
||||
|
||||
void HandleOnEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->ModifyAuraState(AURA_STATE_UNKNOWN22, true);
|
||||
}
|
||||
|
||||
void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
caster->RemoveAurasDueToSpell(SPELL_RUBY_EVASIVE_MANEUVERS);
|
||||
caster->ModifyAuraState(AURA_STATE_UNKNOWN22, false);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_oculus_evasive_chargesAuraScript::HandleOnEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_oculus_evasive_chargesAuraScript::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_oculus_evasive_chargesAuraScript();
|
||||
return ValidateSpellInfo({ SPELL_SOAR_TRIGGER, SPELL_RUBY_EVASIVE_AURA, SPELL_DRAKE_FLAG_VISUAL });
|
||||
}
|
||||
};
|
||||
|
||||
class spell_oculus_soar : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_oculus_soar() : SpellScriptLoader("spell_oculus_soar") { }
|
||||
ObjectGuid _drakeGUID;
|
||||
|
||||
class spell_oculus_soarAuraScript : public AuraScript
|
||||
void HandleOnEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_oculus_soarAuraScript);
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
Creature* drake = caster->GetVehicleCreatureBase();
|
||||
|
||||
if (!drake)
|
||||
return;
|
||||
|
||||
switch (aurEff->GetEffIndex())
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
if (!caster->getAttackers().empty())
|
||||
{
|
||||
if (caster->HasAura(SPELL_SOAR_BUFF))
|
||||
caster->RemoveAurasDueToSpell(SPELL_SOAR_BUFF);
|
||||
|
||||
case EFFECT_1:
|
||||
_drakeGUID = drake->GetGUID();
|
||||
caster->AddAura(SPELL_DRAKE_FLAG_VISUAL, caster);
|
||||
caster->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
caster->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
|
||||
drake->CastSpell(drake, SPELL_SOAR_TRIGGER);
|
||||
if (drake->GetEntry() == NPC_RUBY_DRAKE)
|
||||
drake->CastSpell(drake, SPELL_RUBY_EVASIVE_AURA);
|
||||
break;
|
||||
case EFFECT_2:
|
||||
caster->AddAura(SPELL_SCALE_STATS, drake);
|
||||
PreventDefaultAction();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!caster->HasAura(SPELL_SOAR_BUFF))
|
||||
caster->CastSpell(caster, SPELL_SOAR_BUFF, true);
|
||||
|
||||
// We handle the health regen here, normal heal regen isn't working....
|
||||
if (caster->GetHealth() < caster->GetMaxHealth())
|
||||
caster->SetHealth(caster->GetHealth() + (uint32)((double)caster->GetMaxHealth() * 0.2));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void HandleOnEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
if (!caster->HasAura(SPELL_SOAR_BUFF))
|
||||
caster->CastSpell(caster, SPELL_SOAR_BUFF, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_oculus_soarAuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_oculus_soarAuraScript::HandleOnEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_oculus_soarAuraScript();
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Creature* drake = ObjectAccessor::GetCreature(*caster, _drakeGUID);
|
||||
|
||||
if (drake)
|
||||
{
|
||||
drake->RemoveUnitFlag(UNIT_FLAG_POSSESSED);
|
||||
drake->RemoveAurasDueToSpell(GetId());
|
||||
drake->RemoveAurasDueToSpell(SPELL_SOAR_TRIGGER);
|
||||
drake->RemoveAurasDueToSpell(SPELL_RUBY_EVASIVE_AURA);
|
||||
}
|
||||
caster->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
caster->RemoveAurasDueToSpell(SPELL_DRAKE_FLAG_VISUAL);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_oculus_rider_aura::HandleOnEffectApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_oculus_rider_aura::HandleOnEffectApply, EFFECT_2, SPELL_AURA_LINKED, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_oculus_rider_aura::HandleOnEffectRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_oculus_rider_aura : public SpellScriptLoader
|
||||
class spell_oculus_drake_flag_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_oculus_rider_aura() : SpellScriptLoader("spell_oculus_rider_aura") { }
|
||||
PrepareAuraScript(spell_oculus_drake_flag_aura);
|
||||
|
||||
class spell_oculus_rider_auraAuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_oculus_rider_auraAuraScript);
|
||||
return ValidateSpellInfo({ SPELL_DRAKE_FLAG_VISUAL });
|
||||
}
|
||||
|
||||
ObjectGuid _drakeGUID;
|
||||
void HandleOnEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
void HandleOnEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Creature* drake = caster->GetVehicleCreatureBase();
|
||||
|
||||
if (!drake)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Creature* drake = caster->GetVehicleCreatureBase();
|
||||
|
||||
if (!drake)
|
||||
return;
|
||||
|
||||
switch (aurEff->GetEffIndex())
|
||||
{
|
||||
case EFFECT_1:
|
||||
_drakeGUID = drake->GetGUID();
|
||||
caster->AddAura(SPELL_DRAKE_FLAG_VISUAL, caster);
|
||||
caster->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
caster->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
|
||||
drake->CastSpell(drake, SPELL_SOAR_TRIGGER);
|
||||
if (drake->GetEntry() == NPC_RUBY_DRAKE)
|
||||
drake->CastSpell(drake, SPELL_RUBY_EVASIVE_AURA);
|
||||
break;
|
||||
case EFFECT_2:
|
||||
caster->AddAura(SPELL_SCALE_STATS, drake);
|
||||
PreventDefaultAction();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void HandleOnEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Creature* drake = ObjectAccessor::GetCreature(*caster, _drakeGUID);
|
||||
|
||||
if (drake)
|
||||
{
|
||||
drake->RemoveUnitFlag(UNIT_FLAG_POSSESSED);
|
||||
drake->RemoveAurasDueToSpell(GetId());
|
||||
drake->RemoveAurasDueToSpell(SPELL_SOAR_TRIGGER);
|
||||
drake->RemoveAurasDueToSpell(SPELL_RUBY_EVASIVE_AURA);
|
||||
}
|
||||
caster->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
caster->RemoveAurasDueToSpell(SPELL_DRAKE_FLAG_VISUAL);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_oculus_rider_auraAuraScript::HandleOnEffectApply, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_oculus_rider_auraAuraScript::HandleOnEffectApply, EFFECT_2, SPELL_AURA_LINKED, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_oculus_rider_auraAuraScript::HandleOnEffectRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_oculus_rider_auraAuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_oculus_drake_flag : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_oculus_drake_flag() : SpellScriptLoader("spell_oculus_drake_flag") { }
|
||||
|
||||
class spell_oculus_drake_flagAuraScript : public AuraScript
|
||||
void Register() override
|
||||
{
|
||||
PrepareAuraScript(spell_oculus_drake_flagAuraScript);
|
||||
|
||||
void HandleOnEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Creature* drake = caster->GetVehicleCreatureBase();
|
||||
|
||||
if (!drake)
|
||||
{
|
||||
caster->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
caster->RemoveAurasDueToSpell(SPELL_DRAKE_FLAG_VISUAL);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_oculus_drake_flagAuraScript::HandleOnEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_oculus_drake_flagAuraScript();
|
||||
OnEffectApply += AuraEffectApplyFn(spell_oculus_drake_flag_aura::HandleOnEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1021,17 +909,17 @@ void AddSC_oculus()
|
||||
new npc_oculus_drake();
|
||||
new npc_centrifuge_construct();
|
||||
|
||||
new spell_oculus_stop_time();
|
||||
new spell_oculus_evasive_maneuvers();
|
||||
new spell_oculus_shock_lance();
|
||||
new spell_oculus_temporal_rift();
|
||||
new spell_oculus_touch_the_nightmare();
|
||||
new spell_oculus_dream_funnel();
|
||||
new spell_oculus_call_ruby_emerald_amber_drake();
|
||||
new spell_oculus_ride_ruby_emerald_amber_drake_que();
|
||||
new spell_oculus_evasive_charges();
|
||||
new spell_oculus_soar();
|
||||
new spell_oculus_rider_aura();
|
||||
new spell_oculus_drake_flag();
|
||||
RegisterSpellScript(spell_oculus_stop_time_aura);
|
||||
RegisterSpellScript(spell_oculus_evasive_maneuvers_aura);
|
||||
RegisterSpellScript(spell_oculus_shock_lance);
|
||||
RegisterSpellScript(spell_oculus_temporal_rift_aura);
|
||||
RegisterSpellScript(spell_oculus_touch_the_nightmare);
|
||||
RegisterSpellScript(spell_oculus_dream_funnel_aura);
|
||||
RegisterSpellScript(spell_oculus_call_ruby_emerald_amber_drake);
|
||||
RegisterSpellScript(spell_oculus_ride_ruby_emerald_amber_drake_que_aura);
|
||||
RegisterSpellScript(spell_oculus_evasive_charges_aura);
|
||||
RegisterSpellScript(spell_oculus_soar_aura);
|
||||
RegisterSpellScript(spell_oculus_rider_aura);
|
||||
RegisterSpellScript(spell_oculus_drake_flag_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -1180,159 +1180,133 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_hodir_shatter_chest : public SpellScriptLoader
|
||||
class spell_hodir_shatter_chest : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_hodir_shatter_chest() : SpellScriptLoader("spell_hodir_shatter_chest") { }
|
||||
PrepareSpellScript(spell_hodir_shatter_chest);
|
||||
|
||||
class spell_hodir_shatter_chestSpellScript : public SpellScript
|
||||
void DestroyWinterCache(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_hodir_shatter_chestSpellScript)
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
void destroyWinterCache(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
if (Unit* hodir = GetCaster())
|
||||
hodir->GetAI()->DoAction(EVENT_FAIL_HM);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_hodir_shatter_chestSpellScript::destroyWinterCache, EFFECT_0, SPELL_EFFECT_TRIGGER_MISSILE);
|
||||
};
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_hodir_shatter_chestSpellScript();
|
||||
if (Unit* hodir = GetCaster())
|
||||
hodir->GetAI()->DoAction(EVENT_FAIL_HM);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_hodir_shatter_chest::DestroyWinterCache, EFFECT_0, SPELL_EFFECT_TRIGGER_MISSILE);
|
||||
};
|
||||
};
|
||||
|
||||
class spell_hodir_biting_cold_main_aura : public SpellScriptLoader
|
||||
class spell_hodir_biting_cold_main_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_hodir_biting_cold_main_aura() : SpellScriptLoader("spell_hodir_biting_cold_main_aura") { }
|
||||
PrepareAuraScript(spell_hodir_biting_cold_main_aura);
|
||||
|
||||
class spell_hodir_biting_cold_main_aura_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_biting_cold_main_aura_AuraScript)
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if ((aurEff->GetTickNumber() % 4) == 0)
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER
|
||||
&& !target->isMoving()
|
||||
&& !target->HasAura(SPELL_BITING_COLD_PLAYER_AURA)
|
||||
&& !target->HasAura(SPELL_MAGE_TOASTY_FIRE_AURA))
|
||||
target->CastSpell(target, SPELL_BITING_COLD_PLAYER_AURA, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hodir_biting_cold_main_aura_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_hodir_biting_cold_main_aura_AuraScript();
|
||||
return ValidateSpellInfo({ SPELL_BITING_COLD_PLAYER_AURA, SPELL_MAGE_TOASTY_FIRE_AURA });
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hodir_biting_cold_player_aura : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hodir_biting_cold_player_aura() : SpellScriptLoader("spell_hodir_biting_cold_player_aura") { }
|
||||
|
||||
class spell_hodir_biting_cold_player_aura_AuraScript : public AuraScript
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_biting_cold_player_aura_AuraScript)
|
||||
|
||||
uint8 counter {0};
|
||||
bool prev {false};
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if ((aurEff->GetTickNumber() % 4) == 0)
|
||||
if (Unit* target = GetTarget())
|
||||
{
|
||||
if (target->GetMapId() == 603)
|
||||
SetDuration(GetMaxDuration());
|
||||
if (target->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER))
|
||||
return;
|
||||
if (target->isMoving() || target->HasAura(SPELL_MAGE_TOASTY_FIRE_AURA))
|
||||
{
|
||||
if (prev)
|
||||
{
|
||||
ModStackAmount(-1);
|
||||
prev = false;
|
||||
}
|
||||
else
|
||||
prev = true;
|
||||
if (target->GetTypeId() == TYPEID_PLAYER
|
||||
&& !target->isMoving()
|
||||
&& !target->HasAura(SPELL_BITING_COLD_PLAYER_AURA)
|
||||
&& !target->HasAura(SPELL_MAGE_TOASTY_FIRE_AURA))
|
||||
target->CastSpell(target, SPELL_BITING_COLD_PLAYER_AURA, true);
|
||||
}
|
||||
|
||||
if (counter >= 2)
|
||||
counter -= 2;
|
||||
else if (counter)
|
||||
--counter;
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hodir_biting_cold_main_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hodir_biting_cold_player_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_biting_cold_player_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_FLASH_FREEZE_TRAPPED_PLAYER, SPELL_MAGE_TOASTY_FIRE_AURA, SPELL_BITING_COLD_DAMAGE });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
_counter = 0;
|
||||
_prev = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
{
|
||||
if (target->GetMapId() == 603)
|
||||
SetDuration(GetMaxDuration());
|
||||
if (target->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER))
|
||||
return;
|
||||
if (target->isMoving() || target->HasAura(SPELL_MAGE_TOASTY_FIRE_AURA))
|
||||
{
|
||||
if (_prev)
|
||||
{
|
||||
ModStackAmount(-1);
|
||||
_prev = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
prev = false;
|
||||
++counter;
|
||||
if (counter >= 4)
|
||||
{
|
||||
if (GetStackAmount() == 2) // increasing from 2 to 3 (not checking >= to improve performance)
|
||||
if (InstanceScript* pInstance = target->GetInstanceScript())
|
||||
if (Creature* hodir = pInstance->instance->GetCreature(pInstance->GetGuidData(TYPE_HODIR)))
|
||||
hodir->AI()->SetData(2, 1);
|
||||
ModStackAmount(1);
|
||||
counter = 0;
|
||||
}
|
||||
}
|
||||
_prev = true;
|
||||
|
||||
const int32 dmg = 200 * pow(2.0f, GetStackAmount());
|
||||
target->CastCustomSpell(target, SPELL_BITING_COLD_DAMAGE, &dmg, 0, 0, true);
|
||||
if (_counter >= 2)
|
||||
_counter -= 2;
|
||||
else if (_counter)
|
||||
--_counter;
|
||||
}
|
||||
else
|
||||
{
|
||||
_prev = false;
|
||||
++_counter;
|
||||
if (_counter >= 4)
|
||||
{
|
||||
if (GetStackAmount() == 2) // increasing from 2 to 3 (not checking >= to improve performance)
|
||||
if (InstanceScript* pInstance = target->GetInstanceScript())
|
||||
if (Creature* hodir = pInstance->instance->GetCreature(pInstance->GetGuidData(TYPE_HODIR)))
|
||||
hodir->AI()->SetData(2, 1);
|
||||
ModStackAmount(1);
|
||||
_counter = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hodir_biting_cold_player_aura_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
const int32 dmg = 200 * pow(2.0f, GetStackAmount());
|
||||
target->CastCustomSpell(target, SPELL_BITING_COLD_DAMAGE, &dmg, 0, 0, true);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_hodir_biting_cold_player_aura_AuraScript();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hodir_biting_cold_player_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 _counter;
|
||||
bool _prev;
|
||||
};
|
||||
|
||||
class spell_hodir_periodic_icicle : public SpellScriptLoader
|
||||
class spell_hodir_periodic_icicle : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_hodir_periodic_icicle() : SpellScriptLoader("spell_hodir_periodic_icicle") { }
|
||||
PrepareSpellScript(spell_hodir_periodic_icicle);
|
||||
|
||||
class spell_hodir_periodic_icicle_SpellScript : public SpellScript
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_hodir_periodic_icicle_SpellScript);
|
||||
targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false));
|
||||
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_FLASH_FREEZE_TRAPPED_PLAYER));
|
||||
Acore::Containers::RandomResize(targets, 1);
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Acore::ObjectTypeIdCheck(TYPEID_PLAYER, false));
|
||||
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_FLASH_FREEZE_TRAPPED_PLAYER));
|
||||
Acore::Containers::RandomResize(targets, 1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hodir_periodic_icicle_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_hodir_periodic_icicle_SpellScript();
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hodir_periodic_icicle::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1349,150 +1323,156 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hodir_flash_freeze : public SpellScriptLoader
|
||||
class spell_hodir_flash_freeze : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_hodir_flash_freeze() : SpellScriptLoader("spell_hodir_flash_freeze") { }
|
||||
PrepareSpellScript(spell_hodir_flash_freeze);
|
||||
|
||||
class spell_hodir_flash_freeze_SpellScript : public SpellScript
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_hodir_flash_freeze_SpellScript);
|
||||
targets.remove_if(FlashFreezeCheck());
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(FlashFreezeCheck());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hodir_flash_freeze_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hodir_flash_freeze_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hodir_flash_freeze_AuraScript : public AuraScript
|
||||
void Register() override
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_flash_freeze_AuraScript)
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hodir_flash_freeze::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hodir_flash_freeze::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
class spell_hodir_flash_freeze_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_flash_freeze_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_FLASH_FREEZE_INSTAKILL, SPELL_FLASH_FREEZE_TRAPPED_PLAYER, SPELL_FLASH_FREEZE_TRAPPED_NPC });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (aurEff->GetTotalTicks() > 0 && aurEff->GetTickNumber() == uint32(aurEff->GetTotalTicks()) - 1)
|
||||
{
|
||||
if (aurEff->GetTotalTicks() > 0 && aurEff->GetTickNumber() == uint32(aurEff->GetTotalTicks()) - 1)
|
||||
Unit* target = GetTarget();
|
||||
Unit* caster = GetCaster();
|
||||
if (!target || !caster || caster->GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
|
||||
if (Aura* aur = target->GetAura(target->GetTypeId() == TYPEID_PLAYER ? SPELL_FLASH_FREEZE_TRAPPED_PLAYER : SPELL_FLASH_FREEZE_TRAPPED_NPC))
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
Unit* caster = GetCaster();
|
||||
if (!target || !caster || caster->GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
|
||||
if (Aura* aur = target->GetAura(target->GetTypeId() == TYPEID_PLAYER ? SPELL_FLASH_FREEZE_TRAPPED_PLAYER : SPELL_FLASH_FREEZE_TRAPPED_NPC))
|
||||
if (Unit* caster2 = aur->GetCaster())
|
||||
{
|
||||
if (Unit* caster2 = aur->GetCaster())
|
||||
if (caster2->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (caster2->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
caster2->ToCreature()->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
target->CastSpell(target, SPELL_FLASH_FREEZE_INSTAKILL, true);
|
||||
return;
|
||||
}
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
caster->ToCreature()->AI()->SetData(1, 1);
|
||||
if( Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_PLR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5 * 60 * 1000) )
|
||||
{
|
||||
c->CastSpell(target, SPELL_FLASH_FREEZE_TRAPPED_PLAYER, true);
|
||||
caster->ToCreature()->AI()->JustSummoned(c);
|
||||
caster2->ToCreature()->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
else if (target->GetTypeId() == TYPEID_UNIT)
|
||||
target->CastSpell(target, SPELL_FLASH_FREEZE_INSTAKILL, true);
|
||||
return;
|
||||
}
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
caster->ToCreature()->AI()->SetData(1, 1);
|
||||
if( Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_PLR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5 * 60 * 1000) )
|
||||
{
|
||||
if( Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_NPC, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000) )
|
||||
{
|
||||
c->CastSpell(target, SPELL_FLASH_FREEZE_TRAPPED_NPC, true);
|
||||
caster->ToCreature()->AI()->JustSummoned(c);
|
||||
}
|
||||
c->CastSpell(target, SPELL_FLASH_FREEZE_TRAPPED_PLAYER, true);
|
||||
caster->ToCreature()->AI()->JustSummoned(c);
|
||||
}
|
||||
}
|
||||
else if (target->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if( Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_NPC, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000) )
|
||||
{
|
||||
c->CastSpell(target, SPELL_FLASH_FREEZE_TRAPPED_NPC, true);
|
||||
caster->ToCreature()->AI()->JustSummoned(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hodir_flash_freeze_AuraScript::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_hodir_flash_freeze_SpellScript();
|
||||
}
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_hodir_flash_freeze_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hodir_flash_freeze_aura::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hodir_storm_power : public SpellScriptLoader
|
||||
class spell_hodir_storm_power_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_hodir_storm_power() : SpellScriptLoader("spell_hodir_storm_power") { }
|
||||
PrepareAuraScript(spell_hodir_storm_power_aura);
|
||||
|
||||
class spell_hodir_storm_power_AuraScript : public AuraScript
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_storm_power_AuraScript)
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Aura* a = caster->GetAura(GetId() == SPELL_SHAMAN_STORM_POWER_10 ? SPELL_SHAMAN_STORM_CLOUD_10 : SPELL_SHAMAN_STORM_CLOUD_25))
|
||||
a->ModStackAmount(-1);
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Aura* a = caster->GetAura(GetId() == SPELL_SHAMAN_STORM_POWER_10 ? SPELL_SHAMAN_STORM_CLOUD_10 : SPELL_SHAMAN_STORM_CLOUD_25))
|
||||
a->ModStackAmount(-1);
|
||||
}
|
||||
|
||||
void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, GetId(), 0, GetCaster());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_hodir_storm_power_AuraScript::OnApply, EFFECT_0, SPELL_AURA_MOD_CRIT_DAMAGE_BONUS, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_hodir_storm_power_AuraScript::HandleAfterEffectApply, EFFECT_0, SPELL_AURA_MOD_CRIT_DAMAGE_BONUS, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_hodir_storm_power_AuraScript();
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, GetId(), 0, GetCaster());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_hodir_storm_power_aura::OnApply, EFFECT_0, SPELL_AURA_MOD_CRIT_DAMAGE_BONUS, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_hodir_storm_power_aura::HandleAfterEffectApply, EFFECT_0, SPELL_AURA_MOD_CRIT_DAMAGE_BONUS, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hodir_storm_cloud : public SpellScriptLoader
|
||||
class spell_hodir_storm_cloud_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_hodir_storm_cloud() : SpellScriptLoader("spell_hodir_storm_cloud") { }
|
||||
PrepareAuraScript(spell_hodir_storm_cloud_aura);
|
||||
|
||||
class spell_hodir_storm_cloud_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_storm_cloud_AuraScript)
|
||||
return ValidateSpellInfo({ SPELL_SHAMAN_STORM_CLOUD_10, SPELL_SHAMAN_STORM_POWER_10, SPELL_SHAMAN_STORM_POWER_25 });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetTarget())
|
||||
target->CastSpell((Unit*)nullptr, (GetId() == SPELL_SHAMAN_STORM_CLOUD_10 ? SPELL_SHAMAN_STORM_POWER_10 : SPELL_SHAMAN_STORM_POWER_25), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hodir_storm_cloud_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
return new spell_hodir_storm_cloud_AuraScript();
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetTarget())
|
||||
target->CastSpell((Unit*)nullptr, (GetId() == SPELL_SHAMAN_STORM_CLOUD_10 ? SPELL_SHAMAN_STORM_POWER_10 : SPELL_SHAMAN_STORM_POWER_25), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_hodir_storm_cloud_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hodir_toasty_fire_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_toasty_fire_aura);
|
||||
|
||||
void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, SPELL_MAGE_TOASTY_FIRE_AURA, 0, GetCaster());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_hodir_toasty_fire_aura::HandleAfterEffectApply, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hodir_starlight_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_starlight_aura);
|
||||
|
||||
void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, SPELL_DRUID_STARLIGHT_AREA_AURA, 0, GetCaster());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_hodir_starlight_aura::HandleAfterEffectApply, EFFECT_0, SPELL_AURA_MELEE_SLOW, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1562,62 +1542,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hodir_toasty_fire : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hodir_toasty_fire() : SpellScriptLoader("spell_hodir_toasty_fire") { }
|
||||
|
||||
class spell_hodir_toasty_fire_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_toasty_fire_AuraScript);
|
||||
|
||||
void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, SPELL_MAGE_TOASTY_FIRE_AURA, 0, GetCaster());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_hodir_toasty_fire_AuraScript::HandleAfterEffectApply, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_hodir_toasty_fire_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hodir_starlight : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hodir_starlight() : SpellScriptLoader("spell_hodir_starlight") { }
|
||||
|
||||
class spell_hodir_starlight_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_starlight_AuraScript);
|
||||
|
||||
void HandleAfterEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
target->ToPlayer()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, SPELL_DRUID_STARLIGHT_AREA_AURA, 0, GetCaster());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_hodir_starlight_AuraScript::HandleAfterEffectApply, EFFECT_0, SPELL_AURA_MELEE_SLOW, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_hodir_starlight_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_hodir()
|
||||
{
|
||||
new boss_hodir();
|
||||
@@ -1630,13 +1554,15 @@ void AddSC_boss_hodir()
|
||||
new npc_ulduar_hodir_shaman();
|
||||
new npc_ulduar_hodir_mage();
|
||||
|
||||
new spell_hodir_biting_cold_main_aura();
|
||||
new spell_hodir_biting_cold_player_aura();
|
||||
new spell_hodir_periodic_icicle();
|
||||
new spell_hodir_flash_freeze();
|
||||
new spell_hodir_storm_power();
|
||||
new spell_hodir_storm_cloud();
|
||||
new spell_hodir_shatter_chest();
|
||||
RegisterSpellScript(spell_hodir_shatter_chest);
|
||||
RegisterSpellScript(spell_hodir_biting_cold_main_aura);
|
||||
RegisterSpellScript(spell_hodir_biting_cold_player_aura);
|
||||
RegisterSpellScript(spell_hodir_periodic_icicle);
|
||||
RegisterSpellAndAuraScriptPair(spell_hodir_flash_freeze, spell_hodir_flash_freeze_aura);
|
||||
RegisterSpellScript(spell_hodir_storm_power_aura);
|
||||
RegisterSpellScript(spell_hodir_storm_cloud_aura);
|
||||
RegisterSpellScript(spell_hodir_toasty_fire_aura);
|
||||
RegisterSpellScript(spell_hodir_starlight_aura);
|
||||
|
||||
new achievement_cheese_the_freeze();
|
||||
new achievement_getting_cold_in_here();
|
||||
@@ -1644,6 +1570,4 @@ void AddSC_boss_hodir()
|
||||
new achievement_i_have_the_coolest_friends();
|
||||
new achievement_staying_buffed_all_winter_10();
|
||||
new achievement_staying_buffed_all_winter_25();
|
||||
new spell_hodir_toasty_fire();
|
||||
new spell_hodir_starlight();
|
||||
}
|
||||
|
||||
@@ -432,7 +432,7 @@ class spell_ignis_scorch_aura : public AuraScript
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo( { SPELL_SCORCHED_GROUND_10, SPELL_SCORCHED_GROUND_25 });
|
||||
return ValidateSpellInfo({ SPELL_SCORCHED_GROUND_10, SPELL_SCORCHED_GROUND_25 });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
@@ -458,7 +458,7 @@ class spell_ignis_grab_initial : public SpellScript
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo( { SPELL_GRAB_TRIGGERED });
|
||||
return ValidateSpellInfo({ SPELL_GRAB_TRIGGERED });
|
||||
}
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
|
||||
@@ -882,7 +882,7 @@ class spell_xt002_tympanic_tantrum : public SpellScript
|
||||
// 64234, 63024 - Gravity Bomb
|
||||
enum GravityBomb
|
||||
{
|
||||
SPELL_GRAVTY_BOMB_10 = 63025
|
||||
SPELL_GRAVITY_BOMB_TRIGGER_10 = 63025
|
||||
};
|
||||
|
||||
class spell_xt002_gravity_bomb : public SpellScript
|
||||
@@ -917,7 +917,7 @@ class spell_xt002_gravity_bomb_aura : public AuraScript
|
||||
if (xt002->HasAura(aurEff->GetAmount())) // Heartbreak aura indicating hard mode
|
||||
if (Creature* creature = xt002->SummonCreature(NPC_VOID_ZONE, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000))
|
||||
{
|
||||
int32 damage = GetSpellInfo()->Id == SPELL_GRAVTY_BOMB_10 ? 5000 : 7500;
|
||||
int32 damage = GetSpellInfo()->Id == SPELL_GRAVITY_BOMB_TRIGGER_10 ? 5000 : 7500;
|
||||
creature->CastCustomSpell(creature, SPELL_VOID_ZONE_DAMAGE, &damage, 0, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,32 +343,26 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_frost_tomb : public SpellScriptLoader
|
||||
class spell_frost_tomb_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_frost_tomb() : SpellScriptLoader("spell_frost_tomb") { }
|
||||
PrepareAuraScript(spell_frost_tomb_aura);
|
||||
|
||||
class spell_frost_tombAuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_frost_tombAuraScript);
|
||||
return ValidateSpellInfo({ SPELL_FROST_TOMB_SUMMON });
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (aurEff->GetTickNumber() == 1)
|
||||
if( Unit* target = GetTarget() )
|
||||
target->CastSpell((Unit*)nullptr, SPELL_FROST_TOMB_SUMMON, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_frost_tombAuraScript::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
return new spell_frost_tombAuraScript();
|
||||
PreventDefaultAction();
|
||||
if (aurEff->GetTickNumber() == 1)
|
||||
if( Unit* target = GetTarget() )
|
||||
target->CastSpell((Unit*)nullptr, SPELL_FROST_TOMB_SUMMON, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_frost_tomb_aura::HandleEffectPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -377,6 +371,6 @@ void AddSC_boss_keleseth()
|
||||
new boss_keleseth();
|
||||
new npc_frost_tomb();
|
||||
new npc_vrykul_skeleton();
|
||||
new spell_frost_tomb();
|
||||
RegisterSpellScript(spell_frost_tomb_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -208,37 +208,26 @@ enum TickingTimeBomb
|
||||
SPELL_TICKING_TIME_BOMB_EXPLODE = 59687
|
||||
};
|
||||
|
||||
class spell_ticking_time_bomb : public SpellScriptLoader
|
||||
class spell_ticking_time_bomb_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_ticking_time_bomb() : SpellScriptLoader("spell_ticking_time_bomb") { }
|
||||
PrepareAuraScript(spell_ticking_time_bomb_aura);
|
||||
|
||||
class spell_ticking_time_bomb_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_ticking_time_bomb_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_TICKING_TIME_BOMB_EXPLODE });
|
||||
}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_TICKING_TIME_BOMB_EXPLODE });
|
||||
}
|
||||
|
||||
void HandleOnEffectRemove(AuraEffect const* /* aurEff */, AuraEffectHandleModes /* mode */)
|
||||
{
|
||||
if (GetCaster() == GetTarget())
|
||||
{
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_TICKING_TIME_BOMB_EXPLODE, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_ticking_time_bomb_AuraScript::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleOnEffectRemove(AuraEffect const* /* aurEff */, AuraEffectHandleModes /* mode */)
|
||||
{
|
||||
return new spell_ticking_time_bomb_AuraScript();
|
||||
if (GetCaster() == GetTarget())
|
||||
{
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_TICKING_TIME_BOMB_EXPLODE, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_ticking_time_bomb_aura::HandleOnEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -247,6 +236,6 @@ void AddSC_utgarde_keep()
|
||||
new npc_dragonflayer_forge_master();
|
||||
new npc_enslaved_proto_drake();
|
||||
|
||||
new spell_ticking_time_bomb();
|
||||
RegisterSpellScript(spell_ticking_time_bomb_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -396,56 +396,40 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_svala_ritual_strike : public SpellScriptLoader
|
||||
class spell_svala_ritual_strike : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_svala_ritual_strike() : SpellScriptLoader("spell_svala_ritual_strike") { }
|
||||
PrepareSpellScript(spell_svala_ritual_strike);
|
||||
|
||||
class spell_svala_ritual_strike_SpellScript : public SpellScript
|
||||
void HandleDummyEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_svala_ritual_strike_SpellScript);
|
||||
|
||||
void HandleDummyEffect(SpellEffIndex /*effIndex*/)
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
{
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
{
|
||||
if (unitTarget->GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
if (unitTarget->GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
|
||||
Unit::DealDamage(GetCaster(), unitTarget, 7000, nullptr, DIRECT_DAMAGE);
|
||||
}
|
||||
Unit::DealDamage(GetCaster(), unitTarget, 7000, nullptr, DIRECT_DAMAGE);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_svala_ritual_strike_SpellScript::HandleDummyEffect, EFFECT_2, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_svala_ritual_strike_SpellScript();
|
||||
}
|
||||
|
||||
class spell_svala_ritual_strike_AuraScript : public AuraScript
|
||||
void Register() override
|
||||
{
|
||||
PrepareAuraScript(spell_svala_ritual_strike_AuraScript);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_svala_ritual_strike::HandleDummyEffect, EFFECT_2, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
// Set amount based on difficulty
|
||||
amount = (GetCaster()->GetMap()->IsHeroic() ? 2000 : 1000);
|
||||
}
|
||||
class spell_svala_ritual_strike_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_svala_ritual_strike_aura);
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_svala_ritual_strike_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
return new spell_svala_ritual_strike_AuraScript();
|
||||
// Set amount based on difficulty
|
||||
amount = (GetCaster()->GetMap()->IsHeroic() ? 2000 : 1000);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_svala_ritual_strike_aura::CalculateAmount, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -453,6 +437,6 @@ void AddSC_boss_svala()
|
||||
{
|
||||
new boss_svala();
|
||||
new npc_ritual_channeler();
|
||||
new spell_svala_ritual_strike();
|
||||
RegisterSpellAndAuraScriptPair(spell_svala_ritual_strike, spell_svala_ritual_strike_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -132,38 +132,27 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_optic_link : public SpellScriptLoader
|
||||
class spell_optic_link_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_optic_link() : SpellScriptLoader("spell_optic_link") { }
|
||||
PrepareAuraScript(spell_optic_link_aura);
|
||||
|
||||
class spell_optic_linkAuraScript : public AuraScript
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PrepareAuraScript(spell_optic_linkAuraScript)
|
||||
if (Unit* target = GetTarget())
|
||||
if (Unit* caster = GetCaster())
|
||||
if (GetAura() && GetAura()->GetEffect(0))
|
||||
GetAura()->GetEffect(0)->SetAmount(aurEff->GetSpellInfo()->Effects[EFFECT_0].BasePoints + (((int32)target->GetExactDist(caster)) * 25) + (aurEff->GetTickNumber() * 100));
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
if (Unit* caster = GetCaster())
|
||||
if (GetAura() && GetAura()->GetEffect(0))
|
||||
GetAura()->GetEffect(0)->SetAmount(aurEff->GetSpellInfo()->Effects[EFFECT_0].BasePoints + (((int32)target->GetExactDist(caster)) * 25) + (aurEff->GetTickNumber() * 100));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_optic_linkAuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_optic_linkAuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_optic_link_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_moragg()
|
||||
{
|
||||
new boss_moragg();
|
||||
new spell_optic_link();
|
||||
RegisterSpellScript(spell_optic_link_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -1157,32 +1157,21 @@ public:
|
||||
** DESTROY DOOR SEAL SPELL SCRIPT
|
||||
***********/
|
||||
|
||||
class spell_destroy_door_seal : public SpellScriptLoader
|
||||
class spell_destroy_door_seal_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_destroy_door_seal() : SpellScriptLoader("spell_destroy_door_seal") { }
|
||||
PrepareAuraScript(spell_destroy_door_seal_aura);
|
||||
|
||||
class spell_destroy_door_sealAuraScript : public AuraScript
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PrepareAuraScript(spell_destroy_door_sealAuraScript)
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetTarget())
|
||||
if (InstanceScript* pInstance = target->GetInstanceScript())
|
||||
pInstance->SetData(DATA_DECRASE_DOOR_HEALTH, 0);
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetTarget())
|
||||
if (InstanceScript* pInstance = target->GetInstanceScript())
|
||||
pInstance->SetData(DATA_DECRASE_DOOR_HEALTH, 0);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_destroy_door_sealAuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_destroy_door_sealAuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_destroy_door_seal_aura::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1232,6 +1221,6 @@ void AddSC_violet_hold()
|
||||
new npc_azure_raider();
|
||||
new npc_azure_stalker();
|
||||
|
||||
new spell_destroy_door_seal();
|
||||
RegisterSpellScript(spell_destroy_door_seal_aura);
|
||||
RegisterCreatureAI(npc_violet_hold_defense_system);
|
||||
}
|
||||
|
||||
@@ -198,73 +198,51 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_gurtogg_bloodboil : public SpellScriptLoader
|
||||
class spell_gurtogg_bloodboil : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_gurtogg_bloodboil() : SpellScriptLoader("spell_gurtogg_bloodboil") { }
|
||||
PrepareSpellScript(spell_gurtogg_bloodboil);
|
||||
|
||||
class spell_gurtogg_bloodboil_SpellScript : public SpellScript
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_gurtogg_bloodboil_SpellScript);
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
targets.sort(Acore::ObjectDistanceOrderPred(GetCaster(), false));
|
||||
if (targets.size() > GetSpellValue()->MaxAffectedTargets)
|
||||
{
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
targets.sort(Acore::ObjectDistanceOrderPred(GetCaster(), false));
|
||||
if (targets.size() > GetSpellValue()->MaxAffectedTargets)
|
||||
{
|
||||
std::list<WorldObject*>::iterator itr = targets.begin();
|
||||
std::advance(itr, GetSpellValue()->MaxAffectedTargets);
|
||||
targets.erase(itr, targets.end());
|
||||
}
|
||||
std::list<WorldObject*>::iterator itr = targets.begin();
|
||||
std::advance(itr, GetSpellValue()->MaxAffectedTargets);
|
||||
targets.erase(itr, targets.end());
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gurtogg_bloodboil_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_gurtogg_bloodboil_SpellScript();
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gurtogg_bloodboil::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gurtogg_eject : public SpellScriptLoader
|
||||
class spell_gurtogg_eject : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_gurtogg_eject() : SpellScriptLoader("spell_gurtogg_eject") { }
|
||||
PrepareSpellScript(spell_gurtogg_eject);
|
||||
|
||||
class spell_gurtogg_eject_SpellScript : public SpellScript
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareSpellScript(spell_gurtogg_eject_SpellScript);
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->GetThreatMgr().ModifyThreatByPercent(target, -20);
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->GetThreatMgr().ModifyThreatByPercent(target, -20);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gurtogg_eject_SpellScript::HandleScriptEffect, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_gurtogg_eject_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gurtogg_eject::HandleScriptEffect, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_gurtogg_bloodboil()
|
||||
{
|
||||
new boss_gurtogg_bloodboil();
|
||||
new spell_gurtogg_bloodboil();
|
||||
new spell_gurtogg_eject();
|
||||
RegisterSpellScript(spell_gurtogg_bloodboil);
|
||||
RegisterSpellScript(spell_gurtogg_eject);
|
||||
}
|
||||
|
||||
|
||||
@@ -1023,419 +1023,337 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_draw_soul : public SpellScriptLoader
|
||||
class spell_illidan_draw_soul : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_illidan_draw_soul() : SpellScriptLoader("spell_illidan_draw_soul") { }
|
||||
PrepareSpellScript(spell_illidan_draw_soul);
|
||||
|
||||
class spell_illidan_draw_soul_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_illidan_draw_soul_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_DRAW_SOUL_HEAL });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), SPELL_DRAW_SOUL_HEAL, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidan_draw_soul_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
return new spell_illidan_draw_soul_SpellScript();
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(GetCaster(), SPELL_DRAW_SOUL_HEAL, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidan_draw_soul::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_parasitic_shadowfiend : public SpellScriptLoader
|
||||
class spell_illidan_parasitic_shadowfiend_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_illidan_parasitic_shadowfiend() : SpellScriptLoader("spell_illidan_parasitic_shadowfiend") { }
|
||||
PrepareAuraScript(spell_illidan_parasitic_shadowfiend_aura);
|
||||
|
||||
class spell_illidan_parasitic_shadowfiend_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_illidan_parasitic_shadowfiend_AuraScript)
|
||||
return ValidateSpellInfo({ SPELL_SUMMON_PARASITIC_SHADOWFIENDS });
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (!GetTarget()->HasAura(SPELL_SHADOW_PRISON) && GetTarget()->GetInstanceScript() && GetTarget()->GetInstanceScript()->IsEncounterInProgress())
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_PARASITIC_SHADOWFIENDS, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_illidan_parasitic_shadowfiend_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_illidan_parasitic_shadowfiend_AuraScript();
|
||||
if (!GetTarget()->HasAura(SPELL_SHADOW_PRISON) && GetTarget()->GetInstanceScript() && GetTarget()->GetInstanceScript()->IsEncounterInProgress())
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_PARASITIC_SHADOWFIENDS, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_illidan_parasitic_shadowfiend_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_parasitic_shadowfiend_trigger : public SpellScriptLoader
|
||||
class spell_illidan_parasitic_shadowfiend_trigger : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_illidan_parasitic_shadowfiend_trigger() : SpellScriptLoader("spell_illidan_parasitic_shadowfiend_trigger") { }
|
||||
PrepareSpellScript(spell_illidan_parasitic_shadowfiend_trigger);
|
||||
|
||||
class spell_illidan_parasitic_shadowfiend_trigger_AuraScript : public AuraScript
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareAuraScript(spell_illidan_parasitic_shadowfiend_trigger_AuraScript)
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (!GetTarget()->HasAura(SPELL_SHADOW_PRISON) && GetTarget()->GetInstanceScript() && GetTarget()->GetInstanceScript()->IsEncounterInProgress())
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_PARASITIC_SHADOWFIENDS, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_illidan_parasitic_shadowfiend_trigger_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_illidan_parasitic_shadowfiend_trigger_AuraScript();
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Creature* target = GetHitCreature())
|
||||
target->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
class spell_illidan_parasitic_shadowfiend_trigger_SpellScript : public SpellScript
|
||||
void Register() override
|
||||
{
|
||||
PrepareSpellScript(spell_illidan_parasitic_shadowfiend_trigger_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Creature* target = GetHitCreature())
|
||||
target->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidan_parasitic_shadowfiend_trigger_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_illidan_parasitic_shadowfiend_trigger_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidan_parasitic_shadowfiend_trigger::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_glaive_throw : public SpellScriptLoader
|
||||
class spell_illidan_parasitic_shadowfiend_trigger_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_illidan_glaive_throw() : SpellScriptLoader("spell_illidan_glaive_throw") { }
|
||||
PrepareAuraScript(spell_illidan_parasitic_shadowfiend_trigger_aura);
|
||||
|
||||
class spell_illidan_glaive_throw_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_illidan_glaive_throw_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_SUMMON_PARASITIC_SHADOWFIENDS });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, SPELL_SUMMON_GLAIVE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidan_glaive_throw_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_illidan_glaive_throw_SpellScript();
|
||||
if (!GetTarget()->HasAura(SPELL_SHADOW_PRISON) && GetTarget()->GetInstanceScript() && GetTarget()->GetInstanceScript()->IsEncounterInProgress())
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_PARASITIC_SHADOWFIENDS, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_illidan_parasitic_shadowfiend_trigger_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_tear_of_azzinoth_summon_channel : public SpellScriptLoader
|
||||
class spell_illidan_glaive_throw : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_illidan_tear_of_azzinoth_summon_channel() : SpellScriptLoader("spell_illidan_tear_of_azzinoth_summon_channel") { }
|
||||
PrepareSpellScript(spell_illidan_glaive_throw);
|
||||
|
||||
class spell_illidan_tear_of_azzinoth_summon_channel_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_illidan_tear_of_azzinoth_summon_channel_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_SUMMON_GLAIVE });
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
if (GetTarget()->GetDistance2d(caster) > 25.0f)
|
||||
{
|
||||
SetDuration(0);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_UNCAGED_WRATH, true);
|
||||
}
|
||||
}
|
||||
|
||||
// xinef: ugly hax, dunno how it really works on blizz
|
||||
Map::PlayerList const& pl = GetTarget()->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
if (player->GetPositionX() > 693.4f || player->GetPositionY() < 271.8f || player->GetPositionX() < 658.43f || player->GetPositionY() > 338.68f)
|
||||
{
|
||||
GetTarget()->CastSpell(player, SPELL_CHARGE, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_tear_of_azzinoth_summon_channel_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
return new spell_illidan_tear_of_azzinoth_summon_channel_AuraScript();
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, SPELL_SUMMON_GLAIVE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidan_glaive_throw::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_shadow_prison : public SpellScriptLoader
|
||||
class spell_illidan_tear_of_azzinoth_summon_channel_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_illidan_shadow_prison() : SpellScriptLoader("spell_illidan_shadow_prison") { }
|
||||
PrepareAuraScript(spell_illidan_tear_of_azzinoth_summon_channel_aura);
|
||||
|
||||
class spell_illidan_shadow_prison_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_illidan_shadow_prison_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(PlayerOrPetCheck());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_illidan_shadow_prison_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_illidan_shadow_prison_SpellScript();
|
||||
return ValidateSpellInfo({ SPELL_UNCAGED_WRATH, SPELL_CHARGE });
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_demon_transform1 : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_illidan_demon_transform1() : SpellScriptLoader("spell_illidan_demon_transform1") { }
|
||||
|
||||
class spell_illidan_demon_transform1_AuraScript : public AuraScript
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PrepareAuraScript(spell_illidan_demon_transform1_AuraScript);
|
||||
|
||||
bool Load() override
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DEMON_TRANSFORM_2, true);
|
||||
GetUnitOwner()->ToCreature()->LoadEquipment(0, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_demon_transform1_AuraScript::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_illidan_demon_transform1_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_demon_transform2 : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_illidan_demon_transform2() : SpellScriptLoader("spell_illidan_demon_transform2") { }
|
||||
|
||||
class spell_illidan_demon_transform2_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_illidan_demon_transform2_AuraScript);
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
if (aurEff->GetTickNumber() == 1)
|
||||
{
|
||||
if (GetUnitOwner()->GetDisplayId() == GetUnitOwner()->GetNativeDisplayId())
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DEMON_FORM, true);
|
||||
else
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(SPELL_DEMON_FORM);
|
||||
}
|
||||
else if (aurEff->GetTickNumber() == 2)
|
||||
if (GetTarget()->GetDistance2d(caster) > 25.0f)
|
||||
{
|
||||
SetDuration(0);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DEMON_TRANSFORM_3, true);
|
||||
if (Aura* aura = GetUnitOwner()->GetAura(SPELL_DEMON_TRANSFORM_3))
|
||||
aura->SetDuration(4500);
|
||||
|
||||
if (!GetUnitOwner()->HasAura(SPELL_DEMON_FORM))
|
||||
GetUnitOwner()->ToCreature()->LoadEquipment(1, true);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_UNCAGED_WRATH, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_demon_transform2_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_illidan_demon_transform2_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_flame_burst : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_illidan_flame_burst() : SpellScriptLoader("spell_illidan_flame_burst") { }
|
||||
|
||||
class spell_illidan_flame_burst_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_illidan_flame_burst_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, SPELL_FLAME_BURST_EFFECT, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidan_flame_burst_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_illidan_flame_burst_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_found_target : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_illidan_found_target() : SpellScriptLoader("spell_illidan_found_target") { }
|
||||
|
||||
class spell_illidan_found_target_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_illidan_found_target_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (GetCaster()->GetDistance(target) < 2.0f)
|
||||
// xinef: ugly hax, dunno how it really works on blizz
|
||||
Map::PlayerList const& pl = GetTarget()->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
if (player->GetPositionX() > 693.4f || player->GetPositionY() < 271.8f || player->GetPositionX() < 658.43f || player->GetPositionY() > 338.68f)
|
||||
{
|
||||
GetCaster()->CastSpell(target, SPELL_CONSUME_SOUL, true);
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_FIND_TARGET, true);
|
||||
GetTarget()->CastSpell(player, SPELL_CHARGE, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidan_found_target_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_illidan_found_target_SpellScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_tear_of_azzinoth_summon_channel_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_cage_trap : public SpellScriptLoader
|
||||
class spell_illidan_shadow_prison : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_illidan_cage_trap() : SpellScriptLoader("spell_illidan_cage_trap") { }
|
||||
PrepareSpellScript(spell_illidan_shadow_prison);
|
||||
|
||||
class spell_illidan_cage_trap_SpellScript : public SpellScript
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_illidan_cage_trap_SpellScript);
|
||||
targets.remove_if(PlayerOrPetCheck());
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Creature* target = GetHitCreature())
|
||||
if (GetCaster()->GetExactDist2d(target) < 4.0f)
|
||||
{
|
||||
target->AI()->DoAction(ACTION_ILLIDAN_CAGED);
|
||||
target->CastSpell(target, SPELL_CAGE_TRAP, true);
|
||||
GetCaster()->ToCreature()->DespawnOrUnsummon(1);
|
||||
if (GameObject* gobject = GetCaster()->FindNearestGameObject(GO_CAGE_TRAP, 10.0f))
|
||||
gobject->SetLootState(GO_JUST_DEACTIVATED);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidan_cage_trap_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_illidan_cage_trap_SpellScript();
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_illidan_shadow_prison::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_cage_trap_stun : public SpellScriptLoader
|
||||
class spell_illidan_demon_transform1_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_illidan_cage_trap_stun() : SpellScriptLoader("spell_illidan_cage_trap_stun") { }
|
||||
PrepareAuraScript(spell_illidan_demon_transform1_aura);
|
||||
|
||||
class spell_illidan_cage_trap_stun_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_illidan_cage_trap_stun_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_DEMON_TRANSFORM_2 });
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
bool Load() override
|
||||
{
|
||||
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DEMON_TRANSFORM_2, true);
|
||||
GetUnitOwner()->ToCreature()->LoadEquipment(0, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_demon_transform1_aura::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_demon_transform2_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_illidan_demon_transform2_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_DEMON_FORM, SPELL_DEMON_TRANSFORM_3 });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
if (aurEff->GetTickNumber() == 1)
|
||||
{
|
||||
if (GetUnitOwner()->GetDisplayId() == GetUnitOwner()->GetNativeDisplayId())
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DEMON_FORM, true);
|
||||
else
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(SPELL_DEMON_FORM);
|
||||
}
|
||||
else if (aurEff->GetTickNumber() == 2)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_DEMON_TRANSFORM_3, true);
|
||||
if (Aura* aura = GetUnitOwner()->GetAura(SPELL_DEMON_TRANSFORM_3))
|
||||
aura->SetDuration(4500);
|
||||
|
||||
for (uint32 i = SPELL_CAGED_SUMMON1; i <= SPELL_CAGED_SUMMON8; ++i)
|
||||
GetTarget()->CastSpell(GetTarget(), i, true);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_CAGED_DEBUFF, true);
|
||||
if (!GetUnitOwner()->HasAura(SPELL_DEMON_FORM))
|
||||
GetUnitOwner()->ToCreature()->LoadEquipment(1, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_cage_trap_stun_AuraScript::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_illidan_cage_trap_stun_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_demon_transform2_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_flame_burst : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_illidan_flame_burst);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_FLAME_BURST_EFFECT });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, SPELL_FLAME_BURST_EFFECT, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidan_flame_burst::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_found_target : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_illidan_found_target);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_CONSUME_SOUL, SPELL_FIND_TARGET });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (GetCaster()->GetDistance(target) < 2.0f)
|
||||
{
|
||||
GetCaster()->CastSpell(target, SPELL_CONSUME_SOUL, true);
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_FIND_TARGET, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidan_found_target::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_cage_trap : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_illidan_cage_trap);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_CAGE_TRAP });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Creature* target = GetHitCreature())
|
||||
if (GetCaster()->GetExactDist2d(target) < 4.0f)
|
||||
{
|
||||
target->AI()->DoAction(ACTION_ILLIDAN_CAGED);
|
||||
target->CastSpell(target, SPELL_CAGE_TRAP, true);
|
||||
GetCaster()->ToCreature()->DespawnOrUnsummon(1);
|
||||
if (GameObject* gobject = GetCaster()->FindNearestGameObject(GO_CAGE_TRAP, 10.0f))
|
||||
gobject->SetLootState(GO_JUST_DEACTIVATED);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidan_cage_trap::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidan_cage_trap_stun_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_illidan_cage_trap_stun_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_CAGED_DEBUFF, SPELL_CAGED_SUMMON1, SPELL_CAGED_SUMMON1+1, SPELL_CAGED_SUMMON1+2, SPELL_CAGED_SUMMON1+3, SPELL_CAGED_SUMMON1+4, SPELL_CAGED_SUMMON1+5, SPELL_CAGED_SUMMON1+6, SPELL_CAGED_SUMMON8 });
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
|
||||
for (uint32 i = SPELL_CAGED_SUMMON1; i <= SPELL_CAGED_SUMMON8; ++i)
|
||||
GetTarget()->CastSpell(GetTarget(), i, true);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_CAGED_DEBUFF, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidan_cage_trap_stun_aura::OnPeriodic, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1443,17 +1361,17 @@ void AddSC_boss_illidan()
|
||||
{
|
||||
new boss_illidan_stormrage();
|
||||
new npc_akama_illidan();
|
||||
new spell_illidan_draw_soul();
|
||||
new spell_illidan_parasitic_shadowfiend();
|
||||
new spell_illidan_parasitic_shadowfiend_trigger();
|
||||
new spell_illidan_glaive_throw();
|
||||
new spell_illidan_tear_of_azzinoth_summon_channel();
|
||||
new spell_illidan_shadow_prison();
|
||||
new spell_illidan_demon_transform1();
|
||||
new spell_illidan_demon_transform2();
|
||||
new spell_illidan_flame_burst();
|
||||
new spell_illidan_found_target();
|
||||
new spell_illidan_cage_trap();
|
||||
new spell_illidan_cage_trap_stun();
|
||||
RegisterSpellScript(spell_illidan_draw_soul);
|
||||
RegisterSpellScript(spell_illidan_parasitic_shadowfiend_aura);
|
||||
RegisterSpellAndAuraScriptPair(spell_illidan_parasitic_shadowfiend_trigger, spell_illidan_parasitic_shadowfiend_trigger_aura);
|
||||
RegisterSpellScript(spell_illidan_glaive_throw);
|
||||
RegisterSpellScript(spell_illidan_tear_of_azzinoth_summon_channel_aura);
|
||||
RegisterSpellScript(spell_illidan_shadow_prison);
|
||||
RegisterSpellScript(spell_illidan_demon_transform1_aura);
|
||||
RegisterSpellScript(spell_illidan_demon_transform2_aura);
|
||||
RegisterSpellScript(spell_illidan_flame_burst);
|
||||
RegisterSpellScript(spell_illidan_found_target);
|
||||
RegisterSpellScript(spell_illidan_cage_trap);
|
||||
RegisterSpellScript(spell_illidan_cage_trap_stun_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -171,213 +171,162 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_random_periodic : public SpellScriptLoader
|
||||
class spell_mother_shahraz_random_periodic_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_mother_shahraz_random_periodic() : SpellScriptLoader("spell_mother_shahraz_random_periodic") { }
|
||||
PrepareAuraScript(spell_mother_shahraz_random_periodic_aura);
|
||||
|
||||
class spell_mother_shahraz_random_periodic_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_mother_shahraz_random_periodic_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_SINFUL_PERIODIC, SPELL_SINISTER_PERIODIC, SPELL_VILE_PERIODIC, SPELL_WICKED_PERIODIC });
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (effect->GetTickNumber() % 5 == 1)
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), RAND(SPELL_SINFUL_PERIODIC, SPELL_SINISTER_PERIODIC, SPELL_VILE_PERIODIC, SPELL_WICKED_PERIODIC), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_random_periodic_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
return new spell_mother_shahraz_random_periodic_AuraScript();
|
||||
PreventDefaultAction();
|
||||
if (effect->GetTickNumber() % 5 == 1)
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), RAND(SPELL_SINFUL_PERIODIC, SPELL_SINISTER_PERIODIC, SPELL_VILE_PERIODIC, SPELL_WICKED_PERIODIC), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_random_periodic_aura::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_beam_periodic : public SpellScriptLoader
|
||||
class spell_mother_shahraz_beam_periodic_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_mother_shahraz_beam_periodic() : SpellScriptLoader("spell_mother_shahraz_beam_periodic") { }
|
||||
PrepareAuraScript(spell_mother_shahraz_beam_periodic_aura);
|
||||
|
||||
class spell_mother_shahraz_beam_periodic_AuraScript : public AuraScript
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PrepareAuraScript(spell_mother_shahraz_beam_periodic_AuraScript);
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0))
|
||||
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0))
|
||||
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_beam_periodic_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_mother_shahraz_beam_periodic_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_beam_periodic_aura::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_saber_lash : public SpellScriptLoader
|
||||
class spell_mother_shahraz_saber_lash_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_mother_shahraz_saber_lash() : SpellScriptLoader("spell_mother_shahraz_saber_lash") { }
|
||||
PrepareAuraScript(spell_mother_shahraz_saber_lash_aura);
|
||||
|
||||
class spell_mother_shahraz_saber_lash_AuraScript : public AuraScript
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PrepareAuraScript(spell_mother_shahraz_saber_lash_AuraScript);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetUnitOwner()->GetVictim())
|
||||
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_mother_shahraz_saber_lash_AuraScript::CheckProc);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_saber_lash_AuraScript::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
return new spell_mother_shahraz_saber_lash_AuraScript();
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetUnitOwner()->GetVictim())
|
||||
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_mother_shahraz_saber_lash_aura::CheckProc);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_saber_lash_aura::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction : public SpellScriptLoader
|
||||
class spell_mother_shahraz_fatal_attraction : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_mother_shahraz_fatal_attraction() : SpellScriptLoader("spell_mother_shahraz_fatal_attraction") { }
|
||||
PrepareSpellScript(spell_mother_shahraz_fatal_attraction);
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_mother_shahraz_fatal_attraction_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SABER_LASH_IMMUNITY));
|
||||
if (targets.size() <= 1)
|
||||
FinishCast(SPELL_FAILED_DONT_REPORT);
|
||||
}
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
std::list<TargetInfo> const* targetsInfo = GetSpell()->GetUniqueTargetInfo();
|
||||
for (std::list<TargetInfo>::const_iterator ihit = targetsInfo->begin(); ihit != targetsInfo->end(); ++ihit)
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*GetCaster(), ihit->targetGUID))
|
||||
{
|
||||
dest.Relocate(*target);
|
||||
if (roll_chance_i(50))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void HandleTeleportUnits(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target, SPELL_FATAL_ATTRACTION_AURA, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mother_shahraz_fatal_attraction_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_mother_shahraz_fatal_attraction_SpellScript::SetDest, EFFECT_1, TARGET_DEST_CASTER_RANDOM);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_mother_shahraz_fatal_attraction_SpellScript::HandleTeleportUnits, EFFECT_1, SPELL_EFFECT_TELEPORT_UNITS);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_mother_shahraz_fatal_attraction_SpellScript();
|
||||
return ValidateSpellInfo({ SPELL_FATAL_ATTRACTION_AURA });
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction_dummy : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mother_shahraz_fatal_attraction_dummy() : SpellScriptLoader("spell_mother_shahraz_fatal_attraction_dummy") { }
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction_dummy_SpellScript : public SpellScript
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_mother_shahraz_fatal_attraction_dummy_SpellScript);
|
||||
targets.remove_if(Acore::UnitAuraCheck(true, SPELL_SABER_LASH_IMMUNITY));
|
||||
if (targets.size() <= 1)
|
||||
FinishCast(SPELL_FAILED_DONT_REPORT);
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
std::list<TargetInfo> const* targetsInfo = GetSpell()->GetUniqueTargetInfo();
|
||||
for (std::list<TargetInfo>::const_iterator ihit = targetsInfo->begin(); ihit != targetsInfo->end(); ++ihit)
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*GetCaster(), ihit->targetGUID))
|
||||
{
|
||||
target->CastSpell(target, SPELL_FATAL_ATTRACTION_DAMAGE, true);
|
||||
if (AuraEffect* aurEff = target->GetAuraEffect(SPELL_FATAL_ATTRACTION_AURA, EFFECT_1))
|
||||
aurEff->SetAmount(aurEff->GetTickNumber());
|
||||
dest.Relocate(*target);
|
||||
if (roll_chance_i(50))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_mother_shahraz_fatal_attraction_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void HandleTeleportUnits(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_mother_shahraz_fatal_attraction_dummy_SpellScript();
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target, SPELL_FATAL_ATTRACTION_AURA, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mother_shahraz_fatal_attraction::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_mother_shahraz_fatal_attraction::SetDest, EFFECT_1, TARGET_DEST_CASTER_RANDOM);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_mother_shahraz_fatal_attraction::HandleTeleportUnits, EFFECT_1, SPELL_EFFECT_TELEPORT_UNITS);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction_aura : public SpellScriptLoader
|
||||
class spell_mother_shahraz_fatal_attraction_dummy : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_mother_shahraz_fatal_attraction_aura() : SpellScriptLoader("spell_mother_shahraz_fatal_attraction_aura") { }
|
||||
PrepareSpellScript(spell_mother_shahraz_fatal_attraction_dummy);
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction_aura_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_mother_shahraz_fatal_attraction_aura_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_FATAL_ATTRACTION_DAMAGE });
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
if (effect->GetTickNumber() > uint32(effect->GetAmount() + 1))
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_fatal_attraction_aura_AuraScript::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
return new spell_mother_shahraz_fatal_attraction_aura_AuraScript();
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
target->CastSpell(target, SPELL_FATAL_ATTRACTION_DAMAGE, true);
|
||||
if (AuraEffect* aurEff = target->GetAuraEffect(SPELL_FATAL_ATTRACTION_AURA, EFFECT_1))
|
||||
aurEff->SetAmount(aurEff->GetTickNumber());
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_mother_shahraz_fatal_attraction_dummy::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mother_shahraz_fatal_attraction_aura);
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
if (effect->GetTickNumber() > uint32(effect->GetAmount() + 1))
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_fatal_attraction_aura::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_mother_shahraz()
|
||||
{
|
||||
new boss_mother_shahraz();
|
||||
new spell_mother_shahraz_random_periodic();
|
||||
new spell_mother_shahraz_beam_periodic();
|
||||
new spell_mother_shahraz_saber_lash();
|
||||
new spell_mother_shahraz_fatal_attraction();
|
||||
new spell_mother_shahraz_fatal_attraction_dummy();
|
||||
new spell_mother_shahraz_fatal_attraction_aura();
|
||||
RegisterSpellScript(spell_mother_shahraz_random_periodic_aura);
|
||||
RegisterSpellScript(spell_mother_shahraz_beam_periodic_aura);
|
||||
RegisterSpellScript(spell_mother_shahraz_saber_lash_aura);
|
||||
RegisterSpellScript(spell_mother_shahraz_fatal_attraction);
|
||||
RegisterSpellScript(spell_mother_shahraz_fatal_attraction_dummy);
|
||||
RegisterSpellScript(spell_mother_shahraz_fatal_attraction_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -582,200 +582,155 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_reliquary_of_souls_aura_of_suffering : public SpellScriptLoader
|
||||
class spell_reliquary_of_souls_aura_of_suffering_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_reliquary_of_souls_aura_of_suffering() : SpellScriptLoader("spell_reliquary_of_souls_aura_of_suffering") { }
|
||||
PrepareAuraScript(spell_reliquary_of_souls_aura_of_suffering_aura);
|
||||
|
||||
class spell_reliquary_of_souls_aura_of_suffering_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_reliquary_of_souls_aura_of_suffering_AuraScript)
|
||||
return ValidateSpellInfo({ SPELL_AURA_OF_SUFFERING_TRIGGER });
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_AURA_OF_SUFFERING_TRIGGER, true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->RemoveAurasDueToSpell(SPELL_AURA_OF_SUFFERING_TRIGGER);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_reliquary_of_souls_aura_of_suffering_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_aura_of_suffering_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_reliquary_of_souls_aura_of_suffering_AuraScript();
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_AURA_OF_SUFFERING_TRIGGER, true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->RemoveAurasDueToSpell(SPELL_AURA_OF_SUFFERING_TRIGGER);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_reliquary_of_souls_aura_of_suffering_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_aura_of_suffering_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_reliquary_of_souls_fixate : public SpellScriptLoader
|
||||
class spell_reliquary_of_souls_fixate : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_reliquary_of_souls_fixate() : SpellScriptLoader("spell_reliquary_of_souls_fixate") { }
|
||||
PrepareSpellScript(spell_reliquary_of_souls_fixate);
|
||||
|
||||
class spell_reliquary_of_souls_fixate_SpellScript : public SpellScript
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_reliquary_of_souls_fixate_SpellScript);
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
targets.sort(Acore::ObjectDistanceOrderPred(GetCaster()));
|
||||
WorldObject* target = targets.front();
|
||||
targets.clear();
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_reliquary_of_souls_fixate_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_reliquary_of_souls_fixate_SpellScript();
|
||||
targets.sort(Acore::ObjectDistanceOrderPred(GetCaster()));
|
||||
WorldObject* target = targets.front();
|
||||
targets.clear();
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
class spell_reliquary_of_souls_fixate_AuraScript : public AuraScript
|
||||
void Register() override
|
||||
{
|
||||
PrepareAuraScript(spell_reliquary_of_souls_fixate_AuraScript)
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->RemoveAurasDueToSpell(GetSpellInfo()->Effects[EFFECT_1].TriggerSpell, GetTarget()->GetGUID());
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_fixate_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_reliquary_of_souls_fixate_AuraScript();
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_reliquary_of_souls_fixate::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_reliquary_of_souls_aura_of_desire : public SpellScriptLoader
|
||||
class spell_reliquary_of_souls_fixate_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_reliquary_of_souls_aura_of_desire() : SpellScriptLoader("spell_reliquary_of_souls_aura_of_desire") { }
|
||||
PrepareAuraScript(spell_reliquary_of_souls_fixate_aura);
|
||||
|
||||
class spell_reliquary_of_souls_aura_of_desire_AuraScript : public AuraScript
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_reliquary_of_souls_aura_of_desire_AuraScript);
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->RemoveAurasDueToSpell(GetSpellInfo()->Effects[EFFECT_1].TriggerSpell, GetTarget()->GetGUID());
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
return eventInfo.GetActor() && eventInfo.GetActionTarget();
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActionTarget()->CastCustomSpell(SPELL_AURA_OF_DESIRE_DAMAGE, SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage() / 2, eventInfo.GetActor(), true);
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_2))
|
||||
amount = std::max<int32>(-100, -5 * int32(effect->GetTickNumber()));
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* /*effect*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_1))
|
||||
effect->RecalculateAmount();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_reliquary_of_souls_aura_of_desire_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_reliquary_of_souls_aura_of_desire_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_desire_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_reliquary_of_souls_aura_of_desire_AuraScript::Update, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_reliquary_of_souls_aura_of_desire_AuraScript();
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_fixate_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_reliquary_of_souls_aura_of_anger : public SpellScriptLoader
|
||||
class spell_reliquary_of_souls_aura_of_desire_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_reliquary_of_souls_aura_of_anger() : SpellScriptLoader("spell_reliquary_of_souls_aura_of_anger") { }
|
||||
PrepareAuraScript(spell_reliquary_of_souls_aura_of_desire_aura);
|
||||
|
||||
class spell_reliquary_of_souls_aura_of_anger_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_reliquary_of_souls_aura_of_anger_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_AURA_OF_DESIRE_DAMAGE });
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0))
|
||||
amount = amount * effect->GetTickNumber();
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* /*effect*/)
|
||||
{
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0))
|
||||
effect->RecalculateAmount();
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_1))
|
||||
effect->RecalculateAmount();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_anger_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_anger_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_reliquary_of_souls_aura_of_anger_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
return new spell_reliquary_of_souls_aura_of_anger_AuraScript();
|
||||
return eventInfo.GetActor() && eventInfo.GetActionTarget();
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActionTarget()->CastCustomSpell(SPELL_AURA_OF_DESIRE_DAMAGE, SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage() / 2, eventInfo.GetActor(), true);
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_2))
|
||||
amount = std::max<int32>(-100, -5 * int32(effect->GetTickNumber()));
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* /*effect*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_1))
|
||||
effect->RecalculateAmount();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_reliquary_of_souls_aura_of_desire_aura::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_reliquary_of_souls_aura_of_desire_aura::HandleProc, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_desire_aura::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_reliquary_of_souls_aura_of_desire_aura::Update, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_reliquary_of_souls_spite : public SpellScriptLoader
|
||||
class spell_reliquary_of_souls_aura_of_anger_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_reliquary_of_souls_spite() : SpellScriptLoader("spell_reliquary_of_souls_spite") { }
|
||||
PrepareAuraScript(spell_reliquary_of_souls_aura_of_anger_aura);
|
||||
|
||||
class spell_reliquary_of_souls_spite_AuraScript : public AuraScript
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
PrepareAuraScript(spell_reliquary_of_souls_spite_AuraScript)
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0))
|
||||
amount = amount * effect->GetTickNumber();
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetTarget(), SPELL_SPITE_DAMAGE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_spite_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DAMAGE_IMMUNITY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Update(AuraEffect const* /*effect*/)
|
||||
{
|
||||
return new spell_reliquary_of_souls_spite_AuraScript();
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0))
|
||||
effect->RecalculateAmount();
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_1))
|
||||
effect->RecalculateAmount();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_anger_aura::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_anger_aura::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_reliquary_of_souls_aura_of_anger_aura::Update, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_reliquary_of_souls_spite_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_reliquary_of_souls_spite_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_SPITE_DAMAGE });
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetTarget(), SPELL_SPITE_DAMAGE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_spite_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DAMAGE_IMMUNITY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -785,10 +740,10 @@ void AddSC_boss_reliquary_of_souls()
|
||||
new boss_essence_of_suffering();
|
||||
new boss_essence_of_desire();
|
||||
new boss_essence_of_anger();
|
||||
new spell_reliquary_of_souls_aura_of_suffering();
|
||||
new spell_reliquary_of_souls_fixate();
|
||||
new spell_reliquary_of_souls_aura_of_desire();
|
||||
new spell_reliquary_of_souls_aura_of_anger();
|
||||
new spell_reliquary_of_souls_spite();
|
||||
RegisterSpellScript(spell_reliquary_of_souls_aura_of_suffering_aura);
|
||||
RegisterSpellAndAuraScriptPair(spell_reliquary_of_souls_fixate, spell_reliquary_of_souls_fixate_aura);
|
||||
RegisterSpellScript(spell_reliquary_of_souls_aura_of_desire_aura);
|
||||
RegisterSpellScript(spell_reliquary_of_souls_aura_of_anger_aura);
|
||||
RegisterSpellScript(spell_reliquary_of_souls_spite_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -556,191 +556,141 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
class spell_illidari_council_balance_of_power : public SpellScriptLoader
|
||||
class spell_illidari_council_balance_of_power_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_illidari_council_balance_of_power() : SpellScriptLoader("spell_illidari_council_balance_of_power") { }
|
||||
PrepareAuraScript(spell_illidari_council_balance_of_power_aura);
|
||||
|
||||
class spell_illidari_council_balance_of_power_AuraScript : public AuraScript
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
PrepareAuraScript(spell_illidari_council_balance_of_power_AuraScript);
|
||||
// Set absorbtion amount to unlimited (no absorb)
|
||||
amount = -1;
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
// Set absorbtion amount to unlimited (no absorb)
|
||||
amount = -1;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_illidari_council_balance_of_power_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_illidari_council_balance_of_power_AuraScript();
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_illidari_council_balance_of_power_aura::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidari_council_empyreal_balance : public SpellScriptLoader
|
||||
class spell_illidari_council_empyreal_balance : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_illidari_council_empyreal_balance() : SpellScriptLoader("spell_illidari_council_empyreal_balance") { }
|
||||
PrepareSpellScript(spell_illidari_council_empyreal_balance);
|
||||
|
||||
class spell_illidari_council_empyreal_balance_SpellScript : public SpellScript
|
||||
bool Load() override
|
||||
{
|
||||
PrepareSpellScript(spell_illidari_council_empyreal_balance_SpellScript);
|
||||
_sharedHealth = 0;
|
||||
_sharedHealthMax = 0;
|
||||
_targetCount = 0;
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
_sharedHealth = 0;
|
||||
_sharedHealthMax = 0;
|
||||
_targetCount = 0;
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
_targetCount++;
|
||||
_sharedHealth += target->GetHealth();
|
||||
_sharedHealthMax += target->GetMaxHealth();
|
||||
}
|
||||
}
|
||||
|
||||
void HandleAfterCast()
|
||||
{
|
||||
if (_targetCount != 4)
|
||||
{
|
||||
GetCaster()->ToCreature()->AI()->EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
float pct = (_sharedHealth / _sharedHealthMax) * 100.0f;
|
||||
std::list<TargetInfo> const* targetsInfo = GetSpell()->GetUniqueTargetInfo();
|
||||
for (std::list<TargetInfo>::const_iterator ihit = targetsInfo->begin(); ihit != targetsInfo->end(); ++ihit)
|
||||
if (Creature* target = ObjectAccessor::GetCreature(*GetCaster(), ihit->targetGUID))
|
||||
{
|
||||
_targetCount++;
|
||||
_sharedHealth += target->GetHealth();
|
||||
_sharedHealthMax += target->GetMaxHealth();
|
||||
target->LowerPlayerDamageReq(target->GetMaxHealth());
|
||||
target->SetHealth(CalculatePct(target->GetMaxHealth(), pct));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HandleAfterCast()
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidari_council_empyreal_balance::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
AfterCast += SpellCastFn(spell_illidari_council_empyreal_balance::HandleAfterCast);
|
||||
}
|
||||
|
||||
private:
|
||||
float _sharedHealth;
|
||||
float _sharedHealthMax;
|
||||
uint8 _targetCount;
|
||||
};
|
||||
|
||||
class spell_illidari_council_reflective_shield_aura : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_illidari_council_reflective_shield_aura);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_REFLECTIVE_SHIELD_T });
|
||||
}
|
||||
|
||||
void ReflectDamage(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (dmgInfo.GetAttacker() == target)
|
||||
return;
|
||||
|
||||
int32 bp = absorbAmount / 2;
|
||||
target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_REFLECTIVE_SHIELD_T, &bp, nullptr, nullptr, true, nullptr, aurEff);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_illidari_council_reflective_shield_aura::ReflectDamage, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidari_council_judgement : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_illidari_council_judgement);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit::AuraEffectList const& auras = GetCaster()->GetAuraEffectsByType(SPELL_AURA_DUMMY);
|
||||
for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
|
||||
{
|
||||
if (_targetCount != 4)
|
||||
{
|
||||
GetCaster()->ToCreature()->AI()->EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
float pct = (_sharedHealth / _sharedHealthMax) * 100.0f;
|
||||
std::list<TargetInfo> const* targetsInfo = GetSpell()->GetUniqueTargetInfo();
|
||||
for (std::list<TargetInfo>::const_iterator ihit = targetsInfo->begin(); ihit != targetsInfo->end(); ++ihit)
|
||||
if (Creature* target = ObjectAccessor::GetCreature(*GetCaster(), ihit->targetGUID))
|
||||
if ((*i)->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_SEAL && (*i)->GetEffIndex() == EFFECT_2)
|
||||
if (sSpellMgr->GetSpellInfo((*i)->GetAmount()))
|
||||
{
|
||||
target->LowerPlayerDamageReq(target->GetMaxHealth());
|
||||
target->SetHealth(CalculatePct(target->GetMaxHealth(), pct));
|
||||
GetCaster()->CastSpell(GetHitUnit(), (*i)->GetAmount(), true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidari_council_empyreal_balance_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
AfterCast += SpellCastFn(spell_illidari_council_empyreal_balance_SpellScript::HandleAfterCast);
|
||||
}
|
||||
|
||||
private:
|
||||
float _sharedHealth;
|
||||
float _sharedHealthMax;
|
||||
uint8 _targetCount;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_illidari_council_empyreal_balance_SpellScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidari_council_judgement::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidari_council_reflective_shield : public SpellScriptLoader
|
||||
class spell_illidari_council_deadly_strike_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_illidari_council_reflective_shield() : SpellScriptLoader("spell_illidari_council_reflective_shield") { }
|
||||
PrepareAuraScript(spell_illidari_council_deadly_strike_aura);
|
||||
|
||||
class spell_illidari_council_reflective_shield_AuraScript : public AuraScript
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PrepareAuraScript(spell_illidari_council_reflective_shield_AuraScript);
|
||||
|
||||
void ReflectDamage(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (dmgInfo.GetAttacker() == target)
|
||||
return;
|
||||
|
||||
int32 bp = absorbAmount / 2;
|
||||
target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_REFLECTIVE_SHIELD_T, &bp, nullptr, nullptr, true, nullptr, aurEff);
|
||||
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
|
||||
GetUnitOwner()->m_Events.AddEvent(new VerasEnvenom(*GetUnitOwner(), target->GetGUID()), GetUnitOwner()->m_Events.CalculateTime(urand(1500, 3500)));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_illidari_council_reflective_shield_AuraScript::ReflectDamage, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_illidari_council_reflective_shield_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidari_council_judgement : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_illidari_council_judgement() : SpellScriptLoader("spell_illidari_council_judgement") { }
|
||||
|
||||
class spell_illidari_council_judgement_SpellScript : public SpellScript
|
||||
void Register() override
|
||||
{
|
||||
PrepareSpellScript(spell_illidari_council_judgement_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit::AuraEffectList const& auras = GetCaster()->GetAuraEffectsByType(SPELL_AURA_DUMMY);
|
||||
for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
|
||||
{
|
||||
if ((*i)->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_SEAL && (*i)->GetEffIndex() == EFFECT_2)
|
||||
if (sSpellMgr->GetSpellInfo((*i)->GetAmount()))
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitUnit(), (*i)->GetAmount(), true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidari_council_judgement_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_illidari_council_judgement_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidari_council_deadly_strike : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_illidari_council_deadly_strike() : SpellScriptLoader("spell_illidari_council_deadly_strike") { }
|
||||
|
||||
class spell_illidari_council_deadly_strike_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_illidari_council_deadly_strike_AuraScript);
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
|
||||
{
|
||||
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
|
||||
GetUnitOwner()->m_Events.AddEvent(new VerasEnvenom(*GetUnitOwner(), target->GetGUID()), GetUnitOwner()->m_Events.CalculateTime(urand(1500, 3500)));
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidari_council_deadly_strike_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_illidari_council_deadly_strike_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidari_council_deadly_strike_aura::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -751,10 +701,10 @@ void AddSC_boss_illidari_council()
|
||||
new boss_lady_malande();
|
||||
new boss_veras_darkshadow();
|
||||
new boss_high_nethermancer_zerevor();
|
||||
new spell_illidari_council_balance_of_power();
|
||||
new spell_illidari_council_empyreal_balance();
|
||||
new spell_illidari_council_reflective_shield();
|
||||
new spell_illidari_council_judgement();
|
||||
new spell_illidari_council_deadly_strike();
|
||||
RegisterSpellScript(spell_illidari_council_balance_of_power_aura);
|
||||
RegisterSpellScript(spell_illidari_council_empyreal_balance);
|
||||
RegisterSpellScript(spell_illidari_council_reflective_shield_aura);
|
||||
RegisterSpellScript(spell_illidari_council_judgement);
|
||||
RegisterSpellScript(spell_illidari_council_deadly_strike_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -188,402 +188,290 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_template_harpooners_mark : public SpellScriptLoader
|
||||
class spell_black_template_harpooners_mark_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_black_template_harpooners_mark() : SpellScriptLoader("spell_black_template_harpooners_mark") { }
|
||||
PrepareAuraScript(spell_black_template_harpooners_mark_aura);
|
||||
|
||||
class spell_black_template_harpooners_mark_AuraScript : public AuraScript
|
||||
bool Load() override
|
||||
{
|
||||
PrepareAuraScript(spell_black_template_harpooners_mark_AuraScript)
|
||||
_turtleSet.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
std::list<Creature*> creatureList;
|
||||
GetUnitOwner()->GetCreaturesWithEntryInRange(creatureList, 80.0f, NPC_DRAGON_TURTLE);
|
||||
for (std::list<Creature*>::const_iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
|
||||
{
|
||||
_turtleSet.clear();
|
||||
return true;
|
||||
(*itr)->TauntApply(GetUnitOwner());
|
||||
(*itr)->AddThreat(GetUnitOwner(), 10000000.0f);
|
||||
_turtleSet.insert((*itr)->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
std::list<Creature*> creatureList;
|
||||
GetUnitOwner()->GetCreaturesWithEntryInRange(creatureList, 80.0f, NPC_DRAGON_TURTLE);
|
||||
for (std::list<Creature*>::const_iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
for (ObjectGuid const& guid : _turtleSet)
|
||||
if (Creature* turtle = ObjectAccessor::GetCreature(*GetUnitOwner(), guid))
|
||||
{
|
||||
(*itr)->TauntApply(GetUnitOwner());
|
||||
(*itr)->AddThreat(GetUnitOwner(), 10000000.0f);
|
||||
_turtleSet.insert((*itr)->GetGUID());
|
||||
turtle->TauntFadeOut(GetUnitOwner());
|
||||
turtle->AddThreat(GetUnitOwner(), -10000000.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
for (ObjectGuid const& guid : _turtleSet)
|
||||
if (Creature* turtle = ObjectAccessor::GetCreature(*GetUnitOwner(), guid))
|
||||
{
|
||||
turtle->TauntFadeOut(GetUnitOwner());
|
||||
turtle->AddThreat(GetUnitOwner(), -10000000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_black_template_harpooners_mark_AuraScript::HandleEffectApply, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_black_template_harpooners_mark_AuraScript::HandleEffectRemove, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
private:
|
||||
GuidSet _turtleSet;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_black_template_harpooners_mark_AuraScript();
|
||||
OnEffectApply += AuraEffectApplyFn(spell_black_template_harpooners_mark_aura::HandleEffectApply, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_black_template_harpooners_mark_aura::HandleEffectRemove, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
private:
|
||||
GuidSet _turtleSet;
|
||||
};
|
||||
|
||||
class spell_black_template_free_friend : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_black_template_free_friend);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->RemoveAurasWithMechanic(IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_black_template_free_friend::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_template_free_friend : public SpellScriptLoader
|
||||
class spell_black_temple_curse_of_the_bleakheart_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_black_template_free_friend() : SpellScriptLoader("spell_black_template_free_friend") { }
|
||||
PrepareAuraScript(spell_black_temple_curse_of_the_bleakheart_aura);
|
||||
|
||||
class spell_black_template_free_friend_SpellScript : public SpellScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareSpellScript(spell_black_template_free_friend_SpellScript);
|
||||
return ValidateSpellInfo({ SPELL_CHEST_PAINS });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->RemoveAurasWithMechanic(IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_black_template_free_friend_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
return new spell_black_template_free_friend_SpellScript();
|
||||
isPeriodic = true;
|
||||
amplitude = 5000;
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* /*effect*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (roll_chance_i(20))
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_CHEST_PAINS, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_black_temple_curse_of_the_bleakheart_aura::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_curse_of_the_bleakheart_aura::Update, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_curse_of_the_bleakheart : public SpellScriptLoader
|
||||
class spell_black_temple_skeleton_shot_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_black_temple_curse_of_the_bleakheart() : SpellScriptLoader("spell_black_temple_curse_of_the_bleakheart") { }
|
||||
PrepareAuraScript(spell_black_temple_skeleton_shot_aura);
|
||||
|
||||
class spell_black_temple_curse_of_the_bleakheart_AuraScript : public AuraScript
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_curse_of_the_bleakheart_AuraScript);
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
|
||||
GetTarget()->CastSpell(GetTarget(), GetSpellInfo()->Effects[EFFECT_2].CalcValue(), true);
|
||||
}
|
||||
|
||||
void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
isPeriodic = true;
|
||||
amplitude = 5000;
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* /*effect*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (roll_chance_i(20))
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_CHEST_PAINS, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_black_temple_curse_of_the_bleakheart_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_curse_of_the_bleakheart_AuraScript::Update, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_black_temple_curse_of_the_bleakheart_AuraScript();
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_black_temple_skeleton_shot_aura::HandleEffectRemove, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_skeleton_shot : public SpellScriptLoader
|
||||
class spell_black_temple_wyvern_sting_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_black_temple_skeleton_shot() : SpellScriptLoader("spell_black_temple_skeleton_shot") { }
|
||||
PrepareAuraScript(spell_black_temple_wyvern_sting_aura);
|
||||
|
||||
class spell_black_temple_skeleton_shot_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_skeleton_shot_AuraScript)
|
||||
return ValidateSpellInfo({ SPELL_WYVERN_STING });
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
|
||||
GetTarget()->CastSpell(GetTarget(), GetSpellInfo()->Effects[EFFECT_2].CalcValue(), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_black_temple_skeleton_shot_AuraScript::HandleEffectRemove, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_black_temple_skeleton_shot_AuraScript();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetTarget(), SPELL_WYVERN_STING, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_black_temple_wyvern_sting_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_wyvern_sting : public SpellScriptLoader
|
||||
class spell_black_temple_charge_rage_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_black_temple_wyvern_sting() : SpellScriptLoader("spell_black_temple_wyvern_sting") { }
|
||||
PrepareAuraScript(spell_black_temple_charge_rage_aura);
|
||||
|
||||
class spell_black_temple_wyvern_sting_AuraScript : public AuraScript
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_wyvern_sting_AuraScript)
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetUnitOwner()->SelectNearbyNoTotemTarget((Unit*)nullptr, 50.0f))
|
||||
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetTarget(), SPELL_WYVERN_STING, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_black_temple_wyvern_sting_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_black_temple_wyvern_sting_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_charge_rage_aura::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_charge_rage : public SpellScriptLoader
|
||||
class spell_black_temple_shadow_inferno_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_black_temple_charge_rage() : SpellScriptLoader("spell_black_temple_charge_rage") { }
|
||||
PrepareAuraScript(spell_black_temple_shadow_inferno_aura);
|
||||
|
||||
class spell_black_temple_charge_rage_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_charge_rage_AuraScript);
|
||||
return ValidateSpellInfo({ SPELL_SHADOW_INFERNO_DAMAGE });
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetUnitOwner()->SelectNearbyNoTotemTarget((Unit*)nullptr, 50.0f))
|
||||
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_charge_rage_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
return new spell_black_temple_charge_rage_AuraScript();
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->CastCustomSpell(SPELL_SHADOW_INFERNO_DAMAGE, SPELLVALUE_BASE_POINT0, effect->GetAmount(), GetUnitOwner(), TRIGGERED_FULL_MASK);
|
||||
GetAura()->GetEffect(effect->GetEffIndex())->SetAmount(effect->GetAmount() + 500);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_shadow_inferno_aura::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_shadow_inferno : public SpellScriptLoader
|
||||
class spell_black_temple_spell_absorption_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_black_temple_shadow_inferno() : SpellScriptLoader("spell_black_temple_shadow_inferno") { }
|
||||
PrepareAuraScript(spell_black_temple_spell_absorption_aura);
|
||||
|
||||
class spell_black_temple_shadow_inferno_AuraScript : public AuraScript
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_shadow_inferno_AuraScript);
|
||||
// Set absorbtion amount to unlimited
|
||||
amount = -1;
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->CastCustomSpell(SPELL_SHADOW_INFERNO_DAMAGE, SPELLVALUE_BASE_POINT0, effect->GetAmount(), GetUnitOwner(), TRIGGERED_FULL_MASK);
|
||||
GetAura()->GetEffect(effect->GetEffIndex())->SetAmount(effect->GetAmount() + 500);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_shadow_inferno_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
return new spell_black_temple_shadow_inferno_AuraScript();
|
||||
absorbAmount = dmgInfo.GetDamage();
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
uint32 count = GetUnitOwner()->GetAuraCount(SPELL_CHAOTIC_CHARGE);
|
||||
if (count == 0)
|
||||
return;
|
||||
|
||||
GetUnitOwner()->CastCustomSpell(GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, SPELLVALUE_BASE_POINT0, effect->GetAmount()*count, GetUnitOwner(), TRIGGERED_FULL_MASK);
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(SPELL_CHAOTIC_CHARGE);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_black_temple_spell_absorption_aura::CalculateAmount, EFFECT_2, SPELL_AURA_SCHOOL_ABSORB);
|
||||
OnEffectAbsorb += AuraEffectAbsorbFn(spell_black_temple_spell_absorption_aura::Absorb, EFFECT_2);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_spell_absorption_aura::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_spell_absorption : public SpellScriptLoader
|
||||
class spell_black_temple_bloodbolt : public SpellScript
|
||||
{
|
||||
public:
|
||||
spell_black_temple_spell_absorption() : SpellScriptLoader("spell_black_temple_spell_absorption") { }
|
||||
PrepareSpellScript(spell_black_temple_bloodbolt);
|
||||
|
||||
class spell_black_temple_spell_absorption_AuraScript : public AuraScript
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_spell_absorption_AuraScript);
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target, GetEffectValue(), true);
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
// Set absorbtion amount to unlimited
|
||||
amount = -1;
|
||||
}
|
||||
|
||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
absorbAmount = dmgInfo.GetDamage();
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
uint32 count = GetUnitOwner()->GetAuraCount(SPELL_CHAOTIC_CHARGE);
|
||||
if (count == 0)
|
||||
return;
|
||||
|
||||
GetUnitOwner()->CastCustomSpell(GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, SPELLVALUE_BASE_POINT0, effect->GetAmount()*count, GetUnitOwner(), TRIGGERED_FULL_MASK);
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(SPELL_CHAOTIC_CHARGE);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_black_temple_spell_absorption_AuraScript::CalculateAmount, EFFECT_2, SPELL_AURA_SCHOOL_ABSORB);
|
||||
OnEffectAbsorb += AuraEffectAbsorbFn(spell_black_temple_spell_absorption_AuraScript::Absorb, EFFECT_2);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_spell_absorption_AuraScript::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_black_temple_spell_absorption_AuraScript();
|
||||
OnEffectHitTarget += SpellEffectFn(spell_black_temple_bloodbolt::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_bloodbolt : public SpellScriptLoader
|
||||
class spell_black_temple_consuming_strikes_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_black_temple_bloodbolt() : SpellScriptLoader("spell_black_temple_bloodbolt") { }
|
||||
PrepareAuraScript(spell_black_temple_consuming_strikes_aura);
|
||||
|
||||
class spell_black_temple_bloodbolt_SpellScript : public SpellScript
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PrepareSpellScript(spell_black_temple_bloodbolt_SpellScript);
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastCustomSpell(GetSpellInfo()->Effects[EFFECT_1].CalcValue(), SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage(), GetTarget(), true);
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target, GetEffectValue(), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_black_temple_bloodbolt_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_black_temple_bloodbolt_SpellScript();
|
||||
OnEffectProc += AuraEffectProcFn(spell_black_temple_consuming_strikes_aura::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_consuming_strikes : public SpellScriptLoader
|
||||
class spell_black_temple_curse_of_vitality_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_black_temple_consuming_strikes() : SpellScriptLoader("spell_black_temple_consuming_strikes") { }
|
||||
PrepareAuraScript(spell_black_temple_curse_of_vitality_aura);
|
||||
|
||||
class spell_black_temple_consuming_strikes_AuraScript : public AuraScript
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_consuming_strikes_AuraScript);
|
||||
if (GetUnitOwner()->HealthBelowPct(50))
|
||||
SetDuration(0);
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastCustomSpell(GetSpellInfo()->Effects[EFFECT_1].CalcValue(), SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage(), GetTarget(), true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_black_temple_consuming_strikes_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_black_temple_consuming_strikes_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_curse_of_vitality_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_curse_of_vitality : public SpellScriptLoader
|
||||
class spell_black_temple_dementia_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_black_temple_curse_of_vitality() : SpellScriptLoader("spell_black_temple_curse_of_vitality") { }
|
||||
PrepareAuraScript(spell_black_temple_dementia_aura);
|
||||
|
||||
class spell_black_temple_curse_of_vitality_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_curse_of_vitality_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (GetUnitOwner()->HealthBelowPct(50))
|
||||
SetDuration(0);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_curse_of_vitality_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_black_temple_curse_of_vitality_AuraScript();
|
||||
return ValidateSpellInfo({ SPELL_DEMENTIA1, SPELL_DEMENTIA2 });
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_dementia : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_temple_dementia() : SpellScriptLoader("spell_black_temple_dementia") { }
|
||||
|
||||
class spell_black_temple_dementia_AuraScript : public AuraScript
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_dementia_AuraScript);
|
||||
if (roll_chance_i(50))
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DEMENTIA1, true);
|
||||
else
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DEMENTIA2, true);
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (roll_chance_i(50))
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DEMENTIA1, true);
|
||||
else
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DEMENTIA2, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_dementia_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_black_temple_dementia_AuraScript();
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_dementia_aura::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_black_temple()
|
||||
{
|
||||
new instance_black_temple();
|
||||
new spell_black_template_harpooners_mark();
|
||||
new spell_black_template_free_friend();
|
||||
new spell_black_temple_curse_of_the_bleakheart();
|
||||
new spell_black_temple_skeleton_shot();
|
||||
new spell_black_temple_wyvern_sting();
|
||||
new spell_black_temple_charge_rage();
|
||||
new spell_black_temple_shadow_inferno();
|
||||
new spell_black_temple_spell_absorption();
|
||||
new spell_black_temple_bloodbolt();
|
||||
new spell_black_temple_consuming_strikes();
|
||||
new spell_black_temple_curse_of_vitality();
|
||||
new spell_black_temple_dementia();
|
||||
RegisterSpellScript(spell_black_template_harpooners_mark_aura);
|
||||
RegisterSpellScript(spell_black_template_free_friend);
|
||||
RegisterSpellScript(spell_black_temple_curse_of_the_bleakheart_aura);
|
||||
RegisterSpellScript(spell_black_temple_skeleton_shot_aura);
|
||||
RegisterSpellScript(spell_black_temple_wyvern_sting_aura);
|
||||
RegisterSpellScript(spell_black_temple_charge_rage_aura);
|
||||
RegisterSpellScript(spell_black_temple_shadow_inferno_aura);
|
||||
RegisterSpellScript(spell_black_temple_spell_absorption_aura);
|
||||
RegisterSpellScript(spell_black_temple_bloodbolt);
|
||||
RegisterSpellScript(spell_black_temple_consuming_strikes_aura);
|
||||
RegisterSpellScript(spell_black_temple_curse_of_vitality_aura);
|
||||
RegisterSpellScript(spell_black_temple_dementia_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -145,37 +145,26 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_the_eye_countercharge : public SpellScriptLoader
|
||||
class spell_the_eye_countercharge_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_the_eye_countercharge() : SpellScriptLoader("spell_the_eye_countercharge") { }
|
||||
PrepareAuraScript(spell_the_eye_countercharge_aura);
|
||||
|
||||
class spell_the_eye_counterchargeScript : public AuraScript
|
||||
bool PrepareProc(ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
PrepareAuraScript(spell_the_eye_counterchargeScript);
|
||||
// xinef: prevent charge drop
|
||||
PreventDefaultAction();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PrepareProc(ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
// xinef: prevent charge drop
|
||||
PreventDefaultAction();
|
||||
return true;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_the_eye_counterchargeScript::PrepareProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void Register() override
|
||||
{
|
||||
return new spell_the_eye_counterchargeScript();
|
||||
DoCheckProc += AuraCheckProcFn(spell_the_eye_countercharge_aura::PrepareProc);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_the_eye()
|
||||
{
|
||||
new instance_the_eye();
|
||||
new spell_the_eye_countercharge();
|
||||
RegisterSpellScript(spell_the_eye_countercharge_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -585,37 +585,31 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_arcatraz_soul_steal : public SpellScriptLoader
|
||||
class spell_arcatraz_soul_steal_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_arcatraz_soul_steal() : SpellScriptLoader("spell_arcatraz_soul_steal") { }
|
||||
PrepareAuraScript(spell_arcatraz_soul_steal_aura);
|
||||
|
||||
class spell_arcatraz_soul_steal_AuraScript : public AuraScript
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
PrepareAuraScript(spell_arcatraz_soul_steal_AuraScript)
|
||||
return ValidateSpellInfo({ SPELL_SOUL_STEAL });
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, SPELL_SOUL_STEAL, true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->RemoveAurasDueToSpell(SPELL_SOUL_STEAL);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_arcatraz_soul_steal_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_arcatraz_soul_steal_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
return new spell_arcatraz_soul_steal_AuraScript();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, SPELL_SOUL_STEAL, true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->RemoveAurasDueToSpell(SPELL_SOUL_STEAL);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_arcatraz_soul_steal_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_arcatraz_soul_steal_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -624,6 +618,6 @@ void AddSC_arcatraz()
|
||||
new npc_millhouse_manastorm();
|
||||
new npc_warden_mellichar();
|
||||
|
||||
new spell_arcatraz_soul_steal();
|
||||
RegisterSpellScript(spell_arcatraz_soul_steal_aura);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,136 +42,114 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class spell_botanica_call_of_the_falcon : public SpellScriptLoader
|
||||
class spell_botanica_call_of_the_falcon_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_botanica_call_of_the_falcon() : SpellScriptLoader("spell_botanica_call_of_the_falcon") { }
|
||||
PrepareAuraScript(spell_botanica_call_of_the_falcon_aura);
|
||||
|
||||
class spell_botanica_call_of_the_falcon_AuraScript : public AuraScript
|
||||
bool Load() override
|
||||
{
|
||||
PrepareAuraScript(spell_botanica_call_of_the_falcon_AuraScript)
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
_falconSet.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
std::list<Creature*> creatureList;
|
||||
GetUnitOwner()->GetCreaturesWithEntryInRange(creatureList, 80.0f, NPC_BLOODFALCON);
|
||||
for (std::list<Creature*>::const_iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
|
||||
{
|
||||
(*itr)->TauntApply(GetUnitOwner());
|
||||
(*itr)->AddThreat(GetUnitOwner(), 10000000.0f);
|
||||
_falconSet.insert((*itr)->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
for (ObjectGuid const& guid : _falconSet)
|
||||
if (Creature* falcon = ObjectAccessor::GetCreature(*GetUnitOwner(), guid))
|
||||
{
|
||||
falcon->TauntFadeOut(GetUnitOwner());
|
||||
falcon->AddThreat(GetUnitOwner(), -10000000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_botanica_call_of_the_falcon_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_botanica_call_of_the_falcon_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
private:
|
||||
GuidSet _falconSet;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_botanica_call_of_the_falcon_AuraScript();
|
||||
_falconSet.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
std::list<Creature*> creatureList;
|
||||
GetUnitOwner()->GetCreaturesWithEntryInRange(creatureList, 80.0f, NPC_BLOODFALCON);
|
||||
for (std::list<Creature*>::const_iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
|
||||
{
|
||||
(*itr)->TauntApply(GetUnitOwner());
|
||||
(*itr)->AddThreat(GetUnitOwner(), 10000000.0f);
|
||||
_falconSet.insert((*itr)->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
for (ObjectGuid const& guid : _falconSet)
|
||||
if (Creature* falcon = ObjectAccessor::GetCreature(*GetUnitOwner(), guid))
|
||||
{
|
||||
falcon->TauntFadeOut(GetUnitOwner());
|
||||
falcon->AddThreat(GetUnitOwner(), -10000000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_botanica_call_of_the_falcon_aura::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_botanica_call_of_the_falcon_aura::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
private:
|
||||
GuidSet _falconSet;
|
||||
};
|
||||
|
||||
class spell_botanica_shift_form : public SpellScriptLoader
|
||||
class spell_botanica_shift_form_aura : public AuraScript
|
||||
{
|
||||
public:
|
||||
spell_botanica_shift_form() : SpellScriptLoader("spell_botanica_shift_form") { }
|
||||
PrepareAuraScript(spell_botanica_shift_form_aura);
|
||||
|
||||
class spell_botanica_shift_form_AuraScript : public AuraScript
|
||||
bool Load() override
|
||||
{
|
||||
PrepareAuraScript(spell_botanica_shift_form_AuraScript);
|
||||
_lastSchool = 0;
|
||||
_lastForm = 0;
|
||||
_swapTime = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
|
||||
{
|
||||
_lastSchool = 0;
|
||||
_lastForm = 0;
|
||||
_swapTime = 0;
|
||||
return true;
|
||||
}
|
||||
if ((spellInfo->GetSchoolMask() & _lastSchool) && _swapTime > GameTime::GetGameTime().count())
|
||||
return false;
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
|
||||
uint32 form = 0;
|
||||
switch (GetFirstSchoolInMask(spellInfo->GetSchoolMask()))
|
||||
{
|
||||
if ((spellInfo->GetSchoolMask() & _lastSchool) && _swapTime > GameTime::GetGameTime().count())
|
||||
return false;
|
||||
|
||||
uint32 form = 0;
|
||||
switch (GetFirstSchoolInMask(spellInfo->GetSchoolMask()))
|
||||
{
|
||||
case SPELL_SCHOOL_FIRE:
|
||||
form = SPELL_FIRE_FORM;
|
||||
break;
|
||||
case SPELL_SCHOOL_FROST:
|
||||
form = SPELL_FROST_FORM;
|
||||
break;
|
||||
case SPELL_SCHOOL_ARCANE:
|
||||
form = SPELL_ARCANE_FORM;
|
||||
break;
|
||||
case SPELL_SCHOOL_SHADOW:
|
||||
form = SPELL_SHADOW_FORM;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (form)
|
||||
{
|
||||
_swapTime = GameTime::GetGameTime().count() + 6;
|
||||
_lastSchool = spellInfo->GetSchoolMask();
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(_lastForm);
|
||||
_lastForm = form;
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), _lastForm, true);
|
||||
}
|
||||
case SPELL_SCHOOL_FIRE:
|
||||
form = SPELL_FIRE_FORM;
|
||||
break;
|
||||
case SPELL_SCHOOL_FROST:
|
||||
form = SPELL_FROST_FORM;
|
||||
break;
|
||||
case SPELL_SCHOOL_ARCANE:
|
||||
form = SPELL_ARCANE_FORM;
|
||||
break;
|
||||
case SPELL_SCHOOL_SHADOW:
|
||||
form = SPELL_SHADOW_FORM;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
if (form)
|
||||
{
|
||||
_swapTime = GameTime::GetGameTime().count() + 6;
|
||||
_lastSchool = spellInfo->GetSchoolMask();
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(_lastForm);
|
||||
_lastForm = form;
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), _lastForm, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_botanica_shift_form_AuraScript::CheckProc);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _lastSchool;
|
||||
uint32 _lastForm;
|
||||
uint32 _swapTime;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_botanica_shift_form_AuraScript();
|
||||
return false;
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_botanica_shift_form_aura::CheckProc);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _lastSchool;
|
||||
uint32 _lastForm;
|
||||
uint32 _swapTime;
|
||||
};
|
||||
|
||||
void AddSC_instance_the_botanica()
|
||||
{
|
||||
new instance_the_botanica();
|
||||
new spell_botanica_call_of_the_falcon();
|
||||
new spell_botanica_shift_form();
|
||||
RegisterSpellScript(spell_botanica_call_of_the_falcon_aura);
|
||||
RegisterSpellScript(spell_botanica_shift_form_aura);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user