Advertisement
poxipox

Untitled

Nov 9th, 2023 (edited)
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 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 -math.random(minDMG, maxDMG)
  12.     end
  13.    
  14.     return -math.random(minDMG, maxDMG)
  15. end
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement