Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''vip bank''.



Mais opções de pesquisa

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • A Cidade OTBR
    • OTServ Brasil
    • Atendimento
    • Taverna
  • Projetos Open Source
    • Canary
    • OTServBR-Global
    • Mehah OTClient
    • MyAAC
  • OpenTibia
    • Notícias e Discussões
    • Suporte - Dúvidas, Bugs, Erros
    • Downloads
    • Tutoriais
    • Show-Off
  • Outros
    • Design

Encontrado 1 registro

  1. Sacar e depositar "vip coins" ingame.

    Olá caro úsuario, se você usa gesior, e armaneza "vip coins" na database, aonde o player pode comprar itens no shop do site, tenho uma novidade para você! Que tal liberar as coins ingame, para o players negociarem, e até mesmo quem não tem condições de "depositar", possa comprar essas tais cois de outros players, para comprar sua premmy e etc, isso estimularia o mercado ingame, aonde os principais itens e coisas poderiam ser vendidos pelas "vip coins" entre os players... [spoiler=Padrão] Autor: Mirto, MiltonHit Nome: Bank Vip Versão: 1.0 Créditos: TFS e GESIOR Vamos ao trabalho, primeiro duas funções super simples, para o sistema todo funcionar....em lib/050-function.lua adicione isto na ultima linha: function addVipAccount(cid, count) --function by Mirto, MiltonHit - otserv.com.br db.executeQuery("UPDATE `accounts` SET `premium_points` = premium_points + '"..count.."' WHERE `name` ='"..getPlayerAccount(cid).."'") end function getVipBalance(cid) --function by Mirto, MiltonHit - otserv.com.br local skpo = db.getResult("SELECT * FROM `accounts` where `name`='"..getPlayerAccount(cid).."'") return skpo:getDataInt("premium_points") end function getNumber(txt) --return number if its number and is > 0, else return 0 (function maded by Gesior) x = string.gsub(txt,"%a","") x = tonumber(x) if x ~= nill and x > 0 then return x else return 0 end end Feito isso as funções já vão estar instaladas, agora vá até a pasta npcs/scripts crie um arquivo bank_vip.lua e adicione isto: ------SCRIPT ORIGINALMENTE CRIADO PELO TFS, E ADPTADO POR Mirto, MiltonHit ------------- 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 --------------------MESSAGES------------------------------------------------------------------------------ local id_moeda = 6527 ---MUITO IMPORTANTE, id da coin vip.. if msgcontains(msg, 'deposit') then selfSay('Please tell me how much vip coins it is you would like to deposit.', cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'withdraw') then selfSay('Please tell me how much vip coins you would like to withdraw.', cid) talkState[talkUser] = 3 elseif msgcontains(msg, 'balance') then n = getVipBalance(cid) if n > 1 then selfSay('Your balance are '..n..' vip coins.', cid) else selfSay('Your balance are '..n..' vip coin.', cid) end talkState[talkUser] = 0 ----------------------DEPOSIT------------------------------------------------------- elseif talkState[talkUser] == 1 then if msgcontains(msg, 'all') then n = getPlayerItemCount(cid, id_moeda) if n < 1 then selfSay('You dont have vip coins to deposit.', cid) talkState[talkUser] = 0 return true elseif n == 1 then selfSay('Do you want deposit '..n..' vip coin?', cid) elseif n > 1 then selfSay('Do you want deposit '..n..' vip coins?', cid) end talkState[talkUser] = 2 else n = getNumber(msg) if n < 1 then selfSay('You cant deposit values less than zero.', cid) talkState[talkUser] = 1 return true elseif n > 9999 then selfSay('This value is too hight for deposit.', cid) talkState[talkUser] = 1 return true elseif n == 1 then selfSay('Do you want deposit '..n..' vip coin?', cid) elseif n > 1 then selfSay('Do you want deposit '..n..' vip coins?', cid) end talkState[talkUser] = 2 end elseif talkState[talkUser] == 2 then if msgcontains(msg, 'yes') then if getPlayerItemCount(cid, id_moeda) >= n then addVipAccount(cid, n) doPlayerRemoveItem(cid, id_moeda, n) selfSay('Thanks. Now your balance account is ' ..getVipBalance(cid)..' vip coins.', cid) talkState[talkUser] = 0 else selfSay('You dont have this value for deposit.', cid) talkState[talkUser] = 0 end else selfSay('Thats ok.', cid) talkState[talkUser] = 0 end ----------------------WITHDRAW------------------------------------------------------------------------------------------------------------------------------------ elseif talkState[talkUser] == 3 then if msgcontains(msg, 'all') then n = getVipBalance(cid) if n < 1 then selfSay('Sorry, your balance is zero.', cid) talkState[talkUser] = 0 return true elseif n == 1 then selfSay('Do you want withdraw '..n..' vip coin?', cid) elseif n > 1 then selfSay('Do you want withdraw '..n..' vip coins?', cid) end talkState[talkUser] = 4 else n = getNumber(msg) if n < 1 then selfSay('You cant withdraw values less than zero.', cid) talkState[talkUser] = 3 return true elseif n > 99999 then selfSay('This value is too hight for withdraw.', cid) talkState[talkUser] = 3 return true elseif n == 1 then selfSay('Do you want withdraw '..n..' vip coin?', cid) elseif n > 1 then selfSay('Do you want withdraw '..n..' vip coins?', cid) end talkState[talkUser] = 4 end elseif talkState[talkUser] == 4 then if msgcontains(msg, 'yes') then if getVipBalance(cid) >= n then addVipAccount(cid, -n) doPlayerGiveItem(cid, id_moeda, n) if n == 1 then selfSay('Here you are, '..n..' vip coin. Now your balance account is ' ..getVipBalance(cid)..' vip coins.', cid) elseif n > 1 then selfSay('Here you are, '..n..' vip coins. Now your balance account is ' ..getVipBalance(cid)..' vip coins.', cid) end talkState[talkUser] = 0 else selfSay('Your account dont have that value for withdraw.', cid) talkState[talkUser] = 0 end else selfSay('Ok then', cid) talkState[talkUser] = 0 end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Prontinho! Agora é só você criar um NPC xml ao seu gosto e usufluir do novo Vip Bank, esse script é totalmente exclusivo do otserv.com.br, eu não autorizo a postagem do mesmo em outro forúm. Não se preoucupem com o code, ele já foi testado muitas vezes, é impossível bugar o sistema.... Ele tem todas as travas necessárias para o player não "enganar" o npc, não se esqueça de mudar o id da moeda vip no começo do script do npc, aceito criticas construtivas para diminuir o code. Abraços galera!
×