cara,não entendi direito você quer um npc que teleporte para a area vip?
se for você pode fazer assim:
vá em data/npc crie um arquivo xml da copy e paste e renomeie para barco vip,abra e ponha isso dentro:
<npc name="Capitain Johnson" script="data/npc/scripts/boatvip.lua" floorchange="0" access="5" level="1" maglevel="1">
<health now="150" max="150"/>
<look type="134" head="78" body="88" legs="0" feet="88" addons="3"/>
<parameters>
<parameter key="message_greet" value="Ola |PLAYERNAME|. ! Eu levo você para {Vip City}. Where do you want to go?" />
<parameter key="message_decline" value="Is |TOTALCOST| gold coins too much for you? Get out of here!"/>
<parameter key="travel_destinations" value="Vip City,1052,35,6,7"/>
</parameters>
</npc>
agora vá em data/npc/script e crie um arquivo.lua lá e renomeie para boatvip e ponha isso dentro:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
local travelNode = keywordHandler:addKeyword({'training room'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you wish to travel to Vip City for 100 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination =
{x=368, y=455, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too expensive, eh?'})
keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to \Vip City\', for just a small fee.'})
-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())
em azul também você deve editar os dois
em vermelho é a pos da vip city
desculpe pela forma de resposta,sou iniciante no xtibia começei hoje :X




info
Grupo: Visconde
Registrado: 15/02/11
Posts: 259
Reputação: +25
Char no Tibia: Aias Laf Du
bom eu to com meu ot, wodbo, nao sei pq, se eu colocar vip no xamp localhost, ela nao funciona, o player tem a vip mas nao pode viajar, diz olny premyum can travel bla bla bla. dai queria que o NPC trocasse um item pela vip.
Segui abaixo o script do meu NPC
local focus = 0 local talk_start = 0 local target = 0 local days = 0 function onThingMove(creature, thing, oldpos, oldstackpos) end function onCreatureAppear(creature) end function onCreatureDisappear(cid, pos) if focus == cid then selfSay('Good bye then.') focus = 0 talk_start = 0 end end function onCreatureTurn(creature) end function msgcontains(txt, str) return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)')) end function onCreatureSay(cid, type, msg) msg = string.lower(msg) if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then selfSay('Hello ' .. getCreatureName(cid) .. '! I sell premiums and promotions.') focus = cid talk_start = os.clock() elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.') elseif focus == cid then talk_start = os.clock() if msgcontains(msg, 'promotion') or msgcontains(msg, 'promote') then if getPlayerVocation(cid) > 4 then selfSay('Sorry, you are already promoted.') talk_state = 0 elseif not isPremium(cid) then selfSay('Sorry, you must be premium to buy promotion.') talk_state = 0 else selfSay('Do you want to buy promotion for 20k?') talk_state = 1 end elseif msgcontains(msg, 'premium') or msgcontains(msg, 'premmy') then selfSay('Do you want 20 days of premium ?') talk_state = 2 elseif talk_state == 1 then if msgcontains(msg, 'yes') then if pay(cid,10) then doPlayerSetVocation(cid, getPlayerVocation(cid)+4) selfSay('You are now promoted!') else selfSay('Sorry, you do not have enough money.') end end talk_state = 0 elseif talk_state == 2 then if msgcontains(msg, 'yes') then if pay(cid,1) then buyPrem(cid, 20) selfSay('You have 20 days of premium more!') else selfSay('Sorry, you do not have enough money.') end end talk_state = 0 elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then selfSay('Good bye, ' .. getCreatureName(cid) .. '!') focus = 0 talk_start = 0 end end end function onThink() doNpcSetCreatureFocus(focus) if (os.clock() - talk_start) > 45 then if focus > 0 then selfSay('Next Please...') end focus = 0 end if focus ~= 0 then if getDistanceToCreature(focus) > 5 then selfSay('Good bye then.') focus = 0 end end endEditado Abril 10 por CoyoteStark