Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local citys = {
- town1 = {x=1555, y=2576, z=6}, -- yalahar
- town2 = {x=487, y=261, z=6}, -- anknor
- town3 = {x=1367, y=195, z=6}, -- goroma
- town4 = {x=1995, y=2394, z=6}, -- smallville
- town5 = {x=238, y=370, z=6}, -- venonh
- town6= {x=114, y=282, z=6}, -- alfon
- town7 = {x=31, y=79, z=6}, -- dorion
- town8 = {x=10386, y=10311, z=6}, -- everwood
- town9 = {x=1348, y=1155, z=6}, -- falelfia
- town10 = {x=114 ,y=282 ,z=6} -- nunca
- }
- local cost = 100
- 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
- if msgcontains(msg, 'travel') then
- selfSay('Eu posso te levar para, {yalahar}, {anknor}, {goroma}, {smallville}, {venonh}, {alfon}, {dorion}, {everwood}, {falelfia}, {nunca}, por um pequeno custo.', cid)
- talkState[talkUser] = 0
- end
- if msgcontains(msg, 'yalahar') then
- selfSay('você tem certeza que quer viajar por 100 gold coin ?', cid)
- talkState[talkUser] = 1
- end
- if msgcontains(msg, 'anknor') then
- selfSay('você tem certeza que quer viajar por 100 gold coin ?', cid)
- talkState[talkUser] = 2
- end
- if msgcontains(msg, 'goroma') then
- selfSay('você tem certeza que quer viajar por 100 gold coin ?', cid)
- talkState[talkUser] = 3
- end
- if msgcontains(msg, 'smallville') then
- selfSay('você tem certeza que quer viajar por 100 gold coin ?', cid)
- talkState[talkUser] = 4
- end
- if msgcontains(msg, 'venonh') then
- selfSay('você tem certeza que quer viajar por 100 gold coin ?', cid)
- talkState[talkUser] = 5
- end
- if msgcontains(msg, 'alfon') then
- selfSay('você tem certeza que quer viajar por 100 gold coin ?', cid)
- talkState[talkUser] = 6
- end
- if msgcontains(msg, 'dorion') then
- selfSay('você tem certeza que quer viajar por 100 gold coin ?', cid)
- talkState[talkUser] = 7
- end
- if msgcontains(msg, 'everwood') then
- selfSay('você tem certeza que quer viajar por 100 gold coin ?', cid)
- talkState[talkUser] = 8
- end
- if msgcontains(msg, 'falelfia') then
- selfSay('você tem certeza que quer viajar por 100 gold coin ?', cid)
- talkState[talkUser] = 9
- end
- if msgcontains(msg, 'nunca') then
- selfSay('você tem certeza que quer viajar por 100 gold coin ?', cid)
- talkState[talkUser] = 10
- end
- if msgcontains(msg, 'yes') then
- if talkState[talkUser] == 1 then
- if doPlayerRemoveMoney(cid, cost) then
- doTeleportThing(cid, {x=citys.town1.x, y=citys.town1.y, z=citys.town1.z})
- selfSay('Let\'s GO', cid)
- talkState[talkUser] = 0
- else
- selfSay('Desculpe, você não tem dinheiro suficiente', cid)
- talkState[talkUser] = 0
- end
- elseif talkState[talkUser] == 2 then
- if doPlayerRemoveMoney(cid, cost) then
- doTeleportThing(cid, {x=citys.town2.x, y=citys.town2.y, z=citys.town2.z})
- selfSay('Let\'s GO', cid)
- talkState[talkUser] = 0
- else
- selfSay('Desculpe, você não tem dinheiro suficiente', cid)
- talkState[talkUser] = 0
- end
- elseif talkState[talkUser] == 3 then
- if doPlayerRemoveMoney(cid, cost) then
- doTeleportThing(cid, {x=citys.town3.x, y=citys.town3.y, z=citys.town3.z})
- selfSay('Let\'s GO', cid)
- talkState[talkUser] = 0
- else
- selfSay('Desculpe, você não tem dinheiro suficiente', cid)
- talkState[talkUser] = 0
- end
- elseif talkState[talkUser] == 4 then
- if doPlayerRemoveMoney(cid, cost) then
- doTeleportThing(cid, {x=citys.town4.x, y=citys.town4.y, z=citys.town4.z})
- selfSay('Let\'s GO', cid)
- talkState[talkUser] = 0
- else
- selfSay('Desculpe, você não tem dinheiro suficiente', cid)
- talkState[talkUser] = 0
- end
- elseif talkState[talkUser] == 5 then
- if doPlayerRemoveMoney(cid, cost) then
- doTeleportThing(cid, {x=citys.town5.x, y=citys.town5.y, z=citys.town5.z})
- selfSay('Let\'s GO', cid)
- talkState[talkUser] = 0
- else
- selfSay('Desculpe, você não tem dinheiro suficiente', cid)
- talkState[talkUser] = 0
- end
- elseif talkState[talkUser] == 6 then
- if doPlayerRemoveMoney(cid, cost) then
- doTeleportThing(cid, {x=citys.town6.x, y=citys.town6.y, z=citys.town6.z})
- selfSay('Let\'s GO', cid)
- talkState[talkUser] = 0
- else
- selfSay('Desculpe, você não tem dinheiro suficiente', cid)
- talkState[talkUser] = 0
- end
- elseif talkState[talkUser] == 7 then
- if doPlayerRemoveMoney(cid, cost) then
- doTeleportThing(cid, {x=citys.town7.x, y=citys.town7.y, z=citys.town7.z})
- selfSay('Let\'s GO', cid)
- talkState[talkUser] = 0
- else
- selfSay('Desculpe, você não tem dinheiro suficiente', cid)
- talkState[talkUser] = 0
- end
- elseif talkState[talkUser] == 8 then
- if getPlayerVipDays(cid) > 0 then
- if doPlayerRemoveMoney(cid, cost) then
- doTeleportThing(cid, {x=citys.town8.x, y=citys.town8.y, z=citys.town8.z})
- selfSay('Let\'s GO', cid)
- talkState[talkUser] = 0
- else
- selfSay('Desculpe, você não tem dinheiro suficiente', cid)
- talkState[talkUser] = 0
- end
- else
- selfSay('Você não tem VIP!', cid)
- talkState[talkUser] = 0
- end
- elseif talkState[talkUser] == 9 then
- if getPlayerVipDays(cid) > 0 then
- if doPlayerRemoveMoney(cid, cost) then
- doTeleportThing(cid, {x=citys.town9.x, y=citys.town9.y, z=citys.town9.z})
- selfSay('Let\'s GO', cid)
- talkState[talkUser] = 0
- else
- selfSay('Desculpe, você não tem dinheiro suficiente', cid)
- talkState[talkUser] = 0
- end
- else
- selfSay('Você não tem VIP!', cid)
- talkState[talkUser] = 0
- end
- elseif talkState[talkUser] == 10 then
- if getPlayerVipDays(cid) > 0 then
- if doPlayerRemoveMoney(cid, cost) then
- doTeleportThing(cid, {x=citys.town10.x, y=citys.town10.y, z=citys.town10.z})
- selfSay('Let\'s GO', cid)
- talkState[talkUser] = 0
- else
- selfSay('Desculpe, você não tem dinheiro suficiente', cid)
- talkState[talkUser] = 0
- end
- else
- selfSay('Você não tem VIP!', cid)
- talkState[talkUser] = 0
- end
- elseif msgcontains(msg, 'no') and talkState[talkUser] >= 1 then
- selfSay('Tchau! Volte Logo', cid)
- talkState[talkUser] = 0
- end
- end
- return true
- end
- npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
- npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment