[poor solution]
-
Set BS_Caster = (Triggering unit)
-
Set BS_CasterLoc = (Position of BS_Caster)
-
Set BS_Target = (Target point of ability being cast)
-
Set BS_Angle = (Angle from BS_CasterLoc to BS_Target)
-
Unit - Create 1 Dummy for (Triggering player) at BS_CasterLoc facing (Facing of BS_Caster) degrees
-
Custom script: call RemoveLocation(udg_BS_CasterLoc)
-->
[better solution]
[This is very useful if you have multiple locations]
[All solver with only one real array variable ™ as you can see
-
Set BS_Caster = (Triggering unit)
-
Custom script: set udg_BS_X[0] = GetUnitX(udg_BS_Caster)
-
Custom script: set udg_BS_Y[0] = GetUnitY(udg_BS_Caster)
-
Custom script: set udg_BS_X[1] = GetSpellTargetX()
-
Custom script: set udg_BS_Y[1] = GetSpellTargetY()
-
Set BS_Angle = (Atan2((BS_Y[0] - BS_Y[1]), (BS_X[0] - BS_X[1])))
-
Unit - Create 1 Dummy for (Triggering player) at (Point(BS_X[0], BS_Y[0])) facing BS_Angle degrees
-
-------- or --------
-
Custom script: set udg_BS_Dummy = CreateUnit( GetTriggerPlayer(), 'h000', udg_BS_X[0], udg_BS_Y[0], udg_BS_Angle )
[means you do not need two stupid location]
[Also, the same goes for the other trigger] (replace the stupid location)
[Oh yes spell must be MUI]
I'll post them, if it gets approved. Don't want to spam with wrong triggers in the worst case.
How do you expect someone to help you if you do not see the trigger
So, always post the trigger!
If you want to have more units around the hero
-
Example 1
-
Events
-
Conditions
-
Actions
-
Hashtable - Create a hashtable
-
Set BounceTable = (Last created hashtable)
-
-------- --- --------
-
Set BS_AbilCode = Bouncing Shot
-
-------- --- --------
-
Set BS_UnitTypeId = Dummy
-
-------- --- --------
-
Set BS_EffectCount[1] = 3
-
Set BS_EffectCount[2] = 6
-
Set BS_EffectCount[3] = 9
-
Set BS_EffectCount[4] = 12
-
-------- --- --------
-
Set BS_Distance[1] = 100.00
-
Set BS_Distance[2] = 200.00
-
Set BS_Distance[3] = 300.00
-
Set BS_Distance[4] = 400.00
-
-------- --- --------
-
Custom script: call ExecuteFunc( "InitExample1" )
-
Custom script: endfunction
-
-------- --- --------
-
Custom script: function Example1Actions takes nothing returns boolean
-
-------- --- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Ability being cast) Equal to BS_AbilCode
-
Then - Actions
-
Set BS_Caster = (Triggering unit)
-
Set BS_AbilLevel = (Level of BS_AbilCode for BS_Caster)
-
Custom script: set udg_BS_X[0] = GetUnitX(udg_BS_Caster)
-
Custom script: set udg_BS_Y[0] = GetUnitY(udg_BS_Caster)
-
-------- --- --------
-
For each (Integer BS_IndexA) from 1 to BS_EffectCount[BS_AbilLevel], do (Actions)
-
Loop - Actions
-
Set BS_X[BS_IndexA] = (BS_X[0] + (BS_Distance[BS_AbilLevel] x (Cos(((360.00 / (Real(BS_EffectCount[BS_AbilLevel]))) x (Real(BS_IndexA)))))))
-
Set BS_Y[BS_IndexA] = (BS_Y[0] + (BS_Distance[BS_AbilLevel] x (Sin(((360.00 / (Real(BS_EffectCount[BS_AbilLevel]))) x (Real(BS_IndexA)))))))
-
Set DS_Angle = (Atan2((BS_Y[0] - BS_Y[BS_IndexA]), (BS_X[0] - BS_X[BS_IndexA])))
-
Unit - Create 1 BS_UnitTypeId for (Triggering player) at (Point(BS_X[BS_IndexA], BS_Y[BS_IndexA])) facing DS_Angle degrees
-
Else - Actions
-
-------- --- --------
-
Custom script: return false
-
-------- --- --------
-
Custom script: endfunction
-
-------- --- --------
-
Custom script: function InitExample1 takes nothing returns nothing
-
Custom script: local trigger t = CreateTrigger()
-
Custom script: call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
-
Custom script: call TriggerAddCondition( t, Condition( function Example1Actions ) )
-
Custom script: set t = null
If you want to have more units around the target point
-
Example 2
-
Events
-
Conditions
-
Actions
-
Hashtable - Create a hashtable
-
Set BounceTable = (Last created hashtable)
-
-------- --- --------
-
Set BS_AbilCode = Bouncing Shot
-
-------- --- --------
-
Set BS_UnitTypeId = Dummy
-
-------- --- --------
-
Set BS_EffectCount[1] = 3
-
Set BS_EffectCount[2] = 6
-
Set BS_EffectCount[3] = 9
-
Set BS_EffectCount[4] = 12
-
-------- --- --------
-
Set BS_Distance[1] = 100.00
-
Set BS_Distance[2] = 200.00
-
Set BS_Distance[3] = 300.00
-
Set BS_Distance[4] = 400.00
-
-------- --- --------
-
Custom script: call ExecuteFunc( "InitExample2" )
-
Custom script: endfunction
-
-------- --- --------
-
Custom script: function Example2Actions takes nothing returns boolean
-
-------- --- --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Ability being cast) Equal to BS_AbilCode
-
Then - Actions
-
Set BS_Caster = (Triggering unit)
-
Set BS_AbilLevel = (Level of BS_AbilCode for BS_Caster)
-
Custom script: set udg_BS_X[0] = GetSpellTargetX()
-
Custom script: set udg_BS_Y[0] = GetSpellTargetY()
-
-------- --- --------
-
For each (Integer BS_IndexA) from 1 to BS_EffectCount[BS_AbilLevel], do (Actions)
-
Loop - Actions
-
Set BS_X[BS_IndexA] = (BS_X[0] + (BS_Distance[BS_AbilLevel] x (Cos(((360.00 / (Real(BS_EffectCount[BS_AbilLevel]))) x (Real(BS_IndexA)))))))
-
Set BS_Y[BS_IndexA] = (BS_Y[0] + (BS_Distance[BS_AbilLevel] x (Sin(((360.00 / (Real(BS_EffectCount[BS_AbilLevel]))) x (Real(BS_IndexA)))))))
-
Set DS_Angle = (Atan2((BS_Y[0] - BS_Y[BS_IndexA]), (BS_X[0] - BS_X[BS_IndexA])))
-
Unit - Create 1 BS_UnitTypeId for (Triggering player) at (Point(BS_X[BS_IndexA], BS_Y[BS_IndexA])) facing DS_Angle degrees
-
Else - Actions
-
-------- --- --------
-
Custom script: return false
-
-------- --- --------
-
Custom script: endfunction
-
-------- --- --------
-
Custom script: function InitExample2 takes nothing returns nothing
-
Custom script: local trigger t = CreateTrigger()
-
Custom script: call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
-
Custom script: call TriggerAddCondition( t, Condition( function Example2Actions ) )
-
Custom script: set t = null
And we can do this all day hah...blahh
I gave you some examples
And you just plug the imagination and that's it
I forgot to say.
You do not have to use this method
Simply use the normal method
-
Example 1 Cast
-
Events
-
Unit - A unit Starts the effect of an ability
-
Conditions
-
(Ability being cast) Equal to Bouncing Shot
-
Actions
-
-------- bla,bla --------
-
Example 1 Loop
-
Events
-
Time - Every 0.03 seconds of game time
-
Conditions
-
Actions
-
-------- bla,bla --------
In this case, this is going to map init
-
Map Init
-
Events
-
Conditions
-
Actions
-
Hashtable - Create a hashtable
-
Set BounceTable = (Last created hashtable)
-
-------- --- --------
-
Set BS_AbilCode = Bouncing Shot
-
-------- --- --------
-
Set BS_UnitTypeId = Peasant
-
-------- --- --------
-
Set BS_EffectCount[1] = 3
-
Set BS_EffectCount[2] = 6
-
Set BS_EffectCount[3] = 9
-
Set BS_EffectCount[4] = 12
-
-------- --- --------
-
Set BS_Distance[1] = 100.00
-
Set BS_Distance[2] = 200.00
-
Set BS_Distance[3] = 300.00
-
Set BS_Distance[4] = 400.00
-
-------- --- --------
And now I have to go because I'm on some stupid picnic
The battery of the laptop is at the very end
Shit, 300 kilometers away from home...
Just to even up a serial killer and that's it ... hahahahahahah ... omg...who the fuck is this !!!