mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/WaycrestManor: Implement Lord and Lady Waycrest encounter (#30086)
This commit is contained in:
34
sql/updates/world/master/2024_07_18_00_world.sql
Normal file
34
sql/updates/world/master/2024_07_18_00_world.sql
Normal file
@@ -0,0 +1,34 @@
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_lady_waycrest' WHERE `entry`=131545; -- Lady Waycrest
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_lord_waycrest' WHERE `entry`=131527; -- Lord Waycrest
|
||||
UPDATE `creature_template_difficulty` SET `StaticFlags4`=8192, `VerifiedBuild`=55461 WHERE `Entry` IN (131545, 131527); -- CREATURE_STATIC_FLAG_4_IGNORE_LOS_WHEN_CASTING_ON_ME
|
||||
|
||||
DELETE FROM `spell_target_position` WHERE (`ID`=267082 AND `EffectIndex`=0);
|
||||
INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `VerifiedBuild`) VALUES
|
||||
(267082, 0, 1862, -556.719970703125, -260.30999755859375, 185.2700042724609375, 55461); -- Spell: 267082 (Move to Arena) Efffect: 252 (SPELL_EFFECT_TELEPORT_UNITS)
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` IN (261439, 261440, 261441, 268307, 268278, 268272, 268387, 261446);
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(261439, 'spell_lord_and_lady_waycrest_virulent_pathogen_selector'),
|
||||
(261441, 'spell_lord_and_lady_waycrest_virulent_pathogen_selector'),
|
||||
(261440, 'spell_lord_and_lady_waycrest_virulent_pathogen_damage'),
|
||||
(268307, 'spell_lord_and_lady_waycrest_discordant_cadenza_selector'),
|
||||
(268278, 'spell_lord_and_lady_waycrest_wracking_chord_selector'),
|
||||
(268272, 'spell_lord_and_lady_waycrest_wracking_bolt_missile'),
|
||||
(268387, 'spell_lord_and_lady_waycrest_contagious_remnants'),
|
||||
(261446, 'spell_lord_and_lady_waycrest_vitality_transfer');
|
||||
|
||||
DELETE FROM `creature_text` WHERE `CreatureID` IN (131527, 131545);
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
|
||||
(131545, 0, 0, 'Husband, please attend to our guests.', 14, 0, 50, 0, 0, 97499, 145923, 0, 'Lady Waycrest to Player'),
|
||||
(131545, 0, 1, 'Oh look, husband. Your supper has arrived.', 14, 0, 50, 0, 0, 97498, 145919, 0, 'Lady Waycrest to Player'),
|
||||
(131545, 1, 0, 'Simply inferior.', 14, 0, 50, 0, 0, 97491, 145952, 0, 'Lady Waycrest to Player'),
|
||||
(131545, 1, 1, 'Good riddance.', 14, 0, 50, 0, 0, 97492, 145953, 0, 'Lady Waycrest to Player'),
|
||||
(131545, 2, 0, '|TInterface\\ICONS\\INV_MISC_VOLATILESHADOW:20|t Lady Waycrest starts casting |cFFFF0404|Hspell:268306|h[Discordant Cadenza]|h|r!', 41, 0, 100, 0, 0, 0, 161927, 0, 'Lady Waycrest'),
|
||||
(131545, 3, 0, 'No! You won\'t take him from me!', 14, 0, 33, 0, 0, 97500, 145924, 0, 'Lady Waycrest to Lord Waycrest'),
|
||||
(131545, 3, 1, 'I will never let him go!', 14, 0, 33, 0, 0, 97501, 145925, 0, 'Lady Waycrest to Lord Waycrest'),
|
||||
(131545, 3, 2, 'Our bond can never be broken!', 14, 0, 33, 0, 0, 97502, 145926, 0, 'Lady Waycrest to Lord Waycrest'),
|
||||
(131545, 4, 0, 'We will never be parted...', 14, 0, 100, 0, 0, 97493, 145954, 0, 'Lady Waycrest to Player'),
|
||||
(131527, 0, 0, 'Fester!', 14, 0, 50, 0, 0, 97465, 145959, 0, 'Lord Waycrest to Player'),
|
||||
(131527, 0, 1, 'Rot!', 14, 0, 50, 0, 0, 97466, 145960, 0, 'Lord Waycrest to Player'),
|
||||
(131527, 1, 0, 'Spare parts.', 14, 0, 50, 0, 0, 97467, 145961, 0, 'Lord Waycrest to Player'),
|
||||
(131527, 1, 1, 'Broken.', 14, 0, 50, 0, 0, 97468, 145963, 0, 'Lord Waycrest to Player');
|
||||
@@ -4760,6 +4760,18 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
|
||||
// ENDOF KINGS REST SPELLS
|
||||
|
||||
//
|
||||
// WAYCREST MANOR SPELLS
|
||||
//
|
||||
|
||||
// Discordant Cadenza
|
||||
ApplySpellFix({ 268308 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->AttributesEx2 |= SPELL_ATTR2_IGNORE_LINE_OF_SIGHT;
|
||||
});
|
||||
|
||||
// ENDOF WAYCREST MANOR SPELLS
|
||||
|
||||
//
|
||||
// SEPULCHER OF THE FIRST ONES
|
||||
//
|
||||
|
||||
@@ -0,0 +1,578 @@
|
||||
/*
|
||||
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Creature.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Map.h"
|
||||
#include "MotionMaster.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
#include "waycrest_manor.h"
|
||||
|
||||
enum LordAndLadyWaycrestSpells
|
||||
{
|
||||
// Lord Waycrest
|
||||
SPELL_WASTING_STRIKE = 261438,
|
||||
SPELL_VIRULENT_PATHOGEN_SELECTOR = 261439,
|
||||
SPELL_VIRULENT_PATHOGEN_DAMAGE = 261440,
|
||||
SPELL_VIRULENT_PATHOGEN_INFECT_AREA = 261441,
|
||||
SPELL_PUTRID_VITALITY = 261447,
|
||||
SPELL_LORD_WAYCREST_DUMMY_ABSORB = 273699,
|
||||
SPELL_CONTAGIOUS_REMNANTS = 268385,
|
||||
|
||||
// Lady Waycrest
|
||||
SPELL_SOUL_ARMOR = 271590,
|
||||
SPELL_DISCORDANT_CADENZA = 268306,
|
||||
SPELL_DISCORDANT_CADENZA_DAMAGE = 268308,
|
||||
SPELL_WRACKING_BOLT = 268281,
|
||||
SPELL_WRACKING_CHORD_SELECTOR = 268278,
|
||||
SPELL_WRACKING_CHORD_DAMAGE = 268271,
|
||||
SPELL_VITALITY_TRANSFER = 261446,
|
||||
SPELL_HEAL = 210237,
|
||||
SPELL_MOVE_TO_ARENA = 267082
|
||||
};
|
||||
|
||||
enum LordAndLadyWaycrestVisual
|
||||
{
|
||||
SPELL_VISUAL_DISCORDANT_CADENZA_MISSILE = 76184
|
||||
};
|
||||
|
||||
enum LordAndLadyWaycrestTexts
|
||||
{
|
||||
// Lord Waycrest
|
||||
SAY_VIRULENT_PATHOGEN = 0,
|
||||
|
||||
// Lady Waycrest
|
||||
SAY_AGGRO = 0,
|
||||
SAY_DISCORDANT_CADENZA = 2,
|
||||
SAY_HEAL = 3,
|
||||
SAY_DIED = 4,
|
||||
|
||||
// Shared
|
||||
SAY_SLAY = 1
|
||||
};
|
||||
|
||||
enum LordAndLadyWaycrestEvents
|
||||
{
|
||||
// Lord Waycrest
|
||||
EVENT_WASTING_STRIKE = 1,
|
||||
EVENT_VIRULENT_PATHOGEN,
|
||||
EVENT_RESET_HEAL,
|
||||
|
||||
// Lady Waycrest
|
||||
EVENT_WRACKING_CHORD,
|
||||
EVENT_DISCORDANT_CADENZA,
|
||||
EVENT_JOIN_FIGHT
|
||||
};
|
||||
|
||||
enum LordAndLadyWaycrestActions
|
||||
{
|
||||
ACTION_HEAL_LORD_WAYCREST = 1,
|
||||
ACTION_HEAL_AND_JOIN_FIGHT
|
||||
};
|
||||
|
||||
constexpr Position LordWaycrestCombatPosition = { -549.781f, -260.094f, 185.267f };
|
||||
|
||||
// 131527 - Lord Waycrest
|
||||
struct boss_lord_waycrest : public BossAI
|
||||
{
|
||||
boss_lord_waycrest(Creature* creature) : BossAI(creature, DATA_LORD_WAYCREST), _timesHealed(0), _healed(false)
|
||||
{
|
||||
SetBoundary(instance->GetBossBoundary(DATA_LORD_AND_LADY_WAYCREST));
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
events.Reset();
|
||||
_timesHealed = 0;
|
||||
_healed = false;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (!victim->IsPlayer())
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (me->IsInEvadeMode())
|
||||
return;
|
||||
|
||||
instance->SetBossState(DATA_LORD_AND_LADY_WAYCREST, FAIL);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_VIRULENT_PATHOGEN_DAMAGE);
|
||||
|
||||
_EnterEvadeMode();
|
||||
_DespawnAtEvade();
|
||||
|
||||
if (Creature* ladyWaycrest = instance->GetCreature(DATA_LADY_WAYCREST))
|
||||
ladyWaycrest->AI()->EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo = nullptr*/) override
|
||||
{
|
||||
if (_timesHealed != 3 && me->GetHealth() <= damage)
|
||||
damage = me->GetHealth() - 1;
|
||||
|
||||
if (me->HealthBelowPctDamaged(30, damage) && !_healed)
|
||||
{
|
||||
if (_timesHealed < 2)
|
||||
{
|
||||
if (Creature* ladyWaycrest = instance->GetCreature(DATA_LADY_WAYCREST))
|
||||
ladyWaycrest->AI()->DoAction(ACTION_HEAL_LORD_WAYCREST);
|
||||
|
||||
events.ScheduleEvent(EVENT_RESET_HEAL, 3s);
|
||||
}
|
||||
else if (_timesHealed == 2)
|
||||
{
|
||||
if (Creature* ladyWaycrest = instance->GetCreature(DATA_LADY_WAYCREST))
|
||||
ladyWaycrest->AI()->DoAction(ACTION_HEAL_AND_JOIN_FIGHT);
|
||||
}
|
||||
|
||||
_timesHealed++;
|
||||
_healed = true;
|
||||
}
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
DoCastSelf(SPELL_LORD_WAYCREST_DUMMY_ABSORB);
|
||||
me->GetMotionMaster()->MoveJumpWithGravity(LordWaycrestCombatPosition, 20.0f, 15.1852f);
|
||||
|
||||
instance->SetBossState(DATA_LORD_AND_LADY_WAYCREST, IN_PROGRESS);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
|
||||
|
||||
if (Creature* ladyWaycrest = instance->GetCreature(DATA_LADY_WAYCREST))
|
||||
ladyWaycrest->AI()->DoZoneInCombat();
|
||||
|
||||
events.ScheduleEvent(EVENT_WASTING_STRIKE, 7200ms);
|
||||
events.ScheduleEvent(EVENT_VIRULENT_PATHOGEN, 10800ms);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
|
||||
if (Creature* ladyWaycrest = instance->GetCreature(DATA_LADY_WAYCREST))
|
||||
{
|
||||
if (ladyWaycrest->IsAlive())
|
||||
return;
|
||||
else
|
||||
instance->SetBossState(DATA_LORD_AND_LADY_WAYCREST, DONE);
|
||||
}
|
||||
|
||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_VIRULENT_PATHOGEN_DAMAGE);
|
||||
}
|
||||
|
||||
void ExecuteEvent(uint32 eventId) override
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_WASTING_STRIKE:
|
||||
{
|
||||
DoCastVictim(SPELL_WASTING_STRIKE);
|
||||
events.Repeat(17000ms);
|
||||
break;
|
||||
}
|
||||
case EVENT_VIRULENT_PATHOGEN:
|
||||
{
|
||||
Talk(SAY_VIRULENT_PATHOGEN);
|
||||
DoCast(SPELL_VIRULENT_PATHOGEN_SELECTOR);
|
||||
events.Repeat(17000ms);
|
||||
break;
|
||||
}
|
||||
case EVENT_RESET_HEAL:
|
||||
{
|
||||
_healed = false;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
ExecuteEvent(eventId);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 _timesHealed;
|
||||
bool _healed;
|
||||
};
|
||||
|
||||
// 136918 - Lady Waycrest
|
||||
struct boss_lady_waycrest : public BossAI
|
||||
{
|
||||
boss_lady_waycrest(Creature* creature) : BossAI(creature, DATA_LADY_WAYCREST), _isInArena(false)
|
||||
{
|
||||
SetBoundary(instance->GetBossBoundary(DATA_LORD_AND_LADY_WAYCREST));
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
events.Reset();
|
||||
_isInArena = false;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (!victim->IsPlayer())
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
if (me->IsInEvadeMode())
|
||||
return;
|
||||
|
||||
instance->SetBossState(DATA_LORD_AND_LADY_WAYCREST, FAIL);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
|
||||
_EnterEvadeMode();
|
||||
_DespawnAtEvade();
|
||||
|
||||
if (Creature* lordWaycrest = instance->GetCreature(DATA_LORD_WAYCREST))
|
||||
lordWaycrest->AI()->EnterEvadeMode(why);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
DoCastSelf(SPELL_SOUL_ARMOR);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
instance->SetBossState(DATA_LORD_AND_LADY_WAYCREST, IN_PROGRESS);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
|
||||
|
||||
if (Creature* lordWaycrest = instance->GetCreature(DATA_LORD_WAYCREST))
|
||||
lordWaycrest->AI()->DoZoneInCombat();
|
||||
|
||||
events.ScheduleEvent(EVENT_WRACKING_CHORD, 1100ms);
|
||||
events.ScheduleEvent(EVENT_DISCORDANT_CADENZA, 13300ms);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
|
||||
Talk(SAY_DIED);
|
||||
|
||||
if (Creature* lordWaycrest = instance->GetCreature(DATA_LORD_WAYCREST))
|
||||
{
|
||||
if (lordWaycrest->IsAlive())
|
||||
return;
|
||||
else
|
||||
instance->SetBossState(DATA_LORD_AND_LADY_WAYCREST, DONE);
|
||||
}
|
||||
}
|
||||
|
||||
void HealLordWaycrest()
|
||||
{
|
||||
Talk(SAY_HEAL);
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
|
||||
if (Creature* lordWaycrest = instance->GetCreature(DATA_LORD_WAYCREST))
|
||||
DoCast(lordWaycrest, SPELL_VITALITY_TRANSFER);
|
||||
}
|
||||
|
||||
void DoAction(int32 actionId) override
|
||||
{
|
||||
switch (actionId)
|
||||
{
|
||||
case ACTION_HEAL_LORD_WAYCREST:
|
||||
{
|
||||
HealLordWaycrest();
|
||||
break;
|
||||
}
|
||||
case ACTION_HEAL_AND_JOIN_FIGHT:
|
||||
{
|
||||
if (!_isInArena)
|
||||
{
|
||||
HealLordWaycrest();
|
||||
events.RescheduleEvent(EVENT_WRACKING_CHORD, 10100ms);
|
||||
events.ScheduleEvent(EVENT_JOIN_FIGHT, 3s);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ExecuteEvent(uint32 eventId) override
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_WRACKING_CHORD:
|
||||
{
|
||||
DoCast(SPELL_WRACKING_CHORD_SELECTOR);
|
||||
if (_isInArena)
|
||||
events.Repeat(8500ms);
|
||||
else
|
||||
events.Repeat(2400ms);
|
||||
break;
|
||||
}
|
||||
case EVENT_DISCORDANT_CADENZA:
|
||||
{
|
||||
Talk(SAY_DISCORDANT_CADENZA);
|
||||
DoCast(SPELL_DISCORDANT_CADENZA);
|
||||
events.Repeat(21800ms);
|
||||
break;
|
||||
}
|
||||
case EVENT_JOIN_FIGHT:
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_SOUL_ARMOR);
|
||||
DoCastSelf(SPELL_MOVE_TO_ARENA);
|
||||
_isInArena = true;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
ExecuteEvent(eventId);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
bool _isInArena;
|
||||
};
|
||||
|
||||
// 261439 - Virulent Pathogen
|
||||
// 261441 - Virulent Pathogen (Expire)
|
||||
class spell_lord_and_lady_waycrest_virulent_pathogen_selector : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_VIRULENT_PATHOGEN_DAMAGE });
|
||||
}
|
||||
|
||||
void HandleHitTarget(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitUnit(), SPELL_VIRULENT_PATHOGEN_DAMAGE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_lord_and_lady_waycrest_virulent_pathogen_selector::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 261440 - Virulent Pathogen
|
||||
class spell_lord_and_lady_waycrest_virulent_pathogen_damage : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_VIRULENT_PATHOGEN_INFECT_AREA, SPELL_CONTAGIOUS_REMNANTS });
|
||||
}
|
||||
|
||||
void HandleDamage(AuraEffect const* /*aurEff*/ , AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_ENEMY_SPELL)
|
||||
return;
|
||||
|
||||
Unit* target = GetTarget();
|
||||
|
||||
target->CastSpell(target, SPELL_VIRULENT_PATHOGEN_INFECT_AREA, true);
|
||||
|
||||
if (target->GetMap()->IsHeroicOrHigher())
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(target, SPELL_CONTAGIOUS_REMNANTS, false);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_lord_and_lady_waycrest_virulent_pathogen_damage::HandleDamage, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class DiscordantCadenzaDamageEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
explicit DiscordantCadenzaDamageEvent(Unit* caster, Position dest) : _caster(caster), _dest(dest) { }
|
||||
|
||||
bool Execute(uint64 /*time*/, uint32 /*diff*/) override
|
||||
{
|
||||
_caster->CastSpell(_dest, SPELL_DISCORDANT_CADENZA_DAMAGE, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _caster;
|
||||
Position _dest;
|
||||
};
|
||||
|
||||
// 268307 - Discordant Cadenza
|
||||
class spell_lord_and_lady_waycrest_discordant_cadenza_selector : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_DISCORDANT_CADENZA_DAMAGE });
|
||||
}
|
||||
|
||||
void HandleHitTarget(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
Unit* target = GetHitUnit();
|
||||
static constexpr Seconds TRAVEL_SPEED = 2s;
|
||||
|
||||
caster->SendPlayOrphanSpellVisual(target->GetPosition(), SPELL_VISUAL_DISCORDANT_CADENZA_MISSILE, float(TRAVEL_SPEED.count()), true);
|
||||
caster->m_Events.AddEventAtOffset(new DiscordantCadenzaDamageEvent(caster, target->GetPosition()), TRAVEL_SPEED);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_lord_and_lady_waycrest_discordant_cadenza_selector::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 268278 - Wracking Chord
|
||||
class spell_lord_and_lady_waycrest_wracking_chord_selector : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_WRACKING_BOLT });
|
||||
}
|
||||
|
||||
void HandleHitTarget(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetHitUnit()->CastSpell(GetCaster(), SPELL_WRACKING_BOLT, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_lord_and_lady_waycrest_wracking_chord_selector::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 268272 - Wracking Bolt Ping
|
||||
class spell_lord_and_lady_waycrest_wracking_bolt_missile : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_WRACKING_CHORD_DAMAGE });
|
||||
}
|
||||
|
||||
void HandleHitTarget(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetHitUnit()->CastSpell(GetCaster(), SPELL_WRACKING_CHORD_DAMAGE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_lord_and_lady_waycrest_wracking_bolt_missile::HandleHitTarget, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 261446 - Vitality Transfer
|
||||
class spell_lord_and_lady_waycrest_vitality_transfer : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_HEAL, SPELL_PUTRID_VITALITY });
|
||||
}
|
||||
|
||||
void HandlePeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (aurEff->GetTickNumber() == 5)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Unit* target = GetTarget();
|
||||
caster->SetHealth(caster->GetHealth() - caster->CountPctFromMaxHealth(30));
|
||||
target->CastSpell(target, SPELL_HEAL, true);
|
||||
target->CastSpell(target, SPELL_PUTRID_VITALITY, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_lord_and_lady_waycrest_vitality_transfer::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 268387 - Contagious Remnants
|
||||
class spell_lord_and_lady_waycrest_contagious_remnants : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_VIRULENT_PATHOGEN_DAMAGE });
|
||||
}
|
||||
|
||||
void HandleDamage(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetHitUnit()->CastSpell(GetHitUnit(), SPELL_VIRULENT_PATHOGEN_DAMAGE, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_lord_and_lady_waycrest_contagious_remnants::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_lord_and_lady_waycrest()
|
||||
{
|
||||
RegisterWaycrestManorCreatureAI(boss_lord_waycrest);
|
||||
RegisterWaycrestManorCreatureAI(boss_lady_waycrest);
|
||||
|
||||
RegisterSpellScript(spell_lord_and_lady_waycrest_virulent_pathogen_selector);
|
||||
RegisterSpellScript(spell_lord_and_lady_waycrest_virulent_pathogen_damage);
|
||||
RegisterSpellScript(spell_lord_and_lady_waycrest_discordant_cadenza_selector);
|
||||
RegisterSpellScript(spell_lord_and_lady_waycrest_wracking_chord_selector);
|
||||
RegisterSpellScript(spell_lord_and_lady_waycrest_wracking_bolt_missile);
|
||||
RegisterSpellScript(spell_lord_and_lady_waycrest_vitality_transfer);
|
||||
RegisterSpellScript(spell_lord_and_lady_waycrest_contagious_remnants);
|
||||
}
|
||||
@@ -23,6 +23,7 @@
|
||||
static BossBoundaryData const boundaries =
|
||||
{
|
||||
{ DATA_HEARTSBANE_TRIAD, new BoundaryIntersectionBoundary(new ZRangeBoundary(235.0f, 243.0f), new RectangleBoundary(-618.580f, -524.305f, -188.971f, -137.363f)) },
|
||||
{ DATA_LORD_AND_LADY_WAYCREST, new ZRangeBoundary(182.5f, 192.2f) }
|
||||
};
|
||||
|
||||
ObjectData const creatureData[] =
|
||||
@@ -30,13 +31,16 @@ ObjectData const creatureData[] =
|
||||
{ BOSS_SISTER_BRIAR, DATA_SISTER_BRIAR },
|
||||
{ BOSS_SISTER_MALADY, DATA_SISTER_MALADY },
|
||||
{ BOSS_SISTER_SOLENA, DATA_SISTER_SOLENA },
|
||||
{ BOSS_LADY_WAYCREST, DATA_LADY_WAYCREST },
|
||||
{ BOSS_LORD_WAYCREST, DATA_LORD_WAYCREST },
|
||||
{ 0, 0 } // END
|
||||
};
|
||||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_HEARTSBANE_TRIAD_DOOR, DATA_HEARTSBANE_TRIAD, EncounterDoorBehavior::OpenWhenNotInProgress },
|
||||
{ 0, 0, EncounterDoorBehavior::OpenWhenNotInProgress } // END
|
||||
{ GO_HEARTSBANE_TRIAD_DOOR, DATA_HEARTSBANE_TRIAD, EncounterDoorBehavior::OpenWhenNotInProgress },
|
||||
{ GO_WAYCREST_ORGAN_BARRIER, DATA_LORD_AND_LADY_WAYCREST, EncounterDoorBehavior::OpenWhenDone },
|
||||
{ 0, 0, EncounterDoorBehavior::OpenWhenNotInProgress } // END
|
||||
};
|
||||
|
||||
DungeonEncounterData const encounters[] =
|
||||
|
||||
@@ -36,7 +36,10 @@ enum WaycrestManorDataTypes
|
||||
|
||||
DATA_SISTER_BRIAR,
|
||||
DATA_SISTER_MALADY,
|
||||
DATA_SISTER_SOLENA
|
||||
DATA_SISTER_SOLENA,
|
||||
|
||||
DATA_LADY_WAYCREST,
|
||||
DATA_LORD_WAYCREST
|
||||
};
|
||||
|
||||
enum WaycrestManorCreatureIds
|
||||
@@ -47,7 +50,7 @@ enum WaycrestManorCreatureIds
|
||||
BOSS_SISTER_SOLENA = 131824,
|
||||
BOSS_SOULBOUND_GOLIATH = 131667,
|
||||
BOSS_RAAL_THE_GLUTTONOUS = 131863,
|
||||
BOSS_LADY_WAYCREST = 136918,
|
||||
BOSS_LADY_WAYCREST = 131545,
|
||||
BOSS_LORD_WAYCREST = 131527,
|
||||
BOSS_GORAK_TUL = 131863,
|
||||
|
||||
@@ -56,7 +59,8 @@ enum WaycrestManorCreatureIds
|
||||
|
||||
enum WaycrestManorGameObjectIds
|
||||
{
|
||||
GO_HEARTSBANE_TRIAD_DOOR = 282410
|
||||
GO_HEARTSBANE_TRIAD_DOOR = 282410,
|
||||
GO_WAYCREST_ORGAN_BARRIER = 297809
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
|
||||
@@ -21,6 +21,7 @@ void AddSC_zone_boralus();
|
||||
|
||||
// Waycrest Manor
|
||||
void AddSC_boss_heartsbane_triad();
|
||||
void AddSC_boss_lord_and_lady_waycrest();
|
||||
void AddSC_instance_waycrest_manor();
|
||||
|
||||
// The name of this function should match:
|
||||
@@ -31,5 +32,6 @@ void AddKulTirasScripts()
|
||||
|
||||
// Waycrest Manor
|
||||
AddSC_boss_heartsbane_triad();
|
||||
AddSC_boss_lord_and_lady_waycrest();
|
||||
AddSC_instance_waycrest_manor();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user