mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Scripts/Spells: Implement demon hunter talent "Inner Demon" (#30562)
This commit is contained in:
15
sql/updates/world/master/2025_01_14_05_world.sql
Normal file
15
sql/updates/world/master/2025_01_14_05_world.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_dh_inner_demon';
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(162264, 'spell_dh_inner_demon');
|
||||
|
||||
DELETE FROM `spell_proc` WHERE `SpellId` IN (390145);
|
||||
INSERT INTO `spell_proc` (`SpellId`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`SpellFamilyMask3`,`ProcFlags`,`ProcFlags2`,`SpellTypeMask`,`SpellPhaseMask`,`HitMask`,`AttributesMask`,`DisableEffectsMask`,`ProcsPerMinute`,`Chance`,`Cooldown`,`Charges`) VALUES
|
||||
(390145,0x00,107,0x00000000,0x00300000,0x00000000,0x00000000,0x0,0x0,0x4,0x2,0x0,0x0,0x0,0,0,0,0); -- Inner Demon
|
||||
|
||||
DELETE FROM `areatrigger_create_properties` WHERE (`IsCustom`=0 AND `Id` = 26749);
|
||||
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
|
||||
(26749, 0, 30886, 0, 0, 0, 0, 0, 0, -1, 0, 0, NULL, 1250, 10.4, 0, 3, 3, 0, 0, 0, 0, 0, 0, 'at_dh_inner_demon', 58187); -- Spell: 390139 (Inner Demon)
|
||||
|
||||
DELETE FROM `areatrigger_template` WHERE (`IsCustom`=0 AND `Id` = 30886);
|
||||
INSERT INTO `areatrigger_template` (`Id`, `IsCustom`, `Flags`, `VerifiedBuild`) VALUES
|
||||
(30886, 0, 0, 58187);
|
||||
@@ -5262,6 +5262,12 @@ void SpellMgr::LoadSpellInfoTargetCaps()
|
||||
spellInfo->_LoadSqrtTargetLimit(8, 0, 453034, EFFECT_1, {}, {});
|
||||
});
|
||||
|
||||
// Inner Demon
|
||||
ApplySpellFix({ 390137 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->_LoadSqrtTargetLimit(5, 0, 389693, EFFECT_1, {}, {});
|
||||
});
|
||||
|
||||
TC_LOG_INFO("server.loading", ">> Loaded SpellInfo target caps in {} ms", GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "AreaTrigger.h"
|
||||
#include "AreaTriggerAI.h"
|
||||
#include "DB2Stores.h"
|
||||
#include "PathGenerator.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Spell.h"
|
||||
@@ -127,6 +128,9 @@ enum DemonHunterSpells
|
||||
SPELL_DH_ILLIDANS_GRASP = 205630,
|
||||
SPELL_DH_ILLIDANS_GRASP_DAMAGE = 208618,
|
||||
SPELL_DH_ILLIDANS_GRASP_JUMP_DEST = 208175,
|
||||
SPELL_DH_INNER_DEMON_BUFF = 390145,
|
||||
SPELL_DH_INNER_DEMON_DAMAGE = 390137,
|
||||
SPELL_DH_INNER_DEMON_TALENT = 389693,
|
||||
SPELL_DH_INFERNAL_STRIKE_CAST = 189110,
|
||||
SPELL_DH_INFERNAL_STRIKE_IMPACT_DAMAGE = 189112,
|
||||
SPELL_DH_INFERNAL_STRIKE_JUMP = 189111,
|
||||
@@ -806,6 +810,64 @@ class spell_dh_furious_gaze : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
// Called by 162264 - Metamorphosis
|
||||
class spell_dh_inner_demon : public AuraScript
|
||||
{
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_DH_INNER_DEMON_TALENT, SPELL_DH_INNER_DEMON_BUFF });
|
||||
}
|
||||
|
||||
bool Load() override
|
||||
{
|
||||
return GetUnitOwner()->HasAura(SPELL_DH_INNER_DEMON_TALENT); // This spell has a proc, but is just a copypaste from spell 390145 (also don't have a 5s cooldown)
|
||||
}
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) const
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
target->CastSpell(target, SPELL_DH_INNER_DEMON_BUFF, CastSpellExtraArgsInit{
|
||||
.TriggerFlags = TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR,
|
||||
});
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_dh_inner_demon::OnApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
|
||||
}
|
||||
};
|
||||
|
||||
// 390139 - Inner Demon
|
||||
// ID - 26749
|
||||
struct at_dh_inner_demon : 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->GetEffect(EFFECT_0).CalcValue(caster) + at->GetMaxSearchRadius(), at->GetRelativeAngle(caster));
|
||||
PathGenerator path(at);
|
||||
|
||||
path.CalculatePath(destPos.GetPositionX(), destPos.GetPositionY(), destPos.GetPositionZ(), false);
|
||||
|
||||
at->InitSplines(path.GetPath());
|
||||
}
|
||||
|
||||
void OnRemove() override
|
||||
{
|
||||
if (Unit* caster = at->GetCaster())
|
||||
caster->CastSpell(caster->GetPosition(), SPELL_DH_INNER_DEMON_DAMAGE, TRIGGERED_IGNORE_CAST_IN_PROGRESS | TRIGGERED_DONT_REPORT_CAST_ERROR);
|
||||
}
|
||||
};
|
||||
|
||||
// 209258 - Last Resort
|
||||
class spell_dh_last_resort : public AuraScript
|
||||
{
|
||||
@@ -1253,6 +1315,8 @@ void AddSC_demon_hunter_spell_scripts()
|
||||
RegisterSpellScript(spell_dh_felblade_cooldown_reset_proc);
|
||||
RegisterSpellScript(spell_dh_fiery_brand);
|
||||
RegisterSpellScript(spell_dh_furious_gaze);
|
||||
RegisterSpellScript(spell_dh_inner_demon);
|
||||
RegisterAreaTriggerAI(at_dh_inner_demon);
|
||||
RegisterSpellScript(spell_dh_last_resort);
|
||||
RegisterSpellScript(spell_dh_restless_hunter);
|
||||
RegisterSpellScript(spell_dh_shattered_destiny);
|
||||
|
||||
Reference in New Issue
Block a user