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

Solved Burning arrow spell

Materion

New Member
Joined
Feb 18, 2012
Messages
81
Reaction score
2
Hello It's me again ;). I wanna make spell that will shoot some projectile into enemy and make him burn for some time and some damage, like walk into fire field but without firefield. Like I'm attacking an Orc, I'm casting "Burning Arrow!" - some animation appears and Orc start to burn 10 damage per 5 seconds (no fire under him). But I don't know completly how to start I'm checking spells scripts but I'm little confused :). It should start probably like -
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
But i don't know what next ;d.
 
local condition = createConditionObject(CONDITION_FIRE)
setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
addDamageCondition(condition, how many times, how long between each burn 5000 = 5 sec, damage -10 = 10 health loss)
setCombatCondition(combat, condition)
 
Thank you ! I love you guys for your support and help :). Maybe there is some site or tutorial with all commands/functions/paramaters like this ? setConditionParam(condition, CONDITION_PARAM_DELAYED, 1),addDamageCondition with explanations, or at least list of all possible functions and parameters? I'm looking in documentation of tfs and i can't find those ;<.
I'm programming for about 2 years, maybe I'm not some pro but i can make easy-medium algorithms. Problem is i don't know many of tfs functions and parameters and i don't know often how to use them properly to get result i want. When you write own program/game you know all functions etc. cause you're writing all on your own, now I have to use some premade functions that are not so good documented, at least in my tfs folder :<.
 
Last edited:
Thank you ! I love you guys for your support and help :). Maybe there is some site or tutorial with all commands/functions/paramaters like this ? setConditionParam(condition, CONDITION_PARAM_DELAYED, 1),addDamageCondition with explanations, or at least list of all possible functions and parameters? I'm looking in documentation of tfs and i can't find those ;<.
I'm programming for about 2 years, maybe I'm not some pro but i can make easy-medium algorithms. Problem is i don't know many of tfs functions and parameters and i don't know often how to use them properly to get result i want. When you write own program/game you know all functions etc. cause you're writing all on your own, now I have to use some premade functions that are not so good documented, at least in my tfs folder :<.

They are indeed in the documentations under the name LUA_FUNCTIONS. Many parameters are self explanatory due to their name that's written there, but if you can't understand some function, ask here. Good idea is also to look at scripts of some other spells/items that make a similar effect and copy and edit parts of the scripts. In your case, this would be the Soulfire Rune (which makes a player burn).
 
Okay i have in LUA_FUNCTIONS something like this: setConditionParam(condition, key, value)
But where is a list of possible conditions for this function ? And I am checking other spells, scripts etc to get my own, but when you're beginner and wanna make something more advanced you can get confused sometimes and need help :). Anyway thanks for advice :).
 
Okay i wrote script but it does not work properly (as always) ;d. Here is it:
Lua:
    local skill_level = getPlayerStorageValue(cid, 9002)
     
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITBYFIRE)
     
    local condition = createConditionObject(CONDITION_FIRE)
    setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
     
    if skill_level == 1 then
        addDamageCondition(condition, 3, 5000, -10)
    elseif skill_level == 2 then
        addDamageCondition(condition, 4, 5000, -10)
    elseif skill_level == 3 then
        addDamageCondition(condition, 4, 5000, -15)
    elseif skill_level == 4 then
        addDamageCondition(condition, 5, 5000, -15)
    end
     
    setCombatCondition(combat, condition)
     
    function onCastSpell(cid, var)
        return doCombat(cid, combat, var)
    end

Problem is the spell is casting but monsters dont get any damage and don't start to burn. What's wrong ?
 
You have to create 4 combat objects, each with a different damagecondition and in the actuall function onCastSpell you have to decide which combat to execute with doCombat.
 
Back
Top