aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2014_04_05_00_world_spell_script_names.sql7
-rw-r--r--src/server/game/Spells/SpellEffects.cpp3
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp45
3 files changed, 45 insertions, 10 deletions
diff --git a/sql/updates/world/2014_04_05_00_world_spell_script_names.sql b/sql/updates/world/2014_04_05_00_world_spell_script_names.sql
new file mode 100644
index 00000000000..f5abac98e78
--- /dev/null
+++ b/sql/updates/world/2014_04_05_00_world_spell_script_names.sql
@@ -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');
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 609c9ba05be..28bc659050a 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -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;
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 68c16a1b2d6..65aa22c776d 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -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();