• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 0.X -=[Critical Stone]=- no show CRITICAL!

Enderlop

Banned User
Joined
Jan 10, 2024
Messages
93
Reaction score
16
Lua:
  local config = {
   effectonuse = 14, -- efeito que sai
   levelscrit = 10000,  --- leveis que terão
   storagecrit = 48913 -- storage que será verificado
   }
  
function onUse(cid, item, frompos, item2, topos)
    if getPlayerStorageValue(cid, config.storagecrit) < config.levelscrit then
   doRemoveItem(item.uid, 1)
doSendMagicEffect(topos,config.effectonuse)
doPlayerSendTextMessage(cid,22,"You've Leveled your Critical Skill to ["..(getPlayerStorageValue(cid, config.storagecrit)+1).."/"..config.levelscrit.."].")
setPlayerStorageValue(cid, config.storagecrit, getPlayerStorageValue(cid, config.storagecrit)+1)
elseif getPlayerStorageValue(cid, config.storagecrit) >= config.levelscrit then
doPlayerSendTextMessage(cid,22,"You've already reached the MAX level of Critical Skill.\nCongratulations!!!!")
    return 0
    end
return 1
end

Lua:
local lvlcrit = 48903
local multiplier = 1.5

function onStatsChange(cid, attacker, type, combat, value)
    if (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) and isPlayer(attacker) and isCreature(cid) then
        local attackerCritLevel = getPlayerStorageValue(attacker, lvlcrit) or 0 -- Verifica se o nível crítico do atacante existe, caso contrário, define como 0
        if (attackerCritLevel * 3) >= math.random(0, 1000) then
            local criticalValue = math.ceil(value * multiplier)
            doTargetCombatHealth(attacker, cid, combat, -criticalValue, -criticalValue, 255)
            doSendAnimatedText(getCreaturePos(attacker), "CRITICAL!", 144)
            return false
        end
    end
    return true
end
 
Back
Top