• 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!

Solved [Movement] Faster regeneration in special buildings

Fermantor

Active Member
Joined
Dec 16, 2009
Messages
209
Solutions
4
Reaction score
33
Location
Germany
So the idea is:
There is like a tavern, where you regenerate mana and hp much faster, while you are in the building.
My first attempt is this script
Code:
local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition, CONDITION_PARAM_BUFF_SPELL, 1)
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, 5)
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 5000)
setConditionParam(condition, CONDITION_PARAM_MANAGAIN, 20)
setConditionParam(condition, CONDITION_PARAM_MANATICKS, 4000)

function onStepIn(cid, item, pos)
    if isPlayer(cid) == TRUE then
        doAddCondition(cid, condition)
    end
end

function onStepOut(cid, item, pos)
    doRemoveCondition(cid, CONDITION_REGENERATION)
end
But it seems, as the condition don't get removed...

Any ideas?
 
Last edited:
[EDIT]
I found the error. In movements.xml there was the StepOut missing. For everyone, who wants to use this script proper way, here is the movements.xml
Code:
<movevent event="StepIn" actionid="25000" script="tavern.lua"/>
<movevent event="StepOut" actionid="25000" script="tavern.lua"/>

where 25000 is the actionid of the floor, of the special building.
 
Back
Top