• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Spell] How to set the value of Taurenchieftain's mana when he finishes casting Reincarnation?

Status
Not open for further replies.
Level 5
Joined
Oct 29, 2020
Messages
82
I don't want his mana to be full when he finishes casting Reincarnation, instead I want his mana to be a certain value which is less than his full mana.
Then what is the right trigger?
 
Level 21
Joined
Feb 27, 2019
Messages
660
Item Reincarnation ability can set hit points and mana to a certain amount but... meh..

Detecting reincarnation is not an easy task therefor Bribe has made GUI Unit Event v2.5.2.0 to make it easier for us mortals.

Heres an example on what the trigger would look like using Bribes gui unit event.
Bribes gui unit event also contains a required unit indexer. I will use these three variables in the trigger.
UDexUnits: Every unit that enters the map is assigned a custom value and added to the unit array on the spot corresponding with their custom value.
Udex: This variable is used temporarily to reference the correct spot in the unit array using the units custom value.
DeathEvent: The numbers in the real event variable are automatically set elsewhere to activate the triggers after Udex is already set so we can then reference the unit easily. DeathEvent = 2.00 means that the UDexUnits[Udex] has just finished reincarnating and can be used to reference the unit without error if done instantly. There is also the option to set another unit variable to UDexUnits[Udex] and use it to reference the unit thereforth if required.
  • On Revival
    • Events
      • Game - DeathEvent becomes Equal to 2.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of UDexUnits[UDex]) Equal to Tauren Chieftain
        • Then - Actions
          • Unit - Set mana of UDexUnits[UDex] to (0.25 x (Max mana of UDexUnits[UDex]))
        • Else - Actions
This particular trigger would not be able to differentiate between different kinds of reincarnation. One way could be to check if the reincarnation ability has an almost exact cooldown that would be reasonable if the unit just reincarnated with that ability, like if cooldown of reincarnation = 233 seconds, unless it shares cooldown with another ability.
  • On Revival
    • Events
      • Game - DeathEvent becomes Equal to 2.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of UDexUnits[UDex]) Equal to Tauren Chieftain
          • (Ability Cooldown Remaining of UDexUnits[UDex] for ability Reincarnation..) Equal to 233.00
        • Then - Actions
          • Unit - Set mana of UDexUnits[UDex] to (0.25 x (Max mana of UDexUnits[UDex]))
        • Else - Actions
You can easily see how Bribes lovely gui unit event is far superior than using the Item Reincarnation ability with all the creative flexibility it allows.
  • On Revival
    • Events
      • Game - DeathEvent becomes Equal to 2.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of UDexUnits[UDex]) Equal to Tauren Chieftain
          • (Ability Cooldown Remaining of UDexUnits[UDex] for ability Reincarnation..) Equal to 233.00
        • Then - Actions
          • Unit - Set mana of UDexUnits[UDex] to (0.25 x (Max mana of UDexUnits[UDex]))
          • Special Effect - Create a special effect at (Position of UDexUnits[UDex]) using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Cause UDexUnits[UDex] to damage circular area after 0.00 seconds of radius 150.00 at (Position of UDexUnits[UDex]), dealing 100.00 damage of attack type Spells and damage type Universal
        • Else - Actions
 
Level 5
Joined
Oct 29, 2020
Messages
82
Item Reincarnation ability can set hit points and mana to a certain amount but... meh..

Detecting reincarnation is not an easy task therefor Bribe has made GUI Unit Event v2.5.2.0 to make it easier for us mortals.

Heres an example on what the trigger would look like using Bribes gui unit event.
Bribes gui unit event also contains a required unit indexer. I will use these three variables in the trigger.
UDexUnits: Every unit that enters the map is assigned a custom value and added to the unit array on the spot corresponding with their custom value.
Udex: This variable is used temporarily to reference the correct spot in the unit array using the units custom value.
DeathEvent: The numbers in the real event variable are automatically set elsewhere to activate the triggers after Udex is already set so we can then reference the unit easily. DeathEvent = 2.00 means that the UDexUnits[Udex] has just finished reincarnating and can be used to reference the unit without error if done instantly. There is also the option to set another unit variable to UDexUnits[Udex] and use it to reference the unit thereforth if required.
  • On Revival
    • Events
      • Game - DeathEvent becomes Equal to 2.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of UDexUnits[UDex]) Equal to Tauren Chieftain
        • Then - Actions
          • Unit - Set mana of UDexUnits[UDex] to (0.25 x (Max mana of UDexUnits[UDex]))
        • Else - Actions
This particular trigger would not be able to differentiate between different kinds of reincarnation. One way could be to check if the reincarnation ability has an almost exact cooldown that would be reasonable if the unit just reincarnated with that ability, like if cooldown of reincarnation = 233 seconds, unless it shares cooldown with another ability.
  • On Revival
    • Events
      • Game - DeathEvent becomes Equal to 2.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of UDexUnits[UDex]) Equal to Tauren Chieftain
          • (Ability Cooldown Remaining of UDexUnits[UDex] for ability Reincarnation..) Equal to 233.00
        • Then - Actions
          • Unit - Set mana of UDexUnits[UDex] to (0.25 x (Max mana of UDexUnits[UDex]))
        • Else - Actions
You can easily see how Bribes lovely gui unit event is far superior than using the Item Reincarnation ability with all the creative flexibility it allows.
  • On Revival
    • Events
      • Game - DeathEvent becomes Equal to 2.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of UDexUnits[UDex]) Equal to Tauren Chieftain
          • (Ability Cooldown Remaining of UDexUnits[UDex] for ability Reincarnation..) Equal to 233.00
        • Then - Actions
          • Unit - Set mana of UDexUnits[UDex] to (0.25 x (Max mana of UDexUnits[UDex]))
          • Special Effect - Create a special effect at (Position of UDexUnits[UDex]) using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Cause UDexUnits[UDex] to damage circular area after 0.00 seconds of radius 150.00 at (Position of UDexUnits[UDex]), dealing 100.00 damage of attack type Spells and damage type Universal
        • Else - Actions
Awesome. Thank you very much for your help. I'll try this.
 

Uncle

Warcraft Moderator
Level 67
Joined
Aug 10, 2018
Messages
6,953
If you'd like to avoid using that entire system, you can use the method that's used in that system for detecting reincarnation.

When a unit with the Defend ability dies it issues an order with no target -> "undefend". This happens even if the unit has reincarnation and is going to be reincarnated. So you can add a hidden Defend ability to your unit and use triggers to recreate this effect.
 
Last edited:
Level 5
Joined
Oct 29, 2020
Messages
82
If you'd like to avoid using that entire system, you can use the method that's used in that system for detecting reincarnation.

When a unit with the Defend ability dies it issues an order with no target -> "undefend". This happens even if the unit has reincarnation and is going to be reincarnated. You can add a hidden Defend ability to your unit and use triggers to recreate this effect.
I reconsidered my idea and found that Tauren Chieftain would be not powerful enough because of his low intelligence if Reincarnation was modified like I'd thought.
I think it maybe better if Reincarnation cost some mana.
But thank you all the same.
 
Status
Not open for further replies.
Top