Setting max Mp and Hp

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
JJ2197
Legendary Genius
Posts: 1311
Joined: August 8th, 2007, 8:10 am
Title: Legendary Genius²
Location: St. George Utah

Setting max Mp and Hp

Post by JJ2197 »

I was wondering how to set max mp and hp

I tried this

local real=S2R(SubString(s,7,14))
if SubString(s,0,6)=="-setmp"then
call SetUnitState(u,UNIT_STATE_MAX_MANA,Str)
Computer Specs:
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Re: Setting max Mp and Hp

Post by Xantan »

Don't know that you can that easilly
User avatar
JJ2197
Legendary Genius
Posts: 1311
Joined: August 8th, 2007, 8:10 am
Title: Legendary Genius²
Location: St. George Utah

Re: Setting max Mp and Hp

Post by JJ2197 »

I saw that weu had something about it... but I couldn't get it to work... =/
Computer Specs:
Motherboard: GA-990FXA-UD3
CPU: FX-8350 @ 4.0GHz
PSU: Corsair CX500
RAM: G.Skill Ripjaws X 8GB @ 1866
GPU: Radeon HD 4870 1GB
HDD: OCZ Vertex series 30GB SSD
Case: Antec 900
Monitor: Toshiba 32"
OS: Windows 7 Ultimate
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Re: Setting max Mp and Hp

Post by Xantan »

WEU has a few things that USED to work and no longer do I believe, like the Restart(true) and such...
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Setting max Mp and Hp

Post by weirdone2 »

I'm pretty sure this is not possible. o.0 Though you could do something like add some upgrades with hp and mp on them with 100lvls a piece and have each lvl give like 50 mp or hp or so and then just have the cmd research the upgrades but this would effect all the units of the given player. ;/ Or what would probable be better would be to make an ability that give a unit mp or hp and hide it on the unit when you type the cmd. o.0 But either way it will require more then a simple jass insertion. And still be rather limited. :(
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Re: Setting max Mp and Hp

Post by Xantan »

I used to have to import abilities for my way ooold pack, and I think that wouldve been a cool idea back then, but yeah still limited heh =/

GG JJ.
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Setting max Mp and Hp

Post by Aero »

call SetUnitState(u,UNIT_STATE_MAX_MANA,Str)

Already tried things like this. Unfortunately, I havn't considered to explore other options.

Here is what I would explore next though:

Make 6 upgrades, each has 9 levels

Upgrade 1: Adds 1*upgrade level mana
Upgrade 2: Adds 10*upgrade level mana
Upgrade 3: Adds 100*upgrade level mana
Upgrade 4: Adds 1000*upgrade level mana
Upgrade 5: Adds 10000*upgrade level mana
Upgrade 6: Adds 100000*upgrade level mana

This would allow you to add 1-999999 mana to a unit using only 6 upgrades. Fortunately, upgrades take up a tiny amount of space so doing this using upgrades is definitely a viable option. What I would need to check out is how to make it only affect selected units. I might look into this later.
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Setting max Mp and Hp

Post by weirdone2 »

The ability way would be better, you could have like 16abils and then just name them somting like hp1, hp5, hp25, hp100, hp500, hp2500, hp10000, hp50000, and then the mp versions and just have them add the amount in their name. :P So then if they say somting like -maxhp 650 it would give the unit hp500,hp100,hp50. So then you would just have to have a custom function that can detect what i has to use. Aso I'm not positive but I do believe same abils can be stacked on a unit so you could have like hp500 and hp500 twice on same hero and get 1k extra hp. If this is not the case then you would just have to change the abils to say 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536, this would allow you to add anywhere between 1-131071. But would also increase the abils needed by a good bit. :P The Exact increase would be 17 for hp 17 for mp. >:O
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Setting max Mp and Hp

Post by Aero »

Though upgrades are less space intensive, can use any base up to 100 and manipulate higher numbers with less upgrades, a base 2 system with abilties is definitely another viable option that would be unit-specific.

The item abilities that add hp/mp are also smaller compared to spell abilities. I would say abilities is probably the best option.
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Re: Setting max Mp and Hp

Post by Xantan »

Abilities will work for sure as upgrades who knows if you can assign it to a unit, I somehow doubt it.

abilities would work thats sort of intense ;]