[8.1][Stigma] Teleporter

Status
Zamknięty.

Gohans

Advanced User
Zarejestrowany
Dołączył
Maj 16, 2008
Posty
198
Liczba reakcji
15
Witam!
Je?li macie do?? kapitan?w na statkach, lub tych go?ci co teleportuj? i wolicie do ka?dego miasta wstawi? chocia? po JEDEN NPC kt?ry teleportuje do ka?dego miasta (Opr?cz tego kt?ry si? znajduje obok miasta na PACC i Rooka)
Zaczynajmy!!

W data\npc tworzymy Bananek.xml a w nim:

<?xml version="1.0"?>

<npc name="Bananek" script="data/npc/scripts/teleport.lua" autowalk="25">
<health now="40" max="40"/>
<look type="134" head="95" body="57" legs="113" feet="115"/>
</npc>

Potem w data\npc\scripts tworzymy teleport.lua a w nim:

local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

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
if isPremium(cid) then
selfSay('Elo ' .. getCreatureName(cid) .. '! Mog? ci? przenie?? do:, Anshara, Inferna, Venore, pacc or Folda.(70gp everywhere)')
focus = cid
talk_start = os.clock()
else
selfSay('Sorry, only premium players can travel by boat.')
focus = 0
talk_start = 0
end

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, 'anshara') then
if pay(cid,50) then
travel(cid, 400, 481, 6)
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('jestes splukany ziomus.')
end

elseif msgcontains(msg, 'karmia') then
if pay(cid,50) then
travel(cid, 453, 480, 6)
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('jestes splukany ziomus.')
end

elseif msgcontains(msg, 'inferna') then
if pay(cid,50) then
travel(cid, 517, 439, 6)
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('jestes splukany ziomus.')
end

elseif msgcontains(msg, 'venore') then
if pay(cid,50) then
travel(cid, 431, 421, 6)
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('jestes splukany ziomus.')
end

elseif msgcontains(msg, 'folda') then
if pay(cid,50) then
travel(cid, 267, 317, 6)
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('jestes splukany ziomus.')
end
elseif msgcontains(msg, 'pacc') then
if pay(cid,50) then
travel(cid, 430, 624, 7)
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('jestes splukany ziomus.')
end


elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('NO to pa, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
if focus > 0 then
x, y, z = creatureGetPosition(focus)
myx, myy, myz = selfGetPosition()

if ((myy-y==0) and (myx-x<=0 and myx-x>=-4)) then
selfTurn(1)
end
if ((myy-y==0) and (myx-x>=0 and myx-x<=4)) then
selfTurn(3)
end
if ((myx-x==0) and (myy-y<=0 and myy-y>=-4)) then
selfTurn(2)
end
if ((myx-x==0) and (myy-y>=0 and myy-y<=4)) then
selfTurn(0)
end
if ((myy-y==-2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(2)
end
if ((myy-y==2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(0)
end
if ((myx-x==2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(3)
end
if ((myx-x==-2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(1)
end
if ((myy-y==-3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(2)
end
if ((myy-y==3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(0)
end
if ((myx-x==3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(3)
end
if ((myx-x==-3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(1)
end
if ((myy-y==-4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(2)
end
if ((myy-y==4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(0)
end
if ((myx-x==4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(3)
end
if ((myx-x==-4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(1)
end
end

if (os.clock() - talk_start) > 30 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
end

Skrypt sprawdzony dzia?a mam nadzieje ?e si? przyda ;]
 
Odp: [8.1][Stigma] Teleporter

M?g?by? pokolorowa? miejsca, gdzie mo?na by by?o zmieni? przeznaczenie podr??y i teksty.
 
Odp: [8.1][Stigma] Teleporter

bardzo fajny !!! wszystko dzia?a bardzo przydatne dzi?kuje ;)
 
Odp: [8.1][Stigma] Teleporter

a na evo bd dzia?a? ??
 
Odp: [8.1][Stigma] Teleporter

@up
tak na evo zadzia?a .

a mo?e napisa? by? dok?adnie jak tego u?ywa? itp..
 
Odp: [8.1][Stigma] Teleporter

jak ktos moze mi dac mep editor do stigma ots 8.1 to prosze o kontakt gg 13059700
;)
 
Odp: [8.1][Stigma] Teleporter

Ej, mapeditor do stigmy trzeba samemu zrobi? doda? tam npc i monsters jak chcesz wiedzie? to jest ?atwe serio.
Kiedy? mia??m mapeditor do stigmy ale go skasowa?em bo przesta?em gra? w tibi? ale zn?w wczoraj zaczo??m xD
 
Odp: [8.1][Stigma] Teleporter

Ej kolo a czy by? m?g? napisa? na kolorowo tam gdzie si? zmienia sp?? rzedn? i nazwy miast itp no wiesz o co chodzi. xD
 
Odp: [8.1][Stigma] Teleporter

A gdzie mozna zmienic wspolzdedne gdzie on przeteleportowuje ?
 
Odp: [8.1][Stigma] Teleporter

A gdzie mozna zmienic wspolzdedne gdzie on przeteleportowuje ?
Kod:
if msgcontains(msg, 'anshara') then
if pay(cid,50) then
[B]travel(cid, 400, 481, 6)[/B]
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('jestes splukany ziomus.')
end

elseif msgcontains(msg, 'karmia') then
if pay(cid,50) then
[B]travel(cid, 453, 480, 6)[/B]
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('jestes splukany ziomus.')
end

elseif msgcontains(msg, 'inferna') then
if pay(cid,50) then[B]
travel(cid, 517, 439, 6)[/B]
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('jestes splukany ziomus.')
end

elseif msgcontains(msg, 'venore') then
if pay(cid,50) then
[B]travel(cid, 431, 421, 6)[/B]
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('jestes splukany ziomus.')
end

elseif msgcontains(msg, 'folda') then
if pay(cid,50) then
[B]travel(cid, 267, 317, 6)[/B]
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('jestes splukany ziomus.')
end
elseif msgcontains(msg, 'pacc') then
if pay(cid,50) then
[B]travel(cid, 430, 624, 7)[/B]
selfSay('Let\'s go!')
focus = 0
talk_start = 0
else
selfSay('jestes splukany ziomus.')
end

Pogrubi?em tam gdzie wsp??rz?dne, tzn gdzie teleportuje.

@topic
Skrypt si? na pewno przyda, wykonanie ca?kiem niez?e, jednak mog?e? u?y? tablic, np: local podroz1 itd...

Ale og?lnie spoko 8/10 - u?yj nast?pnym razem tablic :)
 
Status
Zamknięty.
Back
Do góry