Tibia - Z

Forum o Tibia i OTS

Ogłoszenie

Oficjalny Projekt : Harry Potter OTS MMORPG!! Jeśli wiesz że pomożesz,pisz na PW do adminów!!

#1 2009-01-14 14:53:19

Saller

http://img102.imageshack.us/img102/9441/adminuj1.png

Skąd: >Legnica<
Zarejestrowany: 2009-01-11
Posty: 94
Punktów :   
Wiek: 11-19

NPC Santa Claus pod 8.1

Mam dla Was skrypt na Świętego Mikołaja (Santa Claus) pod tibiê 8.1

Do OTS/Data/Npc i tam tworzymy santa.xml
---------------------------------------------------------------------------------------------------------------------------------
<?xml version="1.0"?>
<npc name="Santa Claus" script="data/npc/scripts/santa.lua" access="3" lookdir="160" autowalk="25">
    <mana now="800" max="800"/>
    <health now="200" max="200"/>
<look type="160" head="0" body="94" legs="0" feet="94"/>
</npc>
---------------------------------------------------------------------------------------------------------------------------------

A nastêpnie tworzymy plik santa.lua w OTS/data/npc/scripts
---------------------------------------------------------------------------------------------------------------------------------
fofocus = 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('Wesolych Swiat!')
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('Przepraszam, ' .. creatureGetName(cid) .. '! Poczekaj chwilke,lub dostaniesz rozge!.')
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('Przepraszam,dostales juz prezent,lub byles nie grzeczny ')
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('Wesolych Swiat')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
selfSay('Wesolych Swiat')
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,8)
if rand == 1 then
item = 2195
elseif rand == 2 then
item = 2130
elseif rand == 3 then
item = 2173
elseif rand == 4 then
item = 2160
elseif rand == 5 then
item = 2452
elseif rand == 6 then
item = 2453
elseif rand == 7 then
item = 2349
else
item = 2353
end
end
if focus == 0 then
randsay = math.random(1,80)
if randsay == 1 then
selfSay('Hmmhmm...')
end
if randsay == 2 then
selfSay('Hooooly Shit...')
end
if randsay == 3 then
selfSay('Hoho...')
end
end
end
---------------------------------------------------------------------------------------------------------------------------------
Piszemy do Santa Claus"
Hi
Present
yes
Bye

I jest prezent jak byłeś/aś grzeczny/a??
NIC NIE PISAĆ ŻE NIE DAŁEM CODE!


//Przenoszę


http://img136.imageshack.us/img136/3428/selerix1.png
Dla was to tylko piłka dla nas sens życia

Offline

 

#2 2009-01-14 16:49:20

Adus41

http://img102.imageshack.us/img102/9441/adminuj1.png

438525
Skąd: Płock
Zarejestrowany: 2009-01-11
Posty: 86
Punktów :   
Wiek: 14

Re: NPC Santa Claus pod 8.1

Ale właśnie mam pytanie dlaczego niedodajesz code?? Tak wygląda bardziej przejrzyście,ale twój gust

Offline

 

#3 2009-01-15 11:56:26

Saller

http://img102.imageshack.us/img102/9441/adminuj1.png

Skąd: >Legnica<
Zarejestrowany: 2009-01-11
Posty: 94
Punktów :   
Wiek: 11-19

Re: NPC Santa Claus pod 8.1

No nie robię styl moich skryptów.


http://img136.imageshack.us/img136/3428/selerix1.png
Dla was to tylko piłka dla nas sens życia

Offline

 

#4 2009-01-22 17:00:28

Karas93

http://img102.imageshack.us/img102/9441/adminuj1.png                []D [] []V[] []D

2584099
Call me!
Skąd: Powiat Gibon
Zarejestrowany: 2009-01-11
Posty: 45
Punktów :   
Wiek: 16
WWW

Re: NPC Santa Claus pod 8.1

Dałeś regulamin Działu to się przystosuj

POZDRO

/Ten post był przed regulaminem.Pozdrawiam Saller

Offline

 

Stopka forum

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


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.budownictwowbiis.pun.pl www.apocalypseraiders.pun.pl www.nwk.pun.pl www.nokia5200.pun.pl www.grupa2wspia.pun.pl