Open Tibia Server

Gotowe silniki,mapy,skrpty,accmakery.....

  • Nie jesteś zalogowany.
  • Polecamy: Komputery

  • Index
  •  » Skrypty
  •  » [8.00] Wasp [NPC]-pilnujacy porzadku

#1 2008-03-09 12:07:48

Kosa

Świeżak

Call me!
Zarejestrowany: 2008-03-09
Posty: 5
Punktów :   

[8.00] Wasp [NPC]-pilnujacy porzadku

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*)cenzura(%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*)cenzura(%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*)cenzura(%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*)cenzura(%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*)cenzura(%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*)cenzura(%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.

Skrypt zrobił LEPUS14



A TO LINK DO ORYGINALNEGO TEMATU http://www.tibia11.pun.pl/viewtopic.php?id=2887




Pozdrawiam KOSA

Ostatnio edytowany przez Kosa (2008-03-09 12:11:14)

Offline

 
  • Index
  •  » Skrypty
  •  » [8.00] Wasp [NPC]-pilnujacy porzadku

Stopka forum

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


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.gossip-girl.pun.pl www.spaniele.pun.pl www.dill.pun.pl www.pokemononlinee.pun.pl www.somethingaboutdance.pun.pl