Postado Maio 25, 2015 10 anos local porcentagem = 40 -- Porcentagem de dano que será BLO-QUE-A-DO local pt_br = true function onStatsChange(cid, attacker, type, combat, value) local lang = {"You lose %d hitpoints (damage protected by amulet: %d).", "Você perdeu %d pontos de vida (proteção do amuleto: %d)."} local reset = 9235 if getPlayerSlotItem(cid, 2).itemid == 2218 and isPlayer(attacker) then if type == 1 or type == 3 then if getPlayerStorageValue(cid,reset) == 2 then setPlayerStorageValue(cid,reset,1) return true else local new_dmg = math.ceil((porcentagem/100)*value) setPlayerStorageValue(cid,reset,2) doTargetCombatHealth(attacker, cid, combat, -new_dmg, -new_dmg, 255) doPlayerSendCancel(cid,(pt_br and lang[2]:format(new_dmg, value-new_dmg) or lang[1]:format(new_dmg, value-new_dmg))) return false end end end return true end _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
Postado Maio 27, 2015 10 anos Autor local porcentagem = 40 -- Porcentagem de dano que será BLO-QUE-A-DOlocal pt_br = truefunction onStatsChange(cid, attacker, type, combat, value) local lang = {"You lose %d hitpoints (damage protected by amulet: %d).", "Você perdeu %d pontos de vida (proteção do amuleto: %d)."} local reset = 9235 if getPlayerSlotItem(cid, 2).itemid == 2218 and isPlayer(attacker) then if type == 1 or type == 3 then if getPlayerStorageValue(cid,reset) == 2 then setPlayerStorageValue(cid,reset,1) return true else local new_dmg = math.ceil((porcentagem/100)*value) setPlayerStorageValue(cid,reset,2) doTargetCombatHealth(attacker, cid, combat, -new_dmg, -new_dmg, 255) doPlayerSendCancel(cid,(pt_br and lang[2]:format(new_dmg, value-new_dmg) or lang[1]:format(new_dmg, value-new_dmg))) return false end end end return trueend Ainda não, agora o player hitou 66, daí disse que perdi 156 e protegeu 249, meio que bugou tudo agora, rs. Editado Maio 27, 2015 10 anos por ScythePhantom (veja o histórico de edições)
Postado Maio 30, 2015 10 anos Autor @UP Editado Maio 30, 2015 10 anos por ScythePhantom (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.