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

Holy Deliverance Aura

My entry for the Zephyr Contest 11.

Please bear with the cinematic.
Holy Deliverance Aura

Nearby units gain bonus regeneration. Every few seconds, a unit is healed while nearby units receive 25% of such healing. The cooldown is lessened by 0.25 for each instance of damage dealt within the aura's area between an ally and an enemy of the hero.

Every 4 heals done have 50% more efficiency, and also decrease damage taken by 200% for 3 seconds for the healed unit. Activate to immediately heal a unit.

Statistics
Area of Effect: 750
Cooldown: 10/9/8
Heal Amount: 75/100/125 + 200% Int
Heal Cooldown: 7/6/5
Heal Splash Radius: 200/250/300
Regeneration: 1.25/1.5/1.75 + 0.5 per 10% missing health)


  • Configuration
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Note: There are some fields that do not increase on levelups by default but are configurable. --------
      • -------- Those fields not present here are within the Object Editor, such as; --------
      • -------- HDA Cast Range, Cast Time, Ability Cooldowns, Salvation Duration --------
      • -------- -------------------------------------------- --------
      • -------- Ability itself --------
      • Set Config_HD_Ability = Holy Deliverance Aura
      • -------- Spellbook for the Aura --------
      • Set Config_HD_SpellBook = Deliverance (Spellbook)
      • -------- Dummy Type --------
      • Set Config_HD_DummyID = Dummy
      • -------- Dummy Ability --------
      • Set Config_HD_SalvationDummy = Deliverance (Salvation)
      • -------- Salvation Buff --------
      • Set Config_HD_SalvationBuff = Holy Deliverance Aura (Salvation)
      • -------- -------------------------------------------- --------
      • -------- -------------------------------------------- --------
      • -------- Aura Range --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_Range[1] = 750.00
      • Set Config_HD_Range[2] = 750.00
      • Set Config_HD_Range[3] = 750.00
      • -------- -------------------------------------------- --------
      • -------- Area for Heal Splash --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_HealArea[1] = 200.00
      • Set Config_HD_HealArea[2] = 250.00
      • Set Config_HD_HealArea[3] = 300.00
      • -------- -------------------------------------------- --------
      • -------- Heal base amount --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_HealBase[1] = 75.00
      • Set Config_HD_HealBase[2] = 100.00
      • Set Config_HD_HealBase[1] = 125.00
      • -------- -------------------------------------------- --------
      • -------- Cooldown of the heal --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_HealCD[1] = 7.00
      • Set Config_HD_HealCD[2] = 6.00
      • Set Config_HD_HealCD[3] = 5.00
      • -------- -------------------------------------------- --------
      • -------- Cooldown reduction of the passive heal per damage instance --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_HealCDRed[1] = 0.25
      • Set Config_HD_HealCDRed[2] = 0.25
      • Set Config_HD_HealCDRed[3] = 0.25
      • -------- -------------------------------------------- --------
      • -------- Special Effect for Heal --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_HealFx = Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
      • -------- -------------------------------------------- --------
      • -------- Heal Int Scale Percent, in decimal --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_HealScale[1] = 2.00
      • Set Config_HD_HealScale[2] = 2.00
      • Set Config_HD_HealScale[3] = 2.00
      • -------- -------------------------------------------- --------
      • -------- Percentage Healing received by splashed units, in decimal --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_HealSplash[1] = 0.25
      • Set Config_HD_HealSplash[2] = 0.25
      • Set Config_HD_HealSplash[3] = 0.25
      • -------- -------------------------------------------- --------
      • -------- Trigger Fire Rate in seconds --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_Rate = 0.50
      • -------- -------------------------------------------- --------
      • -------- Regeneration Base --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_RegenBase[1] = 1.25
      • Set Config_HD_RegenBase[2] = 1.50
      • Set Config_HD_RegenBase[3] = 1.75
      • -------- -------------------------------------------- --------
      • -------- Regeneration for every 10% missing health --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_Regeneration[1] = 0.50
      • Set Config_HD_Regeneration[2] = 0.50
      • Set Config_HD_Regeneration[3] = 0.50
      • -------- -------------------------------------------- --------
      • -------- Salvation Healing Bonus Percentage, in Decimal --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_SalvationBonus[1] = 0.50
      • Set Config_HD_SalvationBonus[2] = 0.50
      • Set Config_HD_SalvationBonus[3] = 0.50
      • -------- -------------------------------------------- --------
      • -------- How many heals to trigger salvation --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_SalvationCounter[1] = 4
      • Set Config_HD_SalvationCounter[2] = 4
      • Set Config_HD_SalvationCounter[3] = 4
      • -------- -------------------------------------------- --------
      • -------- Salvation Fx --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_SalvationFx = Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
      • -------- -------------------------------------------- --------
      • -------- Salvation Heal Fx --------
      • -------- -------------------------------------------- --------
      • Set Config_HD_SalvationReverseFx = HolyRestoration.mdx
      • -------- -------------------------------------------- --------
      • -------- End of configurables --------
      • -------- -------------------------------------------- --------
      • Custom script: call TriggerRegisterTimerEvent(gg_trg_Deliverance_Aura, udg_Config_HD_Rate, true)
      • Custom script: set udg_Config_HD_RegenBase[1] = udg_Config_HD_RegenBase[1] * udg_Config_HD_Rate
      • Custom script: set udg_Config_HD_RegenBase[2] = udg_Config_HD_RegenBase[2] * udg_Config_HD_Rate
      • Custom script: set udg_Config_HD_RegenBase[3] = udg_Config_HD_RegenBase[3] * udg_Config_HD_Rate
      • -------- ----------------------- --------
      • -------- Variable Creator --------
      • -------- !Delete actions below after copying! --------
      • -------- ----------------------- --------
      • Set HD_Caster[HD_Index] = (Triggering unit)
      • Set HD_Dummy = (Triggering unit)
      • Set HD_Group[A] = (Last created unit group)
      • Set HD_Player[A] = (Picked player)
      • Set HD_HealCD[A] = 0.00
      • Set HD_HealCounter[A] = 0
      • Set HD_Level[A] = 0
JASS:
//////////////////////////////////////////////////////////////////////////////
//    _   _  __    _                                                        //
//   | |_| || _\  /_\                                                       //
//   |  _  |||_))/ _ \                                                      //
//   |_| |_||__//_/ \_\                                                     //
//                                                                          //
//    Holy Deliverance Aura v 1.4                                           //
//               by CakeMaster                                              //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////

function HD_RadarCondition takes nothing returns boolean
    return GetWidgetLife(GetFilterUnit()) > 0.405 and GetWidgetLife(GetFilterUnit()) != GetUnitState(GetFilterUnit(), UNIT_STATE_MAX_LIFE) and IsUnitAlly(GetFilterUnit(), udg_HD_Player[udg_A]) == true
endfunction

function HD_Setup takes nothing returns boolean
    //On init
    local integer i = -1
    loop
        set i = i + 1
        exitwhen i == 15
        call SetPlayerAbilityAvailable(Player(i), udg_Config_HD_SpellBook, false)
    endloop
    set udg_HD_Dummy = CreateUnit(Player(0), udg_Config_HD_DummyID, 0., 0., 0.)
    call UnitAddAbility(udg_HD_Dummy, udg_Config_HD_SalvationDummy)
    return false
endfunction


function HD_LearnedCache takes nothing returns boolean
    local integer i = 0
    local integer c = 0
    local unit u = GetTriggerUnit()
    
    //After a hero learns, cache his data
    if GetLearnedSkill() == udg_Config_HD_Ability then
        loop
            set i = i + 1
            exitwhen i > udg_HD_Index
            if udg_HD_Caster[udg_A] == u then
                set udg_HD_Level[udg_A] = udg_HD_Level[udg_A] + 1
            else
                set c = c + 1
            endif
        endloop
        if c == udg_HD_Index then
            set udg_HD_Index = (udg_HD_Index + 1)
            set udg_HD_Caster[udg_HD_Index] = u
            set udg_HD_Group[udg_HD_Index] = CreateGroup()
            set udg_HD_HealCD[udg_HD_Index] = 0.
            set udg_HD_HealCounter[udg_HD_Index] = 0
            set udg_HD_Player[udg_HD_Index] = GetOwningPlayer(udg_HD_Caster[udg_HD_Index])
            set udg_HD_Level[udg_HD_Index] = 1
            
            //Adds the buffer aura
            call UnitAddAbility(udg_HD_Caster[udg_HD_Index], udg_Config_HD_SpellBook)
            if udg_HD_Index == 1 then
                call EnableTrigger(gg_trg_Deliverance_Aura)
            endif
        endif
    endif
    set u = null
    return false
endfunction


function HD_Detect takes nothing returns boolean
    local integer a = 0
    //Buff check for Salvation (invul + deflect)
    //If a unit already has the buff, it does not prevent from further dummy casts
    if GetUnitAbilityLevel(udg_target, udg_Config_HD_SalvationBuff) > 0 then
        call DestroyEffect(AddSpecialEffect(udg_Config_HD_SalvationReverseFx, GetUnitX(udg_target), GetUnitY(udg_target)))
        call SetWidgetLife(udg_target, (GetWidgetLife(udg_target) + udg_amount))
        set udg_amount = 0.
    endif
    //Buff Application
    loop
        set a = a + 1
        exitwhen a > udg_HD_Index
        //Heal CD Reduction
        if IsUnitInGroup(udg_target, udg_HD_Group[a]) == true or IsUnitInGroup(udg_source, udg_HD_Group[a]) == true then
            set udg_HD_HealCD[a] = udg_HD_HealCD[a] - udg_Config_HD_HealCDRed[udg_HD_Level[udg_A]]
        endif
    endloop
    return false
endfunction


function HD_OnCast takes nothing returns boolean
    local group g
    local real real1 = 0
    local real x
    local real y
    local unit u = GetTriggerUnit()
    local unit u2
    if GetSpellAbilityId() == udg_Config_HD_Ability then
        set udg_A = 0
        loop
            set udg_A = udg_A + 1
            exitwhen udg_A > udg_HD_Index
            if udg_HD_Caster[udg_A] == u then
                set u2 = GetSpellTargetUnit()
                set x = GetUnitX(u2)
                set y = GetUnitY(u2)
                set real1 = udg_Config_HD_HealBase[udg_HD_Level[udg_A]] + (I2R(GetHeroInt(u, true)) * udg_Config_HD_HealScale[udg_HD_Level[udg_A]])
                
                //Salvation
                if udg_HD_HealCounter[udg_A] < udg_Config_HD_SalvationCounter[udg_HD_Level[udg_A]] then
                    set udg_HD_HealCounter[udg_A] = udg_HD_HealCounter[udg_A] + 1
                    call DestroyEffect(AddSpecialEffect(udg_Config_HD_HealFx, x, y))
                else
                    set udg_HD_HealCounter[udg_A] = 0
                    set real1 = real1 * (1. + udg_Config_HD_SalvationBonus[udg_HD_Level[udg_A]])
                    call SetUnitOwner(udg_HD_Dummy, GetOwningPlayer(udg_HD_Caster[udg_A]), false)
                    call IssueTargetOrder(udg_HD_Dummy, "bloodlust", u2)
                endif
                
                //Heal
                call SetWidgetLife(u2, (GetWidgetLife(u2) + real1))
                set real1 = real1 * udg_Config_HD_HealSplash[udg_HD_Level[udg_A]]
                set g = CreateGroup()
                call GroupEnumUnitsInRange(g, x, y, udg_Config_HD_HealArea[udg_HD_Level[udg_A]], Condition(function HD_RadarCondition))
                
                //Area Heal
                loop
                    set u2 = FirstOfGroup(g)
                    exitwhen u2 == null
                    call SetWidgetLife(u2, (GetWidgetLife(u2) + real1))
                    call GroupRemoveUnit(g, u2)
                endloop
                call DestroyGroup(g)
            endif
        endloop
    endif
    set g = null
    set u = null
    return false
endfunction


function Holy_Deliverance takes nothing returns boolean
    local real x
    local real y
    local group g
    local unit u
    local real real1
    local real real2
    local real real3 = 0.
    local unit u2
    set udg_A = 0
    loop
        set udg_A = udg_A + 1
        exitwhen udg_A > udg_HD_Index
        if GetWidgetLife(udg_HD_Caster[udg_A]) > 0.405 then
            set x = GetUnitX(udg_HD_Caster[udg_A])
            set y = GetUnitY(udg_HD_Caster[udg_A])
            
            //Reduce Cooldown
            if udg_HD_HealCD[udg_A] > 0. then
                set udg_HD_HealCD[udg_A] = udg_HD_HealCD[udg_A] - udg_Config_HD_Rate
            else
                set udg_HD_HealCD[udg_A] = 0.
            endif
            
            //Group Enumeration
            call GroupClear(udg_HD_Group[udg_A])
            call GroupEnumUnitsInRange(udg_HD_Group[udg_A], x, y, udg_Config_HD_Range[udg_HD_Level[udg_A]], Condition(function HD_RadarCondition))
            set g = CreateGroup()
            call GroupEnumUnitsInRange(g, x, y, udg_Config_HD_Range[udg_HD_Level[udg_A]], Condition(function HD_RadarCondition))
            set u2 = null
            set real1 = 0. //Lowest Percentage Checker
            set real2 = 100. //Record Tracker
            
            //Check for units to heal
            loop
                set u = FirstOfGroup(g)
                exitwhen u == null
                
                //====================
                //Regen
                set real3 = GetWidgetLife(u)
                set x = GetUnitState(u, UNIT_STATE_MAX_LIFE)
                set y = ((((x - real3) / x) * 100.) * udg_Config_HD_Regeneration[udg_HD_Level[udg_A]]) + udg_Config_HD_RegenBase[udg_HD_Level[udg_A]]
                call SetWidgetLife(u, (GetWidgetLife(u) + y))
                //====================
                
                //Lowest health% unit
                set real1 = (real3 / x) * 100.0
                //Hero priority
                if IsUnitType(u, UNIT_TYPE_HERO) then
                
                    //Makes it appear that the hero has 5% less
                    set real1 = real1 - 5.
                endif
                if real1 < real2 then
                    set real2 = real1
                    set real1 = real2
                    set u2 = u
                endif
                call GroupRemoveUnit(g, u)
            endloop
            call DestroyGroup(g)
            //Radar Checks
            if u2 == null then
                call GroupClear(udg_HD_Group[udg_A])
                //Group is only used for CD Reduction
            else
                if udg_HD_HealCD[udg_A] == 0. then
                    set udg_HD_HealCD[udg_A] = udg_Config_HD_HealCD[udg_HD_Level[udg_A]]
                    set x = GetUnitX(u2)
                    set y = GetUnitY(u2)
                    set real1 = udg_Config_HD_HealBase[udg_HD_Level[udg_A]] + (I2R(GetHeroInt(udg_HD_Caster[udg_A], true)) * udg_Config_HD_HealScale[udg_HD_Level[udg_A]])
                    //Salvation
                    if udg_HD_HealCounter[udg_A] < udg_Config_HD_SalvationCounter[udg_HD_Level[udg_A]] then
                        set udg_HD_HealCounter[udg_A] = udg_HD_HealCounter[udg_A] + 1
                        call DestroyEffect(AddSpecialEffect(udg_Config_HD_HealFx, x, y))
                     else
                        set udg_HD_HealCounter[udg_A] = 0
                        set real1 = real1 * (1. + udg_Config_HD_SalvationBonus[udg_HD_Level[udg_A]])
                        call SetUnitOwner(udg_HD_Dummy, GetOwningPlayer(udg_HD_Caster[udg_A]), false)
                        call IssueTargetOrder(udg_HD_Dummy, "bloodlust", u2)
                     endif
                    //Heal
                    call SetWidgetLife(u2, (GetWidgetLife(u2) + real1))
                    set real1 = real1 * udg_Config_HD_HealSplash[udg_HD_Level[udg_A]]
                    set g = CreateGroup()
                    call GroupEnumUnitsInRange(g, x, y, udg_Config_HD_HealArea[udg_HD_Level[udg_A]], Condition(function HD_RadarCondition))
                    //Area Heal
                    loop
                        set u = FirstOfGroup(g)
                        exitwhen u == null
                        call SetWidgetLife(u, (GetWidgetLife(u) + real1))
                        call GroupRemoveUnit(g, u)
                    endloop
                endif
            endif
            call DestroyGroup(g)
        else
            call GroupClear(udg_HD_Group[udg_A])
        endif
    endloop
    set g = null
    return false
endfunction


//===========================================================================
function InitTrig_Deliverance_Aura takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_HERO_SKILL)
    call TriggerAddCondition(t, Condition(function HD_LearnedCache))
    set t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(t, Condition(function HD_OnCast))
    call TimerStart(CreateTimer(),0.0,false,function HD_Setup)
    set t = CreateTrigger()
    call TriggerRegisterVariableEvent(t, "udg_damageEventTrigger", EQUAL, 1.)
    call TriggerAddCondition(t, Condition(function HD_Detect))
    set t = null
    set gg_trg_Deliverance_Aura = CreateTrigger()
    call DisableTrigger(gg_trg_Deliverance_Aura)
    call TriggerAddCondition(gg_trg_Deliverance_Aura, Condition(function Holy_Deliverance))
endfunction

8/5/14 - 1.0: Uploaded
8/12/14 - 1.1: Updated


Credits: lfh for DamageEvent

Keywords:
Holy, Deliverance, Holy Deliverance, Aura, Holy Deliverance Aura, Cake
Contents

Holy Deliverance Aura (Map)

Reviews
Holy Deliverance Aura | Reviewed by Maker 17.11.2014 Concept[/COLOR]] The concept is based on a standard aura but it has lots of triggered effects which reflects nicely on its originality Triggers[/COLOR]] The spell is easily...

Moderator

M

Moderator


Holy Deliverance Aura | Reviewed by Maker 17.11.2014

[COLOR="gray"

[COLOR="gray"

[COLOR="gray"

[COLOR="gray"

[COLOR="gray"

Concept[/COLOR]]
126248-albums6177-picture66521.png
  • The concept is based on a standard aura but it has
    lots of triggered effects which reflects nicely
    on its originality
Triggers[/COLOR]]
126248-albums6177-picture66521.png
  • The spell is easily configurable and easy to import
126248-albums6177-picture66523.png
  • if *boolean expression* == true then -> if *boolean expression* then
  • GetWidgetLife(GetFilterUnit()) > 0.405 is not the best way to
    detect if a unit is alive.
    In some rare cases dead units acn have more life than that
    not IsUnitType(unit, UNIT_TYPE_DEAD) and GetUnitTypeId(unit) != 0
    should work better
  • The way you handle i and increment it is somewhat weird.
    It would be more logical to start from 0 and use exitwhen
    when the main action has been executed at least once
  • HD_Setup does not need to return anything
  • Destroy the timer that triggers HD_Setup
  • Some of your global variable names are not so great like
    A, source and target
  • You could prevent the ability from being cast on units
    at max life
Objects[/COLOR]]
126248-albums6177-picture66521.png
  • No unneded objects
126248-albums6177-picture66523.png
  • The tooltip could be worded better
    There's an extra bracket and the statistics word is not needed
  • The spell uses an animation the caster unit type does not have
  • You could remove upgrades used from the dummy and reduce its sight radius
Effects[/COLOR]]
126248-albums6177-picture66521.png
  • The effects blend in with each other. You chose them wisely
    I recommend using a custom effect for the healing when used in
    a custom map
Rating[/COLOR]]
CONCEPTTRIGGERSOBJECTSEFFECTSRATINGSTATUS
126248-albums6177-picture75359.jpg
126248-albums6177-picture75358.jpg
126248-albums6177-picture75359.jpg
126248-albums6177-picture75359.jpg
126248-albums6177-picture75358.jpg
APPROVED
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
JASS:
call TriggerRegisterTimerEvent(t, 0., false)
call TriggerAddCondition(t, Condition(function HD_Setup))
--->
JASS:
function HD_Setup takes nothing returns nothing
    //On init
    local integer i = -1
    loop
        set i = i + 1
        exitwhen i == 15
        call SetPlayerAbilityAvailable(Player(i), 'A002', false)
    endloop
    set udg_HD_Dummy = CreateUnit(Player(0), udg_Config_HD_DummyID, 0., 0., 0.)
    call UnitAddAbility(udg_HD_Dummy, udg_Config_HD_SalvationDummy)
    call DestroyTimer(GetExpiredTimer())
endfunction

call TimerStart(CreateTimer(),0.0,false,function HD_Setup)
 
That isn't really required, this isn't a map.

Though a simple explanation would be nice I guess. Looks cool, might test later.

This is a map that contains a spell or a system (triggers). No, it is required to create a description. There is a rule called: Use Common Sense, in the rule section.
 
This is a map that contains a spell or a system (triggers). No, it is required to create a description. There is a rule called: Use Common Sense, in the rule section.

I made quite the mistake, sorry. Forgot about one of the new rules.

"Spells must have an in-game screenshot and an adequate description."

Don't let it go to your ego, Common Sense doesn't mean you have to make a description though. There isn't any other way to show spells/systems as well.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
This is a map that contains a spell or a system (triggers). No, it is required to create a description. There is a rule called: Use Common Sense, in the rule section.
Would you please stop insulting people. That's childish...

EDIT:
@CakeMaster: Yeah, he's right. Add a description and don't forget next time.
 
Would you please stop insulting people. That's childish...

EDIT:
@CakeMaster: Yeah, he's right. Add a description and don't forget next time.

Can you show me the part where I actually insulted him? I haven't.. I just told him that it is required to have description and quoted a rule from the rules. You can't see difference between insults and counseling? Thats your problem.

Edit: Don't spam threads in regards to me being childish or I will have to start reporting you for useless spam. If you have something to say, please private message me.

I was, and am still on mobile. I forgot to put the tooltip when I uploaded, so I just edited the first post. It's hard to update.

No problem, just don't forget to put a description. It helps people to see what they are downloading. :)
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
I quoted it... and I can't seem to find the string "common sense" on the spell submission rules thread. I did find this one though:

spell submission rules thread said:
• JASS code must be written to follow common JASS convention. To find out more about JASS convention, click here.

@Cakemaster: Take your time bro :D, but don't forget to update with the details.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
The local groups g and g2 could be replaced by a single global group, that would eliminate the need to create and destroy 2 groups.
 
You wanted this :S
I hope that I'm not doin all the job for judges. If I shouldn't have posted the improvements, then let me know - I'll delete this post and report it after the constest is over.

At first, as stated: call TimerStart(CreateTimer(), 0, false, function HD_Setup) instead of trigger + condition call.

Lines: call SetPlayerAbilityAvailable(Player(i), 'A002', false) and if ( GetUnitAbilityLevel(udg_target, 'B001') > 0 ) then should have thier id fields configurable.

JASS:
    if GetLearnedSkill() == udg_Config_HD_Ability then
        loop
            set i = i + 1
            exitwhen i > udg_HD_Index
            if udg_HD_Caster[udg_A] == u then
                set udg_HD_Level[udg_A] = udg_HD_Level[udg_A] + 1
            else
                set c = c + 1
            endif
        endloop
Thats some bad design. You do not need two iterators for that.
JASS:
        loop
            exitwhen i == udg_HD_Index

            if udg_HD_Caster[udg_A] == u then
                set udg_HD_Level[udg_A] = udg_HD_Level[udg_A] + 1
				set u = null
				return
            endif

			set i = i + 1
        endloop
With such solution you both, avoid unnecessary operations for already allocated instance and still have clear code.

SetUnitState and GetUnitState into SetWidgetLife and GetWidgetLife in all the cases. There is no excuse not to do that.

JASS:
        if IsUnitInGroup(udg_target, udg_HD_Group[a]) == true then
            set udg_HD_HealCD[a] = udg_HD_HealCD[a] - udg_Config_HD_HealCDRed[udg_HD_Level[udg_A]]
        endif

        if IsUnitInGroup(udg_source, udg_HD_Group[a]) == true then
            set udg_HD_HealCD[a] = udg_HD_HealCD[a] - udg_Config_HD_HealCDRed[udg_HD_Level[udg_A]]
        endif
I believe this could be simplified to:
JASS:
        if IsUnitInGroup(udg_target, udg_HD_Group[a]) or IsUnitInGroup(udg_source, udg_HD_Group[a]) then
            set udg_HD_HealCD[a] = udg_HD_HealCD[a] - udg_Config_HD_HealCDRed[udg_HD_Level[udg_A]]
        endif
Within onCast function, you do not need to create/destroy group within each iteration. Instead provide one group per call or just use global group. GroupEnum clears the group prior enumeration thus you can get rid of those function calls, without dropping safety or leaving code dirty.

In Holy_Deliverance the group issue is also present. You even added additional group while is it can be completely avoided. Get rid of create/destroy spam. Remove GroupClear too.

if IsUnitType(u, UNIT_TYPE_HERO) == true then you do not need to check if it's true. Leave the function alone, the if statement will evaluate condition properly anyway. Similar issues are seen in other lines too.
call IssueTargetOrder(udg_HD_Dummy, "bloodlust", u2)You should be really using ById equivalent here.
"u" local (Holy_Deliverance) does not need to be nulled. Also, you can easily avoid such high amount of reals within that loop function. Just reuse some of them, simplify the approach - I hope you know how to do it.

General:
Some variables are named inappropriately e.g global integer A - this is too generic.
Add proper documentation and make code actually readable - enter line breaks, check identation, don't fill every line break with comment, add like break before given comment instead.

When you fix those, we shall continue.
 
Some variables are named inappropriately e.g global integer A - this is too generic.
Add proper documentation and make code actually readable - enter line breaks, check identation, don't fill every line break with comment, add like break before given comment instead.

It's a temp variable anyways. :goblin_cry:

Thanks for the review, appreciated.

Though I do not think I will be able to fix this anytime soon due to my PC needing a repair.
 

Deleted member 219079

D

Deleted member 219079

I wonder when poll comes up...
 

Deleted member 219079

D

Deleted member 219079

Lol :p btw how does your spell handles hero respawning? Does it give him the aura back?

Edit:
You should check out my tutorial's chapter 5 to get your loops as efficient as possible.

You exit the loop after there is no units in your temp groups g, g2. So, you don't need to null FoG unit as it's null to begin with, secondly you could use global group so you can avoid 2 native calls per temp group. You can see example at my tut's "5.5 : Use variables efficiently".

The tutorial's not approved yet but it's good. There's only one tutorial mod and I wouldn't want to bother him with reviewing the tut again, but yeah I've put a lot to it...

Edit 2:
Add proper documentation and make code actually readable - enter line breaks, check identation, don't fill every line break with comment, add like break before given comment instead.
The code looks readable to me (that's maybe because I write messy code myself lolol :p), expect for function names. But Bannar is right you should make it even more readable; the code readability affects the rating of your resource ;)
 
Top