Core/Spells:

* fixed Kill Command
* fixed Improved Kill Command crit chance bonus
* fixed Frenzy not triggering Focus Fire's visual effect correctly

closes #78
This commit is contained in:
Ovahlord
2020-07-17 16:21:37 +02:00
parent fc4e2e4203
commit 405569dbff
3 changed files with 48 additions and 4 deletions

View File

@@ -0,0 +1,3 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_hun_kill_command';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(34026, 'spell_hun_kill_command');

View File

@@ -6714,6 +6714,10 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
// Hunter Pet basic attacks (RAP * 0.4 * 0.2)
if (spellProto->SpellFamilyFlags[0] & 0x00080000)
DoneTotal += (owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.4f) * 0.2f;
// Kill Command
if (spellProto->SpellFamilyFlags[1] & 0x00000800)
DoneTotal += owner->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.516f;
break;
case SPELLFAMILY_WARLOCK:
// Warlock Minions inherit 50% of their owner's spell power
@@ -7282,7 +7286,7 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto
&& spellProto->SpellIconID == 1680
&& victim->HasAuraState(AURA_STATE_BLEEDING))
{
if (AuraEffect const* rendAndTear = GetDummyAuraEffect(SPELLFAMILY_DRUID, 2859, 1))
if (AuraEffect const* rendAndTear = GetDummyAuraEffect(SPELLFAMILY_DRUID, 2859, EFFECT_1))
crit_chance += rendAndTear->GetAmount();
break;
}
@@ -7294,6 +7298,13 @@ float Unit::GetUnitSpellCriticalChance(Unit* victim, SpellInfo const* spellProto
if (victim->GetHealthPct() >= healthAuraEff->GetAmount())
crit_chance += critAuraEff->GetAmount();
break;
case SPELLFAMILY_HUNTER:
// Kill Command - Improved Kill Command
if (spellProto->SpellFamilyFlags[1] & 0x00000800)
if (Player* player = GetSpellModOwner())
if (AuraEffect const* improvedKillCommand = player->GetDummyAuraEffect(SPELLFAMILY_HUNTER, 2221, EFFECT_0))
crit_chance += improvedKillCommand->GetAmount();
break;
}
}
/* fallthrough - Calculate critical strike chance for both Ranged and Melee spells*/

View File

@@ -49,6 +49,7 @@ enum HunterSpells
SPELL_HUNTER_FRENZY_EFFECT = 19615,
SPELL_HUNTER_FOCUS_FIRE_ENERGIZE = 83468,
SPELL_HUNTER_FOCUS_FIRE_DUMMY = 88843,
SPELL_HUNTER_FOCUS_FIRE = 82692,
SPELL_HUNTER_GENERIC_ENERGIZE_FOCUS = 91954,
SPELL_HUNTER_IMPROVED_MEND_PET = 24406,
SPELL_HUNTER_IMPROVED_SERPENT_STING_DAMAGE = 83077,
@@ -1670,14 +1671,19 @@ class spell_hun_frenzy_effect : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
return ValidateSpellInfo({ SPELL_HUNTER_FOCUS_FIRE_DUMMY });
return ValidateSpellInfo(
{
SPELL_HUNTER_FOCUS_FIRE_DUMMY,
SPELL_HUNTER_FOCUS_FIRE
});
}
void AfterApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (GetStackAmount() == GetSpellInfo()->StackAmount)
if (Unit* owner = GetTarget()->GetOwner())
owner->CastSpell(owner, SPELL_HUNTER_FOCUS_FIRE_DUMMY, true, nullptr, aurEff);
if (owner->HasSpell(SPELL_HUNTER_FOCUS_FIRE))
owner->CastSpell(owner, SPELL_HUNTER_FOCUS_FIRE_DUMMY, true, nullptr, aurEff);
}
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -1688,11 +1694,34 @@ class spell_hun_frenzy_effect : public AuraScript
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_hun_frenzy_effect::AfterApply, EFFECT_0, SPELL_AURA_MOD_MELEE_HASTE_3, AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK);
AfterEffectApply += AuraEffectApplyFn(spell_hun_frenzy_effect::AfterApply, EFFECT_0, SPELL_AURA_MOD_MELEE_HASTE_3, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK);
AfterEffectRemove += AuraEffectRemoveFn(spell_hun_frenzy_effect::AfterRemove, EFFECT_0, SPELL_AURA_MOD_MELEE_HASTE_3, AURA_EFFECT_HANDLE_REAL);
}
};
// 34026 - Kill Command
class spell_hun_kill_command: public SpellScript
{
PrepareSpellScript(spell_hun_kill_command);
void HandleScriptEffect(SpellEffIndex effIndex)
{
Unit* caster = GetCaster();
if (!caster || !caster->IsPlayer())
return;
Player* player = caster->ToPlayer();
if (Pet* pet = player->GetPet())
if (Unit* target = pet->GetVictim())
pet->CastSpell(target, GetSpellInfo()->Effects[effIndex].BasePoints, false);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_hun_kill_command::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_hunter_spell_scripts()
{
new spell_hun_ancient_hysteria();
@@ -1709,6 +1738,7 @@ void AddSC_hunter_spell_scripts()
RegisterAuraScript(spell_hun_glyph_of_kill_shot);
new spell_hun_improved_mend_pet();
RegisterSpellScript(spell_hun_invigoration);
RegisterSpellScript(spell_hun_kill_command);
new spell_hun_last_stand_pet();
new spell_hun_lock_and_load();
RegisterAuraScript(spell_hun_marked_for_death);