HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Changing a single unit's max life and mana in-game

02-15-2006, 05:07 PM#1
Blade.dk
(As far as I know, this has not been discovered before, if it has, then I am sorry for this post.)

Anyways, I was making an aura spell for a tutorial when I first discovered this.

The spell was supposed to add 50*level life to units in range.

However, it did not work when I increased the level, it only increased life by the value from level 1, 50, at all levels.

I tested it a lot, and found out that it worked when removing the ability, so if I added the ability and set it's level to 2, it should add 100 life. It only added 50 though, but when the ability was removed it removed the value it was supposed to add but didn't, so it removed 100 life again.

This meant that everytime a unit came out of the aura's range, it's max life was permanently decreased.

This inspired me to make this system, which uses 2 abilities and 2 functions (one of them is only used for configuration though) and can change a unit's max life and mana permanently.

I tested it with life, mana, damage and armor, and it only seemed to work with life and mana.

I know about Bonus Mod, but this system only requires two abilities with 3 levels each and it will have no max bonus limit when being used.

I've uploaded a small demo map using this system to the Samples section, you can get it here.
02-15-2006, 06:04 PM#2
Jacek
I remember working +life on wc3s. What ability are you using?
02-15-2006, 06:09 PM#3
Blade.dk
Tip: To know that, press CTRL+D, and search for the base rawcode that my ability shows.

Anyways, it was based on Item Life Bonus (Greater).

EDIT: The thing you showed me at wc3search has nothing to do with this, so it is not the same kind of "+life".
02-15-2006, 06:28 PM#4
Vexorian
Excellent, I think it needs a tweak though.

Changing life/mana by 1 by one is kind of bad when you use big values, it causes a big loop that crashes the thread.

I would suggest that instead of an ability with 3 levels you have an ability with 5 levels or maybe 7

so it can add 1 or 10 or 100 so it can work better for big changes
02-15-2006, 06:28 PM#5
Ragnarok X
Oh god, this is a very good discovery
02-15-2006, 06:31 PM#6
Blade.dk
It only has three levels now, but yes, that sounds like a good idea, will update it.

EDIT: Will need to add a check so removing 100 life temporarily won't kill a unit, will do that too.
02-15-2006, 06:37 PM#7
Vexorian
It was "mistaketation" I first typed "Instead of 3 have 6 or 9, then I "noted" that the increment was 2 so I correct but instead of changing 6 to 5 I changed 3 to 5. Changed 9 to 7 correctly though
02-15-2006, 07:03 PM#8
Blade.dk
I see, no problem.

Anyways, I've updated it now :).

EDIT: Updated again, removed the check, it was not needed. Also updated it again, the code was improved.
02-16-2006, 12:46 PM#9
Chuckle_Brother
Hmm so this is the cause of the issues I had once apon a time. I had tried making a spell only to find that, as you did, leveling a life bonus spell is less than reliable, and in fact it could kill a unit with some extremely wierd results.

Anyway, goodjob with finally bringing this to light of day.
02-16-2006, 01:30 PM#10
qwertyui
Heh heh
However hard Blizzard tries to hide from us the ways to edit unit object data fields, we still find a way!!!
woot ^^

anyway. Is it possible to actually INCREASE unit health with that ability?

Maybe setting lvl 1 of +life ability to 100hp, and lvl7 to +0hp, and then adding and removing that ability will make it so that unit gets 100 extra hp?
02-16-2006, 01:39 PM#11
Blade.dk
The ability works as it is supposed to at level 1.
02-16-2006, 02:03 PM#12
Jacek
Quote:
Originally Posted by qwertyui
Heh heh
However hard Blizzard tries to hide from us the ways to edit unit object data fields, we still find a way!!!
woot ^^

anyway. Is it possible to actually INCREASE unit health with that ability?

Maybe setting lvl 1 of +life ability to 100hp, and lvl7 to +0hp, and then adding and removing that ability will make it so that unit gets 100 extra hp?
I think as max life increases, life increases too but % is same. So when unit has 50 life and 100 max life (we have 50% of max life). We add her +100 max life so her max is 200 and 50% remains so it will have 100 life. So when you remove ability, it is 100 again, 50% remains it has 50 life.

I can be wrong ;]
02-17-2006, 08:48 AM#13
qwertyui
So, the end result is, you can't increase max hp of unit through that method?
This kinda blows.

But since i can still decrease hp and there is no limit to how much hp a unit can have in the first place, i guess a workaround is possible.
02-17-2006, 04:23 PM#14
Anitarf
Sure you can increase as well. Just use a negative life bonus for one of the ability levels.
02-17-2006, 04:36 PM#15
Vexorian
Quote:
Originally Posted by qwertyui
So, the end result is, you can't increase max hp of unit through that method?
This kinda blows.

But since i can still decrease hp and there is no limit to how much hp a unit can have in the first place, i guess a workaround is possible.
What exactly prevented you from checking the demo map he released? cause there you can see that method working perfectly.