- Joined
- Dec 25, 2018
- Messages
- 110
I am using projectile skillshot system I found on this forum but I am having a problem when theres multiple projectiles at once.
Example:
-Spell 1 has speed of 50
-Spell 2 has speed of 10
If spell 1 is still in air and spell 2 is casted, then spell 2 gains speed values of spell 1.
Triggers:
Issue is propably with SS_Move, but even with
set udg_SS_Move[udg_SS_iC] = PolarProjectionBJ(udg_SS_mLoc[udg_SS_iC], 50.00, udg_SS_Angle[udg_SS_iC])
call SetUnitPositionLoc( udg_SS_Missle[udg_SS_iC], udg_SS_Move[udg_SS_iC] )
bug still occured.
Example:
-Spell 1 has speed of 50
-Spell 2 has speed of 10
If spell 1 is still in air and spell 2 is casted, then spell 2 gains speed values of spell 1.
Triggers:
-
INIT
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to ability
-
Actions
- Set SS_iM = (SS_iM + 1)
- Set SS_Caster[SS_iM] = (Triggering unit)
- Set SS_Player[SS_iM] = (Owner of SS_Caster[SS_iM])
- Set SS_aLevel[SS_iM] = (Level of SS_AbilityDamage for SS_Caster[SS_iM])
- Set SS_MissleSpeed[SS_iM] = 50.00
- Set SS_cLoc[SS_iM] = (Position of SS_Caster[SS_iM])
- Set SS_tLoc[SS_iM] = (Target point of ability being cast)
- Set SS_Angle[SS_iM] = (Angle from SS_cLoc[SS_iM] to SS_tLoc[SS_iM])
- Set SS_rLoc[SS_iM] = (SS_cLoc[SS_iM] offset by 1900.00 towards SS_Angle[SS_iM] degrees)
- Unit - Create 1 SS_Dummy for SS_Player[SS_iM] at SS_cLoc[SS_iM] facing SS_Angle[SS_iM] degrees
- Unit - Set Max HP of (Last created unit) to ((Intelligence of SS_Caster[SS_iM] (Include bonuses)) x 3)
- Set SS_Missle[SS_iM] = (Last created unit)
- Animation - Change SS_Missle[SS_iM]'s size to (SS_MissleSize%, SS_MissleSize%, SS_MissleSize%) of its original size
- Special Effect - Create a special effect attached to the chest of SS_Missle[SS_iM] using Abilities\Weapons\NecromancerMissile\NecromancerMissile.mdl
- Set SS_SFX[SS_iM] = (Last created special effect)
- Set SS_mLoc[SS_iM] = (Position of SS_Missle[SS_iM])
- Set SS_Distance[SS_iM] = (Distance between SS_mLoc[SS_iM] and SS_rLoc[SS_iM])
- Animation - Change SS_Missle[SS_iM] flying height to SS_MissleHeight at 0.00
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SS_iM Equal to 1
-
Then - Actions
- Trigger - Turn on Curse Loop <gen>
- Else - Actions
-
If - Conditions
-
Events
-
LOOP
-
Events
- Time - Every 0.03 seconds of game time
- Conditions
-
Actions
-
For each (Integer SS_iC) from 1 to SS_iM, do (Actions)
-
Loop - Actions
- Set SS_Move = (SS_mLoc[SS_iC] offset by SS_MissleSpeed[SS_iM] towards SS_Angle[SS_iC] degrees)
- Unit - Move SS_Missle[SS_iC] instantly to SS_Move
- Custom script: call RemoveLocation (udg_SS_mLoc[udg_SS_iC])
- Set SS_mLoc[SS_iC] = (Position of SS_Missle[SS_iC])
- Set SS_Distance[SS_iC] = (Distance between SS_mLoc[SS_iC] and SS_rLoc[SS_iC])
- Custom script: set bj_wantDestroyGroup = true
-
Unit Group - Pick every unit in (Units within SS_MissleAoE of SS_mLoc[SS_iC]) and do (Actions)
-
Loop - Actions
- Set SS_eUnit = (Picked unit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (SS_eUnit belongs to an enemy of SS_Player[SS_iC]) Equal to True
- (SS_eUnit is alive) Equal to True
- (SS_eUnit is Magic Immune) Equal to False
- (SS_eUnit is A structure) Equal to False
-
Then - Actions
- Unit Group - Add SS_eUnit to SS_Group
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- SS_Distance[SS_iC] Less than or equal to SS_MissleAoE
- (SS_Group is empty) Equal to False
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (SS_Group is empty) Equal to True
-
Then - Actions
- Special Effect - Create a special effect at SS_mLoc[SS_iC] using Abilities\Weapons\BansheeMissile\BansheeMissile.mdl
- Special Effect - Destroy (Last created special effect)
-
Else - Actions
-
Unit Group - Pick every unit in SS_Group and do (Actions)
-
Loop - Actions
- Set SS_eUnit = (Picked unit)
- Special Effect - Create a special effect attached to the SS_MissleHit_AP of SS_eUnit using Abilities\Weapons\BansheeMissile\BansheeMissile.mdl
- Special Effect - Destroy (Last created special effect)
- Unit - Cause SS_Missle[SS_iM] to damage SS_eUnit, dealing (Max life of SS_Missle[SS_iM]) damage of attack type Normal and damage type Normal
- Unit Group - Remove SS_eUnit from SS_Group
-
Loop - Actions
-
Unit Group - Pick every unit in SS_Group and do (Actions)
-
If - Conditions
- Custom script: call RemoveLocation (udg_SS_rLoc[udg_SS_iC])
- Custom script: call RemoveLocation (udg_SS_tLoc[udg_SS_iC])
- Custom script: call RemoveLocation (udg_SS_cLoc[udg_SS_iC])
- Custom script: call RemoveLocation (udg_SS_mLoc[udg_SS_iC])
- Special Effect - Destroy SS_SFX[SS_iC]
- Unit - Remove SS_Missle[SS_iC] from the game
- Set SS_Caster[SS_iC] = SS_Caster[SS_iM]
- Set SS_Player[SS_iC] = SS_Player[SS_iM]
- Set SS_aLevel[SS_iC] = SS_aLevel[SS_iM]
- Set SS_cLoc[SS_iC] = SS_cLoc[SS_iM]
- Set SS_tLoc[SS_iC] = SS_tLoc[SS_iM]
- Set SS_Angle[SS_iC] = SS_Angle[SS_iM]
- Set SS_rLoc[SS_iC] = SS_rLoc[SS_iM]
- Set SS_Missle[SS_iC] = SS_Missle[SS_iM]
- Set SS_SFX[SS_iC] = SS_SFX[SS_iM]
- Set SS_mLoc[SS_iC] = SS_mLoc[SS_iM]
- Set SS_Distance[SS_iC] = SS_Distance[SS_iM]
- Set SS_iM = (SS_iM - 1)
- Set SS_iC = (SS_iC - 1)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- SS_iM Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
Loop - Actions
-
For each (Integer SS_iC) from 1 to SS_iM, do (Actions)
-
Events
Issue is propably with SS_Move, but even with
set udg_SS_Move[udg_SS_iC] = PolarProjectionBJ(udg_SS_mLoc[udg_SS_iC], 50.00, udg_SS_Angle[udg_SS_iC])
call SetUnitPositionLoc( udg_SS_Missle[udg_SS_iC], udg_SS_Move[udg_SS_iC] )
bug still occured.
Last edited: