darkmu
Well-Known Member
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
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