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 havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. 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.

Request a Trigger

Discussion in 'Triggers & Scripts' started by MultiGod, Apr 21, 2010.

  1. MultiGod

    MultiGod

    Joined:
    Jan 17, 2009
    Messages:
    721
    Resources:
    0
    Resources:
    0
    Is there any way to increase a Hero-With-Full-Inventory 's health by the trigger editor?

    +ReP to helpers.

    Thx, MultiGod.
     
  2. PurgeandFire

    PurgeandFire

    Code Moderator

    Joined:
    Nov 11, 2006
    Messages:
    7,426
    Resources:
    18
    Icons:
    1
    Spells:
    4
    Tutorials:
    9
    JASS:
    4
    Resources:
    18
    You could try tomes (but there are probably some drawbacks). Otherwise, just make them drop an item, give them the item with the health bonus to use, and then just make them pickup the item again.
     
  3. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,181
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Look at the item ability Item Permanent Life Gain.

    Create three copies of it, one with +100, one with +10 and one with +1 for example.

    Then create three different items (use manual of health as the base item), Manual of +100 health, +10 health and +1 health and give those abilites to them.

    Then you can use this trigger:

    Trigger
    • Untitled Trigger 003
      • Events
        • Unit - A unit enters Region 000 <gen>
      • Conditions
      • Actions
        • Set Temp_Integer_1 = 153
        • For each (Integer A) from 1 to 10, do (Actions)
          • Loop - Actions
            • Set Temp_Integer_1 = (Temp_Integer_1 - 100)
            • Hero - Create Manual of Health 100 and give it to (Triggering unit)
            • Item - Remove (Last created item)
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Temp_Integer_1 Less than 100
              • Then - Actions
                • For each (Integer B) from 1 to 10, do (Actions)
                  • Loop - Actions
                    • Set Temp_Integer_1 = (Temp_Integer_1 - 10)
                    • Hero - Create Manual of Health 10 and give it to (Triggering unit)
                    • Item - Remove (Last created item)
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • Temp_Integer_1 Less than 10
                      • Then - Actions
                        • For each (Integer loopA) from 1 to 10, do (Actions)
                          • Loop - Actions
                            • Set Temp_Integer_1 = (Temp_Integer_1 - 1)
                            • Hero - Create Manual of Health 1 and give it to (Triggering unit)
                            • Item - Remove (Last created item)
                            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                              • If - Conditions
                                • Temp_Integer_1 Equal to 0
                              • Then - Actions
                                • Skip remaining actions
                              • Else - Actions
                      • Else - Actions
              • Else - Actions


    If it's temporary bonus, just save how many of each items you created for the hero.

    Create three items with -100, -10 and -1 health bonuses. Click shift + Enter when setting negative values.

    Then when the health should be lost, create three loops and give the unit the negative tomes.
     
  4. M0RT

    M0RT

    Joined:
    Apr 15, 2008
    Messages:
    1,067
    Resources:
    6
    Maps:
    3
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    6
    Using items is a bad idea, they don't get removed after use and leak.

    Instead use "+HP bug". The ability that permanently increases hero HP ("Item hero health bonus" or something like that) only modifies HP on add/remove, not when it changes level. So you can make such ability that adds +11 HP on first level, +1 on second and then add it (hero gets +11HP), set it to level 2 (no change) and remove it (hero loses 1 HP).
    That way you can increase HP permanently (also works for the according mana bonus ability)
     
  5. MultiGod

    MultiGod

    Joined:
    Jan 17, 2009
    Messages:
    721
    Resources:
    0
    Resources:
    0
    What I want is like: When that hero somehow kills a unit in certain conditions, his health will increase by X, and it will happen more than 10 times.

    I tried using tomes, but the tome ended up spawning at the hero's legs. Any ideas?
     
  6. M0RT

    M0RT

    Joined:
    Apr 15, 2008
    Messages:
    1,067
    Resources:
    6
    Maps:
    3
    StarCraft II Resources:
    1
    Tutorials:
    2
    Resources:
    6
    As I said, create an ability based on "Item Life bonus" with two levels, first level adds X+1 HP, second level 1 HP. Then, in the trigger, just:
    1. Add this ability
    2. Set it to level 2
    3. Remove it
    It will leave the hero with X bonus health.
     
  7. MultiGod

    MultiGod

    Joined:
    Jan 17, 2009
    Messages:
    721
    Resources:
    0
    Resources:
    0
    Hmm... Testing... Will post sooner or later.

    EDIT: Tested! Worked really great! I didn't know this could really work. Sorry for doubting you. Thx and +ReP!
     
    Last edited: Apr 21, 2010