Fix skill damage never actually scaling with level as its own comment claims
CCharacter::UseAtkSkill's hitmod formula was missing the "+ Stats->Level"
term that CCharacter::NormalAttack's equivalent hitmod already has --
despite the comment directly above it ("skill attacks now based on a
percentage of base attack power so that they scale with level")
promising exactly that. Net effect: a skill with atkpower=100 computed
the same base Attack as a plain auto-attack, but without the level
bonus or crit chance auto-attacks get, so skills ended up hitting no
harder (often weaker) than basic attacks.
This only touches genuine damage skills (skilltype 3/6 dispatched via
SKILL_ATTACK in worldpackets.cpp:pakStartSkill); buffs/heals/status
effects/resurrect (skilltype 9/11/13/20, SKILL_BUFF and friends) run
through entirely separate code and are untouched.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a07c2e0a3f
commit
2b209cf17f
1 file changed
+7
-2
@@ -737,7 +737,12 @@ void CCharacter::UseAtkSkill( CCharacter* Enemy, CSkills* skill, bool deBuff)
|
||||
{
|
||||
//unsigned int totalpower = skill->atkpower + Enemy->Stats->Magic_Defense;
|
||||
unsigned int totalpower = Attack + Enemy->Stats->Magic_Defense;
|
||||
double hitmod = Attack * 100 / totalpower; //percentage of hitpower to use * 100
|
||||
// + Stats->Level to match NormalAttack's hitmod (see battle.cpp
|
||||
// NormalAttack) -- without it, skills never actually scaled with
|
||||
// level despite the comment above claiming they do, and ended up
|
||||
// hitting no harder than (often weaker than, since skills get no
|
||||
// crit) a plain auto-attack.
|
||||
double hitmod = Attack * 100 / totalpower + Stats->Level; //percentage of hitpower to use * 100
|
||||
hitpower = (unsigned int)floor((double)(hitmod * Attack / 100));
|
||||
//Log(MSG_DEBUG,"Skill magic: AP %i DEF %i",Stats->Attack_Power,Enemy->Stats->Defense);
|
||||
//Log(MSG_DEBUG,"Skill magic: Skill power %i. Attack %i",skill->atkpower,Attack);
|
||||
@@ -747,7 +752,7 @@ void CCharacter::UseAtkSkill( CCharacter* Enemy, CSkills* skill, bool deBuff)
|
||||
{
|
||||
//unsigned int totalpower = skill->atkpower + Enemy->Stats->Defense;
|
||||
unsigned int totalpower = Attack + Enemy->Stats->Defense;
|
||||
double hitmod = Attack * 100 / totalpower; //percentage of hitpower to use * 100
|
||||
double hitmod = Attack * 100 / totalpower + Stats->Level; //percentage of hitpower to use * 100
|
||||
hitpower = (unsigned int)floor((double)(hitmod * Attack / 100));
|
||||
//Log(MSG_DEBUG,"Skill physical: AP %i DEF %i",Stats->Attack_Power,Enemy->Stats->Defense);
|
||||
//Log(MSG_DEBUG,"Skill physical: Skill power %i. Attack %i",skill->atkpower,Attack);
|
||||
|
||||
Reference in new issue
Block a user