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

[Trigger] Unit upgradeing using mana... plz help

Status
Not open for further replies.
Level 3
Joined
Jun 27, 2008
Messages
34
In my map units gain mana when they attack and then when they reach a certian amount of mana they upgrade to to next unit. how can i make a trigger that says event:when a Nord Recruit reaches 200 mana/Action: is replaced with Nord footman. or do i have to make a custom ability based off beserker upgrade? plz help
 
Level 13
Joined
Mar 24, 2010
Messages
950
If you want it to happen auto the beserker upgrade will not work well, although i can also think of a way to make that work too, only it would be more work and pointless.

Tell me if i'm wrong but i think what your asking for is as simple as this:
  • test
    • Events
      • Unit - Hero 0004 <gen>'s mana becomes Greater than or equal to 200.00
    • Conditions
      • (Max mana of (Triggering unit)) Greater than or equal to 200.00
    • Actions
      • Unit - Replace (Triggering unit) with a Footman using The new unit's default life and mana
 
Last edited by a moderator:
Level 6
Joined
Jan 6, 2006
Messages
204
If you want it to happen auto the beserker upgrade will not work well, although i can also think of a way to make that work too, only it would be more work and pointless.

Tell me if i'm wrong but i think what your asking for is as simple as this:
  • test
    • Events
      • Unit - Hero 0004 <gen>'s mana becomes Greater than or equal to 200.00
    • Conditions
      • (Max mana of (Triggering unit)) Greater than or equal to 200.00
    • Actions
      • Unit - Replace (Triggering unit) with a Footman using The new unit's default life and mana
+rep xD

Great rep... now this system for ONE unit only.

Create a periodic trigger that checks the mana of units stored in a group or unit array. Then use a hashtable to receive the corresponding unit ID to create a new unit with it.
 
Level 3
Joined
Jun 27, 2008
Messages
34
srry but i forgot to say that these are regular units and that they are trained, and not strating on the map.if i have to i can make the units heros but i would prefer to aviod that.
 
Last edited:
Level 13
Joined
Mar 24, 2010
Messages
950
I'm sorry, was a little unclear to what you wanted. Are these unit that are mana lvling Heros or normal Units?

Also is it all units in the game or just a select few you want for this to happen..?

Originally Posted by Darkt3mpl3r
Create a periodic trigger that checks the mana of units stored in a group or unit array. Then use a hashtable to receive the corresponding unit ID to create a new unit with it.
Dont bother with this, a periodic event is over kill and will run more often than needed. Constant checking of units in a group depending how you do it can cause leaking. Used hash-tables is un-necessary in this case, also he may not know how to use them.
 
Last edited:
Level 3
Joined
Jun 27, 2008
Messages
34
I'm sorry, was a little unclear to what you wanted. Are these unit that are mana lvling Heros or normal Units?

Also is it all units in the game or just a select few you want for this to happen..?

Ok srry i will use best detail i can for your questions:

1. Normal units that when they reach thier required amount of mana (which is got from attacking units) they upgrade to thier next unit in thier tier tree

2. Its to all units in the games except for the players main hero

and also off note from this do u know how to subtract gold from a certian player when his units upgrades?
 
Level 13
Joined
Mar 24, 2010
Messages
950
This is what you want i believe.

You can add conditions to this to control what units you want to be added.
  • Add Units
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • ((Triggering unit) is A Hero) Equal to False
    • Actions
      • Trigger - Add to Mana LvLing <gen> the event (Unit - (Triggering unit)'s mana becomes Greater than or equal to 200.00)
You can also add conditions to this to control what units you want to be added. (clean up the leaks in the group)
  • Add Unit Inital
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A Hero) Equal to False
            • Then - Actions
              • Trigger - Add to Mana LvLing <gen> the event (Unit - (Triggering unit)'s mana becomes Greater than or equal to 200.00)
            • Else - Actions
This is what makes it all work.
  • Mana LvLing
    • Events
    • Conditions
      • (Max mana of (Triggering unit)) Greater than or equal to 200.00
    • Actions
      • Unit - Replace (Triggering unit) with a Footman using The new unit's default life and mana
Try this out, this will work for any unit for any player you want. Easy to limit what units you want involved in this "mana lvling" thing you want also.

Hope i helped better this time :)


Edit:
No idea what you mean for the gold thing.. Like when you upgrade attack or defense? the gold is taken auto for that no need for trigger.
 
Level 13
Joined
Mar 24, 2010
Messages
950
Your welcome :)

Not sure where your other post is but is this what you want?

just add this to the Mana lvling trigger i made up there^
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Owner of (Triggering unit)) Current gold) Greater than 0
      • Then - Actions
        • Player - Add -10 to (Owner of (Last replaced unit)) Current gold
      • Else - Actions
 
Status
Not open for further replies.
Top