Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onGetFormulaValuesWeapon(cid, attackSkill, weaponAtk, attackFactor)
- -- max weapon dmg: (int32_t)math.ceil((2 * (weaponAtk * (attackSkill + 5.8) / 25 + (getPlayerLevel(cid) - 1) / 10.)) / attackFactor);
- local maxDMG = math.ceil((2 * (weaponAtk * (attackSkill + 5.8) / 25 + (getPlayerLevel(cid) - 1) / 10.)) / attackFactor)
- local minDMG = math.ceil(maxDMG * minDMGWeaponsPercent)
- print("maxDMG:" .. maxDMG .. " | minDMG: " .. minDMG)
- if math.random(100) <= criticalHitChance then
- maxDMG = math.pow(maxDMG, criticalHitMultiplier)
- doSendAnimatedText(getPlayerPosition(cid),"Critical!", TEXTCOLOR_GREY)
- return -math.random(minDMG, maxDMG)
- end
- return -math.random(minDMG, maxDMG)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement