Skip to content

Commit

Permalink
Scripts/Spells: Mage Ice Lance (draft)
Browse files Browse the repository at this point in the history
Missing/todo the following:

- x3 damage on frozen target
- lower damage of second lance triggered by Splitting Ice to 80% (now it deals 100%)
- Chain Reaction.
  • Loading branch information
Ryzen-0 authored and Shauren committed Dec 24, 2020
1 parent 5b2e274 commit cafa00b
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
3 changes: 3 additions & 0 deletions sql/updates/world/master/9999_99_99_30455_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- mage ice lance
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_mage_ice_lance';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (30455, 'spell_mage_ice_lance');
2 changes: 1 addition & 1 deletion src/server/game/Spells/SpellMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3102,7 +3102,7 @@ void SpellMgr::LoadSpellInfoCorrections()
// Fingers of Frost
ApplySpellFix({ 44544 }, [](SpellInfo* spellInfo)
{
const_cast<SpellEffectInfo*>(spellInfo->GetEffect(EFFECT_0))->SpellClassMask = flag128(685904631, 1151048, 0, 0);
const_cast<SpellEffectInfo*>(spellInfo->GetEffect(EFFECT_0))->SpellClassMask[0] |= 0x20000;
});

ApplySpellFix({
Expand Down
60 changes: 60 additions & 0 deletions src/server/scripts/Spells/spell_mage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ enum MageSpells
SPELL_MAGE_TEMPORAL_DISPLACEMENT = 80354,
SPELL_MAGE_WORGEN_FORM = 32819,
SPELL_PET_NETHERWINDS_FATIGUED = 160455,
SPELL_MAGE_ICE_LANCE = 30455,
SPELL_MAGE_ICE_LANCE_TRIGGER = 228598,
SPELL_MAGE_THERMAL_VOID = 155149,
SPELL_MAGE_ICY_VEINS = 12472,
SPELL_MAGE_SPLITTING_ICE = 56377,
SPELL_MAGE_CHAIN_REACTION = 278310,
};

enum MiscSpells
Expand Down Expand Up @@ -695,6 +701,59 @@ class spell_mage_water_elemental_freeze : public SpellScript
}
};

// Ice Lance - 30455
class spell_mage_ice_lance : public SpellScript
{
PrepareSpellScript(spell_mage_ice_lance);

bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({
SPELL_MAGE_ICE_LANCE,
SPELL_MAGE_ICE_LANCE_TRIGGER
});
}

void HandleOnHit(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();
Unit* target = GetHitUnit();

bool targetFrozen = target->HasAuraState(AURA_STATE_FROZEN, GetSpellInfo(), caster);

// Thermal Void
if (caster->HasAura(SPELL_MAGE_THERMAL_VOID) && targetFrozen)
{
if (Aura* icyVeins = caster->GetAura(SPELL_MAGE_ICY_VEINS))
{
if (SpellInfo const* thermalVoidInfo = sSpellMgr->GetSpellInfo(SPELL_MAGE_THERMAL_VOID, GetCastDifficulty()))
{
if (SpellEffectInfo const* eff0 = thermalVoidInfo->GetEffect(EFFECT_0))
{
int32 increaseDuration = eff0->CalcValue() * IN_MILLISECONDS;
int32 newDuration = (icyVeins->GetDuration() + increaseDuration);
icyVeins->SetDuration(newDuration);
}
}
}
}

caster->CastSpell(target, SPELL_MAGE_ICE_LANCE_TRIGGER, true); // TODO damage x3 on frozen target

// Chain Reaction
if (targetFrozen)
caster->CastSpell(caster, SPELL_MAGE_CHAIN_REACTION, true);

if (Aura* fingersOfFrost = caster->GetAura(SPELL_MAGE_FINGERS_OF_FROST))
fingersOfFrost->ModStackAmount(-1);
}

void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_mage_ice_lance::HandleOnHit, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};

void AddSC_mage_spell_scripts()
{
RegisterAuraScript(spell_mage_blazing_barrier);
Expand All @@ -716,4 +775,5 @@ void AddSC_mage_spell_scripts()
RegisterSpellScript(spell_mage_time_warp);
RegisterSpellScript(spell_mage_trigger_chilled);
RegisterSpellScript(spell_mage_water_elemental_freeze);
RegisterSpellScript(spell_mage_ice_lance);
}

0 comments on commit cafa00b

Please sign in to comment.