Skip to content

Commit 0756fb9

Browse files
authored
Scripts/Spells: Get rid of some database spell scripts (TrinityCore#30925)
1 parent b4e749a commit 0756fb9

File tree

4 files changed

+151
-0
lines changed

4 files changed

+151
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--
2+
DELETE FROM `spell_scripts` WHERE `id` IN (55770,36153);
3+
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gen_cast_caster_to_target';
4+
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
5+
(55770, 'spell_gen_cast_caster_to_target'),
6+
(36153, 'spell_gen_cast_caster_to_target');
7+
8+
DELETE FROM `spell_scripts` WHERE `id` IN (44876,48724,48726,48728,48730,54640);
9+
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gen_cast_target_to_target';
10+
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
11+
(44876, 'spell_gen_cast_target_to_target'),
12+
(48724, 'spell_gen_cast_target_to_target'),
13+
(48726, 'spell_gen_cast_target_to_target'),
14+
(48728, 'spell_gen_cast_target_to_target'),
15+
(48730, 'spell_gen_cast_target_to_target'),
16+
(54640, 'spell_gen_cast_target_to_target');
17+
UPDATE `smart_scripts` SET `action_type` = 11, `action_param2` = 2 WHERE `entryorguid` IN (27234,27235,27236,27237) AND `id` = 1;
18+
UPDATE `conditions` SET `ConditionTypeOrReference`=32,`ConditionValue1`=144,`ConditionValue2`=0 WHERE `SourceEntry` IN (48724,48726,48728,48730) AND `SourceTypeOrReferenceId` = 13;
19+
20+
DELETE FROM `spell_scripts` WHERE `id` IN (28698);
21+
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_gen_dreaming_glory';
22+
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
23+
(28698, 'spell_gen_dreaming_glory');
24+
25+
DELETE FROM `spell_scripts` WHERE `id` = 55048;
26+
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_storm_peaks_free_brunnhildar_prisoner';
27+
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
28+
(55048, 'spell_storm_peaks_free_brunnhildar_prisoner');
29+
30+
DELETE FROM `spell_scripts` WHERE `id` = 32580;
31+
DELETE FROM `spell_script_names` WHERE `ScriptName` = 'spell_bem_wicked_strong_fetish';
32+
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
33+
(32580, 'spell_bem_wicked_strong_fetish');

src/server/scripts/Northrend/zone_storm_peaks.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,27 @@ struct npc_brunnhildar_prisoner : public ScriptedAI
9797
}
9898
};
9999

100+
// 55048 - Free Brunnhildar Prisoner
101+
class spell_storm_peaks_free_brunnhildar_prisoner : public SpellScript
102+
{
103+
PrepareSpellScript(spell_storm_peaks_free_brunnhildar_prisoner);
104+
105+
bool Validate(SpellInfo const* /*spellInfo*/) override
106+
{
107+
return ValidateSpellInfo({ SPELL_ICE_PRISON });
108+
}
109+
110+
void HandleScript(SpellEffIndex /*effIndex*/)
111+
{
112+
GetCaster()->RemoveAurasDueToSpell(SPELL_ICE_PRISON);
113+
}
114+
115+
void Register() override
116+
{
117+
OnEffectHit += SpellEffectFn(spell_storm_peaks_free_brunnhildar_prisoner::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
118+
}
119+
};
120+
100121
/*######
101122
## npc_freed_protodrake
102123
######*/
@@ -1250,6 +1271,7 @@ class spell_storm_peaks_call_of_earth : public SpellScript
12501271
void AddSC_storm_peaks()
12511272
{
12521273
RegisterCreatureAI(npc_brunnhildar_prisoner);
1274+
RegisterSpellScript(spell_storm_peaks_free_brunnhildar_prisoner);
12531275
RegisterCreatureAI(npc_freed_protodrake);
12541276
RegisterCreatureAI(npc_icefang);
12551277
RegisterCreatureAI(npc_hyldsmeet_protodrake);

src/server/scripts/Outland/zone_blades_edge_mountains.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,32 @@ class spell_bem_dispelling_analysis : public SpellScript
10431043
}
10441044
};
10451045

1046+
/*######
1047+
## Quest 10544: A Curse Upon Both of Your Clans!
1048+
######*/
1049+
1050+
enum ACurseUponBothOfYourClans
1051+
{
1052+
NPC_OGRE_BUILDING_BUNNY_LARGE = 21351
1053+
};
1054+
1055+
// 32580 - Wicked Strong Fetish
1056+
class spell_bem_wicked_strong_fetish : public SpellScript
1057+
{
1058+
PrepareSpellScript(spell_bem_wicked_strong_fetish);
1059+
1060+
void HandleScript(SpellEffIndex /*effIndex*/)
1061+
{
1062+
Unit* caster = GetCaster();
1063+
caster->SummonCreature(NPC_OGRE_BUILDING_BUNNY_LARGE, caster->GetPositionX(), caster->GetPositionY(), caster->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30s);
1064+
}
1065+
1066+
void Register() override
1067+
{
1068+
OnEffectHit += SpellEffectFn(spell_bem_wicked_strong_fetish::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
1069+
}
1070+
};
1071+
10461072
void AddSC_blades_edge_mountains()
10471073
{
10481074
new npc_nether_drake();
@@ -1053,4 +1079,5 @@ void AddSC_blades_edge_mountains()
10531079
new npc_oscillating_frequency_scanner_master_bunny();
10541080
new spell_oscillating_field();
10551081
RegisterSpellScript(spell_bem_dispelling_analysis);
1082+
RegisterSpellScript(spell_bem_wicked_strong_fetish);
10561083
}

src/server/scripts/Spells/spell_generic.cpp

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,46 @@ class spell_gen_cancel_aura : public SpellScript
723723
}
724724
};
725725

726+
class spell_gen_cast_caster_to_target : public SpellScript
727+
{
728+
PrepareSpellScript(spell_gen_cast_caster_to_target);
729+
730+
bool Validate(SpellInfo const* spellInfo) override
731+
{
732+
return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
733+
}
734+
735+
void HandleScript(SpellEffIndex /*effIndex*/)
736+
{
737+
GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()));
738+
}
739+
740+
void Register() override
741+
{
742+
OnEffectHitTarget += SpellEffectFn(spell_gen_cast_caster_to_target::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
743+
}
744+
};
745+
746+
class spell_gen_cast_target_to_target : public SpellScript
747+
{
748+
PrepareSpellScript(spell_gen_cast_target_to_target);
749+
750+
bool Validate(SpellInfo const* spellInfo) override
751+
{
752+
return ValidateSpellInfo({ uint32(spellInfo->GetEffect(EFFECT_0).CalcValue()) });
753+
}
754+
755+
void HandleScript(SpellEffIndex /*effIndex*/)
756+
{
757+
GetHitUnit()->CastSpell(GetHitUnit(), uint32(GetEffectValue()));
758+
}
759+
760+
void Register() override
761+
{
762+
OnEffectHitTarget += SpellEffectFn(spell_gen_cast_target_to_target::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
763+
}
764+
};
765+
726766
enum CannibalizeSpells
727767
{
728768
SPELL_CANNIBALIZE_TRIGGERED = 20578
@@ -1453,6 +1493,32 @@ class spell_gen_divine_storm_cd_reset : public SpellScript
14531493
}
14541494
};
14551495

1496+
enum DreamingGlory
1497+
{
1498+
SPELL_DREAMING_GLORY = 28694
1499+
};
1500+
1501+
// 28698 - Dreaming Glory
1502+
class spell_gen_dreaming_glory : public SpellScript
1503+
{
1504+
PrepareSpellScript(spell_gen_dreaming_glory);
1505+
1506+
bool Validate(SpellInfo const* /*spellInfo*/) override
1507+
{
1508+
return ValidateSpellInfo({ SPELL_DREAMING_GLORY });
1509+
}
1510+
1511+
void HandleScript(SpellEffIndex /*effIndex*/)
1512+
{
1513+
GetHitUnit()->CastSpell(GetHitUnit(), SPELL_DREAMING_GLORY, true);
1514+
}
1515+
1516+
void Register() override
1517+
{
1518+
OnEffectHitTarget += SpellEffectFn(spell_gen_dreaming_glory::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
1519+
}
1520+
};
1521+
14561522
class spell_gen_ds_flush_knockback : public SpellScript
14571523
{
14581524
PrepareSpellScript(spell_gen_ds_flush_knockback);
@@ -4606,6 +4672,8 @@ void AddSC_generic_spell_scripts()
46064672
RegisterSpellScriptWithArgs(spell_gen_break_shield, "spell_gen_tournament_counterattack");
46074673
RegisterSpellScript(spell_gen_burning_depths_necrolyte_image);
46084674
RegisterSpellScript(spell_gen_cancel_aura);
4675+
RegisterSpellScript(spell_gen_cast_caster_to_target);
4676+
RegisterSpellScript(spell_gen_cast_target_to_target);
46094677
RegisterSpellScript(spell_gen_cannibalize);
46104678
RegisterSpellScript(spell_gen_chains_of_ice);
46114679
RegisterSpellScript(spell_gen_chaos_blast);
@@ -4628,6 +4696,7 @@ void AddSC_generic_spell_scripts()
46284696
RegisterSpellScript(spell_gen_despawn_self);
46294697
RegisterSpellScript(spell_gen_despawn_target);
46304698
RegisterSpellScript(spell_gen_divine_storm_cd_reset);
4699+
RegisterSpellScript(spell_gen_dreaming_glory);
46314700
RegisterSpellScript(spell_gen_ds_flush_knockback);
46324701
RegisterSpellScript(spell_gen_dungeon_credit);
46334702
RegisterSpellScript(spell_ethereal_pet_aura);

0 commit comments

Comments
 (0)