local condition = {}
for i = 10000, 50000 do
condition[i] = createConditionObject(CONDITION_POISON)
setConditionParam(condition[i], CONDITION_PARAM_DELAYED, true)
setConditionParam(condition[i], CONDITION_PARAM_FORCEUPDATE, true)
addDamageCondition(condition[i], 10, 1000, -math.ceil(i/2))
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if itemEx.uid == cid or not isPlayer(itemEx.uid) then
doCreatureSay(cid, 'You can only use this item on a' .. (itemEx.uid == cid and 'nother' or '') .. ' player', TALKTYPE_ORANGE_1, false, cid)
elseif getPlayerLevel(cid) < 10000 then
doCreatureSay(cid, 'You need level 10000 or higher to use this item', TALKTYPE_ORANGE_1, false, cid)
elseif getPlayerLevel(itemEx.uid) < 10000 then
doCreatureSay(cid, 'The target\'s level must be 10000 or higher', TALKTYPE_ORANGE_1, false, cid)
elseif getTileInfo(getThingPos(cid)).protection or getTileInfo(toPosition).protection then
doCreatureSay(cid, 'You cannot use this item inside a protection zone', TALKTYPE_ORANGE_1, false, cid)
else
doTargetCombatCondition(cid, itemEx.uid, condition[getPlayerLevel(cid)], CONST_ME_GREEN_RINGS)
end
return true
end