Skip to content

Commit

Permalink
Merge 3.3.5 to 3.3.5-vas-autobalance
Browse files Browse the repository at this point in the history
  • Loading branch information
Github Actions committed Oct 7, 2024
2 parents 8963bff + 5a29762 commit 4b2e3de
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sql/updates/world/3.3.5/2024_10_06_00_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- Spellscripts for "Toss your Luck!"
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_item_titanium_seal_of_dalaran_toss','spell_item_titanium_seal_of_dalaran_catch');
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(60458, 'spell_item_titanium_seal_of_dalaran_toss'),
(60476, 'spell_item_titanium_seal_of_dalaran_catch');
60 changes: 60 additions & 0 deletions src/server/scripts/Spells/spell_item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}

0 comments on commit 4b2e3de

Please sign in to comment.