Postado Julho 19, 2014 11 anos No meu server estou tendo um problema, quando um player faz trade com o NPC, o pagamento está bem implementado, que é feito em Gold nuggets, no entanto na shop window está isto: Onde está esse x gold eu queria que ficasse x Gold Nuggets. Aqui está a script do npc: 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 MoedaVip = 2157 -- Id da MoedaVip local shopWindow = {} local t = { [2457] = {price = 50}, -- [id do item] e em price qnto honor points vai custar [2422] = {price = 200} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and doPlayerRemoveItem(cid, MoedaVip, t[item].price) then doPlayerAddItem(cid, item, 1, false) selfSay("Aqui esta o Item", cid) else selfSay("Voce nao tem "..t[item].price.." Gold nugget suficientes / You do not have enough Gold Nuggets", 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()) Editado Julho 19, 2014 11 anos por mikkas70 (veja o histórico de edições) TibiaServers.org | A sua nova lista de servidores de Tibia [url=https://tibiaservers.org/server/evolution-ot][img]https://tibiaservers.org/dynamic_banners/76-ankrahmun.png[/img][/url]
Postado Julho 19, 2014 11 anos No meu server estou tendo um problema, quando um player faz trade com o NPC, o pagamento está bem implementado, que é feito em Gold nuggets, no entanto na shop window está isto: Onde está esse x gold eu queria que ficasse x Gold Nuggets. Aqui está a script do npc: 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 MoedaVip = 2157 -- Id da MoedaVip local shopWindow = {} local t = { [2457] = {price = 50}, -- [id do item] e em price qnto honor points vai custar [2422] = {price = 200} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and doPlayerRemoveItem(cid, MoedaVip, t[item].price) then doPlayerAddItem(cid, item, 1, false) selfSay("Aqui esta o Item", cid) else selfSay("Voce nao tem "..t[item].price.." Gold nugget suficientes / You do not have enough Gold Nuggets", 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()) Isso não da pra mudar somente pela source e olha la Esse script é um gambiara para fazer oq vc necessita mais apenas isso Skype : emersonaaron Se Te ajudei não me REP+ isso não muda nada! kkkkkkkkkkkk
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.