esss SpoilerNão abre aqui em casa |:
info
Grupo: Banidos
Registrado: 21/01/12
Posts: 842
Reputação: +234
Char no Tibia: Stephan

info
Grupo: Conde
Registrado: 21/03/12
Posts: 651
Reputação: +89
Char no Tibia: Pussycat !

esss SpoilerNão abre aqui em casa |:
todas as spoiler ta abrindo testei aki !!
Vodkart goatei muito
REP +A
info
Grupo: Campones
Registrado: 22/07/12
Posts: 54
Reputação: +1
Char no Tibia: Criandootserver

Alavancas e báus
Alavancas
local coin = 9020 -- sua moeda vip local lever = { [6001] = {30,7429}, [6002] = {20,7366}, [6003] = {10,8926}, [6004] = {5,5978} } function onUse(cid,item,fromPosition,itemEx,toPosition) if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)) end doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and 100 or 1) doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
Báus
local coin = 9020 -- sua moeda vip local lever = { [6001] = {30,7429}, [6002] = {20,7366}, [6003] = {10,8926}, [6004] = {5,5978} } function onUse(cid,item,fromPosition,itemEx,toPosition) if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)) end doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and 100 or 1) doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) return true end
Configuração:
[6001] = {30,7429},
[ActionID do báu ou alavanca] = {Quanto vai custar, ID DO ITEM QUE SERÁ VENDIDO}
a tag é essa:
<action actionid="6001-6004" script="nome do seu script.lua"/>
lembrando que pode adicionar mais, e fazendo isso você deve aumentar na tag também, exemplo:
local lever = {
[6001] = {30,7429},
[6002] = {20,7366},
[6003] = {10,8926},
[6004] = {5,5978},
[6005] = {15,7708}
}
e a tag ficaria assim
<action actionid="6001-6005" script="nome do seu script.lua"/>
Npc's
Trade-say
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local msg = string.lower(msg) local moeda = 9020 local t = { ["boots of haste"] = {15, 2195}, -- ["nome do item"] = {quanto vai custar, id do tem que sera vendido} ["demon helmet"] = {25, 2493}, ["frozen starlight"] = {30, 2361}, ["royal crossbow"] = {20, 8851}, ["solar axe"] = {30, 8925}, ["soft boots"] = {50, 2640}, ["demon armor"] = {100, 2494}, ["firewalker boots"] = {50, 9932}, ["magic plate armor"] = {70, 2472}, ["flame blade"] = {100, 8931} } if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then local str = "" str = str .. "Eu vendo estes items: " for name, pos in pairs(t) do str = str.." {"..name.."} = "..pos[1].." Moedas /" end str = str .. "." npcHandler:say(str, cid) elseif t[msg] then if doPlayerRemoveItem(cid,moeda,t[msg][1]) then doPlayerAddItem(cid,t[msg][2],1) npcHandler:say("Aqui está seu ".. getItemNameById(t[msg][2]) .."!", cid) else npcHandler:say("você não tem "..t[msg][1].." ".. getItemNameById(moeda), cid) end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Trade-Shop
OBS: Você precisará ter gps também na mochila, porém não serão removidos os gps, só as moedas vip.
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local shopWindow = {} local moeda = 9020 local t = { [2195] = {price = 15}, -- [iD DO ITEM QUE SERÁ VENDIDO] = {QUANTO IRÁ CUSTAR} [2493] = {price = 25}, [2361] = {price = 30}, [8851] = {price = 20}, [8925] = {price = 30}, [2640] = {price = 50}, [2494] = {price = 100}, [9932] = {price = 50}, [2472] = {price = 70}, [8931] = {price = 100} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and not doPlayerRemoveItem(cid, moeda, t[item].price) then selfSay("você não tem "..t[item].price.." "..getItemNameById(moeda), cid) else doPlayerAddItem(cid, item) selfSay("aqui está seu item!", cid) end return true end if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then for var, ret in pairs(t) do table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)}) end openShopWindow(cid, shopWindow, onBuy, onSell) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Vodka, como eu faço pra comprar so um item ?
Exemplo : quero comprar 1 arrow.. so que em vez de vim 1 arrow, ta vindo 100 arrows.
É possivel por pra comprar so 1 arrow ?
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

são quantos arrow? ID deles...
info
Grupo: Conde
Registrado: 03/01/12
Posts: 884
Reputação: +233
Char no Tibia: Segredo

muito bom ótimos scripts esses
mais nas Alavancas
não seria assim
local coin = 9020 -- sua moeda vip
local lever = {
[6001] = {30,7429},
[6002] = {20,7366},
[6003] = {10,8926},
[6004] = {5,5978}
}
function onUse(cid,item,fromPosition,itemEx,toPosition)
if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin))
end
doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and 100 or 1)
doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2]))
doSendMagicEffect(getCreaturePosition(cid), math.random(28,30))
return true
end
a linha 15 não seria na linha 10 pra mover a alavancas só se tiver a grana, o item
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
Editado Agosto 20 por notle2012
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

Alavancas e báus
Alavancas
local coin = 9020 -- sua moeda vip local lever = { [6001] = {30,7429}, [6002] = {20,7366}, [6003] = {10,8926}, [6004] = {5,5978} } function onUse(cid,item,fromPosition,itemEx,toPosition) if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)) end doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and 100 or 1) doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
Báus
local coin = 9020 -- sua moeda vip local lever = { [6001] = {30,7429}, [6002] = {20,7366}, [6003] = {10,8926}, [6004] = {5,5978} } function onUse(cid,item,fromPosition,itemEx,toPosition) if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)) end doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and 100 or 1) doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) return true end
Configuração:
[6001] = {30,7429},
[ActionID do báu ou alavanca] = {Quanto vai custar, ID DO ITEM QUE SERÁ VENDIDO}
a tag é essa:
<action actionid="6001-6004" script="nome do seu script.lua"/>
lembrando que pode adicionar mais, e fazendo isso você deve aumentar na tag também, exemplo:
local lever = {
[6001] = {30,7429},
[6002] = {20,7366},
[6003] = {10,8926},
[6004] = {5,5978},
[6005] = {15,7708}
}
e a tag ficaria assim
<action actionid="6001-6005" script="nome do seu script.lua"/>
Npc's
Trade-say
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local msg = string.lower(msg) local moeda = 9020 local t = { ["boots of haste"] = {15, 2195}, -- ["nome do item"] = {quanto vai custar, id do tem que sera vendido} ["demon helmet"] = {25, 2493}, ["frozen starlight"] = {30, 2361}, ["royal crossbow"] = {20, 8851}, ["solar axe"] = {30, 8925}, ["soft boots"] = {50, 2640}, ["demon armor"] = {100, 2494}, ["firewalker boots"] = {50, 9932}, ["magic plate armor"] = {70, 2472}, ["flame blade"] = {100, 8931} } if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then local str = "" str = str .. "Eu vendo estes items: " for name, pos in pairs(t) do str = str.." {"..name.."} = "..pos[1].." Moedas /" end str = str .. "." npcHandler:say(str, cid) elseif t[msg] then if doPlayerRemoveItem(cid,moeda,t[msg][1]) then doPlayerAddItem(cid,t[msg][2],1) npcHandler:say("Aqui está seu ".. getItemNameById(t[msg][2]) .."!", cid) else npcHandler:say("você não tem "..t[msg][1].." ".. getItemNameById(moeda), cid) end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Trade-Shop
OBS: Você precisará ter gps também na mochila, porém não serão removidos os gps, só as moedas vip.
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local shopWindow = {} local moeda = 9020 local t = { [2195] = {price = 15}, -- [iD DO ITEM QUE SERÁ VENDIDO] = {QUANTO IRÁ CUSTAR} [2493] = {price = 25}, [2361] = {price = 30}, [8851] = {price = 20}, [8925] = {price = 30}, [2640] = {price = 50}, [2494] = {price = 100}, [9932] = {price = 50}, [2472] = {price = 70}, [8931] = {price = 100} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and not doPlayerRemoveItem(cid, moeda, t[item].price) then selfSay("você não tem "..t[item].price.." "..getItemNameById(moeda), cid) else doPlayerAddItem(cid, item) selfSay("aqui está seu item!", cid) end return true end if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then for var, ret in pairs(t) do table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)}) end openShopWindow(cid, shopWindow, onBuy, onSell) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Vodka, como eu faço pra comprar so um item ?
Exemplo : quero comprar 1 arrow.. so que em vez de vim 1 arrow, ta vindo 100 arrows.
É possivel por pra comprar so 1 arrow ?
local coin = 9020 -- sua moeda vip
local lever = {
[6001] = {30,2160},
[6002] = {20,7840},
[6003] = {10,7364},
[6004] = {5,2544}
}
local arrows = {2544,7364,7840} -- coloque o ID das arrows
function onUse(cid,item,fromPosition,itemEx,toPosition)
if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then
return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin))
end
doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and isInArray(arrows, lever[item.actionid][2]) and 1 or 100)
doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2]))
doSendMagicEffect(getCreaturePosition(cid), math.random(28,30))
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
return true
end
info
Grupo: Campones
Registrado: 22/07/12
Posts: 54
Reputação: +1
Char no Tibia: Criandootserver

Alavancas e báus
Alavancas
local coin = 9020 -- sua moeda vip local lever = { [6001] = {30,7429}, [6002] = {20,7366}, [6003] = {10,8926}, [6004] = {5,5978} } function onUse(cid,item,fromPosition,itemEx,toPosition) if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)) end doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and 100 or 1) doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
Báus
local coin = 9020 -- sua moeda vip local lever = { [6001] = {30,7429}, [6002] = {20,7366}, [6003] = {10,8926}, [6004] = {5,5978} } function onUse(cid,item,fromPosition,itemEx,toPosition) if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)) end doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and 100 or 1) doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) return true end
Configuração:
[6001] = {30,7429},
[ActionID do báu ou alavanca] = {Quanto vai custar, ID DO ITEM QUE SERÁ VENDIDO}
a tag é essa:
<action actionid="6001-6004" script="nome do seu script.lua"/>
lembrando que pode adicionar mais, e fazendo isso você deve aumentar na tag também, exemplo:
local lever = {
[6001] = {30,7429},
[6002] = {20,7366},
[6003] = {10,8926},
[6004] = {5,5978},
[6005] = {15,7708}
}
e a tag ficaria assim
<action actionid="6001-6005" script="nome do seu script.lua"/>
Npc's
Trade-say
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local msg = string.lower(msg) local moeda = 9020 local t = { ["boots of haste"] = {15, 2195}, -- ["nome do item"] = {quanto vai custar, id do tem que sera vendido} ["demon helmet"] = {25, 2493}, ["frozen starlight"] = {30, 2361}, ["royal crossbow"] = {20, 8851}, ["solar axe"] = {30, 8925}, ["soft boots"] = {50, 2640}, ["demon armor"] = {100, 2494}, ["firewalker boots"] = {50, 9932}, ["magic plate armor"] = {70, 2472}, ["flame blade"] = {100, 8931} } if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then local str = "" str = str .. "Eu vendo estes items: " for name, pos in pairs(t) do str = str.." {"..name.."} = "..pos[1].." Moedas /" end str = str .. "." npcHandler:say(str, cid) elseif t[msg] then if doPlayerRemoveItem(cid,moeda,t[msg][1]) then doPlayerAddItem(cid,t[msg][2],1) npcHandler:say("Aqui está seu ".. getItemNameById(t[msg][2]) .."!", cid) else npcHandler:say("você não tem "..t[msg][1].." ".. getItemNameById(moeda), cid) end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Trade-Shop
OBS: Você precisará ter gps também na mochila, porém não serão removidos os gps, só as moedas vip.
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local shopWindow = {} local moeda = 9020 local t = { [2195] = {price = 15}, -- [iD DO ITEM QUE SERÁ VENDIDO] = {QUANTO IRÁ CUSTAR} [2493] = {price = 25}, [2361] = {price = 30}, [8851] = {price = 20}, [8925] = {price = 30}, [2640] = {price = 50}, [2494] = {price = 100}, [9932] = {price = 50}, [2472] = {price = 70}, [8931] = {price = 100} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and not doPlayerRemoveItem(cid, moeda, t[item].price) then selfSay("você não tem "..t[item].price.." "..getItemNameById(moeda), cid) else doPlayerAddItem(cid, item) selfSay("aqui está seu item!", cid) end return true end if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then for var, ret in pairs(t) do table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)}) end openShopWindow(cid, shopWindow, onBuy, onSell) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Vodka, como eu faço pra comprar so um item ?
Exemplo : quero comprar 1 arrow.. so que em vez de vim 1 arrow, ta vindo 100 arrows.
É possivel por pra comprar so 1 arrow ?
local coin = 9020 -- sua moeda vip local lever = { [6001] = {30,2160}, [6002] = {20,7840}, [6003] = {10,7364}, [6004] = {5,2544} } local arrows = {2544,7364,7840} -- coloque o ID das arrows function onUse(cid,item,fromPosition,itemEx,toPosition) if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)) end doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and isInArray(arrows, lever[item.actionid][2]) and 1 or 100) doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
Vodka, tpw.. eu quero vender PETS, so que quando clica no baú vem 100 unidades, eu quero que venha so uma.
[9991] = {30,6541},[9992] = {30,6542}, actionid - quantia - id dos pets.
[9993] = {30,6543},
[9994] = {30,6544},
[9995] = {30,6545}
id dos pets -- > 6541, 6542, 6543, 6544, 6545.
Poe pra comprar so 1 unidade, ao clicar no baú.
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

é só colocar naquela array cara --'
local coin = 9020 -- sua moeda vip
local lever = {
[9991] = {30,6541},
[9992] = {30,6542},
[9993] = {30,6543},
[9994] = {30,6544},
[9995] = {30,6545}
}
local arrows = {6541,6542,6543,6544,6545} -- coloque o ID aqui
function onUse(cid,item,fromPosition,itemEx,toPosition)
if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then
return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin))
end
doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and isInArray(arrows, lever[item.actionid][2]) and 1 or 100)
doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2]))
doSendMagicEffect(getCreaturePosition(cid), math.random(28,30))
doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
return true
end
Editado Agosto 20 por Vodkart
info
Grupo: Campones
Registrado: 22/07/12
Posts: 54
Reputação: +1
Char no Tibia: Criandootserver

é só colocar naquela array cara --'
local coin = 9020 -- sua moeda vip local lever = { [9991] = {30,6541}, [9992] = {30,6542}, [9993] = {30,6543}, [9994] = {30,6544}, [9995] = {30,6545} } local arrows = {6541,6542,6543,6544,6545} -- coloque o ID aqui function onUse(cid,item,fromPosition,itemEx,toPosition) if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)) end doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and isInArray(arrows, lever[item.actionid][2]) and 1 or 100) doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
Vodka, quando eu cliko no baú ele vira 1 alavanca -.-
Eu quero o sistema pro baú, vooc colocou so onde por os ids, onde ponho o valor ? e o actionid do baú ?
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

uhaauhauhuahuhaua q bosta
eu fiz por alavanca mesmo --'
local coin = 9020 -- sua moeda vip
local lever = {
[9991] = {30,6541},
[9992] = {30,6542},
[9993] = {30,6543},
[9994] = {30,6544},
[9995] = {30,6545}
}
local arrows = {6541,6542,6543,6544,6545} -- coloque o ID aqui
function onUse(cid,item,fromPosition,itemEx,toPosition)
if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then
return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin))
end
doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and isInArray(arrows, lever[item.actionid][2]) and 1 or 100)
doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2]))
doSendMagicEffect(getCreaturePosition(cid), math.random(28,30))
return true
end
info
Grupo: Campones
Registrado: 22/07/12
Posts: 54
Reputação: +1
Char no Tibia: Criandootserver

é só colocar naquela array cara --'
local coin = 9020 -- sua moeda vip local lever = { [9991] = {30,6541}, [9992] = {30,6542}, [9993] = {30,6543}, [9994] = {30,6544}, [9995] = {30,6545} } local arrows = {6541,6542,6543,6544,6545} -- coloque o ID aqui function onUse(cid,item,fromPosition,itemEx,toPosition) if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)) end doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and isInArray(arrows, lever[item.actionid][2]) and 1 or 100) doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
Vodka, voce pode mim arrumar 1 script, que quando o player morrer não perder skills nem magic level ?
VLW :]
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

ótimo lugar para pedir script em amigo, acho que dar uma procurar em outras áreas não mata
Muito bom mesmo !!
não teria como acrescentar um de ser por points adicionados ao character ? Porque por vip coins pode dar problema, trocar entre players, enfim...
info
Grupo: Campones
Registrado: 18/08/12
Posts: 17
Reputação: 0
Char no Tibia: Delaks

Mano spoiler não abre aki .




info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino
Alavancas e báus
Alavancas
local coin = 9020 -- sua moeda vip local lever = { [6001] = {30,7429}, [6002] = {20,7366}, [6003] = {10,8926}, [6004] = {5,5978} } function onUse(cid,item,fromPosition,itemEx,toPosition) if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)) end doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and 100 or 1) doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true endBáus
local coin = 9020 -- sua moeda vip local lever = { [6001] = {30,7429}, [6002] = {20,7366}, [6003] = {10,8926}, [6004] = {5,5978} } function onUse(cid,item,fromPosition,itemEx,toPosition) if doPlayerRemoveItem(cid,coin,lever[item.actionid][1]) == FALSE then return doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "você precisa de "..lever[item.actionid][1].." " ..getItemNameById(coin)) end doPlayerAddItem(cid,lever[item.actionid][2], isItemStackable(lever[item.actionid][2]) and 100 or 1) doPlayerSendTextMessage(cid,22,"você comprou um " .. getItemNameById(lever[item.actionid][2])) doSendMagicEffect(getCreaturePosition(cid), math.random(28,30)) return true endConfiguração:
[6001] = {30,7429},
[ActionID do báu ou alavanca] = {Quanto vai custar, ID DO ITEM QUE SERÁ VENDIDO}
a tag é essa:
lembrando que pode adicionar mais, e fazendo isso você deve aumentar na tag também, exemplo:
local lever = {
[6001] = {30,7429},
[6002] = {20,7366},
[6003] = {10,8926},
[6004] = {5,5978},
[6005] = {15,7708}
}
e a tag ficaria assim
Npc's
Trade-say
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local msg = string.lower(msg) local moeda = 9020 local t = { ["boots of haste"] = {15, 2195}, -- ["nome do item"] = {quanto vai custar, id do tem que sera vendido} ["demon helmet"] = {25, 2493}, ["frozen starlight"] = {30, 2361}, ["royal crossbow"] = {20, 8851}, ["solar axe"] = {30, 8925}, ["soft boots"] = {50, 2640}, ["demon armor"] = {100, 2494}, ["firewalker boots"] = {50, 9932}, ["magic plate armor"] = {70, 2472}, ["flame blade"] = {100, 8931} } if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then local str = "" str = str .. "Eu vendo estes items: " for name, pos in pairs(t) do str = str.." {"..name.."} = "..pos[1].." Moedas /" end str = str .. "." npcHandler:say(str, cid) elseif t[msg] then if doPlayerRemoveItem(cid,moeda,t[msg][1]) then doPlayerAddItem(cid,t[msg][2],1) npcHandler:say("Aqui está seu ".. getItemNameById(t[msg][2]) .."!", cid) else npcHandler:say("você não tem "..t[msg][1].." ".. getItemNameById(moeda), cid) end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())Trade-Shop
OBS: Você precisará ter gps também na mochila, porém não serão removidos os gps, só as moedas vip.
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local shopWindow = {} local moeda = 9020 local t = { [2195] = {price = 15}, -- [iD DO ITEM QUE SERÁ VENDIDO] = {QUANTO IRÁ CUSTAR} [2493] = {price = 25}, [2361] = {price = 30}, [8851] = {price = 20}, [8925] = {price = 30}, [2640] = {price = 50}, [2494] = {price = 100}, [9932] = {price = 50}, [2472] = {price = 70}, [8931] = {price = 100} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and not doPlayerRemoveItem(cid, moeda, t[item].price) then selfSay("você não tem "..t[item].price.." "..getItemNameById(moeda), cid) else doPlayerAddItem(cid, item) selfSay("aqui está seu item!", cid) end return true end if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then for var, ret in pairs(t) do table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)}) end openShopWindow(cid, shopWindow, onBuy, onSell) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())