Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pasdVn/273801 to your computer and use it in GitHub Desktop.
Save pasdVn/273801 to your computer and use it in GitHub Desktop.
From 916f528ad7ea228c6601b69d52de085cec819db3 Mon Sep 17 00:00:00 2001
From: pasdVn <pasdVn3@gmx.de>
Date: Fri, 9 Oct 2009 13:39:40 +0200
Subject: [PATCH 5/6] fixed custom hp/sta and mana/int scaling of some pets
original patch by Corfen, scaling factors by nesocips
TODO: verify scaling factors and add scaling of dk ghoul
---
src/game/StatSystem.cpp | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp
index b625945..986a29a 100644
--- a/src/game/StatSystem.cpp
+++ b/src/game/StatSystem.cpp
@@ -911,10 +911,22 @@ void Pet::UpdateMaxHealth()
{
UnitMods unitMod = UNIT_MOD_HEALTH;
float stamina = GetStat(STAT_STAMINA) - GetCreateStat(STAT_STAMINA);
+ float multiplicator;
+
+ // some pets don't gain 10 hp per stamina
+ switch(GetEntry())
+ {
+ case 416: multiplicator = 8.4f; break; // imp
+ case 417: multiplicator = 9.5f; break; // felhunter
+ case 1863: multiplicator = 9.1f; break; // succubus
+ case 1860: // voidwalker
+ case 17252: multiplicator = 11.0f; break; // felguard
+ default: multiplicator = 10.0f; break;
+ }
float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
value *= GetModifierValue(unitMod, BASE_PCT);
- value += GetModifierValue(unitMod, TOTAL_VALUE) + stamina * 10.0f;
+ value += GetModifierValue(unitMod, TOTAL_VALUE) + stamina * multiplicator;
value *= GetModifierValue(unitMod, TOTAL_PCT);
SetMaxHealth((uint32)value);
@@ -925,10 +937,22 @@ void Pet::UpdateMaxPower(Powers power)
UnitMods unitMod = UnitMods(UNIT_MOD_POWER_START + power);
float addValue = (power == POWER_MANA) ? GetStat(STAT_INTELLECT) - GetCreateStat(STAT_INTELLECT) : 0.0f;
+ float multiplicator;
+
+ // some pets don't gain 15 mana per intellect
+ switch(GetEntry())
+ {
+ case 416: multiplicator = 4.95f; break; // imp
+ case 417: // felhunter
+ case 1860: // voidwalker
+ case 1863: // succubus
+ case 17252: multiplicator = 11.5f; break; // felguard
+ default: multiplicator = 15.0f; break;
+ }
float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreatePowers(power);
value *= GetModifierValue(unitMod, BASE_PCT);
- value += GetModifierValue(unitMod, TOTAL_VALUE) + addValue * 15.0f;
+ value += GetModifierValue(unitMod, TOTAL_VALUE) + addValue * multiplicator;
value *= GetModifierValue(unitMod, TOTAL_PCT);
SetMaxPower(power, uint32(value));
@@ -945,7 +969,7 @@ void Pet::UpdateAttackPowerAndDamage(bool ranged)
if(GetEntry() == 416) // imp's attack power (probably this is correct for all "casters",
val = GetStat(STAT_STRENGTH) - 10.0f; // e.g. also mage's water elemental
else
- val = 2 * GetStat(STAT_STRENGTH) - 20.0f;
+ val = 2 * GetStat(STAT_STRENGTH) - 20.0f; // this is also not correct for all pets, e.g. dk ghoul gets less ap
SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, val);
--
1.6.5.1.1367.gcd48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment