• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Health and Mana Glitch Exploit

Status
Not open for further replies.
Level 12
Joined
May 22, 2015
Messages
1,051
I have read in a few spots here and there that there is a bug that can be abused to permanently modify max health and mana by:
1) Adding the health or mana ability
2) Setting the ability to a level other than 1
3) Remove the ability

The max health and mana abilities don't level up when you trigger them to, but I head that when you remove them, they remove the higher level amount from the unit. Basically, level 1 of the ability adds 0, and then you use negative of the amount you want to modify for the other levels and then set it accordingly in the trigger and remove it.

Do I understand the bug properly and does this bug still work? I may want to use it, but I don't want to get into it without knowing if it still works and if there are any bad side effects.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
The abilities do level, but because of how they are hardcoded, they do not update the health/mana when they level up but only when you add/remove them.

There is a snippet called SetUnitMaxState which kind of does that but I must say that the functions are in the wrong order.
It works... good, but just something with how it should have been set up.
 
Level 12
Joined
May 22, 2015
Messages
1,051
So does this exploit work?

What is SetUnitMaxState? Is it in common.j?

Does SetUnitState(unit, state, value) allow me to modify UNIT_STATE_MAX_LIFE? I haven't tried seeing what that does, but I assume it doesn't work.
 
I haven't heard of that glitch.

There is one that can be done with handicaps:
http://www.hiveworkshop.com/forums/...hout-needing-glitch-through-abilities-254190/

I wouldn't recommend using that method in a system (since you have to reserve a player, and some people may use that slot for their own purposes), but for personal mapping it should work fine.

The other method (as linked by Wietlol) involves 8 or so abilities based on a binary system. (i.e. +1 hp, +2, +4, +8, +16, +32...)

A third method is tomes. I haven't seen that method used in a long time though.

Your method sounds interesting--I encourage you to test it out and see if you get any good results.
 
Level 12
Joined
May 22, 2015
Messages
1,051
Okay I thought I had read about it. I'll mess around with it some time.

The handicap method actually seems like an awesome way to do it. I don't use neutral passive or neutral hostile in my map (except for certain dummy units - but their health doesn't matter) so I can use it with not problem.

It's by %, but with some math, I think I can make it add any flat amount I want. Not sure if there are other issues with it, though.

Tomes was an idea, but I don't know if spawning lots of items will cause problems or not. I might end up doing that.

The 8+ abilities thing I have already done with damage, so that is actually probably the most simple solution for me. I'm wondering if I could make less object editor data with the tomes though.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Yes it does exist and yes it does still work.

Many item abilities that modify properties do not support level modification, they are clearly missing the handler for level change. They do have the appropriate handler for removal. As a result they will only ever add their level 1 properties however they can remove any level of their properties that they were set to when removed.

The idea is that at level 1 you add the amount you want to add, say 50 hp. Level 2 then adds 0 of the property you want to add. You give the unit the ability, level it up to 2 and then remove it. The unit will permanently gain 50 hp as a result. Many abilities with two levels or a single ability with multiple levels could be used depending on preference.

You can also use tomes to permanently modify attack and health. However these are a lot less efficient and require care so as not to leak (auto consumed items like TFT tomes are not removed).
 
I haven't heard of that glitch.
Wait, what? I consider this "glitch" common knowledge as it has been used for years in the SetUnitMaxState snippet.

And no, you don't need lots of abilities for this, as you can simply abuse ability levels. You just one for Mana and one for Life.

And yes, it does still work.
 
I remember during works on my campaign I had a problem with BonusModLibrary + SetUnitMaxState. I used 3 BonusMods (armor, damage, life regen) and SetUnitMaxState(u, UNIT_STATE_MAX_LIFE, value)

It crashed a thread when looping on many units. For about ~30 units it should work, but for more units it will crash, and it crashed in my campaign. I had to split it to few separate triggers and then was ok
 
Level 12
Joined
May 22, 2015
Messages
1,051
What were you doing in the loop?

I imagine frequent use of these could cause problems, but I only plan to do it on things like:
getting items
dropping items
gaining certain abilities
activating certain abilities

The most expensive use of stat modification I have is 1 second periodic timer that updates damage based on some other factor (% missing health in one case) and it won't be used for max health or mana (doesn't make sense for anything I can think of).
 
Status
Not open for further replies.
Top