• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

How spell know where to deal damage ?

BulawOw

Soul of Shinobi
Joined
Sep 15, 2014
Messages
204
Solutions
8
Reaction score
62
LUA:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_ENERGYAREA)
combat:setArea(createCombatArea(AREA_BEAM8))

function onGetFormulaValues(player, level, magicLevel)
    local min = (level / 5) + (magicLevel * 3.6) + 22
    local max = (level / 5) + (magicLevel * 6) + 37
    return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(creature, variant)
    return combat:execute(creature, variant)
end

Example with great enerby beam/exevo gran vis lux
This spell is casted in dir where the player is looking but where in the code it knows which way the player is looking i dont rly get it
 
I believe it's in spells.xml, I think it's direction="1" or something
LUA:
<instant group="attack" spellid="23" name="Great Energy Beam" words="exevo gran vis lux" level="29" mana="110" direction="1" cooldown="6000" groupcooldown="2000" needlearn="0" script="attack/great_energy_beam.lua">
        <vocation name="Sorcerer" />
        <vocation name="Master Sorcerer" />
    </instant>

Ok got it so if its 1 then its gonna return the dmg the way player is looking but if its 0 its just gonna cast it like it is set up in script right ?
 
Back
Top