KE
dúvida

Ajuda Com Esse Creaturescripts De Level Protection

Por KennyConrad, 26 de ago. de 2012 em Scripts

script
3
761
KennyConradK
26 de agosto de 2012 às 21:05

Galera achei esse script feito pelo vodkart gostei dele ai queria colocar pra funcionar assim Até o level 100 (sem reset) jogadores não perdem itens nen skills ao morrer.

 

function onDeath(cid, corpse, deathList)

local config = {

onlypremium = false, -- se precisa ser premium para não perder nada

exp = false, -- se ao morrer o jogador irá perder exp

skills = false, -- se ao morrer vai perder skills

magic = false, -- se vai perder magic level

loot = false, -- se ao morrer o jogador irá perder o loot

level = 100 -- até que level irá proteger o player

}

if isPlayer(cid) and getPlayerLevel(cid) <= config.level then

if config.onlypremium == true and not isPremium(cid) then return TRUE end

if config.loot == false then doCreatureSetDropLoot(cid, false) end

if config.magic == false then doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) end

if config.skills == false then doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0) end

if config.exp == false then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) end

return TRUE end return TRUE end

 

meu sistema de resets não da storage pra quem não entendeu quero que esse script so protega players com 0 resets porque se não um jogador com 50 resets tiver level 90 morrer ele não vai perder skills nen lot e não quero isso. por isso quero que so proteja players com 0 resets. uso o advanced reset system 2.0 se presisar posto o script aki ok ?

Editado Agosto 26 por KennyxD

VodkartV
26 de agosto de 2012 às 21:11
function onDeath(cid, corpse, deathList)

function getResets(cid) 
local check = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..getPlayerGUID(cid)) 
return check:getDataInt("reset") <= 0 and 0 or check:getDataInt("reset") 
end 

local config = {
onlypremium = false, -- se precisa ser premium para não perder nada
exp = false, -- se ao morrer o jogador irá perder exp
skills = false, -- se ao morrer vai perder skills
magic = false, -- se vai perder magic level
loot = false, -- se ao morrer o jogador irá perder o loot
level = 100 -- até que level irá proteger o player
}
if isPlayer(cid) and getPlayerLevel(cid) <= config.level and getResets(cid) == 0 then
if config.onlypremium == true and not isPremium(cid) then return TRUE end
if config.loot == false then doCreatureSetDropLoot(cid, false) end
if config.magic == false then doPlayerSetLossPercent(cid, PLAYERLOSS_MANA, 0) end
if config.skills == false then doPlayerSetLossPercent(cid, PLAYERLOSS_SKILLS, 0) end
if config.exp == false then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 0) end
return TRUE end return TRUE end

KennyConradK
26 de agosto de 2012 às 23:07

vlw vodkart REP + ajudando como sempre xD ^^

 

duvida sanada topico reportado.