Both of these are MUI:hi guys, I hope are doing well, i need MUI system for one of my spell in the map that i uploaded it called Brain Sap.
Thanks alot friend, it works perfectly.Both of these are MUI:
Brain Sap
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Brain Sap
Actions
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (100.00 x (Real((Level of Brain Sap for (Triggering unit))))) damage of attack type Chaos and damage type Magic
Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (100.00 x (Real((Level of Brain Sap for (Triggering unit))))))
Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIil\AIilTarget.mdl
Special Effect - Destroy (Last created special effect)
(Triggering unit) will work even after a Wait. (Target unit of ability being cast) will NOT.
Brain Sap
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Brain Sap
Actions
Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (100.00 x (Real((Level of Brain Sap for (Triggering unit))))) damage of attack type Chaos and damage type Magic
Wait 0.25 game-time seconds
Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (100.00 x (Real((Level of Brain Sap for (Triggering unit))))))
Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Items\AIil\AIilTarget.mdl
Special Effect - Destroy (Last created special effect)
Also, you can simplify your Burning Legion Dialog menu to one trigger:
Do Dialog can be simplified as well, there's no need for the For Loop:
Dialog
Events
Time - Elapsed game time is 0.50 seconds
Conditions
Actions
Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Race of (Picked player)) Equal to Undead
Then - Actions
Set VariableSet PN = (Player number of (Picked player))
Dialog - Clear Choice[PN]
Dialog - Change the title of Choice[PN] to Play as the Burning...
Dialog - Create a dialog button for Choice[PN] labelled Yes
Set VariableSet BurningLegion[PN] = (Last created dialog Button)
Dialog - Create a dialog button for Choice[PN] labelled No
Set VariableSet Other[PN] = (Last created dialog Button)
Dialog - Show Choice[PN] for (Picked player)
Else - Actions
Do Dialog
Events
Dialog - A dialog button is clicked for Choice[1]
Dialog - A dialog button is clicked for Choice[2]
Dialog - A dialog button is clicked for Choice[3]
Dialog - A dialog button is clicked for Choice[4]
Dialog - A dialog button is clicked for Choice[5]
Dialog - A dialog button is clicked for Choice[6]
Dialog - A dialog button is clicked for Choice[7]
Dialog - A dialog button is clicked for Choice[8]
Conditions
(Clicked dialog button) Equal to BurningLegion[(Player number of (Triggering player))]
Actions
Unit Group - Pick every unit in (Units owned by (Triggering player).) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to Acolyte
Then - Actions
Set VariableSet Worker = (Picked unit)
Unit - Replace Worker with a Acolyte (Demon) using The old unit's relative life and mana
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to Ghoul
Then - Actions
Set VariableSet Worker2 = (Picked unit)
Unit - Remove Worker2 from the game
Unit - Create 1 Acolyte (Demon) for (Owner of (Picked unit)) at (Position of Worker2) facing (Facing of Worker2) degrees
Unit - Create 1 Acolyte (Demon) for (Owner of (Picked unit)) at (Position of Worker2) facing (Facing of Worker2) degrees
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to Necropolis
Then - Actions
Set VariableSet Hall = (Picked unit)
Unit - Remove Hall from the game
Unit - Create 1 Necropolis (Demon) for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees
Else - Actions
Edit: I had time to kill so I went through and cleaned up all of your triggers.
Notes:
- You can often use one generic trigger to do everything you need. If you catch yourself creating a trigger or variable per Player then you're probably doing something wrong.
- Arrays and clever use of variables can be used to avoid having multiple If Then Else statements. For example, when wanting different outcombes based on the Level of the ability being cast you can use an Array variable with the Ability Level as the [index]. I do this with the Dark Conversion Zombies.
- The Else - Actions section of an If Then Else can help optimize your triggers and fix issues (see Do Dialog for an example of this).
- You'll see I added a simple system called Delayed Destroy Effect which allows you to destroy a Special Effect after a given amount of time.
- I cleaned up all the of memory leaks. This isn't necessary but it can help and was easy enough to implement so I figured why not.
- Most global variable usage isn't safe after Waits, but a lot of Event Responses can still be used: Event Response Myths
- I use a local variable in your Dark Conversion trigger, these require Custom Script but aren't that difficult to figure out. You can combine them with the standard GUI functions to create simple MUI triggers. A local variable is unique to the instance of the trigger that is running so you never have to worry about them changing or breaking in some way.
Sorry but I use old patch can you send triggers?It's MUI in the map I attached.
I renamed your Dialog variables, deleted a lot of other variables, and made some new ones:Sorry but I use old patch can you send triggers?
Thanks again.I renamed your Dialog variables, deleted a lot of other variables, and made some new ones:
View attachment 472107
Player Hero Limitations
Events
Map initialization
Conditions
Actions
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Player - Limit training of Heroes to 3 for (Picked player)
Player - Limit training of Voidwalker to 1 for (Picked player)
Player - Limit training of Dreadlord to 1 for (Picked player)
Player - Limit training of Eredar Warlock to 1 for (Picked player)
Player - Limit training of Pit Lord to 1 for (Picked player)
Burning Legion Dialog Setup
Events
Time - Elapsed game time is 0.50 seconds
Conditions
Actions
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked player) controller) Equal to User
(Race of (Picked player)) Equal to Undead
Then - Actions
Set VariableSet PN = (Player number of (Picked player))
-------- --------
Dialog - Clear Burning_Legion_Dialog[PN]
Dialog - Change the title of Burning_Legion_Dialog[PN] to Play as the Burning...
-------- --------
Dialog - Create a dialog button for Burning_Legion_Dialog[PN] labelled Yes
Set VariableSet Burning_Legion_Yes[PN] = (Last created dialog Button)
-------- --------
Dialog - Create a dialog button for Burning_Legion_Dialog[PN] labelled No
Set VariableSet Burning_Legion_No[PN] = (Last created dialog Button)
-------- --------
Dialog - Show Burning_Legion_Dialog[PN] for (Picked player)
Else - Actions
Burning Legion Dialog Click
Events
Dialog - A dialog button is clicked for Burning_Legion_Dialog[1]
Dialog - A dialog button is clicked for Burning_Legion_Dialog[2]
Dialog - A dialog button is clicked for Burning_Legion_Dialog[3]
Dialog - A dialog button is clicked for Burning_Legion_Dialog[4]
Dialog - A dialog button is clicked for Burning_Legion_Dialog[5]
Dialog - A dialog button is clicked for Burning_Legion_Dialog[6]
Dialog - A dialog button is clicked for Burning_Legion_Dialog[7]
Dialog - A dialog button is clicked for Burning_Legion_Dialog[8]
Conditions
(Clicked dialog button) Equal to Burning_Legion_Yes[(Player number of (Triggering player))]
Actions
Set VariableSet Temp_Group = (Units owned by (Triggering player).)
-------- --------
Unit Group - Pick every unit in Temp_Group and do (Actions)
Loop - Actions
Set VariableSet Temp_Unit = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of Temp_Unit) Equal to Acolyte
Then - Actions
Unit - Replace Temp_Unit with a Acolyte (Demon) using The old unit's relative life and mana
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of Temp_Unit) Equal to Ghoul
Then - Actions
Set VariableSet Temp_Point = (Position of Temp_Unit)
Unit - Remove Temp_Unit from the game
Unit - Create 1 Acolyte (Demon) for (Owner of Temp_Unit) at Temp_Point facing (Facing of Temp_Unit) degrees
Unit - Create 1 Acolyte (Demon) for (Owner of Temp_Unit) at Temp_Point facing (Facing of Temp_Unit) degrees
Custom script: call RemoveLocation( udg_Temp_Point )
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of Temp_Unit) Equal to Necropolis
Then - Actions
Set VariableSet Temp_Point = (Position of Temp_Unit)
Unit - Remove Temp_Unit from the game
Unit - Create 1 Necropolis (Demon) for (Owner of Temp_Unit) at Temp_Point facing Default building facing degrees
Custom script: call RemoveLocation( udg_Temp_Point )
Else - Actions
-------- --------
Custom script: call DestroyGroup( udg_Temp_Group )
Dark Conversion
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Dark Conversion (Demon)
Actions
Custom script: local unit u = GetSpellTargetUnit()
Set VariableSet DarkConversion_Target = (Target unit of ability being cast)
-------- --------
-------- Setup Zombie types based on ability [level]. Note: It'd be better to set these variables once at the start of the game: --------
Set VariableSet DarkConversion_Zombie_Type[1] = Zombie (Level 1)
Set VariableSet DarkConversion_Zombie_Type[2] = Zombie (Level 2)
Set VariableSet DarkConversion_Zombie_Type[3] = Zombie (Level 3)
-------- --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((DarkConversion_Target is A Hero) Equal to True) or (((DarkConversion_Target is A flying unit) Equal to True) or ((Level of DarkConversion_Target) Greater than 3))
Then - Actions
-------- Nothing happens --------
Else - Actions
Special Effect - Create a special effect attached to the origin of DarkConversion_Target using Abilities\Spells\Undead\UnholyAura\UnholyAura.mdl
Set VariableSet DDE_Delay = 4.50
Trigger - Run Delayed Destroy Effect <gen> (ignoring conditions)
-------- --------
Wait 3.00 game-time seconds
-------- --------
Custom script: set udg_DarkConversion_Target = u
Special Effect - Create a special effect attached to the origin of DarkConversion_Target using Abilities\Spells\Demon\DarkConversion\ZombifyTarget.mdl
Set VariableSet DDE_Delay = 3.00
Trigger - Run Delayed Destroy Effect <gen> (ignoring conditions)
-------- --------
Wait 1.50 game-time seconds
-------- --------
Custom script: set udg_DarkConversion_Target = u
Set VariableSet Temp_Point = (Position of DarkConversion_Target)
Unit - Remove DarkConversion_Target from the game
Unit - Create 1 DarkConversion_Zombie_Type[(Level of Dark Conversion (Demon) for (Triggering unit))] for (Owner of (Triggering unit)) at Temp_Point facing (Facing of DarkConversion_Target) degrees
Custom script: call RemoveLocation( udg_Temp_Point )
-------- --------
Custom script: set u = null
Void
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Void
Actions
Set VariableSet Temp_Point = (Position of (Target unit of ability being cast))
Unit - Create 1 Dummy for Neutral Passive at (Position of (Target unit of ability being cast)) facing Default building facing degrees
Custom script: call RemoveLocation( udg_Temp_Point )
Unit - Add a 0.20 second Generic expiration timer to (Last created unit)
Unit - Add Void to (Last created unit)
Unit - Order (Last created unit) to Human Sorceress - Slow (Target unit of ability being cast)
Delayed Destroy Effect
Events
Conditions
Actions
Custom script: local effect sfx = GetLastCreatedEffectBJ()
Wait DDE_Delay game-time seconds
Custom script: call DestroyEffect(sfx)
Custom script: set sfx = null