diff options
| author | Sorikoff <46191832+Sorikoff@users.noreply.github.com> | 2019-06-28 18:15:16 +0000 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2021-12-13 00:42:18 +0100 |
| commit | ea4c1ae7d0c4b3420b1d78623c5254466c64f43b (patch) | |
| tree | c2395220c5904b337e205d515f1a84f53c85198d /src | |
| parent | 2fea2a1e8104856587d0eff651eb2199dfcd0513 (diff) | |
Scripts/Spells: Dimensional Ripper - Area 52 (#23505)
* Scripts/Spells: Dimensional Ripper - Area 52
* Rename 9999_99_99_99_world.sql to 2019_06_28_00_world.sql
(cherry picked from commit 63f548921c268cc9f30af68bf9b41c80df0492ac)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 38 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 56 |
2 files changed, 56 insertions, 38 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 91b9bbc6183..a10fd80aa74 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -970,44 +970,6 @@ void Spell::EffectTeleportUnits() } return; } - // Dimensional Ripper - Area 52 - case 36890: - { - if (roll_chance_i(50)) // 50% success - { - int32 rand_eff = urand(1, 4); - switch (rand_eff) - { - case 1: - // soul split - evil - m_caster->CastSpell(m_caster, 36900, CastSpellExtraArgs(TRIGGERED_FULL_MASK) - .SetOriginalCastId(m_castId)); - break; - case 2: - // soul split - good - m_caster->CastSpell(m_caster, 36901, CastSpellExtraArgs(TRIGGERED_FULL_MASK) - .SetOriginalCastId(m_castId)); - break; - case 3: - // Increase the size - m_caster->CastSpell(m_caster, 36895, CastSpellExtraArgs(TRIGGERED_FULL_MASK) - .SetOriginalCastId(m_castId)); - break; - case 4: - // Transform - { - if (m_caster->ToPlayer()->GetTeam() == ALLIANCE) - m_caster->CastSpell(m_caster, 36897, CastSpellExtraArgs(TRIGGERED_FULL_MASK) - .SetOriginalCastId(m_castId)); - else - m_caster->CastSpell(m_caster, 36899, CastSpellExtraArgs(TRIGGERED_FULL_MASK) - .SetOriginalCastId(m_castId)); - break; - } - } - } - return; - } } } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index da9c104ad3f..dc4b3a24ba2 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1710,6 +1710,61 @@ class spell_item_scroll_of_recall : public SpellScript } }; +// 36890 - Dimensional Ripper - Area 52 +enum DimensionalRipperArea52 +{ + SPELL_TRANSPORTER_MALFUNCTION = 36895, + SPELL_TRANSFORM_HORDE = 36897, + SPELL_TRANSFORM_ALLIANCE = 36899, + SPELL_SOUL_SPLIT_EVIL = 36900, + SPELL_SOUL_SPLIT_GOOD = 36901 +}; + +class spell_item_dimensional_ripper_area52 : public SpellScript +{ + PrepareSpellScript(spell_item_dimensional_ripper_area52); + + bool Load() override + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleScript(SpellEffIndex /* effIndex */) + { + if (!roll_chance_i(50)) // 50% success + return; + + Unit* caster = GetCaster(); + + uint32 spellId = 0; + switch (urand(0, 3)) + { + case 0: + spellId = SPELL_TRANSPORTER_MALFUNCTION; + break; + case 1: + spellId = SPELL_SOUL_SPLIT_EVIL; + break; + case 2: + spellId = SPELL_SOUL_SPLIT_GOOD; + break; + case 3: + if (caster->ToPlayer()->GetTeamId() == TEAM_ALLIANCE) + spellId = SPELL_TRANSFORM_HORDE; + else + spellId = SPELL_TRANSFORM_ALLIANCE; + break; + } + + caster->CastSpell(caster, spellId, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_item_dimensional_ripper_area52::HandleScript, EFFECT_0, SPELL_EFFECT_TELEPORT_UNITS); + } +}; + // 71169 - Shadow's Fate (Shadowmourne questline) enum ShadowsFate { @@ -4241,6 +4296,7 @@ void AddSC_item_spell_scripts() RegisterAuraScript(spell_item_power_circle); RegisterSpellScript(spell_item_savory_deviate_delight); RegisterSpellScript(spell_item_scroll_of_recall); + RegisterSpellScript(spell_item_dimensional_ripper_area52); RegisterAuraScript(spell_item_unsated_craving); RegisterAuraScript(spell_item_shadows_fate); RegisterAuraScript(spell_item_shadowmourne); |
