• 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 Executing Summon Spells

mackerel

Well-Known Member
Joined
Apr 26, 2017
Messages
398
Solutions
18
Reaction score
72
I've been trying countless times to fix the issue with the summon spells (executed by players) in where they first have to get close to the target/hit them in order for the spell to work perfectly.

So here what happens:

1. Player executes target spell to make summons attack (NO DAMAGE)

oqB33xe.png



2. Summons attack nearby target

u1CxckQ.png



3. Player executes target spell again to make summons attack, this time the damage is there

6qFpvCc.png


I really do not know what is wrong other than thinking that something has to be updated within the source code but it could also be something small I have missed in LUA.

XML:
    <instant name="test" words="test" lvl="0" mana="0" prem="0" needtarget="1" exhaustion="2000" needlearn="0" script="test.lua">
       <vocation name="Royal Paladin"/>
   </instant>

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

function onGetFormulaValues(player, level, maglevel)
    local min = (level / 5) + (maglevel * 2.4) + 7
    local max = (level / 5) + (maglevel * 4) + 12
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, var)
    local player = Player(creature)
    local summons = player:getSummons()

    for i = 1, #summons do
        combat:execute(summons[i], var)
    end
    return true
end

My tfs is 1.0, I would appreciate any help

I just want the damage to be there when they first attack the target, no matter the distance |:
 
Last edited:
Back
Top