• 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.X+ Effect weapon Attack

Allan Silva

Member
Joined
May 30, 2018
Messages
39
Solutions
1
Reaction score
7
I'm trying to modify weapon effect attack. I would like to make the basic attack have the same effect exori. However I can only do "exori hit" feat around the monster instead of around the character, as shown in the image. I send the used code. I would like to make the hit area around the character instead of the creature.

1616623029704.png

Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setFormula(COMBAT_FORMULA_SKILL, 0, 0, 1, 0)

arr = {
{1, 1, 1},
{1, 3, 1},
{1, 1, 1}
}

local club = Weapon(WEAPON_CLUB)

local area = createCombatArea(arr)
    combat:setArea(area)
   
function club.onUseWeapon(creature, var)
    return combat:execute(creature, var)
end

club:id(2321)
club:wieldUnproperly(true)
club:register()

I'm using TFS 1.3
Thanks XD
 
Solution
Lua:
function club.onUseWeapon(creature, var)
    return combat:execute(creature, Variant(creature:getPosition()))
end
If this does not the trick, then you can create second combat and execute it on yourself instead of adding area to the combat executing on target.
Lua:
function club.onUseWeapon(creature, var)
    return combat:execute(creature, Variant(creature:getPosition()))
end
If this does not the trick, then you can create second combat and execute it on yourself instead of adding area to the combat executing on target.
 
Last edited:
Solution
Lua:
function club.onUseWeapon(creature, var)
    return combat:execute(creature, Variant(creature:getPosition))
end
If this does not the trick, then you can create second combat and execute it on yourself instead of adding area to the combat executing on target.

Hi Nekiro, I replaced the code and now i got this error

Lua:
data\scripts\weapons\scripts\club.lua:19: function arguments expected near ')'

Thanks to try help me XD
 
Hi Nekiro, I replaced the code and now i got this error

Lua:
data\scripts\weapons\scripts\club.lua:19: function arguments expected near ')'

Thanks to try help me XD
change
Lua:
return combat:execute(creature, Variant(creature:getPosition))
return combat:execute(creature, Variant(creature:getPosition()))
 
Back
Top