• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Exhaustion problem - plzz help!

Rangerix

New Member
Joined
Nov 28, 2010
Messages
4
Reaction score
0
I wanna do exhaustion for this "potion-based" script:
Code:
function onUse(cid, item, frompos, item2, topos)

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 4000)

if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end

if (item.itemid == 5953 and item.type > 1) then
doCreatureAddHealth(cid, math.random(200, 500))
doChangeTypeItem(item.uid,item.type-1)
doSendMagicEffect(topos,12)
doCreatureSay(cid, "Nice weeeed...", TALKTYPE_ORANGE_1)
else
doRemoveItem(item.uid,1)
end

return 1
end

Exhaustion inside code, doesn't work ;/
 
do you want it to affect healing/support spells aswell (and vice-versa, get affected by casting them), or only potions
 
potions only .. (is that marijuana healing weed)
i want exhaust, after using this weed.
 
LUA:
local a = createConditionObject(CONDITION_EXHAUST)
setConditionParam(a, CONDITION_PARAM_TICKS, 4000)
setConditionParam(a, CONDITION_PARAM_SUBID, 4)

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if hasCondition(cid, CONDITION_EXHAUST, 4) then
		doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
	else
		doRemoveItem(item.uid)
		doAddCondition(cid, a)
		doCreatureAddHealth(cid, math.random(200, 500))
		doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
		doCreatureSay(cid, 'Nice weeeed...', TALKTYPE_ORANGE_1)
	end
	return true
end
 
Back
Top