• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Make This Spell MUI

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,602
Hey.

I have one spell in the campaign that I would like to have it to transformed to MUI. I mean, you can do this spell to many units same time without any bugs. Can you do this, perhaps?

Rep & credits will be given.

  • Reiki
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Reiki (Light Spell Book - Low)
    • Actions
      • Set Regrowth_Unit = (Target unit of ability being cast)
      • Set Regrowth_Heal_Power_666 = (750.00 + (((Real((Intelligence of (Casting unit) (Include bonuses)))) x 3.00) + (((Real((Charges remaining in (Item carried by (Casting unit) of type Low Magic Ball)))) x 10.00) + (((Real((Charges remaining in (Item carried by (Casting unit) of type Moderate
      • Set Regrowth_Heal_Power_666 = (Regrowth_Heal_Power_666 / 15.00)
      • For each (Integer Regrowth_Integer) from 1 to 15, do (Actions)
        • Loop - Actions
          • Unit - Set life of Regrowth_Unit to ((Life of Regrowth_Unit) + Regrowth_Heal_Power_666)
          • Special Effect - Create a special effect attached to the origin of (Target unit of ability being cast) using Abilities\Spells\Human\Heal\HealTarget.mdl
          • Wait 1.00 seconds
          • Special Effect - Destroy (Last created special effect)
 
Last edited:
Level 12
Joined
Aug 22, 2008
Messages
911
You could take all the math put into the variable and do it straightaway to the target, I know that it's a lot of work but that's the most MUI way I can think of.
Also, you could instead make a dummy unit using the effect's model and add an expiration timer to it, then attatch it to the unit the ability is being casted on. Work, that should.
 
Level 12
Joined
Jun 28, 2008
Messages
688
Make a dummy unit with the effect model and create it instead of the effect, then add a 1 second expiration timer to it.

EDIT: Sorry, I didn't notice that idodik already said that, but anyways that's probably the best way to do it.

EDIT 2: Again, sorry, but you don't need to do any of that. HealTarget.mdl doesn't have a stand anim, therefor if you cut out the wait, it will have no effect. It will play its default birth to death anims, which it would do anyways whether you have the wait in there or not. So just delete the wait and it will work fine.
 
Level 3
Joined
Aug 19, 2007
Messages
24
Here's a way of doing it in GUI, 2 triggers:

  • Reiki
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Reiki (Light Spell Book - Low)
    • Actions
      • Set Regrow_Unit_Count = (Regrow_Unit_Count + 1)
      • Set Regrow_Units_Array[Regrow_Unit_Count] = (Target unit of abililty being cast)
      • Set Regrow_Amount_Array[Regrow_Unit_Count] = (750.00 + (((Real((Intelligence of (Casting unit) (Include bonuses)))) x 3.00) + (((Real((Charges remaining in (Item carried by (Casting unit) of type Low Magic Ball)))) x 10.00) + (((Real((Charges remaining in (Item carried by (Casting unit) of type Moderate
      • Set Regrow_Amount_Array[Regrow_Unit_Count] = (Regrow_Amount_Array[Regrow_Unit_Count] / 15.00)
      • Set Regrow_Timer_Count[Regrow_Unit_Count] = 15
  • Reiki Timer
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Loop_End = Regrow_Unit_Count
      • Do Multiple ActionsFor each (Integer A) from 1 to Loop_End, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Regrow_Timer_Count[(Integer A)] Greater than (>) 0
            • Then - Actions
              • Set Regrow_Timer_Count[(Integer A)] = (Regrow_Timer_Count[(Integer A)] - 1)
              • Unit - Set life of Regrow_Units_Array[(Integer A)] to ((Life of Regrow_Units_Array[(Integer A)]) + Regrow_Amount_Array[(Integer A)])
              • Special Effect - Create a special effect attached to the origin of Regrow_Units_Array[(Integer A)] using Abilities\Spells\Human\Heal\HealTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to Loop_End, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Regrow_Timer_Count[(Integer A)] Less than or equal to (<=) 0
            • Then - Actions
              • Set Regrow_Unit_Count = (Regrow_Unit_Count - 1)
              • Set Regrow_Timer_Count[(Integer A)] = Regrow_Timer_Count[Regrow_Unit_Count]
              • Set Regrow_Timer_Count[Regrow_Unit_Count] = 0
              • Set Regrow_Units_Array[(Integer A)] = Regrow_Units_Array[Regrow_Unit_Count]
              • Set Regrow_Units_Array[Regrow_Unit_Count] = No unit
              • Set Regrow_Amount_Array[(Integer A)] = Regrow_Amount_Array[Regrow_Unit_Count]
              • Set Regrow_Amount_Array[Regrow_Unit_Count] = 0.00
            • Else - Actions
This should work as long as you keep the units below about 7000. The heal animation should play correctly (most animations play through one sequence if you create and destroy them back to back). Please note that you cannot combine the two Loop statements.

Note:
Loop_End = Integer, start 0
Regrow_Unit_Count = Integer, start 0
Regrow_Units_Array = Unit array, size whatever
Regrow_Amount_Array = Real array, size whatever
Regrow_Timer_Count = Integer array, size whatever
 
Level 12
Joined
Jun 28, 2008
Messages
688
I guess I misunderstood where the non-MUI part is. From my understanding, you want the target to heal *Regrowth_Heal_Power_666* health once every second 15 times, is that correct? If so, I guess what I would do is make a dummy unit cast a dummy ability with a buff on the target unit, and then make a 1 second periodic trigger that heals all units on the map with that buff for *Regrowth_Heal_power_666*. And then just make the buff last 15 seconds.
 
Level 3
Joined
Aug 19, 2007
Messages
24
I guess I misunderstood where the non-MUI part is. From my understanding, you want the target to heal *Regrowth_Heal_Power_666* health once every second 15 times, is that correct? If so, I guess what I would do is make a dummy unit cast a dummy ability with a buff on the target unit, and then make a 1 second periodic trigger that heals all units on the map with that buff for *Regrowth_Heal_power_666*. And then just make the buff last 15 seconds.

Disadvantages:
1. Changing heal power after casting the spell would change the amount that people are healed, since you are using a global variable
2. Only one person would be able to cast the spell at a time, because it would use the heal power value from whoever cast the spell last

Advantages:
1. Buff could potentially be purged off, which may be a mechanic that you want
 
Level 37
Joined
Aug 14, 2006
Messages
7,602
Oh shit this whole thread now bugs because you gave me that huge trigger. I don't like this. Well, anyways. I'm not sure how I'm going to do now, seems pretty advanced for me. I'm not the guy that handles MUI very well because I have been doing that campaign last 1,5 years...

So, any suggestions where to start?

EDIT: We have to remember that there is only 3 character that may cast this spell.
 
Status
Not open for further replies.
Top