• 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!

direction to instant attack spells ?

CipsoftStinks

www.relicaria.com
Joined
Oct 1, 2016
Messages
947
Solutions
3
Reaction score
137
Location
Argentina
Hello i want to edit sources or if it's possible from lua

how i can give direction to instant attacks spells such as exori vis flam etc? im using
a server 7.x

i want that if a monster is tarjeted the instant attack spells hit the monsters
to avoid missing/fail when shooting these spells
 
Last edited:
Solution
Hey sorry man I was asleep before you replied last night then had class this morning. Try using my LUA script still, but in your xml change
Code:
direction="1"
to
Code:
casterTargetOrDirection="1"
yours is set as "direction" meaning that it will only cast in front of the player, no matter what you do (just like e-wave, fire wave, e-beam, etc).

casterTargetOrDirection will let the spell hit whatever you are targeted. The LUA scipt outlines both combat modes for distance combat (with a target) and regular combat (without a target).

Let me know.
How do you mean? Like the spell casts in the direction your character is facing?
Also what type of server? OTHire? Avesta? TFS?
im using tfs in old version the instant /attack spells aren't tarjeted directly to the monster you have to face him
i want that doesn't matter were player is viewing if the player have the monster tarjeted the spell will hit the monster
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_TELEPORT)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.4, 0, -0.5, 0)

local distanceCombat = createCombatObject()
setCombatParam(distanceCombat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(distanceCombat, COMBAT_PARAM_EFFECT, CONST_ME_TELEPORT)
setCombatParam(distanceCombat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(distanceCombat, COMBAT_FORMULA_LEVELMAGIC, -0.4, 0, -0.5, 0)

function onCastSpell(cid, var)
    if(variantToNumber(var) ~= 0) then
        return doCombat(cid, distanceCombat, var)
    end
    return doCombat(cid, combat, var)
end

Use this. If no monster is targeted, the spell will appear in front of the player (the way your char is facing) If you are targeting a monster, the spell will hit the monster.
 
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_TELEPORT)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.4, 0, -0.5, 0)

local distanceCombat = createCombatObject()
setCombatParam(distanceCombat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(distanceCombat, COMBAT_PARAM_EFFECT, CONST_ME_TELEPORT)
setCombatParam(distanceCombat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
setCombatFormula(distanceCombat, COMBAT_FORMULA_LEVELMAGIC, -0.4, 0, -0.5, 0)

function onCastSpell(cid, var)
    if(variantToNumber(var) ~= 0) then
        return doCombat(cid, distanceCombat, var)
    end
    return doCombat(cid, combat, var)
end

Use this. If no monster is targeted, the spell will appear in front of the player (the way your char is facing) If you are targeting a monster, the spell will hit the monster.

not working mate i tried these formulas from 8.x :c

thanks anyway :)




anyone knows a way or source editing? just for the instant attack spells
 
Ahh ok well now I know what rev you are using. One last thing to check, do me a favor and post the .xml for energy strike, and the LUA script you are using.
 
Last edited:
im using now the script lua that you gave me
but i was using
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_TELEPORT)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.25, -0, -0.55, 0)

local arr = {
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 0, 0},
{0, 3, 0}
}

local area = createCombatArea(arr)
setCombatArea(combat, area)

function onCastSpell(cid, var)
    return doCombat(cid, combat, var)
end

<instant name="Energy Strike" words="exori vis" mana="20" maglv="3" prem="0" direction="1" blockwalls="1" exhaustion="1000" needlearn="0" event="script" value="attack/energy strike.lua">
 
Hey sorry man I was asleep before you replied last night then had class this morning. Try using my LUA script still, but in your xml change
Code:
direction="1"
to
Code:
casterTargetOrDirection="1"
yours is set as "direction" meaning that it will only cast in front of the player, no matter what you do (just like e-wave, fire wave, e-beam, etc).

casterTargetOrDirection will let the spell hit whatever you are targeted. The LUA scipt outlines both combat modes for distance combat (with a target) and regular combat (without a target).

Let me know.
 
Last edited:
Solution
Back
Top