Forum Forum o grze Tibia Strona Główna


Forum o grze Tibia
Witamy!Forum o GRZE TIBIA!!
Odpowiedz do tematu
Scrypty
Szkopas
Moderator
Moderator


Dołączył: 22 Sty 2006
Posty: 4
Przeczytał: 0 tematów

Ostrzeżeń: 0/5
Skąd: Near Liverpool

Witam. z czasem uzupelnie ten temat. Zamieszcze tutaj pare przydatnych scryptow Smile

edit:
Ciekawy NPC dzięki któremu wasze domki będą ładniejsze.
NPC zrobiony pod 7.6

w data/npc tworzymy nowy plik XML o nazwie Terey
Kod:

<?xml version="1.0"?>

<npc name="Terey" script="data/npc/scripts/terey.lua" access="3" lookdir="1">
   <health now="1" max="1"/>
   <look type="129" head="76" body="114" legs="124" feet="86"/>
</npc>

potem w data/npc/scripts tworzymy terey.lua i wpisujemy
Kod:
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 ((string.find(msg, '(%a*)hi(%a*)')) and (focus == 0)) and getDistanceToCreature(cid) < 4 then
       selfSay('Hello, ' .. creatureGetName(cid) .. '! I sell all colours tapestry(all for 50gp).')
       focus = cid
       talk_start = os.clock()

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

    elseif msgcontains(msg, 'purple tapestry') and focus == cid then
       buy(cid,1857,1,50)
       talk_start = os.clock()

    elseif msgcontains(msg, 'green tapestry') and focus == cid then
       buy(cid,1860,1,50)
       talk_start = os.clock()

    elseif msgcontains(msg, 'yellow tapestry') and focus == cid then
       buy(cid,1863,1,50)
       talk_start = os.clock()

    elseif msgcontains(msg, 'orange tapestry') or msgcontains(msg, 'mana fluid') and focus == cid then
       buy(cid,1863,1,50)
       talk_start = os.clock()

    elseif msgcontains(msg, 'red tapestry') or msgcontains(msg, 'life fluid') and focus == cid then
       buy(cid,1869,1,50)
       talk_start = os.clock()

    elseif msgcontains(msg, 'blue tapestry') and focus == cid then
       buy(cid,1872,1,50)
       talk_start = os.clock()

   elseif (msgcontains(msg, 'vial') or msgcontains(msg, 'flask')) and focus == cid then
       sell(cid,2812,1,50)
       talk_start = os.clock()

    elseif 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('Next Please...')
       end
          focus = 0
    end
   if focus ~= 0 then
      if getDistanceToCreature(focus) > 5 then
         selfSay('Good bye then.')
         focus = 0
      end
   end
 end

teraz żeby go umieścić na mapie wchodzimy w data/world otwieramy plik NPC i dodajemy
Kod:

<npc name="Terey" x="[color=red]145[/color]" y="[color=red]37[/color]" z="[color=red]7[/color]" />


gdzie to co na czerwono musicie zmienic na wlasną lokalizacje tego NPC.
I teraz Cieszcie sie ladnymi tapetami Smile

......................

wchodzimy w data\monster i tworzymy nowy plik o nazwie Train machine.XML
i wpisujemy
Kod:

<?xml version="1.0"?>
<monster name="Train machine" level="20" maglevel="30" experience="16" pushable="1" armor="15" defense="20" canpushitems="1" staticattack="45" changetarget="200" speed="250">
<health now="100000000" max="10000000"/>
<look type="18" head="20" body="30" legs="40" feet="50" corpse="4230"/>
<combat targetdistance="1" runonhealth="0"/>
<attacks>
<attack type="rune" name="ultimate healing" exhaustion="10" cycleticks="1500" probability="100000"/>
<attack type="melee" maxdamage="1"/>
<attack type="instant" name="exura vita" exhaustion="100" cycleticks="800" probability="100"/>
</attacks>

<defenses>
<!-- <defense immunity="poison"/> -->
</defenses>

<loot>
<item id="2969" countmax="30" chance1="100000" chancemax="0"/>
<item id="2858" chance="20000"/>
<item id="3315" chance="10000"/>
<item id="3305" chance="6666"/>
<item id="3224" chance="20000"/>

<item id="2791" chance="100000">
<inside>
<item id="3292" chance="6666"/>
<item id="3052" countmax="2" chance1="20000" chancemax="0"/>
<item id="3229" chance="10000"/>
<item id="2990" chance="2500"/>
</inside>
</item>
</loot>
</monster>

fajny skrypcik dla knighta i paladina gdyż ten potworek leczy siebie i trenujacego Smile


Post został pochwalony 0 razy
Zobacz profil autora
Candy
Cos tam wie
Cos tam wie


Dołączył: 28 Kwi 2007
Posty: 20
Przeczytał: 0 tematów

Ostrzeżeń: 0/5

[link widoczny dla zalogowanych]


Post został pochwalony 0 razy
Zobacz profil autora
Scrypty
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Wszystkie czasy w strefie EET (Europa)  
Strona 1 z 1  

  
  
 Odpowiedz do tematu