• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[GUI] Divine Protection v1.2

By Archangel678
[rainbow]Divine Protection[/rainbow]

Divine Protection - Target Point, Targeting Image

Ingame Description -


The caster calls for the heavens, and causing all friendly units in an area to become invulnerable, while causing damage per second to hostile units. If a unit leaves the area, the effects will cease upon the unit.

Level 1 - Duration - 10
AoE - 500
Damage Per Second - 24

Level 2 - Duration - 12
AoE - 600
Damage Per Second - 30

Level 3 - Duration - 14
AoE - 700
Damage Per Second - 36


  • MapInt
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Hash_Divine = (Last created hashtable)
      • -------- ======================== --------
      • -------- ======================== --------
      • -------- The constant AoE. Its the X + (Number). It does not increase with each level. --------
      • Set DivAoEB = 400.00
      • -------- This is the number that increases with each level. It is multiplied with every level and added to the constant. --------
      • Set DivAoEI = 100.00
      • -------- ======================== --------
      • -------- ======================== --------
      • -------- Use this to set your dummy unit. --------
      • Set DivDummy = DivineDummy
      • -------- ======================== --------
      • -------- ======================== --------
      • -------- The constant duration. Does not increase with each level. If the "DivCountMAX" is 33, it'll be around one second each. --------
      • Set DivDurationB = 8
      • -------- This is the duration that increases with each level, note that it is multiplied by the level of the ability. --------
      • Set DivDurationI = 2
      • -------- ======================== --------
      • -------- ======================== --------
      • -------- Special Effects (SFX) --------
      • -------- ======================== --------
      • -------- ======================== --------
      • -------- Effect A is the effect made on units in the first cast area... --------
      • Set DivEffectA = AbilitiesSpellsHumanSpellStealSpellStealMissile.mdl
      • -------- ======================== --------
      • -------- ======================== --------
      • -------- Effect B is on unit that enter the effect area. --------
      • Set DivEffectB = AbilitiesSpellsHumanHolyBoltHolyBoltSpecialArt.mdl
      • -------- ======================== --------
      • -------- ======================== --------
      • -------- Effect C is the effect that is made on units that level the area. --------
      • Set DivEffectC = AbilitiesSpellsHumanDispelMagicDispelMagicTarget.mdl
      • -------- ======================== --------
      • -------- ======================== --------
      • -------- Effect D is the effect made near the lightnings... --------
      • Set DivEffectD = AbilitiesWeaponsFaerieDragonMissileFaerieDragonMissile.mdl
      • -------- ======================== --------
      • -------- Effect E is the effect on enemy units in the circle. --------
      • Set DivEffectE = AbilitiesWeaponsWingedSerpentMissileWingedSerpentMissile.mdl
      • -------- ======================== --------
      • -------- ======================== --------
      • -------- The base Damage Per Interval/Second. Only affect enemy units. This value does not increase with each level. --------
      • Set DivDPSB = 18.00
      • -------- The increasing Damage Per Interval/Second. This value is multiplied with each ability level. --------
      • Set DivDPSI = 6.00
      • -------- ======================== --------
      • -------- ======================== --------
      • -------- Lightning Type. --------
      • Set DL1 = Spirit Link
      • -------- The rate of intervals for detecting what units are in/out of the circle, damage per second, etc... --------
      • -------- 33 = 1 Second, as the spell loops at a .03 rate. Lightning effects are not affected by this value. --------
      • Set DivCountMAX = 33
      • -------- ======================== --------
      • -------- The subtracted height of the dummy unit, so it looks like the lightning is going into the dummy unit... --------
      • Set DivHeightNull = 90.00
      • -------- ======================== --------
      • -------- ======================== --------
      • -------- The height of the lightning away from the center. --------
      • Set DPH1 = 30.00
      • -------- The height of the lightning at the center of the circle. --------
      • Set DPH2 = 300.00
      • -------- The angle between each lightning. --------
      • Set DivAngleUp = 90.00
      • -------- The rate that the lightning spins. Remember that the spell loops at a .03 ratio... --------
      • Set DivAngleConstantUp = 6.00
      • -------- The damage type. --------
      • Set DivAttackType = Spells
  • DivineCast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Divine Protection
    • Actions
      • Set DivCast = (Triggering unit)
      • Set DP = (Target point of ability being cast)
      • -------- ======================== --------
      • Set DivLevel = (Level of Divine Protection for DivCast)
      • Set DivAoE = (DivAoEB + (DivAoEI x (Real(DivLevel))))
      • Set DivDuration = (DivDurationB + (DivDurationI x DivLevel))
      • Set DivDPS = (DivDPSB + (DivDPSI x (Real(DivLevel))))
      • -------- Dummy "Shield" Create & Growth --------
      • Set DivAngle = (Facing of DivCast)
      • Unit - Create 1 DivDummy for (Triggering player) at DP facing DivAngle degrees
      • Set DivDummyUNIT = (Last created unit)
      • Custom script: set udg_Handle_Div = GetHandleId(udg_DivDummyUNIT)
      • -------- ======================== --------
      • -------- Lightning --------
      • For each (Integer DivLoop) from 1 to 4, do (Actions)
        • Loop - Actions
          • Set DivAngle = (DivAngle + DivAngleUp)
          • Set DP2 = (DP offset by DivAoE towards DivAngle degrees)
          • Custom script: set udg_DL = AddLightningEx(udg_DL1, true , GetLocationX(udg_DP), GetLocationY(udg_DP), (udg_DPH2), GetLocationX(udg_DP2), GetLocationY(udg_DP2), GetLocationZ(udg_DP2) + (udg_DPH1) )
          • Hashtable - Save Handle OfDL as (DivLoop + 6) of Handle_Div in Hash_Divine
          • Custom script: call RemoveLocation(udg_DP2)
      • Custom script: call SetUnitFlyHeight( udg_DivDummyUNIT, (udg_DPH2) - (udg_DivHeightNull), 0.00 )
      • -------- ======================== --------
      • -------- ======================== --------
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within DivAoE of DP matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of (Triggering player)) Equal to True) or ((Owner of (Matching unit)) Equal to (Triggering player))))) and do (Actions)
        • Loop - Actions
          • Set DivPickedUnit = (Picked unit)
          • Custom script: call DestroyEffect(AddSpecialEffectTarget (udg_DivEffectA, udg_DivPickedUnit, "chest"))
          • Unit - Make DivPickedUnit Invulnerable
          • Custom script: call GroupAddUnit(udg_DivGroup2, udg_DivPickedUnit)
          • Custom script: set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
          • Hashtable - Save Handle OfDivDummyUNIT as 6 of Handle_Div2 in Hash_Divine
      • -------- ======================== --------
      • -------- Save Hashtables --------
      • -------- ======================== --------
      • Hashtable - Save Handle OfDivCast as 1 of Handle_Div in Hash_Divine
      • Hashtable - Save DivAoE as 2 of Handle_Div in Hash_Divine
      • Hashtable - Save DivDuration as 3 of Handle_Div in Hash_Divine
      • Hashtable - Save DivDPS as 4 of Handle_Div in Hash_Divine
      • Hashtable - Save Handle OfDivGroup2 as 5 of Handle_Div in Hash_Divine
      • Hashtable - Save DivAngle as 11 of Handle_Div in Hash_Divine
      • Hashtable - Save DivIntegerSFX as 15 of Handle_Div in Hash_Divine
      • Custom script: call GroupAddUnit(udg_DivGroup, udg_DivDummyUNIT)
      • -------- ======================== --------
      • -------- Clean up/Turn on --------
      • -------- ======================== --------
      • Set DivTRIGGER = (DivTRIGGER + 1)
      • Trigger - Turn on DivineLoop <gen>
      • Custom script: call RemoveLocation(udg_DP)
  • DivineLoop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • -------- This makes a "1 second" delay... --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DivCount Greater than or equal to DivCountMAX
        • Then - Actions
          • Set DivBool = True
          • Set DivCount = 0
        • Else - Actions
          • Set DivBool = False
          • Set DivCount = (DivCount + 1)
      • -------- ============================= --------
      • Unit Group - Pick every unit in DivGroup and do (Actions)
        • Loop - Actions
          • Set DivDummyUNIT = (Picked unit)
          • Set DP = (Position of DivDummyUNIT)
          • Custom script: set udg_Handle_Div = GetHandleId(udg_DivDummyUNIT)
          • -------- ============================= --------
          • Set DivAoE = (Load 2 of Handle_Div from Hash_Divine)
          • Set DivAngle = (Load 11 of Handle_Div from Hash_Divine)
          • Set DivAngleTemp = DivAngle
          • Set DivDuration = (Load 3 of Handle_Div from Hash_Divine)
          • Set DivIntegerSFX = (Load 15 of Handle_Div from Hash_Divine)
          • -------- ============================= --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DivBool Equal to True
            • Then - Actions
              • Set DivCast = (Load 1 of Handle_Div in Hash_Divine)
              • Set DivDPS = (Load 4 of Handle_Div from Hash_Divine)
              • Set DivGroup2 = (Load 5 of Handle_Div in Hash_Divine)
              • -------- ============================== --------
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within DivAoE of DP matching ((((Matching unit) belongs to an ally of (Owner of DivDummyUNIT)) Equal to False) and (((Owner of (Matching unit)) Not equal to (Owner of DivDummyUNIT)) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) and do (Actions)
                • Loop - Actions
                  • Set DivPickedUnit = (Picked unit)
                  • Custom script: call UnitDamageTarget (udg_DivCast, udg_DivPickedUnit, udg_DivDPS, true, true, udg_DivAttackType, DAMAGE_TYPE_DIVINE, WEAPON_TYPE_WHOKNOWS)
                  • Custom script: call DestroyEffect(AddSpecialEffectTarget (udg_DivEffectE, udg_DivPickedUnit, "chest"))
              • -------- ============================== --------
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within DivAoE of DP matching (((((Matching unit) is in DivGroup2) Equal to False) and (((Matching unit) is in DivGroup3) Equal to False)) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of (Owner of DivDummyUNI and do (Actions)
                • Loop - Actions
                  • Set DivPickedUnit = (Picked unit)
                  • Custom script: call DestroyEffect(AddSpecialEffectTarget (udg_DivEffectB, udg_DivPickedUnit, "origin"))
                  • Unit - Make DivPickedUnit Invulnerable
                  • Custom script: call GroupAddUnit(udg_DivGroup2, udg_DivPickedUnit)
                  • Custom script: set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
                  • Hashtable - Save Handle OfDivDummyUNIT as 6 of Handle_Div2 in Hash_Divine
              • -------- ============================== --------
              • -------- ============================== --------
              • Unit Group - Pick every unit in DivGroup2 and do (Actions)
                • Loop - Actions
                  • Set DivPickedUnit = (Picked unit)
                  • Custom script: set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
                  • Set DP2 = (Position of DivPickedUnit)
                  • Set DivTar = (Load 6 of Handle_Div2 in Hash_Divine)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Or - Any (Conditions) are true
                        • Conditions
                          • (DivDummyUNIT is alive) Equal to False
                          • (DivPickedUnit is hidden) Equal to True
                          • DivTar Equal to No unit
                          • DivTar Equal to DivDummyUNIT
                      • (Distance between DP and DP2) Greater than DivAoE
                    • Then - Actions
                      • Custom script: call DestroyEffect(AddSpecialEffectTarget (udg_DivEffectC, udg_DivPickedUnit, "origin"))
                      • Unit - Make DivPickedUnit Vulnerable
                      • Custom script: call GroupRemoveUnit (udg_DivGroup2, udg_DivPickedUnit)
                      • Hashtable - Clear all child hashtables of child Handle_Div2 in Hash_Divine
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_DP2)
              • -------- ============================== --------
              • Set DivDuration = (DivDuration - 1)
              • Hashtable - Save Handle OfDivGroup2 as 5 of Handle_Div in Hash_Divine
              • Hashtable - Save DivDuration as 3 of Handle_Div in Hash_Divine
            • Else - Actions
          • For each (Integer DivLoop) from 1 to 4, do (Actions)
            • Loop - Actions
              • Set DL = (Load (DivLoop + 6) of Handle_Div in Hash_Divine)
              • -------- ============================= --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DivDuration Greater than 0
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DivDuration Equal to 8
                    • Then - Actions
                      • -------- // Remove a few BJs doing this method. --------
                      • Custom script: call SetLightningColor( udg_DL, 0.80, 0.80, 0.80, 1 )
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DivDuration Equal to 5
                    • Then - Actions
                      • Custom script: call SetLightningColor( udg_DL, 0.60, 0.60, 0.60, 1 )
                    • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DivDuration Equal to 2
                    • Then - Actions
                      • Custom script: call SetLightningColor( udg_DL, 0.40, 0.40, 0.40, 1 )
                    • Else - Actions
                  • -------- ============================= --------
                  • -------- ============================= --------
                  • Set DivAngleTemp = (DivAngleTemp + (DivAngleUp x ((Real(DivLoop)) - 1.00)))
                  • Set DP2 = (DP offset by DivAoE towards DivAngleTemp degrees)
                  • -------- ============================= --------
                  • -------- ============================= --------
                  • Custom script: call MoveLightningEx(udg_DL , true , GetLocationX(udg_DP), GetLocationY(udg_DP), GetLocationZ(udg_DP) + (udg_DPH2) , GetLocationX(udg_DP2), GetLocationY(udg_DP2), GetLocationZ(udg_DP2) + (udg_DPH1) )
                  • -------- ============================= --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • DivIntegerSFX Equal to DivLoop
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • DivIntegerSFX Greater than or equal to 4
                        • Then - Actions
                          • Set DivIntegerSFX = 0
                        • Else - Actions
                      • Custom script: call DestroyEffect(AddSpecialEffectLoc (udg_DivEffectD, udg_DP2))
                    • Else - Actions
                  • Custom script: call RemoveLocation(udg_DP2)
                • Else - Actions
                  • Custom script: call DestroyLightning( udg_DL )
          • -------- ============================= --------
          • Set DivIntegerSFX = (DivIntegerSFX + 1)
          • Set DivAngle = (DivAngle + DivAngleConstantUp)
          • -------- ============================= --------
          • Hashtable - Save DivIntegerSFX as 15 of Handle_Div in Hash_Divine
          • Hashtable - Save DivAngle as 11 of Handle_Div in Hash_Divine
          • -------- ============================= --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • DivDuration Equal to 0
            • Then - Actions
              • Unit Group - Pick every unit in DivGroup2 and do (Actions)
                • Loop - Actions
                  • Set DivPickedUnit = (Picked unit)
                  • Custom script: set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Load 6 of Handle_Div2 in Hash_Divine) Equal to DivDummyUNIT
                    • Then - Actions
                      • Custom script: call DestroyEffect(AddSpecialEffectTarget (udg_DivEffectC, udg_DivPickedUnit, "origin"))
                      • Unit - Make DivPickedUnit Vulnerable
                      • Custom script: call GroupRemoveUnit (udg_DivGroup2, udg_DivPickedUnit)
                      • Hashtable - Clear all child hashtables of child Handle_Div2 in Hash_Divine
                    • Else - Actions
              • Custom script: call GroupRemoveUnit (udg_DivGroup, udg_DivDummyUNIT)
              • Unit - Add a 0.01 second Generic expiration timer to DivDummyUNIT
              • Unit - Make DivDummyUNIT Explode on death
              • Set DivTRIGGER = (DivTRIGGER - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • DivTRIGGER Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
              • Hashtable - Clear all child hashtables of child Handle_Div in Hash_Divine
            • Else - Actions
          • -------- ============================= --------
          • Custom script: call RemoveLocation(udg_DP)
170705-albums4602-picture46695.jpg
170705-albums4602-picture46696.jpg
170705-albums4602-picture46698.jpg
170705-albums4602-picture46699.jpg


Upload Log
1.0 Uploaded
1.1 More Bj's removed.
1.2 Fixed 1.1's JASS errors.
This spell was requested by Bel0lyn. The idea is Bel0lyn's, but the triggering is completely mine.



Keywords:
Divine,Protection,Paladin,Light,Good,Goodness,Super,Invulnerable,DPS,Damage,Per,Second,Angel,Arch,678,Ultimate,Anti,Evil,Ebil,Dark,Demon,Banish,Soul,
Contents

Divine Protection (Map)

Reviews
Bribe: Looks REALLY good. I will test out this spell when I am home this evening. No leaks, way more efficient than a GUI system needs to be, very nice work. Unrelated to the spell, your "Dies" trigger could be simplified and also leaks a...

Moderator

M

Moderator

Bribe:

Looks REALLY good. I will test out this spell when I am home this evening.

No leaks, way more efficient than a GUI system needs to be, very nice work.

Unrelated to the spell, your "Dies" trigger could be simplified and also leaks a location. I advise changing it to this:

JASS:
local unit u = GetTriggerUnit()
local integer id = GetUnitTypeId(u)
local real f = GetUnitFacing(u)
local real x = GetUnitX(u)
local real y = GetUnitY(u)
call PolledWait(5.22)
call CreateUnit(Player(2), id, x, y, f)

Maker, v1.2. 14.07.2011
Approved.
You should put these if/then/elses inside each other:
DivDuration Equal to 8
DivDuration Equal to 5
DivDuration Equal to 2
 
No leaks, way more efficient than a GUI system needs to be, very nice work.

I taught him everything he knows ^_^ (Did I?)

EDIT: To show you exactly how efficient this system is:

Look at the relatively low number of BJS:


JASS:
function Trig_DivineCast_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A000' ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineCast_Func012C takes nothing returns boolean
    if ( not ( IsUnitType(udg_DivDummyUNIT, UNIT_TYPE_FLYING) == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineCast_Func021001003001 takes nothing returns boolean
    return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction

function Trig_DivineCast_Func021001003002001 takes nothing returns boolean
    return ( IsUnitAlly(GetFilterUnit(), GetTriggerPlayer()) == true )
endfunction

function Trig_DivineCast_Func021001003002002 takes nothing returns boolean
    return ( GetOwningPlayer(GetFilterUnit()) == GetTriggerPlayer() )
endfunction

function Trig_DivineCast_Func021001003002 takes nothing returns boolean
    return GetBooleanOr( Trig_DivineCast_Func021001003002001(), Trig_DivineCast_Func021001003002002() )
endfunction

function Trig_DivineCast_Func021001003 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineCast_Func021001003001(), Trig_DivineCast_Func021001003002() )
endfunction

function Trig_DivineCast_Func021A takes nothing returns nothing
    set udg_DivPickedUnit = GetEnumUnit()
    call AddSpecialEffectTargetUnitBJ( "chest", udg_DivPickedUnit, udg_DivEffectA )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
    call SetUnitInvulnerable( udg_DivPickedUnit, true )
    call GroupAddUnitSimple( udg_DivPickedUnit, udg_DivGroup2 )
    set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
    call SaveUnitHandleBJ( udg_DivDummyUNIT, 6, udg_Handle_Div2, udg_Hash_Divine )
endfunction

function Trig_DivineCast_Actions takes nothing returns nothing
    set udg_DivCast = GetTriggerUnit()
    set udg_DP = GetSpellTargetLoc()
    // ========================
    set udg_DivLevel = GetUnitAbilityLevelSwapped('A000', udg_DivCast)
    set udg_DivAoE = ( udg_DivAoEB + ( udg_DivAoEI * I2R(udg_DivLevel) ) )
    set udg_DivDuration = ( udg_DivDurationB + ( udg_DivDurationI * udg_DivLevel ) )
    set udg_DivDPS = ( udg_DivDPSB + ( udg_DivDPSI * I2R(udg_DivLevel) ) )
    // Dummy "Shield" Create & Growth
    set udg_DivAngle = GetUnitFacing(udg_DivCast)
    call CreateNUnitsAtLoc( 1, udg_DivDummy, GetTriggerPlayer(), udg_DP, udg_DivAngle )
    set udg_DivDummyUNIT = GetLastCreatedUnit()
    if ( Trig_DivineCast_Func012C() ) then
        call UnitAddAbilityBJ( 'Amrf', udg_DivDummyUNIT )
    else
    endif
    set udg_Handle_Div = GetHandleId(udg_DivDummyUNIT)
    // ========================
    // Lightning
    set udg_DivLoop = 1
    loop
        exitwhen udg_DivLoop > 4
        set udg_DivAngle = ( udg_DivAngle + udg_DivAngleUp )
        set udg_DP2 = PolarProjectionBJ(udg_DP, udg_DivAoE, udg_DivAngle)
        set udg_DL = AddLightningEx(udg_DL1, true , GetLocationX(udg_DP), GetLocationY(udg_DP), (udg_DPH2), GetLocationX(udg_DP2), GetLocationY(udg_DP2), GetLocationZ(udg_DP2) + (udg_DPH1) )
        call SaveLightningHandleBJ( udg_DL, ( udg_DivLoop + 6 ), udg_Handle_Div, udg_Hash_Divine )
        call RemoveLocation(udg_DP2)
        set udg_DivLoop = udg_DivLoop + 1
    endloop
    call SetUnitFlyHeight( udg_DivDummyUNIT, (udg_DPH2) - (udg_DivHeightNull), 0.00 )
    // ========================
    // ========================
    set bj_wantDestroyGroup = true
    call ForGroupBJ( GetUnitsInRangeOfLocMatching(udg_DivAoE, udg_DP, Condition(function Trig_DivineCast_Func021001003)), function Trig_DivineCast_Func021A )
    // ========================
    // Save Hashtables
    // ========================
    call SaveUnitHandleBJ( udg_DivCast, 1, udg_Handle_Div, udg_Hash_Divine )
    call SaveRealBJ( udg_DivAoE, 2, udg_Handle_Div, udg_Hash_Divine )
    call SaveIntegerBJ( udg_DivDuration, 3, udg_Handle_Div, udg_Hash_Divine )
    call SaveRealBJ( udg_DivDPS, 4, udg_Handle_Div, udg_Hash_Divine )
    call SaveGroupHandleBJ( udg_DivGroup2, 5, udg_Handle_Div, udg_Hash_Divine )
    call SaveRealBJ( udg_DivAngle, 11, udg_Handle_Div, udg_Hash_Divine )
    call SaveIntegerBJ( udg_DivIntegerSFX, 15, udg_Handle_Div, udg_Hash_Divine )
    call GroupAddUnitSimple( udg_DivDummyUNIT, udg_DivGroup )
    // ========================
    // Clean up/Turn on
    // ========================
    set udg_DivTRIGGER = ( udg_DivTRIGGER + 1 )
    call EnableTrigger( gg_trg_DivineLoop )
    call RemoveLocation(udg_DP)
endfunction

//===========================================================================
function InitTrig_DivineCast takes nothing returns nothing
    set gg_trg_DivineCast = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_DivineCast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_DivineCast, Condition( function Trig_DivineCast_Conditions ) )
    call TriggerAddAction( gg_trg_DivineCast, function Trig_DivineCast_Actions )
endfunction
JASS:
function Trig_DivineLoop_Func002C takes nothing returns boolean
    if ( not ( udg_DivCount >= udg_DivCountMAX ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func011Func007001003001 takes nothing returns boolean
    return ( IsUnitAlly(GetFilterUnit(), GetOwningPlayer(udg_DivDummyUNIT)) == false )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002001 takes nothing returns boolean
    return ( GetOwningPlayer(GetFilterUnit()) != GetOwningPlayer(udg_DivDummyUNIT) )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002001 takes nothing returns boolean
    return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002002001 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002002002001 takes nothing returns boolean
    return ( IsUnitHiddenBJ(GetFilterUnit()) == false )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002002002002 takes nothing returns boolean
    return ( IsUnitIllusionBJ(GetFilterUnit()) == false )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002002002 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func007001003002002002002001(), Trig_DivineLoop_Func004Func011Func007001003002002002002002() )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002002 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func007001003002002002001(), Trig_DivineLoop_Func004Func011Func007001003002002002002() )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func007001003002002001(), Trig_DivineLoop_Func004Func011Func007001003002002002() )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func007001003002001(), Trig_DivineLoop_Func004Func011Func007001003002002() )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func007001003001(), Trig_DivineLoop_Func004Func011Func007001003002() )
endfunction

function Trig_DivineLoop_Func004Func011Func007A takes nothing returns nothing
    set udg_DivPickedUnit = GetEnumUnit()
    call UnitDamageTargetBJ( udg_DivCast, udg_DivPickedUnit, udg_DivDPS, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DIVINE )
    call AddSpecialEffectTargetUnitBJ( "chest", udg_DivPickedUnit, "Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl" )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003001001 takes nothing returns boolean
    return ( IsUnitInGroup(GetFilterUnit(), udg_DivGroup2) == false )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003001002 takes nothing returns boolean
    return ( IsUnitInGroup(GetFilterUnit(), udg_DivGroup3) == false )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003001 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func010001003001001(), Trig_DivineLoop_Func004Func011Func010001003001002() )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003002001 takes nothing returns boolean
    return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003002002001 takes nothing returns boolean
    return ( IsUnitAlly(GetFilterUnit(), GetOwningPlayer(udg_DivDummyUNIT)) == true )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003002002002 takes nothing returns boolean
    return ( GetOwningPlayer(GetFilterUnit()) == GetOwningPlayer(udg_DivDummyUNIT) )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003002002 takes nothing returns boolean
    return GetBooleanOr( Trig_DivineLoop_Func004Func011Func010001003002002001(), Trig_DivineLoop_Func004Func011Func010001003002002002() )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003002 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func010001003002001(), Trig_DivineLoop_Func004Func011Func010001003002002() )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func010001003001(), Trig_DivineLoop_Func004Func011Func010001003002() )
endfunction

function Trig_DivineLoop_Func004Func011Func010A takes nothing returns nothing
    set udg_DivPickedUnit = GetEnumUnit()
    call AddSpecialEffectTargetUnitBJ( "origin", udg_DivPickedUnit, udg_DivEffectB )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
    call SetUnitInvulnerable( udg_DivPickedUnit, true )
    call GroupAddUnitSimple( udg_DivPickedUnit, udg_DivGroup2 )
    set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
    call SaveUnitHandleBJ( udg_DivDummyUNIT, 6, udg_Handle_Div2, udg_Hash_Divine )
endfunction

function Trig_DivineLoop_Func004Func011Func013Func005Func001C takes nothing returns boolean
    if ( ( IsUnitAliveBJ(udg_DivDummyUNIT) == false ) ) then
        return true
    endif
    if ( ( IsUnitHiddenBJ(udg_DivPickedUnit) == true ) ) then
        return true
    endif
    if ( ( udg_DivTar == null ) ) then
        return true
    endif
    if ( ( udg_DivTar == udg_DivDummyUNIT ) ) then
        return true
    endif
    return false
endfunction

function Trig_DivineLoop_Func004Func011Func013Func005C takes nothing returns boolean
    if ( not Trig_DivineLoop_Func004Func011Func013Func005Func001C() ) then
        return false
    endif
    if ( not ( DistanceBetweenPoints(udg_DP, udg_DP2) > udg_DivAoE ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func011Func013A takes nothing returns nothing
    set udg_DivPickedUnit = GetEnumUnit()
    set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
    set udg_DP2 = GetUnitLoc(udg_DivPickedUnit)
    set udg_DivTar = LoadUnitHandleBJ(6, udg_Handle_Div2, udg_Hash_Divine)
    if ( Trig_DivineLoop_Func004Func011Func013Func005C() ) then
        call AddSpecialEffectTargetUnitBJ( "origin", udg_DivPickedUnit, udg_DivEffectC )
        call DestroyEffectBJ( GetLastCreatedEffectBJ() )
        call SetUnitInvulnerable( udg_DivPickedUnit, false )
        call GroupRemoveUnitSimple( udg_DivPickedUnit, udg_DivGroup2 )
        call FlushChildHashtableBJ( udg_Handle_Div2, udg_Hash_Divine )
    else
    endif
    call RemoveLocation(udg_DP2)
endfunction

function Trig_DivineLoop_Func004Func011C takes nothing returns boolean
    if ( not ( udg_DivBool == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func012Func003Func002C takes nothing returns boolean
    if ( not ( udg_DivDuration == 8 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func012Func003Func003C takes nothing returns boolean
    if ( not ( udg_DivDuration == 5 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func012Func003Func004C takes nothing returns boolean
    if ( not ( udg_DivDuration == 2 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func012Func003Func014Func001C takes nothing returns boolean
    if ( not ( udg_DivIntegerSFX >= 4 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func012Func003Func014C takes nothing returns boolean
    if ( not ( udg_DivIntegerSFX == udg_DivLoop ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func012Func003C takes nothing returns boolean
    if ( not ( udg_DivDuration > 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func020Func001Func003C takes nothing returns boolean
    if ( not ( LoadUnitHandleBJ(6, udg_Handle_Div2, udg_Hash_Divine) == udg_DivDummyUNIT ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func020Func001A takes nothing returns nothing
    set udg_DivPickedUnit = GetEnumUnit()
    set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
    if ( Trig_DivineLoop_Func004Func020Func001Func003C() ) then
        call AddSpecialEffectTargetUnitBJ( "origin", udg_DivPickedUnit, udg_DivEffectC )
        call DestroyEffectBJ( GetLastCreatedEffectBJ() )
        call SetUnitInvulnerable( udg_DivPickedUnit, false )
        call GroupRemoveUnitSimple( udg_DivPickedUnit, udg_DivGroup2 )
    else
    endif
endfunction

function Trig_DivineLoop_Func004Func020C takes nothing returns boolean
    if ( not ( udg_DivDuration == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004A takes nothing returns nothing
    set udg_DivDummyUNIT = GetEnumUnit()
    set udg_DP = GetUnitLoc(udg_DivDummyUNIT)
    set udg_Handle_Div = GetHandleId(udg_DivDummyUNIT)
    // =============================
    set udg_DivAoE = LoadRealBJ(2, udg_Handle_Div, udg_Hash_Divine)
    set udg_DivAngle = LoadRealBJ(11, udg_Handle_Div, udg_Hash_Divine)
    set udg_DivAngleTemp = udg_DivAngle
    set udg_DivDuration = LoadIntegerBJ(3, udg_Handle_Div, udg_Hash_Divine)
    set udg_DivIntegerSFX = LoadIntegerBJ(15, udg_Handle_Div, udg_Hash_Divine)
    // =============================
    if ( Trig_DivineLoop_Func004Func011C() ) then
        set udg_DivCast = LoadUnitHandleBJ(1, udg_Handle_Div, udg_Hash_Divine)
        set udg_DivDPS = LoadRealBJ(4, udg_Handle_Div, udg_Hash_Divine)
        set udg_DivGroup2 = LoadGroupHandleBJ(5, udg_Handle_Div, udg_Hash_Divine)
        // ==============================
        set bj_wantDestroyGroup = true
        call ForGroupBJ( GetUnitsInRangeOfLocMatching(udg_DivAoE, udg_DP, Condition(function Trig_DivineLoop_Func004Func011Func007001003)), function Trig_DivineLoop_Func004Func011Func007A )
        // ==============================
        set bj_wantDestroyGroup = true
        call ForGroupBJ( GetUnitsInRangeOfLocMatching(udg_DivAoE, udg_DP, Condition(function Trig_DivineLoop_Func004Func011Func010001003)), function Trig_DivineLoop_Func004Func011Func010A )
        // ==============================
        // ==============================
        call ForGroupBJ( udg_DivGroup2, function Trig_DivineLoop_Func004Func011Func013A )
        // ==============================
        set udg_DivDuration = ( udg_DivDuration - 1 )
        call SaveGroupHandleBJ( udg_DivGroup2, 5, udg_Handle_Div, udg_Hash_Divine )
        call SaveIntegerBJ( udg_DivDuration, 3, udg_Handle_Div, udg_Hash_Divine )
    else
    endif
    set udg_DivLoop = 1
    loop
        exitwhen udg_DivLoop > 4
        set udg_DL = LoadLightningHandleBJ(( udg_DivLoop + 6 ), udg_Handle_Div, udg_Hash_Divine)
        // =============================
        if ( Trig_DivineLoop_Func004Func012Func003C() ) then
            if ( Trig_DivineLoop_Func004Func012Func003Func002C() ) then
                // // Remove a few BJs doing this method.
                call SetLightningColor( udg_DL, 0.80, 0.80, 0.80, 1 )
            else
            endif
            if ( Trig_DivineLoop_Func004Func012Func003Func003C() ) then
                call SetLightningColor( udg_DL, 0.60, 0.60, 0.60, 1 )
            else
            endif
            if ( Trig_DivineLoop_Func004Func012Func003Func004C() ) then
                call SetLightningColor( udg_DL, 0.40, 0.40, 0.40, 1 )
            else
            endif
            // =============================
            // =============================
            set udg_DivAngleTemp = ( udg_DivAngleTemp + ( udg_DivAngleUp * ( I2R(udg_DivLoop) - 1 ) ) )
            set udg_DP2 = PolarProjectionBJ(udg_DP, udg_DivAoE, udg_DivAngleTemp)
            // =============================
            // =============================
            call MoveLightningEx(udg_DL , true , GetLocationX(udg_DP), GetLocationY(udg_DP), GetLocationZ(udg_DP) + (udg_DPH2) , GetLocationX(udg_DP2), GetLocationY(udg_DP2), GetLocationZ(udg_DP2) + (udg_DPH1) )
            // =============================
            if ( Trig_DivineLoop_Func004Func012Func003Func014C() ) then
                if ( Trig_DivineLoop_Func004Func012Func003Func014Func001C() ) then
                    set udg_DivIntegerSFX = 0
                else
                endif
                call AddSpecialEffectLocBJ( udg_DP2, udg_DivEffectD )
                call DestroyEffectBJ( GetLastCreatedEffectBJ() )
            else
            endif
            call RemoveLocation(udg_DP2)
        else
            call DestroyLightning( udg_DL )
        endif
        set udg_DivLoop = udg_DivLoop + 1
    endloop
    // =============================
    set udg_DivIntegerSFX = ( udg_DivIntegerSFX + 1 )
    set udg_DivAngle = ( udg_DivAngle + udg_DivAngleConstantUp )
    // =============================
    call SaveIntegerBJ( udg_DivIntegerSFX, 15, udg_Handle_Div, udg_Hash_Divine )
    call SaveRealBJ( udg_DivAngle, 11, udg_Handle_Div, udg_Hash_Divine )
    // =============================
    if ( Trig_DivineLoop_Func004Func020C() ) then
        call ForGroupBJ( udg_DivGroup2, function Trig_DivineLoop_Func004Func020Func001A )
        call GroupRemoveUnitSimple( udg_DivDummyUNIT, udg_DivGroup )
        call UnitApplyTimedLifeBJ( 0.01, 'BTLF', udg_DivDummyUNIT )
        call SetUnitExplodedBJ( udg_DivDummyUNIT, true )
        set udg_DivTRIGGER = ( udg_DivTRIGGER - 1 )
        call FlushChildHashtableBJ( udg_Handle_Div, udg_Hash_Divine )
    else
    endif
    // =============================
    call RemoveLocation(udg_DP)
endfunction

function Trig_DivineLoop_Func005Func002Func006Func009C takes nothing returns boolean
    if ( ( udg_DivTar == null ) ) then
        return true
    endif
    if ( ( IsUnitDeadBJ(udg_DivTar) == true ) ) then
        return true
    endif
    return false
endfunction

function Trig_DivineLoop_Func005Func002Func006C takes nothing returns boolean
    if ( not Trig_DivineLoop_Func005Func002Func006Func009C() ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func005Func002A takes nothing returns nothing
    set udg_DivPickedUnit = GetEnumUnit()
    // =============================
    set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
    set udg_DivTar = LoadUnitHandleBJ(6, udg_Handle_Div2, udg_Hash_Divine)
    // =============================
    if ( Trig_DivineLoop_Func005Func002Func006C() ) then
        // =============================
        call AddSpecialEffectTargetUnitBJ( "origin", udg_DivPickedUnit, udg_DivEffectC )
        call DestroyEffectBJ( GetLastCreatedEffectBJ() )
        // =============================
        call SetUnitInvulnerable( udg_DivPickedUnit, false )
        call GroupRemoveUnitSimple( udg_DivPickedUnit, udg_DivGroup2 )
        // =============================
        call FlushChildHashtableBJ( udg_Handle_Div2, udg_Hash_Divine )
    else
    endif
endfunction

function Trig_DivineLoop_Func005C takes nothing returns boolean
    if ( not ( udg_DivTRIGGER == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Actions takes nothing returns nothing
    // This makes a "1 second" delay...
    if ( Trig_DivineLoop_Func002C() ) then
        set udg_DivBool = true
        set udg_DivCount = 0
    else
        set udg_DivBool = false
        set udg_DivCount = ( udg_DivCount + 1 )
    endif
    // =============================
    call ForGroupBJ( udg_DivGroup, function Trig_DivineLoop_Func004A )
    if ( Trig_DivineLoop_Func005C() ) then
        // =============================
        call ForGroupBJ( udg_DivGroup2, function Trig_DivineLoop_Func005Func002A )
        // =============================
        call DisableTrigger( GetTriggeringTrigger() )
    else
    endif
endfunction

//===========================================================================
function InitTrig_DivineLoop takes nothing returns nothing
    set gg_trg_DivineLoop = CreateTrigger(  )
    call DisableTrigger( gg_trg_DivineLoop )
    call TriggerRegisterTimerEventPeriodic( gg_trg_DivineLoop, 0.03 )
    call TriggerAddAction( gg_trg_DivineLoop, function Trig_DivineLoop_Actions )
endfunction


That's pretty low compared to other spells :D
Good Job ^^
 
Level 6
Joined
Aug 20, 2009
Messages
95
I taught him everything he knows ^_^ (Did I?)

EDIT: To show you exactly how efficient this system is:

Look at the relatively low number of BJS:


JASS:
function Trig_DivineCast_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A000' ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineCast_Func012C takes nothing returns boolean
    if ( not ( IsUnitType(udg_DivDummyUNIT, UNIT_TYPE_FLYING) == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineCast_Func021001003001 takes nothing returns boolean
    return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction

function Trig_DivineCast_Func021001003002001 takes nothing returns boolean
    return ( IsUnitAlly(GetFilterUnit(), GetTriggerPlayer()) == true )
endfunction

function Trig_DivineCast_Func021001003002002 takes nothing returns boolean
    return ( GetOwningPlayer(GetFilterUnit()) == GetTriggerPlayer() )
endfunction

function Trig_DivineCast_Func021001003002 takes nothing returns boolean
    return GetBooleanOr( Trig_DivineCast_Func021001003002001(), Trig_DivineCast_Func021001003002002() )
endfunction

function Trig_DivineCast_Func021001003 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineCast_Func021001003001(), Trig_DivineCast_Func021001003002() )
endfunction

function Trig_DivineCast_Func021A takes nothing returns nothing
    set udg_DivPickedUnit = GetEnumUnit()
    call AddSpecialEffectTargetUnitBJ( "chest", udg_DivPickedUnit, udg_DivEffectA )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
    call SetUnitInvulnerable( udg_DivPickedUnit, true )
    call GroupAddUnitSimple( udg_DivPickedUnit, udg_DivGroup2 )
    set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
    call SaveUnitHandleBJ( udg_DivDummyUNIT, 6, udg_Handle_Div2, udg_Hash_Divine )
endfunction

function Trig_DivineCast_Actions takes nothing returns nothing
    set udg_DivCast = GetTriggerUnit()
    set udg_DP = GetSpellTargetLoc()
    // ========================
    set udg_DivLevel = GetUnitAbilityLevelSwapped('A000', udg_DivCast)
    set udg_DivAoE = ( udg_DivAoEB + ( udg_DivAoEI * I2R(udg_DivLevel) ) )
    set udg_DivDuration = ( udg_DivDurationB + ( udg_DivDurationI * udg_DivLevel ) )
    set udg_DivDPS = ( udg_DivDPSB + ( udg_DivDPSI * I2R(udg_DivLevel) ) )
    // Dummy "Shield" Create & Growth
    set udg_DivAngle = GetUnitFacing(udg_DivCast)
    call CreateNUnitsAtLoc( 1, udg_DivDummy, GetTriggerPlayer(), udg_DP, udg_DivAngle )
    set udg_DivDummyUNIT = GetLastCreatedUnit()
    if ( Trig_DivineCast_Func012C() ) then
        call UnitAddAbilityBJ( 'Amrf', udg_DivDummyUNIT )
    else
    endif
    set udg_Handle_Div = GetHandleId(udg_DivDummyUNIT)
    // ========================
    // Lightning
    set udg_DivLoop = 1
    loop
        exitwhen udg_DivLoop > 4
        set udg_DivAngle = ( udg_DivAngle + udg_DivAngleUp )
        set udg_DP2 = PolarProjectionBJ(udg_DP, udg_DivAoE, udg_DivAngle)
        set udg_DL = AddLightningEx(udg_DL1, true , GetLocationX(udg_DP), GetLocationY(udg_DP), (udg_DPH2), GetLocationX(udg_DP2), GetLocationY(udg_DP2), GetLocationZ(udg_DP2) + (udg_DPH1) )
        call SaveLightningHandleBJ( udg_DL, ( udg_DivLoop + 6 ), udg_Handle_Div, udg_Hash_Divine )
        call RemoveLocation(udg_DP2)
        set udg_DivLoop = udg_DivLoop + 1
    endloop
    call SetUnitFlyHeight( udg_DivDummyUNIT, (udg_DPH2) - (udg_DivHeightNull), 0.00 )
    // ========================
    // ========================
    set bj_wantDestroyGroup = true
    call ForGroupBJ( GetUnitsInRangeOfLocMatching(udg_DivAoE, udg_DP, Condition(function Trig_DivineCast_Func021001003)), function Trig_DivineCast_Func021A )
    // ========================
    // Save Hashtables
    // ========================
    call SaveUnitHandleBJ( udg_DivCast, 1, udg_Handle_Div, udg_Hash_Divine )
    call SaveRealBJ( udg_DivAoE, 2, udg_Handle_Div, udg_Hash_Divine )
    call SaveIntegerBJ( udg_DivDuration, 3, udg_Handle_Div, udg_Hash_Divine )
    call SaveRealBJ( udg_DivDPS, 4, udg_Handle_Div, udg_Hash_Divine )
    call SaveGroupHandleBJ( udg_DivGroup2, 5, udg_Handle_Div, udg_Hash_Divine )
    call SaveRealBJ( udg_DivAngle, 11, udg_Handle_Div, udg_Hash_Divine )
    call SaveIntegerBJ( udg_DivIntegerSFX, 15, udg_Handle_Div, udg_Hash_Divine )
    call GroupAddUnitSimple( udg_DivDummyUNIT, udg_DivGroup )
    // ========================
    // Clean up/Turn on
    // ========================
    set udg_DivTRIGGER = ( udg_DivTRIGGER + 1 )
    call EnableTrigger( gg_trg_DivineLoop )
    call RemoveLocation(udg_DP)
endfunction

//===========================================================================
function InitTrig_DivineCast takes nothing returns nothing
    set gg_trg_DivineCast = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_DivineCast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_DivineCast, Condition( function Trig_DivineCast_Conditions ) )
    call TriggerAddAction( gg_trg_DivineCast, function Trig_DivineCast_Actions )
endfunction
JASS:
function Trig_DivineLoop_Func002C takes nothing returns boolean
    if ( not ( udg_DivCount >= udg_DivCountMAX ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func011Func007001003001 takes nothing returns boolean
    return ( IsUnitAlly(GetFilterUnit(), GetOwningPlayer(udg_DivDummyUNIT)) == false )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002001 takes nothing returns boolean
    return ( GetOwningPlayer(GetFilterUnit()) != GetOwningPlayer(udg_DivDummyUNIT) )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002001 takes nothing returns boolean
    return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002002001 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_MAGIC_IMMUNE) == false )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002002002001 takes nothing returns boolean
    return ( IsUnitHiddenBJ(GetFilterUnit()) == false )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002002002002 takes nothing returns boolean
    return ( IsUnitIllusionBJ(GetFilterUnit()) == false )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002002002 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func007001003002002002002001(), Trig_DivineLoop_Func004Func011Func007001003002002002002002() )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002002 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func007001003002002002001(), Trig_DivineLoop_Func004Func011Func007001003002002002002() )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002002 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func007001003002002001(), Trig_DivineLoop_Func004Func011Func007001003002002002() )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003002 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func007001003002001(), Trig_DivineLoop_Func004Func011Func007001003002002() )
endfunction

function Trig_DivineLoop_Func004Func011Func007001003 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func007001003001(), Trig_DivineLoop_Func004Func011Func007001003002() )
endfunction

function Trig_DivineLoop_Func004Func011Func007A takes nothing returns nothing
    set udg_DivPickedUnit = GetEnumUnit()
    call UnitDamageTargetBJ( udg_DivCast, udg_DivPickedUnit, udg_DivDPS, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_DIVINE )
    call AddSpecialEffectTargetUnitBJ( "chest", udg_DivPickedUnit, "Abilities\\Weapons\\WingedSerpentMissile\\WingedSerpentMissile.mdl" )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003001001 takes nothing returns boolean
    return ( IsUnitInGroup(GetFilterUnit(), udg_DivGroup2) == false )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003001002 takes nothing returns boolean
    return ( IsUnitInGroup(GetFilterUnit(), udg_DivGroup3) == false )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003001 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func010001003001001(), Trig_DivineLoop_Func004Func011Func010001003001002() )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003002001 takes nothing returns boolean
    return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003002002001 takes nothing returns boolean
    return ( IsUnitAlly(GetFilterUnit(), GetOwningPlayer(udg_DivDummyUNIT)) == true )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003002002002 takes nothing returns boolean
    return ( GetOwningPlayer(GetFilterUnit()) == GetOwningPlayer(udg_DivDummyUNIT) )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003002002 takes nothing returns boolean
    return GetBooleanOr( Trig_DivineLoop_Func004Func011Func010001003002002001(), Trig_DivineLoop_Func004Func011Func010001003002002002() )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003002 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func010001003002001(), Trig_DivineLoop_Func004Func011Func010001003002002() )
endfunction

function Trig_DivineLoop_Func004Func011Func010001003 takes nothing returns boolean
    return GetBooleanAnd( Trig_DivineLoop_Func004Func011Func010001003001(), Trig_DivineLoop_Func004Func011Func010001003002() )
endfunction

function Trig_DivineLoop_Func004Func011Func010A takes nothing returns nothing
    set udg_DivPickedUnit = GetEnumUnit()
    call AddSpecialEffectTargetUnitBJ( "origin", udg_DivPickedUnit, udg_DivEffectB )
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
    call SetUnitInvulnerable( udg_DivPickedUnit, true )
    call GroupAddUnitSimple( udg_DivPickedUnit, udg_DivGroup2 )
    set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
    call SaveUnitHandleBJ( udg_DivDummyUNIT, 6, udg_Handle_Div2, udg_Hash_Divine )
endfunction

function Trig_DivineLoop_Func004Func011Func013Func005Func001C takes nothing returns boolean
    if ( ( IsUnitAliveBJ(udg_DivDummyUNIT) == false ) ) then
        return true
    endif
    if ( ( IsUnitHiddenBJ(udg_DivPickedUnit) == true ) ) then
        return true
    endif
    if ( ( udg_DivTar == null ) ) then
        return true
    endif
    if ( ( udg_DivTar == udg_DivDummyUNIT ) ) then
        return true
    endif
    return false
endfunction

function Trig_DivineLoop_Func004Func011Func013Func005C takes nothing returns boolean
    if ( not Trig_DivineLoop_Func004Func011Func013Func005Func001C() ) then
        return false
    endif
    if ( not ( DistanceBetweenPoints(udg_DP, udg_DP2) > udg_DivAoE ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func011Func013A takes nothing returns nothing
    set udg_DivPickedUnit = GetEnumUnit()
    set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
    set udg_DP2 = GetUnitLoc(udg_DivPickedUnit)
    set udg_DivTar = LoadUnitHandleBJ(6, udg_Handle_Div2, udg_Hash_Divine)
    if ( Trig_DivineLoop_Func004Func011Func013Func005C() ) then
        call AddSpecialEffectTargetUnitBJ( "origin", udg_DivPickedUnit, udg_DivEffectC )
        call DestroyEffectBJ( GetLastCreatedEffectBJ() )
        call SetUnitInvulnerable( udg_DivPickedUnit, false )
        call GroupRemoveUnitSimple( udg_DivPickedUnit, udg_DivGroup2 )
        call FlushChildHashtableBJ( udg_Handle_Div2, udg_Hash_Divine )
    else
    endif
    call RemoveLocation(udg_DP2)
endfunction

function Trig_DivineLoop_Func004Func011C takes nothing returns boolean
    if ( not ( udg_DivBool == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func012Func003Func002C takes nothing returns boolean
    if ( not ( udg_DivDuration == 8 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func012Func003Func003C takes nothing returns boolean
    if ( not ( udg_DivDuration == 5 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func012Func003Func004C takes nothing returns boolean
    if ( not ( udg_DivDuration == 2 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func012Func003Func014Func001C takes nothing returns boolean
    if ( not ( udg_DivIntegerSFX >= 4 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func012Func003Func014C takes nothing returns boolean
    if ( not ( udg_DivIntegerSFX == udg_DivLoop ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func012Func003C takes nothing returns boolean
    if ( not ( udg_DivDuration > 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func020Func001Func003C takes nothing returns boolean
    if ( not ( LoadUnitHandleBJ(6, udg_Handle_Div2, udg_Hash_Divine) == udg_DivDummyUNIT ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004Func020Func001A takes nothing returns nothing
    set udg_DivPickedUnit = GetEnumUnit()
    set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
    if ( Trig_DivineLoop_Func004Func020Func001Func003C() ) then
        call AddSpecialEffectTargetUnitBJ( "origin", udg_DivPickedUnit, udg_DivEffectC )
        call DestroyEffectBJ( GetLastCreatedEffectBJ() )
        call SetUnitInvulnerable( udg_DivPickedUnit, false )
        call GroupRemoveUnitSimple( udg_DivPickedUnit, udg_DivGroup2 )
    else
    endif
endfunction

function Trig_DivineLoop_Func004Func020C takes nothing returns boolean
    if ( not ( udg_DivDuration == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func004A takes nothing returns nothing
    set udg_DivDummyUNIT = GetEnumUnit()
    set udg_DP = GetUnitLoc(udg_DivDummyUNIT)
    set udg_Handle_Div = GetHandleId(udg_DivDummyUNIT)
    // =============================
    set udg_DivAoE = LoadRealBJ(2, udg_Handle_Div, udg_Hash_Divine)
    set udg_DivAngle = LoadRealBJ(11, udg_Handle_Div, udg_Hash_Divine)
    set udg_DivAngleTemp = udg_DivAngle
    set udg_DivDuration = LoadIntegerBJ(3, udg_Handle_Div, udg_Hash_Divine)
    set udg_DivIntegerSFX = LoadIntegerBJ(15, udg_Handle_Div, udg_Hash_Divine)
    // =============================
    if ( Trig_DivineLoop_Func004Func011C() ) then
        set udg_DivCast = LoadUnitHandleBJ(1, udg_Handle_Div, udg_Hash_Divine)
        set udg_DivDPS = LoadRealBJ(4, udg_Handle_Div, udg_Hash_Divine)
        set udg_DivGroup2 = LoadGroupHandleBJ(5, udg_Handle_Div, udg_Hash_Divine)
        // ==============================
        set bj_wantDestroyGroup = true
        call ForGroupBJ( GetUnitsInRangeOfLocMatching(udg_DivAoE, udg_DP, Condition(function Trig_DivineLoop_Func004Func011Func007001003)), function Trig_DivineLoop_Func004Func011Func007A )
        // ==============================
        set bj_wantDestroyGroup = true
        call ForGroupBJ( GetUnitsInRangeOfLocMatching(udg_DivAoE, udg_DP, Condition(function Trig_DivineLoop_Func004Func011Func010001003)), function Trig_DivineLoop_Func004Func011Func010A )
        // ==============================
        // ==============================
        call ForGroupBJ( udg_DivGroup2, function Trig_DivineLoop_Func004Func011Func013A )
        // ==============================
        set udg_DivDuration = ( udg_DivDuration - 1 )
        call SaveGroupHandleBJ( udg_DivGroup2, 5, udg_Handle_Div, udg_Hash_Divine )
        call SaveIntegerBJ( udg_DivDuration, 3, udg_Handle_Div, udg_Hash_Divine )
    else
    endif
    set udg_DivLoop = 1
    loop
        exitwhen udg_DivLoop > 4
        set udg_DL = LoadLightningHandleBJ(( udg_DivLoop + 6 ), udg_Handle_Div, udg_Hash_Divine)
        // =============================
        if ( Trig_DivineLoop_Func004Func012Func003C() ) then
            if ( Trig_DivineLoop_Func004Func012Func003Func002C() ) then
                // // Remove a few BJs doing this method.
                call SetLightningColor( udg_DL, 0.80, 0.80, 0.80, 1 )
            else
            endif
            if ( Trig_DivineLoop_Func004Func012Func003Func003C() ) then
                call SetLightningColor( udg_DL, 0.60, 0.60, 0.60, 1 )
            else
            endif
            if ( Trig_DivineLoop_Func004Func012Func003Func004C() ) then
                call SetLightningColor( udg_DL, 0.40, 0.40, 0.40, 1 )
            else
            endif
            // =============================
            // =============================
            set udg_DivAngleTemp = ( udg_DivAngleTemp + ( udg_DivAngleUp * ( I2R(udg_DivLoop) - 1 ) ) )
            set udg_DP2 = PolarProjectionBJ(udg_DP, udg_DivAoE, udg_DivAngleTemp)
            // =============================
            // =============================
            call MoveLightningEx(udg_DL , true , GetLocationX(udg_DP), GetLocationY(udg_DP), GetLocationZ(udg_DP) + (udg_DPH2) , GetLocationX(udg_DP2), GetLocationY(udg_DP2), GetLocationZ(udg_DP2) + (udg_DPH1) )
            // =============================
            if ( Trig_DivineLoop_Func004Func012Func003Func014C() ) then
                if ( Trig_DivineLoop_Func004Func012Func003Func014Func001C() ) then
                    set udg_DivIntegerSFX = 0
                else
                endif
                call AddSpecialEffectLocBJ( udg_DP2, udg_DivEffectD )
                call DestroyEffectBJ( GetLastCreatedEffectBJ() )
            else
            endif
            call RemoveLocation(udg_DP2)
        else
            call DestroyLightning( udg_DL )
        endif
        set udg_DivLoop = udg_DivLoop + 1
    endloop
    // =============================
    set udg_DivIntegerSFX = ( udg_DivIntegerSFX + 1 )
    set udg_DivAngle = ( udg_DivAngle + udg_DivAngleConstantUp )
    // =============================
    call SaveIntegerBJ( udg_DivIntegerSFX, 15, udg_Handle_Div, udg_Hash_Divine )
    call SaveRealBJ( udg_DivAngle, 11, udg_Handle_Div, udg_Hash_Divine )
    // =============================
    if ( Trig_DivineLoop_Func004Func020C() ) then
        call ForGroupBJ( udg_DivGroup2, function Trig_DivineLoop_Func004Func020Func001A )
        call GroupRemoveUnitSimple( udg_DivDummyUNIT, udg_DivGroup )
        call UnitApplyTimedLifeBJ( 0.01, 'BTLF', udg_DivDummyUNIT )
        call SetUnitExplodedBJ( udg_DivDummyUNIT, true )
        set udg_DivTRIGGER = ( udg_DivTRIGGER - 1 )
        call FlushChildHashtableBJ( udg_Handle_Div, udg_Hash_Divine )
    else
    endif
    // =============================
    call RemoveLocation(udg_DP)
endfunction

function Trig_DivineLoop_Func005Func002Func006Func009C takes nothing returns boolean
    if ( ( udg_DivTar == null ) ) then
        return true
    endif
    if ( ( IsUnitDeadBJ(udg_DivTar) == true ) ) then
        return true
    endif
    return false
endfunction

function Trig_DivineLoop_Func005Func002Func006C takes nothing returns boolean
    if ( not Trig_DivineLoop_Func005Func002Func006Func009C() ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Func005Func002A takes nothing returns nothing
    set udg_DivPickedUnit = GetEnumUnit()
    // =============================
    set udg_Handle_Div2 = GetHandleId(udg_DivPickedUnit)
    set udg_DivTar = LoadUnitHandleBJ(6, udg_Handle_Div2, udg_Hash_Divine)
    // =============================
    if ( Trig_DivineLoop_Func005Func002Func006C() ) then
        // =============================
        call AddSpecialEffectTargetUnitBJ( "origin", udg_DivPickedUnit, udg_DivEffectC )
        call DestroyEffectBJ( GetLastCreatedEffectBJ() )
        // =============================
        call SetUnitInvulnerable( udg_DivPickedUnit, false )
        call GroupRemoveUnitSimple( udg_DivPickedUnit, udg_DivGroup2 )
        // =============================
        call FlushChildHashtableBJ( udg_Handle_Div2, udg_Hash_Divine )
    else
    endif
endfunction

function Trig_DivineLoop_Func005C takes nothing returns boolean
    if ( not ( udg_DivTRIGGER == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_DivineLoop_Actions takes nothing returns nothing
    // This makes a "1 second" delay...
    if ( Trig_DivineLoop_Func002C() ) then
        set udg_DivBool = true
        set udg_DivCount = 0
    else
        set udg_DivBool = false
        set udg_DivCount = ( udg_DivCount + 1 )
    endif
    // =============================
    call ForGroupBJ( udg_DivGroup, function Trig_DivineLoop_Func004A )
    if ( Trig_DivineLoop_Func005C() ) then
        // =============================
        call ForGroupBJ( udg_DivGroup2, function Trig_DivineLoop_Func005Func002A )
        // =============================
        call DisableTrigger( GetTriggeringTrigger() )
    else
    endif
endfunction

//===========================================================================
function InitTrig_DivineLoop takes nothing returns nothing
    set gg_trg_DivineLoop = CreateTrigger(  )
    call DisableTrigger( gg_trg_DivineLoop )
    call TriggerRegisterTimerEventPeriodic( gg_trg_DivineLoop, 0.03 )
    call TriggerAddAction( gg_trg_DivineLoop, function Trig_DivineLoop_Actions )
endfunction


That's pretty low compared to other spells :D
Good Job ^^


That's a lot of BJ's :p. The Natives aren't that hard to use compared to the BJ's. AddSpecialEffectTargetBJ, what does that do, except for rearrange the position that the target is in, Just use AddSpecialEffectTarget, tuh duh.
 
Level 10
Joined
Apr 25, 2009
Messages
296
The effects are great! But i would like to see more DivEffectD effects around the circle. And you could slow down the lightning move a bit.
Well configured! I love when the spell are easy to configure!
Good work. i'd rate 5/5


You pick structures in groups, should they be picked?
Thanks! I picked structures in groups so they may take damage, and/or become invulnerable.


The lightnings could originate from the center of the effect, not from the bottom of the effect.
Maybe attach some effect to the end point of the lightning.
Are you removing Strom Crow somewhere?
DivTRIGGER Equal to 0 should be done right after Set DivTRIGGER = (DivTRIGGER - 1) , not during every loop.
I'll see to adding a lightning effect.

The crow form - it's mostly there incase a person imports this and tests the dummy unit as a footman or something, it'll work. I don't think I'll need to remove crow form as the dummy unit is always killed at the end of the spell. In all honesty, the action could be removed entirely, however, it may prove useful for starting map makers.

DivTRIGGER Equal to 0 should be done right after Set DivTRIGGER = (DivTRIGGER - 1) , not during every loop.
Updated.


I taught him everything he knows ^_^ (Did I?)

EDIT: To show you exactly how efficient this system is:

Look at the relatively low number of BJS:

That's pretty low compared to other spells :D
Good Job ^^
:p

I tried removing as many BJ's as possible, as I'm still learning how to use things properly.


It looks really epic!5/5
Thanks ^^ Glad you like it.


That's a lot of BJ's :p. The Natives aren't that hard to use compared to the BJ's. AddSpecialEffectTargetBJ, what does that do, except for rearrange the position that the target is in, Just use AddSpecialEffectTarget, tuh duh.
I'll try to do that - I'm trying to using JassCraft and it just screws me up sadly.


the pictures (1,2,3,4) doesn't work :) good job btw 5/5
Thanks ^^. If the pictures aren't working, try refreshing the page. If it still doesn't work, click here.


Thanks for all of your feedback! Updates should follow shortly.

I'll remove even more BJ's to the point where I should probably just switch to JASS for this, but, what ever.
 
JASS:
local unit u = GetTriggerUnit()
local integer id = GetUnitTypeId(u)
local real f = GetUnitFacing(u)
local real x = GetUnitX(u)
local real y = GetUnitY(u)
call PolledWait(5.22)
call CreateUnit(Player(2), id, x, y, f)

Or you could simplify it further to this:
JASS:
local unit u = GetTriggerUnit()
call TriggerSleepAction(5.22)
call CreateUnit(Player(2), GetUnitTypeId(u), GetUnitX(u), GetUnitY(u), GetUnitFacing(u))

Tsk Tsk Tsk Bribe x)
 
Last edited:
Level 29
Joined
Mar 10, 2009
Messages
5,016
a very good spell however there are things to consider...

- Instead of making an sfx and store in variable, it can be like this...
JASS:
call DestroyEffect(AddSpecialEffectTarget(YOUR SFX, YOUR UNIT, "chest"))

- You may store the "(Position of DivDummyUNIT)" into hashtable then clear it one time when the spell ends...

- You should configure the attack & damage type as well in the MapInt...
 
Level 22
Joined
Nov 14, 2008
Messages
3,256
Category: JASS, GUI / Triggers

Whata JASS?

-I'm still kinda amazed that you still don't use a formula for your damage, aoe and such. You still have those variables at the start, it's just waste of space from my point of view as you have another variable in the cast trigger (for each one of them).

-What is this necessary for? Just make it flying in the object editor and you will not need this. Useless check when it can be prevented via the OE.

  • (DivDummyUNIT is A flying unit) Equal to False
-Instead of doing GetLocationX of udg_DP you can just use GetSpellTargetX().

Custom script: set udg_DL = AddLightningEx(udg_DL1, true , GetLocationX(udg_DP), GetLocationY(udg_DP), (udg_DPH2), GetLocationX(udg_DP2), GetLocationY(udg_DP2), GetLocationZ(udg_DP2) + (udg_DPH1))

-These two can be merged if you want to get more of the "less function calls"

Custom script: set udg_DivSFX = AddSpecialEffectTarget (udg_DivEffectA, udg_DivPickedUnit, "chest")
Custom script: call DestroyEffect (udg_DivSFX)

into

Custom script: call DestroyEffect(AddSpecialEffectTarget (udg_DivEffectA, udg_DivPickedUnit, "chest"))

-I really don't get this. This is at top. It will apply to all spells so if I cast this spell twice in a row within 1 second, the second spell will have almost a ~2 seconds delay won't it?
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • DivCount Greater than or equal to DivCountMAX
    • Then - Actions
      • Set DivBool = True
      • Set DivCount = 0
    • Else - Actions
      • Set DivBool = False
      • Set DivCount = (DivCount + 1)
-I advise you to merge the special effect destruction as I told in the cast trigger.

-This lol? :)
  • Game - Display to (All players) the text: Reset
Else it seems fine but I don't think this should apply to MUI (well it is but the if at the top ruins it).

Hopefully I didn't miss anything too important :)
 
Level 10
Joined
Apr 25, 2009
Messages
296
a very good spell however there are things to consider...

- Instead of making an sfx and store in variable, it can be like this...
Jass:
collapse_tcat.gif
call DestroyEffect(AddSpecialEffectTarget(YOUR SFX, YOUR UNIT, "chest"))

- You may store the "(Position of DivDummyUNIT)" into hashtable then clear it one time when the spell ends...

- You should configure the attack & damage type as well in the MapInt...
The SFX thing is updated, never knew you could do that.

Position of 'Dummy Unit' - Probably won't change it because a person may find use of it moving.

I'll see to the configuration of the Attack & damage type.


Category: JASS, GUI / Triggers Whata JASS?

-I'm still kinda amazed that you still don't use a formula for your damage, aoe and such. You still have those variables at the start, it's just waste of space from my point of view as you have another variable in the cast trigger (for each one of them).

-What is this necessary for? Just make it flying in the object editor and you will not need this. Useless check when it can be prevented via the OE.

if.gif
(DivDummyUNIT is A flying unit) Equal to False



-Instead of doing GetLocationX of udg_DP you can just use GetSpellTargetX().

Custom script: set udg_DL = AddLightningEx(udg_DL1, true , GetLocationX(udg_DP), GetLocationY(udg_DP), (udg_DPH2), GetLocationX(udg_DP2), GetLocationY(udg_DP2), GetLocationZ(udg_DP2) + (udg_DPH1))

-These two can be merged if you want to get more of the "less function calls"

Custom script: set udg_DivSFX = AddSpecialEffectTarget (udg_DivEffectA, udg_DivPickedUnit, "chest")
Custom script: call DestroyEffect (udg_DivSFX)

into

Custom script: call DestroyEffect(AddSpecialEffectTarget (udg_DivEffectA, udg_DivPickedUnit, "chest"))

-I really don't get this. This is at top. It will apply to all spells so if I cast this spell twice in a row within 1 second, the second spell will have almost a ~2 seconds delay won't it?
if.gif
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
joinminus.gif
cond.gif
If - Conditions
line.gif
joinbottom.gif
if.gif
DivCount Greater than or equal to DivCountMAX

joinminus.gif
actions.gif
Then - Actions
line.gif
join.gif
set.gif
Set DivBool = True
line.gif
joinbottom.gif
set.gif
Set DivCount = 0

joinbottomminus.gif
actions.gif
Else - Actions
empty.gif
join.gif
set.gif
Set DivBool = False
empty.gif
joinbottom.gif
set.gif
Set DivCount = (DivCount + 1)





-I advise you to merge the special effect destruction as I told in the cast trigger.

-This lol? :)
game.gif
Game - Display to (All players) the text: Reset



Else it seems fine but I don't think this should apply to MUI (well it is but the if at the top ruins it).

Hopefully I didn't miss anything too important :)
Oops.

-What is this necessary for? Just make it flying in the object editor and you will not need this. Useless check when it can be prevented via the OE.

if.gif
(DivDummyUNIT is A flying unit) Equal to False
Noob friendly spell making.

-I'm still kinda amazed that you still don't use a formula for your damage, aoe and such. You still have those variables at the start, it's just waste of space from my point of view as you have another variable in the cast trigger (for each one of them).
Its fewer clicks.

Custom script: set udg_DivSFX = AddSpecialEffectTarget (udg_DivEffectA, udg_DivPickedUnit, "chest")
Custom script: call DestroyEffect (udg_DivSFX)
Done.

-I really don't get this. This is at top. It will apply to all spells so if I cast this spell twice in a row within 1 second, the second spell will have almost a ~2 seconds delay won't it?
if.gif
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
joinminus.gif
cond.gif
If - Conditions
line.gif
joinbottom.gif
if.gif
DivCount Greater than or equal to DivCountMAX

joinminus.gif
actions.gif
Then - Actions
line.gif
join.gif
set.gif
Set DivBool = True
line.gif
joinbottom.gif
set.gif
Set DivCount = 0

joinbottomminus.gif
actions.gif
Else - Actions
empty.gif
join.gif
set.gif
Set DivBool = False
empty.gif
joinbottom.gif
set.gif
Set DivCount = (DivCount + 1)
This is mostly to merge the loops... Units that are in the circle from the beginning are make invulnerable instantly. From testing the spell, I've never found this to be a major problem, but I'll look into it.


Updated.
 
Last edited:
Level 3
Joined
Jun 3, 2013
Messages
39
It's a little hard for me to import. The spell itself is really nice, though :grin:

(I can't just copy and paste all those variables, considering I can only select one at a time)
 
Last edited:
Top