SirChiracle - 2006-11-30 15:27:40

Hej!.

Wchodzimy do data/npc i robimy plik XML o nazwie Rings.xml i wklejamy to ::

<?xml version="1.0"?>
<npc name="Rings" script="data/npc/scripts/rings.lua" access="3">
    <look type="131" head="57" body="57" legs="57" feet="57"/>
</npc>

potem wchodzimy do data/npc/scripts i robimy plik LUA o nazwie rings.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('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
          selfSay('Hello ' .. creatureGetName(cid) .. '! I buy energy rings (1k), time rings (1k), sword rings (750gp), club rings (500gp), axe rings (500gp), dwarven rings (100gp), ring of healings (1,5k), life rings (750gp), might rings (1k), stealth rings (2k), power rings (200gp) I am alsobuying Stone skin amulets (2,5k)')
          focus = cid
          talk_start = os.clock()

      elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
          selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

    elseif focus == cid then
        talk_start = os.clock()

        if msgcontains(msg, 'energy ring') then
            sell(cid,2167,1,1000)
        elseif msgcontains(msg, 'time ring') then
            sell(cid,2169,1,1000)
        elseif msgcontains(msg, 'sword ring') then
            sell(cid,2207,1,750)
        elseif msgcontains(msg, 'club ring') then
            sell(cid,2209,1,500)
        elseif msgcontains(msg, 'axe ring') then
            sell(cid,2208,1,500)
                elseif msgcontains(msg, 'dwarven ring') then
            sell(cid,2213,1,100)
        elseif msgcontains(msg, 'ring of healing') then
            sell(cid,2214,1,1500)
        elseif msgcontains(msg, 'life ring') then
            sell(cid,2168,1,750)
        elseif msgcontains(msg, 'might ring') then
            sell(cid,2164,1,1000)
        elseif msgcontains(msg, 'stealth ring') then
            sell(cid,2165,1,2000)
                elseif msgcontains(msg, 'power ring') then
            sell(cid,2166,1,200)
        elseif msgcontains(msg, 'stone skin amulet') then
            sell(cid,2197,1,3000)

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


function onCreatureChangeOutfit(creature)

end


function onThink()
      if (os.clock() - talk_start) > 15 then
          if focus > 0 then
              selfSay('Next Please...')
          end
              focus = 0
      end
    if focus ~= 0 then
        if getDistanceToCreature(focus) > 3 then
            selfSay('Good bye then.')
            focus = 0
        end
    end
end

mam nadzieje ze sie przyda ;p

Guzur - 2006-11-30 17:36:58

Muszę Cię nauczyć robić ramki bo widze że z tym masz kłopoty xD

Na początku piszesz zdanie, które chcesz umieścić w ramce np. "Forum www.TiBiA11.Pun.Pl".
Następnie zaznaczasz całość tekstu.
I jak podświetlony masz tekst klikasz: #
Całość wygląda tak:

Kod:

Forum www.TiBiA11.Pun.Pl
SirChiracle - 2006-11-30 18:01:02

dzieki ziomek xD ale skrypty mogą być ??

Guzur - 2006-11-30 18:05:05

Skrypty Good tylko na Forum mało ludzi ;/ Jakbyś miał jak to próbuj je gdzieś zareklamować ;D

Jeżeli będziesz tak dalej uczestniczył na tym forum to dam Ci Modka i umieszcze Twojego OTS'a na tym forum jako oficjalny server naszego forum :)

SirChiracle - 2006-11-30 18:10:28

oki xD hehe loozik  i GZ dla twojego forum xD bardzo mi sie podoba ;p

wrobelek - 2006-12-31 11:43:02

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

SirChiracle - 2007-01-01 13:44:40

Napisałem ci w Santa Claus tylko zmień pozycje i nazwe NPC a wklejać tak samo.

Brolly - 2007-04-12 19:33:49

Dlaczego jak kupuje u tego npc to wszystko ma 1 charges. Mimo że zmieniałem w items.xml to dalej jest 1.

Brolly - 2007-05-03 11:58:44

Rozumiem, że nie uzyskam tu odpowiedzi.

Guzur - 2007-05-03 12:57:05

Ściągnij innego OTS może masz zrypane items.xml.
Myślałem, że sam do tego dojdziesz.

Brolly - 2007-05-05 11:07:21

Na bank jest w porządku.

Guzur - 2007-05-05 11:32:29

Ja miałem to samo z tymi pierścionkami ale nie korzystałem z nich i nigdy nie próbowałem tego naprawiać.
Poszukaj w config.lua może będzie jakaś linijka odpowiadająca za to lub w /data jakiś folder z itemami np. pierścionkami.

Brolly - 2007-05-10 22:12:19

Dobra w sumie racja, nie bardzo się tego używa.
P.S. Fajnie, że grasz na Candii, ja też ;)

Rici - 2007-05-15 14:59:42

Może mi sie zdaje ale wygląda ten npc jak z illusion bo go testowałem ale może sie myle

Kod:

Jeśli się myle to przepraszam
Guzur - 2007-05-15 18:07:53

ALE CO Z TEGO!? PRZECIEŻ NIE ZAMIESZCZAMY TU TYLKO SWOICH SKRYPTÓW!

Sory, że się tak uniosłem ale wkurza mnie to :P

paligoz - 2007-05-16 21:48:22

Wielkie dzieki! Nareszcie cos co mi dziala:D

wojtek15 - 2007-07-08 17:09:16

Wiem że nie w tym temacie ale ile postów trzeba mieć na jaką range na tym forum??

SirChiracle - 2007-07-08 17:37:27

Jest ten temat w dziale "Aktualności". Nabijasz posty, i za chwilę zarwiesz bana

wojtek15 - 2007-07-08 18:14:19

OK Spokojnie z tymi banami po prostu nie wiedziałem.

SirChiracle - 2007-07-08 18:56:04

Nie wiedziałeś, że nie można nabijać postów? Nie ośmieszaj się.

wojtek15 - 2007-07-08 18:59:39

Nie wiedziałem że ten temat jest w dziale "AKTUALNOŚCI".

ToD - 2007-07-23 16:56:57

Mam pytanie jak umieścić tego npc na otsie lub edytorze zeby dzialal zrobilem all jak tutaj napisane ;] pzdr 4all

SirChiracle - 2007-07-23 18:00:02

Npc pod 7.6 :]

Tenktowlasnieja - 2007-08-04 11:20:47

sprowadzam ludzi na forum ^^

wojtek15 - 2007-08-04 14:56:09

Tenktowlasnieja napisał:

sprowadzam ludzi na forum ^^

O co Ci chodzi??

Feriendorf Papillon Wohnung 05-2 Garden Sentral Hotel