w actions.xml dodajemy linijke:

actions.xml
<action itemid="ID ITEMA" script="box.lua"/>

do data/actions dodajemy:

box.lua
function onUse(cid, item, frompos, item2, topos)
 
   rand = math.random(1,5)
 
 
 
      if item.itemid == 2156 then
 
         if rand == 1 then
 
         doPlayerSendTextMessage(cid,22,"Thanks for donate") 
 
   doRemoveItem(item.uid, 1)
 
   doSendMagicEffect(getCreaturePosition(cid), 96)
 
   doPlayerAddItem(cid, 2443, 1)
 
 
 
         elseif rand == 2 then
 
         doPlayerSendTextMessage(cid,22,"Thanks for donate") 
 
   doRemoveItem(item.uid, 1)
 
      doSendMagicEffect(getCreaturePosition(cid), 96)
 
      doPlayerAddItem(cid, 2412, 1)
 
 
 
         elseif rand == 3 then
 
         doPlayerSendTextMessage(cid,22,"Thanks for donate") 
 
   doRemoveItem(item.uid, 1)
 
      doSendMagicEffect(getCreaturePosition(cid), 96)
 
      doPlayerAddItem(cid, 2425, 1)
 
 
 
         elseif rand == 4 then
 
         doPlayerSendTextMessage(cid,22,"Thanks for donate") 
 
   doRemoveItem(item.uid, 1)
 
      doSendMagicEffect(getCreaturePosition(cid), 96)
 
      doPlayerAddItem(cid, 2390, 1)
 
 
 
         else
 
 
 
         doPlayerSendTextMessage(cid,22,"Thanks for donate")
 
   doRemoveItem(item.uid, 1)
 
      doSendMagicEffect(getCreaturePosition(cid), 96)
 
      doPlayerAddItem(cid, 2411, 1)
 
 
 
         end
 
 
 
    return
 
    end
 
end
otspub/item_dajacy_losowy_item.txt · Last modified: 2011/04/03 21:02 by erexo
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
 otosowy pasek