local playerPosition =
{
{x = 1363, y = 795, z = 8, stackpos = STACKPOS_TOP_CREATURE},
{x = 1364, y = 795, z = 8, stackpos = STACKPOS_TOP_CREATURE},
{x = 1365, y = 795, z = 8, stackpos = STACKPOS_TOP_CREATURE},
{x = 1366, y = 795, z = 8, stackpos = STACKPOS_TOP_CREATURE}
}
local newPosition =
{
{x = 1353, y = 795, z = 9},
{x = 1354, y = 795, z = 9},
{x = 1355, y = 795, z = 9},
{x = 1356, y = 795, z = 9}
}
-- Do not modify the declaration lines below.
local player = {0, 0, 0, 0}
local failed = FALSE
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
for i = 1, 4 do
failed = TRUE
player[i] = getThingfromPos(playerPosition[i])
if player[i].itemid > 0 then
if isPlayer(player[i].uid) == TRUE then
if getPlayerStorageValue(player[i].uid, 30015) == -1 then
if getPlayerLevel(player[i].uid) >= 100 then
failed = FALSE
end
end
end
end
if failed == TRUE then
doPlayerSendCancel(cid, "Sorry, not possible.")
return TRUE
end
end
for i = 1, 4 do
doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
doTeleportThing(player[i].uid, newPosition[i], FALSE)
doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)
end
doTransformItem(item.uid, item.itemid + 1)
elseif item.itemid == 1946 then
doPlayerSendCancel(cid, "Sorry, not possible.")
end
return TRUE
end
function onUse(cid, item, frompos, item2, topos)
if item.uid == 5001 then
queststatus = getPlayerStorageValue(cid,100)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a demon armor.")
doPlayerAddItem(cid,2494,1)
setPlayerStorageValue(cid,100,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
end
if item.uid == 5002 then
queststatus = getPlayerStorageValue(cid,100)
if queststatus ~= 1 then
doPlayerSendTextMessage(cid,22,"You have found a magic sword.")
doPlayerAddItem(cid,2400,1)
setPlayerStorageValue(cid,100,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
end
if item.uid == 5003 then
queststatus = getPlayerStorageValue(cid,100)
if queststatus ~= 1 then
doPlayerSendTextMessage(cid,22,"You have found a stonecutter axe.")
doPlayerAddItem(cid,2431,1)
setPlayerStorageValue(cid,100,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
end
if item.uid == 5004 then
queststatus = getPlayerStorageValue(cid,100)
if queststatus ~= 1 then
doPlayerSendTextMessage(cid,22,"You have found a present.")
doPlayerAddItem(cid,2326,1)
setPlayerStorageValue(cid,100,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
else
return 0
end
return 1
end