Spellpack Nuke, Flame Storm, Blink Back, Fade Run

Prometheus

Everything is mutable; nothing is sacred
Reaction score
589
I forget how one does their own struct-->timer system.


Edit: Using CSData.


Edit 2: Fixed.
 

emjlr3

Change can be a good thing
Reaction score
395
well nuke looks like flamestrike with an imported sfx
flame storm has too much shit all over
blink back is decent
fade run looks aweful
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
589
Nuke was for a FX spam contest.
Flame Storm was for a fire+movement themed contest. Eye candy was also big there.
Thanks.
How so? It's meant to create a trail.
 

emjlr3

Change can be a good thing
Reaction score
395
well the images dont look as though they are running themselves, they are just standing there looking dumb, would be nice to have the images pause at the correct spot in the units animation, that is the only way this can look decent
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
589
I think I fixed that, mind looking at the code so I don't just release a really small update and then have to do a ton more?
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Implementation instructions are within the map.

Credits: Uberplayer, Romek, Tinki3, Phyrex1an, Ghan, Varine, Trollvottel, azlier, Daxtreme

PUI
TT
CSData can be found in the map.

Nuke

Vid
http://www.xfire.com/video/a712c/

Code
JASS:
scope NukeBomb initializer Init
//Requires CSData
    globals
        //[Config Header]
        private constant integer ABID = 'A000'
            //The abilities ID.
        private constant integer DUMID = 'u001'
            //The ID of the dummy unit.
        private constant integer CROW = 'Amrf'
            //The ability ID for crow, leave alone unless you've changed it.
        private constant string BOOM = "war3mapImported\\NuclearExplosion.mdx"
            //The string file path for the explosion at the end. All \s become \\s.
        private constant real DMG = 100
            //How much base damage is done per level.
        private constant real AOE = 500
            //The AOE of the damage.
        private constant boolean REALISTIC = false
            //If set to true, the unit will damage everything around him.
            //If set to false, the unit will only damage enemies.
        //End [Config Header]
            
        private sound SOUND
        private unit temp
    endglobals
    
    private constant function SPECDMG takes integer lvl returns real
        return DMG*lvl
        //This function multiplies the base damage (Variable: DMG) by the level of the ability.
    endfunction
    
    private function NukeCond takes nothing returns boolean
        return GetSpellAbilityId() == ABID
    endfunction
    
    private function IsEnemy takes nothing returns boolean
        if IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(temp)) then
            return true
        endif
        return false
    endfunction
    
    private struct Nuke
        unit u
        unit d
        group g
        location l
        location q
        integer lvl
        
        method onDestroy takes nothing returns nothing
            set .u = null
            set .d = null
            call DestroyGroup(.g)
            set .g = null
            call RemoveLocation(.l)
            call RemoveLocation(.q)
            set .l = null
            set .q = null
        endmethod
        
        method DmgE takes group g, unit u returns nothing
            loop
            exitwhen FirstOfGroup(g) == null
                call UnitDamageTarget(u,FirstOfGroup(g),SPECDMG(GetUnitAbilityLevel(u,ABID)),true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNKNOWN,WEAPON_TYPE_WHOKNOWS)
                call GroupRemoveUnit(g,FirstOfGroup(g))
            endloop
        endmethod
        
        static method Nukes takes nothing returns nothing
            local Nuke this = GetCSData(GetExpiredTimer())
            
            call KillUnit(.d)
            if REALISTIC == true then
                call UnitDamagePoint(.u,0,AOE,GetLocationX(.l),GetLocationY(.l),SPECDMG(.lvl),false,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNKNOWN,WEAPON_TYPE_WHOKNOWS)
            else
                set temp = .u
                call GroupEnumUnitsInRangeOfLoc(.g,.q,AOE,Condition(function IsEnemy))
                call .DmgE(.g,.u)
            endif
            call DestroyEffect(AddSpecialEffectLoc(BOOM,.l))
        endmethod
    endstruct
            
            
    private function NukeAct takes nothing returns nothing
        local Nuke this = Nuke.create()
        local timer t = CreateTimer()
        
        set this.u = GetTriggerUnit()
        set this.g = CreateGroup()
        set this.l = GetSpellTargetLoc()
        set this.q = GetUnitLoc(this.u)
        set this.lvl = GetUnitAbilityLevel(this.u,ABID)
        set this.d = CreateUnitAtLoc(GetOwningPlayer(this.u),DUMID,this.q,0)
        
        call StartSound(SOUND)
        
        call UnitAddAbility(this.d,CROW)
        call UnitRemoveAbility(this.d,CROW)
        
        call SetUnitFlyHeight(this.d,1,GetUnitFlyHeight(this.d)*GetUnitMoveSpeed(this.d)/DistanceBetweenPoints(this.q,this.l))
        call IssuePointOrder(this.d,"move",GetLocationX(this.l),GetLocationY(this.l))
        
        call TimerStart(t,DistanceBetweenPoints(this.q,this.l)/GetUnitMoveSpeed(this.d),false,function Nuke.Nukes)
        
        call SetCSData(t,this)
    endfunction
    
    private function SoundInit takes nothing returns nothing
        set SOUND = gg_snd_nuclear
    endfunction
    
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        
        loop
        exitwhen i > 15
            call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function FailSafe))
            set i = i + 1
        endloop
        
        call TriggerAddAction(t,function NukeAct)
        call TriggerAddCondition(t, Condition(function NukeCond))
        
        set t = CreateTrigger()
        
        call TriggerRegisterTimerEvent(t,1,false)
        call TriggerAddAction(t,function SoundInit)
    endfunction
endscope

Flame Storm


Vid
http://www.xfire.com/video/a715e/

Code
JASS:
scope FlameStorm initializer Init
//Requires TT
    globals
        //[Config Header]
        private constant integer ABID = 'A002'
            //The ability ID of the spell.
        private constant integer DUMID = 'u000'
            //The unit ID of the dummy that is created.
        private constant real TIME = 20
            //The length of time that the spell lasts, in seconds
        private constant real MINLENG = 20
            //The minimum length the flame is from the caster.
        private constant real MAXLENG = 400
            //The maximum length the flame is from the caster.
        private constant real DMG = 50
            //The base damage done.
        private constant string FX = "war3mapImported\\NuclearExplosion.mdx"
            //The ending effect, AKA those big booms.
        private constant boolean REALISTIC = false
            //If set to true, the unit will damage everything around him.
            //If set to false, the unit will only damage enemies.
        //End [Config Header]
        private unit tempUnit
    endglobals
    
    struct flamemove
        unit base
        unit array flames[4]
        group g = CreateGroup()
        real ticker = 0
        real curleng = 20
        real array angles[4]
        location array uni[4]
        boolean uord = true
        
        method onDestroy takes nothing returns nothing
            set .base = null
            set .flames[0] = null
            set .flames[1] = null
            set .flames[2] = null
            set .flames[3] = null
            call DestroyGroup(.g)
            set .g = null
            call RemoveLocation(.uni[0])
            call RemoveLocation(.uni[1])
            call RemoveLocation(.uni[2])
            call RemoveLocation(.uni[3])
            set .uni[0] = null
            set .uni[1] = null
            set .uni[2] = null
            set .uni[3] = null
        endmethod
    endstruct
    
    private constant function SPECDMG takes integer lvl returns real
        return DMG*lvl
        //This function multiplies the base damage (Variable: DMG) by the level of the ability.
    endfunction
    
    private function IsEnemy takes nothing returns boolean
        if IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(tempUnit)) then
            call UnitDamageTarget(tempUnit,GetFilterUnit(),SPECDMG(GetUnitAbilityLevel(tempUnit,ABID)),true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNKNOWN,WEAPON_TYPE_WHOKNOWS)
            return true
        endif
        return false
    endfunction
    
    private function move takes nothing returns boolean
        local flamemove a = TT_GetData()
        local integer i = 0
        local location l = GetUnitLoc(a.base)
        set a.ticker = a.ticker + TT_PERIOD * 100
        if a.ticker == TIME * 100 then
            call DestroyEffect(AddSpecialEffectLoc(FX,l))
            loop
            exitwhen i > 3
                call KillUnit(a.flames<i>)
                call DestroyEffect(AddSpecialEffectLoc(FX,a.uni<i>))
            if REALISTIC == true then
                call UnitDamagePoint(a.base,0,a.curleng,GetLocationX(l),GetLocationY(l),SPECDMG(GetUnitAbilityLevel(GetTriggerUnit(),ABID)),true,true,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNKNOWN,WEAPON_TYPE_WHOKNOWS)
            else
                set tempUnit = a.base
                call GroupEnumUnitsInRangeOfLoc(a.g,l,a.curleng,Condition(function IsEnemy))
            endif
                set i = i + 1
            endloop
            return true
        endif
        loop
        exitwhen i &gt; 3
            set a.angles<i> = a.angles<i>+10
            if a.uord == true then
                set a.curleng = a.curleng + 5
                if a.curleng == MAXLENG then
                    set a.uord = false
                endif
            elseif a.uord == false then
                set a.curleng = a.curleng - 5
                if a.curleng == MINLENG then
                    set a.uord = true
                endif
            endif
            set a.uni<i> = PolarProjectionBJ(l,a.curleng,a.angles<i>)
            call SetUnitPositionLoc(a.flames<i>,a.uni<i>)
            call SetUnitFacing(a.flames<i>,GetUnitFacing(a.flames<i>)+1)
            set i = i + 1
        endloop
        return false
    endfunction
    
   private function FSC takes nothing returns boolean
        return GetSpellAbilityId() == ABID
    endfunction
    
    private function FSA takes nothing returns nothing
        local flamemove a = flamemove.create()
        local integer i = 0
        set a.base = GetTriggerUnit()
        loop
        exitwhen i &gt; 3
            set a.angles<i> = i*90
            set a.uni<i> = PolarProjectionBJ(GetUnitLoc(a.base),a.curleng,a.angles)
            set a.flames<i> = CreateUnitAtLoc(GetOwningPlayer(a.base),DUMID,a.uni<i>,0)
            set i = i + 1
        endloop
        call TT_Start(function move,a)
    endfunction
    
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        loop
        exitwhen i &gt; 15
            call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function FailSafe))
            set i = i + 1
        endloop
        
        call TriggerAddAction(t,function FSA)
        call TriggerAddCondition(t,Condition(function FSC))
    endfunction
endscope</i></i></i></i></i></i></i></i></i></i></i></i></i></i>



Blink Back


Vid
http://www.xfire.com/video/a75ab/

Code
JASS:
scope BlinkBack initializer Init
//Requires PUI

//! runtextmacro PUI_PROPERTY(&quot;private&quot;, &quot;location&quot;, &quot;BKTOLOC&quot;, &quot;null&quot;)
//! runtextmacro PUI_PROPERTY(&quot;private&quot;, &quot;integer&quot;, &quot;NUMTELE&quot;, &quot;0&quot;)

    globals
        private constant integer ABID = &#039;A001&#039;
            //The ID of the main ability.
        private constant integer TELEBK = &#039;A004&#039;
            //The ID of the teleporting back spell.
        private constant integer NUMTELES = 3
            //The maximum number of teleports a player can do, per location.
        private constant real RANGE = 1000
            //The range that the unit can be called back.
        private constant string FX = &quot;Abilities\\Spells\\Demon\\ReviveDemon\\ReviveDemon.mdx&quot;
            //The string path of the effect.
    endglobals
    
    private function BBA takes nothing returns nothing
        local unit u = GetTriggerUnit()
        local location l = GetUnitLoc(u)
        
        if GetSpellAbilityId() == ABID then
            if NUMTELE[GetTriggerUnit()] == 0 then
                set BKTOLOC[GetTriggerUnit()] = GetUnitLoc(u)
                call UnitAddAbility(u,TELEBK)
            else
                call RemoveLocation(BKTOLOC[GetTriggerUnit()])
                set BKTOLOC[GetTriggerUnit()] = GetUnitLoc(u)
                set NUMTELE[GetTriggerUnit()] = 0
            endif
        endif
        if GetSpellAbilityId() == TELEBK and IsUnitInRangeLoc(u,BKTOLOC[GetTriggerUnit()],RANGE) == true then
            call DestroyEffect(AddSpecialEffectLoc(FX,l))
            call DestroyEffect(AddSpecialEffectLoc(FX,BKTOLOC[GetTriggerUnit()]))
            call TriggerSleepAction(1)
            call SetUnitPositionLoc(u,BKTOLOC[GetTriggerUnit()])
            set NUMTELE[GetTriggerUnit()] = NUMTELE[GetTriggerUnit()] + 1
            if NUMTELE[GetTriggerUnit()] &gt;= NUMTELES then
                call UnitRemoveAbility(u,TELEBK)
                set NUMTELE[GetTriggerUnit()] = 0
                call RemoveLocation(BKTOLOC[GetTriggerUnit()])
            endif
        endif
        call RemoveLocation(l)
        set l = null
        set u = null
    endfunction
    
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        
        loop
        exitwhen i &gt; 15
            call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function FailSafe))
            set i = i + 1
        endloop
        
        call TriggerAddAction(t,function BBA)
    endfunction
endscope


Fade Run


Vid
http://www.xfire.com/video/a7170/

Code
JASS:
scope FadeRun initializer Init
//Requires TT
    globals
        private constant integer ABID = &#039;A005&#039;
            //The ID of the ability.
        private constant integer LOKUST = &#039;Aloc&#039;
            //The ID of the ability to make the trail unselectable.
        private constant integer ACTK = &#039;Aatk&#039;
            //ID for removing the attack of the clone.
        private constant integer TRAIL = 5
            //This controls the trail. It&#039;s really damn weird.
            //Use 1 for a really thick trail, I suggest testing different numbers.
            //The TT inteverval affects this.
        private constant real TIME = 20
            //The length it will last in seconds.
    endglobals
    
    private struct Fade
        unit anchor
        real ticks
        
        method onDestroy takes nothing returns nothing
            set .anchor = null
        endmethod
        
        method fade takes unit u returns nothing
            local integer i = 255
            loop
            exitwhen i &lt;= 0
                call SetUnitVertexColor(u,255,255,255,i)
                call TriggerSleepAction(0.01)
                set i = i - 5
            endloop
            call RemoveUnit(u)
        endmethod
        
        static method Do takes nothing returns boolean
            local Fade this = TT_GetData()
            local unit d
            if ModuloReal(.ticks,TRAIL) == 0 then
                set d = CreateUnit(GetOwningPlayer(.anchor),GetUnitTypeId(.anchor),GetUnitX(.anchor),GetUnitY(.anchor),GetUnitFacing(.anchor))
                call UnitAddAbility(d,LOKUST)
                call UnitRemoveAbility(d,ACTK)
                call SetUnitAnimation(d,&quot;stand&quot;)
                call PauseUnit(d,true)
                call SetUnitTimeScale(d,0)
                call SetUnitOwner(d,Player(15),false)
                call .fade.execute(d)
                set d = null
            endif
            debug call BJDebugMsg(R2S(.ticks))
            set .ticks = .ticks + TT_PERIOD * 100
            if .ticks == TIME*100 then
                return true
            endif
            return false
        endmethod
    endstruct
    
    private function FRC takes nothing returns boolean
        return GetSpellAbilityId() == ABID
    endfunction
    
    private function FRA takes nothing returns nothing
        local Fade a = Fade.create()
        set a.anchor = GetTriggerUnit()
        set a.ticks = 0
        call TT_Start(function Fade.Do,a)
    endfunction
    
    private function Init takes nothing returns nothing
        local trigger t = CreateTrigger()
        local integer i = 0
        
        loop
        exitwhen i &gt; 15
            call TriggerRegisterPlayerUnitEvent(t,Player(i),EVENT_PLAYER_UNIT_SPELL_EFFECT,Condition(function FailSafe))
            set i = i + 1
        endloop
        
        call TriggerAddAction(t,function FRA)
        call TriggerAddCondition(t,Condition(function FRC))
    endfunction
endscope




I'm just going to quote this, as it seems to fit my feelings toward flame storm:

Good job making such an uber thing.
Wish it made cookies that come out of my usb ports though, only con with it.
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
589
Thanks to Darthfett, code has been improved and the like.
 

emjlr3

Change can be a good thing
Reaction score
395
that run spell still just creates images that stand there looking silly
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
589
Well, what would you have them do?
Should I add a boolean so they'll attack?
 

emjlr3

Change can be a good thing
Reaction score
395
make it looks as though they are actual images of the running caster, the way you have it makes it look lame
 

Prometheus

Everything is mutable; nothing is sacred
Reaction score
589
I don't get what you mean emjlr. You want them to be frozen in the position the caster was at that exact time?
 

Romek

Super Moderator
Reaction score
963
I don't believe that's possible, emjlr3. :p
 

emjlr3

Change can be a good thing
Reaction score
395
it is very possible, I have done it before
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top