[8237] Apply attack power multiplier to creature bonus attackpower.

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.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Lynx3d 2009-07-24 16:48:44 +04:00 committed by VladimirMangos
parent 6b2b58cec9
commit e947acd59c
5 changed files with 11 additions and 3 deletions

View file

@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`;
CREATE TABLE `db_version` ( CREATE TABLE `db_version` (
`version` varchar(120) default NULL, `version` varchar(120) default NULL,
`creature_ai_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'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
-- --

View file

@ -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);

View file

@ -250,6 +250,7 @@ pkgdata_DATA = \
8212_01_mangos_spell_proc_event.sql \ 8212_01_mangos_spell_proc_event.sql \
8213_01_mangos_spell_bonus_data.sql \ 8213_01_mangos_spell_bonus_data.sql \
8227_01_mangos_spell_proc_event.sql \ 8227_01_mangos_spell_proc_event.sql \
8237_01_mangos_creature_template.sql \
README README
## Additional files to include when running 'make dist' ## Additional files to include when running 'make dist'
@ -480,4 +481,5 @@ EXTRA_DIST = \
8212_01_mangos_spell_proc_event.sql \ 8212_01_mangos_spell_proc_event.sql \
8213_01_mangos_spell_bonus_data.sql \ 8213_01_mangos_spell_bonus_data.sql \
8227_01_mangos_spell_proc_event.sql \ 8227_01_mangos_spell_proc_event.sql \
8237_01_mangos_creature_template.sql \
README README

View file

@ -803,7 +803,9 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType)
UnitMods unitMod = UNIT_MOD_DAMAGE_MAINHAND; 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 base_pct = GetModifierValue(unitMod, BASE_PCT);
float total_value = GetModifierValue(unitMod, TOTAL_VALUE); float total_value = GetModifierValue(unitMod, TOTAL_VALUE);
float total_pct = GetModifierValue(unitMod, TOTAL_PCT); float total_pct = GetModifierValue(unitMod, TOTAL_PCT);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "8236" #define REVISION_NR "8237"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__