aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/2013_07_30_01_world_spell_script_names_434.sql3
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp12
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp54
3 files changed, 57 insertions, 12 deletions
diff --git a/sql/updates/world/2013_07_30_01_world_spell_script_names_434.sql b/sql/updates/world/2013_07_30_01_world_spell_script_names_434.sql
new file mode 100644
index 00000000000..07f72b82ea7
--- /dev/null
+++ b/sql/updates/world/2013_07_30_01_world_spell_script_names_434.sql
@@ -0,0 +1,3 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=77767;
+INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES
+(77767,'spell_hun_cobra_shot');
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 56ece0ca037..04bd4f8a17e 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -7755,7 +7755,7 @@ Player* Unit::GetAffectingPlayer() const
return NULL;
}
-Minion *Unit::GetFirstMinion() const
+Minion* Unit::GetFirstMinion() const
{
if (uint64 pet_guid = GetMinionGUID())
{
@@ -8932,16 +8932,6 @@ bool Unit::isSpellCrit(Unit* victim, SpellInfo const* spellProto, SpellSchoolMas
break;
}
break;
- case SPELLFAMILY_WARRIOR:
- // Victory Rush
- if (spellProto->SpellFamilyFlags[1] & 0x100)
- {
- // Glyph of Victory Rush
- if (AuraEffect const* aurEff = GetAuraEffect(58382, 0))
- crit_chance += aurEff->GetAmount();
- break;
- }
- break;
}
}
/// Intentional fallback. Calculate critical strike chance for both Ranged and Melee spells
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index e2686eab3ac..9456dc8fdcb 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -35,6 +35,7 @@ enum HunterSpells
SPELL_HUNTER_BESTIAL_WRATH = 19574,
SPELL_HUNTER_CHIMERA_SHOT_HEAL = 53353,
SPELL_HUNTER_FIRE = 82926,
+ SPELL_HUNTER_GENERIC_ENERGIZE_FOCUS = 91954,
SPELL_HUNTER_IMPROVED_MEND_PET = 24406,
SPELL_HUNTER_INVIGORATION_TRIGGERED = 53398,
SPELL_HUNTER_LOCK_AND_LOAD = 56453,
@@ -73,6 +74,11 @@ class spell_hun_chimera_shot : public SpellScriptLoader
return true;
}
+ bool Load() OVERRIDE
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastSpell(GetCaster(), SPELL_HUNTER_CHIMERA_SHOT_HEAL, true);
@@ -93,6 +99,52 @@ class spell_hun_chimera_shot : public SpellScriptLoader
}
};
+// 77767 - Cobra Shot
+class spell_hun_cobra_shot : public SpellScriptLoader
+{
+ public:
+ spell_hun_cobra_shot() : SpellScriptLoader("spell_hun_cobra_shot") { }
+
+ class spell_hun_cobra_shot_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_hun_cobra_shot_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_GENERIC_ENERGIZE_FOCUS) ||
+ !sSpellMgr->GetSpellInfo(SPELL_HUNTER_SERPENT_STING))
+ return false;
+ return true;
+ }
+
+ bool Load() OVERRIDE
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleScriptEffect(SpellEffIndex /*effIndex*/)
+ {
+ GetCaster()->CastSpell(GetCaster(), SPELL_HUNTER_GENERIC_ENERGIZE_FOCUS, true);
+
+ if (Aura* aur = GetHitUnit()->GetAura(SPELL_HUNTER_SERPENT_STING, GetCaster()->GetGUID()))
+ {
+ int32 newDuration = aur->GetDuration() + GetEffectValue() * IN_MILLISECONDS;
+ aur->SetDuration(std::min(newDuration, aur->GetMaxDuration()), true);
+ }
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_hun_cobra_shot_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_hun_cobra_shot_SpellScript();
+ }
+};
+
// 781 - Disengage
class spell_hun_disengage : public SpellScriptLoader
{
@@ -932,7 +984,6 @@ class spell_hun_thrill_of_the_hunt : public SpellScriptLoader
}
};
-
// -56333 - T.N.T.
class spell_hun_tnt : public SpellScriptLoader
{
@@ -977,6 +1028,7 @@ class spell_hun_tnt : public SpellScriptLoader
void AddSC_hunter_spell_scripts()
{
new spell_hun_chimera_shot();
+ new spell_hun_cobra_shot();
new spell_hun_disengage();
new spell_hun_fire();
new spell_hun_improved_mend_pet();