aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/base/world_database.sql6
-rw-r--r--sql/updates/9840_world_spell_linked_spell.sql5
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp50
3 files changed, 60 insertions, 1 deletions
diff --git a/sql/base/world_database.sql b/sql/base/world_database.sql
index ce7563929f5..c8725d9c2a3 100644
--- a/sql/base/world_database.sql
+++ b/sql/base/world_database.sql
@@ -18109,7 +18109,11 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment
( 69377, 72590, 1, 'Runescroll of Fortitude'),
( 50141, 50001, 0, 'Blood Oath to Blood Oath Aura'),
( 61263, 61267, 0, 'Intravenous Healing Effect'),
-( 61263, 61268, 0, 'Intravenous Mana Regeneration Effect');
+( 61263, 61268, 0, 'Intravenous Mana Regeneration Effect'),
+-- PvP Trinket / Every Man for Himself / Will of the Forsaken
+(7744, 72757, 0, 'Will of the Forsaken Cooldown Trigger (WOTF)'),
+(42292, 72752, 0, 'Will of the Forsaken Cooldown Trigger'),
+(59752, 72752, 0, 'Will of the Forsaken Cooldown Trigger');
/*!40000 ALTER TABLE `spell_linked_spell` ENABLE KEYS */;
UNLOCK TABLES;
diff --git a/sql/updates/9840_world_spell_linked_spell.sql b/sql/updates/9840_world_spell_linked_spell.sql
new file mode 100644
index 00000000000..fab11165a0d
--- /dev/null
+++ b/sql/updates/9840_world_spell_linked_spell.sql
@@ -0,0 +1,5 @@
+DELETE FROM spell_linked_spell WHERE spell_trigger IN(7744,42292,59752);
+INSERT INTO spell_linked_spell (spell_trigger, spell_effect, type, comment) VALUES
+(7744, 72757, 0, 'Will of the Forsaken Cooldown Trigger (WOTF)'),
+(42292, 72752, 0, 'Will of the Forsaken Cooldown Trigger'),
+(59752, 72752, 0, 'Will of the Forsaken Cooldown Trigger');
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index a45ebda6f2f..15b698a3bfc 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -144,9 +144,59 @@ class spell_creature_permanent_feign_death : public SpellScriptLoader
}
};
+enum PvPTrinketTriggeredSpells
+{
+ SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER = 72752,
+ SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF = 72757,
+};
+class spell_pvp_trinket_wotf_shared_cd : public SpellScriptLoader
+{
+public:
+ spell_pvp_trinket_wotf_shared_cd() : SpellScriptLoader("spell_pvp_trinket_wotf_shared_cd") {}
+
+ class spell_pvp_trinket_wotf_shared_cd_SpellScript : public SpellScript
+ {
+ bool Validate(SpellEntry const * /*spellEntry*/)
+ {
+ if (!sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER))
+ return false;
+ if (!sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER_WOTF))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Player* pCaster = GetCaster()->ToPlayer();
+ if (!pCaster)
+ return;
+ const SpellEntry* m_spellInfo = GetSpellInfo();
+
+ pCaster->AddSpellCooldown(m_spellInfo->Id, NULL, time(NULL) + GetSpellRecoveryTime(sSpellStore.LookupEntry(SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)) / IN_MILLISECONDS);
+ WorldPacket data(SMSG_SPELL_COOLDOWN, 8+1+4);
+ data << uint64(pCaster->GetGUID());
+ data << uint8(0);
+ data << uint32(m_spellInfo->Id);
+ data << uint32(0);
+ pCaster->GetSession()->SendPacket(&data);
+ }
+
+ void Register()
+ {
+ OnEffect += SpellEffectFn(spell_pvp_trinket_wotf_shared_cd_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_pvp_trinket_wotf_shared_cd_SpellScript();
+ }
+};
+
void AddSC_generic_spell_scripts()
{
new spell_gen_pet_summoned();
new spell_gen_remove_flight_auras();
new spell_creature_permanent_feign_death();
+ new spell_pvp_trinket_wotf_shared_cd();
}