LU

[ Fechado ]

Por lukina, 11 de abr. de 2010 em Archived

5
807
lukinaL
11 de abril de 2010 às 18:20

PLEASE 2 NPC BOAT DESCRIÇOES

1 QUE LEVE PARA Vip City(280,86,4) Ice Island (561,53,7)

2° leve para jungle city(,132,175,7)ilha perdida(174,173,7)"/>

lucasatakL
11 de abril de 2010 às 18:54

Npc 1 : copie qualquer arquivo e renomeio para Rodolfo e cole isto:

 

vip city = {x=280, y=86, z=4}

ice island = {x=561, y=53, z=7}

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

 

function onThingMove(creature, thing, oldpos, oldstackpos, cid, item, frompos, item2, topos)

 

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('Hiho ' .. getCreatureName(cid) .. '! Eu posso te levar para Vip City,Ice Island. Lembrando que a viagem custa 50 gps.')

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, 'vip city') then

if(doPlayerRemoveMoney(cid, 50) == TRUE) then

doTeleportThing(cid,vip city)

doSendMagicEffect(vip city,10)

selfSay("Let's GO")

focus = 0

talk_start = 0

else

selfSay("Sorry, you don\'t have enough money.")

end

 

elseif msgcontains(msg, 'ice island') then

if(doPlayerRemoveMoney(cid, 50) == TRUE) then

doTeleportThing(cid,ice island)

doSendMagicEffect(ice island,10)

selfSay("Let's GO")

focus = 0

talk_start = 0

else

selfSay("Sorry, you don\'t have enough money.")

end

 

elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then

selfSay('Adeus ' .. creatureGetName(cid) .. ', Volte Sempre.')

focus = 0

talk_start = 0

 

elseif msg ~= "" then

selfSay('Como? Eu não entendi!')

talk_state = 0

end

end

end

 

function onCreatureChangeOutfit(creature)

end

 

function onThink()

doNpcSetCreatureFocus(focus)

if (os.clock() - talk_start) > 30 then

if focus > 0 then

selfSay('Proximo!!...')

end

focus = 0

talk_start = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good Bye')

focus = 0

talk_start = 0

end

end

end

 

em xml copie qualquer arquivo renomeio para Rodolfo e cole isto:

 

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

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

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

<look type="132" head="20" body="39" legs="45" feet="7" addons="0"/>

<parameters>

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

<parameter key="keywords" value="hi" />

<parameter key="keyword_reply1" value="Hello!." />

</parameters>

</npc>

 

NPC 2: copie qualquer arquivo e renomeio para Andre e cole isto:

 

jungle = {x=132, y=175, z=7}

ilha perdida = {x=174, y=173, z=7}

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

 

function onThingMove(creature, thing, oldpos, oldstackpos, cid, item, frompos, item2, topos)

 

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('Hiho ' .. getCreatureName(cid) .. '! Eu posso te levar para Jungle City e Ilha perdida. Lembrando que a viagem custa 50 gps.')

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, 'jungle') then

if(doPlayerRemoveMoney(cid, 50) == TRUE) then

doTeleportThing(cid,jungle)

doSendMagicEffect(jungle,10)

selfSay("Let's GO")

focus = 0

talk_start = 0

else

selfSay("Sorry, you don\'t have enough money.")

end

 

elseif msgcontains(msg, 'ilha perdida') then

if(doPlayerRemoveMoney(cid, 50) == TRUE) then

doTeleportThing(cid,ilha perdida)

doSendMagicEffect(ilha perdida,10)

selfSay("Let's GO")

focus = 0

talk_start = 0

else

selfSay("Sorry, you don\'t have enough money.")

end

 

elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then

selfSay('Adeus ' .. creatureGetName(cid) .. ', Volte Sempre.')

focus = 0

talk_start = 0

 

elseif msg ~= "" then

selfSay('Como? Eu não entendi!')

talk_state = 0

end

end

end

 

function onCreatureChangeOutfit(creature)

end

 

function onThink()

doNpcSetCreatureFocus(focus)

if (os.clock() - talk_start) > 30 then

if focus > 0 then

selfSay('Proximo!!...')

end

focus = 0

talk_start = 0

end

if focus ~= 0 then

if getDistanceToCreature(focus) > 5 then

selfSay('Good Bye')

focus = 0

talk_start = 0

end

end

end

 

em xml copie qualquer arquivo renomeio para Andre e cole isto:

 

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

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

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

<look type="132" head="20" body="39" legs="45" feet="7" addons="0"/>

<parameters>

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

<parameter key="keywords" value="hi" />

<parameter key="keyword_reply1" value="Hello!." />

</parameters>

</npc>

Editado Abril 11 por lucasatak

guedes100G
11 de abril de 2010 às 20:19

esse de cima nao funcinou aqui

 

teste esse:

 

Capitao Frius.xml

<npc name="Capitao Frius" script="data/npc/scripts/boatfree.lua" floorchange="0" access="5" level="1" maglevel="1">

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

<look type="151" head="114" body="15" legs="80" feet="115" addons="2" corpse="2212"/>

<parameters>

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

<parameter key="message_greet" value="Hello |PLAYERNAME|. Do you wanna meet my ship rotes? If you say {travel}, I'll can help you!" />

<parameter key="travel_destinations" value="jungle city,132,175,7,500;ilha perdida,174,173,7,500"/>

</parameters>

</npc>

 

npc\scrippts boatfree.lua

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

npcHandler:addModule(FocusModule:new())

 

Npc vip:

 

Capitao Vip.xml

<npc name="Capitao Vip" script="data/npc/scripts/slum.lua" floorchange="0" access="5" level="1" maglevel="1">

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

<look type="151" head="114" body="15" legs="80" feet="115" addons="2" corpse="2212"/>

<parameters>

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

<parameter key="message_greet" value="Hello |PLAYERNAME|. Do you wanna meet my ship rotes? If you say {travel}, I'll can help you!" />

<parameter key="travel_destinations" value="vip City,280,86,4,500;ice Island,561,53,7,500"/>

</parameters>

</npc>

 

npc\scripts slum.lua

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

npcHandler:addModule(FocusModule:new())

 

flw

Editado Abril 11 por Nicekid

lukinaL
12 de abril de 2010 às 08:57

VLW Nice Seu script pegou sertinho o do cara d cima não pegou os dois o.O bug ;/ nice me ajudando de novo Hehe

guedes100G
12 de abril de 2010 às 10:33

tudo bem ja sabe

qualquer duvida venha ao xtibia

 

quando sua duvida ou pedido for sanado por favor reporte o topico para que fechem!

obrigado

att,Nicekid