[Spell] Triggered Locust Swarm

Chocobo

White-Flower
Reaction score
409
For the thread http://www.thehelper.net/forums/showthread.php?t=45018

I made a Triggered Locust Swarm, in which you can refer to each locust unit using [((((Custom value of (Triggering unit)) x 81) + ((<Xst unit) - 1)) mod 81)], I am currently working to get it to work perfectly.

This ability works at half, dummy units never gets removed at end. Someone knows how to do that?

Here is the triggers required :

Code:
Base Trigger
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Triggered Locust Swarm 
    Actions
        Set CurrentRegister = (CurrentRegister + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                CurrentRegister Equal to 101
            Then - Actions
                Set CurrentRegister = 1
            Else - Actions
        Unit - Set the custom value of (Triggering unit) to CurrentRegister
        Set GetTriggerUnit[CurrentRegister] = (Triggering unit)
        -------- MODIFY WHATEVER NOW --------
        Set SwarmAmount[CurrentRegister] = 20
        Set SwarmDelay[CurrentRegister] = 0.03
        Set SwarmTime[CurrentRegister] = 30.00
        Set LifeStole[CurrentRegister] = 0.75
        Set SwarmUnitId[CurrentRegister] = Infestation
        Set SwarmDistance[CurrentRegister] = 1000.00
        Set UsePreAcquirement[CurrentRegister] = True
        Set AcquirementDistance[CurrentRegister] = 0.00
        Set SeekIfBelow[CurrentRegister] = False
        Set PercentageSeekHp[CurrentRegister] = 0.00
        Set SwarmExplodes[CurrentRegister] = False
        -------- DO NOT MODIFY AFTER --------
        For each (Integer A) from 1 to SwarmAmount[(Custom value of (Triggering unit))], do (Actions)
            Loop - Actions
                Set TrgPos[1] = (Position of (Triggering unit))
                Set RReal[1] = (Random real number between (SwarmDistance[(Custom value of (Triggering unit))] x 0.80) and SwarmDistance[(Custom value of (Triggering unit))])
                Set RReal[2] = (Random real number between 0.00 and 359.99)
                Set TrgPos[2] = (TrgPos[1] offset by RReal[1] towards RReal[2] degrees)
                Unit - Create 1 SwarmUnitId[(Custom value of (Triggering unit))] for (Owner of (Triggering unit)) at TrgPos[1] facing TrgPos[2]
                Unit - Order (Last created unit) to Attack-Move To TrgPos[2]
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        SwarmExplodes[(Custom value of (Triggering unit))] Equal to True
                    Then - Actions
                        Unit - Add a (SwarmTime[(Custom value of (Triggering unit))] - (SwarmDelay[(Custom value of (Triggering unit))] x (Real((Integer A))))) second Generic expiration timer to (Last created unit)
                    Else - Actions
                Set SwarmUnits[(((Custom value of (Triggering unit)) x 81) + ((Integer A) - 1))] = (Last created unit)
                Wait SwarmDelay[(Custom value of (Triggering unit))] game-time seconds
        For each (Integer A) from 1 to (Integer((SwarmTime[(Custom value of (Triggering unit))] - (SwarmDelay[(Custom value of (Triggering unit))] x (Real(SwarmAmount[(Custom value of (Triggering unit))])))))), do (Actions)
            Loop - Actions
                Set TrgPos[3] = (Position of (Triggering unit))
                For each (Integer B) from 1 to SwarmAmount[(Custom value of (Triggering unit))], do (Actions)
                    Loop - Actions
                        Set RReal[3] = (Random real number between (SwarmDistance[(Custom value of (Triggering unit))] - (SwarmDistance[(Custom value of (Triggering unit))] x 2.00)) and SwarmDistance[(Custom value of (Triggering unit))])
                        Set RReal[4] = (Random real number between 0.00 and 359.99)
                        Set TrgPos[4] = (TrgPos[3] offset by RReal[3] towards RReal[4] degrees)
                        Set TrgPos[5] = (Position of SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)])
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                And - All (Conditions) are true
                                    Conditions
                                        SeekIfBelow[(Custom value of (Triggering unit))] Equal to False
                                        Or - Any (Conditions) are true
                                            Conditions
                                                (Distance between TrgPos[3] and TrgPos[4]) Greater than or equal to SwarmDistance[(Custom value of (Triggering unit))]
                                                (Distance between TrgPos[3] and TrgPos[5]) Greater than or equal to SwarmDistance[(Custom value of (Triggering unit))]
                            Then - Actions
                                Unit - Order SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)] to Move To TrgPos[3]
                            Else - Actions
                                Unit - Order SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)] to Attack-Move To TrgPos[4]
                Wait 1.00 game-time seconds
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Triggering unit) is dead) Equal to True
                    Then - Actions
                        For each (Integer B) from 1 to SwarmAmount[(Custom value of (Triggering unit))], do (Actions)
                            Loop - Actions
                                Unit - Kill SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)]
                        Skip remaining actions
                    Else - Actions
        For each (Integer A) from 1 to SwarmAmount[(Custom value of (Triggering unit))], do (Actions)
            Loop - Actions
                Set TrgPos[6] = (Position of (Triggering unit))
                Set TrgPos[7] = (Position of SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)])
                Unit - Order SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)] to Move To TrgPos[6]
                Unit - Remove All buffs from SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)]
                Unit - Add a ((Distance between TrgPos[6] and TrgPos[7]) / (Current movement speed of SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)])) second Generic expiration timer to SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)]

Code:
Required Trigger 1
    Events
        Time - Elapsed game time is 0.01 seconds
    Conditions
    Actions
        Custom script: set bj_wantDestroyGroup = true
        Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
            Loop - Actions
                Trigger - Add to Required Trigger 3 <gen> the event (Unit - (Picked unit) Takes damage)
                Unit - Set the custom value of (Picked unit) to 1
        Trigger - Destroy (This trigger)

Code:
Required Trigger 2
    Events
        Unit - A unit enters (Entire map)
    Conditions
        And - All (Conditions) are true
            Conditions
                (Custom value of (Triggering unit)) Equal to 0
                (Unit-type of (Triggering unit)) Not equal to SwarmUnitId[(Custom value of (Triggering unit))]
    Actions
        Trigger - Add to Required Trigger 3 <gen> the event (Unit - (Triggering unit) Takes damage)
        Unit - Set the custom value of (Triggering unit) to 1

Code:
Required Trigger 3
    Events
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Damage source)) Equal to SwarmUnitId[(Custom value of (Damage source))]
            Then - Actions
                Unit - Set life of GetTriggerUnit[(Custom value of (Damage source))] to ((Life of GetTriggerUnit[(Custom value of (Damage source))]) + ((Damage taken) x LifeStole[(Custom value of (Triggering unit))]))
            Else - Actions

A file is attached to the post so you can download it.

The Triggered Locust Swarm is able to handle 100 casters, each having a capacity of 81 locust units.
 

Attachments

  • [Spell] Triggered Locust Swarm.w3x
    107.2 KB · Views: 174
Uh please make it so that it doesn't require WEU. :rolleyes:
 
And - All (Conditions) are true
Conditions
(Custom value of (Triggering unit)) Equal to 0
(Unit-type of (Triggering unit)) Not equal to SwarmUnitId[(Custom value of (Triggering unit))]

Conditions up there are already considered "And" conditions. You can remove the "and" part.
 
And - All (Conditions) are true
Conditions
(Custom value of (Triggering unit)) Equal to 0
(Unit-type of (Triggering unit)) Not equal to SwarmUnitId[(Custom value of (Triggering unit))]

Conditions up there are already considered "And" conditions. You can remove the "and" part.

Ok, didn't see I wrote And in normal conditions.


For that line :

Code:
                Unit - Add a ((Distance between TrgPos[6] and TrgPos[7]) / (Current movement speed of SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)])) second Generic expiration timer to SwarmUnits[((((Custom value of (Triggering unit)) x 81) + ((Integer B) - 1)) mod 81)]

Do you know what the problem in it? It never worked.



Uh please make it so that it doesn't require WEU

Hmm? I didn't use WEU. I only used WE Helper without the LikeWEU.dll. :nuts: Or am I wrong?


Anyway it looks nice. I didn' t get it why there were two Locust Swarms.. then I realized it was for comparing, silly me Nice work !

Two locust swarms : One for Triggered, one for Normal. See the big differance between them, but this works REALLY fine. Need to fix the duration problem for locust units.
 
> Or am I wrong?
Either that or something is seriously wrong with my editor.
weuhf2.jpg

Well if you simply disabled LikeWEU then that's not enough, vexorian figured out that disabling one plugin results in disabling something else...could be fixed in 1.6 though.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    News portal has been retired. Main page of site goes to Headline News forum now
  • The Helper The Helper:
    I am working on getting access to the old news portal under a different URL for those that would rather use that for news before we get a different news view.
  • Ghan Ghan:
    Easily done
    +1
  • The Helper The Helper:
    https://www.thehelper.net/pages/news/ is a link to the old news portal - i will integrate it into the interface somewhere when i figure it out
  • Ghan Ghan:
    Need to try something
  • Ghan Ghan:
    Hopefully this won't cause problems.
  • Ghan Ghan:
    Hmm
  • Ghan Ghan:
    I have converted the Headline News forum to an Article type forum. It will now show the top 20 threads with more detail of each thread.
  • Ghan Ghan:
    See how we like that.
  • The Helper The Helper:
    I do not see a way to go past the 1st page of posts on the forum though
  • The Helper The Helper:
    It is OK though for the main page to open up on the forum in the view it was before. As long as the portal has its own URL so it can be viewed that way I do want to try it as a regular forum view for a while
  • Ghan Ghan:
    Yeah I'm not sure what the deal is with the pagination.
  • Ghan Ghan:
    It SHOULD be there so I think it might just be an artifact of having an older style.
  • Ghan Ghan:
    I switched it to a "Standard" article forum. This will show the thread list like normal, but the threads themselves will have the first post set up above the rest of the "comments"
  • The Helper The Helper:
    I don't really get that article forum but I think it is because I have never really seen it used on a multi post thread
  • Ghan Ghan:
    RpNation makes more use of it right now as an example: https://www.rpnation.com/news/
  • The Helper The Helper:
  • The Helper The Helper:
    What do you think Tom?
  • tom_mai78101 tom_mai78101:
    I will have to get used to this.
  • tom_mai78101 tom_mai78101:
    The latest news feed looks good

      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