Ir para conteúdo

Posts Recomendados

Creaturescript / Scripts / Promotion.lua E Adicione

 

 

local config = {

promoLevel = 1, -- promotion level : )

needLevel = 20, -- level to get promotion

needPremium = "yes" -- need premium (YES/NO)? :D

}

 

function onAdvance(cid, skill, oldlevel, newlevel)

if (skill == 0) and (newlevel >= config.needLevel and getPlayerPromotionLevel(cid)<config.promoLevel) then

if(string.lower(config.needPremium) == "yes" and isPremium(cid) == TRUE) or (string.lower(config.needPremium) == "no") then

setPlayerPromotionLevel(cid, config.promoLevel)

doPlayerSendTextMessage(cid, 22, "You have been promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")

end

end

return TRUE

end

Creaturescript.xml Adicione

<event type="advance" name="promotion" script="promotion.lua"/>

 

Créditos: Pinpao

 

 

 

Editado por BackMan
Link para o comentário
https://xtibia.com/forum/topic/166383-promotion-automatico/#findComment-1093889
Compartilhar em outros sites

1- Crie um arquivo com o nome de "promotion.lua" (sem aspas) em : data/creaturescripts/scripts.

Adicione este code:

--- Created by Allan.

 

--[Inicio das Configurações]--

local config = {

level = 20, -- Level que o player vai ser promovido.

storage = 2020, -- Storage Value que vai ser usado.

msg = "Parabéns, você foi promovido com sucesso!", -- Mensagem enviada quando atingir o level necessário.

msgtype = MESSAGE_EVENT_ADVANCE -- Tipo da mensagem enviada.

}

--[Fim das Configurações]--

 

function onAdvance(cid, oldLevel, newLevel)

if getPlayerStorageValue(cid, config.storage) == -1 and getPlayerLevel(cid) >= config.level then

setPlayerPromotionLevel(cid, 1)

doPlayerSendTextMessage(cid, config.msgtype, config.msg)

setPlayerStorageValue(cid, config.storage, 1)

end

return TRUE

end

 

2- Em, data/creaturescripts abra o arquivo creaturescripts.xml.

Adicione a tag:

<event type="advance" name="promotion" event="script" value="promotion.lua"/>

 

3- Em, data/creaturescripts/scripts abra o arquivo longin.lua.

Adicione esta linha antes do ultimo return true :

registerCreatureEvent(cid, "promotion")

Créditos :

allan1001

Link para o comentário
https://xtibia.com/forum/topic/166383-promotion-automatico/#findComment-1094753
Compartilhar em outros sites

×
×
  • Criar Novo...