Forum nie tylko o Tibii i OTS...

Nie tylko o Tibii i OTS...


#1 2008-05-15 21:49:30

Ziele

http://i38.tinypic.com/ztvkat.gif

6868784
Zarejestrowany: 2008-03-26
Posty: 462

[NPC] The Oracle (Wyrocznia)

sam szukalem tego skryptu i go nieumialem znalezc... Skrypt nie muj.
ale napewno sie komus przyda bo zadko sie go spotyka ;]

w data/npc robnimy the oracle.xml :

Kod:

<?xml version="1.0" ?>
  <npc name="The Oracle" script="data/npc/scripts/oracle.lua" access="3">
  <look type="1448" head="57" body="59" legs="40" feet="76" />
  </npc>

a w scripts robimy Oracle.lua:

Kod:

focus = 0
talk_start = 0
target = 0
following = false
attacking = false
talk_state = 0
cname = ''
vocation = 0
mainlevel = 8

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)
      cname = creatureGetName(cid)
    msg = string.lower(msg)

      if (msgcontains(msg, 'cze') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
          selfSay('Hello ' .. cname .. '! Are You reapered Your destiny?')
          talk_state = 0
          focus = cid
          talk_start = os.clock()

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

      elseif msgcontains(msg, 'nara') and focus == cid and getDistanceToCreature(cid) < 4 then
        selfSay('Goodbye, ' .. cname .. '!')
        talk_state = 0
        focus = 0
        talk_start = 0      elseif focus == cid then
        talk_start = os.clock()          if talk_state == 0 then
            if msgcontains(msg, 'yes') then        -- wanna go to mainland
                  level = getPlayerLevel(cname)

                  if level >= mainlevel then
                    selfSay('Great! What vocation You prefer? knight, paladin,sorcerer,druid?')
                    talk_state = 1
                  else
                      selfSay('Sorry, You need ' .. mainlevel .. 'to go to mainland.')
                    talk_state = 0
                  end
            else
                selfSay('Come back when You'll grow.')
                talk_state = 0
            end

        elseif talk_state == 1 then        -- telling vocation
            talk_state = 2

            if msgcontains(msg, 'sorcerer') then
                selfSay('Sorcerer! Are You sure?')
                vocation = 1
            elseif msgcontains(msg, 'druid') then
                selfSay('Druid! Are You sure?')
                vocation = 2
            elseif msgcontains(msg, 'paladin') then
                selfSay('Paladin! Are You sure?')
                vocation = 3
            elseif msgcontains(msg, 'knight') then
                selfSay('Knight! Are You sure?')
                vocation = 4
            else
                selfSay('Sorry,this vocation is not match.')
                vocation = 0
                talk_state = 1
            end

        elseif talk_state == 2 then        -- confirming vocation
            if msgcontains(msg, 'yes') then
                selfSay('Great! What City you prefer? twoja nazwa 1, twoja nazwa 2 itd')
                talk_state = 3
            else
                selfSay('What vocation do you want then?')
                talk_state = 1
            end

        elseif talk_state == 3 then        -- telling city name
            if msgcontains(msg, 'nazwa miasta 1') then
                selfSay('Good luck!')
                setPlayerVocation(cid,vocation)
                setPlayerMasterPos(cid,x,y,z)   templa na mainie miasta 1
                selfSay('/send ' .. cname .. ', x  y  z')  templa na mainie  miasta 1   

                                                  if msgcontains(msg, 'nazwa miasta 2') then
                selfSay('Good luck!')
                setPlayerVocation(cid,vocation)
                setPlayerMasterPos(cid,x,y,z)   templa na mainie miasta 2
                selfSay('/send ' .. cname .. ', x  y  z')  templa na mainie miasta 2



                talk_state = 0
                focus = 0
                talk_start = 0
            else
                selfSay('This city don't match..')
                talk_state = 3
            end
          end
      end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
      if (os.clock() - talk_start) > 45 then
          if focus > 0 then
              selfSay('Next please...')
          end
              focus = 0
      end
    if focus ~= 0 then
        if getDistanceToCreature(focus) > 5 then
            selfSay('Good bye!.')
            focus = 0
        end
    end
end

Pozdro ;]


^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^.^
http://www.pokeplushies.com/images/adoptables/771098.gif
Nakarmisz Mnie ???
www.cs-myp.xt.pl <<<<---- zapraszamy do rejestracjii !!
www.games4you.y0.pl <<<< --------- Również zapraszamy !!!

Offline

 

#2 2008-05-15 22:01:36

 Soldier of the North

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

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

Re: [NPC] The Oracle (Wyrocznia)

Był już ten skrypt! Chyba z 3x ..


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

Offline

 

#3 2008-05-15 22:03:30

 Seeker

http://i49.tinypic.com/2whmhds.jpg

4133650
Skąd: Tu i Tam...
Zarejestrowany: 2008-02-29
Posty: 1243
Nick: Heannak
Profesja: Honera
Server: 39~
WWW

Re: [NPC] The Oracle (Wyrocznia)

ze b3 razy tego jest pelno no ale on new moze niewiedziec a ty bys sie wydzieral odrazu


http://pretoriaots.pl/signature.php?character=Seeker&image=4
http://s2.tibiafun.y0.pl/char.php?c=Naplecior
http://www.pokeplushies.com/images/adoptables/690903.gif

Offline

 

#4 2008-05-15 22:04:02

 Dimek

http://i50.tinypic.com/242swno.jpg

Zarejestrowany: 2008-04-05
Posty: 1855

Re: [NPC] The Oracle (Wyrocznia)

racja opcja ''szukaj''


http://i44.tinypic.com/kd01v7.png
http://www.kiep.pl/img21/2011/03/18/1300408688dance.gif

Offline

 

#5 2008-05-15 22:22:56

 Soldier of the North

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

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

Re: [NPC] The Oracle (Wyrocznia)

Jest nowy ale to nie znaczy, że nie może używać opcji "szukaj"


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

Offline

 

#6 2008-05-15 22:33:38

Dechalol

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

234439
Skąd: Gdansk - Yaponia xd
Zarejestrowany: 2008-05-15
Posty: 2
Nick: Dechaa
Profesja: WypasRPG oT
Server: 11 ale up'uje ;>
WWW

Re: [NPC] The Oracle (Wyrocznia)

Plagiat że nie wiem, oryginalną wersje widziałem na tibia.org.pl ..

Więc chociaż napisz skąd to masz..

Offline

 

#7 2008-05-15 23:13:15

Matys

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

NoobSpam
Skąd: HaJnÓwKa
Zarejestrowany: 2007-12-27
Posty: 591
WWW

Re: [NPC] The Oracle (Wyrocznia)

W temacie piszecie tylko szukaj itd jak macie zamiar tylko takie pisac to nie piszcie bo to nabijanie postow
@Temat
Gratuluje ponownego oplublikowania czegos co juz bylo nie zwracaj uwagi jak ktos pisze np. ten up ze jestes pliagiat bo pliagiat dla mnie to ktos kto gada ze sam zrobil


Raz na jakis czas Tu bywam

Offline

 

#8 2008-05-22 15:54:13

~Shikamaru~

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

Zarejestrowany: 2008-05-22
Posty: 23

Re: [NPC] The Oracle (Wyrocznia)

hmm....jak ktos jest fanem roka to sie przyda xDD



PzDr ALL :]


xD....Opisu Nie Ma....xD

Offline

 

#9 2008-07-26 11:04:33

maks_129

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

Zarejestrowany: 2008-07-25
Posty: 5

Re: [NPC] The Oracle (Wyrocznia)

siema zrobilem wszystko tak ja tu jest opisane i mi nie działa nawet nigdzie nie ma go na mapie
z góry dzieki za pomoc

Offline

 

#10 2008-12-15 20:52:23

DonKonieczko

Zbanowany

I'm ToXiC
Skąd: Londynek <33
Zarejestrowany: 2008-12-15
Posty: 310
Nick: Master Loczek
Profesja: Rox666
Server: 250

Re: [NPC] The Oracle (Wyrocznia)

Noo Fajny Skrypt Na RL Mape Jak Ktos Zrobil Rookgaard i Nie Ma Oracle xD


www.14dzielnica.pun.pl
Super Forum O Grach !

Offline

 

Stopka forum

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


Darmowe Forum | Ciekawe Fora | Darmowe Fora
www.teenager-hogwart.pun.pl www.bleachfani.pun.pl www.radiotopmusic.pun.pl www.ligipilkarskie.pun.pl www.costam.pun.pl