• 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.
 
Code:
function onStepIn(cid, item, pos, fromPos)
if isPlayer(cid) then

 addDamageCondition(CONDITION_POISONED, 50, 5, 50)
end
end

this is simple example
 
Thanks, gonna see if it works!

Edit: Error from console:

Code:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/ankrahmun/random_hota/cobra_poison.lua:onStepIn

luaAddDamageCondition(). This function can only be used while loading the script.
 
Edit: Error from console:
Code:
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/ankrahmun/random_hota/cobra_poison.lua:onStepIn

luaAddDamageCondition(). This function can only be used while loading the script.
 
Sorry, was afk. Going to try now!

'addCondition' (a nil value)

By the way, I'm using Avesta 0.6.3 (Probably OTServ originally)
 
Sorry, was afk. Going to try now!

'addCondition' (a nil value)

By the way, I'm using Avesta 0.6.3 (Probably OTServ originally)

You should have said that from the start ;o, the functions aren't the same I think unfornatly I do not know the Avesta functions / differences since I have never used an avesta server, but check ur doc folder <if you got one>, a file named LUA_FUNCTIONS or smtihng :P if not, then check sources.
 
No, I don't have it. Going to check my sources for some lua functions, sec!

Done. Listing.
Code:
setCombatCondition(combat, condition)
setConditionParam(condition, key, value)
addDamageCondition(condition, rounds, time, value)
setConditionFormula(combat, mina, minb, maxa, maxb)
doTargetCombatCondition(cid, target, condition, effect)
doAddCondition(cid, condition)
 
It's doAddCondition(cid, CONDITION_POISON) :P But I want it to lose 50hp then drop, do you know how?
I tried: doAddCondition(cid, CONDITION_POISON, 50) in knowledge that it would not work lol!
 
Back
Top