1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. Ride into the sunset with the 32nd Modeling Contest. The contest is optionally paired. Best of luck, people!
    Dismiss Notice
  5. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  6. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Trigger Viewer

Doom Fuse Jass.w3x
Variables
Spell
Doom Fuse
Variables
Test
Test
Revive
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code.

		
Name Type Is Array Initial Value
Doom_Fuse_AngleW23 real Yes
Doom_Fuse_Caster unit Yes
Doom_Fuse_Dummy unit Yes
Doom_Fuse_Duration real Yes
Doom_Fuse_GroupDamage group No
Doom_Fuse_HeightW3 real Yes
Doom_Fuse_Index integer No
Doom_Fuse_LeftRight boolean No
Doom_Fuse_LeftRightW3 boolean Yes
Doom_Fuse_Level integer Yes
Doom_Fuse_Models effect Yes
Doom_Fuse_Sin real Yes
Doom_Fuse_SinW2 real Yes
Doom_Fuse_SpellX real Yes
Doom_Fuse_SpellY real Yes
Doom_Fuse_Timer timer No
Doom_Fuse_TLDuration real Yes
Doom_Fuse_TLHandle lightning Yes
Doom_Fuse_TLIndex integer No
Doom_Fuse_TLTimer timer No
Doom_Fuse_Waves integer Yes
i integer No
l location No
r real Yes
t timer No
u unit Yes
//TESH.scrollpos=24
//TESH.alwaysfold=1
//***************************************************************************
//*
//*                    DOOM FUSE JASS
//*                        v1.0d
//*                     by JC Helas
//*
//*                         FAQ
//*                    Q.How to Import?
//*    A1. Goto File>Preferences>General> Mark "Automatically create unknown variable while pasting trigger data".
//*    A2. Copy all custom object that spell need into your map.
//*    A3. Copy Doom Fuse category into your map.
//*    A4. Then done, have fun.
//*
//*                  Q.Is it Configurable?
//*    A.1 You can configure all detailed constant functions what ever you want.
//*    A.2 You can even remodel the spell and change some values amount.
//*
//*
//*                    Report any Bugs
//*               Contact:sojocu4@gmail.com
//*
//*
//*                      Changelog
//*                        v1.0
//*                   Initial Release
//*
//*                        v1.0a
//*                  Fix Loop Function
//*
//*                        v1.0b
//*                 Fix Loop Conditions
//*               Add More Documentating
//*                        v1.0d
//*                      Fix Waves
//*                      Remove BJ
//*
//*
//***************************************************************************
// Ability ID of spell
constant function Doom_Fuse_AbilityID takes nothing returns integer
    return 'A000'
endfunction
//***************************************************************************
// Ability ID that makes dummy flyable
constant function Doom_Fuse_FlyID takes nothing returns integer
    return 'Amrf'
endfunction
//***************************************************************************
// Unit Type ID of dummy
constant function Doom_Fuse_DummyID takes nothing returns integer
    return 'u000'
endfunction
//***************************************************************************
// Model of dummy that was place at center
constant function Doom_Fuse_BallModel takes nothing returns string
    return "Abilities\\Spells\\Undead\\AntiMagicShell\\AntiMagicShell.mdl"
endfunction
//***************************************************************************
// Attach location of ball model
constant function Doom_Fuse_BallModelAttach takes nothing returns string
    return "origin"
endfunction
//***************************************************************************
// Model of turning dummy
// attach to dummy that will turn to ball dummy
constant function Doom_Fuse_PostModel takes nothing returns string
    return "Abilities\\Weapons\\IllidanMissile\\IllidanMissile.mdl"
endfunction
//***************************************************************************
// Attach location of post model
constant function Doom_Fuse_PostModelAttach takes nothing returns string
    return "origin"
endfunction
//***************************************************************************
// Lighting Type
//
// "CLPB":Chain Lightning - Primary
// "CLSB":Chain Lightning - Secondary
// "DRAB":Drain
// "DRAM":Drain Mana
// "AFOD":Finger of Death
// "FORK":Fork Lightning
// "HWPB":Healing Wave
// "CHIM":Lightning Attack
// "LEAS":Magic Leash
// "MBUR":Mana Burn
// "MFPB":Mana Flare
// "SPLK":Spirit Link
//
// This lightning was use at damaging the target
// and summon every interval damage.
constant function Doom_Fuse_LightningType takes nothing returns string
    return "SPLK"
endfunction
//***************************************************************************
// Lightning life time
constant function Doom_Fuse_LightningDuration takes nothing returns real
    return 0.125
endfunction
//***************************************************************************
// Lightning type of damaging effect
// Effect that will stand as thunders hits the ground.
constant function Doom_Fuse_LightningMarks takes nothing returns string
    return "Abilities\\Weapons\\CannonTowerMissile\\CannonTowerMissile.mdl"
endfunction
//***************************************************************************
// Loop Periodic PS: Changing this may cause bigger change
constant function Doom_Fuse_Periodic takes nothing returns real
    return 0.031250
endfunction
//***************************************************************************
// Owner of all dummies
constant function Doom_Fuse_DummyOwn takes nothing returns player
    return Player(PLAYER_NEUTRAL_PASSIVE)
endfunction
//***************************************************************************
// Height of the center dummy
constant function Doom_Fuse_CenterBallHeight takes nothing returns real
    return 400.0
endfunction
//***************************************************************************
// Duration of center dummy's travling to its height limit
constant function Doom_Fuse_FlyDuration takes nothing returns real
    return 2.0
endfunction
//***************************************************************************
// Duration of post dummies traveling to its distance limit from center
constant function Doom_Fuse_PostTravelDuration takes nothing returns real
    return 2.0
endfunction
//***************************************************************************
// Amount of post line that will rotate
constant function Doom_Fuse_PostNumbers takes nothing returns integer
    return 6
endfunction
//***************************************************************************
// Max distance of post to center
constant function Doom_Fuse_PostDistance takes nothing returns real
    return 400.0
endfunction
//***************************************************************************
// Speed turning of 360 deg.
constant function Doom_Fuse_RotateSpeed takes nothing returns real
    return 2.0//seconds
endfunction
//***************************************************************************
// Attack Type of damaging
constant function Doom_Fuse_AttackType takes nothing returns attacktype
    return ATTACK_TYPE_NORMAL
endfunction
//***************************************************************************
// Damage Type of damaging
constant function Doom_Fuse_DamageType takes nothing returns damagetype
    return DAMAGE_TYPE_NORMAL
endfunction
//***************************************************************************
// Damage
// Damage Base+(Amount Added each lvl)
constant function Doom_Fuse_Damage takes integer lv returns real
    return 150.0+(25.0*lv)
endfunction
//***************************************************************************
// Damage Interval
constant function Doom_Fuse_DamageInterval takes nothing returns real
    return 0.25
endfunction
//***************************************************************************
// Damage Range per interval
constant function Doom_Fuse_DamageRadius takes nothing returns real
    return 100.0
endfunction
//***************************************************************************
// Drop speed of all dummies at last wave
constant function Doom_Fuse_SpeedDrop takes nothing returns real
    return 15.0
endfunction
//***************************************************************************
// Vacuum force speed
constant function Doom_Fuse_VacuumForce takes nothing returns real
    return 2.0
endfunction
//***************************************************************************
// Duration of damaging and post rotate
constant function Doom_Fuse_Duration takes nothing returns real
    return 10.0
endfunction
//***************************************************************************
// End Setup
//***************************************************************************
// In this wave ball will raise,
// Upon reaching its height, ball will
// call forth of thunders that scars its
// designated area and causing damage
// as well as vacuuming enemy in area.
constant function Doom_Fuse_WaveBall takes nothing returns integer
    return 1
endfunction
//***************************************************************************
// In this wave post are being summoned
constant function Doom_Fuse_WaveCreatePost takes nothing returns integer
    return 2
endfunction
//***************************************************************************
// In this wave post are rotating
constant function Doom_Fuse_WaveRotatePost takes nothing returns integer
    return 3
endfunction
//***************************************************************************
// In this wave every dummies are falling
// and deindex instance.
constant function Doom_Fuse_WaveEnd takes nothing returns integer
    return 4
endfunction
//***************************************************************************
constant function Doom_Fuse_SinMax takes nothing returns real
    return 90.0
endfunction
//***************************************************************************
function Doom_Fuse_SinSpeed takes real sm,real d returns real
    return sm/(d/Doom_Fuse_Periodic())
endfunction
//***************************************************************************
function Doom_Fuse_Filter takes unit u,unit t returns boolean
    return not IsUnitType(u,UNIT_TYPE_DEAD) and not IsUnitType(u,UNIT_TYPE_MAGIC_IMMUNE) and not (GetUnitAbilityLevel(u,'Bvul') > 0) and not IsUnitAlly(u,GetOwningPlayer(t))
endfunction
//***************************************************************************
function Doom_Fuse_TL takes nothing returns nothing
    local integer i=1
    local real c
    loop
        exitwhen i>udg_Doom_Fuse_TLIndex
        if udg_Doom_Fuse_TLDuration[i]>Doom_Fuse_Periodic() then
            set udg_Doom_Fuse_TLDuration[i]=udg_Doom_Fuse_TLDuration[i]-Doom_Fuse_Periodic()
            set c=Sin((Doom_Fuse_SinMax()/Doom_Fuse_LightningDuration())*udg_Doom_Fuse_TLDuration[i]*bj_DEGTORAD)
            call SetLightningColor(udg_Doom_Fuse_TLHandle[i],c,c,c,c)
        else
            call DestroyLightning(udg_Doom_Fuse_TLHandle[i])
            set udg_Doom_Fuse_TLHandle[i]=null
            set udg_Doom_Fuse_TLHandle[i]=udg_Doom_Fuse_TLHandle[udg_Doom_Fuse_TLIndex]
            set udg_Doom_Fuse_TLDuration[i]=udg_Doom_Fuse_TLDuration[udg_Doom_Fuse_TLIndex]
            set udg_Doom_Fuse_TLIndex=udg_Doom_Fuse_TLIndex-1
            set i=i-1
            if udg_Doom_Fuse_TLIndex==0 then
                call PauseTimer(udg_Doom_Fuse_TLTimer)
            endif
        endif
        set i=i+1
    endloop
endfunction
//***************************************************************************
function Doom_Fuse_Loop takes nothing returns nothing
    local integer i=1
    local real x
    local real y
    local real a
    local unit u
    loop
        exitwhen i>udg_Doom_Fuse_Index
        if udg_Doom_Fuse_Waves[i]==Doom_Fuse_WaveBall() then
            if udg_Doom_Fuse_Sin[i]<Doom_Fuse_SinMax() then
                set udg_Doom_Fuse_Sin[i]=udg_Doom_Fuse_Sin[i]+Doom_Fuse_SinSpeed(Doom_Fuse_SinMax(),Doom_Fuse_FlyDuration()+Doom_Fuse_PostTravelDuration())
                call SetUnitFlyHeight(udg_Doom_Fuse_Dummy[i],Sin(udg_Doom_Fuse_Sin[i]*bj_DEGTORAD)*Doom_Fuse_CenterBallHeight(),0.0)
            else
                set udg_Doom_Fuse_Sin[i]=udg_Doom_Fuse_Sin[i]+Doom_Fuse_SinSpeed(Doom_Fuse_SinMax(),Doom_Fuse_DamageInterval())
                call GroupEnumUnitsInRange(udg_Doom_Fuse_GroupDamage,udg_Doom_Fuse_SpellX[i],udg_Doom_Fuse_SpellY[i],Doom_Fuse_PostDistance(),null)
                loop
                    set u=FirstOfGroup(udg_Doom_Fuse_GroupDamage)
                    exitwhen u==null
                    if Doom_Fuse_Filter(udg_Doom_Fuse_Caster[i],u) then
                        set x=GetUnitX(u)
                        set y=GetUnitY(u)
                        set a=Atan2(y-udg_Doom_Fuse_SpellY[i],x-udg_Doom_Fuse_SpellX[i])*bj_RADTODEG
                        call SetUnitX(u,x-Doom_Fuse_VacuumForce()*Cos(a*bj_DEGTORAD))
                        call SetUnitY(u,y-Doom_Fuse_VacuumForce()*Sin(a*bj_DEGTORAD))
                    endif
                    call GroupRemoveUnit(udg_Doom_Fuse_GroupDamage,u)
                endloop
                if udg_Doom_Fuse_Sin[i]>=(Doom_Fuse_SinMax()*2) then
                    set a=GetRandomReal(0,359)
                    set x=udg_Doom_Fuse_SpellX[i]+GetRandomReal(20.0,Doom_Fuse_CenterBallHeight())*Cos(a*bj_DEGTORAD)
                    set y=udg_Doom_Fuse_SpellY[i]+GetRandomReal(20.0,Doom_Fuse_CenterBallHeight())*Sin(a*bj_DEGTORAD)
                    call DestroyEffect(AddSpecialEffect(Doom_Fuse_LightningMarks(),x,y))
                    call GroupEnumUnitsInRange(udg_Doom_Fuse_GroupDamage,x,y,Doom_Fuse_DamageRadius(),null)
                    loop
                        set u=FirstOfGroup(udg_Doom_Fuse_GroupDamage)
                        exitwhen u==null
                        if Doom_Fuse_Filter(udg_Doom_Fuse_Caster[i],u) then
                            call UnitDamageTarget(udg_Doom_Fuse_Caster[i],u,Doom_Fuse_Damage(udg_Doom_Fuse_Level[i]),false,false,Doom_Fuse_AttackType(),Doom_Fuse_DamageType(),null)
                        endif
                        call GroupRemoveUnit(udg_Doom_Fuse_GroupDamage,u)
                    endloop
                    set udg_Doom_Fuse_Sin[i]=Doom_Fuse_SinMax()
                    set udg_Doom_Fuse_TLIndex=udg_Doom_Fuse_TLIndex+1
                    set udg_Doom_Fuse_TLDuration[udg_Doom_Fuse_TLIndex]=Doom_Fuse_LightningDuration()
                    set udg_Doom_Fuse_TLHandle[udg_Doom_Fuse_TLIndex]=AddLightningEx(Doom_Fuse_LightningType(),true,udg_Doom_Fuse_SpellX[i],udg_Doom_Fuse_SpellY[i],Doom_Fuse_CenterBallHeight(),x,y,0.0)
                    if udg_Doom_Fuse_TLIndex==1 then
                        call TimerStart(udg_Doom_Fuse_TLTimer,Doom_Fuse_Periodic(),true,function Doom_Fuse_TL)
                    endif
                endif
                set udg_Doom_Fuse_Duration[i]=udg_Doom_Fuse_Duration[i]+Doom_Fuse_Periodic()
                if udg_Doom_Fuse_Duration[i]>=Doom_Fuse_Duration() then
                    set udg_Doom_Fuse_Waves[i]=Doom_Fuse_WaveEnd()
                    set udg_Doom_Fuse_Duration[i]=0.0
                endif
            endif
        elseif udg_Doom_Fuse_Waves[i]==Doom_Fuse_WaveCreatePost() then
            if udg_Doom_Fuse_Sin[i]<Doom_Fuse_SinMax() then
                set udg_Doom_Fuse_Sin[i]=udg_Doom_Fuse_Sin[i]+Doom_Fuse_SinSpeed(Doom_Fuse_SinMax(),Doom_Fuse_PostTravelDuration())
                set a=(Doom_Fuse_PostDistance()/Doom_Fuse_SinMax())*udg_Doom_Fuse_Sin[i]
                set x=udg_Doom_Fuse_SpellX[i]+a*Cos(udg_Doom_Fuse_AngleW23[i]*bj_DEGTORAD)
                set y=udg_Doom_Fuse_SpellY[i]+a*Sin(udg_Doom_Fuse_AngleW23[i]*bj_DEGTORAD)
                if udg_Doom_Fuse_SinW2[i]>=Doom_Fuse_SinMax()/Doom_Fuse_PostNumbers() then
                    if udg_Doom_Fuse_LeftRight then
                        set udg_Doom_Fuse_LeftRight=false
                    else
                        set udg_Doom_Fuse_LeftRight=true
                    endif
                    set udg_Doom_Fuse_Index=udg_Doom_Fuse_Index+1
                    set udg_Doom_Fuse_Waves[udg_Doom_Fuse_Index]=Doom_Fuse_WaveRotatePost()
                    set udg_Doom_Fuse_Sin[udg_Doom_Fuse_Index]=0.0
                    set udg_Doom_Fuse_Duration[udg_Doom_Fuse_Index]=0.0
                    set udg_Doom_Fuse_HeightW3[udg_Doom_Fuse_Index]=Doom_Fuse_PostDistance()-a
                    set udg_Doom_Fuse_Caster[udg_Doom_Fuse_Index]=udg_Doom_Fuse_Caster[i]
                    set udg_Doom_Fuse_SpellX[udg_Doom_Fuse_Index]=udg_Doom_Fuse_SpellX[i]
                    set udg_Doom_Fuse_SpellY[udg_Doom_Fuse_Index]=udg_Doom_Fuse_SpellY[i]
                    set udg_Doom_Fuse_AngleW23[udg_Doom_Fuse_Index]=udg_Doom_Fuse_AngleW23[i]
                    set udg_Doom_Fuse_LeftRightW3[udg_Doom_Fuse_Index]=udg_Doom_Fuse_LeftRight
                    set udg_Doom_Fuse_Level[udg_Doom_Fuse_Index]=GetUnitAbilityLevel(udg_Doom_Fuse_Caster[i],Doom_Fuse_AbilityID())
                    set udg_Doom_Fuse_Dummy[udg_Doom_Fuse_Index]=CreateUnit(Doom_Fuse_DummyOwn(),Doom_Fuse_DummyID(),x,y,0)
                    set udg_Doom_Fuse_Models[udg_Doom_Fuse_Index]=AddSpecialEffectTarget(Doom_Fuse_PostModel(),udg_Doom_Fuse_Dummy[udg_Doom_Fuse_Index],"origin")
                    call UnitAddAbility(udg_Doom_Fuse_Dummy[udg_Doom_Fuse_Index],Doom_Fuse_FlyID())
                    call UnitRemoveAbility(udg_Doom_Fuse_Dummy[udg_Doom_Fuse_Index],Doom_Fuse_FlyID())
                    set udg_Doom_Fuse_SinW2[i]=0
                endif
                set udg_Doom_Fuse_SinW2[i]=udg_Doom_Fuse_SinW2[i]+Doom_Fuse_SinSpeed(Doom_Fuse_SinMax(),Doom_Fuse_PostTravelDuration())
            else
                set udg_Doom_Fuse_Waves[i]=Doom_Fuse_WaveEnd()
            endif
        elseif udg_Doom_Fuse_Waves[i]==Doom_Fuse_WaveRotatePost() then
            if udg_Doom_Fuse_Sin[i]<Doom_Fuse_SinMax() then
                set udg_Doom_Fuse_Sin[i]=udg_Doom_Fuse_Sin[i]+Doom_Fuse_SinSpeed(Doom_Fuse_SinMax(),Doom_Fuse_FlyDuration())
                set a=Sin(udg_Doom_Fuse_Sin[i]*bj_DEGTORAD)*(Doom_Fuse_PostDistance()-udg_Doom_Fuse_HeightW3[i])
                set x=udg_Doom_Fuse_SpellX[i]+a*Cos(udg_Doom_Fuse_AngleW23[i]*bj_DEGTORAD)
                set y=udg_Doom_Fuse_SpellY[i]+a*Sin(udg_Doom_Fuse_AngleW23[i]*bj_DEGTORAD)
            elseif udg_Doom_Fuse_LeftRightW3[i] then
                set udg_Doom_Fuse_AngleW23[i]=udg_Doom_Fuse_AngleW23[i]+(360/(Doom_Fuse_RotateSpeed()/Doom_Fuse_Periodic()))
                set a=Sin(udg_Doom_Fuse_Sin[i]*bj_DEGTORAD)*(Doom_Fuse_PostDistance()-udg_Doom_Fuse_HeightW3[i])
                set x=udg_Doom_Fuse_SpellX[i]+a*Cos(udg_Doom_Fuse_AngleW23[i]*bj_DEGTORAD)
                set y=udg_Doom_Fuse_SpellY[i]+a*Sin(udg_Doom_Fuse_AngleW23[i]*bj_DEGTORAD)
                if udg_Doom_Fuse_AngleW23[i]==360 then
                    set udg_Doom_Fuse_AngleW23[i]=0
                endif
                set udg_Doom_Fuse_Duration[i]=udg_Doom_Fuse_Duration[i]+Doom_Fuse_Periodic()
            else
                set udg_Doom_Fuse_AngleW23[i]=udg_Doom_Fuse_AngleW23[i]-(360/(Doom_Fuse_RotateSpeed()/Doom_Fuse_Periodic()))
                set a=Sin(udg_Doom_Fuse_Sin[i]*bj_DEGTORAD)*(Doom_Fuse_PostDistance()-udg_Doom_Fuse_HeightW3[i])
                set x=udg_Doom_Fuse_SpellX[i]+a*Cos(udg_Doom_Fuse_AngleW23[i]*bj_DEGTORAD)
                set y=udg_Doom_Fuse_SpellY[i]+a*Sin(udg_Doom_Fuse_AngleW23[i]*bj_DEGTORAD)
                if udg_Doom_Fuse_AngleW23[i]==0 then
                    set udg_Doom_Fuse_AngleW23[i]=360
                endif
                set udg_Doom_Fuse_Duration[i]=udg_Doom_Fuse_Duration[i]+Doom_Fuse_Periodic()
            endif
            call SetUnitFlyHeight(udg_Doom_Fuse_Dummy[i],Sin(udg_Doom_Fuse_Sin[i]*bj_DEGTORAD)*udg_Doom_Fuse_HeightW3[i],0.0)
            call SetUnitX(udg_Doom_Fuse_Dummy[i],x)
            call SetUnitY(udg_Doom_Fuse_Dummy[i],y)
            if udg_Doom_Fuse_Duration[i]>=Doom_Fuse_Duration() then
                set udg_Doom_Fuse_Waves[i]=Doom_Fuse_WaveEnd()
                set udg_Doom_Fuse_Duration[i]=0.0
            endif
        elseif udg_Doom_Fuse_Waves[i]==Doom_Fuse_WaveEnd() then
            if udg_Doom_Fuse_Dummy[i]!=null then
                set a=GetUnitFlyHeight(udg_Doom_Fuse_Dummy[i])
                if a>=Doom_Fuse_SpeedDrop() then
                    call SetUnitFlyHeight(udg_Doom_Fuse_Dummy[i],a-Doom_Fuse_SpeedDrop(),0.0)
                elseif udg_Doom_Fuse_Caster[i]!=null then
                    call DestroyEffect(udg_Doom_Fuse_Models[i])
                    set udg_Doom_Fuse_Duration[i]=1.0
                    set udg_Doom_Fuse_Caster[i]=null
                elseif udg_Doom_Fuse_Duration[i]>Doom_Fuse_Periodic() then
                    set udg_Doom_Fuse_Duration[i]=udg_Doom_Fuse_Duration[i]-Doom_Fuse_Periodic()
                elseif udg_Doom_Fuse_Duration[i]<=Doom_Fuse_Periodic() then
                    call RemoveUnit(udg_Doom_Fuse_Dummy[i])
                    set udg_Doom_Fuse_Dummy[i]=null
                    set udg_Doom_Fuse_Models[i]=null
                endif
            else
                set udg_Doom_Fuse_Caster[i]=udg_Doom_Fuse_Caster[udg_Doom_Fuse_Index]
                set udg_Doom_Fuse_Dummy[i]=udg_Doom_Fuse_Dummy[udg_Doom_Fuse_Index]
                set udg_Doom_Fuse_SpellX[i]=udg_Doom_Fuse_SpellX[udg_Doom_Fuse_Index]
                set udg_Doom_Fuse_SpellY[i]=udg_Doom_Fuse_SpellY[udg_Doom_Fuse_Index]
                set udg_Doom_Fuse_Sin[i]=udg_Doom_Fuse_Sin[udg_Doom_Fuse_Index]
                set udg_Doom_Fuse_SinW2[i]=udg_Doom_Fuse_SinW2[udg_Doom_Fuse_Index]
                set udg_Doom_Fuse_HeightW3[i]=udg_Doom_Fuse_HeightW3[udg_Doom_Fuse_Index]
                set udg_Doom_Fuse_Duration[i]=udg_Doom_Fuse_Duration[udg_Doom_Fuse_Index]
                set udg_Doom_Fuse_AngleW23[i]=udg_Doom_Fuse_AngleW23[udg_Doom_Fuse_Index]
                set udg_Doom_Fuse_Waves[i]=udg_Doom_Fuse_Waves[udg_Doom_Fuse_Index]
                set udg_Doom_Fuse_Level[i]=udg_Doom_Fuse_Level[udg_Doom_Fuse_Index]
                set udg_Doom_Fuse_LeftRightW3[i]=udg_Doom_Fuse_LeftRightW3[udg_Doom_Fuse_Index]
                set udg_Doom_Fuse_Models[i]=udg_Doom_Fuse_Models[udg_Doom_Fuse_Index]
                set udg_Doom_Fuse_Index=udg_Doom_Fuse_Index-1
                set i=i-1
                if udg_Doom_Fuse_Index==0 then
                    call PauseTimer(udg_Doom_Fuse_Timer)
                endif
            endif
        endif
        set i=i+1
    endloop
    set u=null
endfunction
//***************************************************************************
function Trig_Doom_Fuse_Cast takes nothing returns boolean
    local integer i
    if GetSpellAbilityId()== Doom_Fuse_AbilityID() then
        set udg_Doom_Fuse_Index=udg_Doom_Fuse_Index+1
        set udg_Doom_Fuse_Waves[udg_Doom_Fuse_Index]=Doom_Fuse_WaveBall()
        set udg_Doom_Fuse_Sin[udg_Doom_Fuse_Index]=0.0
        set udg_Doom_Fuse_Duration[udg_Doom_Fuse_Index]=0.0
        set udg_Doom_Fuse_Caster[udg_Doom_Fuse_Index]=GetTriggerUnit()
        set udg_Doom_Fuse_SpellX[udg_Doom_Fuse_Index]=GetSpellTargetX()
        set udg_Doom_Fuse_SpellY[udg_Doom_Fuse_Index]=GetSpellTargetY()
        set udg_Doom_Fuse_Level[udg_Doom_Fuse_Index]=GetUnitAbilityLevel(udg_Doom_Fuse_Caster[udg_Doom_Fuse_Index],Doom_Fuse_AbilityID())
        set udg_Doom_Fuse_Dummy[udg_Doom_Fuse_Index]=CreateUnit(Doom_Fuse_DummyOwn(),Doom_Fuse_DummyID(),udg_Doom_Fuse_SpellX[udg_Doom_Fuse_Index],udg_Doom_Fuse_SpellY[udg_Doom_Fuse_Index],0)
        set udg_Doom_Fuse_Models[udg_Doom_Fuse_Index]=AddSpecialEffectTarget(Doom_Fuse_BallModel(),udg_Doom_Fuse_Dummy[udg_Doom_Fuse_Index],"origin")
        call UnitAddAbility(udg_Doom_Fuse_Dummy[udg_Doom_Fuse_Index],Doom_Fuse_FlyID())
        call UnitRemoveAbility(udg_Doom_Fuse_Dummy[udg_Doom_Fuse_Index],Doom_Fuse_FlyID())
        if udg_Doom_Fuse_Index==1 then
            call TimerStart(udg_Doom_Fuse_Timer,Doom_Fuse_Periodic(),true,function Doom_Fuse_Loop)
        endif
       
        set i=1
        loop
            exitwhen i>Doom_Fuse_PostNumbers()
            set udg_Doom_Fuse_Index=udg_Doom_Fuse_Index+1
            set udg_Doom_Fuse_Waves[udg_Doom_Fuse_Index]=Doom_Fuse_WaveCreatePost()
            set udg_Doom_Fuse_Sin[udg_Doom_Fuse_Index]=0.0
            set udg_Doom_Fuse_SinW2[udg_Doom_Fuse_Index]=Doom_Fuse_SinMax()/Doom_Fuse_PostNumbers()
            set udg_Doom_Fuse_AngleW23[udg_Doom_Fuse_Index]=(360/Doom_Fuse_PostNumbers())*i
            set udg_Doom_Fuse_Caster[udg_Doom_Fuse_Index]=GetTriggerUnit()
            set udg_Doom_Fuse_SpellX[udg_Doom_Fuse_Index]=GetSpellTargetX()
            set udg_Doom_Fuse_SpellY[udg_Doom_Fuse_Index]=GetSpellTargetY()
            set udg_Doom_Fuse_Level[udg_Doom_Fuse_Index]=GetUnitAbilityLevel(udg_Doom_Fuse_Caster[udg_Doom_Fuse_Index],Doom_Fuse_AbilityID())
            set i=i+1
        endloop
    endif
    return false
endfunction
//===========================================================================
function InitTrig_Doom_Fuse takes nothing returns nothing
    local integer i
    set gg_trg_Doom_Fuse=CreateTrigger()
    set i = 0
    loop
        call TriggerRegisterPlayerUnitEvent(gg_trg_Doom_Fuse,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
        set i = i + 1
        exitwhen i == bj_MAX_PLAYER_SLOTS
    endloop
    call TriggerAddCondition(gg_trg_Doom_Fuse,Condition(function Trig_Doom_Fuse_Cast))
endfunction

 
Variables
  Events
  Conditions
  Actions
    Set VariableSet Doom_Fuse_AngleW23[0] = 0.00
    Set VariableSet Doom_Fuse_Caster[0] = No unit
    Set VariableSet Doom_Fuse_Dummy[0] = No unit
    Set VariableSet Doom_Fuse_Duration[0] = 0.00
    Set VariableSet Doom_Fuse_GroupDamage = (Last created unit group)
    Set VariableSet Doom_Fuse_HeightW3[0] = 0.00
    Set VariableSet Doom_Fuse_Index = 0
    Set VariableSet Doom_Fuse_LeftRight = False
    Set VariableSet Doom_Fuse_LeftRightW3[0] = False
    Set VariableSet Doom_Fuse_Level[0] = 0
    Set VariableSet Doom_Fuse_Models[0] = (Last created special effect)
    Set VariableSet Doom_Fuse_Sin[0] = 0.00
    Set VariableSet Doom_Fuse_SinW2[0] = 0.00
    Set VariableSet Doom_Fuse_SpellX[0] = 0.00
    Set VariableSet Doom_Fuse_SpellY[0] = 0.00
    Set VariableSet Doom_Fuse_TLDuration[0] = 0.00
    Set VariableSet Doom_Fuse_TLHandle[0] = (Last created lightning effect)
    Set VariableSet Doom_Fuse_TLIndex = 0
    Set VariableSet Doom_Fuse_TLTimer = (Last started timer)
    Set VariableSet Doom_Fuse_Timer = (Last started timer)
    Set VariableSet Doom_Fuse_Waves[0] = 0
Test
  Events
    Player - Player 1 (Red) skips a cinematic sequence
  Conditions
  Actions
    Unit - Set life of Dreadlord 0001 <gen> to 100%
    Unit - Set mana of Dreadlord 0001 <gen> to 100%
    Unit - Reset ability cooldowns for Dreadlord 0001 <gen>.
    Unit - Set life of Dreadlord 0035 <gen> to 100%
    Unit - Set mana of Dreadlord 0035 <gen> to 100%
    Unit - Reset ability cooldowns for Dreadlord 0035 <gen>.
    Unit - Set life of Dreadlord 0036 <gen> to 100%
    Unit - Set mana of Dreadlord 0036 <gen> to 100%
    Unit - Reset ability cooldowns for Dreadlord 0036 <gen>.
Revive
  Events
    Map initialization
  Conditions
  Actions
    Custom script: call ExecuteFunc("init")
    Custom script: endfunction
    Custom script: function lop takes nothing returns nothing
    For each (Integer A) from 1 to i, do (Actions)
      Loop - Actions
        Custom script: set udg_r[bj_forLoopAIndex]=udg_r[bj_forLoopAIndex]-0.031250
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          If - Conditions
            r[(Integer A)] Less than or equal to 0.00
          Then - Actions
            Set VariableSet l = (Position of u[(Integer A)])
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                (u[(Integer A)] is A Hero) Equal to False
              Then - Actions
                Unit - Create 1.(Unit-type of u[(Integer A)]) for (Owner of u[(Integer A)]) at l facing (Facing of u[(Integer A)]) degrees
                Unit - Remove u[(Integer A)] from the game
              Else - Actions
                Hero - Instantly revive u[(Integer A)] at l, Show revival graphics
            Custom script: call RemoveLocation(udg_l)
            Set VariableSet u[(Integer A)] = No unit
            Set VariableSet u[(Integer A)] = u[i]
            Set VariableSet r[(Integer A)] = r[i]
            Set VariableSet i = (i - 1)
            Custom script: set bj_forLoopAIndexEnd=udg_i
            Custom script: set bj_forLoopAIndex=bj_forLoopAIndex-1
            If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              If - Conditions
                i Equal to 0
              Then - Actions
                Countdown Timer - Pause t
              Else - Actions
          Else - Actions
    Custom script: endfunction
    Custom script: function dies takes nothing returns nothing
    Set VariableSet i = (i + 1)
    Set VariableSet u[i] = (Triggering unit)
    Set VariableSet r[i] = 1.00
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      If - Conditions
        i Equal to 1
      Then - Actions
        Custom script: call TimerStart(udg_t,0.03125,true,function lop)
      Else - Actions
    Custom script: endfunction
    Custom script: function init takes nothing returns nothing
    Custom script: call TriggerClearActions(gg_trg_Revive)
    Custom script: call BJDebugMsg("Press Skip to Reset Cooldown,Life and Mana.")
    Custom script: call TriggerRegisterAnyUnitEventBJ( gg_trg_Revive, EVENT_PLAYER_UNIT_DEATH )
    Custom script: call TriggerAddAction(gg_trg_Revive,function dies)
    Visibility - Disable fog of war
    Visibility - Disable black mask