local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local position = {x=936, y=1093, z=10} -- Posição que o jogador será teleportado.
local itemId = 11328 -- ID do item que será removido do jogador.
local chance = 75 -- Porcentagem de sucesso
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 onCreatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, "Marte") then
selfSay("Basta agora você me dar uma {"..getItemNameById(itemId).."} e mais 1000 gps que eu te levarei.", cid)
talkState[cid] = 0
elseif msgcontains(msg, 'mandibulas') then
chance = (tonumber(chance) and tonumber(chance) * 100 or 100000)
if doPlayerRemoveItem(cid, itemId, 1) then
if chance > math.random(1, 100000) then
doTeleportThing(cid, position)
else
selfSay("Desculpe, mas {".. getItemNameById(itemId) .."} quebrou no processo.", cid)
end
else
selfSay("É necessário uma {"..getItemNameById(itemId).."} pra que eu possa abrir o teleporte.", cid)
end
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, onCreatureSayCallback)
npcHandler:addModule(FocusModule:new())
3
704
22 de agosto de 2012 às 15:00
info
Grupo: Visconde
Registrado: 21/08/11
Posts: 470
Reputação: +5
Char no Tibia: ...

22 de agosto de 2012 às 15:17
oneshot vlw cara REP + funciono perfeitamente.
duvida sanada reportado para moverem



info
Grupo: Visconde
Registrado: 21/08/11
Posts: 470
Reputação: +5
Char no Tibia: ...
Galera Teria Como Colocar No Meu Script Chances De Quebrar O Item Que O Npc Pede Para Levar O Player Para Tal Lugar ?
Exemplo Quando Quebra-se O Npc Fala-se Desculpe A Mandibula Quebrou.
Ajuda ae Valendo REP +