aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2025-05-29 00:08:33 +0200
committerGitHub <noreply@github.com>2025-05-29 00:08:33 +0200
commitab972a9e97644bcb6bee0c7972d9e070877dbdbd (patch)
tree71a31876a123ef7b28b4067932ccc4f97930f1c5 /src
parentbd87381eab32f0e136675ade503fe70285590803 (diff)
Scripts/Spells: Implement monk talent Song of Chi-ji (#30952)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_monk.cpp36
1 files changed, 36 insertions, 0 deletions
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);