-- ToT by Leon Zawodowiec --
-- Made for Halloween Update --
-- Remade by Simon --
function onUse(cid, item, frompos, item2, topos)
-- no spoko expl dest fbomb hmm gfb sd mwal uh paral ava 5d 10d
local runyyy_id = {2313, 2261, 2305, 2311, 2304, 2268, 2293, 2273, 2278, 2274, 2280, 2282}
local config = {
pos = {x=849, y=1113, z=6}
}
local x = {50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 1, 1}
local treats = {[1] = {f = function(cid,uid)
doPlayerAddItem(cid, 2160, 2, TRUE) -- 1. Treat - 2cc.
doRemoveItem(uid, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got 2 Crystal Coins.")
end},
[2] = {f = function(cid,uid)
for i = 1, 5 do
doPlayerAddBlessing(cid, i)
end
doPlayerAddItem(cid, 2160, 2, TRUE) -- 2. Treat - 2cc + Blessy.
doRemoveItem(uid, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got 2 Crystal Coins and All Blessings.")
end},
[3] = {f = function(cid,uid)
local z = math.random(1,12)
doPlayerAddItem(cid, runyyy_id[z], x[z]) -- 3. Treat - Losowa Runka x50, lub Runka z PACC'em.
nazwa = getItemNameById(runyyy_id[z])
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got ".. x[z] .."x ".. nazwa .. ".")
doRemoveItem(uid, 1)
end},
[4] = {f = function(cid,uid)
doPlayerAddItem(cid, 6569, 25) -- 4. Treat - 25x cukierkow
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You got 25 Candies.")
doRemoveItem(uid, 1)
end},
[5] = {f = function(cid,uid)
doPlayerAddExperience(cid, 500000) -- 5. Treat - 500k Expa
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You received 500k Experience Points, Please Re-Log.")
doRemoveItem(uid, 1)
end},
[6] = {f = function(cid,uid)
doTeleportThing(cid, config.pos) -- 6. Trick - Teleport na zadupie
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You gotta Tricket ! Hmm how to back ?")
doRemoveItem(uid, 1)
end},
[7] = {f = function(cid,uid)
doRemoveItem(uid, 1)
doRemoveCreature(cid, true) -- 7. Trick - Kick
end},
[8] = {f = function(cid,uid)
if (getPlayerSex(cid) == 0) then -- 8. Trick - Zmiana p?ci
doPlayerSetSex(cid, 1)
else
doPlayerSetSex(cid, 0)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You gotta Owned ! Re-Log !

")
doRemoveItem(uid, 1)
end},
[9] = {f = function(cid,uid)
doPlayerSay(cid, "JESTEM PEDALEM") -- 9. Trick - Krzyczy
doRemoveItem(uid, 1)
end},
[10] = {f = function(cid,uid)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This bag was empty.") -- 10. Trick - Pusty worek
doRemoveItem(uid, 1)
end}
}
local liczba = math.random(1,#treats)
treats[liczba].f(cid,item.uid) -- wywo?anie funkcji danego psikusa
return true
end