Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Core/Spell: Fix Mirror Image Mage Close #975
Browse files Browse the repository at this point in the history
  • Loading branch information
Nightprince committed Nov 14, 2023
1 parent 932ca97 commit 7208942
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 6 deletions.
6 changes: 6 additions & 0 deletions sql/updates/world/world_2023_11_15_01_36.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_mage_mirror_image';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(55342, 'spell_mage_mirror_image'),
(63093, 'spell_mage_mirror_image'),

This comment has been minimized.

Copy link
@AriDEV3

AriDEV3 Nov 15, 2023

Contributor

glyph does not need this script
same for 88091 and 88092

(88091, 'spell_mage_mirror_image'),
(88092, 'spell_mage_mirror_image');
12 changes: 6 additions & 6 deletions src/server/scripts/Pet/pet_mage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

enum MageSpells
{
SPELL_MAGE_CLONE_ME = 45204,
SPELL_MAGE_CLONE_WEAPONS = 41054,
SPELL_MAGE_MASTERS_THREAT_LIST = 58838
SPELL_MIRROR_IMAGE_CLONE_ME = 45204,
SPELL_MIRROR_IMAGE_COPY_WEAPONS = 41054,
SPELL_MIRROR_IMAGE_MASTERS_THREAT_LIST = 58838,
};

class npc_pet_mage_mirror_image : public CreatureScript
Expand All @@ -36,12 +36,12 @@ class npc_pet_mage_mirror_image : public CreatureScript
if (!owner)
return;
// Inherit Master's Threat List (not yet implemented)
owner->CastSpell((Unit*)NULL, SPELL_MAGE_MASTERS_THREAT_LIST, true);
me->CastSpell(me, SPELL_MIRROR_IMAGE_MASTERS_THREAT_LIST, true);
// here mirror image casts on summoner spell (not present in client dbc) 49866
// here should be auras (not present in client dbc): 35657, 35658, 35659, 35660 selfcasted by mirror images (stats related?)
// Clone Me!
owner->CastSpell(me, SPELL_MAGE_CLONE_ME, true);
owner->CastSpell(me, SPELL_MAGE_CLONE_WEAPONS, true);
owner->CastSpell(me, SPELL_MIRROR_IMAGE_CLONE_ME, true);
owner->CastSpell(me, SPELL_MIRROR_IMAGE_COPY_WEAPONS, true);
}

// Do not reload Creature templates on evade mode enter - prevent visual lost
Expand Down
37 changes: 37 additions & 0 deletions src/server/scripts/Spells/spell_mage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ enum MageSpells

// Pyroblast!
SPELL_MAGE_PYROBLAST_CLEARCAST = 48108,

// Mirror Image
SPELL_MAGE_SUMMON_IMAGES_FROST = 58832,
SPELL_MAGE_SUMMON_IMAGES_FIRE = 88092,
SPELL_MAGE_SUMMON_IMAGES_ARCANE = 88091,
};

enum MageIcons
Expand Down Expand Up @@ -900,6 +905,37 @@ class spell_mage_water_elemental_freeze : public SpellScriptLoader
}
};

// 55342 - Mirror Image
class spell_mage_mirror_image : public SpellScriptLoader
{
public:
spell_mage_mirror_image() : SpellScriptLoader("spell_mage_mirror_image") { }

class spell_mage_mirror_image_SpellScript : public SpellScript
{
PrepareSpellScript(spell_mage_mirror_image_SpellScript);

This comment has been minimized.

Copy link
@AriDEV3

AriDEV3 Nov 15, 2023

Contributor

missing validate

void HandleDummy(SpellEffIndex /*effIndex*/)
{
Unit* caster = GetCaster();

uint32 spellId = SPELL_MAGE_SUMMON_IMAGES_FROST;

caster->CastSpell(caster, spellId, true);
}

void Register() override
{
OnEffectHit += SpellEffectFn(spell_mage_mirror_image_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
}
};

SpellScript* GetSpellScript() const override
{
return new spell_mage_mirror_image_SpellScript();
}
};

void AddSC_mage_spell_scripts()
{
new spell_mage_frostjaw(); // 5.4.8 18414
Expand All @@ -918,4 +954,5 @@ void AddSC_mage_spell_scripts()
new spell_mage_ring_of_frost();
new spell_mage_ring_of_frost_freeze();
new spell_mage_water_elemental_freeze();
new spell_mage_mirror_image();
}

0 comments on commit 7208942

Please sign in to comment.