Advertisement
poxipox

Untitled

Nov 9th, 2023
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. function onGetFormulaValuesWeapon(cid, attackSkill, weaponAtk, attackFactor)
  2.  
  3.     -- max weapon dmg: (int32_t)math.ceil((2 * (weaponAtk * (attackSkill + 5.8) / 25 + (getPlayerLevel(cid) - 1) / 10.)) / attackFactor);
  4.  
  5.     local maxDMG = math.ceil((2 * (weaponAtk * (attackSkill + 5.8) / 25 + (getPlayerLevel(cid) - 1) / 10.)) / attackFactor)
  6.     local minDMG = math.ceil(maxDMG * minDMGWeaponsPercent)
  7.     print("maxDMG:" .. maxDMG .. " | minDMG: " .. minDMG)
  8.     if math.random(100) <= criticalHitChance then
  9.         maxDMG = math.pow(maxDMG, criticalHitMultiplier)
  10.         doSendAnimatedText(getPlayerPosition(cid),"Critical!", TEXTCOLOR_GREY)
  11.         return -maxDMG, -maxDMG
  12.     end
  13.  
  14.     return -minDMG, -maxDMG
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement