local config = {
stonePos = { x = 0, y = 31677, z = 15, stackpos = STACKPOS_FIRST_ITEM_ABOVE_GROUNDTILE },
rewards = { [6425] = 2427, [6426] = 2171, [6427] = 2466, [6428] = 2520 }
-- Guardian Halberd, Platinum Amulet, Golden Armor, Demon Shield
}
function onUse(cid, item)
if item.itemid == 1945 then
for i = 33295, 33299 do
config.stonePos.x = i
doRemoveItem(getThingfromPos(config.stonePos).uid)
doSendMagicEffect(config.stonePos, CONST_ME_MAGIC_RED)
end
doTransformItem(item.uid, item.itemid + 1)
elseif item.itemid == 1946 then
for i = 33295, 33299 do
config.stonePos.x = i
doCreateItem(1304, 1, config.stonePos)
doSendMagicEffect(config.stonePos, CONST_ME_POFF)
end
doTransformItem(item.uid, item.itemid - 1)
elseif item.itemid == 1740 then
for action, reward in pairs(config.rewards) do
if item.actionid == action then
if getPlayerStorageValue(cid, action) == - 1 then
doPlayerAddItem(cid, reward, 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a "..getItemName(reward)..".")
setPlayerStorageValue(cid, action, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
end
end
end
end
return TRUE
end