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

Mind Tolerance v1.0

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: IcemanBo
Having trained to successfully negate all damage that comes to mind, he is able to withstand any kind of damage that he receives and put it on hold for later time. After the effect wears off, the damage will be dealt to the caster and will disperse it to surrounding enemies. Damage is lessen for dispersion damage to nearby enemies. If the self-damage is fatal, the caster will gain health and get stunned.

[Level 1] - Delaying damage for up to 5 seconds, health is set to 100 if lethal, 2 second self-stun, 20% dispersion damage.
[Level 2] - Delaying damage for up to 6 seconds, health is set to 200 if lethal, 1.5 second self-stun, 30% dispersion damage.
[Level 3] - Delaying damage for up to 7 seconds, health is set to 300 if lethal, 1 second self-stun, 40% dispersion damage.
[Level 4] - Delaying damage for up to 8 seconds, health is set to 400 if lethal, 0.5 second self-stun, 50% dispersion damage.


  • MT Setup
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set MT_DurationSetup[1] = 5.00
      • Set MT_DurationSetup[2] = 6.00
      • Set MT_DurationSetup[3] = 7.00
      • Set MT_DurationSetup[4] = 8.00
      • Set MT_AOE_Setup[1] = 300.00
      • Set MT_AOE_Setup[2] = 400.00
      • Set MT_AOE_Setup[3] = 500.00
      • Set MT_AOE_Setup[4] = 600.00
      • Set MT_DamageDisperseSetup[1] = 0.20
      • Set MT_DamageDisperseSetup[2] = 0.30
      • Set MT_DamageDisperseSetup[3] = 0.40
      • Set MT_DamageDisperseSetup[4] = 0.50
      • Set MT_FatalHealSetup[1] = 100.00
      • Set MT_FatalHealSetup[2] = 200.00
      • Set MT_FatalHealSetup[3] = 300.00
      • Set MT_FatalHealSetup[4] = 400.00
      • Set MT_onHitEffect = Abilities\Spells\Undead\DeathandDecay\DeathandDecayDamage.mdl
      • Set MT_onDisperseEffect = Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • Set MT_onActivateEffect = Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
      • Set MT_onDamageEffect = Abilities\Spells\Undead\DeathCoil\DeathCoilSpecialArt.mdl
      • Set MT_onFatalHealEffect = Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
      • Set MT_Ability = Mind Tolerance
      • Set MT_DummyCaster = Mind Tolerance (Dummy Caster)
      • Set MT_StunAbility = Mind Tolerance (Stun)
  • MT Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to MT_Ability
    • Actions
      • Set TempU = (Triggering unit)
      • Set TempInt = (Level of MT_Ability for TempU)
      • Set MT_Key = (Custom value of TempU)
      • Set MT_Duration[MT_Key] = MT_DurationSetup[TempInt]
      • Set MT_AOE[MT_Key] = MT_AOE_Setup[TempInt]
      • Set MT_DamageDisperse[MT_Key] = MT_DamageDisperseSetup[TempInt]
      • Set MT_FatalHeal[MT_Key] = MT_FatalHealSetup[TempInt]
      • Unit Group - Add TempU to MT_Group
      • Special Effect - Create a special effect attached to the overhead of TempU using MT_onActivateEffect
      • Special Effect - Destroy (Last created special effect)
      • Trigger - Turn on MT Loop <gen>
  • MT Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (MT_Group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Unit Group - Pick every unit in MT_Group and do (Actions)
            • Loop - Actions
              • Set TempU = (Picked unit)
              • Set MT_Key = (Custom value of TempU)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • MT_Duration[MT_Key] Greater than 0.00
                • Then - Actions
                  • Set MT_Duration[MT_Key] = (MT_Duration[MT_Key] - 0.03)
                • Else - Actions
                  • Set TempLoc = (Position of TempU)
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit Group - Pick every unit in (Units within MT_AOE[MT_Key] of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is alive) Equal to True) a and do (Actions)
                    • Loop - Actions
                      • Set TempU2 = (Picked unit)
                      • Set TempReal = (MT_DamageHold[MT_Key] x MT_DamageDisperse[MT_Key])
                      • Floating Text - Create floating text that reads (- + (String((Integer(TempReal))))) above TempU2 with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                      • Set TempText = (Last created floating text)
                      • Floating Text - Set the velocity of TempText to 64.00 towards 315.00 degrees
                      • Floating Text - Change TempText: Disable permanence
                      • Floating Text - Change the lifespan of TempText to 1.50 seconds
                      • Floating Text - Change the fading age of TempText to 0.75 seconds
                      • Special Effect - Create a special effect attached to the overhead of TempU2 using MT_onDamageEffect
                      • Special Effect - Destroy (Last created special effect)
                      • Unit - Cause TempU to damage TempU2, dealing TempReal damage of attack type Chaos and damage type Universal
                  • Set TempReal = (Life of TempU)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (TempReal - MT_DamageHold[MT_Key]) Less than or equal to 1.00
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • TempReal Less than or equal to MT_FatalHeal[MT_Key]
                        • Then - Actions
                          • Unit - Set life of TempU to MT_FatalHeal[MT_Key]
                        • Else - Actions
                      • Unit - Create 1 MT_DummyCaster for (Owner of TempU) at TempLoc facing Default building facing degrees
                      • Set TempU2 = (Last created unit)
                      • Unit - Add a 0.50 second Generic expiration timer to TempU2
                      • Unit - Set level of MT_StunAbility for TempU2 to (Level of MT_Ability for TempU)
                      • Unit - Order TempU2 to Human Mountain King - Storm Bolt TempU
                      • Special Effect - Create a special effect attached to the origin of TempU using MT_onFatalHealEffect
                      • Special Effect - Destroy (Last created special effect)
                    • Else - Actions
                      • Unit - Set life of TempU to ((Life of TempU) - MT_DamageHold[MT_Key])
                      • Special Effect - Create a special effect attached to the origin of TempU using MT_onDisperseEffect
                      • Special Effect - Destroy (Last created special effect)
                      • Floating Text - Create floating text that reads (- + (String((Integer(MT_DamageHold[MT_Key]))))) above TempU with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 0.00%), and 0.00% transparency
                      • Set TempText = (Last created floating text)
                      • Floating Text - Set the velocity of TempText to 64.00 towards 315.00 degrees
                      • Floating Text - Change TempText: Disable permanence
                      • Floating Text - Change the lifespan of TempText to 1.50 seconds
                      • Floating Text - Change the fading age of TempText to 0.75 seconds
                  • Custom script: call RemoveLocation(udg_TempLoc)
                  • Unit Group - Remove TempU from MT_Group
                  • Set MT_DamageHold[MT_Key] = 0.00
  • MT Before Hit
    • Events
      • Game - DamageModifierEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget is in MT_Group) Equal to True
    • Actions
      • Set MT_Key = (Custom value of DamageEventTarget)
      • Set MT_DamageHold[MT_Key] = (MT_DamageHold[MT_Key] + DamageEventAmount)
      • Set DamageEventAmount = 0.00
      • Special Effect - Create a special effect attached to the body of DamageEventTarget using MT_onHitEffect
      • Special Effect - Destroy (Last created special effect)
  • MT Hit
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (DamageEventTarget is in MT_Group) Equal to True
    • Actions
      • Special Effect - Create a special effect attached to the overhead of DamageEventTarget using MT_onHitEffect
      • Special Effect - Destroy (Last created special effect)
v1.0
- Initial release


Bribe - Damage Detection System and Unit Indexer


Keywords:
unit, indexer, defskull, mind, tolerance, damage, detection, system, disperse, damage, hashtable.
Contents

Just another Warcraft III map (Map)

Reviews
12th Dec 2015 IcemanBo: For long time as NeedsFix. Rejected. 04:32, 7th Jan 2015 IcemanBo: http://www.hiveworkshop.com/forums/spells-569/mind-tolerance-v1-0-a-259474/#post2636910
Level 33
Joined
Mar 27, 2008
Messages
8,035
Reserved~
There are some hidden mechanics for this spell, but it doesn't show in the tooltips (because no more space).
The mechanic is that, if you take a fatal damage, it would set your HP to a certain fixed amount, right ?
But if your currentHP > fatalHeal, the set life won't occur.

Example 1:
You take fatal damage, and it will set your HP to 400, but your current HP right now is 500, therefore, no setLife action occurs.

Example 2:
You take fatal damage, and it will set your HP to 400, but your current HP right now is 200, therefore, setLife action occurs which results in your HP to become 400.

Comments and Feedback are much appreciated, because I'm a long-time spell/system maker, maybe there are obsolete technique in the making of these triggers, please do tell :)
 
Hey there! The concept seems interesting!

Maybe you could change the floatings as optional in a further update. As their amount is limited, I can imagine a user could have want to have it disabled.

As optimization you could use one global dummy, and just always change the ownership. This way you can reduce heavy unit creation operations.

Following line is pretty long and quite unreadable:
  • Unit Group - Pick every unit in (Units within MT_AOE[MT_Key] of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is alive) Equal to True) a and do (Actions)
Using an If/Then/Else to check all the conditions would better, and then you can use the variable instead of refering to "MatchingUnit" each time.

The check, to turn off the periodic trigger should be done when the effect of an instance ends.
Also using an own integer as counter would be more efficient than checking if a group is empty.

Could be configurable:
- Attack-, and Damagtype
- Attachmentpoints

What condition exactly has to match for fatal damage?
 
Last edited:
Level 33
Joined
Mar 27, 2008
Messages
8,035
Hey there! The concept seems interesting!

Maybe you could change the floatings as optional in a further update. As their amount is limited, I can imagine a user could have want to have it disabled.

As optimization you could use one global dummy, and just always change the ownership. This way you can reduce heavy unit creation operations.

Following line is pretty long and quite unreadable:
  • Unit Group - Pick every unit in (Units within MT_AOE[MT_Key] of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is alive) Equal to True) a and do (Actions)
Using an If/Then/Else to check all the conditions would better, and then you can use the variable instead of refering to "MatchingUnit" each time.

The check, to turn off the periodic trigger should be done when the effect of an instance ends.
Also using an own integer as counter would be more efficient than checking if a group is empty.

Could be configurable:
- Attack-, and Damagtype
- Attachmentpoints

What condition exactly has to match for fatal damage?

1. The Floating Text configurable would be in the next update
2. I was thinking about using Dummy Caster system, but was too lazy at the moment to import it, maybe I'll do it later on
3. I agree with the unreadable part for the (Matching unit) comparison, will do line by line
4. I was thinking of using custom integer to keep track of instances, but this is a Hashtable-method, not Indexing, so... I kinda need to perform extra if operation, because it doesn't allow "Stacking", whenever same unit cast the ability within intended duration, it will refresh the timer, but won't "add" to the IntegerCount. Perhaps I would do this in the next update.
5. DmgType and AttachmentPoint for configurable would be in the next update.
6. The condition for "fatal" is that, fatalDamage > currentHealth.

and also that line leaks

Which part is the leak ?
Can you tell me so that I can fix it in the next update.

Thanks for comments so far.
 
Last edited:
Level 13
Joined
Jul 16, 2012
Messages
679
  • Trigger - Turn on MT Loop <gen>
You need to put this on ITE

For my suggestion, call DestroyGroup() is better than set bj_wantDestroyGroup = true

  • Unit Group - Pick every unit in (Units within MT_AOE[MT_Key] of TempLoc matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and ((((Matching unit) is Mechanical) Equal to False) and ((((Matching unit) is alive) Equal to True) a and do (Actions)
put it in ITE
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
You guys don't need to remind same point over and over again lol.
Find new points, come on... be original @@"

For my suggestion, call DestroyGroup() is better than set bj_wantDestroyGroup = true
For DestroyGroup(), first you need a group variable, later an operation to be called to save all unit inside the Unit Group.
See ?
That has already takes time.
Also, this group is meant to be temporary, doesn't even need to waste a variable just for a temporary group (Temporary Variables like Real, Int, is different, because this requires reference/calculations to multiple other results)

The way I see it, it serves the same purpose with same efficiency.

Like I said, only to pick unit within range, that's it.
Doesn't even need a variable to waste the storage.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
For my suggestion, call DestroyGroup() is better than set bj_wantDestroyGroup = true

This is not true. All GUI unit group actions check to see if the unit group should be destroyed. Thus the boolean value bj_wantDestroyGroup. If bj_wantDestroyGroup is true it then calls DestroyGroup(). So it can't be better.
 
  • Please add import instructions.
  • It's not really the system's job to display the damage/healings via floatings. Please seperate it.
  • Use one global dummy.
  • You could use a counter to check if the loop has to be turned on/off.
  • You could think of a limit for the amount damage absorbtion. It could be set seperatly for each level.
  • Damage- and Attack type should be configurable. Just as attachment points.
  • The learning tooltip is too long. Shorten it, because it's not fully shown in game.
  • Add short and useful comments. Especially needed for the user.

Needs Fix
 
Top