• 🏆 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] Transforming trigger to Multi-unit Ability

Status
Not open for further replies.
Level 4
Joined
May 21, 2015
Messages
70
Transforming trigger to MUI Ability

how do i make this into a MUI ability ex. 2 players with the same hero casts the same ability.

  • Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) [Warrior] Strike II
    • Actions
      • Set StrikeChanceII = (Random integer number between 1 and 4)
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • StrikeChance Equal to (==) 4
          • Then - Actions
            • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing (((Real((Strength of (Casting unit) (Include bonuses)))) x 2.00) + ((Real((Agility of (Casting unit) (Include bonuses)))) x 1.00)) damage of attack type Spells and damage type Enhanced
          • Else - Actions
      • Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing ((Real((Strength of (Casting unit) (Include bonuses)))) x 2.00) damage of attack type Spells and damage type Enhanced
      • Floating Text - Create floating text that reads (String(((Real((Strength of (Casting unit) (Include bonuses)))) x 2.00))) above (Target unit of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
and also ,,, does any here have a tutorial on how to make a MUI ability
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,657
Making things MUI (or keeping them MUI) is hard when you are doing things over time.
Like, you want an effect to happen only after a few seconds.
In that case, there are many things that can go wrong for example, variables get overwritten by the newer cast while the old trigger is still happening.

But all you do is very instant...
As Zwiebelchen said, it is already MUI.
However, I would recommend you to store all stuff like "Triggering unit", "Target unit of ability being cast", "Last created floating text", etc in global variables as they are faster and easier to edit later on and better when you copy and paste code for spells that do exactly the same.
 
Level 4
Joined
May 21, 2015
Messages
70
ohh ok.... then how do I store the triggering unit, target unit of ability being cast , etc...etc.. to global varibles?
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
Generally, assigning a variable to any value makes that variable a global one.
If you want to declare a local variable, you have to make use of custom script; like:
  • Custom script: local unit Warrior
  • Custom script: set Warrior = GetTriggerUnit()
and use JASS to refer to that variable in a script.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Create a global variable for example TempUnit, TempAbility, TempReal, TempInteger, etc.
One global variable for each different type.
Also make them arrays.
Then you can store the triggering unit under TempUnit[0], and the target under TempUnit[1].
(0 and 1 can still be used by all other triggers.)

Then you use the "Set variable" action to store those units under those variables.
 
Status
Not open for further replies.
Top