jesteraddon.lua
function onSay(cid, words, param, channel)
local cfg = {
["first nightmare addon"] = {
outfit = {
male = 273,
female = 270,
addon = 1,
storage = 11018
},
items = {
{9693,1}
}
},
["second nightmare addon"] = {
outfit = {
male = 273,
female = 270,
addon = 2,
storage = 11019
},
items = {
{9693,1}
}
}
}
local v, removeItems = cfg[param], 0, 0
if(param == "") then
doPlayerSendCancel(cid, "Command requires param.")
return TRUE
end
if (not isPremium(cid)) then
doPlayerSendCancel(cid, "Você nao tem premium account.")
return TRUE
end
if(getPlayerStorageValue(cid, v.outfit.storage) == -1) then
for i = 1, #v.items do
if(getPlayerItemCount(cid, v.items[i][1]) >= v.items[i][2]) then
removeItems = removeItems+1
end
end
if(removeItems == #v.items) then
if(getPlayerSex(cid) == 1) then
doPlayerAddOutfit(cid, v.outfit.male, v.outfit.addon)
elseif(getPlayerSex(cid) == 0) then
doPlayerAddOutfit(cid, v.outfit.female, v.outfit.addon)
end
for i = 1, #v.items do
doPlayerRemoveItem(cid, v.items[i][1], v.items[i][2])
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você recebeu uma nova outfit!")
doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW)
setPlayerStorageValue(cid, v.outfit.storage, 1)
else
for i = 1, #v.items do
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "você precisa " .. v.items[i][2] .. "x " .. getItemNameById(v.items[i][1]) .. " para comprar a outfit.")
end
end
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "Você ja tem está outfit.")
end
return TRUE
end
talkactions.xml
<talkaction words="!buy" event="script" value="jesteraddon.lua"/>
comandos:
!buy first nightmare addon
!buy second nightmare addon






info
Grupo: Campones
Registrado: 19/12/08
Posts: 22
Reputação: +2
Tipo do script: Não Sei
Protocolo (versão do Tibia): 8.54
Servidor utilizado: TFS 0.3.6
Nível de experiência: Acho que Básica (me expliquem onde botar as coisas certinho)
Adicionais/Informações:
Item: Jester Doll
ID:9693
O que faz: um Doll (Boneco) que quando você digita o seguinte comando, EXEMPLO:
!first "nightmare addon e !second "nightmare addon voce ganha o addon escolhido
vi isso em um outro OTS e achei muito interessante, se voces puderem me ajudar, agradeço desde já!