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

Heal cooldown doesnt work

henkas

Well-Known Member
Joined
Jul 8, 2015
Messages
993
Solutions
5
Reaction score
55
Hi,
so im using spell groups but when i use buff i cant cast healing. This is buff
XML:
<instant group="support" spellid="133" name="power up" words="power up" selftarget="1" aggressive="0" lvl="200" maglv="100" mana="5000" soul="0" exhaustion="30000" enabled="1" script="power up.lua"></instant>
This is heals i use
XML:
    <instant group="healing" spellid="135" name="body regeneration" words="body regeneration" selftarget="1" aggressive="0"  lvl="30"     maglv="50"  mana="1500" soul="0" exhaustion="1000" prem="1" enabled="1" script="regeneration.lua"></instant>
    <instant group="healing" spellid="135" name="small body regeneration" words="small body regeneration" selftarget="1" aggressive="0"  lvl="5" maglv="3"  mana="300" soul="0" exhaustion="1000" prem="0" enabled="1" script="sregeneration.lua"></instant>
 
Solution
if it's a 1.x based server then cid would be userdata in this case.
cid:getId() is what you're searching for.
Guess I need to stop helping with 1.x servers.
These minor differences cause a lot of small issues I personally can't troubleshoot without a server log.
Oh well.
Its tfs 1.2 by ninja
Try this.
Lua:
local exhaust = {}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 28)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
 
local condition = createConditionObject(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 30000)
condition:setParameter(CONDITION_PARAM_SKILL_SWORD, 10)...
Guess I need to stop helping with 1.x servers.
These minor differences cause a lot of small issues I personally can't troubleshoot without a server log.
Oh well.

Try this.
Lua:
local exhaust = {}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 28)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
condition:setParameter(CONDITION_PARAM_TICKS, 30000)
condition:setParameter(CONDITION_PARAM_SKILL_SWORD, 10)
condition:setParameter(CONDITION_PARAM_SKILL_AXE, 10)
condition:setParameter(CONDITION_PARAM_SKILL_DISTANCE, 10)
condition:setParameter(CONDITION_PARAM_SKILL_SHIELD, 10)
condition:setParameter(CONDITION_PARAM_SKILL_FISHING, 10)
condition:setParameter(CONDITION_PARAM_SKILL_CLUB, 15)
condition:setParameter(CONDITION_PARAM_STAT_MAXHITPOINTS, 5000)
condition:setParameter(CONDITION_PARAM_STAT_MAXMANAPOINTS, 5000)
condition:setParameter(CONDITION_PARAM_BUFF, true)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
    local cur_time, playerid = os.mtime(), cid:getId()
    print("cur_time = " .. cur_time .. "")
    if not exhaust[playerid] then
        exhaust[playerid] = 0
    end
    print("exhaust[playerid] = " .. exhaust[playerid] .. "")
    if exhaust[playerid] > cur_time then
        local next_time = (exhaust[playerid] - cur_time) / 1000
        doPlayerSendCancel(cid, "Exhausted. Can use again in " .. next_time .. " seconds.")
        print("exhausted. " .. exhaust[playerid] .. " - " .. cur_time .. " = " .. (exhaust[playerid] - cur_time) .. "")
        print("----")
        return false
    end
    exhaust[playerid] = cur_time + 30000
    print("Success.")
    print("----")
    return true
end
Yea it works thanks buddy
 
Back
Top