mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Scripts/Anniversary: Implement Lord Kazzak encounter (#30606)
This commit is contained in:
25
sql/updates/world/master/2025_01_30_01_world.sql
Normal file
25
sql/updates/world/master/2025_01_30_01_world.sql
Normal file
@@ -0,0 +1,25 @@
|
||||
-- SET @CGUID := 123456789;
|
||||
--
|
||||
-- DELETE FROM `creature` WHERE `guid`= @CGUID+0;
|
||||
-- INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnDifficulties`, `PhaseId`, `PhaseGroup`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `currentwaypoint`, `MovementType`, `npcflag`, `unit_flags`, `unit_flags2`, `unit_flags3`, `VerifiedBuild`) VALUES
|
||||
-- (@CGUID+0, 121818, 0, 41, 0, '0', '0', 0, 0, 1, -11781.095703125, -2378.037109375, -6.59761428833007812, 4.975621223449707031, 120, 0, 0, 0, NULL, NULL, NULL, NULL, 58238); -- Lord Kazzak (Area: 0 - Difficulty: 0) CreateObject1 (Auras: )
|
||||
|
||||
UPDATE `creature_template_difficulty` SET `LevelScalingDeltaMin`=3, `LevelScalingDeltaMax`=3, `ContentTuningID`=888, `StaticFlags1`=0x10000000, `VerifiedBuild`=58238 WHERE (`Entry`=121818 AND `DifficultyID`=0); -- 121818 (Lord Kazzak) - CanSwim
|
||||
UPDATE `creature_template` SET `unit_flags2`=0x800, `ScriptName`='boss_lord_kazzak_anniversary' WHERE `entry`=121818; -- Lord Kazzak
|
||||
|
||||
DELETE FROM `creature_template_addon` WHERE `entry` = 121818;
|
||||
INSERT INTO `creature_template_addon` (`entry`, `PathId`, `mount`, `StandState`, `AnimTier`, `VisFlags`, `SheathState`, `PvpFlags`, `emote`, `aiAnimKit`, `movementAnimKit`, `meleeAnimKit`, `visibilityDistanceType`, `auras`) VALUES
|
||||
(121818, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 4, ''); -- 121818 (Lord Kazzak)
|
||||
|
||||
DELETE FROM `creature_text` WHERE `CreatureID`=121818;
|
||||
INSERT INTO `creature_text` (`CreatureID`, `GroupID`, `ID`, `Text`, `Type`, `Language`, `Probability`, `Emote`, `Duration`, `Sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
|
||||
(121818, 0, 0, 'For the Legion! For Kil\'Jaeden!', 14, 0, 100, 0, 0, 0, 8650, 0, 'Lord Kazzak'),
|
||||
(121818, 1, 0, 'Your own strength feeds me, $n!', 14, 0, 100, 0, 0, 0, 8461, 0, 'Lord Kazzak'),
|
||||
(121818, 2, 0, 'Kazzak is supreme!', 14, 0, 100, 0, 0, 0, 8651, 0, 'Lord Kazzak');
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` IN (243737, 243723, 243726, 243715);
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(243737, 'spell_lord_kazzak_mark_of_kazzak_selector'),
|
||||
(243723, 'spell_lord_kazzak_mark_of_kazzak_periodic'),
|
||||
(243726, 'spell_lord_kazzak_mark_of_kazzak_explosion'),
|
||||
(243715, 'spell_lord_kazzak_thunderclap');
|
||||
@@ -0,0 +1,267 @@
|
||||
/*
|
||||
* 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 "ScriptMgr.h"
|
||||
#include "GridNotifiers.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum LordKazzakSpells
|
||||
{
|
||||
SPELL_MARK_OF_KAZZAK_SELECTOR = 243737,
|
||||
SPELL_MARK_OF_KAZZAK_PERIODIC = 243723,
|
||||
SPELL_MARK_OF_KAZZAK_DAMAGE = 243725,
|
||||
SPELL_MARK_OF_KAZZAK_EXPLOSION = 243726,
|
||||
SPELL_VOID_BOLT = 243713,
|
||||
SPELL_THUNDERCLAP = 243715,
|
||||
SPELL_SHADOW_BOLT_VOLLEY = 243712,
|
||||
SPELL_FRENZY = 156598
|
||||
};
|
||||
|
||||
enum LordKazzakTexts
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_KILL = 1,
|
||||
SAY_FRENZY = 2
|
||||
};
|
||||
|
||||
enum LordKazzakEvents
|
||||
{
|
||||
EVENT_MARK_OF_KAZZAK = 1,
|
||||
EVENT_VOID_BOLT,
|
||||
EVENT_THUNDERCLAP,
|
||||
EVENT_SHADOW_BOLT_VOLLEY
|
||||
};
|
||||
|
||||
// 121818 - Lord Kazzak
|
||||
struct boss_lord_kazzak_anniversary : public WorldBossAI
|
||||
{
|
||||
boss_lord_kazzak_anniversary(Creature* creature) : WorldBossAI(creature), _frenzyTriggered(false) { }
|
||||
|
||||
void JustAppeared() override
|
||||
{
|
||||
Talk(SAY_FRENZY);
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
WorldBossAI::Reset();
|
||||
_frenzyTriggered = false;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim) override
|
||||
{
|
||||
if (victim->IsPlayer())
|
||||
Talk(SAY_KILL, victim);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
WorldBossAI::JustEngagedWith(who);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_MARK_OF_KAZZAK, 9s);
|
||||
events.ScheduleEvent(EVENT_VOID_BOLT, 16400ms);
|
||||
events.ScheduleEvent(EVENT_THUNDERCLAP, 11s);
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, 1min + 50s, 1min + 55s);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& damage, DamageEffectType /*damageType*/, SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
if (!_frenzyTriggered && me->HealthBelowPctDamaged(30, damage))
|
||||
{
|
||||
_frenzyTriggered = true;
|
||||
Talk(SAY_FRENZY);
|
||||
DoCastSelf(SPELL_FRENZY);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_MARK_OF_KAZZAK:
|
||||
{
|
||||
DoCast(SPELL_MARK_OF_KAZZAK_SELECTOR);
|
||||
events.ScheduleEvent(EVENT_MARK_OF_KAZZAK, 21s, 23s);
|
||||
break;
|
||||
}
|
||||
case EVENT_VOID_BOLT:
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
|
||||
DoCast(target, SPELL_VOID_BOLT);
|
||||
events.ScheduleEvent(EVENT_VOID_BOLT, 20s, 23s);
|
||||
break;
|
||||
}
|
||||
case EVENT_THUNDERCLAP:
|
||||
{
|
||||
DoCast(SPELL_THUNDERCLAP);
|
||||
events.ScheduleEvent(EVENT_THUNDERCLAP, 25700ms);
|
||||
break;
|
||||
}
|
||||
case EVENT_SHADOW_BOLT_VOLLEY:
|
||||
{
|
||||
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 0.0f, true))
|
||||
DoCast(target, SPELL_SHADOW_BOLT_VOLLEY);
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_VOLLEY, 1min + 50s, 1min + 55s);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
bool _frenzyTriggered;
|
||||
};
|
||||
|
||||
// 243737 - Mark of Kazzak
|
||||
class spell_lord_kazzak_mark_of_kazzak_selector : public SpellScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_MARK_OF_KAZZAK_PERIODIC });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/) const
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitUnit(), SPELL_MARK_OF_KAZZAK_PERIODIC, CastSpellExtraArgsInit{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
|
||||
.TriggeringSpell = GetSpell()
|
||||
});
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_lord_kazzak_mark_of_kazzak_selector::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 243723 - Mark of Kazzak
|
||||
class spell_lord_kazzak_mark_of_kazzak_periodic : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_MARK_OF_KAZZAK_DAMAGE, SPELL_MARK_OF_KAZZAK_EXPLOSION });
|
||||
}
|
||||
|
||||
void HandlePeriodic(AuraEffect const* aurEff) const
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
caster->CastSpell(GetTarget(), SPELL_MARK_OF_KAZZAK_DAMAGE, CastSpellExtraArgsInit{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
|
||||
.TriggeringAura = aurEff
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) const
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEATH && GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
|
||||
return;
|
||||
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
caster->CastSpell(GetTarget(), SPELL_MARK_OF_KAZZAK_EXPLOSION, CastSpellExtraArgsInit{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
|
||||
.TriggeringAura = aurEff,
|
||||
.CustomArg = GetTarget()->GetGUID()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_lord_kazzak_mark_of_kazzak_periodic::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_lord_kazzak_mark_of_kazzak_periodic::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
// 243726 - Mark of Kazzak
|
||||
class spell_lord_kazzak_mark_of_kazzak_explosion : public SpellScript
|
||||
{
|
||||
void FilterTargets(std::list<WorldObject*>& targets) const
|
||||
{
|
||||
ObjectGuid const* explosionTargetGUID = std::any_cast<ObjectGuid>(&GetSpell()->m_customArg);
|
||||
if (!explosionTargetGUID)
|
||||
return;
|
||||
|
||||
targets.remove_if([explosionTargetGUID](WorldObject const* target) -> bool
|
||||
{
|
||||
return target->GetGUID() == *explosionTargetGUID;
|
||||
});
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_lord_kazzak_mark_of_kazzak_explosion::FilterTargets, EFFECT_1, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 243715 - Thunderclap
|
||||
class spell_lord_kazzak_thunderclap : public SpellScript
|
||||
{
|
||||
void HandleAfterHit() const
|
||||
{
|
||||
if (Aura* aura = GetHitAura())
|
||||
aura->SetStackAmount(static_cast<uint8>(GetSpellInfo()->StackAmount));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterHit += SpellHitFn(spell_lord_kazzak_thunderclap::HandleAfterHit);
|
||||
}
|
||||
};
|
||||
|
||||
// 243715 - Thunderclap
|
||||
class spell_lord_kazzak_thunderclap_aura : public AuraScript
|
||||
{
|
||||
void HandlePeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
ModStackAmount(-1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_lord_kazzak_thunderclap_aura::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_lord_kazzak_anniversary()
|
||||
{
|
||||
RegisterCreatureAI(boss_lord_kazzak_anniversary);
|
||||
RegisterSpellScript(spell_lord_kazzak_mark_of_kazzak_selector);
|
||||
RegisterSpellScript(spell_lord_kazzak_mark_of_kazzak_periodic);
|
||||
RegisterSpellScript(spell_lord_kazzak_mark_of_kazzak_explosion);
|
||||
RegisterSpellAndAuraScriptPair(spell_lord_kazzak_thunderclap, spell_lord_kazzak_thunderclap_aura);
|
||||
}
|
||||
@@ -31,6 +31,7 @@ void AddSC_event_zalazane_fall();
|
||||
|
||||
// Anniversary
|
||||
void AddSC_boss_doomwalker_anniversary();
|
||||
void AddSC_boss_lord_kazzak_anniversary();
|
||||
|
||||
// The name of this function should match:
|
||||
// void Add${NameOfDirectory}Scripts()
|
||||
@@ -51,4 +52,5 @@ void AddEventsScripts()
|
||||
|
||||
// Anniversary
|
||||
AddSC_boss_doomwalker_anniversary();
|
||||
AddSC_boss_lord_kazzak_anniversary();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user