local newPos = {x=100, y=100, z=7}
local stoneId = xxxx -- Item ID of the stone
local stoneUID = xxxx -- Unique ID of the stone
local liquidType = 2 -- Subtype of the liquid pool
local liquidId = 2016 -- Item ID of the liquid pool
function onUse(cid, item, frompos, item2, topos)
local liquid = getThingfromPos(splash)
if(item.uid == stoneUID) and (liquid.itemid == liquidId) and (liquid.type == liquidType) and (stoneId.itemid == xxxx) then
doSendMagicEffect(splash, CONST_ME_MAGIC_RED)
doTeleportThing(cid, newPos)
doPlayerSendTextMessage(cid, 22, "You have stained the stone with blood.")
end
end
local config = {
stoneUnique = 34343, -- unique of the stone.
stoneID = 35435, -- id of the stone
storage = 34324, -- storage
newPos = {x = 100, y = 100, z = 7}, -- pos
AlreadyDone = "You already done this quest.", -- already done
Done = "You have stained the stone with blood." -- quest done
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if itemEx.uid == config.stoneUnique and itemEx.itemid == config.stoneID then
if getPlayerStorageValue(cid, config.storage) == -1 then
setPlayerStorageValue(cid, config.storage, 1)
doPlayerSendTextMessage(cid, 22, config.Done)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED)
doTeleportThing(cid, config.newPos)
doRemoveItem(item.uid)
else
doPlayerSendCancel(cid, config.AlreadyDone)
end
end
return TRUE
end
local index =
{
vialID = XXXX,
stoneID = XXXX,
storage = 65535,
uniqueID = 6550
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == index.vialID and itemEx.itemid == index.stoneID and itemEx.uid = index.uniqueID then
if getPlayerStorageValue(cid, index.storage) > 0 then
return FALSE
end
local pos = { x = 100, y = 100, z = 7 }
doTeleportThing(cid, pos)
setPlayerStorageValue(cid, index.storage, 1)
doRemoveItem(item.uid, 1)
return TRUE
end
end
local newPos = {
x = 100,
y = 100,
z = 7
}
local index = {
vialID = XXXX,
stoneID = XXXX,
storage = 65535,
uniqueID = 6550
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == index.vialID and itemEx.itemid == index.stoneID and itemEx.uid = index.uniqueID then
if getPlayerStorageValue(cid, index.storage) == -1 then
doSendMagicEffect(getCreaturePosition(cid),2)
doTeleportThing(cid, newPos)
doSendMagicEffect(getCreaturePosition(cid),10)
setPlayerStorageValue(cid, index.storage, 1)
doRemoveItem(item.uid, 1)
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
config = {
blood_type = 2,
vial_id = 2005,
actionid_on_stone = xxxx,
tp_pos = {}
}
if item2.actionid == config.actionid_on_stone then
if vial_id.count == 2 then --type?
doTeleportThing(cid, tp_pos)
return TRUE
end
end
[26/06/2009 10:16:25] data/actions/scripts/other/gravestone.lua:11: attempt to index global 'item2' (a nil value)
[26/06/2009 10:16:25] stack traceback:
[26/06/2009 10:16:25] data/actions/scripts/other/gravestone.lua:11: in function <data/actions/scripts/other/gravestone.lua:1>
if item2.actionid == config.actionid_on_stone then
function onUse(cid, item, fromPosition, itemEx, toPosition)
config = {
blood_type = 2,
actionid_on_stone = xxxx,
tp_pos = {}
}
if itemEx.actionid == config.actionid_on_stone then
if item.count == 2 then --type?
doTeleportThing(cid, tp_pos)
return TRUE
end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
config = {
blood_type = 2,
actionid_on_stone = 13444,
tp_pos = {x=32793, y=32334, z=9}
}
if itemEx.actionid == config.actionid_on_stone then
if item.count == 2 then --type?
doTeleportThing(cid, tp_pos)
return TRUE
end
end
end