• 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

New Member
Joined
May 30, 2018
Messages
33
Reaction score
4
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.

Nekiro

Legendary OT User
TFS Developer
Joined
Sep 7, 2015
Messages
2,510
Solutions
116
Reaction score
1,772
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

Xikini

I whore myself out for likes
Support Team
Joined
Nov 17, 2010
Messages
5,672
Solutions
406
Reaction score
3,786
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()))
 
OP
OP
A

Allan Silva

New Member
Joined
May 30, 2018
Messages
33
Reaction score
4
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
 
Top