• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

convert this script for use on tfs 1.0

davidmemo

New Member
Joined
Mar 28, 2011
Messages
37
Reaction score
0
this is the script
Code:
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 ----id del vampire token aqui esta por gold nugget
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())
 
Back
Top