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

Troubles with Spells

Status
Not open for further replies.
Level 2
Joined
May 21, 2005
Messages
7
Well I'm not sure if it should be here but I'm having troubles with a certain spell.

I want it to do damage according to how much mana you have left. I've tried a lot of different things, but can anyone point me in the right direction as to what I should be looking for?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
This is EXTREMELY simple.
All that is needed is the simplest of triggers.
The trigger should be run when the projeticle hits a unit or when the units casts the spell.

GetUnitState(whichUnit,UNIT_STATE_MANA)
GetUnitState(whichUnit,UNIT_STATE_MAX_MANA)

They return the current and max mana a unit has.
Use them in your formulars to culculate the damage you want the spell to do based on mana.
Then use the native UnitDamageTarget() to damage the target by the culculated damage amount.

GetUnitState(whichUnit,UNIT_STATE_MANA)
This will return the unit's current mana

GetUnitState(whichUnit,UNIT_STATE_MAX_MANA)
This will return the unit's max mana

constant native GetUnitState takes unit whichUnit,unitstate whichUnitState returns real
 
Level 2
Joined
May 21, 2005
Messages
7
Ok I don't understand what you're trying to tell me here... I can't find anything like UNIT_STATE_MAX_MANA or anything remotly close to it. If you could maybe make the trigger and take a screenshot of it... that might help. That is if you want to.

Also by the looks of it, I don't think this is going to do what I want. See I want it so that when you cast a spell it takes your ammount of mana and converts that into a percentage... then uses that percentage to set the amount of damage you do.

Examples
1000 Mana does 100% damage.
90000 Mana does 9000% damage.
100 Mana does 10% damage.

If the trigger you gave me does that, then don't worry about changing it, just thought I would mention it.
 
Status
Not open for further replies.
Top