HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Increase a units HP, Damage, Defense via trigger

09-27-2009, 05:51 AM#1
Steelbom
Hi, I'm wondering how to increase a units max HP, damage, and defense via trigger? in either GUI or Jass.

Kind Regards
09-27-2009, 12:44 PM#2
Tot
Earth-Fury's BonusMod/SetUnitMaxState (somewhere on hiveworkshop.com)
09-27-2009, 03:21 PM#3
Rising_Dusk
There was a script here that used to do that, but the author ragequit the site. If you want to add/remove those things you talk about in the first post, you'll need to do so by adding abilities to the unit in question that either add or remove armor/whatever.
09-27-2009, 05:02 PM#4
Storyyeller
If you only want a prespecified amount, and don't mind magic immunity as well, you could try Avatar.
09-27-2009, 05:54 PM#5
Earth-Fury
Quote:
Originally Posted by Tot
Earth-Fury's BonusMod/SetUnitMaxState (somewhere on hiveworkshop.com)

http://www.wc3c.net/showthread.php?t=107451

BonusMod isn't submitted here. it's at THW.

http://www.hiveworkshop.com/forums/j...axstate-65622/

(Please use the UnitMaxState library here. The one at THW is outdated.)

Both are vJass, but use simple JASS APIs. (No structs or anything.)
09-28-2009, 06:26 AM#6
Tot
@Earth-Fury:
Can you please submit BonusMod and SetUnitMaxState here?
Cause many systemes would benefit from them, but only submissions without any system that isn't submitted here will be approved.
09-28-2009, 07:11 AM#7
Newuser
If you don't mind using abilities, you can just use the item abilities which add HP, damage, and armor and just add them to the unit using triggers.

Also make the abilities have multiple levels so you can define the amount of stats you want to add.

For example, you can have HP boost have 10 levels with +100HP at level 1, +200 HP at level 2, etc.

If you wanted to add +200 HP to a unit, add the HP boost ability then set it to the level 2.

Those abilities do not have icons so you don't have to hide them in spell books or anything.
09-28-2009, 09:41 PM#8
Drain Pipe
i don't know if they ever fixed it, but last time i checked, leveling health bonus abilities doesn't work, it only gives anything more than that you started with when you remove the ability, which is when it removes the correct amount of hp. You can work around this by making abilities with 0 bonus hp at level 1 and -X bonus hp at level X. Then set the level and remove, and it'll give the unit bonus hp.
09-28-2009, 09:47 PM#9
Rising_Dusk
Quote:
Originally Posted by Tot
Can you please submit BonusMod and SetUnitMaxState here?
UnitMaxState is already here, he even linked to it.
09-29-2009, 01:42 AM#10
TheKid
Modifying Attack Damage
Create 8 abilities based off of Item Damage Bonus, each with 2 levels. Each ability should have a level for adding, and a level for removing (positive/negative damage bonuses).
  • Ability A : +1, -1
  • Ability B : +2, -2
  • Ability C : +4, -4
  • Ability D : +8, -8
  • Ability E : +16, -16
  • Ability F : +32, -32
  • Ability G : +64, -64
  • Ability H : +128, -128

Since damage ability bonuses don't stack with each other, you need to use a binary counting system. For instance, if you wanted to have 38 damage; you would add the ability with +32, then add the ability with +4, then add the ability with +2.

This will give you a spectrum of +255 to -255 damage. Having more abilities increases this amount, but with 8 abilities using binary counting you can get to 255 (probably the best way).

Armor Modifying
Armor is modified the exact same way damage is, but with an array of abilities based on Item Defense Bonus (or whatever its called). Follow the method I stated for modifying attack damage.

Unit Max Life Modifying
Items that modify a unit's maximum life amount stack with each other, so if you added one ability that added +100 twice, it would yield +200 maximum life. Create an ability based off of a life-modifying ability and give it a few levels, each level incrementing by a multiple of 10:
  • Level 1 : +1 HP
  • Level 2 : +10 HP
  • Level 3 : +100 HP
  • Level 4 : +1000 HP
  • Level 5 : -1 HP
  • Level 6 : -10 HP
  • Level 7 : -100 HP
  • Level 8 : -1000 HP

If you wanted a result of +6 life, you would simply add the ability and set it to level 1; do this 6 times. If you wanted a result of -230 life, you would add the ability twice at level 7 (-100 life) and then add it again 3 times at level 6 (-10 life). Here is what we have:

(-100) + (-100) + (-10) + (-10) + (-10) = -230

Hope this helps.
09-29-2009, 11:12 AM#11
Captain Griffen
Quote:
Originally Posted by TheKid
Modifying Attack Damage
Create 8 abilities based off of Item Damage Bonus, each with 2 levels. Each ability should have a level for adding, and a level for removing (positive/negative damage bonuses).
  • Ability A : +1, -1
  • Ability B : +2, -2
  • Ability C : +4, -4
  • Ability D : +8, -8
  • Ability E : +16, -16
  • Ability F : +32, -32
  • Ability G : +64, -64
  • Ability H : +128, -128

More efficient object editor wise to have one big negative and the rest positive.
09-29-2009, 02:34 PM#12
Anitarf
Quote:
Originally Posted by Captain Griffen
More efficient object editor wise to have one big negative and the rest positive.
You could have some sort of a smart system with this setup, though. For a bonus of 127 you could use 128 and -1 instead of 1,2,4,8,16,32 and 64. That is probably not a significant improvement, though, such a smart setup is more applicable to higher base operations which can only be done with stackable abilities such as the hp ability trick.
09-29-2009, 06:11 PM#13
Tot
Quote:
Originally Posted by Rising_Dusk
UnitMaxState is already here, he even linked to it.


BonusMod, isn#t --> force EF to submit BonusMod here

PEDANT
09-29-2009, 06:30 PM#14
Anachron
I like Bonus Mod more,... Its nearly the same, but as I said, its not the same.
09-29-2009, 07:13 PM#15
Tot
yea...bonus-mod rulez


grr...american keyboard :emote_berserkergang: