HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Unit Max Health

01-04-2004, 04:06 AM#1
AntJAB
I can figure out how to turn a unit's max health into a variable easy enough I'm sure, but after that I could use some advice.

After I manipulate the number how I want, how would I then replace a unit with that variable?

In essence I want to take a unit's max health/mana, add/subtract from them, and then replace the max health/mana with the new number.

It's the replacing part that has me stumped.

Keeping this out of JASS or whatnot would be nice too, I havn't learned those languages yet.

Thanks.
01-04-2004, 05:38 AM#2
AntJAB
Another stupid question...

I want to have the lightning bolt dodad strike once on a spot.
I know very little on doodads
I placed it, and began the trigger.
I toggle it on, but for how long should it be on to just flash once?
01-04-2004, 05:57 AM#3
ChaosWolfs
so your saying that you want to change the unit's max health in game?
01-04-2004, 02:30 PM#4
linkmaster23
yes thats what hes saying. YAY i might learn something...*waits patiently*
01-04-2004, 03:12 PM#5
AntJAB
My basic main goal is to have a unit step into a location, circle of power or whatnot, activate a switch, and then...

E - Doodad destroid
C - Doodad = switch
C - Unit standing in (location) = owned by player of triggering unit
A - If unit = Grunt then:
Select unit
Set [maxhealth] = selected unit's max health
Set [maxmana] = selected unit's max mana
(arethmatic) [maxhealth] * 3= [maxhealth]
(arethmatic) [maxmana] * 3= [maxmana]
Set selected unit's max health = [maxhealth]
Set selected unit's max mana = [maxmana]
Else:
Do nothing
A - Reset switch

[maxhealth] and [maxmana] being variables of course. I'm not sure if they should be integers or real or what, never was good at that part.

What happens aobve is similar to what I want to to, (don't want to give away the core of the map's uniqueness just yet) take a units max healt, multipy it by three, and then replace the max health. Thus making the unit three times as powerful as the other.
(My next question of course, can you do the same with wih a unit's attack damage and defence?)

If this can't be done without JASS it doesn't matter.
I found a way around it, but it would just be way more time consuming.


Edit: Wow, I can't spell. :bgrun:
01-04-2004, 06:23 PM#6
AntJAB
If anyone wants to figure out the above, please do, but I no longer need it.


I am really having a bitch with:

I want a player to be able to make a building.
Whenever three units of the same type (three grunts, three footmen, etc.) come within rage (300ish) of the building, actions take place.

I can't figure out for the life of me how to get the conditions and events to observe for when three units of the same type are within range.

I've run through a bunch of different set-ups, and all I've gotten now is a big head ache.


Three units of the same type are within range of another (non-preset, but specific type) building.
--depending on the type of the units, the type of the unit created will be selected--
Kill those three units.
Create new unit at random point within range of building.


Also figureing out how to do the same thing, but with three specific unit types instead of one.

Grunt, Footman, and Archer come within range of (non-preset, specific type) building.
Kill Grunt, Footman, and Archer.
Create Ghoul at random point within range of building.


If I can figure those two out, I won't even need the max health editing.