Core/Spells: fixed Throw Shield Visual and Clone Weapon

This commit is contained in:
joschiwald committed 2014-04-05 00:37:07 +02:00
1 parent c4f4a023ea
commit 29610b250d
3 files changed
+45 -10

No files matched your search

@@ -0,0 +1,7 @@
DELETE FROM `spell_script_names` WHERE `spell_id` IN (41213, 43416, 69222, 73076, 45204);
INSERT INTO `spell_script_names` (`spell_id` ,`ScriptName`) VALUES
(41213, 'spell_gen_throw_shield'),
(43416, 'spell_gen_throw_shield'),
(69222, 'spell_gen_throw_shield'),
(73076, 'spell_gen_throw_shield'),
(45204, 'spell_gen_clone');
-3
View File
@@ -3595,9 +3595,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
}
return;
}
case 45204: // Clone Me!
m_caster->CastSpell(unitTarget, damage, true);
break;
case 55693: // Remove Collapsing Cave Aura
if (!unitTarget)
return;
+38 -7
View File
@@ -711,7 +711,7 @@ class spell_gen_clone : public SpellScriptLoader
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetHitUnit()->CastSpell(GetCaster(), GetEffectValue(), true);
GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
}
void Register() OVERRIDE
@@ -751,10 +751,7 @@ class spell_gen_clone_weapon : public SpellScriptLoader
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
Unit* caster = GetCaster();
if (Unit* target = GetHitUnit())
caster->CastSpell(target, GetEffectValue(), true);
GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
}
void Register() OVERRIDE
@@ -778,8 +775,6 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader
{
PrepareAuraScript(spell_gen_clone_weapon_auraScript);
uint32 prevItem;
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_COPY_WEAPON_AURA) ||
@@ -792,6 +787,12 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader
return true;
}
bool Load() OVERRIDE
{
prevItem = 0;
return true;
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* caster = GetCaster();
@@ -877,6 +878,8 @@ class spell_gen_clone_weapon_aura : public SpellScriptLoader
OnEffectRemove += AuraEffectRemoveFn(spell_gen_clone_weapon_auraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
}
private:
uint32 prevItem;
};
AuraScript* GetAuraScript() const OVERRIDE
@@ -3282,6 +3285,33 @@ class spell_gen_summon_tournament_mount : public SpellScriptLoader
}
};
// 41213, 43416, 69222, 73076 - Throw Shield
class spell_gen_throw_shield : public SpellScriptLoader
{
public:
spell_gen_throw_shield() : SpellScriptLoader("spell_gen_throw_shield") { }
class spell_gen_throw_shield_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_throw_shield_SpellScript);
void HandleScriptEffect(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
}
void Register() OVERRIDE
{
OnEffectHitTarget += SpellEffectFn(spell_gen_throw_shield_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const OVERRIDE
{
return new spell_gen_throw_shield_SpellScript();
}
};
enum MountedDuelSpells
{
@@ -3773,6 +3803,7 @@ void AddSC_generic_spell_scripts()
new spell_gen_summon_elemental("spell_gen_summon_fire_elemental", SPELL_SUMMON_FIRE_ELEMENTAL);
new spell_gen_summon_elemental("spell_gen_summon_earth_elemental", SPELL_SUMMON_EARTH_ELEMENTAL);
new spell_gen_summon_tournament_mount();
new spell_gen_throw_shield();
new spell_gen_tournament_duel();
new spell_gen_tournament_pennant();
new spell_pvp_trinket_wotf_shared_cd();