local config = {
gnle1 = { x = 32779, y = 31977, z = 9, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE }, -- Garlick Necklace 1 spot
gnle2 = { x = 32777, y = 31982, z = 9, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE }, -- Garlick Necklace 2 spot
gnle3 = { x = 32781, y = 31982, z = 9, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE }, -- Garlick Necklace 3 spot
mstorage = 1290,
gnleID = 2199,
gnle1P = getThingFromPos(config.gnle1),
gnle2P = getThingFromPos(config.gnle2),
gnle3P = getThingFromPos(config.gnle3),
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,config.mstorage) == -1 then
doCreatureSay(cid, "You can cast me maybe you need perform another missions.", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid,config.mstorage) >= 2 then
doPlayerSendCancel(cid, "You already made this mission.")
elseif getPlayerStorageValue(cid,config.mstorage) == 1 then
if(item.itemid == 1416) then
if((gnle1P.itemid ~= config.gnleID) or (gnle2P.itemid ~= config.gnleID) or (gnle3P.itemid ~= config.gnleID)) then
doPlayerSendCancel(cid, "Place the Garlick Necklace on the correct spot.")
else
doRemoveItem(config.gnle1P.uid, 1)
doRemoveItem(config.gnle2P.uid, 1)
doRemoveItem(config.gnle3P.uid, 1)
doSendMagicEffect(config.gnle1P, CONST_ME_POFF)
doSendMagicEffect(config.gnle2P, CONST_ME_POFF)
doSendMagicEffect(config.gnle3P, CONST_ME_POFF)
doCreatureSay(cid, "Who insists caster me!", TALKTYPE_ORANGE_1)
doSummonCreature("The Count", getPlayerPosition(cid).x+1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
setPlayerStorageValue(cid,config.mstorage,2)
end
end
elseif(item.itemid == 1946) then
doTransformItem(item.uid, item.itemid - 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
return TRUE
end
local config = {
mstorage = 1290,
gnleID = 2199,
gnle1P = getThingFromPos({ x = 32779, y = 31977, z = 9, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE }),
gnle2P = getThingFromPos({ x = 32777, y = 31982, z = 9, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE }),
gnle3P = getThingFromPos({ x = 32777, y = 31982, z = 9, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE }),
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,config.mstorage) == -1 then
doCreatureSay(cid, "You can cast me maybe you need perform another missions.", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid,config.mstorage) >= 2 then
doPlayerSendCancel(cid, "You already made this mission.")
elseif getPlayerStorageValue(cid,config.mstorage) == 1 then
if(item.itemid == 1416) then
if((gnle1P.itemid ~= config.gnleID) or (gnle2P.itemid ~= config.gnleID) or (gnle3P.itemid ~= config.gnleID)) then
doPlayerSendCancel(cid, "Place the Garlick Necklace on the correct spot.")
else
doRemoveItem(config.gnle1P.uid, 1)
doRemoveItem(config.gnle2P.uid, 1)
doRemoveItem(config.gnle3P.uid, 1)
doSendMagicEffect(config.gnle1P, CONST_ME_POFF)
doSendMagicEffect(config.gnle2P, CONST_ME_POFF)
doSendMagicEffect(config.gnle3P, CONST_ME_POFF)
doCreatureSay(cid, "Who insists caster me!", TALKTYPE_ORANGE_1)
doSummonCreature("The Count", getPlayerPosition(cid).x+1)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_ENERGYAREA)
setPlayerStorageValue(cid,config.mstorage,2)
end
end
elseif(item.itemid == 1946) then
doTransformItem(item.uid, item.itemid - 1)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local removals =
{
{x = 32780, y = 31976, z = 9, stackpos = 255},
{x = 32778, y = 31980, z = 9, stackpos = 255},
{x = 32782, y = 31980, z = 9, stackpos = 255}
}
ret = false
--if getPlayerStorageValue(cid, 1889) == 22 then
for i = 1, #removals do
local amuletos = getThingfromPos(removals[i])
if amuletos.itemid == 2199 then
doRemoveItem(getThingfromPos(removals[i]).uid, 1)
doCreateMonster("The Count", {x = 32780, y = 31980, z = 9})
else
ret = true
end
end
if ret then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You need to put the amulets in the altars.")
end
--else
-- doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You aren't a member of the inquisition.")
--end
return TRUE
end
local config = {
garlicPos = {
{ x = 32779, y = 31977, z = 9},
{ x = 32777, y = 31982, z = 9},
{ x = 32781, y = 31982, z = 9}
},
storage = 1290,
garlicID = 2199
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, config.storage) == -1 then
doCreatureSay(cid, "You can cast me maybe you need perform another missions.", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid, config.storage) > 1 then
doPlayerSendCancel(cid, "You already made this mission.")
elseif getPlayerStorageValue(cid, config.storage) == 1 then
for i, v in ipairs(config.garlicPos) do
if getTileItemById(v[i], config.garlicID).uid <= 0 then
doPlayerSendCancel(cid, "Place the Garlick Necklace on the correct spot.")
return false
else
doRemoveItem(getTileItemById(v[i], config.garlicID).uid)
doSendMagicEffect(v[i], CONST_ME_POFF)
end
end
doCreatureSay(cid, "Who insists caster me!", TALKTYPE_ORANGE_1)
doSummonCreature("The Count", getThingPos(cid))
doSendMagicEffect(fromPosition, CONST_ME_ENERGYAREA)
setPlayerStorageValue(cid, config.storage, 2)
end
return true
end
local config = {
garlicPos = {
{ x = 32779, y = 31977, z = 9, stackpos = 255},
{ x = 32777, y = 31982, z = 9, stackpos = 255},
{ x = 32781, y = 31982, z = 9, stackpos = 255}
},
storage = 1290,
garlicID = 2199
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, config.storage) == -1 then
doCreatureSay(cid, "You can cast me maybe you need perform another missions.", TALKTYPE_ORANGE_1)
elseif getPlayerStorageValue(cid, config.storage) > 1 then
doPlayerSendCancel(cid, "You already made this mission.")
elseif getPlayerStorageValue(cid, config.storage) == 1 then
for i, v in ipairs(config.garlicPos) do
if getThingFromPos(v[i]).itemid ~= config.garlicID then
return doPlayerSendCancel(cid, "Place the Garlick Necklace on the correct spot.")
else
doRemoveItem(getThingFromPos(v[i]).uid)
doSendMagicEffect(v[i], CONST_ME_POFF)
end
end
doCreatureSay(cid, "Who insists caster me!", TALKTYPE_ORANGE_1)
doSummonCreature("The Count", getThingPos(cid))
doSendMagicEffect(fromPosition, CONST_ME_ENERGYAREA)
setPlayerStorageValue(cid, config.storage, 2)
end
return true
end
local amuletos = getThingfromPos(removals[i])
if amuletos.itemid == 2199 then
doRemoveItem(getThingfromPos(removals[i]).uid, 1)
doCreateMonster("The Count", {x = 32780, y = 31980, z = 9})
[Error - Action Interface]
data/actions/scripts/inq/thecount.lua:onUse
Description:
attempt to index a nil value
stack traceback:
[C]: in function 'getThingFromPos'
data/actions/scripts/inq/thecount.lua:18: in function <data/actions/scri
pts/inq/thecount.lua:11>
No more ???? I need that too
I tested StreamSide script but summon 3 THE COUNT and is to simple than that you Bulet and Sypher has doing plx finish him ...