KU
talkaction

[Talkaction] Promotion

Por Kuro o Shiniga, 27 de dez. de 2010 em Actions e Talkactions

otserv
tibia
script
3
3.3k
Kuro o ShinigaK
27 de dezembro de 2010 às 04:25

Ola Galera! Não Sei Se Ja Tem Esse Script Aqui Mais Se Tiver Desculpe :yipi:

Esse Script E Bem Util Pq Varios Players N Sabe Aonde fica O Npc De Promotion Com Esse Talkactions Você Pode Compra Promotion.

 

Testado Em TFS 0.3

 

 

Vamos Ao Que Intereça!

 

Va em Data/Talkactions/Script e crie um arquivo.lua com o nome Promotion.Lua

 

local config = {

promotion = 1, -- promotion level, default = 1 . Ignore if you don't have new vocations.

minLevel = 20, -- Level needed to buy promotion

cost = 20000, -- Promotion cost in gp

premium = "yes" -- is premium needed to buy promotion?

}

 

local disabledVocations = {0}

 

config.premium = getBooleanFromString(config.premium)

 

function onSay(cid, words, param)

if(isInArray(disabledVocations, getPlayerVocation(cid)) == TRUE) then

doPlayerSendCancel(cid, "Your vocation cannot buy promotion.")

elseif(config.premium == TRUE and isPremium(cid) == FALSE) then

doPlayerSendCancel(cid, "You need a premium account.")

elseif(getPlayerPromotionLevel(cid) >= config.promotion) then

doPlayerSendCancel(cid, "You are already promoted.")

elseif(getPlayerLevel(cid) < config.minLevel) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need " .. config.minLevel .. " to get promotion.")

elseif(doPlayerRemoveMoney(cid, config.cost) ~= TRUE) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You do not have enought money! (Promotion cost " .. config.cost .. " gp.")

else

setPlayerPromotionLevel(cid, config.promotion)

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

end

return TRUE

end

 

 

 

Depois Em Talkactions.xml

 

<talkaction words="!buypromotion" script="promotion.lua"/>

 

E Isso Galera! :smile_positivo:

 

Rep+ :nuts:

HudsinH
27 de dezembro de 2010 às 04:27

Ótimo Script Pinpao eu estava mesmo precisando dece script no meu ot, Rep+ :tongue:

JoazanJ
27 de dezembro de 2010 às 04:33

Só vi esse script no ot do subwat , a maioria dos otservs aberto era pra ter mesmo