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

Changing Ability Data with Triggers

Status
Not open for further replies.
Level 3
Joined
Sep 10, 2012
Messages
39
Greetings. I am attempting to create a few different spells, the effects of which I can only think to accomplish by directly changing the value of an ability's data.
For example, a spell that increases a unit's max life by a percentage of their current max life. There are abilities that can change max life, of course, but only by a fixed amount. If it were possible to change that amount with triggers, I could set the amount to the unit's max life multiplied by, say, .25.
I have not found a method of doing this with GUI and my knowledge of JASS is quite poor, so I am in need of help.
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
You can't change an ability's object data through triggers, either trigger the effect of spell or change ability.
 
Level 3
Joined
Sep 30, 2012
Messages
31
Create a passive ability based off of Item HP Bonus. Call it HP bonus (or whatever you want).

Give it 1000 levels (or as many as you need). Shift-click the editor field to do so, or else it won't let you go past 100.
Set Level 1 = 1 hp, level 2 = 2 hp, etc.

When (unit casts spell)
Add Ability to unit
Set level of ability to 0.25 * max life of unit
Disable Ability for owner of unit

This will grant your unit a passive that gives max life equal to 25% of their max life, then hides the passive from the player so they can't see it. When you want to remove the hp bonus, use "Remove Ability from Unit".

You can use this method for stuff like STR/AGI/INT, HP, MP, armor, damage, etc.

I am using this method of passives in my own map to grant item bonuses without items being in the unit's inventory. Hope this helps, if you are still confused I can upload a map.
 
Status
Not open for further replies.
Top