• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

SetUnitMaxState

Status
Not open for further replies.
Level 10
Joined
Apr 3, 2006
Messages
535
thanks, i checked out th elink but i still need some help with someone who understands it alot more than i do. I am still not sure how i can use this exploit to ensure my hero stays at a set amount of mana regardless of picking up any +mana items, could someone give em an example or have a go it this?

many thanks
 
Level 4
Joined
Dec 9, 2008
Messages
52
So the idea is that normally if you have 100/100 mana and you pick up a +100 mana item you'll end up with 200/200 mana. And that instead you want the player to pick up a +100 mana item and end up with 100/200 mana?

Well you could just have a frequently called trigger that stores a unit's mana in a hashtable. So every .01 seconds you record your unit's mana. And then if your unit picks up an item you set its mana to the recorded value in the hashtable.
 
Level 4
Joined
Dec 9, 2008
Messages
52
That would work if they have 100/100 already when they pick up the +100 mana item. If they have 50/100 and pick up the +100 mana item, I dont think their mana goes to 150/200. I think it goes to the ratio, which would be 100/200. And then in that case you'd set their mana from 50/100 to 0/200.
 
Level 10
Joined
Apr 3, 2006
Messages
535
Is it possible to stop items with intelligence, giving +mana to certain hero?

I have a warrior based class that uses rage similar to WoW so I want its maximum mana to constantly stay at 100, my problem being if it picks up items with +mana or intelligence the maximum goes up. Is there a way to do this without having to manually trigger every item that has mana and make the hero drop it?

WOuld the hash table idea be able to do this? and also how do i go about using it i have no idea how this would work
 
Level 6
Joined
Mar 20, 2008
Messages
208
Is it possible to stop items with intelligence, giving +mana to certain hero?

I have a warrior based class that uses rage similar to WoW so I want its maximum mana to constantly stay at 100, my problem being if it picks up items with +mana or intelligence the maximum goes up. Is there a way to do this without having to manually trigger every item that has mana and make the hero drop it?

WOuld the hash table idea be able to do this? and also how do i go about using it i have no idea how this would work

Hash table is kinda a manual trigger.


JASS:
    call SetUnitState(u, UNIT_STATE_MAX_MANA, 100)

I don't know if you can change maximum states, but you could trigger that every time that specific hero picks up or drops an item and see if it works.
 
Level 10
Joined
Apr 3, 2006
Messages
535
problem is, it is not a specific hero it would have to be a unit type, beause you choose from a list of heroes ot play as so the hero willn ot be on the map to begin with, also it is unkwon which player will select the hero type i need to the mana states to
 
Level 6
Joined
Mar 20, 2008
Messages
208
Just set and check the hero point values in the object editor. Its a free, unused, variable as far as I know.
 
Level 10
Joined
Apr 3, 2006
Messages
535
yea as long as the maximum does not exceed 100 due to items with +mana or +intelligence on them i dont mind.

Is this possible in GUI, or do i need a JASS person :p
 
I mean, why don't you simply set the current mana of the hero to 100 when it goes beyond 100? It can be done simply in GUI.

Create a periodic trigger that goes off every second and pick every unit matching whatever type. Then just check if they have more than 100 mana and set it to 100 if they do.

Otherwise, it would be rather difficult to tweak the max mana of the hero everytime it goes above 100.

PS: If you don't understand the SetUnitMaxState, its rather simple how its done:
When you add a +hp/mp skill to a unit, the unit gains the bonuses. However, when you level the skill, the bonuses are still that of level 1. When you remove it, it removes the health based on the current bonuses that the level of the ability is supposed to give.

Therefore, if Level 1 gives 100 health, and level 2 gives 0 health, you can use this to add 100 health.

Add The ability.
Set It to level 2.
Remove it.

It can be done for mana too. You can try doing this whenever your hero acquires an item and use some conditions and loops or something to check how much mana you need to take away.
 
Status
Not open for further replies.
Top