[General] Skillshot in cone

Status
Not open for further replies.
Level 5
Joined
Dec 25, 2018
Messages
110
I want my hero to throw 3 projectiles in a cone, something like this:
upload_2019-12-18_13-15-1.png

I tried doing it like this:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Facing of SS_Caster[SS_iM]) Less than or equal to 360.00
              • (Facing of SS_Caster[SS_iM]) Greater than or equal to 300.00
          • And - All (Conditions) are true
            • Conditions
              • (Facing of SS_Caster[SS_iM]) Greater than or equal to 150.00
              • (Facing of SS_Caster[SS_iM]) Less than or equal to 250.00
    • Then - Actions
      • Set SS_tLoc[SS_iM] = (PositionOfChargedSpell[(Player number of (Owner of (Triggering unit)))] offset by (0.00, -130.00))
    • Else - Actions
      • Set SS_tLoc[SS_iM] = (PositionOfChargedSpell[(Player number of (Owner of (Triggering unit)))] offset by (-130.00, 0.00))
But that's not consistent, does anyone know smarter way to do it?
 
Level 24
Joined
Nov 9, 2006
Messages
2,561
This method is the most flexible.
Ignore the leaks and obvious shit.
  • Melee Initialization
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shockwave
    • Actions
      • Set ConeWidth = 90.00
      • Set Projectiles = 3
      • Set ConeWidthSpread = (ConeWidth / (Real(Projectiles)))
      • Set TemporaryReal = ((Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) - (ConeWidth / 2.00))
      • For each (Integer A) from 1 to Projectiles, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at ((Position of (Triggering unit)) facing (Angle from (Position of (Triggering unit)) to (Target point of ability being cast)) degrees
          • Unit - Add Shockwave to (Last created unit)
          • Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave ((Position of (Triggering unit)) offset by 600.00 towards TemporaryReal degrees)
          • Set TemporaryReal = (TemporaryReal + ConeWidthSpread)
 
Status
Not open for further replies.
Top