aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2009-07-30 11:02:07 +0800
committermegamage <none@none>2009-07-30 11:02:07 +0800
commita94cccbf4d900fd3e184239ce981a7dfbb6dc467 (patch)
tree6b5b98b3464a6c0ec3eef7484cf3910260239286
parent7f6926dd3b1e2596e9cfa697b72afc7828f4e321 (diff)
[8237] Apply attack power multiplier to creature bonus attackpower. Author: Lynx3d
Note: mindmg/maxdmg in creature_template expected including attackpower part in its. attackpower field only show part of attackpower not affected by AP multiplier. Thanks also to Seizer for take part in reseach and patch review. --HG-- branch : trunk
-rw-r--r--sql/mangos.sql2
-rw-r--r--sql/updates/4643_world_8237_creature_template.sql4
-rw-r--r--src/game/StatSystem.cpp4
3 files changed, 8 insertions, 2 deletions
diff --git a/sql/mangos.sql b/sql/mangos.sql
index 731ff4e7e22..5453a09ba83 100644
--- a/sql/mangos.sql
+++ b/sql/mangos.sql
@@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`;
CREATE TABLE `db_version` (
`version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL,
- `required_8227_01_mangos_spell_proc_event` bit(1) default NULL
+ `required_8237_01_mangos_creature_template` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
--
diff --git a/sql/updates/4643_world_8237_creature_template.sql b/sql/updates/4643_world_8237_creature_template.sql
new file mode 100644
index 00000000000..8a199e4d9b7
--- /dev/null
+++ b/sql/updates/4643_world_8237_creature_template.sql
@@ -0,0 +1,4 @@
+-- ALTER TABLE db_version CHANGE COLUMN required_8227_01_mangos_spell_proc_event required_8237_01_mangos_creature_template bit;
+
+UPDATE creature_template
+ SET mindmg = ROUND(mindmg + attackpower), maxdmg=ROUND(maxdmg+attackpower); \ No newline at end of file
diff --git a/src/game/StatSystem.cpp b/src/game/StatSystem.cpp
index bd283c81fc5..fbe16c9b726 100644
--- a/src/game/StatSystem.cpp
+++ b/src/game/StatSystem.cpp
@@ -863,7 +863,9 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType)
UnitMods unitMod = UNIT_MOD_DAMAGE_MAINHAND;
- float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType);
+ /* difference in AP between current attack power and base value from DB */
+ float att_pwr_change = GetTotalAttackPowerValue(attType) - GetCreatureInfo()->attackpower;
+ float base_value = GetModifierValue(unitMod, BASE_VALUE) + (att_pwr_change * GetAPMultiplier(attType, false) / 14.0f);
float base_pct = GetModifierValue(unitMod, BASE_PCT);
float total_value = GetModifierValue(unitMod, TOTAL_VALUE);
float total_pct = GetModifierValue(unitMod, TOTAL_PCT);