• 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+ Offset effect

Michcol94

Member
Joined
Sep 2, 2021
Messages
105
Reaction score
18
How to center graphics?

Bez tytułu.png
Post automatically merged:

Resolved
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_USECHARGES, true)
combat:setArea(createCombatArea(AREA_SQUARE1X1))

function onGetFormulaValues(player, skill, attack, factor)
    local min = (player:getLevel() / 5) + (skill * attack * 0.03) + 7
    local max = (player:getLevel() / 5) + (skill * attack * 0.05) + 11
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    local pos = creature:getPosition()
Position(pos.x + 5, pos.y + 5. pos.z):sendMagicEffect(154)
    return combat:execute(creature, variant)
end
 
Last edited:
Lua:
function onCastSpell(creature, variant)
local offset = Position(creature:getPosition().x + 2, creature:getPosition().y+2, creature:getPosition().z)
        offset:sendMagicEffect(154)
      
        creature:say("explosion", TALKTYPE_MONSTER_SAY)
      
    return combat:execute(creature, variant)
end
 
Back
Top