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

Damage in specific position

-.Ktz

New Member
Joined
Feb 11, 2016
Messages
37
Reaction score
1
Can anyone tell me how I place so that when the player triggers a lever and it is in a position x he takes damage (if it is of vita light utamo damage too) without using doTargetCombatHealth
 
Any of these should work.
Code:
doCreatureAddHealth(cid, health[, force]) (but using negative value)
doAreaCombatHealth(cid, type, pos, area, min, max, effect)
doTargetCombatHealth(cid, target, type, min, max, effect)
addDamageCondition(condition, rounds, time, value)
 
I did so
Code:
doTargetCombatHealth (0, cid, COMBAT_PHYSICALDAMAGE, -min, -max, CONST_ME_NONE)

but if the player is to mana shield he takes life damage
and the damage goes straight to the player and not the position that I wish

how do I get out in the desired position?
 
More or less a work-around, because I don't know of any direct function.
I script with 0.3.7, but I saw in another thread you use TFS 1.2, so just use it as a possible guide.
Code:
local damage = ??? --math.random(100,200) for example I guess.
if hasCondition(target, CONDITION_MANASHIELD) == true then
    if getCreatureMana(target) >= damage then
        -- doTargetCombatMana(cid, target, damage, damage, effect)
    else
        local mana_damage = (damage - getCreatureMana(target))
        damage = damage - mana_damage
        -- doTargetCombatHealth(cid, target, type, damage, damage, effect)
        -- doTargetCombatMana(cid, target, mana_damage, mana_damage, effect)
    end
else
    -- doTargetCombatHealth(cid, target, type, damage, damage, effect)
end
You'll have to fill out the rest of the functions, I only edited the parts where it was specifically required.
 
Back
Top