• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Mui

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
Is this MUI?

  • Slaughter
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Slauther
      • (Level of Slauther for (Triggering unit)) Less than 2
    • Actions
      • Set Slauther_MaxIndex = (Slauther_MaxIndex + 1)
      • Set Slauther_TrigUnit[Slauther_MaxIndex] = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Slauther_MaxIndex Equal to 1
        • Then - Actions
          • Trigger - Turn on Slauther Loop <gen>
        • Else - Actions
  • Slauther Loop
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
      • damageType Equal to 0
      • (target is Magic Immune) Equal to False
    • Actions
      • Trigger - Turn off (This trigger)
      • For each (Integer TempInt) from 1 to Slauther_MaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Slauther for Slauther_TrigUnit[TempInt]) Equal to 1
              • (Level of target) Less than or equal to 5
              • (Random integer number between 1 and 100) Less than or equal to 5
              • source Equal to Slauther_TrigUnit[TempInt]
            • Then - Actions
              • Set TempPlayerGroup = (Player group((Owner of Slauther_TrigUnit[TempInt])))
              • Floating Text - Create floating text that reads (|CFFFF0000 + Slaughter!) above target with Z offset 0.00, using font size 15.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Hide (Last created floating text) for (All players)
              • Floating Text - Show (Last created floating text) for TempPlayerGroup
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
              • Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
              • Unit - Cause Slauther_TrigUnit[TempInt] to damage target, dealing 1000000000.00 damage of attack type Chaos and damage type Normal
              • Custom script: call DestroyForce(udg_TempPlayerGroup)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Slauther for Slauther_TrigUnit[TempInt]) Equal to 2
                  • (Level of target) Less than or equal to 10
                  • (Random integer number between 1 and 100) Less than or equal to 10
                  • source Equal to Slauther_TrigUnit[TempInt]
                • Then - Actions
                  • Set TempPlayerGroup = (Player group((Owner of Slauther_TrigUnit[TempInt])))
                  • Floating Text - Create floating text that reads (|CFFFF0000 + Slaughter!) above target with Z offset 0.00, using font size 15.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
                  • Floating Text - Hide (Last created floating text) for (All players)
                  • Floating Text - Show (Last created floating text) for TempPlayerGroup
                  • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
                  • Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
                  • Unit - Cause Slauther_TrigUnit[TempInt] to damage target, dealing 1000000000.00 damage of attack type Chaos and damage type Normal
                  • Custom script: call DestroyForce(udg_TempPlayerGroup)
                • Else - Actions
      • Trigger - Turn on (This trigger)
The spell is passive.
 
Yes, it is MUI. Although, you could really just make it one trigger, since you don't really need to do any storage.

It would be something along these lines:
  • Slauther Loop
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
      • (Level of Slauther for source) Greater than 0
      • damageType Equal to 0
      • (target is Magic Immune) Equal to False
    • Actions
      • <Do your actions>
That way, you can avoid going through a loop every time a unit is damaged, and it is a lot neater. You would just use "source" instead of Slauther_TrigUnit. The condition "Level of Slauther..." already ensures that the unit has the passive before the trigger is actually ran.

You only need to do the stack loop when you need to store something and retrieve it later on in time (across multiple units), such as with a periodic or timed spell.
 
Level 18
Joined
May 11, 2012
Messages
2,103
Hmm, nice advice
Never thought of that
I'll try to make it with 1 trig =)

This looks fine?
  • Slaughter
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
      • (Level of Slaughter for source) Greater than 0
      • damageType Equal to 0
      • (target is Magic Immune) Equal to False
    • Actions
      • Trigger - Turn off (This trigger)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Slaughter for source) Equal to 1
          • (Level of target) Less than or equal to 5
          • (Random integer number between 1 and 100) Less than or equal to 5
        • Then - Actions
          • Set TempPlayerGroup = (Player group((Owner of source)))
          • Floating Text - Create floating text that reads (|CFFFF0000 + Slaughter!) above target with Z offset 0.00, using font size 15.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
          • Floating Text - Hide (Last created floating text) for (All players)
          • Floating Text - Show (Last created floating text) for TempPlayerGroup
          • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
          • Floating Text - Change (Last created floating text): Disable permanence
          • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
          • Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
          • Unit - Cause source to damage target, dealing 1000000000.00 damage of attack type Chaos and damage type Normal
          • Custom script: call DestroyForce(udg_TempPlayerGroup)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Slaughter for source) Equal to 2
              • (Level of target) Less than or equal to 10
              • (Random integer number between 1 and 100) Less than or equal to 10
            • Then - Actions
              • Set TempPlayerGroup = (Player group((Owner of source)))
              • Floating Text - Create floating text that reads (|CFFFF0000 + Slaughter!) above target with Z offset 0.00, using font size 15.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Hide (Last created floating text) for (All players)
              • Floating Text - Show (Last created floating text) for TempPlayerGroup
              • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
              • Floating Text - Change the lifespan of (Last created floating text) to 4.00 seconds
              • Unit - Cause source to damage target, dealing 1000000000.00 damage of attack type Chaos and damage type Normal
              • Custom script: call DestroyForce(udg_TempPlayerGroup)
            • Else - Actions
      • Custom script: set udg_TempPlayerGroup = null
      • Trigger - Turn on (This trigger)
 
Level 5
Joined
Jan 27, 2014
Messages
164
> why do you need to turn off and then turn it on...
Not very familiar with damage detection system but here goes.
Turn on/off is usually used to prevent infinite loop which can cause crash.

In this example, if a unit is damage it will trigger the response. In the response, if the unit is damaged again, it will in turn trigger the event again. It's a feedback loop. Ultimately causing a crash. Which is why the trigger is turned off, so that the damage action within the trigger will not activate the trigger event again. Sometimes, it's not really required, depending on situation, but people just add them for just in case purposes.
 
Last edited:
Level 13
Joined
Dec 21, 2010
Messages
541
> why do you need to turn off and then turn it on...
Not very familiar with damage detection system but here goes.
But turn on/off is usually used to prevent infinite loop which can cause crash.

In this example, if a unit is damage it will trigger the response. In the response, if the unit is damaged again, it will in turn trigger the event again. It's a feedback loop. Ultimately causing a crash. Which is why the trigger is turned off, so that the damage action within the trigger will not activate the trigger event again. Sometimes, it's not really required, depending on situation, but people just add them for just in case purposes.


ok .. :)
 
Level 18
Joined
May 11, 2012
Messages
2,103
> why do you need to turn off and then turn it on...
Not very familiar with damage detection system but here goes.
Turn on/off is usually used to prevent infinite loop which can cause crash.

In this example, if a unit is damage it will trigger the response. In the response, if the unit is damaged again, it will in turn trigger the event again. It's a feedback loop. Ultimately causing a crash. Which is why the trigger is turned off, so that the damage action within the trigger will not activate the trigger event again. Sometimes, it's not really required, depending on situation, but people just add them for just in case purposes.

Yes, that's why I put it there haha
Thanks for explanation?
 
Status
Not open for further replies.
Top