Tried to look for something similar but no luck. I'm doing a basic IA which do certain spells at certain moments.
Usually, for 'Unit is issued order targeting a point' actions, i take the position (point variable) of the enemy and order the unit cast targeting that position (works fine).
The problem comes with the point variable. When i order the unit cast the spell, obviously takes the point as the center of the AOE. That's a problem when the enemy is closer to the caster and the spell can damage the caster too.
What i need is move the position of the point variable to avoid damage the caster when the enemy is close. I know i should do something with offsets, but i have no idea what
I attached a image 'explaining' what i want
This is an example of what i have...
Usually, for 'Unit is issued order targeting a point' actions, i take the position (point variable) of the enemy and order the unit cast targeting that position (works fine).
The problem comes with the point variable. When i order the unit cast the spell, obviously takes the point as the center of the AOE. That's a problem when the enemy is closer to the caster and the spell can damage the caster too.
What i need is move the position of the point variable to avoid damage the caster when the enemy is close. I know i should do something with offsets, but i have no idea what
I attached a image 'explaining' what i want
This is an example of what i have...
-
Cast FlameStrike Example
-

Acontecimientos
-

Condiciones
-

Acciones
-


-------- Vanilla World Edit In Spanish --------
-


-------- ------------------------------------------- --------
-


-------- In my map, i set two unit variables. Each one represent the selected hero (It's a 1v1 map). I use them for many things --------
-


-------- (I'm just picking two specific unit for this example) --------
-


-------- ------------------------------------------- --------
-


Set Caster = Mago sanguinario 0000 <gen>
-


Set Enemy = Rey de la Montaña 0001 <gen>
-


-------- ------------------------------------------- --------
-


-------- Setting points --------
-


-------- ------------------------------------------- --------
-


Set Caster_Point = (Position of Caster)
-


Set Target_Point = (Position of Enemy)
-


-------- ------------------------------------------- --------
-


-------- (200 is the default range for flamestrike) --------
-


-------- (Mayor que would be 'Greater than') --------
-


-------- (To keep the example simple, let's assume that the ability is always ready to use) --------
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



Si: Condiciones
-




(Distance between Caster_Point and Target_Point) Mayor que 200.00
-
-



Entonces: Acciones
-




-------- Cast Llamarada (Flamestrike) with no problem --------
-




Unidad - Order Caster to Humano mago sanguinario - Llamarada Target_Point
-
-



Otros: Acciones
-




-------- Here is where i don't know what to do. I'm sure i'm have to do something with offsets. But no idea what calculate --------
-
-
-


-------- Removing Point Leaks --------
-


Custom script: call RemoveLocation (udg_Caster_Point)
-


Custom script: call RemoveLocation (udg_Target_Point)
-
-