Created
May 29, 2013 07:39
-
-
Save SymbolixDEV/5668592 to your computer and use it in GitHub Desktop.
Hack fix for frost trap , Snake trap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 8d9b630c95b655607cd8d9e4d9d6c09f66ba44da Mon Sep 17 00:00:00 2001 | |
From: ddark <[email protected]> | |
Date: Wed, 6 Jun 2012 13:28:43 +0400 | |
Subject: [PATCH] Revert "Revert "Hack fix of Entrapment and Lock and Load"" | |
This reverts commit 05275b49931317c9910d9f8cd6a4050ecb7df336. | |
--- | |
sql/custom/world/spell_script_names.sql | 14 +++ | |
src/server/scripts/Spells/spell_hunter.cpp | 136 ++++++++++++++++++++++++++++ | |
2 files changed, 150 insertions(+), 0 deletions(-) | |
diff --git a/sql/custom/world/spell_script_names.sql b/sql/custom/world/spell_script_names.sql | |
index f3acbd6..d2ba7a1 100644 | |
--- a/sql/custom/world/spell_script_names.sql | |
+++ b/sql/custom/world/spell_script_names.sql | |
@@ -49,6 +49,16 @@ DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hun_pet_aspect_of_the | |
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES | |
(61669, 'spell_hun_pet_aspect_of_the_beast'); | |
+-- Entrapment and Lock and Load of frost trap | |
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hun_frost_trap'; | |
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES | |
+(63487, 'spell_hun_frost_trap'); | |
+ | |
+-- Entrapment of snake trap | |
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hun_snake_trap'; | |
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES | |
+(45145, 'spell_hun_snake_trap'); | |
+ | |
-- Paladin | |
-- Blessing of Kings and Sanctuary | |
@@ -65,6 +75,10 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES | |
-- Shaman | |
+-- Glyph of Totem of Wrath | |
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sha_totem_of_wrath'; | |
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES | |
+(-30706, 'spell_sha_totem_of_wrath'); | |
-- Raid and Dungeon | |
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp | |
index 4271ce2..9174a73 100644 | |
--- a/src/server/scripts/Spells/spell_hunter.cpp | |
+++ b/src/server/scripts/Spells/spell_hunter.cpp | |
@@ -655,6 +655,140 @@ class spell_hun_misdirection_proc : public SpellScriptLoader | |
} | |
}; | |
+enum Entrapment | |
+{ | |
+ TALENT_ENTRAPMENT_RANK_1 = 19184, | |
+ TALENT_ENTRAPMENT_RANK_2 = 19387, | |
+ TALENT_ENTRAPMENT_RANK_3 = 19388, | |
+ | |
+ SPELL_ENTRAPMENT_TRIGGER_1 = 19185, | |
+ SPELL_ENTRAPMENT_TRIGGER_2 = 64803, | |
+ SPELL_ENTRAPMENT_TRIGGER_3 = 64804, | |
+}; | |
+ | |
+enum LockAndLoad | |
+{ | |
+ TALENT_LOCK_AND_LOAD_RANK_1 = 56342, | |
+ TALENT_LOCK_AND_LOAD_RANK_2 = 56343, | |
+ TALENT_LOCK_AND_LOAD_RANK_3 = 56344, | |
+ | |
+ SPELL_LOCK_AND_LOAD_TRIGGER = 56453, | |
+}; | |
+ | |
+class spell_hun_frost_trap : public SpellScriptLoader | |
+{ | |
+ public: | |
+ spell_hun_frost_trap() : SpellScriptLoader("spell_hun_frost_trap") { } | |
+ | |
+ class spell_hun_frost_trap_SpellScript : public SpellScript | |
+ { | |
+ PrepareSpellScript(spell_hun_frost_trap_SpellScript); | |
+ | |
+ bool Validate(SpellInfo const* /*spellEntry*/) | |
+ { | |
+ if (!sSpellMgr->GetSpellInfo(TALENT_ENTRAPMENT_RANK_1) || !sSpellMgr->GetSpellInfo(TALENT_ENTRAPMENT_RANK_2) || | |
+ !sSpellMgr->GetSpellInfo(TALENT_ENTRAPMENT_RANK_3) || !sSpellMgr->GetSpellInfo(SPELL_ENTRAPMENT_TRIGGER_1) || | |
+ !sSpellMgr->GetSpellInfo(SPELL_ENTRAPMENT_TRIGGER_2) || !sSpellMgr->GetSpellInfo(SPELL_ENTRAPMENT_TRIGGER_3 || | |
+ !sSpellMgr->GetSpellInfo(TALENT_LOCK_AND_LOAD_RANK_1) || !sSpellMgr->GetSpellInfo(TALENT_LOCK_AND_LOAD_RANK_2) || | |
+ !sSpellMgr->GetSpellInfo(TALENT_LOCK_AND_LOAD_RANK_3) || !sSpellMgr->GetSpellInfo(SPELL_LOCK_AND_LOAD_TRIGGER))) | |
+ return false; | |
+ return true; | |
+ } | |
+ | |
+ void Entrapment(SpellEffIndex /*effIndex*/) | |
+ { | |
+ Unit* caster = GetCaster(); | |
+ if (Unit* target = GetHitUnit()) | |
+ { | |
+ if (Unit* owner = caster->GetOwner()) | |
+ { | |
+ if (owner->HasAura(TALENT_ENTRAPMENT_RANK_3)) | |
+ caster->AddAura(SPELL_ENTRAPMENT_TRIGGER_3,target); | |
+ else if (owner->HasAura(TALENT_ENTRAPMENT_RANK_2)) | |
+ caster->AddAura(SPELL_ENTRAPMENT_TRIGGER_2,target); | |
+ else if (owner->HasAura(TALENT_ENTRAPMENT_RANK_1)) | |
+ caster->AddAura(SPELL_ENTRAPMENT_TRIGGER_1,target); | |
+ } | |
+ } | |
+ } | |
+ | |
+ void LockAndLoad(SpellEffIndex /*effIndex*/) | |
+ { | |
+ Unit* caster = GetCaster(); | |
+ if (Unit* owner = caster->GetOwner()) | |
+ { | |
+ uint32 chanceProc = 0; | |
+ if (owner->HasAura(TALENT_LOCK_AND_LOAD_RANK_1)) | |
+ chanceProc = 33; | |
+ else if (owner->HasAura(TALENT_LOCK_AND_LOAD_RANK_2)) | |
+ chanceProc = 66; | |
+ else if (owner->HasAura(TALENT_LOCK_AND_LOAD_RANK_3)) | |
+ chanceProc = 100; | |
+ | |
+ if (chanceProc != 0 && urand(0,99) < chanceProc) | |
+ owner->CastSpell(owner,SPELL_LOCK_AND_LOAD_TRIGGER,true); | |
+ } | |
+ } | |
+ | |
+ void Register() | |
+ { | |
+ OnEffectHitTarget += SpellEffectFn(spell_hun_frost_trap_SpellScript::Entrapment, EFFECT_0, SPELL_EFFECT_TRIGGER_SPELL); | |
+ OnEffectHitTarget += SpellEffectFn(spell_hun_frost_trap_SpellScript::LockAndLoad, EFFECT_0, SPELL_EFFECT_TRIGGER_SPELL); | |
+ } | |
+ }; | |
+ | |
+ SpellScript* GetSpellScript() const | |
+ { | |
+ return new spell_hun_frost_trap_SpellScript(); | |
+ } | |
+}; | |
+ | |
+class spell_hun_snake_trap : public SpellScriptLoader | |
+{ | |
+ public: | |
+ spell_hun_snake_trap() : SpellScriptLoader("spell_hun_snake_trap") { } | |
+ | |
+ class spell_hun_snake_trap_SpellScript : public SpellScript | |
+ { | |
+ PrepareSpellScript(spell_hun_snake_trap_SpellScript); | |
+ | |
+ bool Validate(SpellInfo const* /*spellEntry*/) | |
+ { | |
+ if (!sSpellMgr->GetSpellInfo(TALENT_ENTRAPMENT_RANK_1) || !sSpellMgr->GetSpellInfo(TALENT_ENTRAPMENT_RANK_2) || | |
+ !sSpellMgr->GetSpellInfo(TALENT_ENTRAPMENT_RANK_3) || !sSpellMgr->GetSpellInfo(SPELL_ENTRAPMENT_TRIGGER_1) || | |
+ !sSpellMgr->GetSpellInfo(SPELL_ENTRAPMENT_TRIGGER_2) || !sSpellMgr->GetSpellInfo(SPELL_ENTRAPMENT_TRIGGER_3)) | |
+ return false; | |
+ return true; | |
+ } | |
+ | |
+ void Entrapment(SpellEffIndex /*effIndex*/) | |
+ { | |
+ Unit* caster = GetCaster(); | |
+ if (Unit* target = GetHitUnit()) | |
+ { | |
+ if (Unit* owner = caster->GetOwner()) | |
+ { | |
+ if (owner->HasAura(TALENT_ENTRAPMENT_RANK_3)) | |
+ caster->AddAura(SPELL_ENTRAPMENT_TRIGGER_3,target); | |
+ else if (owner->HasAura(TALENT_ENTRAPMENT_RANK_2)) | |
+ caster->AddAura(SPELL_ENTRAPMENT_TRIGGER_2,target); | |
+ else if (owner->HasAura(TALENT_ENTRAPMENT_RANK_1)) | |
+ caster->AddAura(SPELL_ENTRAPMENT_TRIGGER_1,target); | |
+ } | |
+ } | |
+ } | |
+ | |
+ void Register() | |
+ { | |
+ OnEffectHitTarget += SpellEffectFn(spell_hun_snake_trap_SpellScript::Entrapment, EFFECT_0, SPELL_EFFECT_DUMMY); | |
+ } | |
+ }; | |
+ | |
+ SpellScript* GetSpellScript() const | |
+ { | |
+ return new spell_hun_snake_trap_SpellScript(); | |
+ } | |
+}; | |
void AddSC_hunter_spell_scripts() | |
{ | |
@@ -671,4 +805,6 @@ void AddSC_hunter_spell_scripts() | |
new spell_hun_pet_carrion_feeder(); | |
new spell_hun_misdirection(); | |
new spell_hun_misdirection_proc(); | |
+ new spell_hun_frost_trap(); | |
+ new spell_hun_snake_trap(); | |
} | |
-- | |
1.7.3.1.msysgit.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment