Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onUse(cid, item, fromPosition, itemEx, toPosition)
- local q = {
- a = {1111, 2222, 3333, 4444, 5555, 6666, 0}, -- Id of items which surprise package can create (0 means nothing).
- b = {1, 2} -- Amount of create items (random).
- }
- local r, s, t, u = q.a[math.random(1, #q.a)], getItemNameById(r), amount[math.random(1, #q.b)], getCreaturePosition(cid)
- if(r == 0) then
- doCreatureAddHealth(cid, -(math.random(20,100)))
- doSendMagicEffect(u, CONST_ME_EXPLOSIONHIT)
- doPlayerSendTextMessage(cid, 4, "It was a trap! Surprise package burned you!")
- else
- doPlayerAddItem(cid, r, t)
- doSendMagicEffect(u, CONST_ME_GIFT_WRAPS)
- doPlayerSendTextMessage(cid, 4, "Surprise package gave you ".. t .."x of ".. s ..".")
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment