aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2012_04_25_02_world_spell_script_names.sql11
-rw-r--r--sql/updates/world/2012_04_25_03_world_spell_group.sql11
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp44
3 files changed, 61 insertions, 5 deletions
diff --git a/sql/updates/world/2012_04_25_02_world_spell_script_names.sql b/sql/updates/world/2012_04_25_02_world_spell_script_names.sql
new file mode 100644
index 00000000000..ea6b95559c6
--- /dev/null
+++ b/sql/updates/world/2012_04_25_02_world_spell_script_names.sql
@@ -0,0 +1,11 @@
+DELETE FROM `spell_scripts` WHERE `id` IN (15998,25952,29435,45980,51592,51910,52267,54420);
+DELETE FROM `spell_script_names` WHERE `spell_id` IN (15998,25952,29435,45980,51592,51910,52267,54420);
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(15998, 'spell_gen_despawn_self'),
+(25952, 'spell_gen_despawn_self'),
+(29435, 'spell_gen_despawn_self'),
+(45980, 'spell_gen_despawn_self'),
+(51592, 'spell_gen_despawn_self'),
+(51910, 'spell_gen_despawn_self'),
+(52267, 'spell_gen_despawn_self'),
+(54420, 'spell_gen_despawn_self'); \ No newline at end of file
diff --git a/sql/updates/world/2012_04_25_03_world_spell_group.sql b/sql/updates/world/2012_04_25_03_world_spell_group.sql
new file mode 100644
index 00000000000..a6fa90ad41d
--- /dev/null
+++ b/sql/updates/world/2012_04_25_03_world_spell_group.sql
@@ -0,0 +1,11 @@
+DELETE FROM `spell_group` WHERE `id` IN (1117,1118);
+INSERT INTO `spell_group` (`id`,`spell_id`) VALUES
+(1117,25898),
+(1117,25899),
+(1118,20911),
+(1118,20217);
+
+DELETE FROM `spell_group_stack_rules` WHERE `group_id` in (1117,1118);
+INSERT INTO `spell_group_stack_rules` (`group_id`,`stack_rule`) VALUES
+(1117,3),
+(1118,3);
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index 2d431331691..3f75c7d41a9 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -169,7 +169,7 @@ class spell_gen_burn_brutallus : public SpellScriptLoader
}
};
-enum eCannibalizeSpells
+enum CannibalizeSpells
{
SPELL_CANNIBALIZE_TRIGGERED = 20578,
};
@@ -224,7 +224,7 @@ class spell_gen_cannibalize : public SpellScriptLoader
};
// 45472 Parachute
-enum eParachuteSpells
+enum ParachuteSpells
{
SPELL_PARACHUTE = 45472,
SPELL_PARACHUTE_BUFF = 44795,
@@ -365,7 +365,7 @@ class spell_gen_remove_flight_auras : public SpellScriptLoader
};
// 66118 Leeching Swarm
-enum eLeechingSwarmSpells
+enum LeechingSwarmSpells
{
SPELL_LEECHING_SWARM_DMG = 66240,
SPELL_LEECHING_SWARM_HEAL = 66125,
@@ -481,7 +481,7 @@ class spell_gen_elune_candle : public SpellScriptLoader
};
// 24750 Trick
-enum eTrickSpells
+enum TrickSpells
{
SPELL_PIRATE_COSTUME_MALE = 24708,
SPELL_PIRATE_COSTUME_FEMALE = 24709,
@@ -557,7 +557,7 @@ class spell_gen_trick : public SpellScriptLoader
};
// 24751 Trick or Treat
-enum eTrickOrTreatSpells
+enum TrickOrTreatSpells
{
SPELL_TRICK = 24714,
SPELL_TREAT = 24715,
@@ -2656,6 +2656,39 @@ class spell_gen_count_pct_from_max_hp : public SpellScriptLoader
int32 _damagePct;
};
+class spell_gen_despawn_self : public SpellScriptLoader
+{
+public:
+ spell_gen_despawn_self() : SpellScriptLoader("spell_gen_despawn_self") { }
+
+ class spell_gen_despawn_self_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_despawn_self_SpellScript);
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_UNIT;
+ }
+
+ void HandleDummy(SpellEffIndex effIndex)
+ {
+ GetCaster()->ToCreature()->DespawnOrUnsummon();
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_despawn_self_SpellScript::HandleDummy, EFFECT_FIRST_FOUND, SPELL_EFFECT_DUMMY);
+ OnEffectHitTarget += SpellEffectFn(spell_gen_despawn_self_SpellScript::HandleDummy, EFFECT_FIRST_FOUND, SPELL_EFFECT_SCRIPT_EFFECT);
+
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_despawn_self_SpellScript();
+ }
+};
+
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -2709,4 +2742,5 @@ void AddSC_generic_spell_scripts()
new spell_gen_wg_water();
new spell_gen_count_pct_from_max_hp("spell_gen_default_count_pct_from_max_hp");
new spell_gen_count_pct_from_max_hp("spell_gen_50pct_count_pct_from_max_hp", 50);
+ new spell_gen_despawn_self();
}