• 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.

[Trigger] Need trigger help - Health / Mana

Status
Not open for further replies.
Level 3
Joined
Dec 1, 2008
Messages
27
Im looking for a trigger that determines the health of a target so that i can have a move that if they are below a certain HP value it deals more damage for example

Event
Spell is cast

Condition
Spell being cast = Spell

Action
Set variable Caster=Casting unit
Set variable Target=Target of casted spell
(Heres where i want it)
If target less than X hp deal 250 ect ect....

(Im also using WE Unlimited ATM)

Thx for the help
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Firstly, drag WEU from where it is located on your hard disc or memory stick and into your computer's recycling can. WEU is highly dated now and JNGP does pretty much everything it does but without half as many bugs.

Secondly, the fastest way go get a unit's, destructable's or even item's hitpoints is by using the GetWidgetLife() native. However I take it as you are using GUI you would want it within GUI (which it is).

In GUI you have to go to a real field (a field that axcepts real numbers and not integers). It is one of the code options there and is something like unit state. If you want the value in a integer field, you will have to use the integer code option to convert a real to integer and then choose the health code option (will result in loss of number accuracy obviously due to not being able to represent non whole numbers).

If it is not there then GUI is more messed up than I thought, in which case I recommend using the JASS native I provided, which I think is ultimatly the best in the end.
 
Level 6
Joined
Apr 24, 2008
Messages
174
Okay created as you wish...
It's really easy, you dont eaven need the variables but well, if you want them, there they are.

Caster = Unit
Target = Unit
HP = Real

Hope it helps :gg:
 

Attachments

  • Helper01.jpg
    Helper01.jpg
    21.8 KB · Views: 111
Status
Not open for further replies.
Top