• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

doSetCondition? Help!

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,782
Solutions
25
Reaction score
491
Location
Sweden
I need help with a script, or one line is more like.

When you walk on a tile, you should get poisoned and lose 50hp that later drops to 49,48 and so on.

My thought is something like

doPlayerSetCondition(cid, poison)

But it, of course, doesn't work. So I simply wonder if someone knows what to write and then if someone could post it here to help me out. Would appriciate it with some Rep!

Thanks for now.
 
LUA:
local condition = createConditionObject(CONDITION_MANASHIELD)-- change to ur thing
addDamageCondition(condition, 50, 5, 50)

function onAnything(...)
    doAddCondition(cid, condition)
end


 
I'll try it out!

Edit: Didn't work really. When I step I get posioned for like 0.5 seconds and then drops it. I edited it like this, tell me if it's wrong

LUA:
local condition = createConditionObject(CONDITION_POISON)-- change to ur thing
addDamageCondition(condition, 50, 5, 50)
 
function onStepIn(cid, item, frompos, item2, topos) 
    doAddCondition(cid, condition)
end

Also tried

LUA:
local condition = createConditionObject(CONDITION_POISON)-- change to ur thing
addDamageCondition(condition, 50, 5, 50)
 
function onStepIn(cid, item, frompos, item2, topos) 
    doAddCondition(cid, CONDITION_POSION)
end

On the last example I got poisoned but lost only 1hp!
 
Last edited:
You can try this...


local condition = createConditionObject(CONDITION_POISON)
setConditionParam(condition, CONDITION_PARAM_PERIODICDAMAGE, -20)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition, CONDITION_PARAM_TICKINTERVAL, 2000)

function onStepIn(cid, item, position, fromPosition)
if(isPlayer(cid)) then
doAddCondition(cid, condition)
end
return true
end
 
Back
Top