REDIVIVUS

Proposals / #697

Name skill and damage helper parameters from their callees

applied · by dtchitt · submitted 2026-11-01, applied 2026-11-01

Ghidra v1799 · 2663303

Each parameter is forwarded unchanged to a callee parameter and takes its name: SERVER_MinDamage and MaxDamage, GetMinElemDamage and GetMaxElemDamage, SKILLS_CalcToHit, D2GetSkillCalc, SKILLS_CreateMissileAtTarget, DRLGROOM_FindBetterNearbyRoom, SetDamageStats, DAMAGE_RollPhysicalDamageRange and ITEMMOD_GetOrCreateStatList. Pushes and registers were matched to each signature in the machine code. Two are not forwards: SKILLBAR_CanTargetPosition's EAX is range-checked against nTxtSkillsCount and scaled into the skills table, so nSkillId; ITEMMODE_ResetSkillToDefault's EBX reaches GetLeftSkillData when nonzero and GetRightSkillData when zero, so bIsLeftSkill. The chosen name SKILLDESC_DescLine8_AppendMana looks wrong: it calls SKILLS_CalcToHit and formats a to-hit value.

Changes 19, applied together

  1. Rename variable win 0x004ec740 EAX

    namenParam2→nSkillLevel
  2. Rename variable win 0x004ec740 EDI

    namenParam3→eSkillId
  3. Rename variable win 0x004ec6f0 EDI

    namenParam1→nSkillLevel
  4. Rename variable win 0x004ec6f0 EBX

    namenParam2→eSkillId
  5. Rename variable win 0x004ec280 EAX

    namenParam1→nLevel
  6. Rename variable win 0x004ec280 EBX

    namenParam2→nMissileId
  7. Rename variable win 0x004ec510 ECX

    namenParam1→eSkill
  8. Rename variable win 0x004ec510 EAX

    namenParam2→nSkillLevel
  9. Rename variable win 0x005d02b0 Stack[0x8]

    namenParam1→nSkillLvl
  10. Rename variable win 0x005ca470 Stack[0x10]

    namenParam→nSkillLvl
  11. Rename variable win 0x005d9ce0 Stack[0x8]

    namenParam1→nX
  12. Rename variable win 0x005d9ce0 Stack[0xc]

    namenParam2→nY
  13. Rename variable win 0x005d9ce0 EAX

    namenParam3→nSkillId
  14. Rename variable win 0x0059f900 EDI

    namenParam→nLevel
  15. Rename variable win 0x0057a8e0 Stack[0xc]

    namenParam1→nMinPctBonus
  16. Rename variable win 0x0057a8e0 Stack[0x10]

    namenParam2→nRangePctBonus
  17. Rename variable win 0x0057a8e0 Stack[0x14]

    namenParam→nDamageAccum
  18. Rename variable win 0x0055c4f0 EBX

    namenParam→bIsLeftSkill
  19. Rename variable win 0x0065d070 Stack[0x18]

    namenParam5→nState