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

Lua Change all the damage output to elemental damage if a weapon is equiped

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,713
Solutions
31
Reaction score
965
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
Hi everyone,

I'm using TFS 1.5 (Nekiro downgrade) and need some help implementing a specific mechanic:

  • If a player equips a weapon from a certain group (IDs: 7862, 7863, 7864), all their damage output (spells, hits, etc., excluding healing) should be converted to FIRE damage.
  • Similarly, if a player equips a weapon from another group (IDs: 7872, 7873, 7874), all their damage output should convert to ENERGY damage.
Does anyone have ideas or examples on how to achieve this? Any guidance or code snippets would be greatly appreciated!

Thanks in advance! 😊
Post automatically merged:

Figured out how! Just added this script to each fire weapon
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)
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

    if math.random(1, 100) <= 90 then
        return false
    end

    player:addDamageCondition(Creature(variant:getNumber()), CONDITION_FIRE, DAMAGELIST_LOGARITHMIC_DAMAGE, 2)
    return true
end

Which is the same that is used on viper stars, it just need a change in the element.
But I still wonder, how would be to convert the spell damage output too?

Thanks in advance!
 
Last edited:
Back
Top