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

Lua conditions attributes losing

darkmu

Well-Known Member
Joined
Aug 26, 2007
Messages
274
Solutions
1
Reaction score
50
Location
Paraná,Brazil
Could someone tell me if it is possible to use a condition for the player to put on dying, when using another type of condition he does not lose? just lose for the same time? For when using my critical potion if he uses any magic that increases the damage / critical or dies he simply loses.

TFS 1.3

Lua:
local critical = Condition(CONDITION_ATTRIBUTES)
critical:setParameter(CONDITION_PARAM_TICKS, 30 * 60 * 1000)
critical:setParameter(CONDITION_PARAM_SKILL_CRITICAL_HIT_CHANCE, 30)
critical:setParameter(CONDITION_PARAM_SKILL_CRITICAL_HIT_DAMAGE, 30)

local config = {
    [40000] = critical,
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)

    local useItem = config[item.itemid]
    if not useItem then
        return true
    end

    player:addCondition(useItem)
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)

    item:remove(1)
    return true
end
 
Back
Top