Ir para conteúdo

Npc Que Teletransporta Apenas Premium Account


Ponintatu

Posts Recomendados

Aew Pessoal, Preciso Muito De Um Npc Que Teletransporte Apenas Premium Account.

 

Se alguem Puder Me ajudar Ficarei Grato ! :happy:

 

 

Obs: é Um Npc Bem SImples.

 

Exemplo:

 

Player: HI.

NPC: Ola <PLAYERNAME>, PAra Onde Deseja Ir ?

PLAYER: Vip City

NPC: Tem Certeza Disso ?

PLAYER: Yes

 

 

Não Precisa Estar Escrito COmo Esta No Exemplo. Basta Teletransportar Apenas Premium Account !

 

[ Espero Que também possam Me AJudar No MEu Outro Tópico ]

Editado por Noreply
Link para o comentário
Compartilhar em outros sites

Toma aqui

 

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({'NOME DA CITY'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to NOME DA CITY for 95 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 95, destination = {x=109, y=28, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

local travelNode = keywordHandler:addKeyword({'NOME DA CITY2'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to NOME DA CITY2 for 60 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 30, cost = 60, destination = {x=761, y=732, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

local travelNode = keywordHandler:addKeyword({'NOME DA CITY3'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to NOME DA CITY3 for 95 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 95, destination = {x=431, y=420, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

local travelNode = keywordHandler:addKeyword({'NOME DA CITY4'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to NOME DA CITY4 for 40 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 40, destination = {x=103, y=411, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

local travelNode = keywordHandler:addKeyword({'NOME DA CITY5'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to NOME DA CITY5 for 80 gold coins?'})
travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 80, destination = {x=883, y=584, z=6} })
travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})


keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can only take you to NOME DA CITY, NOME DA CITY5, NOME DA CITY2, NOME DA CITY3, NOME DA CITY4, Talas and Mandrin.'})
keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})
keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can only take you to NOME DA CITY, NOME DA CITY5, NOME DA CITY2, NOME DA CITY3, NOME DA CITY4, Talas and Mandrin.'})

-- Makes sure the npc reacts when you say hi, bye etc.
npcHandler:addModule(FocusModule:new())

 

Sabe editar né?

Link para o comentário
Compartilhar em outros sites

em data/npc crie um arquivo chamado Captain Bluebear.xml

 

 

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Captain Bluebear" script="data/npc/scripts/Captain Bluebear.lua" walkinterval="2000" floorchange="0">

<health now="100" max="100"/>

<look type="129" head="19" body="69" legs="107" feet="50" addons="0"/>

<voices>

<voice text="Passages to VIP City." interval2="100" margin="1" yell="no"/>

</voices>

<parameters>

<parameter key="message_farewell" value="Good bye. Recommend us if you were satisfied with our service." />

<parameter key="message_walkaway" value="Good bye. Recommend us if you were satisfied with our service." />

<parameter key="module_keywords" value="1" />

<parameter key="keywords" value="name;free city;" />

<parameter key="keyword_reply1" value="My name is Captain Bluebear from the Royal Tibia Line." />

<parameter key="keyword_reply2" value="This is Thais. Where do you want to go?" />

<parameter key="keyword_reply3" value="I'm not sailing there. This route is afflicted by a ghost ship! However, I heard that Captain Fearless sails there from Venore." />

<parameter key="message_greet" value="Welcome on board, |PLAYERNAME|. Where may I sail you today?"/>

</parameters>

</npc>

 

 

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

 

 

 

 

 

 

 

em data/npc/script crie um arquivo chamado Captain Bluebear.lua

 

 

-- 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({'vip city'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to vip city for free?'})

travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 0, destination = {x=32387, y=31820, z=6} })

travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})

 

keywordHandler:addKeyword({'sail'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Where do you want to go? To vip city.'})

keywordHandler:addKeyword({'job'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})

keywordHandler:addKeyword({'captain'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I am the captain of this ship.'})

 

 

npcHandler:addModule(FocusModule:new())

 

Editado por DoohRush
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...