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

Item that Removes Mana Regeneration?

Status
Not open for further replies.
Level 4
Joined
Dec 24, 2016
Messages
42
Hi Everyone,

I am trying to make a map that uses an item that removes a user's Mana Regeneration. I want the equipped unit to have 0 Mana Regeneration regardless of other bonuses like Brilliance Aura and other Mana-Regeneration-based Items. From my previous question, I have learned how to put negative real values to Stat Modifiers and most Item stats are additive, but Mana Regeneration is strange in that it takes a multiplied/divided version of original value and then adds to it.


DEFAULT

Original Mana Regen (2/second)
+ Custom Item w/ Item Mana Regeneration [-1.00] (Original Mana Regen x -1.00)
= 0 mana/second
+ Sobi Mask (Original Mana Regen x 0.50)
= 1 mana/second
+ Brilliance Aura (2 mana/second)
= 3 mana/second​


GOAL

Original Mana Regen (2/second)
+ Item w/ Item Mana Regeneration (Original Mana Regen x "M") <--- M is the Editor Field
= (2+2M) mana/second
+ Brilliance Aura (2/second)
= (4+2M) mana/second
+ Custom Item [???] <--- What do I do here?
= 0/second <--- End Goal

If this is possible using triggers, I am using GUI to set up all of my triggers as I have no experience using vJass. If does require code outside of GUI, I might just discard the idea and figure out something else. Without further adieu, I will appreciate any help in creating this map/mod.
 
Level 11
Joined
May 16, 2016
Messages
730
Hi Everyone,

I am trying to make a map that uses an item that removes a user's Mana Regeneration. I want the equipped unit to have 0 Mana Regeneration regardless of other bonuses like Brilliance Aura and other Mana-Regeneration-based Items. From my previous question, I have learned how to put negative real values to Stat Modifiers and most Item stats are additive, but Mana Regeneration is strange in that it takes a multiplied/divided version of original value and then adds to it.
You have to use triggers.
 

Attachments

  • Triggerring Mana Regeneration.w3x
    15.8 KB · Views: 51
  • INIT
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set HASHMANAREG = (Last created hashtable)
  • EVERY 1 SEC
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set group = (Units in (Playable map area) matching (((Matching unit) is alive) Equal to True))
      • Unit Group - Pick every unit in group and do (Actions)
        • Loop - Actions
          • Set unit = (Picked unit)
          • Custom script: set udg_integer = GetHandleIdBJ( udg_unit )
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Inventory (Hero) for (Picked unit)) Greater than 0
            • Then - Actions
              • Set real = (Load 0 of integer from HASHMANAREG)
              • Set real = (real + 0.10)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • real Greater than or equal to 2.00
                • Then - Actions
                  • Set real = 0.00
                  • Trigger - Run MANA REGEN <gen> (checking conditions)
                • Else - Actions
              • Hashtable - Save real as 0 of integer in HASHMANAREG
            • Else - Actions
      • Custom script: call DestroyGroup( udg_group )
  • MANA REGEN
    • Events
    • Conditions
    • Actions
      • Set real = (Load 1 of integer from HASHMANAREG)
      • Set real = (real + 2.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (unit has buff Brilliance Aura) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (unit has buff Brilliance Aura) Equal to True
            • Then - Actions
              • Set real = (real + 0.75)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (unit has buff Brilliance Aura 2 ) Equal to True
                • Then - Actions
                  • Set real = (real + 1.50)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (unit has buff Brilliance Aura 3 ) Equal to True
                    • Then - Actions
                      • Set real = (real + 2.25)
                    • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (unit has an item of type Sobi Mask) Equal to True
        • Then - Actions
          • Set real = (real x (1.00 + 0.50))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (unit has an item of type Block Regeneration) Equal to True
        • Then - Actions
          • Set real = (real x 0.00)
        • Else - Actions
      • Set integer2 = (Integer(real))
      • Unit - Set mana of unit to ((Mana of unit) + (Real(integer2)))
      • Set real = (real - (Real(integer2)))
      • Hashtable - Save real as 1 of integer in HASHMANAREG


Trigger from the attached map.
 
Level 4
Joined
Dec 24, 2016
Messages
42
  • INIT
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set HASHMANAREG = (Last created hashtable)
  • EVERY 1 SEC
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set group = (Units in (Playable map area) matching (((Matching unit) is alive) Equal to True))
      • Unit Group - Pick every unit in group and do (Actions)
        • Loop - Actions
          • Set unit = (Picked unit)
          • Custom script: set udg_integer = GetHandleIdBJ( udg_unit )
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Inventory (Hero) for (Picked unit)) Greater than 0
            • Then - Actions
              • Set real = (Load 0 of integer from HASHMANAREG)
              • Set real = (real + 0.10)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • real Greater than or equal to 2.00
                • Then - Actions
                  • Set real = 0.00
                  • Trigger - Run MANA REGEN <gen> (checking conditions)
                • Else - Actions
              • Hashtable - Save real as 0 of integer in HASHMANAREG
            • Else - Actions
      • Custom script: call DestroyGroup( udg_group )
  • MANA REGEN
    • Events
    • Conditions
    • Actions
      • Set real = (Load 1 of integer from HASHMANAREG)
      • Set real = (real + 2.00)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (unit has buff Brilliance Aura) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (unit has buff Brilliance Aura) Equal to True
            • Then - Actions
              • Set real = (real + 0.75)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (unit has buff Brilliance Aura 2 ) Equal to True
                • Then - Actions
                  • Set real = (real + 1.50)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (unit has buff Brilliance Aura 3 ) Equal to True
                    • Then - Actions
                      • Set real = (real + 2.25)
                    • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (unit has an item of type Sobi Mask) Equal to True
        • Then - Actions
          • Set real = (real x (1.00 + 0.50))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (unit has an item of type Block Regeneration) Equal to True
        • Then - Actions
          • Set real = (real x 0.00)
        • Else - Actions
      • Set integer2 = (Integer(real))
      • Unit - Set mana of unit to ((Mana of unit) + (Real(integer2)))
      • Set real = (real - (Real(integer2)))
      • Hashtable - Save real as 1 of integer in HASHMANAREG


Trigger from the attached map.

Wow. This is very helpful. I'll try to crack down on it and make work of it. Thank you to both Fruit Forest and Daffa.
 
Status
Not open for further replies.
Top