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

[TFS 1.5] do not remain if I end the attack

Shoorkill

Member
Joined
Dec 17, 2018
Messages
126
Reaction score
21
Good evening my dears, I'm using a script for a sword on my server, I added to it the bleeding condition for 20 times every 5 seconds 1 damage, however if I stop attacking my opponent the condition also ends, I would like to see my opponent crawling bleeding to death, even if I don't see him xD

Lua:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

function onGetFormulaValues(cid, level, maglevel)
skill = getPlayerSkill(cid,3)
level = getPlayerLevel(cid)
min = -((skill*17)+level*1)
max = -((skill*25)+level*1)
return min, max
end

setCombatCallback(combat1, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_EFFECT, 32)
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
function onGetFormulaValues(cid, level, maglevel)
skill = getPlayerSkill(cid,3)
level = getPlayerLevel(cid)
min = -((skill*30)+level*2)
max = -((skill*40)+level*2)
return min, max
end

local condition = createConditionObject(CONDITION_BLEEDING)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, 20, 5000, -1000)
addCombatCondition(combat2, condition)

setCombatCallback(combat2, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")



function onUseWeapon(cid, var)
    local critical = math.random(1,100)
    local life = 5 * getCreatureMaxHealth(cid) / 100

    if critical > 50 then
        doCreatureAddHealth(cid, life)
        doSendAnimatedText(formattedText, getPlayerPosition(cid), color)
        doSendAnimatedText("Critical", getPlayerPosition(cid), 129)
        combat2:execute(cid, var)
    else
        combat1:execute(cid, var)
    end
end
 
Solution
Are you testing this on a God character or a regular player? Remember that if you're testing it on God, the monster loses aggro, and the condition resets. You can create a summon if you want to test it on God to hold the monster's aggro or with a regular player.
Are you testing this on a God character or a regular player? Remember that if you're testing it on God, the monster loses aggro, and the condition resets. You can create a summon if you want to test it on God to hold the monster's aggro or with a regular player.
 
Solution
Are you testing this on a God character or a regular player? Remember that if you're testing it on God, the monster loses aggro, and the condition resets. You can create a summon if you want to test it on God to hold the monster's aggro or with a regular player.
This seems so obvious, how did I not think of it before? Thank you, resolved!
 
Back
Top