AoE Shadow Strike Ability. (sort of)

Roku

New Member
Reaction score
3
I've been trying to do this for ages but after failing every time, i thought it was time to ask for help. This is not my first trigger, and not my first map, well still i can't seem to figure it. Basically i would like to request a trigger (GUI or JASS), that would shadow strike all units in a region, that are enemies of Player 12 Brown (computer player). I won't give +rep or anything to posts like "just create a dummy for every unit and order it to blabla", i have tried that and it didn't work. I would need some actual code, that preferably is tested or works 100%. It shouldn't be anything hard. Oh and please say if there are any special things you modified in the ability that relate to the trigger. Thanks in advance.

EDIT: By the way i forgot to mention, that this shouldn't be an on-demand ability issued by a player, it's supposed to be a periodic event that says happens every 15 secs, no matter what.
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
'YourShadowStrike' is the spell casted by your hero
'ShadowStrike' is the dummy spell shadow strike
'YourRect' is the region you want the units to be picked in
ShadowStrikeGroup is obviously a unit group
TempPoint is a point variable

Code:
AoEShadowStrike
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to 'YourShadowStrike'
    Actions
        Set ShadowStrikeGroup = (Units in 'YourRect' ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of Player 12 (Brown)) Equal to True))))
        Unit Group - Pick every unit in ShadowStrikeGroup and do (Actions)
            Loop - Actions
                Set TempPoint = (Position of (Target unit of ability being cast))
                Unit - Create 1 'Dummy' for Player 12 (Brown) at TempPoint facing Default building facing (270.0) degrees
                Unit - Add 'ShadowStrike' to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Picked unit)
                Custom script: call RemoveLocation (udg_TempPoint)
        Custom script: call DestroyGroup (udg_ShadowStrikeGroup)
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
thats bad if you dont know how. actually its pretty easy.
pick everyone in the group (and set the right conditions who is in the group and who not)
then create 1 dummy for every unit in the group.
add an timer against leaks.
the ability you wanna cast.
and finally order the dummy to use his skill.
 

ThePlague

New Member
Reaction score
14
'YourShadowStrike' is the spell casted by your hero
'ShadowStrike' is the dummy spell shadow strike
'YourRect' is the region you want the units to be picked in
ShadowStrikeGroup is obviously a unit group
TempPoint is a point variable

Code:
AoEShadowStrike
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to 'YourShadowStrike'
    Actions
        Set ShadowStrikeGroup = (Units in 'YourRect' ((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of Player 12 (Brown)) Equal to True))))
        Unit Group - Pick every unit in ShadowStrikeGroup and do (Actions)
            Loop - Actions
                Set TempPoint = (Position of (Target unit of ability being cast))
                Unit - Create 1 'Dummy' for Player 12 (Brown) at TempPoint facing Default building facing (270.0) degrees
                Unit - Add 'ShadowStrike' to (Last created unit)
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Picked unit)
                Custom script: call RemoveLocation (udg_TempPoint)
        Custom script: call DestroyGroup (udg_ShadowStrikeGroup)

just a few problems with this
your choosing units in a Rectangle, abilties affect units in a radius also the dummy should be created for the owner of the caster so that they will get exp for the kills

Also it seems he edited his request for a periodic event

Code:
Events
Every 15.00 seconds
Conditions
Actions
set CasterGroup=units in playable map area (matching unit) is alive equal to true and (Level of ShadowStrikeAOE for (matching unit) Equal to 1)
[COLOR="Blue"]      Unit Group - Pick every unit in CasterGroup and do (Actions)
            Loop - Actions
                    set Location=Position of (Picked Unit)
                    set Owner=Owner of (Picked Unit)
                    Set ShadowStrikeGroup = (Units in Within 500 of (Location)((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner) Equal to True))))[/COLOR]
[COLOR="Red"]Unit Group - Pick every unit in (ShadowStrikeGroup) and do (Actions)
                    Loop - Actions
                                Set TempPoint = (Position of (Picked Unit))
                                Unit - Create 1 'Dummy' for (Owner) at TempPoint facing Default building facing (270.0) degrees
                                 Unit - Add 'ShadowStrike' to (Last created unit)
                                 Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                                 Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Picked unit)[/COLOR]
[COLOR="Red"]                         Custom script: call RemoveLocation (udg_TempPoint[/COLOR]
[COLOR="Blue"]                   Custom script: call RemoveLocation (udg_Location)
                    Custom script: call DestroyGroup (udg_ShadowStrikeGroup)[/COLOR]
            Custom script: call DestroyGroup (udg_CasterGroup)
erm this is a bit messy i'll edit it once i see what it looks like to be more readable

ok the Blue Text is part of the first loop
The Red Text is part of the loop within the loop
btw this is completely mui and will shadowstrike all units in a 500 radius of units with the ability 'ShadowStrikeAOE'

Question: Why are the locations and groups being destroyed? They're globals
 

cleeezzz

The Undead Ranger.
Reaction score
268
every single variable you create from the variable editor is a user defined global. hence you must use udg_Point when destroying it. just because its global does not mean it does not leak.

Code:
Events
Every 15.00 seconds
Conditions
Actions
      Set CasterGroup=units in playable map area (matching unit) is alive equal to true and (Level of ShadowStrikeAOE for (matching unit) Equal to 1)
          Unit Group - Pick every unit in CasterGroup and do (Actions)
               Loop - Actions
                    Set Location = Position of (Picked Unit)
                    Set Owner = Owner of (Picked Unit)
                    Set ShadowStrikeGroup = (Units in Within 500 of (Location)((((Matching unit) is alive) Equal to True) and ((((Matching unit) is A structure) Equal to False) and (((Matching unit) belongs to an enemy of (Owner) Equal to True))))
                    Unit Group - Pick every unit in (ShadowStrikeGroup) and do (Actions)
                        Loop - Actions
                              Set TempPoint = (Position of (Picked Unit))
                              Unit - Create 1 'Dummy' for (Owner) at TempPoint facing Default building facing (270.0) degrees
                              Unit - Add 'ShadowStrike' to (Last created unit)
                              Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
                              Unit - Order (Last created unit) to Night Elf Warden - Shadow Strike (Picked unit)
                              Custom script: call RemoveLocation (udg_TempPoint)
                   Custom script: call DestroyGroup (udg_ShadowStrikeGroup)
                   Custom script: call RemoveLocation (udg_Location)
      Custom script: call DestroyGroup (udg_CasterGroup)

(i think it should look more like that, which is what you did, but your colors were still confusing.)
 

ThePlague

New Member
Reaction score
14
Iv never fully understood leaks, but wouldnt the old value be destroyed anyways when it is overwritten?
(I mean I know what leaks are, but I just dont 100% get them)


0o
Ps Love your Archer Wars Map
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top