1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Ride into the sunset with the 32nd Modeling Contest. The contest is optionally paired. Best of luck, people!
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Item that Removes Mana Regeneration?

Discussion in 'World Editor Help Zone' started by AquaFire, Dec 26, 2016.

  1. AquaFire

    AquaFire

    Joined:
    Dec 24, 2016
    Messages:
    42
    Resources:
    0
    Resources:
    0
    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.
     
  2. Fruit Forest

    Fruit Forest

    Joined:
    May 16, 2016
    Messages:
    733
    Resources:
    1
    Maps:
    1
    Resources:
    1
    You have to use triggers.
     

    Attached Files:

  3. AquaFire

    AquaFire

    Joined:
    Dec 24, 2016
    Messages:
    42
    Resources:
    0
    Resources:
    0
    Huh. I appreciate the help, but I am unable to open the w3x file. I think it would be simpler to tell me how to approach it.
     
  4. Fruit Forest

    Fruit Forest

    Joined:
    May 16, 2016
    Messages:
    733
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I can't explain using the text. Why are you unable to open it?
     
  5. Daffa

    Daffa

    Joined:
    Jan 30, 2013
    Messages:
    7,947
    Resources:
    29
    Packs:
    1
    Maps:
    8
    Spells:
    18
    Tutorials:
    2
    Resources:
    29
    • 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.
     
  6. LordDz

    LordDz

    Joined:
    May 11, 2007
    Messages:
    4,305
    Resources:
    0
    Resources:
    0
    Download the map and then open it in the World Editor.
    If you can't open maps, you're going to have a very large problem with learning to create maps.
     
  7. AquaFire

    AquaFire

    Joined:
    Dec 24, 2016
    Messages:
    42
    Resources:
    0
    Resources:
    0
    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.
     
  8. wc3neverdies

    wc3neverdies

    Joined:
    Sep 20, 2015
    Messages:
    369
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Just a tip: i had to to a thing like this in the past, if the unit is a hero be sure to change mana regeneration from intelligence points, you can find it in
    Advanced > gameplay costants