diff options
| author | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-23 13:44:42 +0200 |
|---|---|---|
| committer | Vincent-Michael <Vincent_Michael@gmx.de> | 2013-07-23 13:46:38 +0200 |
| commit | 193d71f158d87a875d16020323483c7484198d7f (patch) | |
| tree | bdd5e02141ce310d461450ece0c945cf78fe9189 | |
| parent | 62944c6d8da6b05b0106e633d5e3f53c6e3fa08e (diff) | |
Core/Spells: Fix hunter talent "Master Marksman" for 4.3.4
Closes #9968
| -rw-r--r-- | sql/updates/world/2013_07_23_01_world_spell_spell_misc_434.sql | 11 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 2 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 7 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_dk.cpp | 2 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_hunter.cpp | 80 | ||||
| -rw-r--r-- | src/server/scripts/Spells/spell_shaman.cpp | 2 |
6 files changed, 95 insertions, 9 deletions
diff --git a/sql/updates/world/2013_07_23_01_world_spell_spell_misc_434.sql b/sql/updates/world/2013_07_23_01_world_spell_spell_misc_434.sql new file mode 100644 index 00000000000..d1776eb3edf --- /dev/null +++ b/sql/updates/world/2013_07_23_01_world_spell_spell_misc_434.sql @@ -0,0 +1,11 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (34485,34486,34487,82926); +INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES +(34485, 0, 9, 0, 0x1, 0, 0, 0, 0, 0, 0), +(34486, 0, 9, 0, 0x1, 0, 0, 0, 0, 0, 0), +(34487, 0, 9, 0, 0x1, 0, 0, 0, 0, 0, 0), +(82926, 0, 9, 0x20000, 0, 0, 0, 0, 0, 0, 0); + +DELETE FROM `spell_script_names` WHERE `spell_id`IN (82925,82926); +INSERT INTO `spell_script_names`(`spell_id`, `ScriptName`) VALUES +(82925,'spell_hun_ready_set_aim'), +(82926,'spell_hun_fire'); diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 0f92bdad061..e58a401575a 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -2252,7 +2252,7 @@ uint32 SpellInfo::CalcCastTime(Unit* caster, Spell* spell) const if (caster) caster->ModSpellCastTime(this, castTime, spell); - if (Attributes & SPELL_ATTR0_REQ_AMMO && (!IsAutoRepeatRangedSpell())) + if (Attributes & SPELL_ATTR0_REQ_AMMO && (!IsAutoRepeatRangedSpell()) && !(AttributesEx9 & SPELL_ATTR9_AIMED_SHOT)) castTime += 500; return (castTime > 0) ? uint32(castTime) : 0; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index cedafc08883..e0cea01a9ca 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3029,10 +3029,10 @@ void SpellMgr::LoadSpellInfoCorrections() case 53096: // Quetz'lun's Judgment spellInfo->MaxAffectedTargets = 1; break; - case 42730: + case 42730: // Woe Strike spellInfo->Effects[EFFECT_1].TriggerSpell = 42739; break; - case 59735: + case 59735: // Woe Strike spellInfo->Effects[EFFECT_1].TriggerSpell = 59736; break; case 52611: // Summon Skeletons @@ -3089,9 +3089,6 @@ void SpellMgr::LoadSpellInfoCorrections() // because of bug in dbc spellInfo->ProcChance = 0; break; - case 20335: // Heart of the Crusader - case 20336: - case 20337: case 63320: // Glyph of Life Tap case 53228: // Rapid Killing (Rank 1) case 53232: // Rapid Killing (Rank 2) diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 45a8199609e..b704a475edd 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -864,7 +864,7 @@ class spell_dk_scent_of_blood : public SpellScriptLoader { PreventDefaultAction(); GetTarget()->CastSpell(GetTarget(), SPELL_DK_SCENT_OF_BLOOD, true, NULL, aurEff); - GetTarget()->RemoveAuraFromStack(GetSpellInfo()->Id); + GetTarget()->RemoveAuraFromStack(GetId()); } void Register() OVERRIDE diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index 208d10fbfe3..7c4d3ca2208 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -36,6 +36,7 @@ enum HunterSpells SPELL_HUNTER_ASPECT_OF_THE_VIPER_ENERGIZE = 34075, SPELL_HUNTER_BESTIAL_WRATH = 19574, SPELL_HUNTER_CHIMERA_SHOT_HEAL = 53353, + SPELL_HUNTER_FIRE = 82926, SPELL_HUNTER_GLYPH_OF_ASPECT_OF_THE_VIPER = 56851, SPELL_HUNTER_IMPROVED_MEND_PET = 24406, SPELL_HUNTER_INVIGORATION_TRIGGERED = 53398, @@ -219,6 +220,42 @@ class spell_hun_disengage : public SpellScriptLoader } }; +// 82926 - Fire! +class spell_hun_fire : public SpellScriptLoader +{ + public: + spell_hun_fire() : SpellScriptLoader("spell_hun_fire") { } + + class spell_hun_fire_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_fire_AuraScript); + + void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod) + { + if (!spellMod) + { + spellMod = new SpellModifier(GetAura()); + spellMod->op = SPELLMOD_CASTING_TIME; + spellMod->type = SPELLMOD_PCT; + spellMod->spellId = GetId(); + spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask; + } + + spellMod->value = -aurEff->GetAmount(); + } + + void Register() OVERRIDE + { + DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_hun_fire_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_hun_fire_AuraScript(); + } +}; + // -19572 - Improved Mend Pet class spell_hun_improved_mend_pet : public SpellScriptLoader { @@ -661,6 +698,44 @@ class spell_hun_readiness : public SpellScriptLoader } }; +// 82925 - Ready, Set, Aim... +class spell_hun_ready_set_aim : public SpellScriptLoader +{ + public: + spell_hun_ready_set_aim() : SpellScriptLoader("spell_hun_ready_set_aim") { } + + class spell_hun_ready_set_aim_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_ready_set_aim_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_FIRE)) + return false; + return true; + } + + void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + if (GetStackAmount() == 5) + { + GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_FIRE, true, NULL, aurEff); + GetTarget()->RemoveAura(GetId()); + } + } + + void Register() OVERRIDE + { + AfterEffectApply += AuraEffectApplyFn(spell_hun_ready_set_aim_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_hun_ready_set_aim_AuraScript(); + } +}; + // 37506 - Scatter Shot class spell_hun_scatter_shot : public SpellScriptLoader { @@ -709,7 +784,8 @@ class spell_hun_sniper_training : public SpellScriptLoader bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE { - if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_SNIPER_TRAINING_R1) || !sSpellMgr->GetSpellInfo(SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1)) + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_SNIPER_TRAINING_R1) || + !sSpellMgr->GetSpellInfo(SPELL_HUNTER_SNIPER_TRAINING_BUFF_R1)) return false; return true; } @@ -964,6 +1040,7 @@ void AddSC_hunter_spell_scripts() new spell_hun_ascpect_of_the_viper(); new spell_hun_chimera_shot(); new spell_hun_disengage(); + new spell_hun_fire(); new spell_hun_improved_mend_pet(); new spell_hun_invigoration(); new spell_hun_last_stand_pet(); @@ -974,6 +1051,7 @@ void AddSC_hunter_spell_scripts() new spell_hun_pet_heart_of_the_phoenix(); new spell_hun_rapid_recuperation(); new spell_hun_readiness(); + new spell_hun_ready_set_aim(); new spell_hun_scatter_shot(); new spell_hun_sniper_training(); new spell_hun_steady_shot(); diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 6b78c3e4c44..3b67fca94cf 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -91,7 +91,7 @@ class spell_sha_ancestral_awakening : public SpellScriptLoader void HandleEffectProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 heal = CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount()); + int32 heal = int32(CalculatePct(eventInfo.GetHealInfo()->GetHeal(), aurEff->GetAmount())); GetTarget()->CastCustomSpell(SPELL_SHAMAN_ANCESTRAL_AWAKENING, SPELLVALUE_BASE_POINT0, heal, (Unit*)NULL, true, NULL, aurEff); } |
