Scripts/Spells: Implement monk talent Song of Chi-ji (#30952)

This commit is contained in:
Aqua Deus
2025-05-29 00:08:33 +02:00
committed by GitHub
parent bd87381eab
commit ab972a9e97
2 changed files with 41 additions and 0 deletions

View File

@@ -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);

View File

@@ -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);