Forum nie tylko o Tibii i OTS...

Nie tylko o Tibii i OTS...

  • Nie jesteś zalogowany.

#1 2006-11-25 19:34:15

SirChiracle

Zbanowany

Zarejestrowany: 2006-10-27
Posty: 1132
WWW

Santa Claus

Siema.
Pokaże wam jak się robi Santa Claus.
Wchodzimy do data/npc i tworzymy plik XML o nazwie Santa Claus.xml i wklejamy do niego to:

<?xml version="1.0"?>
<npc name="Santa Claus" script="data/npc/scripts/santa.lua" access="3" lookdir="2">
    <mana now="800" max="800"/>
    <health now="200" max="200"/>
    <look type="160" head="0" body="94" legs="0" feet="94"/>
</npc>

Potem wchodzimy do data/npc/scripts i robimy plik LUA o nazwie santa.lua i wklejamy to:

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

function onThingMove(creature, thing, oldpos, oldstackpos)
end

function onCreatureAppear(creature)
end


function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Merry Christmas!')
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 ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Merry Christmas ' .. creatureGetName(cid) .. '!')
focus = cid
talk_start = os.clock()
end

if string.find(msg, '(%a*)hi(%a*)') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. creatureGetName(cid) .. '! Please wait.')
end

if string.find(msg, '(%a*)present(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
present = getPlayerStorageValue(cid,1210)
if present == -1 then
buy(cid,item,1,0)
setPlayerStorageValue(cid,1210,1)
end

if present == 1 then
selfSay('Sorry, I dont have more presents for you.')
end
end

if string.find(msg, '(%a*)bye(%a*)') and focus == cid and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end


function onCreatureChangeOutfit(creature)
end


function onThink()
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Merry Christmas!')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
selfSay('Merry Christmas!')
focus = 0
end
end
if focus == 0 then
cx, cy, cz = selfGetPosition()
randmove = math.random(1,25)
if randmove == 1 then
nx = cx + 1
end
if randmove == 2 then
nx = cx - 1
end
if randmove == 3 then
ny = cy + 1
end
if randmove == 4 then
ny = cy - 1
end
if randmove >= 5 then
nx = cx
ny = cy
end
moveToPosition(nx, ny, cz)
--summons = 30
--summons2 = 30
end

if focus > 0 then
rand = math.random(1,6)
if rand == 1 then
item = 2969
elseif rand == 2 then
item = 2973
elseif rand == 3 then
item = 2981
elseif rand == 4 then
item = 3520
elseif rand == 5 then
item = 2930
else
item = 3524
end
end

if focus == 0 then
randsay = math.random(1,75)
if randsay == 1 then
selfSay('Hmmhmm...')
end
if randsay == 2 then
selfSay('Hoho...')
end
end
end

tam gdzue mamy present = getPlayerStorageValue(cid,1210)  i gdzie jest (cid,1210) id zmieniamy na to co chcesz zeby mikolaj dal

to koniec PZDR. !!!

Gressis:
Edytowałem bo źle było w ramki złapane to co mamy wklejić u siebie.

Ostatnio edytowany przez Gressis (2006-11-29 13:19:47)


WYJEBANE W TO FORUM - - -- - -- - - - -- -- -- --  -- ---------------------------------------------------------------------------------------------------------------------------------------------------

Offline

 

#2 2006-12-31 11:33:51

wrobelek

http://i37.tinypic.com/okc0lk.gif

Zarejestrowany: 2006-12-31
Posty: 7

Re: Santa Claus

Jak zrobić zeby on na OTS był wszystko wkleiłem i nie ma go Prosze o odpowiedz

Offline

 

#3 2007-01-01 13:41:04

SirChiracle

Zbanowany

Zarejestrowany: 2006-10-27
Posty: 1132
WWW

Re: Santa Claus

Wchodzimy do data/world/npc i otwieramy go za pomoca notatnika i wklejamy taką linijkę  :

Kod:

<npc name="Santa Claus" x="136" y="51" z="7"/>

Tu gdzie masz 136 , 51, 7 czyli pozycja gdzie musi stać. Robi to się jasno i prosto wchodzisz na GM'a i piszesz /pos, wyświetla ci się wtedy pozycja.
Myślę że zrozumiałeś
PoSdro


WYJEBANE W TO FORUM - - -- - -- - - - -- -- -- --  -- ---------------------------------------------------------------------------------------------------------------------------------------------------

Offline

 

#4 2007-07-23 17:11:23

ToD

http://i35.tinypic.com/2usym0z.gif

Skąd: Łódź
Zarejestrowany: 2007-07-23
Posty: 113
WWW

Re: Santa Claus

Mam slinik evolution 0.7.8 xml i w data/world niema zadnego pliku o nazwie npc tylko jest evolutions.otmb , evolutions-house, evolutions-housestore, evolutions-mapstore i evolution-spawn  co mam zrobić pomocy z góry thx.


http://www.ubar.pl/www/img_14529_normal.gif
http://www.ubar.pl/www/img_14516_normal.gif
http://www.ubar.pl/www/img_14533_normal.gif

Offline

 

#5 2007-07-23 17:59:05

SirChiracle

Zbanowany

Zarejestrowany: 2006-10-27
Posty: 1132
WWW

Re: Santa Claus

@up
To npc pod 7.6


WYJEBANE W TO FORUM - - -- - -- - - - -- -- -- --  -- ---------------------------------------------------------------------------------------------------------------------------------------------------

Offline

 

#6 2007-11-30 21:07:28

Razor13

http://i38.tinypic.com/19pb0n.gif

Zarejestrowany: 2007-11-26
Posty: 15

Re: Santa Claus

mam pytank bo jestem zielony w tych sprawach jak go wlozyc na mapke !?!

Offline

 

#7 2007-12-01 16:44:19

Adek445

http://i37.tinypic.com/okc0lk.gif

Zarejestrowany: 2007-11-26
Posty: 7

Re: Santa Claus

Mam pytanie wytlumaczcie mi dokladnie jak sie stawia potwory na mapce do otsa

Offline

 

#8 2007-12-01 18:16:27

Little Raitto

http://i37.tinypic.com/30iway9.gif

Skąd: Polkowice
Zarejestrowany: 2007-11-25
Posty: 92

Re: Santa Claus

jak otorzysz map editora i mape to masz pasek zadan na górze tam masz coś przypominajacego czerwony kwadrat- spawn tools klikasz na to lpm i na mape gdzie chesz postawic potworki . potem masz taką liste rozwijanom wybierasz z tego monster i wybierasz potwora poczym stawaisz go na mape. A tak pozatym to pytanie nie mowino być w tym dziale i temacie

Offline

 

#9 2008-01-07 18:59:10

rby

http://i37.tinypic.com/sb1sbd.jpg

Zarejestrowany: 2008-01-02
Posty: 195

Re: Santa Claus

Niewarzne jakie IP ustawie on zawsze daje zabitego potwora lub na mape dodatek np. ostatnio present mówie a on dał wode na mape na ulice i trzeba edytować mapke przez to !!! Plis pomórzcie !


Kliknij !!!!
Kliknij!!!
Kliknij !!
Trenuje pokemony
13.kwiecień 2008 r. godz. 12.24 - 100 post !!!!!

Offline

 

#10 2008-01-07 21:02:56

Requza

http://i38.tinypic.com/19pb0n.gif

Skąd: Sand Country
Zarejestrowany: 2008-01-07
Posty: 16
Nick: Conspirs
Profesja: Fortera
Server: 82

Re: Santa Claus

Wszystko super i dokładnie xD ale szkoda, że pod 7.6 ;/


http://i175.photobucket.com/albums/w141/Yoki-sensei/BANER/Gaara44.jpg

Offline

 

#11 2008-02-28 17:59:19

 DaVo

http://i35.tinypic.com/71u5wo.gif

Zarejestrowany: 2008-02-03
Posty: 1053
WWW

Re: Santa Claus

przyda sie ;]


<<

http://img835.imageshack.us/img835/1563/franklampard.png

Offline

 

#12 2008-02-29 13:06:03

Krasik

Zbanowany

Zarejestrowany: 2008-02-17
Posty: 49

Re: Santa Claus

Mi wszysko działa tylko jak mowie do niego "hi" "present" to on mi daje jakiegos zabitego wilka :(

Offline

 

#13 2008-03-05 21:45:48

 Soldier of the North

http://i34.tinypic.com/3321jrs.gif

1980
Skąd: Nordland
Zarejestrowany: 2008-02-06
Posty: 3358

Re: Santa Claus

moze to inne id?? Pod jakiego OT jest ten skrypty? A jaki OTS masz?? TZN. np. pod 7.6


http://img811.imageshack.us/img811/7369/strza1.jpg

Offline

 

#14 2008-03-25 11:41:00

DjMZ

http://i37.tinypic.com/30iway9.gif

3832590
Call me!
Skąd: Metin2
Zarejestrowany: 2007-12-28
Posty: 94
Nick: IronShadow
Profesja: Obsydian
Server: 37
WWW

Re: Santa Claus

Ja powiem krótko i zwięźle... Trzeba wejść w folder items (ten w folderze data OTSa) i tam macie items.otb i items.xml no i wchodzicie w items.xml. wyszukujecie coś (nie podam tu konkretnego ip bo juz nie mam OTSów pod 7.6) i macie powiedzmy magic plate armor z ip np. 7777 (daje tu losowe ip) i teraz robicie coś takiego, że w tym npc przestawiacie to:
"then
present = getPlayerStorageValue(cid,1210)
if present == -1 then
buy(cid,item,1,0)
setPlayerStorageValue(cid,1210,1)
end"
na:
"then
present = getPlayerStorageValue(cid,7777)
if present == -1 then
buy(cid,item,1,0)
setPlayerStorageValue(cid,7777,1)
end"
Myślę, że jasno i prosto wyjaśniłem...
Aha i jeszcze jedno, żeby potem nie było tekstów typu "A mi przywołuje lave." "A mi przywołuje cośtam!" to ip zmyśliłem... nie mam bladego pojęcia co jest pod tym ip... Dałem je tylko jako przykład, więc proszę wszystkich i każdego z osobna, żeby sam sobie poszukał jakiegoś sensownego ip w pliku items.xml. Żeby jak wyżej mówił rby nie tworzył dziwacznych itemów, to trzeba te obydwa które powiększyłem edytować... Obydwa! Mam nadzieję, że ktoś skorzysta na mojej pomocy... Miłego stawiania tego npc!


http://www.penspinning.pl/images/photoalbum/album_4/userbar.png
Znikam z tego forum na razie - mam inne zajęcie ;p Do zobaczenia!!! Kiedyś... POZDROO!

Offline

 

Stopka forum

RSS
Powered by PunBB
© Copyright 2002–2008 PunBB
Wersja Lo-Fi


Darmowe Forum | Ciekawe Fora | Darmowe Fora
tutaj parkiety taneczne now foods czarna sukienka kwatery biały dunajec