local itemi = 2086
local pos1 = {x=2034, y=340, z=7}
local itemi2 = 2090
local pos2 = {x=2035, y=340, z=7}
local queststatus = getPlayerStorageValue(cid,49506)
function onUse(cid, item, frompos, item2, topos)
local targetItem = getTileItemById(pos1, itemi).uid
local targetItem2 = getTileItemById(pos2, itemi2).uid
if queststatus == -1 then
if targetitem > 0 and targetitem2 > 0 then
doRemoveItem(targetItem)
doRemoveItem(targetItem2)
setPlayerStorageValue(cid,49506,1)
doPlayerAddItem(cid, 2087, 1)
doSendMagicEffect(pos1, CONST_ME_FIREAREA)
doSendMagicEffect(pos2, CONST_ME_FIREAREA)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_YELLOW)
else
doCreatureSay(cid, "You have to put "..getItemNameById(itemi).." and "..getItemNameById(itemi2).." to the right places!", TALKTYPE_ORANGE_1)
end
else
doCreatureSay(cid, "You have already done this!", TALKTYPE_ORANGE_1)
end
return 1
end
local itemi = 2086
local pos1 = {x=2034, y=340, z=7}
local itemi2 = 2090
local pos2 = {x=2035, y=340, z=7}
local storage = 9129 -- quest storage
function onUse(cid, item, frompos, item2, topos)
local queststatus = getPlayerStorageValue(cid,storage)
local targetItem = getTileItemById(pos1, itemi).uid
local targetItem2 = getTileItemById(pos2, itemi2).uid
if queststatus == -1 then
if targetitem > 0 and targetitem2 > 0 then
doRemoveItem(targetItem)
doRemoveItem(targetItem2)
setPlayerStorageValue(cid,49506,1)
doPlayerAddItem(cid, 2087, 1)
doSendMagicEffect(pos1, CONST_ME_FIREAREA)
doSendMagicEffect(pos2, CONST_ME_FIREAREA)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_FIREWORK_YELLOW)
else
doCreatureSay(cid, "You have to put "..getItemNameById(itemi).." and "..getItemNameById(itemi2).." to the right places!", TALKTYPE_ORANGE_1)
end
else
doCreatureSay(cid, "You have already done this!", TALKTYPE_ORANGE_1)
end
return 1
end
local item1 = 2086
local pos1 = {x=2034, y=340, z=7}
local item2 = 2090
local pos2 = {x=2035, y=340, z=7}
local storage = 9129 -- quest storage
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, storage) == -1 then
local a, b = getTileItemById(pos1, item1).uid, getTileItemById(pos2, item2).uid
if a > 0 and b > 0 then
doRemoveItem(a)
doRemoveItem(b)
setPlayerStorageValue(cid, storage, 1)
doPlayerAddItem(cid, 2087, 1)
doSendMagicEffect(pos1, CONST_ME_FIREAREA)
doSendMagicEffect(pos2, CONST_ME_FIREAREA)
doSendMagicEffect(getThingPos(cid), CONST_ME_FIREWORK_YELLOW)
else
doCreatureSay(cid, "You have to put "..getItemNameById(item1).." and "..getItemNameById(item2).." to the right places!", TALKTYPE_ORANGE_1, false, cid)
end
else
doCreatureSay(cid, "You have already done this!", TALKTYPE_ORANGE_1, false, cid)
end
return true
end