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

Damage Bubble Ability

Status
Not open for further replies.
Level 5
Joined
Aug 17, 2014
Messages
106
Does anyone have any idea on how to make or get started on an ability that function almost exactly as Power Word: Shield from World of Warcraft?

I essentially wish to make a spell that upon activation it places a bubble around a character that would shield them for x damage (damage of all types). Once that x damage threshold is met the buff/bubble is destroyed.

Also, I would prefer if this were done using GUI
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
There are a dozen such abilities in the spell section. It is even easy to make one yourself now thanks to new functions added in recent patches.

The current approach is to use a damage detection system and in response to damage modify the damage taken using the recently added functions. The shield itself is tracked like any old instanced effect, possibly using a unit indexing system to give each unit a unique array index to hold the instance data. When the unit takes damage, reduce the damage to damage taken minus the minimum of damage taken and shield remaining and reduce shield remaining by the same amount. When shield remaining is 0 or when the buff expires, clean up.

The old approach was more complex since damage events fire before the damage is dealt to the units health pool but after it is scheduled to be dealt to the units health pool. To stop the unit dying one had to temporarily raise the units health to absorb all the damage, then using a 0 second timeout or other JASS thread deference system, set the units life to the appropriate combat damage amount. Things were made more difficult by multiple damages being able to occur before the thread deference system could fire meaning that a data structure was needed to track the appropriate life the unit should be left with. One could still get other damage based systems bugging out due to receiving incorrect damage or health amounts due to this trick. Some damage detection systems had this functionality built in to help reduce the occurrence of such errors.
 
Status
Not open for further replies.
Top