diff options
author | Odyssey <odysseyhyd@gmail.com> | 2024-10-06 12:49:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-06 12:49:14 +0200 |
commit | 5a29762b30c1301b158ccaf937d2d35e79c0adcf (patch) | |
tree | 5750dcdb4fd5ca1486ed50d4aa65e1f2def533e2 /src | |
parent | 2c0ebbef1f5c051a104ef3ba74020b6e7bb2ccaa (diff) |
Scripts/Spells: Implement Titanium Seal of Dalaran (#30291)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 2cf9d7bc5c7..1bdeed4655f 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -4286,6 +4286,64 @@ class spell_item_eggnog : public SpellScript } }; +// Titanium Seal of Dalaran +enum TitaniumSealOfDalaranTexts +{ + TEXT_TSOD_COIN_TOSS = 32638, + TEXT_TSOD_FLIPPED_HEADS = 32663, + TEXT_TSOD_FLIPPED_TAILS = 32664 +}; + +// 60458 - Toss Your Luck! +class spell_item_titanium_seal_of_dalaran_toss : public SpellScript +{ + PrepareSpellScript(spell_item_titanium_seal_of_dalaran_toss); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return sObjectMgr->GetBroadcastText(TEXT_TSOD_COIN_TOSS); + } + + void RelocateHeight(SpellDestination& dest) + { + dest.RelocateOffset({ 0.0f, 0.0f, 20.0f }); + } + + void TriggerEmote(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + caster->TextEmote(TEXT_TSOD_COIN_TOSS, caster); + } + + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_item_titanium_seal_of_dalaran_toss::RelocateHeight, EFFECT_0, TARGET_DEST_CASTER); + OnEffectLaunch += SpellEffectFn(spell_item_titanium_seal_of_dalaran_toss::TriggerEmote, EFFECT_0, SPELL_EFFECT_TRIGGER_MISSILE); + } +}; + +// 60476 - Toss Your Luck! +class spell_item_titanium_seal_of_dalaran_catch : public SpellScript +{ + PrepareSpellScript(spell_item_titanium_seal_of_dalaran_catch); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + return sObjectMgr->GetBroadcastText(TEXT_TSOD_FLIPPED_HEADS) && sObjectMgr->GetBroadcastText(TEXT_TSOD_FLIPPED_TAILS); + } + + void TriggerEmote(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + caster->TextEmote(RAND(TEXT_TSOD_FLIPPED_HEADS, TEXT_TSOD_FLIPPED_TAILS), caster); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_item_titanium_seal_of_dalaran_catch::TriggerEmote, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } +}; + void AddSC_item_spell_scripts() { // 23074 Arcanite Dragonling @@ -4421,4 +4479,6 @@ void AddSC_item_spell_scripts() RegisterSpellScript(spell_item_mad_alchemists_potion); RegisterSpellScript(spell_item_crazy_alchemists_potion); RegisterSpellScript(spell_item_eggnog); + RegisterSpellScript(spell_item_titanium_seal_of_dalaran_toss); + RegisterSpellScript(spell_item_titanium_seal_of_dalaran_catch); } |