mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 13:46:24 +00:00
fix(Scripts/Spells): Update Death Knight Ebon Gargoyle auras and damage, and Ghoul auras (#22398)
Co-authored-by: Tereneckla <Tereneckla@pm.me>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
--
|
||||
UPDATE `spell_dbc` SET `Attributes`=`Attributes`|64, `AttributesEx4`=34603008, `ProcChance`=101, `DurationIndex`=21,
|
||||
`Effect_1`=6, `Effect_2`=6, `Effect_3`=6, `EffectBasePoints_1`=-1, `EffectBasePoints_2`=-1, `EffectBasePoints_3`=-1,
|
||||
`ImplicitTargetA_1`=1, `ImplicitTargetA_2`=1, `ImplicitTargetA_3`=1,
|
||||
`EffectAura_1`=29, `EffectAura_2`=29, `EffectAura_3`=189,
|
||||
`EffectMultipleValue_1`=1.0, `EffectMultipleValue_2`=1.0, `EffectMultipleValue_3`=1.0,
|
||||
`EffectMiscValue_1`=3, `EffectMiscValue_2`=4, `EffectMiscValue_3`=114688
|
||||
WHERE `ID`=67557;
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id` = 67557;
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(67557, 'spell_pet_intellect_spirit_resilience_scaling');
|
||||
UPDATE `creature_template_addon` SET `auras` = '' WHERE (`entry` = 27829);
|
||||
@@ -1345,11 +1345,14 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
SetCreateMana(28 + 10 * petlevel);
|
||||
SetCreateHealth(28 + 30 * petlevel);
|
||||
}
|
||||
|
||||
AddAura(SPELL_HUNTER_PET_SCALING_04, this);
|
||||
AddAura(SPELL_SUMMON_HEAL, this);
|
||||
AddAura(SPELL_DK_PET_SCALING_01, this);
|
||||
AddAura(SPELL_DK_PET_SCALING_02, this);
|
||||
AddAura(SPELL_DK_PET_SCALING_03, this);
|
||||
AddAura(SPELL_NIGHT_OF_THE_DEAD_AVOIDANCE, this);
|
||||
AddAura(SPELL_ORC_RACIAL_COMMAND_DK, this);
|
||||
AddAura(SPELL_PET_SCALING_MASTER_03, this);
|
||||
AddAura(SPELL_PET_SCALING_MASTER_06, this);
|
||||
break;
|
||||
}
|
||||
case NPC_BLOODWORM:
|
||||
@@ -1401,9 +1404,9 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
// 100% energy after summon
|
||||
SetPower(POWER_ENERGY, GetMaxPower(POWER_ENERGY));
|
||||
|
||||
// xinef: fixes orc death knight command racial
|
||||
if (owner->getRace() == RACE_ORC)
|
||||
CastSpell(this, SPELL_ORC_RACIAL_COMMAND_DK, true, nullptr, nullptr, owner->GetGUID());
|
||||
AddAura(SPELL_ORC_RACIAL_COMMAND_DK, this);
|
||||
|
||||
AddAura(SPELL_RISEN_GHOUL_SELF_STUN, this);
|
||||
|
||||
// Avoidance, Night of the Dead
|
||||
if (Aura* aur = AddAura(SPELL_NIGHT_OF_THE_DEAD_AVOIDANCE, this))
|
||||
@@ -1411,13 +1414,16 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
if (aur->GetEffect(0))
|
||||
aur->GetEffect(0)->SetAmount(-aurEff->GetSpellInfo()->Effects[EFFECT_2].CalcValue());
|
||||
|
||||
AddAura(SPELL_HUNTER_PET_SCALING_04, this);
|
||||
// Added to perm ghoul by default
|
||||
if (!IsPet())
|
||||
{
|
||||
AddAura(SPELL_DK_PET_SCALING_01, this);
|
||||
AddAura(SPELL_DK_PET_SCALING_02, this);
|
||||
AddAura(SPELL_DK_PET_SCALING_03, this);
|
||||
}
|
||||
|
||||
AddAura(SPELL_PET_SCALING_MASTER_03, this);
|
||||
AddAura(SPELL_PET_SCALING_MASTER_06, this);
|
||||
}
|
||||
|
||||
sScriptMgr->OnInitStatsForLevel(this, petlevel);
|
||||
|
||||
@@ -134,6 +134,7 @@ enum NPCEntries
|
||||
enum PetScalingSpells
|
||||
{
|
||||
SPELL_PET_AVOIDANCE = 32233,
|
||||
SPELL_PET_SCALING_MASTER_03 = 67557, // Serverside - Pet Scaling - Master Spell 03 - Intellect, Spirit, Resilience
|
||||
SPELL_PET_SCALING_MASTER_06 = 67561, // Serverside - Pet Scaling - Master Spell 06 - Spell Hit, Expertise, Spell Penetration
|
||||
|
||||
// Hunter
|
||||
@@ -197,6 +198,8 @@ enum PetScalingSpells
|
||||
SPELL_DK_PET_SCALING_03 = 61697,
|
||||
SPELL_DK_AVOIDANCE = 65220,
|
||||
SPELL_DK_ARMY_OF_THE_DEAD_PASSIVE = 49040,
|
||||
SPELL_SUMMON_HEAL = 36492, // Serverside - Summon Heal
|
||||
SPELL_RISEN_GHOUL_SELF_STUN = 47466,
|
||||
};
|
||||
|
||||
#define PET_FOLLOW_DIST 1.0f
|
||||
|
||||
@@ -280,17 +280,17 @@ class spell_pet_dk_gargoyle_strike : public SpellScript
|
||||
|
||||
void HandleDamageCalc(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
int32 damage = 60;
|
||||
int32 damage = GetEffectValue();
|
||||
if (Unit* caster = GetCaster())
|
||||
if (caster->GetLevel() >= 60)
|
||||
damage += (caster->GetLevel() - 60) * 4;
|
||||
damage += (caster->GetLevel() - 60) * 3;
|
||||
|
||||
SetEffectValue(damage);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_pet_dk_gargoyle_strike::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
OnEffectLaunchTarget += SpellEffectFn(spell_pet_dk_gargoyle_strike::HandleDamageCalc, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -776,19 +776,19 @@ class spell_dk_pet_scaling : public AuraScript
|
||||
|
||||
void CalculateSPAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
// xinef: dk gargoyle inherits 33% of SP
|
||||
if (GetUnitOwner()->GetEntry() != NPC_EBON_GARGOYLE)
|
||||
return;
|
||||
|
||||
if (Unit* owner = GetUnitOwner()->GetOwner())
|
||||
{
|
||||
int32 modifier = 33;
|
||||
// Percentage of the owner's attack power to be inherited as spell power
|
||||
// This value was chosen based on experimental damage of Gargoyle Strike
|
||||
int32 modifier = 75;
|
||||
|
||||
// xinef: impurity
|
||||
if (owner->GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 1986, 0))
|
||||
modifier = 40;
|
||||
if (AuraEffect* impurityEff = owner->GetDummyAuraEffect(SPELLFAMILY_DEATHKNIGHT, 1986, EFFECT_0))
|
||||
AddPct(modifier, impurityEff->GetAmount());
|
||||
|
||||
amount = CalculatePct(std::max<int32>(0, owner->GetTotalAttackPowerValue(BASE_ATTACK)), modifier);
|
||||
amount = CalculatePct(std::max<int32>(0, static_cast<int32>(owner->GetTotalAttackPowerValue(BASE_ATTACK))), modifier);
|
||||
|
||||
// xinef: Update appropriate player field
|
||||
if (owner->IsPlayer())
|
||||
@@ -800,8 +800,11 @@ class spell_dk_pet_scaling : public AuraScript
|
||||
{
|
||||
// xinef: scale haste with owners melee haste
|
||||
if (Unit* owner = GetUnitOwner()->GetOwner())
|
||||
if (owner->m_modAttackSpeedPct[BASE_ATTACK] < 1.0f) // inherit haste only
|
||||
amount = std::min<int32>(100, int32(((1.0f / owner->m_modAttackSpeedPct[BASE_ATTACK]) - 1.0f) * 100.0f));
|
||||
{
|
||||
float modSpeed = owner->m_modAttackSpeedPct[BASE_ATTACK];
|
||||
modSpeed = std::ranges::clamp(modSpeed, 1e-6f, 1.0f);
|
||||
amount = static_cast<int32>(((1.0f / modSpeed) - 1.0f) * 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
@@ -860,13 +863,13 @@ class spell_dk_pet_scaling : public AuraScript
|
||||
|
||||
void Register() override
|
||||
{
|
||||
if (m_scriptSpellId == 54566)
|
||||
if (m_scriptSpellId == SPELL_DK_PET_SCALING_01)
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling::CalculateStatAmount, EFFECT_ALL, SPELL_AURA_MOD_STAT);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling::CalculateSPAmount, EFFECT_ALL, SPELL_AURA_MOD_DAMAGE_DONE);
|
||||
}
|
||||
|
||||
if (m_scriptSpellId == 51996)
|
||||
if (m_scriptSpellId == SPELL_DK_PET_SCALING_02)
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_pet_scaling::CalculateHasteAmount, EFFECT_ALL, SPELL_AURA_MELEE_SLOW);
|
||||
|
||||
OnEffectApply += AuraEffectApplyFn(spell_dk_pet_scaling::HandleEffectApply, EFFECT_ALL, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
|
||||
|
||||
@@ -5320,6 +5320,55 @@ class spell_gen_set_health : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
// 67557 - Serverside - Pet Scaling - Master Spell 03 - Intellect, Spirit, Resilience
|
||||
class spell_pet_intellect_spirit_resilience_scaling : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_pet_intellect_spirit_resilience_scaling)
|
||||
|
||||
void CalculateIntellectAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Player* modOwner = GetUnitOwner()->GetSpellModOwner())
|
||||
amount = static_cast<int32>(CalculatePct(std::max<float>(0, modOwner->GetStat(STAT_INTELLECT)), 30));
|
||||
}
|
||||
|
||||
void CalculateSpiritAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Player* modOwner = GetUnitOwner()->GetSpellModOwner())
|
||||
amount = static_cast<int32>(CalculatePct(std::max<float>(0, modOwner->GetStat(STAT_SPIRIT)), 30));
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->ApplySpellImmune(GetId(), IMMUNITY_STATE, aurEff->GetAuraType(), true, SPELL_BLOCK_TYPE_POSITIVE);
|
||||
}
|
||||
|
||||
void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
if (!GetUnitOwner()->IsPet())
|
||||
return;
|
||||
|
||||
isPeriodic = true;
|
||||
amplitude = 3 * IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
void HandlePeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetEffect(aurEff->GetEffIndex())->RecalculateAmount();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pet_intellect_spirit_resilience_scaling::CalculateIntellectAmount, EFFECT_0, SPELL_AURA_MOD_STAT);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pet_intellect_spirit_resilience_scaling::CalculateSpiritAmount, EFFECT_1,SPELL_AURA_MOD_STAT);
|
||||
// The resilience scaling is not used. The owner's resilience is used directly
|
||||
// DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pet_intellect_spirit_resilience_scaling::CalculateResilienceAmount, EFFECT_2, SPELL_AURA_MOD_RATING);
|
||||
OnEffectApply += AuraEffectApplyFn(spell_pet_intellect_spirit_resilience_scaling::HandleEffectApply, EFFECT_ALL, SPELL_AURA_ANY, AURA_EFFECT_HANDLE_REAL);
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_pet_intellect_spirit_resilience_scaling::CalcPeriodic, EFFECT_ALL, SPELL_AURA_ANY);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_pet_intellect_spirit_resilience_scaling::HandlePeriodic, EFFECT_ALL, SPELL_AURA_ANY);
|
||||
}
|
||||
};
|
||||
|
||||
// 67561 - Serverside - Pet Scaling - Master Spell 06 - Spell Hit, Expertise, Spell Penetration
|
||||
class spell_pet_spellhit_expertise_spellpen_scaling : public AuraScript
|
||||
{
|
||||
@@ -5605,6 +5654,7 @@ void AddSC_generic_spell_scripts()
|
||||
RegisterSpellScript(spell_gen_sober_up);
|
||||
RegisterSpellScript(spell_gen_steal_weapon);
|
||||
RegisterSpellScript(spell_gen_set_health);
|
||||
RegisterSpellScript(spell_pet_intellect_spirit_resilience_scaling);
|
||||
RegisterSpellScript(spell_pet_spellhit_expertise_spellpen_scaling);
|
||||
RegisterSpellScript(spell_gen_proc_on_victim);
|
||||
RegisterSpellScriptWithArgs(spell_gen_translocate, "spell_gen_translocate_down", SPELL_TRANSLOCATION_DOWN);
|
||||
|
||||
Reference in New Issue
Block a user