• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[Action] Vial Posioner

Zarabustor

Human Being
Joined
Sep 10, 2009
Messages
186
Reaction score
0
Location
Cancun, Mexico
Hi everybody, could someone help me to make a script that its about an XITEM that when you use it on target it will remove depends of you level i mean that if you are level 100 it will remove the health of you target by -50 damage each 1 seconds for a total of 10 seconds, also it can be used with level 100 or higher, and target must be also 100 or higher.
 
Code:
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
 
Last edited:
Code:
local condition = {}
for i = 100, 500 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, -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) < 100 then
		doCreatureSay(cid, 'You need level 100 or higher to use this item', TALKTYPE_ORANGE_1, false, cid)
	elseif getPlayerLevel(itemEx.uid) < 100 then
		doCreatureSay(cid, 'The target\'s level must be 100 or higher', TALKTYPE_ORANGE_1, false, cid)
	else
		doTargetCombatCondition(cid, itemEx.uid, condition[getPlayerLevel(cid)], CONST_ME_GREEN_RINGS)
	end
	return true
end

Error:

[15/05/2010 20:49:24] [Error - Action Interface]
[15/05/2010 20:49:24] data/actions/scripts/andres/vialp.lua:eek:nUse
[15/05/2010 20:49:24] Description:
[15/05/2010 20:49:24] (luaDoTargetCombatCondition) Condition not found

:) Thanks
 
And how many conditions should the script make?
It needs to make conditions for every level you want the script to work for, because the condition system is limited :/
 
Its just 1 condition and maybe idk if there is a way that you can make the script quit health points, like when you heal with an UH Rune, so will be like this: if you are level 10000 it will quit -5000 like healing (green) but will quit health. So i mean that if could be not exactly a condition like POISON or idk, just quit health.
 
Last edited:
but I edited the post -.- you need to copy the script again

Ok, sorry i didnt see :/

[15/05/2010 22:10:42] [Error - LuaScriptInterface::loadFile] data/actions/scripts/andres/vialp.lua:20: 'end' expected (to close 'function' at line 9) near '<eof>'
[15/05/2010 22:10:42] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/andres/vialp.lua)
[15/05/2010 22:10:42] data/actions/scripts/andres/vialp.lua:20: 'end' expected (to close 'function' at line 9) near '<eof>'
[15/05/2010 22:10:42] Reloaded actions.
 
Back
Top