Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[----- Inicio de Configurações -------
- Obs: Está tudo em ordem! Ex
- Nome da Pos {x = 1869, y = 655, z = 7} é Mystic e o valor do item gastado é 1
- Caso for Editar, Peça ajuda a alguem, caso você não saiba oque mecher! uma virgula errada pode bugar o script todo!
- -]]
- local item = 10523 -- ItemID
- local pos = { -- Pos dos locais em name
- {x = 1869, y = 655, z = 7},
- {x = 1333, y = 1150, z = 7},
- {x = 143, y = 828, z = 7},
- {x = 384, y = 240, z = 7},
- {x = 1162, y = 940, z = 7},
- {x = 1420, y = 711, z = 7},
- {x = 1432, y = 615, z = 7},
- {x = 711, y = 133, z = 7},
- {x = 432, y = 97, z = 7},
- {x = 363, y = 379, z = 7}
- }
- local namepos = { -- Nome das Pos
- "Mystic",
- "King",
- "Mantasin",
- "Little",
- "Pincher",
- "Master I",
- "Master II",
- "Crystal",
- "Ice",
- "Boss"
- }
- local valor = { -- Quantidade dos Items Gastados
- Mystic = 1,
- King = 2,
- mantasin = 3,
- Little = 4,
- Pincher = 5,
- Master I = 6,
- Master II = 7,
- Crystal = 8,
- Ice = 9,
- Boss = 10
- }
- --- Fim de Configurações -----
- 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
- if msgcontains(msg, 'yes') or msgcontains(msg, 'sim') then
- selfSay('Você gostaria de viajar para '..namepos[1]..', '..namepos[2]..', '..namepos[3]..', '..namepos[4]..', '..namepos[5]..', '..namepos[6]..', '..namepos[7]..', '..namepos[8]..', '..namepos[9]..' ou '..namepos[10]..' por 1x '..getItemNameById(item)..'???', cid)
- if (getPlayerItemCount(cid, item) == valor[1] or getPlayerItemCount(cid, item) == valor[2] or getPlayerItemCount(cid, item) == valor[3] or getPlayerItemCount(cid, item) == valor[4] or getPlayerItemCount(cid, item) == valor[5] or getPlayerItemCount(cid, item) == valor[6] or getPlayerItemCount(cid, item) == valor[7] or getPlayerItemCount(cid, item) == valor[8] or getPlayerItemCount(cid, item) == valor[9] or getPlayerItemCount(cid, item) == valor[10]) then
- if msgcontains(msg, 'Mystic') or msgcontains(msg, 'mystic') then
- doPlayerRemoveItem(cid, item, valor[1])
- doTeleportThing(cid, pos[1])
- selfSay('Você acaba de ser levado(a) para '..namepos[1]..'', cid)
- elseif msgcontais(msg, 'King') or msgcontais(msg, 'king') then
- doTeleportThing(cid, pos[2])
- doPlayerRemoveItem(cid, item, valor[2])
- selfSay('Você acaba de ser levado(a) para '..namepos[2]..'', cid)
- elseif msgcontais(msg, 'Mantasin') or msgcontais(msg, 'mantasin') then
- doTeleportThing(cid, pos[3])
- doPlayerRemoveItem(cid, item, valor[3])
- selfSay('Você acaba de ser levado(a) para '..namepos[3]..'', cid)
- elseif msgcontais(msg, 'Little') or msgcontais(msg, 'little') then
- doTeleportThing(cid, pos[4])
- doPlayerRemoveItem(cid, item, valor[4])
- selfSay('Você acaba de ser levado(a) para '..namepos[4]..'', cid)
- elseif msgcontais(msg, 'Pincher') or msgcontais(msg, 'pincher') then
- doTeleportThing(cid, pos[5])
- doPlayerRemoveItem(cid, item, valor[5])
- selfSay('Você acaba de ser levado(a) para '..namepos[5]..'', cid)
- elseif msgcontais(msg, 'Master I') or msgcontais(msg, 'master i') or msgcontais(msg, 'Master 1') or msgcontais(msg, 'master 1') then
- doTeleportThing(cid, pos[6])
- doPlayerRemoveItem(cid, item, valor[6])
- selfSay('Você acaba de ser levado(a) para '..namepos[6]..'', cid)
- elseif msgcontais(msg, 'Master II') or msgcontais(msg, 'Master ii') or msgcontais(msg, 'Master 2') or msgcontais(msg, 'master 2') then ----------------------- ///// -------------------
- doTeleportThing(cid, pos[7])
- doPlayerRemoveItem(cid, item, valor[7])
- selfSay('Você acaba de ser levado(a) para '..namepos[7]..'', cid)
- elseif msgcontais(msg, 'Crystal') or msgcontais(msg, 'crystal') then
- doTeleportThing(cid, pos[8])
- doPlayerRemoveItem(cid, item, valor[8])
- selfSay('Você acaba de ser levado(a) para '..namepos[8]..'', cid)
- elseif msgcontais(msg, 'Ice') or msgcontais(msg, 'ice') then
- doTeleportThing(cid, pos[9])
- doPlayerRemoveItem(cid, item, valor[9])
- selfSay('Você acaba de ser levado(a) para '..namepos[9]..'', cid)
- elseif msgcontais(msg, 'Boss') or msgcontais(msg, 'boss') then
- doTeleportThing(cid, pos[10])
- doPlayerRemoveItem(cid, item, valor[10])
- selfSay('Você acaba de ser levado(a) para '..namepos[10]..'', cid)
- end
- end
- elseif msgcontains(msg, 'no') or msgcontains(msg, 'nao') or msgcontains(msg, 'não') then
- selfSay('Caso você queira viajar fale comigo novamente!', cid)
- else
- selfSay('Você não tem dinheiro suficiente!', cid)
- end
- return 0
- end
- npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
- npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement