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

Need an MUI Mana restoration trigger over time

Status
Not open for further replies.
Level 11
Joined
Aug 11, 2009
Messages
594
Hi, I really dont know how to make things MUI, so if someone could make a real quick trigger for this or link me to a spell in the spell section I can copy then I would really appreciate it.

Basically what it should do is when a unit uses a certain item he regains 5% mana per sec over 5 sec.

So really simple, would also appreciate if someone knew a guide or something on how to learn to code simple things like this in MUI that would also be appreciated.

Thanks in advance :)
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,183
i think this will work
  • restore mana item
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Mana restore item
    • Actions
      • Unit Group - Add (Hero manipulating item) to some_unit_group
      • Wait 5.00 seconds
      • Unit Group - Remove (Hero manipulating item) from some_unit_group
  • mana restore loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in some_unit_group and do (Actions)
        • Loop - Actions
          • Set bonus_mana = ((Max mana of (Picked unit)) / 100.00)
          • Unit - Set mana of (Picked unit) to ((Percentage mana of (Picked unit)) + bonus_mana)%
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You can use either Hashtable or Indexing or both (requires advance knowledge for both methods)

These are the methods to make a MUI trigger out of GUI (Trigger Editor)

Basically, Darkgrom's trigger is totally not MUI

Here, I have created a test map for you, fully MUI, uses Hashtable, learn from it :)

If you have any question, do ask :)
 

Attachments

  • Simple MUI System.w3x
    15.2 KB · Views: 48
Level 11
Joined
Aug 11, 2009
Messages
594
Thanks to both of you for the help :) defskull do you know any guide or something where I could learn to use Hashtables or indexing?
 
Status
Not open for further replies.
Top