• 🏆 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!

Custom abilities! [Solved]

Status
Not open for further replies.
Level 10
Joined
Jun 20, 2017
Messages
337
Hey, I have an ally in my map that has a unit that you can upgrade or give abilities to.
So I need 2 different abilities, you can only have one of them. These abilities are activated when you purchase 10 of them with lumber (each cost 500 lumber).
It also adds 15 gold to your income.


Income: +15
Note: You can activate only 1.
Note: Skill only activates when maxed (at level 10).

1.
Increases his base damage by 350%, and that can bounces up to the second target and deals 50% of the damage, and gains 35% lifesteal of the primary target.
Passively increases mana regeneration rate by 1% of maximum.
Duration: 30 seconds.
Cooldown: 60 seconds.
  • I gave the unit the Roar (Neutral Hostile) ability, and I tried to autocasting it, but it didn't work!
  • Unit - Order (Triggering unit) to Special Rexxar - Battle Roar.
  • Unit - Order (Triggering unit) to Night Elf Druid Of The Claw - Roar.

2.
Enemy units affected by the ability lose 1% of their maximum hit points per second.
Passively increases mana regeneration rate by 1% of maximum.
Area of Effect:|r 715
Duration: 30 seconds.
Cooldown: 60 seconds.
 

Attachments

  • Custom abilities.w3m
    29.1 KB · Views: 2

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Just have a Dummy unit cast Inner Fire on the Dark Presence caster. You generally don't want your units to have to cast the buffing abilities themselves.

Also, you won't get kill credit when Royal Presence kills a unit since it's life loss and not damage. You'd have to trigger this ability if you want there to be a (Killing unit).
 
Level 10
Joined
Jun 20, 2017
Messages
337
Thanks, it works now, however I tried with the dummy unit, but it won't cast the inner fire!
Not working!
  • Dark Presence Dummy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dark Presence
    • Actions
      • Unit - Create 1 Dummy Spell for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add Inner Fire (Neutral Hostile)3 to (Last created unit)
      • Unit - Add Dark Presence Life Steal to (Last created unit)
      • Unit - Add Presence (Brilliance Aura) (Item) to (Last created unit)
      • Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
      • Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
Working!
  • Dark Presence
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dark Presence
    • Actions
      • Unit - Add Inner Fire (Neutral Hostile)3 to (Triggering unit)
      • Unit - Add Dark Presence Life Steal to (Triggering unit)
      • Unit - Add Presence (Brilliance Aura) (Item) to (Triggering unit)
      • Unit - Order (Triggering unit) to Human Priest - Inner Fire (Triggering unit)
      • -------- --------
      • Wait 30.00 game-time seconds
      • -------- --------
      • Unit - Remove Inner Fire (Neutral Hostile)3 from (Triggering unit)
      • Unit - Remove Dark Presence Life Steal from (Triggering unit)
      • Unit - Remove Presence (Brilliance Aura) (Item) from (Triggering unit)
  • Royal Presence
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Royal Presence
    • Actions
      • Unit - Add Royal Presence (Neutral Hostile) to (Triggering unit)
      • Unit - Add Presence (Brilliance Aura) (Item) to (Triggering unit)
      • -------- --------
      • Wait 30.00 game-time seconds
      • -------- --------
      • Unit - Remove Royal Presence (Neutral Hostile) from (Triggering unit)
      • Unit - Remove Presence (Brilliance Aura) (Item) from (Triggering unit)
And I have this messy trigger, but this line does not work! I can still buy the dummy unit! I mean it should be unavailable in the shop!
Player - Make Dark Presence Unavailable for training/construction by (Owner of (Selling unit))
  • Purchase Ability
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Selling unit)) is an ally of Player 23 (Emerald).) Equal to True
        • Then - Actions
          • Set VariableSet Player_King = Player 23 (Emerald)
          • Set VariableSet Unit_King = Guardian of the Realm west 0008 <gen>
        • Else - Actions
          • Set VariableSet Player_King = Player 24 (Peanut)
          • Set VariableSet Unit_King = Guardian of the Realm east 0009 <gen>
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Dark Presence
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Royal Presence for Unit_King) Not equal to 1
              • (Current research level of Royal Presence for Player_King) Not equal to 1
              • (Current research level of Royal Presence for Player_King) Not equal to 2
              • (Current research level of Royal Presence for Player_King) Not equal to 3
              • (Current research level of Royal Presence for Player_King) Not equal to 4
              • (Current research level of Royal Presence for Player_King) Not equal to 5
              • (Current research level of Royal Presence for Player_King) Not equal to 6
              • (Current research level of Royal Presence for Player_King) Not equal to 7
              • (Current research level of Royal Presence for Player_King) Not equal to 8
              • (Current research level of Royal Presence for Player_King) Not equal to 9
              • (Current research level of Royal Presence for Player_King) Not equal to 10
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current research level of Dark Presence for Player_King) Less than (Max research level of Dark Presence for Player_King)
                • Then - Actions
                  • Player Group - Pick every player in (All allies of Player_King.) and do (Actions)
                    • Loop - Actions
                      • Player - Set the current research level of Dark Presence to ((Current research level of Dark Presence for (Picked player)) + 1) for (Picked player)
                  • -------- --------
                  • Special Effect - Create a special effect attached to the origin of Unit_King using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Game - Display to (All allies of Player_King.) for 10.00 seconds the text: (((Name of (Owner of (Selling unit))) + |r upgraded Dark Presence to level |cffffcc00) + ((String((Current research level of Dark Presence for Player_King))) + |r))
                  • Set VariableSet integer_kingupgrade[(Player number of (Owner of (Selling unit)))] = (integer_kingupgrade[(Player number of (Owner of (Selling unit)))] + 1)
                  • Set VariableSet integer_income[(Player number of (Owner of (Selling unit)))] = (integer_income[(Player number of (Owner of (Selling unit)))] + 15)
                  • -------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Dark Presence for Player_King) Equal to (Max research level of Dark Presence for Player_King)
                    • Then - Actions
                      • Unit - Add Dark Presence to Unit_King
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Dark Presence for Player_King) Equal to (Max research level of Dark Presence for Player_King)
                    • Then - Actions
                      • Player - Make Dark Presence Unavailable for training/construction by (Owner of (Selling unit))
                      • Player - Add -500 to (Owner of (Selling unit)).Total lumber gathered
                      • Player - Add 500 to (Owner of (Selling unit)).Current lumber
                      • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This ability is alr...
                    • Else - Actions
            • Else - Actions
              • Player - Add -500 to (Owner of (Selling unit)).Total lumber gathered
              • Player - Add 500 to (Owner of (Selling unit)).Current lumber
              • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: A |cff8080ffPresenc...
        • Else - Actions
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Royal Presence
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Dark Presence for Unit_King) Not equal to 1
              • (Current research level of Dark Presence for Player_King) Not equal to 1
              • (Current research level of Dark Presence for Player_King) Not equal to 2
              • (Current research level of Dark Presence for Player_King) Not equal to 3
              • (Current research level of Dark Presence for Player_King) Not equal to 4
              • (Current research level of Dark Presence for Player_King) Not equal to 5
              • (Current research level of Dark Presence for Player_King) Not equal to 6
              • (Current research level of Dark Presence for Player_King) Not equal to 7
              • (Current research level of Dark Presence for Player_King) Not equal to 8
              • (Current research level of Dark Presence for Player_King) Not equal to 9
              • (Current research level of Dark Presence for Player_King) Not equal to 10
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current research level of Royal Presence for Player_King) Less than (Max research level of Royal Presence for Player_King)
                • Then - Actions
                  • Player Group - Pick every player in (All allies of Player_King.) and do (Actions)
                    • Loop - Actions
                      • Player - Set the current research level of Royal Presence to ((Current research level of Royal Presence for (Picked player)) + 1) for (Picked player)
                  • -------- --------
                  • Special Effect - Create a special effect attached to the origin of Unit_King using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Game - Display to (All allies of Player_King.) for 10.00 seconds the text: (((Name of (Owner of (Selling unit))) + |r upgraded Royal Presence to level |cffffcc00) + ((String((Current research level of Royal Presence for Player_King))) + |r))
                  • Set VariableSet integer_kingupgrade[(Player number of (Owner of (Selling unit)))] = (integer_kingupgrade[(Player number of (Owner of (Selling unit)))] + 1)
                  • Set VariableSet integer_income[(Player number of (Owner of (Selling unit)))] = (integer_income[(Player number of (Owner of (Selling unit)))] + 15)
                  • -------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Royal Presence for Player_King) Equal to (Max research level of Royal Presence for Player_King)
                    • Then - Actions
                      • Unit - Add Royal Presence to Unit_King
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Royal Presence for Player_King) Equal to (Max research level of Royal Presence for Player_King)
                    • Then - Actions
                      • Player - Make Royal Presence Unavailable for training/construction by (Owner of (Selling unit))
                      • Player - Add -500 to (Owner of (Selling unit)).Total lumber gathered
                      • Player - Add 500 to (Owner of (Selling unit)).Current lumber
                      • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: This ability is alr...
                    • Else - Actions
            • Else - Actions
              • Player - Add -500 to (Owner of (Selling unit)).Total lumber gathered
              • Player - Add 500 to (Owner of (Selling unit)).Current lumber
              • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: A |cff8080ffPresenc...
        • Else - Actions
      • -------- --------
      • Unit - Remove (Sold unit) from the game
      • -------- --------
      • Trigger - Run gg_trg_Update_Income (ignoring conditions)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
A Dummy unit is no different than any other unit. It needs to meet all of the requirements for casting a spell.

The Dummy unit should be based on the Locust with the following changes:
Movement Type: None, Speed Base: 0, Attacks Enabled: None, Model/Shadow: None.

Inner Fire needs to have the following changes:
99999 cast range, 0 mana cost, valid targets allowed, no requirements.

A Dummy unit can cast Inner Fire or any ability for that matter if you follow these rules.

Also, in your Dark Presence Dummy trigger you were Adding all of the abilities to the Dummy when you obviously meant to add them to the (Casting unit).


In your Purchase Ability trigger you're making some mistakes:

1) The (Selling unit) is not necessarily owned by the Player that purchased the unit. You probably need to prevent the owner of the (Sold unit) from being able to train Dark Presence.

2) Work smart, not hard. Your Conditions seem very unnecessary:
  • (Current research level of Dark Presence for Player_King) Equal to 0
Isn't this the same thing as checking if Royal Presence is Not 1, 2, 3, 4, 5, 6, 7, 8, 9, 10?

Or simply do something like this:
  • (Current research level of Dark Presence for Player_King) Less than or equal to 10
3) Are you even sure that this Action "Player - Make Royal Presence Unavailable for training/construction by (Owner of (Selling unit))" is even running? The way your Conditions are setup leads me to believe that it's impossible.
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
337
The Dummy unit should be based on the Locust with the following changes:
Movement Type: None, Speed Base: 0, Attacks Enabled: None, Model/Shadow: None.

Inner Fire needs to have the following changes:
99999 cast range, 0 mana cost, valid targets allowed, no requirements.
Yes I already knew about them! But it's still the same!
  • Dark Presence Dummy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dark Presence
    • Actions
      • Unit - Create 1 Dummy Spell for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add Inner Fire (Neutral Hostile)3 to (Last created unit)
      • Unit - Set level of Inner Fire (Neutral Hostile)3 for (Last created unit) to (Level of Inner Fire (Neutral Hostile)3 for (Triggering unit))
      • Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
      • Unit - Add Dark Presence Life Steal to (Triggering unit)
      • Unit - Add Presence (Brilliance Aura) (Item) to (Triggering unit)
      • Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
I couldn't figure out why it wasn't working, so I made 2 shops 1 with stock 1 no stock.
  • Purchase Ability
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of (Selling unit)) is an ally of Player 23 (Emerald).) Equal to True
        • Then - Actions
          • Set VariableSet Player_King = Player 23 (Emerald)
          • Set VariableSet Unit_King = Guardian of the Realm west 0008 <gen>
        • Else - Actions
          • Set VariableSet Player_King = Player 24 (Peanut)
          • Set VariableSet Unit_King = Guardian of the Realm east 0009 <gen>
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Dark Presence
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Royal Presence for Unit_King) Not equal to 1
              • (Current research level of Royal Presence for Player_King) Equal to 0
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current research level of Dark Presence for Player_King) Less than (Max research level of Dark Presence for Player_King)
                • Then - Actions
                  • Player Group - Pick every player in (All allies of Player_King.) and do (Actions)
                    • Loop - Actions
                      • Player - Set the current research level of Dark Presence to ((Current research level of Dark Presence for (Picked player)) + 1) for (Picked player)
                  • -------- --------
                  • Special Effect - Create a special effect attached to the origin of Unit_King using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Game - Display to (All allies of Player_King.) for 10.00 seconds the text: (((Name of (Owner of (Selling unit))) + |r upgraded Dark Presence to level |cffffcc00) + ((String((Current research level of Dark Presence for Player_King))) + |r))
                  • Set VariableSet integer_kingupgrade[(Player number of (Owner of (Selling unit)))] = (integer_kingupgrade[(Player number of (Owner of (Selling unit)))] + 1)
                  • Set VariableSet integer_income[(Player number of (Owner of (Selling unit)))] = (integer_income[(Player number of (Owner of (Selling unit)))] + 15)
                  • -------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Dark Presence for Player_King) Equal to (Max research level of Dark Presence for Player_King)
                    • Then - Actions
                      • Unit - Add Dark Presence to Unit_King
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Level of Dark Presence for Unit_King) Equal to 1
                          • (Current research level of Dark Presence for Player_King) Equal to (Max research level of Dark Presence for Player_King)
                    • Then - Actions
                      • For each (Integer A) from 1 to 12, do (Actions)
                        • Loop - Actions
                          • Unit - Replace Units_TH[(Integer A)] with a Arcane Vault2 using The new unit's max life and mana
                    • Else - Actions
            • Else - Actions
              • Player - Add -500 to (Owner of (Selling unit)).Total lumber gathered
              • Player - Add 500 to (Owner of (Selling unit)).Current lumber
              • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: A |cff8080ffPresenc...
        • Else - Actions
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Royal Presence
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Dark Presence for Unit_King) Not equal to 1
              • (Current research level of Dark Presence for Player_King) Equal to 0
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Current research level of Royal Presence for Player_King) Less than (Max research level of Royal Presence for Player_King)
                • Then - Actions
                  • Player Group - Pick every player in (All allies of Player_King.) and do (Actions)
                    • Loop - Actions
                      • Player - Set the current research level of Royal Presence to ((Current research level of Royal Presence for (Picked player)) + 1) for (Picked player)
                  • -------- --------
                  • Special Effect - Create a special effect attached to the origin of Unit_King using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Game - Display to (All allies of Player_King.) for 10.00 seconds the text: (((Name of (Owner of (Selling unit))) + |r upgraded Royal Presence to level |cffffcc00) + ((String((Current research level of Royal Presence for Player_King))) + |r))
                  • Set VariableSet integer_kingupgrade[(Player number of (Owner of (Selling unit)))] = (integer_kingupgrade[(Player number of (Owner of (Selling unit)))] + 1)
                  • Set VariableSet integer_income[(Player number of (Owner of (Selling unit)))] = (integer_income[(Player number of (Owner of (Selling unit)))] + 15)
                  • -------- --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Current research level of Royal Presence for Player_King) Equal to (Max research level of Royal Presence for Player_King)
                    • Then - Actions
                      • Unit - Add Royal Presence to Unit_King
                    • Else - Actions
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (Level of Royal Presence for Unit_King) Equal to 1
                          • (Current research level of Royal Presence for Player_King) Equal to (Max research level of Royal Presence for Player_King)
                    • Then - Actions
                      • For each (Integer A) from 1 to 12, do (Actions)
                        • Loop - Actions
                          • Unit - Replace Units_TH[(Integer A)] with a Arcane Vault2 using The new unit's max life and mana
                    • Else - Actions
            • Else - Actions
              • Player - Add -500 to (Owner of (Selling unit)).Total lumber gathered
              • Player - Add 500 to (Owner of (Selling unit)).Current lumber
              • Game - Display to (Player group((Owner of (Selling unit)))) for 10.00 seconds the text: A |cff8080ffPresenc...
        • Else - Actions
      • -------- --------
      • Unit - Remove (Sold unit) from the game
      • -------- --------
      • Trigger - Run gg_trg_Update_Income (ignoring conditions)

I even added these 3 lines, that maybe one of them might work but...
Player - Make Dark Presence Unavailable for training/construction by (Owner of (Sold unit))
Player - Make Dark Presence Unavailable for training/construction by (Owner of (Selling unit))
Player - Make Dark Presence Unavailable for training/construction by (Owner of (Buying unit))

if.gif
(Current research level of Dark Presence for Player_King) Equal to 0
thanks ;d
 
Level 10
Joined
Jun 20, 2017
Messages
337
I'm positive the solution is in my post you're quoting. If I had to guess (which is all I can do if you don't show me anything) is that you forgot to remove the requirements from Inner Fire.
I edited everything! Can you check please?!
Also, you don't train/construct units from a Shop so I imagine that Action doesn't even work here.
I guess so!
 

Attachments

  • Custom abilities.w3m
    30.4 KB · Views: 4

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
"Inner Fire Targets Allowed = Self". Are you sure you actually checked, lol.

The Dummy unit is the Self in this situation, which is obviously not what we want.

  • Dark Presence Dummy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dark Presence
    • Actions
      • Unit - Add Dark Presence (Life Steal) to (Triggering unit)
      • Unit - Add Presence (Brilliance Aura) (Item) to (Triggering unit)
      • Unit - Create 1 Dummy Spell for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add a 0.20 second Generic expiration timer to (Last created unit)
      • Unit - Add Dark Presence (Inner Fire) to (Last created unit)
      • Unit - Set level of Dark Presence (Inner Fire) for (Last created unit) to (Level of Dark Presence for (Triggering unit))
      • Unit - Order (Last created unit) to Human Priest - Inner Fire (Triggering unit)
      • Wait 30.00 game-time seconds
      • Unit - Remove Dark Presence (Life Steal) from (Triggering unit)
      • Unit - Remove Presence (Brilliance Aura) (Item) from (Triggering unit)
^ This leaks a Point -> (Position of (Triggering unit))
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
337
"Inner Fire Targets Allowed = Self". Are you sure you actually checked, lol.
Yes, I wanted the ability to only work for the casting unit, that's why I set the target to self.
The Dummy unit is the Self in this situation, which is obviously not what we want.
Oops ;d
^ This leaks a Point -> (Position of (Triggering unit))
Yes, I know about the leaks, I will clear them in my map.

Thank you, now the thread is solved.
 
Level 10
Joined
Jun 20, 2017
Messages
337
Trying to make my ability into MUI, did I do it right?! is it MUI?!
  • Dark Presence
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dark Presence [Channel]
    • Actions
      • Set VariableSet MUI_Index = (MUI_Index + 1)
      • Set VariableSet MUI_Caster[MUI_Index] = (Triggering unit)
      • Set VariableSet MUI_Target[MUI_Index] = (Target unit of ability being cast)
      • Set VariableSet MUI_Counter[MUI_Index] = 0.00
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MUI_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Brilliance Aura Loop <gen>
        • Else - Actions
      • -------- --------
      • Set VariableSet TriggeringUnit = (Triggering unit)
      • Set VariableSet PositionOfUnit = (Position of TriggeringUnit)
      • -------- --------
      • Unit - Add Dark Presence (Item) to TriggeringUnit
      • Unit - Add Brilliance Aura (Item) to TriggeringUnit
      • Unit - Create 1 Dummy Spell for (Owner of TriggeringUnit) at PositionOfUnit facing Default building facing degrees
      • Set VariableSet LastCreatedUnit = (Last created unit)
      • Unit - Add a 0.20 second Generic expiration timer to LastCreatedUnit
      • Unit - Add Inner Fire [Champion] to LastCreatedUnit
      • Unit - Set level of Inner Fire [Champion] for LastCreatedUnit to (Level of Inner Fire [Champion] for TriggeringUnit)
      • Unit - Order LastCreatedUnit to Human Priest - Inner Fire TriggeringUnit
      • -------- --------
      • Wait 30.00 game-time seconds
      • -------- --------
      • Unit - Remove Dark Presence (Item) from TriggeringUnit
      • Unit - Remove Brilliance Aura (Item) from TriggeringUnit
      • -------- --------
      • Custom script: call RemoveLocation(udg_PositionOfUnit)
  • Brilliance Aura Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer MUI_Loop) from 1 to MUI_Index, do (Actions)
        • Loop - Actions
          • Unit - Set mana of MUI_Caster[MUI_Loop] to ((Mana of MUI_Caster[MUI_Loop]) + 1.00)%
          • Set VariableSet MUI_Counter[MUI_Loop] = (MUI_Counter[MUI_Loop] + 1.00)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MUI_Counter[MUI_Loop] Greater than or equal to 30.00
            • Then - Actions
              • Set VariableSet MUI_Caster[MUI_Loop] = MUI_Caster[MUI_Index]
              • Set VariableSet MUI_Target[MUI_Loop] = MUI_Target[MUI_Index]
              • Set VariableSet MUI_Counter[MUI_Loop] = MUI_Counter[MUI_Index]
              • Set VariableSet MUI_Index = (MUI_Index - 1)
              • Set VariableSet MUI_Loop = (MUI_Loop - 1)
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MUI_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
No, it's not MUI. You can't reference a global variable after a Wait unless you know for a fact that it's value will be the same. But the Wait doesn't even make sense anymore since you have the Loop trigger tracking how much time has elapsed.

Here is a fixed version:
  • Dark Presence
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dark Presence [Channel]
    • Actions
      • Set VariableSet TriggeringUnit = (Triggering unit)
      • Set VariableSet PositionOfUnit = (Position of TriggeringUnit)
      • -------- --------
      • Set VariableSet MUI_Index = (MUI_Index + 1)
      • Set VariableSet MUI_Caster[MUI_Index] = TriggeringUnit
      • Set VariableSet MUI_Counter[MUI_Index] = 0
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MUI_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Dark Presence Loop <gen>
        • Else - Actions
      • -------- --------
      • Unit - Add Dark Presence (Item) to TriggeringUnit
      • Unit - Add Brilliance Aura (Item) to TriggeringUnit
      • Unit - Create 1 Dummy Spell for (Owner of TriggeringUnit) at PositionOfUnit facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_PositionOfUnit)
      • Set VariableSet LastCreatedUnit = (Last created unit)
      • Unit - Add a 0.20 second Generic expiration timer to LastCreatedUnit
      • Unit - Add Inner Fire [Champion] to LastCreatedUnit
      • Unit - Set level of Inner Fire [Champion] for LastCreatedUnit to (Level of Dark Presence [Channel] for TriggeringUnit)
      • Unit - Order LastCreatedUnit to Human Priest - Inner Fire TriggeringUnit
  • Dark Presence Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer MUI_Loop) from 1 to MUI_Index, do (Actions)
        • Loop - Actions
          • Unit - Set mana of MUI_Caster[MUI_Loop] to ((Mana of MUI_Caster[MUI_Loop]) + 1.00)%
          • Set VariableSet MUI_Counter[MUI_Loop] = (MUI_Counter[MUI_Loop] + 1)
          • -------- --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • MUI_Counter[MUI_Loop] Greater than or equal to 30
            • Then - Actions
              • Unit - Remove Inner Fire [Champion] buff from MUI_Caster[MUI_Loop]
              • Unit - Remove Dark Presence (Item) from MUI_Caster[MUI_Loop]
              • Unit - Remove Brilliance Aura (Item) from MUI_Caster[MUI_Loop]
              • -------- --------
              • Set VariableSet MUI_Caster[MUI_Loop] = MUI_Caster[MUI_Index]
              • Set VariableSet MUI_Counter[MUI_Loop] = MUI_Counter[MUI_Index]
              • Set VariableSet MUI_Index = (MUI_Index - 1)
              • Set VariableSet MUI_Loop = (MUI_Loop - 1)
              • -------- --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MUI_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
1) I removed the Wait since it's no longer needed.
2) I restructured the Dark Presence trigger slightly so that (Triggering unit) only gets used once.
3) I made the Dark Presence Loop trigger manage the removal of the abilities/buff.
4) I fixed a mistake you were making when setting the level of the dummy spell.
5) I changed MUI_Counter to be an Integer rather than a Real since Reals suffer from floating point precision.

This type of spell is a lot easier to manage with the Unit Indexing method. This is because the spell only needs a Unit Group variable to track the casters and MUI_Counter[] to track the duration of the spell. You would use the caster's custom value as the [index] of MUI_Counter. This would simplify both triggers as well.
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
337
No, it's not MUI. You can't reference a global variable after a Wait unless you know for a fact that it's value will be the same. But the Wait doesn't even make sense anymore since you have the Loop trigger tracking how much time has elapsed.
I see.
This type of spell is a lot easier to manage with the Unit Indexing method. This is because the spell only needs a Unit Group variable to track the casters and MUI_Counter[] to track the duration of the spell. You would use the caster's custom value as the [index] of MUI_Counter. This would simplify both triggers as well.
I will make a version of Unit Indexing later today, and I will post the trigger, which you can tell me if I did it right or not!
Thank you.

Edit.
I came up with this and somehow it works without the unit indexer in my map!
  • Dark Presence Index
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Dark Presence
    • Actions
      • Set VariableSet Index_caster = (Triggering unit)
      • Set VariableSet Index_CV = (Custom value of Index_caster)
      • Set VariableSet Index_PN = (Player number of (Owner of Index_caster))
      • -------- --------
      • Unit - Add Dark Presence Life Steal to Index_caster
      • Unit - Add Presence (Brilliance Aura) (Item) to Index_caster
      • Unit - Create 1 Dummy Spell for (Owner of Index_caster) at (Position of Index_caster) facing Default building facing degrees
      • Unit - Add a 0.20 second Generic expiration timer to (Last created unit)
      • Unit - Add Inner Fire (Neutral Hostile)3 to (Last created unit)
      • Unit - Set level of Inner Fire (Neutral Hostile)3 for (Last created unit) to (Level of Dark Presence for Index_caster)
      • Unit - Order (Last created unit) to Human Priest - Inner Fire Index_caster
      • -------- --------
      • Unit Group - Add Index_caster to Index_UnitGroup[Index_PN]
      • Set VariableSet IsInIndexUnitGroup[Index_CV] = True
      • Set VariableSet Index_Trigger = Dark Presence Loop Index <gen>
      • Countdown Timer - Start Index_Timer as a One-shot timer that will expire in 30.00 seconds
      • Set VariableSet Index_Timer = (Last started timer)
  • Dark Presence Loop Index
    • Events
      • Time - Index_Timer expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Index_UnitGroup[Index_PN] and do (Actions)
        • Loop - Actions
          • Set VariableSet Index_caster = (Picked unit)
          • Set VariableSet Index_CV = (Custom value of Index_caster)
          • -------- --------
          • Unit - Remove Dark Presence buff from Index_caster
          • Unit - Remove Dark Presence Life Steal from Index_caster
          • Unit - Remove Presence (Brilliance Aura) (Item) from Index_caster
 

Attachments

  • Custom abilities.w3m
    31.9 KB · Views: 0
Last edited:
Status
Not open for further replies.
Top