• 🏆 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] GUI Spell help - MUI

Status
Not open for further replies.
Level 9
Joined
Sep 5, 2007
Messages
358
My spell is almost done but I don't know how to make it MUI and the tutorial on Hive doesn't help.

  • Casting the Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to |cffFDFD00Combat Healing|r
    • Actions
      • Set Caster = (Casting unit)
      • Set Target = (Target unit of ability being cast)
      • Trigger - Turn on Restoring Damage <gen>
      • Trigger - Add to Restoring Damage <gen> the event (Unit - Caster Takes damage)
      • Trigger - Add to Restoring Damage <gen> the event (Unit - Target Takes damage)
      • Wait 14.00 seconds
      • Trigger - Turn off Restoring Damage <gen>
the next trigger initially disabled:

  • Restoring Damage
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of |cffFDFD00Combat Healing|r for Caster) Equal to 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Caster
            • Then - Actions
              • Unit - Set life of Target to ((Life of Target) + ((Damage taken) / 3.00))
              • Special Effect - Create a special effect attached to the overhead of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Target
            • Then - Actions
              • Unit - Set life of Caster to ((Life of Caster) + ((Damage taken) / 3.00))
              • Special Effect - Create a special effect attached to the overhead of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of |cffFDFD00Combat Healing|r for Caster) Equal to 2
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Caster
            • Then - Actions
              • Unit - Set life of Target to ((Life of Target) + ((Damage taken) / 2.00))
              • Special Effect - Create a special effect attached to the overhead of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Target
            • Then - Actions
              • Unit - Set life of Caster to ((Life of Caster) + ((Damage taken) / 2.00))
              • Special Effect - Create a special effect attached to the overhead of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of |cffFDFD00Combat Healing|r for Caster) Equal to 3
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Caster
            • Then - Actions
              • Unit - Set life of Target to ((Life of Target) + ((Damage taken) / 1.50))
              • Special Effect - Create a special effect attached to the overhead of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Target
            • Then - Actions
              • Unit - Set life of Caster to ((Life of Caster) + ((Damage taken) / 1.50))
              • Special Effect - Create a special effect attached to the overhead of Target using Abilities\Spells\Orc\HealingWave\HealingWaveTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
        • Else - Actions
 
Level 5
Joined
Nov 14, 2007
Messages
161
if you have only one hero/unit per player, you could do arrays by player number. it works but sucks to make. and sometimes very frustrating.
 
Level 5
Joined
Dec 18, 2007
Messages
205
Hmm, I think you must create 2 unit-arrays, one for the caster and one for the target.

Casting Trigger: Find a free array in one variable, set target/caster to it (e.g. 1 is already being used, then set Caster[2] and Target[2] to both units). After the time is up (waited 14 secs) null both units (in this case Caster[2] and Target [2]).

Restoring Damage Trigger: Make the event get a lot of Caster[]-units and Target[]-units.

Oh and for your information: You can shorten the Restoring Damage Trigger. The special effects are always the same, so just put them behind the if's.


I don't know, if that works (didn't test it), but give it a try.

greetz
 
Level 5
Joined
Nov 14, 2007
Messages
161
ok so i was messing around and wondered if this would actually work.

im not the best with timers so there probably is a better way to check when it expires possibly an event like "timer[1] expires" for all players or something

  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Heal
    • Actions
      • Set PlayerNumberInt = (Player number of (Owner of (Triggering unit)))
      • Set CasterUnit[PlayerNumberInt] = (Triggering unit)
      • Set TargetUnit[PlayerNumberInt] = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Heal for CasterUnit[PlayerNumberInt]) Equal to 1
        • Then - Actions
          • Countdown Timer - Start Timer[PlayerNumberInt] as a One-shot timer that will expire in 15.00 seconds
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to CasterUnit[PlayerNumberInt]
            • Then - Actions
              • Unit - Set life of CasterUnit[PlayerNumberInt] to ((Life of TargetUnit[PlayerNumberInt]) + ((Damage taken) / 3.00))
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to TargetUnit[PlayerNumberInt]
            • Then - Actions
              • Unit - Set life of CasterUnit[PlayerNumberInt] to ((Life of TargetUnit[PlayerNumberInt]) + ((Damage taken) / 3.00))
            • Else - Actions
        • Else - Actions
and the turnning it off:
  • Trigger End
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 0 to 13, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Elapsed time for Timer[(Integer A)]) Greater than or equal to 14.00
            • Then - Actions
              • Set CasterUnit[(Integer A)] = No unit
              • Set TargetUnit[(Integer A)] = No unit
            • Else - Actions
Note there are quite a few leeks so if your going for leek free, you got some work ;)
 
Status
Not open for further replies.
Top