Advertisement
Guest User

Untitled

a guest
Jun 24th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. quest truhe begin
  2.     state start begin
  3.         function truhe()
  4.             return
  5.                 {
  6.                     --truhenvnum--ItemsInDerKiste------itemids-----------chance---------------anzahl
  7.                     {123,           5,      10,11,12,13,14,     20,20,20,20,20,     1,1,1,1,1,},
  8.                     {1234,          5,      10,11,12,13,14,     20,20,20,20,20,     1,1,1,1,1,}
  9.                
  10.                 }
  11.         end
  12.    
  13.         when item.get_vnum().use with item.get_type() == 18 begin
  14.             local boni,luck,anz,per,cha,trh = 0,0,0,0,0,truhe.truhe()
  15.             for i = 1, table.getn(trh)+1, 1 do
  16.                 if item.get_vnum() == trh[i][1] then
  17.                     boni = number(1,trh[i][2])
  18.                     ite = boni + 2
  19.                     per = boni + 2 + trh[i][2]
  20.                     anz = boni + 10
  21.                     luck = 0 + per
  22.                     cha = number(1,100)
  23.                     if cha < luck then
  24.                         pc.give_item2(trh[i][ite], trh[i][anz])
  25.                         item.remove()
  26.                     else
  27.                         syschat("Die Kiste war leer. Mehr glück beim nächsten mal!")
  28.                     end
  29.                 end
  30.             end
  31.         end
  32.     end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement