#1 2008-03-06 17:21:38

lepus14

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

Skąd: Zabrze
Zarejestrowany: 2007-09-07
Posty: 133
Nick: Nie Ważne ;P
Profesja: Eternia/Chimera
Server: 67/9

[8.0][NPC] Wasp - pilnujacy porzadku

Witam Chciałbym oświadczyć ze wracam powrotnie do robienia skryptów a wiec na sam początek dodam skrypta NPC Wasp który pilnuje porządków, niestety srypt nie moj ale fajny na koncu dodam link do strony w ktorej ten skrypt się znajduje a wiec lecimy :

Chciałbym wam przedstawić kontynuację Npc na tibie 7.6

1.Wasp, który po usłyszeniu przekleństwa pozostawia gracza z ilością życia równą 1. Gdy graczowi pozostanie 1hp, a nadal będzie używał nieprzyzwoitych słów zostanie zabity.

Tak wiec, tworzymy plik Wasp Security.xml w folderze data/npc i wklejamy to:

<?xml version="1.0"?>

<npc name="Wasp Security" script="data/npc/scripts/wasphp.lua" access="3" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="44" head="20" body="30" legs="40" feet="50" corpse="2131"/>
</npc>

Nastepnie tworzymy plik wasphp.lua w data/npc/scripts i wklejamy to:


-----NPC by Mefis-----

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)

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*)kurw(%a*)'))
    or (string.find(msg, '(%a*)dziwk(%a*)'))
    or (string.find(msg, '(%a*)suk(%a*)'))
    or (string.find(msg, '(%a*)debil(%a*)'))
    or (string.find(msg, '(%a*)huj(%a*)'))
    or (string.find(msg, '(%a*)spierd(%a*)'))
    or (string.find(msg, '(%a*)jeb(%a*)'))
    or (string.find(msg, '(%a*)pierdol(%a*)'))
    or (string.find(msg, '(%a*)qrw(%a*)'))
    or (string.find(msg, '(%a*)pizd(%a*)'))
    or (string.find(msg, '(%a*)fuck(%a*)'))
    or (string.find(msg, '(%a*)bitch(%a*)'))
    or (string.find(msg, '(%a*)qurw(%a*)'))
    and (focus == 0)) and getDistanceToCreature(cid) < 8 then
          selfSay('' .. creatureGetName(cid) ..' nie przeklinaj wiecej...!!')

hp = getPlayerHealth(cid)-1

mana = getPlayerMana(cid)



        doPlayerAddMana(cid,-mana)
        doPlayerAddHealth(cid,-hp)

    end

    if ((string.find(msg, '(%a*)kurw(%a*)'))
    or (string.find(msg, '(%a*)dziwk(%a*)'))
    or (string.find(msg, '(%a*)suk(%a*)'))
    or (string.find(msg, '(%a*)debil(%a*)'))
    or (string.find(msg, '(%a*)huj(%a*)')) 
    or (string.find(msg, '(%a*)spierd(%a*)'))
    or (string.find(msg, '(%a*)jeb(%a*)'))
    or (string.find(msg, '(%a*)pierdol(%a*)'))
    or (string.find(msg, '(%a*)qrw(%a*)'))
    or (string.find(msg, '(%a*)pizd(%a*)'))
    or (string.find(msg, '(%a*)fuck(%a*)'))
    or (string.find(msg, '(%a*)bitch(%a*)'))
    or (string.find(msg, '(%a*)qurw(%a*)'))
    and (focus == 0)) and mana == 0 and hp <= 1 and getDistanceToCreature(cid) < 8 then
          selfSay('' .. creatureGetName(cid) ..' nie przeklinaj wiecej...!!')

       
        doPlayerAddHealth(cid,-(hp+1))
       

       
          focus = cid
          talk_start = os.clock()
    end
end

function onCreatureChangeOutfit(creature)

end


function onThink()

    doNpcSetCreatureFocus(focus)
      if (os.clock() - talk_start) > 0 then

      focus = 0
      end

    if focus == 0 then
        randsay = math.random(1,60)
   
    if randsay == 1 then
            selfSay('Nie przeklinaj...')
    end
    if randsay == 2 then
        selfSay('Nie uzywaj wulgaryzmow...')
    end
    end
end

2. Wasp, który po usłyszeniu przekleństwa pozostawia gracza z ilością życia równą 1. Gdy graczowi pozostanie 1hp, a nadal będzie używał nieprzyzwoitych słów zostanie teleportowany do danego miejsca(np.więzienia).

Tworzymy plik Wasp Security.xml w folderze data/npc i wklejamy to:

<?xml version="1.0"?>

<npc name="Wasp Security" script="data/npc/scripts/wasptp.lua" access="3" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="44" head="20" body="30" legs="40" feet="50" corpse="2131"/>
</npc>

Nastepnie tworzymy plik wasptp.lua w data/npc/scripts i wklejamy to:

-----NPC by Mefis-----

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)

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*)kurw(%a*)'))
    or (string.find(msg, '(%a*)dziwk(%a*)'))
    or (string.find(msg, '(%a*)suk(%a*)'))
    or (string.find(msg, '(%a*)debil(%a*)'))
    or (string.find(msg, '(%a*)huj(%a*)'))
    or (string.find(msg, '(%a*)spierd(%a*)'))
    or (string.find(msg, '(%a*)jeb(%a*)'))
    or (string.find(msg, '(%a*)pierdol(%a*)'))
    or (string.find(msg, '(%a*)qrw(%a*)'))
    or (string.find(msg, '(%a*)pizd(%a*)'))
    or (string.find(msg, '(%a*)fuck(%a*)'))
    or (string.find(msg, '(%a*)bitch(%a*)'))
    or (string.find(msg, '(%a*)qurw(%a*)'))
    and (focus == 0)) and getDistanceToCreature(cid) < 8 then
          selfSay('' .. creatureGetName(cid) ..' nie przeklinaj wiecej...!!')

hp = getPlayerHealth(cid)-1

mana = getPlayerMana(cid)



        doPlayerAddMana(cid,-mana)
        doPlayerAddHealth(cid,-hp)

    end

    if ((string.find(msg, '(%a*)kurw(%a*)'))
    or (string.find(msg, '(%a*)dziwk(%a*)'))
    or (string.find(msg, '(%a*)suk(%a*)'))
    or (string.find(msg, '(%a*)debil(%a*)'))
    or (string.find(msg, '(%a*)huj(%a*)')) 
    or (string.find(msg, '(%a*)spierd(%a*)'))
    or (string.find(msg, '(%a*)jeb(%a*)'))
    or (string.find(msg, '(%a*)pierdol(%a*)'))
    or (string.find(msg, '(%a*)qrw(%a*)'))
    or (string.find(msg, '(%a*)pizd(%a*)'))
    or (string.find(msg, '(%a*)fuck(%a*)'))
    or (string.find(msg, '(%a*)bitch(%a*)'))
    or (string.find(msg, '(%a*)qurw(%a*)'))
    and (focus == 0)) and mana == 0 and hp <= 1 and getDistanceToCreature(cid) < 8 then
          selfSay('' .. creatureGetName(cid) ..' nie przeklinaj wiecej...!!')

tppos = {x=współrzędne x, y=współrzędne y, z=współrzędne z}       

        doTeleportThing(cid,tppos)
       

       
          focus = cid
          talk_start = os.clock()
    end
end

function onCreatureChangeOutfit(creature)

end


function onThink()

    doNpcSetCreatureFocus(focus)
      if (os.clock() - talk_start) > 0 then

      focus = 0
      end


    if focus == 0 then
        randsay = math.random(1,60)
   
    if randsay == 1 then
            selfSay('Nie przeklinaj...')
    end
    if randsay == 2 then
        selfSay('Nie uzywaj wulgaryzmow...')
    end
    end
end

Współrzędne miejsca, do którego ma teleportować gracza wpisujemy w tej linijce:

tppos = {x=współrzędne x, y=współrzędne y, z=współrzędne z}

(przyklad: tppos = {x=160, y=54, z=7})


--------------------------------------------------------
3. NPC w działaniu identyczny co Wasp Security nr1, lecz jest on bardziej "realistyczny" (wygląd gracza, po napisaniu "hi" odpowiada mówiąc kim jest i co robi).

Tworzymy plik Straznik.xml w folderze data/npc i wklejamy to:

<?xml version="1.0"?>

<npc name="Straznik" script="data/npc/scripts/straznik.lua" access="3" lookdir="2">
<mana now="800" max="800"/>
<health now="200" max="200"/>
<look type="131" head="0" body="114" legs="0" feet="0"/>
</npc>

Nastepnie tworzymy plik straznik.lua w data/npc/scripts i wklejamy to:

----NPC by Mefis----

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)

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*)kurw(%a*)'))
    or (string.find(msg, '(%a*)dziwk(%a*)'))
    or (string.find(msg, '(%a*)suk(%a*)'))
    or (string.find(msg, '(%a*)debil(%a*)'))
    or (string.find(msg, '(%a*)huj(%a*)'))
    or (string.find(msg, '(%a*)spierd(%a*)'))
    or (string.find(msg, '(%a*)jeb(%a*)'))
    or (string.find(msg, '(%a*)pierdol(%a*)'))
    or (string.find(msg, '(%a*)qrw(%a*)'))
    or (string.find(msg, '(%a*)pizd(%a*)'))
    or (string.find(msg, '(%a*)fuck(%a*)'))
    or (string.find(msg, '(%a*)bitch(%a*)'))
    or (string.find(msg, '(%a*)qurw(%a*)'))
    and (focus == 0)) and getDistanceToCreature(cid) < 8 then
          selfSay('' .. creatureGetName(cid) ..' nie przeklinaj wiecej...!!')

hp = getPlayerHealth(cid)-1

mana = getPlayerMana(cid)



        doPlayerAddMana(cid,-mana)
        doPlayerAddHealth(cid,-hp)

    end

    if ((string.find(msg, '(%a*)kurw(%a*)'))
    or (string.find(msg, '(%a*)dziwk(%a*)'))
    or (string.find(msg, '(%a*)suk(%a*)'))
    or (string.find(msg, '(%a*)debil(%a*)'))
    or (string.find(msg, '(%a*)huj(%a*)')) 
    or (string.find(msg, '(%a*)spierd(%a*)'))
    or (string.find(msg, '(%a*)jeb(%a*)'))
    or (string.find(msg, '(%a*)pierdol(%a*)'))
    or (string.find(msg, '(%a*)qrw(%a*)'))
    or (string.find(msg, '(%a*)pizd(%a*)'))
    or (string.find(msg, '(%a*)fuck(%a*)'))
    or (string.find(msg, '(%a*)bitch(%a*)'))
    or (string.find(msg, '(%a*)qurw(%a*)'))
    and (focus == 0)) and mana == 0 and hp <= 1 and getDistanceToCreature(cid) < 8 then
          selfSay('' .. creatureGetName(cid) ..' nie przeklinaj wiecej...!!')

       
        doPlayerAddHealth(cid,-(hp+1))
       

       
         
    end
   
    if ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then
      selfSay('Witaj ' .. creatureGetName(cid) .. '! Jestem straznikiem tego miasta i za wszelka cene dopilnuje, aby panowal tu porzadek!')   

    focus = cid
      talk_start = os.clock()

    end
end

function onCreatureChangeOutfit(creature)

end


function onThink()

    doNpcSetCreatureFocus(focus)
      if (os.clock() - talk_start) > 0 then

      focus = 0
      end

end

--------------------------------------------------------



Aby umieścić NPC na mapie otwieramy plik test-spawn.xml w data/word i dopisujemy to:


<spawn centerx="współrzędne x" centery="współrzędne y" centerz="współrzędne z" radius="8">
<npc name="nazwa npc" x="0" y="0"/>
</spawn>

Mam nadzieję, że komu się przyda.


a tu obiecany link do orginalnego srypta

http://forum.tibia.org.pl/showthread.php?t=250630


http://www.ubar.pl/www/img_14521_normal.gif
http://www.ubar.pl/www/img_14522_normal.gif
http://www.ubar.pl/www/img_14665_normal.gif
http://www.ubar.pl/www/img_14611_normal.gif
http://www.ubar.pl/www/img_14538_normal.gif

Offline

 

#2 2008-03-08 11:55:25

 DaVo

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

Zarejestrowany: 2008-02-03
Posty: 1053
WWW

Re: [8.0][NPC] Wasp - pilnujacy porzadku

przyda sie ;]


<<

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

Offline

 

#3 2008-03-08 12:42:00

 Alex

http://i53.tinypic.com/qr0z2p.png

Zarejestrowany: 2008-02-18
Posty: 1550

Re: [8.0][NPC] Wasp - pilnujacy porzadku

Fajny skrypcik masz "+"


http://i27.tinypic.com/5l3nya.png


http://www.sadistic.pl/pics/019c7a64e3a1.gif

Offline

 

#4 2008-03-17 16:39:42

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: [8.0][NPC] Wasp - pilnujacy porzadku

Bardzo, ale to BARDZO się przyda... u mnie jak na OTS były pierwsze 4 osoby, to przeklinali w depocie jak szewce... Teraz mam na nich hacka Plusik leci...


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

 

#5 2008-03-19 10:30:34

1DeVoP2

http://i33.tinypic.com/2v2gq5x.gif

status 1241421
4598593
Call me!
Skąd: Cementarz
Zarejestrowany: 2008-03-15
Posty: 283
Nick: Icy Gravler
Profesja: Neptera
Server: 1
WWW

Re: [8.0][NPC] Wasp - pilnujacy porzadku

Czyż to nie temat z Torga? Widziałem ten temat i to nie byłeś ty

Offline

 

#6 2008-03-27 18:47:10

 Alex

http://i53.tinypic.com/qr0z2p.png

Zarejestrowany: 2008-02-18
Posty: 1550

Re: [8.0][NPC] Wasp - pilnujacy porzadku

Kurcze nie wiem czemu ale u mnie nie działa nawet nie widać tej postaci ;/

Już działa tylko teraz powiedzcie jak zrobić zeby on biegał po całej mapce ??

Ostatnio edytowany przez Alex (2008-03-27 19:54:22)


http://i27.tinypic.com/5l3nya.png


http://www.sadistic.pl/pics/019c7a64e3a1.gif

Offline

 

#7 2009-05-30 16:06:46

Xenox

http://i37.tinypic.com/2dqpohz.gif

Skąd: Gdzieś niedaleko...
Zarejestrowany: 2009-05-30
Posty: 28
Nick: GM Xenox
Profesja: Jeszcze nie gotowy...
Server: Wciąż rośnie...
WWW

Re: [8.0][NPC] Wasp - pilnujacy porzadku

Szkoda że pod tibie 8.0 ale skrypcik spox


Daj + Nic nie tracisz a zyskasz Przyjaciela

Offline

 

Stopka forum

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


Darmowe Forum | Ciekawe Fora | Darmowe Fora
mapa fotowoltaiki