diff options
author | Aqua Deus <95978183+aquadeus@users.noreply.github.com> | 2025-05-29 00:08:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-29 00:08:33 +0200 |
commit | ab972a9e97644bcb6bee0c7972d9e070877dbdbd (patch) | |
tree | 71a31876a123ef7b28b4067932ccc4f97930f1c5 | |
parent | bd87381eab32f0e136675ade503fe70285590803 (diff) |
Scripts/Spells: Implement monk talent Song of Chi-ji (#30952)
-rw-r--r-- | sql/updates/world/master/2025_05_28_01_world.sql | 5 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_monk.cpp | 36 |
2 files changed, 41 insertions, 0 deletions
diff --git a/sql/updates/world/master/2025_05_28_01_world.sql b/sql/updates/world/master/2025_05_28_01_world.sql new file mode 100644 index 00000000000..08dc23a77fb --- /dev/null +++ b/sql/updates/world/master/2025_05_28_01_world.sql @@ -0,0 +1,5 @@ +DELETE FROM `areatrigger_create_properties` WHERE (`Id`=5484 AND `IsCustom`=0); +INSERT INTO `areatrigger_create_properties` (`Id`, `IsCustom`, `AreaTriggerId`, `IsAreatriggerCustom`, `Flags`, `MoveCurveId`, `ScaleCurveId`, `MorphCurveId`, `FacingCurveId`, `AnimId`, `AnimKitId`, `DecalPropertiesId`, `SpellForVisuals`, `TimeToTargetScale`, `Speed`, `Shape`, `ShapeData0`, `ShapeData1`, `ShapeData2`, `ShapeData3`, `ShapeData4`, `ShapeData5`, `ShapeData6`, `ShapeData7`, `ScriptName`, `VerifiedBuild`) VALUES +(5484, 0, 10191, 0, 24, 1656, 0, 0, 0, -1, 0, 0, NULL, 5000, 7, 0, 5, 5, 0, 0, 0, 0, 0, 0, 'at_monk_song_of_chi_ji', 60822); -- Spell: 198898 (Song of Chi-Ji) + +UPDATE `areatrigger_template` SET `VerifiedBuild`=60822 WHERE (`Id`=10191 AND `IsCustom`=0); diff --git a/src/server/scripts/Spells/spell_monk.cpp b/src/server/scripts/Spells/spell_monk.cpp index 99a19b5dff0..b86ec7481d8 100644 --- a/src/server/scripts/Spells/spell_monk.cpp +++ b/src/server/scripts/Spells/spell_monk.cpp @@ -21,7 +21,10 @@ */ #include "ScriptMgr.h" +#include "AreaTrigger.h" +#include "AreaTriggerAI.h" #include "DB2Stores.h" +#include "PathGenerator.h" #include "Player.h" #include "Spell.h" #include "SpellAuraEffects.h" @@ -49,6 +52,7 @@ enum MonkSpells SPELL_MONK_ROLL_BACKWARD = 109131, SPELL_MONK_ROLL_FORWARD = 107427, SPELL_MONK_SAVE_THEM_ALL_HEAL_BONUS = 390105, + SPELL_MONK_SONG_OF_CHI_JI_STUN = 198909, SPELL_MONK_SOOTHING_MIST = 115175, SPELL_MONK_STANCE_OF_THE_SPIRITED_CRANE = 154436, SPELL_MONK_STAGGER_DAMAGE_AURA = 124255, @@ -432,6 +436,37 @@ class spell_monk_save_them_all : public AuraScript } }; +// 198898 - Song of Chi-Ji +struct at_monk_song_of_chi_ji : AreaTriggerAI +{ + using AreaTriggerAI::AreaTriggerAI; + + void OnInitialize() override + { + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(at->GetSpellId(), DIFFICULTY_NONE); + if (!spellInfo) + return; + + Unit* caster = at->GetCaster(); + if (!caster) + return; + + Position destPos = at->GetFirstCollisionPosition(spellInfo->GetMaxRange(false, caster), 0.0f); + PathGenerator path(at); + + path.CalculatePath(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ(), false); + + at->InitSplines(path.GetPath()); + } + + void OnUnitEnter(Unit* unit) override + { + if (Unit* caster = at->GetCaster()) + if (caster->IsValidAttackTarget(unit)) + caster->CastSpell(unit, SPELL_MONK_SONG_OF_CHI_JI_STUN, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR); + } +}; + // Utility for stagger scripts Aura* FindExistingStaggerEffect(Unit* unit) { @@ -678,6 +713,7 @@ void AddSC_monk_spell_scripts() RegisterSpellScript(spell_monk_roll); RegisterSpellScript(spell_monk_roll_aura); RegisterSpellScript(spell_monk_save_them_all); + RegisterAreaTriggerAI(at_monk_song_of_chi_ji); RegisterSpellScript(spell_monk_stagger); RegisterSpellScript(spell_monk_stagger_damage_aura); RegisterSpellScript(spell_monk_stagger_debuff_aura); |