1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  5. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  6. Vote for the best entries in the 13th Music Contest Poll.
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Damage Bubble Ability

Discussion in 'World Editor Help Zone' started by Recklessness, Jan 27, 2019.

  1. Recklessness

    Recklessness

    Joined:
    Aug 17, 2014
    Messages:
    81
    Resources:
    0
    Resources:
    0
    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
     
  2. Devalut

    Devalut

    Joined:
    Feb 9, 2009
    Messages:
    1,083
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Check out my resource Bone Armor!

    Make the ability base ability Berserk (Very good since it doesn't interrupt orders.)
    and change any instance of "target of the ability being cast to triggering unit!
     
  3. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,815
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    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.