aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsirikfoll <sirikfoll@hotmail.com>2015-07-12 18:38:35 +0100
committerDDuarte <dnpd.dd@gmail.com>2015-07-12 18:38:35 +0100
commitb0e580eb4cce4999e435d940b11939836351b82e (patch)
tree0433b511a55de1b9f23710db2dc6e16b631d5f7e
parentf34471f1e148640029f969123e73042a84984988 (diff)
Spell Script for quests Among the Champions and The Grand Melee
Solves issues with the credit spells hitting the mount instead of the player itself. (cherry picked from commit 5bbd7cff4c98b59673d03416e6fff83d7db4d950) Conflicts: sql/updates/world/2015_07_11_00_world.sql
-rw-r--r--sql/updates/world/2015_07_12_32_world_2015_07_11_00.sql41
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp30
2 files changed, 71 insertions, 0 deletions
diff --git a/sql/updates/world/2015_07_12_32_world_2015_07_11_00.sql b/sql/updates/world/2015_07_12_32_world_2015_07_11_00.sql
new file mode 100644
index 00000000000..968be928b13
--- /dev/null
+++ b/sql/updates/world/2015_07_12_32_world_2015_07_11_00.sql
@@ -0,0 +1,41 @@
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (64830,64831,64832,64833,64834,64835,64836,64837,64838,64839,63060,63597,64893);
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(64830, 'spell_q13665_q13790_bested_trigger'),
+(64831, 'spell_q13665_q13790_bested_trigger'),
+(64832, 'spell_q13665_q13790_bested_trigger'),
+(64833, 'spell_q13665_q13790_bested_trigger'),
+(64834, 'spell_q13665_q13790_bested_trigger'),
+(64835, 'spell_q13665_q13790_bested_trigger'),
+(64836, 'spell_q13665_q13790_bested_trigger'),
+(64837, 'spell_q13665_q13790_bested_trigger'),
+(64838, 'spell_q13665_q13790_bested_trigger'),
+(64839, 'spell_q13665_q13790_bested_trigger'),
+(63060, 'spell_q13665_q13790_bested_trigger'),
+(63597, 'spell_q13665_q13790_bested_trigger'),
+(64893, 'spell_q13665_q13790_bested_trigger');
+
+-- Among the Champions
+UPDATE `smart_scripts` SET `action_param1`=64830 WHERE `entryorguid`=33740 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64831 WHERE `entryorguid`=33738 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64832 WHERE `entryorguid`=33743 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64833 WHERE `entryorguid`=33744 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64834 WHERE `entryorguid`=33745 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64835 WHERE `entryorguid`=33746 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64836 WHERE `entryorguid`=33747 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64837 WHERE `entryorguid`=33748 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64838 WHERE `entryorguid`=33739 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64839 WHERE `entryorguid`=33749 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=63597 WHERE `entryorguid` IN (33740,33738,33743,33744,33745,33746,33747,33748,33739,33749) AND `source_type`=0 AND `id`=12 AND `link`=13;
+
+-- The Grand Melee
+UPDATE `smart_scripts` SET `action_param1`=64830 WHERE `entryorguid`=33558 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64831 WHERE `entryorguid`=33559 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64832 WHERE `entryorguid`=33564 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64833 WHERE `entryorguid`=33306 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64834 WHERE `entryorguid`=33285 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64835 WHERE `entryorguid`=33382 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64836 WHERE `entryorguid`=33561 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64837 WHERE `entryorguid`=33383 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64838 WHERE `entryorguid`=33562 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=64839 WHERE `entryorguid`=33384 AND `source_type`=0 AND `id`=13 AND `link`=14;
+UPDATE `smart_scripts` SET `action_param1`=63060 WHERE `entryorguid` IN (33558,33559,33564,33306,33285,33382,33561,33383,33562,33384) AND `source_type`=0 AND `id`=12 AND `link`=13;
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index 98cc33a6f40..95a8bc8ed05 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -2526,6 +2526,35 @@ class spell_q12414_hand_over_reins : public SpellScriptLoader
}
};
+// 13790 13793 13811 13814 - Among the Champions
+// 13665 13745 13750 13756 13761 13767 13772 13777 13782 13787 - The Grand Melee
+class spell_q13665_q13790_bested_trigger : public SpellScriptLoader
+{
+ public:
+ spell_q13665_q13790_bested_trigger() : SpellScriptLoader("spell_q13665_q13790_bested_trigger") { }
+
+ class spell_q13665_q13790_bested_trigger_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q13665_q13790_bested_trigger_SpellScript);
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Unit* target = GetHitUnit()->GetCharmerOrOwnerOrSelf();
+ target->CastSpell(target, uint32(GetEffectValue()));
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q13665_q13790_bested_trigger_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_q13665_q13790_bested_trigger_SpellScript();
+ }
+};
+
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
@@ -2587,4 +2616,5 @@ void AddSC_quest_spell_scripts()
new spell_q28813_get_our_boys_back_dummy();
new spell_q28813_set_health_random();
new spell_q12414_hand_over_reins();
+ new spell_q13665_q13790_bested_trigger();
}