• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Get your art tools and paintbrushes ready and enter Hive's 34th Texturing Contest: Void! Click here to enter!

Max health gaining ability

Status
Not open for further replies.
Level 4
Joined
Sep 2, 2017
Messages
88
Is there any ability like this:

If a hero casts a spell on the unit, that unit dies and the hero gains 100 max health. If he had 1000/1000, now he has 1000/1100.
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
as of now to increase heros hp u need to use the item ability "item life bonus"
give it to your hero and increase it when the hero kills a unit

  • HP increase
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
      • (Level of Your ability for (Killing unit)) Greater than 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of hp bonus for (Killing unit)) Greater than 0
        • Then - Actions
          • Unit - Set level of hp bonus for (Killing unit) to ((Level of hp bonus for (Killing unit)) + 1)
        • Else - Actions
          • Unit - Add hp bonus to (Killing unit)

allthough if u wait for patch 1.29 u can directly increase the hp with out the use of the ability.
 
Level 4
Joined
Sep 2, 2017
Messages
88
I'm new to trigger so I most likely don't understand what you said, because I can't find those options in trigger editor.

Can't find :
-"(Level of Your ability for (Killing unit)) greater than 0"
-"(Level of hp bonus for (Killing unit)) greater than 0"
-"Unit - Set level of hp bonus for (Killing unit) to ((Level of hp bonus for (Killing unit)) + 1)"
-"Unit - Add hp bonus to (killing unit)"

I haven't noticed "greater than" option nowhere.

And yeah, the hero must gain 100 max hp every time he uses a spell and kills the target with it( which is every time).
 
Level 6
Joined
Aug 5, 2017
Messages
251
For "(Level of Your ability for (Killing unit)) greater than 0", make a condition, select "Integer Comparison", select "(Number of units in(Units in(Playable map area)))", then select "Unit - Level of Ability for Unit" and "Level of Ability for (Triggering Unit)" should appear. Change it to what you need. Also, the "integer Comparison" is where you find "Greater than" option. You'll need to change "Equal to" option.
For "Unit - Add hp bonus to (killing unit)", I think hp bonus is a spell in fact. It is confirmed in "Unit - Set level of hp bonus for (Killing unit) to ((Level of hp bonus for (Killing unit)) + 1)".
 
Level 4
Joined
Sep 2, 2017
Messages
88
Okay, I have done the triggers, and I made a custom spell from item life bonus and gave it to the hero but nothing happens.

And yeah, I don't see how this trigger should work. I need to kill the unit with some spell and then the hero should get 100 more max hp. In this trigger I see only "When a unit that has hpBonus(ability) kills enemy unit, the ability will improve 1 level and add additional 100 hp.", but I need this: "When a hero that has hpBonus kills enemy unit with deathCurse(ability with which you must kill in order for hpBonus to level up) the hpBonus will improve 1 level and he will gain 100 hp more".
 
Level 12
Joined
Dec 11, 2014
Messages
665
Had a similar problem. Here.

The point is you need to make the ability have 2 levels, with the level 2 giving 0 hp, then you level the ability and remove it.

Also, in 1.29 they are introducing new natives where you'll be able to manipulate such things with a single action, so no need to use glitches like these, you can just wait for the patch.
 
Level 4
Joined
Sep 2, 2017
Messages
88
I don't get it, how do I need 2 levels? I made 11. First gives 0 hp, second 100, third 200 and so on. With that, hero has from the start that ability, but when he uses his ultimate ability it should change to lvl 2 and hero will get 100 hp. That is the idea.

In regard to your problem, I don't understand JASS, I'm trying to learn trigger but it isn't so easy because you can't even get 1% of needed information that you need to work with from trigger tutorials.

Well, I could wait for 1.29, but don't want to. Haha. I need it as soon as possible to move on, and to learn something in the process. As I said, it is very hard to learn it. If someone had a consistent youtube channel for it, that would be more efficient way of learning.
 
Level 4
Joined
Sep 2, 2017
Messages
88
  • Life
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
      • (Level of hp Bonus for (Killing unit)) Greater than 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of hp Bonus for (Killing unit)) Greater than 0
        • Then - Actions
          • Unit - Set level of hp Bonus for (Killing unit) to ((Level of hp Bonus for (Killing unit)) + 1)
        • Else - Actions
          • Unit - Add hp Bonus to (Killing unit)
Well, that is all I have. All the same as you sent me. :)
 
Level 4
Joined
Sep 2, 2017
Messages
88
Like this:

A spell that kills enemy unit instantly and hero gains 100 max hp.

Correction:

  • hb Bonus
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
      • (Level of Death Conversion for (Killing unit)) Greater than 0
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Death Conversion for (Killing unit)) Greater than 0
        • Then - Actions
          • Unit - Set level of hp Bonus for (Killing unit) to ((Level of hp Bonus for (Killing unit)) + 1)
        • Else - Actions
          • Unit - Add hp Bonus to (Killing unit)
I tried to change first and second condition, and only one of them, but it still doesn't work. :(
 
Last edited:
Level 13
Joined
May 10, 2009
Messages
868
The trick is, "Item Life Bonus" does not work properly with multiple levels. For example, if its level 1 data is set to 100, and 0 to its second level, the unit's HP is not decreased by 100 if you set it to level 2. Then, you just need to remove it in order to repeat the process.

  • HP Bonus
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
      • (Level of Death Conversion for (Killing unit)) Greater than 0
    • Actions
      • Unit - Add HP Bonus to (Killing unit)
      • Unit - Set level of HP Bonus for (Killing unit) to 2
      • Unit - Remove HP Bonus from (Killing unit)
 
Level 4
Joined
Sep 2, 2017
Messages
88
The trick is, "Item Life Bonus" does not work properly with multiple levels. For example, if its level 1 data is set to 100, and 0 to its second level, the unit's HP is not decreased by 100 if you set it to level 2. Then, you just need to remove it in order to repeat the process.

  • HP Bonus
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) belongs to an enemy of (Owner of (Killing unit))) Equal to True
      • (Level of Death Conversion for (Killing unit)) Greater than 0
    • Actions
      • Unit - Add HP Bonus to (Killing unit)
      • Unit - Set level of HP Bonus for (Killing unit) to 2
      • Unit - Remove HP Bonus from (Killing unit)


It works, thanks! :D :D :D

But I really don't understand how does it work. You remove an ability from the hero, he wont have the effect right?
 
Level 4
Joined
Sep 2, 2017
Messages
88
Guys, all of you, thank you very much, you made my day! If anyone needs a hug... hahaha

I learned very much from this spell! I Can not explain the joy! Hahaha :* :* :*
 
Level 4
Joined
Sep 2, 2017
Messages
88
Okay, but now, when he kills a unit and has the spell he will get 100 hp. But he needs to get hp only if he kills with the spell.

Don't know what to select for that either.
 
Level 13
Joined
May 10, 2009
Messages
868
Well, since finger of death doesn't add a buff to its targets, it's impossible to differ whether a player killed a unit with Finger of Death using that event. You should set Finger of Death's damage field to 0., and damage target units via trigger editor. Doing so, you'll be able to detect when finger of death kills a unit.

  • Finger of Death Damage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Finger of Death (Neutral Hostile)
    • Actions
      • Set tmp_unit[0] = (Triggering unit)
      • Set tmp_unit[1] = (Target unit of ability being cast)
      • Custom script: call SetUnitExploded(udg_tmp_unit[1], true)
      • Unit - Cause tmp_unit[0] to damage tmp_unit[1], dealing 2000.00 damage of attack type Spells and damage type Normal
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (tmp_unit[1] is dead) Equal to True
        • Then - Actions
          • Unit - Add HP Bonus to tmp_unit[0]
          • Unit - Set level of HP Bonus for tmp_unit[0] to 2
          • Unit - Remove HP Bonus from tmp_unit[0]
        • Else - Actions
          • Custom script: call SetUnitExploded(udg_tmp_unit[1], false)
 
Level 13
Joined
May 10, 2009
Messages
868
Well, Finger of Death deals damage as soon as it's cast, so you should be fine with that trigger.

The first custom script makes a unit explode when it gets killed. The second one is there to remove that effect, in case the target survives.
 
Level 4
Joined
Sep 2, 2017
Messages
88
I'm new to trigger so I have problem finding all I need from that code and i don't know how to program in Jass. I know only a litlle bit of javasript. Haha
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
Change the whole trigger with is being a spell :/ some reason i thought u wanted it to be a passive

Im not on my cpu so ill do my best to show u the trigger

  • Event
    • Unit - a unit starts the effect of a ability
  • Condition
    • Ability being cast is equal to ( death conversion)
  • Actions
    • Unit - kill (target of ability being cast)
  • --- The hp add on stuff---
Now that i remember instead of the hp bonus ability u can give the hero the tome that gives hp bonus
 
Level 4
Joined
Sep 2, 2017
Messages
88
Done it! It works! Now I learned even more! Haha thanks! :D

If you need anything that I could help you with, just send me a message. :D :*
 
Level 26
Joined
Oct 18, 2008
Messages
951
the thing with the life bonus is a weird exploitable glitch. leveling it up doesn't work for whatever reason. however when you remove it it removes the amount (or negative amount) of life that the unit would have had if the level ups had worked.

sadly the same thing does not work with other item abilities except for mana bonus and they just fail to level. it's a mystery how blizzard even made it like this by accident.
 
Level 4
Joined
Sep 2, 2017
Messages
88
Well, I don't know a lot about trigger but I know a lot about gameplay constants and object editor, and there is a lot of things that don't work in it. I presume that's because blizzard had plans for them but never needed them in the actual game so they didn't finish programming it. :)

I hope that blizzard will concentrate more on editor in the future and make a loooot of improvements and add more things enabling more and easier control of making custom games happen.

I see a lot more potential in WE and that is the reason for blizzard to work on it, but sometimes I remember that this game was made in 2002 and is still more original than 99% of the games today. :D
 
Status
Not open for further replies.
Top