1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. 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
  3. 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
  4. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  5. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  6. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  7. The results are out! Check them out.
    Dismiss Notice
  8. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  9. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  10. 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.

Savior's Aura v1.1

Submitted by Empirean
This bundle is marked as approved. It works and satisfies the submission rules.
Hi, this is my first spell and is also my entry for the Zephyr Contest #11. The poll is up so i think its ok to upload it in this section. The spell is very simple i hope its approvable.


Tooltip

Emits an aura that heals nearby allied units whenever the bearer of the aura is attacked. Also allows you to force enemy units within 250 radius to attack you.

Level 1 - Heals nearby units based on 30% of the bearer's strength.
Level 2 - Heals nearby units based on 60% of the bearer's strength.
Level 3 - Heals nearby units based on 90% of the bearer's strength.
Level 4 - Heals nearby units based on 120% of the bearer's strength.

Area of Effect: 500
Units that has this ability will not be healed by this aura.



The Code

  • SaviorAuraTriggerConfiguration
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- set the ability that will be the basis for the aura --------
      • -------- - --------
      • Set SA_A_PassiveAbility = Savior's Aura (Container)
      • Set SA_A_ActiveAbility = Savior's Aura (Active)
      • -------- - --------
      • -------- set the buff that the ability will emit --------
      • -------- - --------
      • Set SA_BF_Buff = Savior's Aura
      • -------- - --------
      • -------- if set to true, the amount healed will be based on the percentage of strength of the hero --------
      • -------- if set to false, the number will directly heal units --------
      • -------- please note that 20% is 20.00 and not 0.2 --------
      • -------- - --------
      • Set SA_B_UseStat = True
      • -------- - --------
      • Set SA_R_Heal[1] = 30.00
      • Set SA_R_Heal[2] = 60.00
      • Set SA_R_Heal[3] = 90.00
      • Set SA_R_Heal[4] = 120.00
      • -------- - --------
      • -------- special effects configurables --------
      • -------- attachment point --------
      • -------- - --------
      • Set SA_S_Attach = origin
      • -------- - --------
      • -------- special effects attached to unit --------
      • -------- - --------
      • Set SA_S_SFX = Abilities\Spells\Undead\VampiricAura\VampiricAuraTarget.mdl
      • -------- - --------
      • -------- Area of effect of the aura --------
      • -------- - --------
      • Set SA_R_AoE[1] = 500.00
      • Set SA_R_AoE[2] = 500.00
      • Set SA_R_AoE[3] = 500.00
      • Set SA_R_AoE[4] = 500.00
      • -------- - --------
      • -------- list abilities that unlearns all hero skills --------
      • -------- SA_A_Total is the total number of abilities that can unlearn the spell --------
      • -------- - --------
      • Set SA_I_Total = 1
      • -------- - --------
      • Set SA_A_Unlearn[1] = Tome of Retraining
      • -------- - --------
      • -------- Disable spellbook --------
      • -------- - --------
      • For each (Integer SA_I_TempInt) from 1 to 12, do (Actions)
        • Loop - Actions
          • -------- - --------
          • -------- Disable the spellbook --------
          • -------- - --------
          • Player - Disable SA_A_PassiveAbility for (Player(SA_I_TempInt))
      • Custom script: set bj_wantDestroyGroup=true
      • -------- - --------
      • -------- Check if any there are units that already learnt the ability --------
      • -------- - --------
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • -------- - --------
          • -------- add the picked unit into a variable --------
          • -------- - --------
          • Set SA_U_Picked = (Picked unit)
          • -------- - --------
          • -------- Check if the unit has leveled the ability --------
          • -------- - --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of SA_A_ActiveAbility for SA_U_Picked) Greater than 0
            • Then - Actions
              • -------- - --------
              • -------- add the actual aura to the picked unit --------
              • -------- - --------
              • Unit - Add SA_A_PassiveAbility to SA_U_Picked
            • Else - Actions


  • SaviorAuraEffect
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
      • (Level of SA_A_ActiveAbility for target) Greater than 0
      • (source belongs to an enemy of (Owner of target)) Equal to True
    • Actions
      • -------- - --------
      • -------- Set the attacked unit --------
      • -------- - --------
      • Set SA_U_AtkUnit = target
      • -------- - --------
      • -------- Determine the owner of the unit --------
      • -------- - --------
      • Set SA_PL_Player = (Owner of SA_U_AtkUnit)
      • -------- - --------
      • -------- set the level of the ability into a variable --------
      • -------- - --------
      • Set SA_I_Level = (Level of SA_A_ActiveAbility for SA_U_AtkUnit)
      • -------- - --------
      • -------- Checks on what value should be applied on the aura's healing effect --------
      • -------- - --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • SA_B_UseStat Equal to True
        • Then - Actions
          • -------- - --------
          • -------- if this is applied then the heal value is equal to a certain percentage of the attacked unit's strength --------
          • -------- - --------
          • Set SA_R_HealAmt = ((Real((Strength of SA_U_AtkUnit (Include bonuses)))) x (SA_R_Heal[SA_I_Level] x 0.01))
        • Else - Actions
          • -------- - --------
          • -------- if this is applied, then the heal amount is equal to the predefined value in the trigger configuration --------
          • -------- - --------
          • Set SA_R_HealAmt = SA_R_Heal[SA_I_Level]
      • -------- - --------
      • -------- sets the position of the attacked units into a variable --------
      • -------- - --------
      • Set SA_P_AtkPos = (Position of SA_U_AtkUnit)
      • -------- - --------
      • -------- selects the valid units that can be healed --------
      • -------- - --------
      • Set SA_UG_UnitGroup = (Units within SA_R_AoE[SA_I_Level] of SA_P_AtkPos)
      • -------- - --------
      • -------- heals the picked units --------
      • -------- - --------
      • Unit Group - Pick every unit in SA_UG_UnitGroup and do (Actions)
        • Loop - Actions
          • Set SA_U_Picked = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (SA_U_Picked is dead) Equal to False
              • (SA_U_Picked belongs to an ally of SA_PL_Player) Equal to True
              • (SA_U_Picked is A structure) Equal to False
              • (SA_U_Picked is Magic Immune) Equal to False
              • (SA_U_Picked has buff SA_BF_Buff) Equal to True
              • (Level of SA_A_PassiveAbility for SA_U_Picked) Less than 1
            • Then - Actions
              • -------- - --------
              • -------- sets the picked unit into a variable --------
              • -------- its ok to recycle this variable isn't it? --------
              • -------- - --------
              • -------- - --------
              • -------- Heals the picked unit --------
              • -------- - --------
              • Unit - Set life of SA_U_Picked to ((Life of SA_U_Picked) + SA_R_HealAmt)
              • -------- - --------
              • -------- Add some visuals --------
              • -------- - --------
              • Special Effect - Create a special effect attached to the SA_S_Attach of SA_U_Picked using SA_S_SFX
              • -------- - --------
              • -------- destroy visuals to prevent leaks --------
              • -------- - --------
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • Set SA_U_Picked = No unit
      • -------- - --------
      • -------- Clean up --------
      • -------- - --------
      • -------- SA_UG_UnitGroup.Clear(); --------
      • -------- Clear the unit group --------
      • -------- - --------
      • Unit Group - Remove all units from SA_UG_UnitGroup
      • -------- - --------
      • -------- Destroy the instance of the unit group --------
      • -------- - --------
      • Custom script: call DestroyGroup(udg_SA_UG_UnitGroup)
      • -------- - --------
      • -------- Destroy the point --------
      • -------- - --------
      • Custom script: call RemoveLocation(udg_SA_P_AtkPos)



credits

Dat-C3 - for adding damage detection and for helping on a lot of stuff.
looking_for_help aka eey - for his damage detection system.


Keywords:
holy,passive,savior,aura,human,heal
Contents

Savior's Aura (Map)

Reviews
Moderator
19:33, 9th Jan 2015 IcemanBo: Simple concept. Code works fine. Approved. http://www.hiveworkshop.com/forums/spells-569/saviors-aura-v1-1-a-256071/index2.html#post2638132
  1. Empirean

    Empirean

    Joined:
    Jun 20, 2014
    Messages:
    390
    Resources:
    8
    Spells:
    8
    Resources:
    8
    @Dalvengyr... thanks. Dat-C3 helped me on adding the DDS he should be credited as well
     
  2. Quilnez

    Quilnez

    Joined:
    Oct 12, 2011
    Messages:
    3,251
    Resources:
    37
    Icons:
    2
    Tools:
    1
    Maps:
    7
    Spells:
    21
    Tutorials:
    2
    JASS:
    4
    Resources:
    37
    If I remember it correctly, he is just adding spellbook ability on that trigger. You only need to add it once at ability level 1. Except if he is adding different abilities and assigning different values/datas on each level, then the first condition shouldn't be changed.
     
  3. Mythic

    Mythic

    Joined:
    Apr 24, 2012
    Messages:
    7,734
    Resources:
    103
    Models:
    87
    Icons:
    5
    Maps:
    3
    Spells:
    6
    Tutorials:
    2
    Resources:
    103
    Damn, I thought it was the heal trigger. It doesn't seem to be included in the first post.
     
  4. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,190
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Dead units can not have buffs.
     
  5. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,181
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    • Only need to add the passive ability once. Not each level.
    • User could be warned in config the AOE to be exactly the same as the AOE of the passive in object editor.
      Else the buff check could fail.
    • In your filter for healing, you could check if the unit is in UnitGroup (boolean), instead of checking for ability level. (integer) Result is same, but for me it's simpler and clear.

    Approved (please add the warning in a short comment)

    @Maker, it's checked if it's dead equals to false:

    • (SA_U_Picked is dead) == False
    • ....
    • (SA_U_Picked has buff SA_BF_Buff) == True
     
  6. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,190
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    Yes, and dead units can not have buffs. So there is no need to check if the unit is alive or not, if you are also checking if it has the buff.

    If a unit has the buff, then it is alive.
     
  7. IcemanBo

    IcemanBo

    Joined:
    Sep 6, 2013
    Messages:
    6,181
    Resources:
    22
    Maps:
    3
    Spells:
    11
    Template:
    1
    Tutorials:
    4
    JASS:
    3
    Resources:
    22
    Indeed. You are right.. I misundertsood it.

    So the check if unit is alive is not needed.
     
  8. Empirean

    Empirean

    Joined:
    Jun 20, 2014
    Messages:
    390
    Resources:
    8
    Spells:
    8
    Resources:
    8
    I will revisit this spell and upload a better version soon.