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

GUI vs. MUI

Status
Not open for further replies.
Level 6
Joined
Aug 5, 2017
Messages
251
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Natural Bond
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • ((Life of (Casting unit)) / 2.00) Greater than 1.00
      • Then - Actions
        • Unit - Set life of (Casting unit) to ((Life of (Casting unit)) / 2.00)
        • Unit - Set life of (Target unit of ability being cast) to ((Life of (Target unit of ability being cast)) + 400.00)
      • Else - Actions
        • Unit - Order (Casting unit) to Stop
        • Game - Display to (All players controlled by a User player) for 4.00 seconds the text: |cffffcc00Not enoug...
The code does work, but only for the hero and a unit. I want this code to work for the other units. I've been searching for tutorials MUI-related, but I can't find one that fits for me.

edit by mod: added trigger tags
 
Last edited by a moderator:
The Trigger you posted is instant, instant spells are always MUI.
From the text, below your trigger, I guess you want that this life transfer spell affects all units in a circle around the Caster or Target.

To affect more than 1 unit use the unit group category with in range of position.
Unit Groups do all things listed inside its loop for each unit inside the group, The current unit is addressed with picked Unit.
  • Unit Group - Pick every unit in (Units within 512.00 of (Position of (Triggering unit))) and do (Actions)
    • Loop - Actions
      • -------- Actions --------
      • Unit - Set life of (Picked unit) to ((Life of (Picked unit)) + 10.00)
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
The code does work, but only for the hero and a unit. I want this code to work for the other units.
What do you mean?

What do you want to happen?

Your trigger does:
Unit casts spell > reduce casting unit's health by half > "heal" 400 hp to the target unit.

You have a condition which I believe is useless, units "die" when their health becomes <.405, so the fear of unit dying from splitting 1hp in half should be unnecessary.
 
Level 6
Joined
Aug 5, 2017
Messages
251
I figured it out. Tasyen did help me. I specified the post about Tasyen's code, because of my mistake.
One more question: The code works great for a hero, but how do you make
the code for multiple necromancers casting the same spell, for example?
 
Status
Not open for further replies.
Top