Points Lua:
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 file = "data/logs/Donater Shop.txt"
local text = io.open(file, "a+")
if msgcontains(msg, "items") or msgcontains(msg, "itens") then
npcHandler:say("Voce pode comprar os items:", cid)
npcHandler:say("Vocations VIPS:\n-{vocation minato} por 20 points.\n-{vocation itachi} por 15 points.\n-{vocation kisame} por 15 points.\n-{vocation raikage} por 25 points.\n-{vocation tsunade} por 10 points.\n-{vocation madara} por 20 points.", cid)
npcHandler:say("Itens VIPS:\n-{kurama helmet} por 10 points.\n-{kurama armor} por 20 points.\n-{kurama boots} por 10 points.\n-{kurama legs} por 10 points.\n-{obito ring} por 20 points.\n-{amaterasu element} por 15 points.\n-{gunbai} por 20 points.\n-{shuriken} por 15 nto points.", cid)
end
if msgcontains(msg, "como pagar") then
npcHandler:say("Acesse www.nto-server.weebly.com!}", cid)
end
--------------------------minato vocation--------------------------------
if msgcontains(msg, "vocation minato") or msgcontains(msg, "minato") then
npcHandler:say("Voce tem certeza que deseja trocar 20 nto points por vocation minato? {yes} or {no}.", cid)
talkState[talkUser] = 1
elseif msgcontains(msg, "no") and talkState[talkUser] == 1 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
if doPlayerRemoveItem(cid, 9970, 20) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 5957, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(5957).."\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
end
--------------------------itachi vocation--------------------------------
if msgcontains(msg, "vocation itachi") or msgcontains(msg, "itachi") then
npcHandler:say("Voce tem certeza que deseja trocar 15 nto points por vocation itachi? {yes} or {no}.", cid)
talkState[talkUser] = 2
elseif msgcontains(msg, "no") and talkState[talkUser] == 2 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 2 then
if doPlayerRemoveItem(cid, 9970, 15) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 5952, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(5952)..". -15 points.\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
end
--------------------------kisame vocation--------------------------------
if msgcontains(msg, "vocation kisame") or msgcontains(msg, "kisame") then
npcHandler:say("Voce tem certeza que deseja trocar 15 nto points por vocation kisame? {yes} or {no}.", cid)
talkState[talkUser] = 10
elseif msgcontains(msg, "no") and talkState[talkUser] == 10 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 10 then
if doPlayerRemoveItem(cid, 9970, 15) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 6119, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(6119)..". -15 points.\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
end
--------------------------raikage vocation-------------------------------
if msgcontains(msg, "vocation raikage") or msgcontains(msg, "raikage") then
npcHandler:say("Voce tem certeza que deseja trocar 25 nto points por vocation raikage? {yes} or {no}.", cid)
talkState[talkUser] = 11
elseif msgcontains(msg, "no") and talkState[talkUser] == 11 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 11 then
if doPlayerRemoveItem(cid, 9970, 25) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 8189, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(8189)..". -25 points.\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
end
-----------------------------tsunade vocation----------------------------
if msgcontains(msg, "vocation tsunade") or msgcontains(msg, "tsunade") then
npcHandler:say("Voce tem certeza que deseja trocar 10 nto points por vocation tsunade? {yes} or {no}.", cid)
talkState[talkUser] = 18
elseif msgcontains(msg, "no") and talkState[talkUser] == 18 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 18 then
if doPlayerRemoveItem(cid, 9970, 10) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 11407, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(11407)..". -10 points.\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
end
-----------------------------madara vocation-----------------------------
if msgcontains(msg, "vocation madara") then
npcHandler:say("Voce tem certeza que deseja trocar 20 nto points por vocation madara? {yes} or {no}.", cid)
talkState[talkUser] = 19
elseif msgcontains(msg, "no") and talkState[talkUser] == 19 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 19 then
if doPlayerRemoveItem(cid, 9970, 20) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 11408, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(11408)..". -20 points.\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
end
--------------------------------gunbai------------------------------------
if msgcontains(msg, "gunbai") then
npcHandler:say("Voce tem certeza que deseja trocar 20 nto points por uma gunbai? {yes} or {no}.", cid)
talkState[talkUser] = 17
elseif msgcontains(msg, "no") and talkState[talkUser] == 17 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 17 then
if doPlayerRemoveItem(cid, 9970, 20) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 11395, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(11395)..". -20 points.\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
end
---------------------------kurama helmet--------------------------------
if msgcontains(msg, "kurama helmet") then
npcHandler:say("Voce tem certeza que deseja trocar 10 nto points por uma kurama helmet? {yes} or {no}.", cid)
talkState[talkUser] = 3
elseif msgcontains(msg, "no") and talkState[talkUser] == 3 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 3 then
if doPlayerRemoveItem(cid, 9970, 10) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 11444, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(7380)..". -5 points.\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
return TRUE
end
---------------------------kurama armor--------------------------------
if msgcontains(msg, "kurama armor") then
npcHandler:say("Voce tem certeza que deseja trocar 20 nto points por uma kurama armor? {yes} or {no}.", cid)
talkState[talkUser] = 4
elseif msgcontains(msg, "no") and talkState[talkUser] == 4 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 4 then
if doPlayerRemoveItem(cid, 9970, 20) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 11436, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(2523)..". -5 points.\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
end
---------------------------kurama legs--------------------------------
if msgcontains(msg, "kurama") then
npcHandler:say("Voce tem certeza que deseja trocar 10 nto points por uma kurama legs? {yes} or {no}.", cid)
talkState[talkUser] = 6
elseif msgcontains(msg, "no") and talkState[talkUser] == 6 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 6 then
if doPlayerRemoveItem(cid, 9970, 10) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 11445, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(2432)..". -5 points.\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
end
---------------------------kurama boots--------------------------------
if msgcontains(msg, "kurama boots") then
npcHandler:say("Voce tem certeza que deseja trocar 10 nto points por uma kurama boots? {yes} or {no}.", cid)
talkState[talkUser] = 5
elseif msgcontains(msg, "no") and talkState[talkUser] == 5 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 5 then
if doPlayerRemoveItem(cid, 9970, 10) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 11446, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(11446)..". -10 points.\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
end
---------------------------obito ring-------------------------------
if msgcontains(msg, "obito ring") then
npcHandler:say("Voce tem certeza que deseja trocar 20 nto points por um obito ring? {yes} or {no}.", cid)
talkState[talkUser] = 7
elseif msgcontains(msg, "no") and talkState[talkUser] == 7 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 7 then
if doPlayerRemoveItem(cid, 9970, 20) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 11437, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(7408)..". -10 points.\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
end
---------------------------amaterasu element-------------------------------
if msgcontains(msg, "amaterasu element") then
npcHandler:say("Voce tem certeza que deseja trocar 15 nto points por um amaterasu element? {yes} or {no}.", cid)
talkState[talkUser] = 8
elseif msgcontains(msg, "no") and talkState[talkUser] == 8 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 8 then
if doPlayerRemoveItem(cid, 9970, 15) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 11435, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(2474)..". -10 points.\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
end
----------------------------shuriken--------------------------------
if msgcontains(msg, "shuriken") then
npcHandler:say("Voce tem certeza que deseja trocar 15 nto points por uma shuriken vip {yes} or {no}.", cid)
talkState[talkUser] = 9
elseif msgcontains(msg, "no") and talkState[talkUser] == 9 then
npcHandler:say("Esta bem, quando decidir fale comigo novamente.", cid)
talkState[talkUser] = 0
elseif msgcontains(msg, "yes") and talkState[talkUser] == 9 then
if doPlayerRemoveItem(cid, 9970, 15) == TRUE then
npcHandler:say("Obrigado! Aqui esta o item comprado.", cid)
doPlayerAddItem(cid, 11443, 1)
text:write("["..os.date("%d/%m/%Y %X", os.time()).."] "..getPlayerName(cid).." ["..getPlayerLevel(cid).."]: Comprou 1 "..getItemNameById(7859)..". -15 points.\n")
text:close()
else
npcHandler:say("Voce nao tem points suficientes! para adquirir points entre no blog de nosso server para saber como pagar: {http://nto-server.weebly.com/}", cid)
end
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Xml
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Donater Shop" script="data/npc/scripts/points.lua" walkinterval="0" speed="0" floorchange="0">
<health now="100" max="100"/>
<look type="495"/>
<parameters>
<parameter key="message_greet" value="Ola |PLAYERNAME|, voce pode comprar items Vips com Nto Points para saber os items que voce pode comprar diga {items}, caso queira saber como adquirir nto points diga {como pagar}." />
</parameters>
</npc>