• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Tower Ability Max

Status
Not open for further replies.
Level 3
Joined
Oct 21, 2007
Messages
37
I want to make a hero which has an ability to summon one tower every 60 seconds, The problem is to prevent massive spamming of towers i want it to have a tower cap.
Lvl 1: 3 towers
Lvl 2: 4 towers
Lvl 3: 5 towers
If the hero goes over this cap, either the ability doesnt work, or the tower he just summoned is destroyed.
Also the towers could be upgraded into five different forms.
Im afraid i'm bad at more complicated triggering so i don't know how to do this.
 
Level 9
Joined
Nov 4, 2007
Messages
931
Well this doesn't seem too complex, though it will require a few variables to carry out
  • Tower
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Summon Tower
    • Actions
      • Set TowerLevel = (Level of Summon Tower for (Casting unit))
      • Set Temp_Group = (Units in (Playable map area) matching ((((Matching unit) is A structure) Equal to True) and ((Custom value of (Matching unit)) Equal to 1)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Temp_Group) Greater than (TowerLevel + 2)
        • Then - Actions
          • Unit - Create 1 Tower for (Owner of (Casting unit)) at (Position of (Casting unit)) facing Default building facing degrees
          • Unit - Add a 60.00 second Generic expiration timer to (Last created unit)
          • Unit - Set the custom value of (Last created unit) to 1
        • Else - Actions
          • Do nothing
  • call DestroyGroup(udg_Temp_Group)
That should take care of setting the maximum for the number of towers you want summoned, the ability itself however must not summon the tower, the tower must be created through this trigger, thats the easiest way I saw of doing this
 
Status
Not open for further replies.
Top