Não testei...
local SKILL_ID = 0 -- id do skill...
local function showSkill(cid)
local skills = {
[{10, 20}] = 10, -- chance de dar miss...
[{21, 30}] = 20,
[{31, 40}] = 30,
[{31, 40}] = 40,
[{41, math.huge}] = 50
}
for var, ret in pairs(t) do
if getPlayerSkillLevel(cid, SKILL_ID) >= var[1] and getPlayerSkillLevel(cid, SKILL_ID) <= var[2] then
return ret
end
end
end
function onStatsChange(cid, attacker, type, combat, value)
local COLOR_ID = 200 -- cor do texto...
local CHANCE = 100 -- chance max do player dar miss / 100 = 1 em 100 / 1000 = 1 em 1000...
local showMagicEffect = true -- vai mostrar magic effect? / true = sim / false = nao...
local MAGIC_EFFECT = 1 -- id do magic effect caso true...
if not isCreature(cid) then
return true
end
if combat ~= COMBAT_HEALING then
if showSkill(cid) > math.random (1, CHANCE) then
if showMagicEffect == true then
doSendMagicEffect(getCreaturePosition(cid), MAGIC_EFFECT)
end
doSendAnimatedText(getCreaturePosition(cid), "MISS!", COLOR_ID)
return false
end
end
return true
end
Só configurar aonde está escrito.














info
Grupo: Artesão
Registrado: 02/07/13
Posts: 115
Reputação: +12
Char no Tibia: Naoti
Ola Xtibia eu uso o TFS 0.4 3884
eu preciso de um sistema que dependendo do seu skill de shielding podera da MISS quando um bicho te ataca ou player ataca avera chance de da MISS (Attack falha)
Tipo :
Se seu skill de shielding for 20 tera 5% de chance de da MISS
Se seu skill de shielding for 30 tera 10% de chance de da MISS
Se seu skill de shielding for 60 tera 30% de chance de da MISS
Quando não acerta o attack ai aparece MISS em azul em cima do player.
Quem me ajuda darei 3 Rep++
por favor to precisando ugente