• 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 on the Player

lazarus321

Member
Joined
May 8, 2017
Messages
222
Reaction score
23
hi, i have this script with damage in area, i want this effect comes out of the player and not the creature. Any help? server tfs1.3.


local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

function onGetFormulaValues(player, level, magicLevel)
local min = (level / 5) + (magicLevel * 5) + 25
local max = (level / 5) + (magicLevel * 6.2) + 45
return -min, -max
end

-- combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onUseWeapon(player, variant)
local playerPos = player:getPosition()
return combat:execute(player, variant)
end
 
Under:
Code:
local PlayerPos = player:getPosition()

Add:
Code:
PlayerPos:sendMagicEffect( EFFECT NUMBER )

If you want to remove the common spell effect just simply change:
Code:
CONST_ME_HOLYAREA
to:
Code:
CONST_ME_NONE
 
This line says everything:
LUA:
combat:setArea(createCombatArea(AREA_SQUARE1X1))

AREA_SQUARE1X1 - it means that the area, which a spell reaches, is 1 sqm in every direction.
You can set it up to :
LUA:
AREA_SQUARE3X3
Now 3 sqm

B.t.w it's a weapon spell, so it will be always shown on the target.
 
Back
Top