Ir para conteúdo

Featured Replies

Postado
-- <event type="advance" name="skill" event="script" value="skill.lua"/>
-- <event type="login" name="skill2" event="script" value="skill2.lua"/>

--  registerCreatureEvent(cid, "skill")
--  registerCreatureEvent(cid, "skill2")




function onAdvance(cid, skill, oldLevel, newLevel)

local t = {  -- [id da skill] = {Max = maximo de skill} 

[SKILL_FIST] =  {Max = 100},
[SKILL_SWORD] = {Max = 100},
[SKILL_AXE] = {Max = 100},
[SKILL_CLUB] = {Max = 100},
[SKILL_DISTANCE] = {Max = 100},
[SKILL__MAGLEVEL] = {Max = 100},
[SKILL_FISHING] = {Max = 100},

}

local check_skill = t[skill]

     if check_skill then
        if  newLevel > check_skill.Max then 
        
            doPlayerSetRate(cid, skill, 0.0)
            doPlayerSave(cid)
			setPlayerStorageValue(cid, skill + 1000, 1)
		return false
      	end
    end
return true     
end

function onLogin(cid)
    
    if getPlayerStorageValue(cid, 1000) == 1 then
    
    doPlayerSetRate(cid, 0, 0.0)
    
    elseif getPlayerStorageValue(cid, 1000 + 1) == 1 then
    
    doPlayerSetRate(cid, 1, 0.0)
    
    elseif getPlayerStorageValue(cid, 1000 + 2) == 1 then
    
    doPlayerSetRate(cid, 2, 0.0)
    
    elseif getPlayerStorageValue(cid, 1000 + 3) == 1 then
    
    doPlayerSetRate(cid, 3, 0.0)
    
    elseif getPlayerStorageValue(cid, 1000 + 4) == 1 then
    
    doPlayerSetRate(cid, 4, 0.0)
    
    elseif getPlayerStorageValue(cid, 1000 + 5) == 1 then
    
    doPlayerSetRate(cid, 5, 0.0)
    
    elseif getPlayerStorageValue(cid, 1000 + 6) == 1 then
    
    doPlayerSetRate(cid, 6, 0.0)
    
    elseif getPlayerStorageValue(cid, 1000 + 7) == 1 then
    
    doPlayerSetRate(cid, 7, 0.0)
    
    return true
    end
return true
end

 

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo