• 🏆 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!

An Upgrade trigger.

Status
Not open for further replies.
Level 5
Joined
Jun 27, 2010
Messages
73
Hey im still noobish for triggers and crap but anyways how do u do this:

Ok im making a zombie map. Theirs 3 paths into town. Point of game is to defend town. Theirs town guards on each path. My idea is i want to spawn new troops at each path when a Player buys a Town Defender Upgrade from shop.How do i do that?
 
Well, if these guards are used as guards only, you can do this:
  • Trigger1
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Set GuardTypes[1] = Footman
    • Set GuardTypes[2] = Archer
    • Set GuardTypes[3] = Rifleman
  • Trigger2
  • Events
    • Unit - A unit sells a unit
  • Conditions
    • (Unit-type of (Sold unit)) Equal to Town Defender Upgrade
  • Actions
    • Set Integer = (Player number of (Owner of (Sold unit)))
    • Unit - Kill (Sold unit)
    • Unit - Remove (Sold unit) from the game
    • Set Count[Integer] = (Count[Integer] + 1)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in (Units in (Playable Map Area) matching ((Owner of (Matching unit)) Equal to (Owner of (Sold unit))) and (Unit-type of (Matching unit)) Equal to GuardTypes[(Integer - 1)]) and do (Actions)
      • Loop - Actions
        • Unit - Replace (Picked unit) with a GuardTypes[Integer], using the new unit's default life and mana
 
Status
Not open for further replies.
Top