• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Set max hp trigger based?

Status
Not open for further replies.
Level 2
Joined
Jun 3, 2007
Messages
14
Hello and thanks for the time you need to read and answer my question. :)
I'll describe first what I want to do in general, because probably you know an easier way to do it. Its a TD, and right now two factors contribute to the max. hp an incoming creep has: level and difficulty. The max. hp of a unit are set in the units propertys to the max. hp needed for the hardest difficulty, and then get reduced via trigger for lower difficuties. Of cause, this way you see creeps starting with e.g. 50% life all the time, but thats "just" something cosmetic and not my real problem. My real problem is: I want to add a third factor. Currently I do some math at first to figure out the creeps max. hp (which gets reduced by difficulty later, you know). But I know beforehand what kind of armor or special ability (both affect the max. hp) the creep will have, because actually those are determined by level. Now I want to change that and let creeps have e.g. random armor. Long story short: I need a way to calculate the max. hp in-game, because I am not really intrested in creating ~20 simliar looking creeps with different max. hp per level, just to pick one afterwards. :/
Of cause, there is a function like this:
Unit - Set life of (Last created unit) to ((Life of (Last created unit)) x Var)
And while it works great on reducing the actual hp, you cant modify the max. hp nor can you increase the actual hp over the max. hp.

For those who are intrested, I want to do it for >this< map. (Sorry if linking to (own) maps isnt allowed here, but I haven't found a rule against this)

Thanks in advance,
Isdariel
 
Level 10
Joined
Nov 10, 2004
Messages
351
I think he means that he want's a trigger that changes the maximum hp of a unit.

WE doesn't have the option to change max hp, but a guy named Blade.dk made a function that does.
Go to the resource section on wc3campaigns and look for SetUnitMaxState.

If you don't know anything about using jass functions then there's not really any other solution.. Unless the problem isn't changing the max hp ofc..
 
Level 9
Joined
Jul 27, 2006
Messages
652
I take it you want a function that changes a units max Hp?
There is a little JASS ( custom script ) function that does just that.
I don't have a direct link for you but if you just pop in at Wc3campaigns.net and look in the systems section, you should find a system by Blade.dk that does what your asking for...
- Hope this helps...
 
Level 9
Joined
Jul 27, 2006
Messages
652
It also gives problems with the new version of Warcraft...
But yes it did have such a "GUI" trigger action...
 
Status
Not open for further replies.
Top