• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

I want to add DOT to certain weapons in TFS 1.4.2(Solved)

crispy_256

New Member
Joined
Sep 18, 2014
Messages
10
Reaction score
1
I'm wanting to add poison DOT to things like the poison dagger and the serpent sword, along with a fire DOT with the fire sword...things like that. I'm using a pre compiled TFS 1.4.2. I've tried lots of different ways to do it, but does anyone have some advice, or can you at least tell me if it's not possible without compiling my own version of TFS?
 
Sorry, I'm just not sure where I'm supposed to put that, like which Lua should I edit/create and where should I place it? Sorry, I'm still pretty new at this
you might try starting with a lua script in the weapons folder? If you are not at all going to even try then you are going to get no where as no one will help you... and this is the most basic kind of question you could ask... you didn't even search the forums clearly... like dude... there is an ots guide at the top, a lua guide at the top, a whole tutorials section....
 
you might try starting with a lua script in the weapons folder? If you are not at all going to even try then you are going to get no where as no one will help you... and this is the most basic kind of question you could ask... you didn't even search the forums clearly... like dude... there is an ots guide at the top, a lua guide at the top, a whole tutorials section....
Wow, dude...you don't have to help. I DID try an Lua in my weapons folder, it didn't work, but maybe I messed something up...I might be able to figure it out...but I'd rather know I was working in the right place because i was also trying around in creaturescripts...but like I said...I'm new at all of this...thanks for the advice...I'm sure a lot of it is basic to you, but this is my second week of tinkering around
 
take a look on how poison arrow works

LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0)

function onUseWeapon(player, variant)
    if not combat:execute(player, variant) then
        return false
    end

    player:addDamageCondition(Creature(variant:getNumber()), CONDITION_POISON, DAMAGELIST_LOGARITHMIC_DAMAGE, 3)
    return true
end

now just add the correct item id on weapons.xml and it should work

Code:
<melee id="26806" unproperly="1" level="100" script="weapons/warrior_sword.lua">
    <vocation name="Knight" />
</melee>
 
take a look on how poison arrow works

LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_POISONARROW)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0)

function onUseWeapon(player, variant)
    if not combat:execute(player, variant) then
        return false
    end

    player:addDamageCondition(Creature(variant:getNumber()), CONDITION_POISON, DAMAGELIST_LOGARITHMIC_DAMAGE, 3)
    return true
end

now just add the correct item id on weapons.xml and it should work

Code:
<melee id="26806" unproperly="1" level="100" script="weapons/warrior_sword.lua">
    <vocation name="Knight" />
</melee>
The only thing that I had to do differently than what you had was take out the weapons/ before the lua....I really thought I had tried this first like 2 days ago...I must have had a typo somewhere...because now it works just fine. Thanks for your help.
 
I'm wanting to add poison DOT to things like the poison dagger and the serpent sword, along with a fire DOT with the fire sword...things like that. I'm using a pre compiled TFS 1.4.2. I've tried lots of different ways to do it, but does anyone have some advice, or can you at least tell me if it's not possible without compiling my own version of TFS?
Did you figure it out with the other damage types as well? I was thinking of doing the same. In the same boat as you, tinkering around for a couple of weeks and just learning/absorbing as much as possible
 
Back
Top