Spell Temporal Fluxuation

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
This is a spell I originally made for emjlr3's 2nd spell contest, in which it won first place. It doesn't actually work the way I would like it to, but I think it functions sufficiently well.

The spell requires Vexorian's CSCache; the version I used was 12.9 because I can't use the newer versions that require vJASS (I'm on OS X). It should be compatable with other versions of CSCache/CasterSystem, but I haven't actually tested it.

Thanks to Vexorian for his spell idea, Darkwulfv for the terrain, and JetFangInferno for his neat models.

The following is a rather long, complicated, and overly-delved-into description/explaination of the spell:

Temporal Fluxuation
Not just your average summon-yourself-from-the-future spell​

  • First, you summon yourself from the future
  • All information about your surroundings when you summoned your future self is stored
  • Your future self fights with/for you; it's not controllable, but its hero icon shows up, and it CAN be target of spells/abilities
  • Anything that happens to you (leveling up, learning spells, etc) happens to your future self the instant you do it
  • Your future self goes back to its respective time, and its current health/mana are stored
  • At some arbitrary point in the future, you (now acting as the future self) have a flashback to the battle in which you originally summoned your future self; your life/mana are set to the values stored earlier
In case it isn't stressed enough, anything that happens to you or your future self will affect the other, and vice versa!

Screenshot:

TemporalFluxuation.jpg

View attachment 8759

Full Temporal Fluxuation Code:
JASS:
constant function TF_Ability_Id takes nothing returns integer
    return 'A000'
endfunction

constant function TF_Chaos_Ability_Id takes nothing returns integer
    return 'S001'
endfunction

constant function TF_Spawn_Offset takes nothing returns real
    return 400.00
endfunction

constant function TF_Other_Player_Effect_Path takes nothing returns string
    return "Timerift Missle.mdx"
endfunction

constant function TF_Other_Player_Effect_Attach takes nothing returns string
    return "origin"
endfunction

constant function TF_Abyss_Dummy_Unit_Id takes nothing returns integer
    return 'h000'
endfunction

constant function TF_Portal_Dummy_Unit_Id takes nothing returns integer
    return 'h001'
endfunction

constant function TF_Auxiliary_Effect_Path takes nothing returns string
    return "Metamorphosis.mdx"
endfunction

constant function TF_Auxiliary_Effect_Attach takes nothing returns string
    return "origin"
endfunction



function TF_Cast_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == TF_Ability_Id()
endfunction

function TF_Group_Filter takes nothing returns boolean
    local unit U = GetFilterUnit()
    local boolean B1 = (U != bj_ghoul[60])
    local boolean B2 = (GetAttachedUnit(U, "TF Past Self") == null)
    local boolean B3 = (B1 and B2)
    set U = null
    return B3
endfunction

function TF_Countdown_Filter takes nothing returns boolean
    return GetAttachedInt(GetFilterUnit(), "TF Flashback Countdown") > 0
endfunction

function TF_Futures_Filter takes nothing returns boolean
    return GetAttachedBoolean(GetFilterUnit(), "Is A Future Self")
endfunction

function TF_Event_Filter takes nothing returns boolean
    local unit U = GetTriggerUnit()
    local unit U2 = GetAttachedUnit(U, "TF Future Self")
    local unit U3 = GetAttachedUnit(U, "TF Past Self")
    local boolean B = ((U2 != null) or (U3 != null))
    set U = null
    set U2 = null
    set U3 = null
    return B
endfunction



function TF_Get_Used_Integer_Indexes takes handle H, string ToCheck returns integer
    local integer I = 0
    local integer I2
    loop
        set I = I+1
        set I2 = GetAttachedInt(H, ToCheck+" "+I2S(I))
        exitwhen I2 == 0
    endloop
    return I-1
endfunction

function TF_Skill_Learn takes nothing returns nothing
    local unit U = GetTriggerUnit()
    local unit U2 = GetAttachedUnit(U, "TF Future Self")
    call SelectHeroSkill(U2, GetLearnedSkill())
    set U = null
    set U2 = null
endfunction

function TF_Hero_Set takes unit U, unit U2 returns nothing
    local integer array Abilities
    local integer I = 0
    local integer Level
    local integer I2 = 0
    local integer ItemId

    set Abilities[1] = 'AUdc'
    set Abilities[2] = 'A000'
    set Abilities[3] = 'AUau'
    set Abilities[4] = 'AUan'
//    set Abilities[5] = ''

    set Level = GetHeroLevel(U)
    call SetHeroLevel(U2, Level, false)

    loop
        set I = I+1
        exitwhen I > 4 //5 if the hero has a total of 5 hero abilities
        set Level = GetUnitAbilityLevel(U, Abilities<i>)
        loop
            set I2 = I2+1
            exitwhen I2 &gt; Level
            call SelectHeroSkill(U2, Abilities<i>)
        endloop
        set I2 = 0
    endloop
    set I = 0
    loop
        set I = I+1
        exitwhen I &gt; 6
        set ItemId = GetItemTypeId(UnitItemInSlot(U, I))
        call UnitAddItemById(U2, ItemId)
    endloop
endfunction

function TF_Death_Future takes nothing returns nothing
    local unit U = GetTriggerUnit()
    local unit U2
    local real X
    local real Y
    local boolean B = GetAttachedBoolean(U, &quot;TF Is A Future Self&quot;)

    if B then
        set U2 = GetAttachedUnit(U, &quot;TF Past Self&quot;)
    else
        set U2 = GetAttachedUnit(U, &quot;TF Future Self&quot;)
    endif
    set X = GetUnitX(U)
    set Y = GetUnitY(U)

    call DestroyEffect(AddSpecialEffect(TF_Auxiliary_Effect_Path(), X, Y))
    set X = GetUnitX(U2)
    set Y = GetUnitY(U2)
    call DestroyEffect(AddSpecialEffect(TF_Auxiliary_Effect_Path(), X, Y))
    if not(B) then
        call KillUnit(U2)
    endif
    call CleanAttachedVars(U)
    call CleanAttachedVars(U2)

    set U = null
    set U2 = null
endfunction

function TF_Level_Up takes nothing returns nothing
    local unit U = GetTriggerUnit()
    local unit U2
    local boolean B = GetAttachedBoolean(U, &quot;TF Is A Future Self&quot;)
    local integer Level

    if B then
        set U2 = GetAttachedUnit(U, &quot;TF Past Self&quot;)
        set Level = GetHeroLevel(U2)
    else
        set U2 = GetAttachedUnit(U, &quot;TF Future Self&quot;)
        set Level = GetHeroLevel(U)
    endif
    call SetHeroLevel(U2, Level, true)

    set U = null
    set U2 = null
endfunction

function TF_Future_Self_Remove takes nothing returns nothing
    local timer T = GetExpiredTimer()
    local unit U = GetAttachedUnit(T, &quot;TF Future Self To Remove&quot;)
    local unit U2 = GetAttachedUnit(U, &quot;TF Past Self&quot;)
    local real Life = GetWidgetLife(U)
    local real Mana = GetUnitState(U, UNIT_STATE_MANA)
    local group G = GetAttachedGroup(bj_crippledTimer[60], &quot;TF Callback Group&quot;)
    local real X = GetUnitX(U)
    local real Y = GetUnitY(U)
    local integer VA = 127
    local integer Level = GetHeroLevel(U)

    call PauseTimer(T)

    call GroupRemoveUnit(G, U)
    call AttachObject(U2, &quot;TF Future Self&quot;, null)
    call AttachReal(U2, &quot;TF Flashback Restore Life&quot;, Life)
    call AttachReal(U2, &quot;TF Flashback Restore Mana&quot;, Mana)
    call AttachInt(U2, &quot;TF Flashback Restore Level&quot;, Level)
    call PauseUnit(U, true)
    call SetUnitTimeScale(U, 0.00)
    call SetUnitInvulnerable(U, true)
    call UnitAddAbility(U, &#039;Aloc&#039;)
    call DestroyEffect(AddSpecialEffect(TF_Auxiliary_Effect_Path(), X, Y))
    call RemoveUnit(U)
    call CleanAttachedVars(U)

    call DestroyTimer(T)
    set T = null
    set U = null
    set U2 = null
    set G = null
endfunction

function TF_Flashback_Cleanup takes nothing returns nothing
    local timer T = GetExpiredTimer()
    local group G = CreateGroup()
    local unit U
    local integer CountdownMS = GetAttachedInt(T, &quot;TF Flashback Countdown MS&quot;)
    local group G2 = GetAttachedGroup(T, &quot;TF Flashback Cleanup Group&quot;)
    local integer VA
    local real X
    local real Y
    local real F
    local unit U2 = GetAttachedUnit(T, &quot;TF Flashback Previous Unit&quot;)
    local real Life
    local real Mana
    local real MaxLife
    local real MaxMana
    local unit U3
    local integer Level

    call GroupAddGroup(G2, G)
    set CountdownMS = CountdownMS-10
    call AttachInt(T, &quot;TF Flashback Countdown MS&quot;, CountdownMS)
    if CountdownMS == 0 then
        set X = GetAttachedReal(T, &quot;TF Flashback Previous X&quot;)
        set Y = GetAttachedReal(T, &quot;TF Flashback Previous Y&quot;)
        set F = GetAttachedReal(T, &quot;TF Flashback Previous Facing&quot;)
        set Life = GetAttachedReal(U2, &quot;TF Flashback Restore Life&quot;)
        set Mana = GetAttachedReal(U2, &quot;TF Flashback Restore Mana&quot;)
        set Level = GetAttachedInt(U2, &quot;TF Flashback Restore Level&quot;)
        call SetUnitX(U2, X)
        call SetUnitY(U2, Y)
        call DestroyEffect(AddSpecialEffect(&quot;Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl&quot;, X, Y))
        call SetUnitFacing(U2, F)
        call SetWidgetLife(U2, Life)
        call SetUnitState(U2, UNIT_STATE_MANA, Mana)
        call SetHeroLevel(U2, Level, true)
        call AttachReal(U2, &quot;TF Flashback Restore Life&quot;, 0.00)
        call AttachReal(U2, &quot;TF Flashback Restore Mana&quot;, 0.00)
        call AttachInt(U2, &quot;TF Flashback Restore Level&quot;, 0)
        call PauseUnit(U2, false)
        call SetUnitInvulnerable(U2, false)
        call SetUnitTimeScale(U2, 1.00)
        loop
            set U = FirstOfGroup(G)
            exitwhen U == null
            call RemoveUnit(U)
            call DestroyEffect(GetAttachedEffect(U, &quot;TF Other Player SFX&quot;))
            call CleanAttachedVars(U)
            call GroupRemoveUnit(G, U)
        endloop
        call PauseTimer(T)
        call DestroyTimer(T)
        call CleanAttachedVars(T)
    else
        set Life = GetWidgetLife(U2)
        set MaxLife = GetUnitState(U2, UNIT_STATE_MAX_LIFE)
        set Life = Life-((MaxLife-GetAttachedReal(U2, &quot;TF Flashback Restore Life&quot;))/40)
        call SetWidgetLife(U2, Life)
        set Mana = GetUnitState(U2, UNIT_STATE_MANA)
        set MaxMana = GetUnitState(U2, UNIT_STATE_MAX_MANA)
        set Mana = Mana-((MaxMana-GetAttachedReal(U2, &quot;TF Flashback Restore Mana&quot;))/40)
        call SetUnitState(U2, UNIT_STATE_MANA, Mana)
        if CountdownMS == 30 then
            call DestroyEffect(AddSpecialEffectTarget(TF_Auxiliary_Effect_Path(), U2, TF_Auxiliary_Effect_Attach()))
        endif


        loop
            set U = FirstOfGroup(G)
            exitwhen U == null
            set VA = GetAttachedInt(U, &quot;TF Vertex Alpha&quot;)
            set VA = VA-4
            if GetLocalPlayer() == GetOwningPlayer(U2) then
                call SetUnitVertexColor(U, 255, 255, 255, VA)
            else
                call SetUnitVertexColor(U, 255, 255, 255, 0)
            endif
            call AttachInt(U, &quot;TF Vertex Alpha&quot;, VA)
            if VA == 0 then
                set X = GetUnitX(U)
                set Y = GetUnitY(U)
                set U3 = CreateUnit(GetOwningPlayer(U), TF_Abyss_Dummy_Unit_Id(), X, Y, 0)
                call UnitApplyTimedLife(U3, &#039;BTLF&#039;, 2.00)
                call DestroyEffect(AddSpecialEffectTarget(TF_Auxiliary_Effect_Path(), U, TF_Auxiliary_Effect_Attach()))
            endif
            if CountdownMS == 300 then
                call SetUnitTimeScale(U, 0.00)
            endif
            call GroupRemoveUnit(G, U)
        endloop
    endif

    call DestroyGroup(G)
    set G = null
    set G2 = null
    set U = null
    set U2 = null
    set U3 = null
    set T = null
endfunction

function TF_Flashback takes timer T, unit U returns nothing
    local real X = GetAttachedReal(T, &quot;TF Flashback Origin X&quot;)
    local real Y = GetAttachedReal(T, &quot;TF Flashback Origin Y&quot;)
    local real F = GetAttachedReal(T, &quot;TF Flashback Origin Facing&quot;)
    local real OX = GetUnitX(U)
    local real OY = GetUnitY(U)
    local real OF = GetUnitFacing(U)
    local unit U2
    local integer I = 0
    local integer TotalIndex = TF_Get_Used_Integer_Indexes(T, &quot;TF Flashback Unit Id&quot;)
    local integer UId
    local integer I2 = 0
    local real Mana = GetUnitState(U, UNIT_STATE_MAX_MANA)*(GetRandomReal(0.15, 0.45))
    local real R
    local integer P
    local group G = CreateGroup()
    local timer T2 = CreateTimer()
    local string EffectPath = &quot;&quot;
    local player OP = GetOwningPlayer(U)
    local effect SFX
    local real TX = GetAttachedReal(T, &quot;TF Flashback Origin X Move To&quot;)
    local real TY = GetAttachedReal(T, &quot;TF Flashback Origin Y Move To&quot;)
    local real D

    call DestroyEffect(AddSpecialEffectTarget(TF_Auxiliary_Effect_Path(), U, TF_Auxiliary_Effect_Attach()))
    call SetUnitX(U, TX)
    call SetUnitY(U, TY)
    call DestroyEffect(AddSpecialEffect(&quot;Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl&quot;, TX, TY))
    call SetUnitFacing(U, F)
    call SetWidgetLife(U, GetUnitState(U, UNIT_STATE_MAX_LIFE))
    if (GetUnitState(U, UNIT_STATE_MANA) &gt; Mana) then
        call SetUnitState(U, UNIT_STATE_MANA, Mana)
    endif
    call PauseUnit(U, true)
    call SetUnitTimeScale(U, 0.00)
    call SetUnitFacing(U, F)
    call SetUnitInvulnerable(U, true)

    loop
        set I = I+1
        exitwhen I &gt; TotalIndex
        set UId = GetAttachedInt(T, &quot;TF Flashback Unit Id &quot;+I2S(I))
        set X = GetAttachedReal(T, &quot;TF Flashback Unit X &quot;+I2S(I))
        set Y = GetAttachedReal(T, &quot;TF Flashback Unit Y &quot;+I2S(I))
        set F = GetAttachedReal(T, &quot;TF Flashback Unit Facing &quot;+I2S(I))
        set P = GetAttachedInt(T, &quot;TF Flashback Unit Owner &quot;+I2S(I))
        set U2 = CreateUnit(Player(P), UId, X, Y, F)
        if GetLocalPlayer() == OP then
            call SetUnitVertexColor(U2, 255, 255, 255, 152)
        else
            call SetUnitVertexColor(U2, 255, 255, 255, 0)
        endif
        call SetUnitAnimationByIndex(U2, GetRandomInt(1, 6))
        call AttachInt(U2, &quot;TF Vertex Alpha&quot;, 152)
        if GetLocalPlayer() != OP then
            set EffectPath = TF_Other_Player_Effect_Path()
        endif
        set SFX = AddSpecialEffectTarget(EffectPath, U2, TF_Other_Player_Effect_Attach())
        call AttachObject(U2, &quot;TF Other Player SFX&quot;, SFX)
        call UnitAddAbility(U2, &#039;Aloc&#039;)
        call SetUnitX(U2, X)
        call SetUnitY(U2, Y)
        call PauseUnit(U2, true)
        call GroupAddUnit(G, U2)
    endloop

    call AttachObject(T2, &quot;TF Flashback Cleanup Group&quot;, G)
    call AttachInt(T2, &quot;TF Flashback Countdown MS&quot;, 400)
    call AttachObject(T2, &quot;TF Flashback Previous Unit&quot;, U)
    call AttachReal(T2, &quot;TF Flashback Previous X&quot;, OX)
    call AttachReal(T2, &quot;TF Flashback Previous Y&quot;, OY)
    call AttachReal(T2, &quot;TF Flashback Previous Facing&quot;, OF)
    call TimerStart(T2, 0.10, true, function TF_Flashback_Cleanup)

    set U2 = null
    set SFX = null
    set T2 = null
endfunction

function TF_Flashback_Callback takes nothing returns nothing
    local timer T = GetExpiredTimer()
    local integer Countdown = GetAttachedInt(T, &quot;TF Flashback Countdown&quot;)
    local unit U = GetAttachedUnit(T, &quot;TF Flashback Origin Unit&quot;)

    if (GetWidgetLife(U) &lt; 0.406 or U == null) then
        call PauseTimer(T)
        call DestroyTimer(T)
        call CleanAttachedVars(T)
    else
        set Countdown = Countdown-1
        call AttachInt(T, &quot;TF Flashback Countdown&quot;, Countdown)
        if Countdown == 0 then
            call PauseTimer(T)
            call TF_Flashback(T, U)
            call DestroyTimer(T)
            call CleanAttachedVars(T)
        endif
    endif

    set T = null
    set U = null
endfunction

function TF_Move_Callback takes nothing returns nothing
    local timer T = GetExpiredTimer()
    local group G = CreateGroup()
    local unit FutureSelf
    local unit PastSelf
    local real X
    local real Y
    local real X2
    local real Y2
    local real D
    local real A
    local integer Countdown

    call GroupAddGroup(GetAttachedGroup(T, &quot;TF Callback Group&quot;), G)
    loop
        set FutureSelf = FirstOfGroup(G)
        exitwhen FutureSelf == null
        set PastSelf = GetAttachedUnit(FutureSelf, &quot;TF Past Self&quot;)
        if GetUnitCurrentOrder(FutureSelf) != 851983 then
            set X = GetUnitX(PastSelf)
            set Y = GetUnitY(PastSelf)
            set D = GetRandomReal(25.00, 300.00)
            set A = GetRandomReal(0.00, 360.00)
            set X2 = X + (D*Cos(A*bj_DEGTORAD))
            set Y2 = Y + (D*Sin(A*bj_DEGTORAD))
            call IssuePointOrder(FutureSelf, &quot;attack&quot;, X2, Y2)
        endif
        call GroupRemoveUnit(G, FutureSelf)
    endloop
    call DestroyGroup(G)

    set FutureSelf = null
    set PastSelf = null
    set G = null
    set T = null
endfunction

function TF_Vertex_Callback takes nothing returns nothing
    local timer T = GetExpiredTimer()
    local unit U = GetAttachedUnit(T, &quot;TF Vertex Unit&quot;)
    call SetUnitVertexColor(U, 255, 255, 255, 127)
    call PauseTimer(T)
    call DestroyTimer(T)
    call CleanAttachedVars(T)
    set T = null
    set U = null
endfunction

function TF_Cast_Portal takes nothing returns nothing
    local unit U = bj_ghoul[60]
    local unit U2
    local real X = GetAttachedReal(U, &quot;TF Portal X&quot;)
    local real Y = GetAttachedReal(U, &quot;TF Portal Y&quot;)
    local real X2 = GetAttachedReal(U, &quot;TF Portal X2&quot;)
    local real Y2 = GetAttachedReal(U, &quot;TF Portal Y2&quot;)
    local real F = GetAttachedReal(U, &quot;TF Portal Facing&quot;)
    local integer UId = GetAttachedInt(U, &quot;TF Portal Id&quot;)
    local unit Portal = CreateUnit(GetOwningPlayer(U), TF_Portal_Dummy_Unit_Id(), X2, Y2, (F+180.00))
    local group G = GetAttachedGroup(bj_crippledTimer[60], &quot;TF Callback Group&quot;)
    local timer T = CreateTimer()
    local integer Level = GetUnitAbilityLevel(U, TF_Ability_Id())

    call SetUnitTimeScale(Portal, 2.25)
    call SetUnitAnimation(Portal, &quot;birth&quot;)

    call PolledWait(3.00)

    set X2 = X + ((TF_Spawn_Offset()-20.00)*Cos(F*bj_DEGTORAD))
    set Y2 = Y + ((TF_Spawn_Offset()-20.00)*Sin(F*bj_DEGTORAD))
    set U2 = CreateUnit(GetOwningPlayer(U), UId, X2, Y2, (F+180.00))
    call DestroyEffect(AddSpecialEffect(&quot;Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl&quot;, X, Y))
    call DestroyEffect(AddSpecialEffectTarget(TF_Auxiliary_Effect_Path(), U2, TF_Auxiliary_Effect_Attach()))
    call IssuePointOrder(U2, &quot;attack&quot;, X, Y)
    call SetUnitAnimation(Portal, &quot;stand&quot;)
    call SetUnitAnimation(Portal, &quot;death&quot;)

    call UnitAddAbility(U2, &#039;Aloc&#039;)
    call UnitAddAbility(U2, TF_Chaos_Ability_Id())
    call AttachObject(U2, &quot;TF Past Self&quot;, U)
    call TF_Hero_Set(U, U2)
    call GroupAddUnit(G, U2)
    call AttachObject(U, &quot;TF Future Self&quot;, U2)

    //Setting Vertex Color Timer
    call AttachObject(T, &quot;TF Vertex Unit&quot;, U2)
    call TimerStart(T, 0.025, false, function TF_Vertex_Callback)
    set T = null

    //Removing the Future Self Timer
    set T = CreateTimer()
    call AttachObject(T, &quot;TF Future Self To Remove&quot;, U2)
    call TimerStart(T, (20.00+(5.00*Level)), false, function TF_Future_Self_Remove)

    call PolledWait(4.00)
    call RemoveUnit(Portal)

    set U = null
    set U2 = null
    set Portal = null
    set G = null
    set T = null
endfunction

function TF_Cast takes nothing returns nothing
    local unit U = GetTriggerUnit()
    local integer Id = GetUnitTypeId(U)
    local real X = GetUnitX(U)
    local real Y = GetUnitY(U)
    local real F = GetUnitFacing(U)
    local real X2 = X + (TF_Spawn_Offset()*Cos(F*bj_DEGTORAD))
    local real Y2 = Y + (TF_Spawn_Offset()*Sin(F*bj_DEGTORAD))
    local timer T = CreateTimer()
    local group G = GetAttachedGroup(bj_crippledTimer[60], &quot;TF Callback Group&quot;)
    local unit U3
    local integer I = 0
    local integer P
    local integer Level = GetUnitAbilityLevel(U, TF_Ability_Id())

    call AttachReal(U, &quot;TF Portal X&quot;, X)
    call AttachReal(U, &quot;TF Portal Y&quot;, Y)
    call AttachReal(U, &quot;TF Portal X2&quot;, X2)
    call AttachReal(U, &quot;TF Portal Y2&quot;, Y2)
    call AttachReal(U, &quot;TF Portal Facing&quot;, F)
    call AttachInt(U, &quot;TF Portal Id&quot;, Id)
    set bj_ghoul[60] = U
    call ExecuteFunc(&quot;TF_Cast_Portal&quot;)

    //Flashback Timer
    set T = CreateTimer()
    call AttachObject(T, &quot;TF Flashback Origin Unit&quot;, U)
    call AttachInt(T, &quot;TF Flashback Countdown&quot;, (23+(5*Level)))
    call AttachReal(T, &quot;TF Flashback Origin X&quot;, X2)
    call AttachReal(T, &quot;TF Flashback Origin Y&quot;, Y2)
    call AttachReal(T, &quot;TF Flashback Origin X Move To&quot;, X)
    call AttachReal(T, &quot;TF Flashback Origin Y Move To&quot;, Y)
    call AttachReal(T, &quot;TF Flashback Origin Facing&quot;, F)
    set G = CreateGroup()
    call GroupEnumUnitsInRange(G, X, Y, 375.00, Condition(function TF_Group_Filter))
    loop
        set U3 = FirstOfGroup(G)
        set I = I+1
        exitwhen U3 == null

        set Id = GetUnitTypeId(U3)
        set P = GetPlayerId(GetOwningPlayer(U3))
        set X2 = GetUnitX(U3)
        set Y2 = GetUnitY(U3)
        set F = GetUnitFacing(U3)
        call AttachInt(T, &quot;TF Flashback Unit Id &quot;+I2S(I), Id)
        call AttachInt(T, &quot;TF Flashback Unit Owner &quot;+I2S(I), P)
        call AttachReal(T, &quot;TF Flashback Unit X &quot;+I2S(I), X2)
        call AttachReal(T, &quot;TF Flashback Unit Y &quot;+I2S(I), Y2)
        call AttachReal(T, &quot;TF Flashback Unit Facing &quot;+I2S(I), F)

        call GroupRemoveUnit(G, U3)
    endloop
    call TimerStart(T, 1.00, true, function TF_Flashback_Callback)

    set U = null
    set U3 = null
    set T = null
    set G = null
endfunction

//===========================================================================
function InitTrig_Temporal_Fluxation takes nothing returns nothing
    local trigger T = CreateTrigger(  )
    local group G = CreateGroup()
    set bj_crippledTimer[60] = CreateTimer()
    set gg_trg_Temporal_Fluxation = CreateTrigger(  )

    call TriggerRegisterAnyUnitEventBJ(gg_trg_Temporal_Fluxation, EVENT_PLAYER_UNIT_SPELL_EFFECT)
    call TriggerAddCondition(gg_trg_Temporal_Fluxation, Condition(function TF_Cast_Conditions))
    call TriggerAddAction(gg_trg_Temporal_Fluxation, function TF_Cast)

    call TimerStart(bj_crippledTimer[60], 1.00, true, function TF_Move_Callback)
    call AttachObject(bj_crippledTimer[60], &quot;TF Callback Group&quot;, G)

    call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_UNIT_DEATH)
    call TriggerAddCondition(T, Condition(function TF_Event_Filter))
    call TriggerAddAction(T, function TF_Death_Future)

    set T = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_HERO_LEVEL)
    call TriggerAddCondition(T, Condition(function TF_Event_Filter))
    call TriggerAddAction(T, function TF_Level_Up)

    set T = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ(T, EVENT_PLAYER_HERO_SKILL)
    call TriggerAddCondition(T, Condition(function TF_Event_Filter))
    call TriggerAddAction(T, function TF_Skill_Learn)

    set G = null
    set T = null
endfunction

</i></i>



And the thing is, you can STILL cause a temporal paradox. If you (the caster, as the past self) die after you summon your future self, but before you flashback in time, something BAD should happen.

But, I'll just stick to string theory and say that your future self was actually from an alternate dimension and that his coming to this dimension caused a planar shift in which you (the past self) died.

Just in case nobody understands what the heck I'm talking about, here's the lowdown on the string-theory part of the spell:

Note: the caster will always be referred to as the "past self", and the summoned unit will always be referred to as the "future self".

The past self summons the future self to aid him in his plight; the future self is an exact copy of the current past self (excluding health/mana; including spells and items). While both are present, anything that happens to the past self (as this is WC3, this is limited to specific things not including changes in life/mana) will happen instantly to the future self, since it has then happened in the future self's past.

Eventually, the future self goes back to its respective time, and the past self prepares to return to the past in which he summoned his future self. While in the past, anything that happened to the future self when it was in the past, is now applied to the past self (barring WC3 limitiations, this time it affects life and mana). The journey to the past drained the future self of much of its magical essence (mana), and thus the past self loses some of its also.

If at any point the past self gains a level, learns a skill, or (in next version of spell) gains/loses an item, the same will (according to string theory) happen to the future self, since it has now happened in the future self's past.

Oh, and to anyone who attempts to open the map up and look at the spell that way, the formatting is going to be all fucked up because I wrote it on a Mac. Just refer to the attached text file as the actual code (which it is), or replace the existing code with the code in either the text file or in the above code box.

To fix the .txt file formatting, just c 'n p it all into another program that self-formats (AIM, etc.) and then paste that into another document and the formatting should be fixed.

Spell Download
The Code in a Text File
 

waaaks!

Zinctified
Reaction score
255
wow nice spell, very original idea, ill DL it now, and learn some stuff
+rep
 

Estel3

New Member
Reaction score
6
Oh man this confuses the hell out of me, and I usually understand things...

So the moment the future self leaves, I was teleported somewhere and frozen, and I was constantly losing health. What part of the explanation is this?

And after that happened I was cast straight back into the battle. What happened during these two parts?
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
That was the part that doesn't work the way I'd envisioned it. Essentially, that was you becoming the future self that you summoned from the future when you cast the spell.

The funky movement stuff was supposed to be a flashback to the battle/place in time you summoned yourself, and the reason you were loosing health was because the future self that you summoned took damage. It wouldn't make sense for your future self to take damage but not have it applied to the past self when the past self becomes the future self... would it?

The way it should've worked is that you're taken back along the path your future self took, having periodic flashbacks... but that was way too much work, and I'm a lazy man.
 

mr-death

Acolyte
Reaction score
51
Careful

Be careful with the title of Thread.

"OMG!" < this is breaking the rules of thread posting,

Just remember not to create a thread with that kinda thing.

-------------------------------------------------------------------------

Anyway, this ability is great.

But I don't know the deep JASS things. :p

Good Luck :cool:
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
I just thought "[Spell]" was rather generic. So I made it a bit more lively. And it's not really the title of the thread...


I'm glad you like it :p
 

Sim

Forum Administrator
Staff member
Reaction score
534
I didn't acknowledge anything bad happening when I died during the future self was there.

Except that I didn't revive :p

You should add that feature. I hate restarting games >_<

--------------------

Wow, have a forth approval. Really :p

--------------------

Please rate this thread guys, and from now on spells should be rated. The thread rating system is not there for nothing :p
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Wow... This is a huge code... I looked at this at the spell contest and I was amazed... Good job!

Though this isn't JESP is it? Well, it doesn't have that specific variables, that is all I've got.... Lol, I don't feel like reading the whole damn code! :D
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
It's about 80% JESP; I forgot to add constants for some things. Actually, now that I think about it, I should really fix this bugger up and get everything working.

Expect some bigger, more confusing, less-restarting-required, revised code from me in a few days.

Daxtreme said:
Wow, have a forth approval. Really :p
And that means what?

Daxtreme said:
I didn't acknowledge anything bad happening when I died during the future self was there.
That's part of the whole 'cause-a-temporal-paradox' thing. I needs a-fixin'.
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
You can't.

The cooldown is longer than the duration of the spell. I suppose it would would work just fine if you cast it before the duration was up.

I've never tested it.
 

Sim

Forum Administrator
Staff member
Reaction score
534
> And that means what?

Please elaborate. You aren't happy with the approval?
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Oh; I didn't realize that you'd moved the thread and 'approved' the spell.

I was confused because I thought you meant "fourth" instead of "forth".


Thanks!
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
TextEdit?

I just use a regular text program to write my code and then check it in a demo JASS syntax checker.
 

Cohadar

master of fugue
Reaction score
209
TextEdit?

I just use a regular text program to write my code and then check it in a demo JASS syntax checker.

You are a dirty stinking alien hiding in a human body.
Don't think for a second that I don't know you have a vJass co-processor inserted in your neural cortex.
And the fact you know just a little too much about quantum physics is not helping your cover either.
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Bwahahahah!
JASS:
struct TestStruct
    integer X = 0
    integer Y = 0

    method Display takes nothing returns nothing
        call BJDebugMsg(&quot;X+Y = &quot;+I2S(this.X+this.Y))
    endmethod
endstruct

function Blah takes nothing returns nothing
    local TestStruct TS = TestStruct.create()
    set TS.X = GetRandomInt(1, 7)
    set TS.Y = GetRandomInt(15, 90)
    call TS.Display()
    call TS.destroy
endfunction

//Becomes...

globals
    integer array _ss__TestStruct_X
    integer array _ss__TestStruct_Y
    integer _ss__TestStruct_Count = 0
endglobals

function _ss__TestStruct_allocate takes nothing returns integer
    set _ss__TestStruct_Count = _ss__TestStruct_Count+1
    set _ss__TestStruct_X[_ss__TestStruct_Count] = 0
    set _ss__TestStruct_Y[_ss__TestStruct_Count] = 0
    return _ss__TestStruct_Count
endfunction

function _ss__TestStruct_destroy takes integer i returns nothing
    set _ss__TestStruct_Count = _ss__TestStruct_Count-1
endfunction

function _ss__TestStruct_Display takes integer i returns nothing
    call BJDebugMsg(&quot;X+Y = &quot;+I2S(_ss__TestStruct_X<i>+ _ss__TestStruct_Y<i>))
endfunction

function Blah takes nothing returns nothing
    local integer TS = _ss_TestStruct_allocate()
    set _ss__TestStruct_X[TS] = GetRandomInt(1, 7)
    set _ss__TestStruct_X[TS] = GetRandomInt(15, 90)
    call _ss__TestStruct_Display(TS)
    call _ss__TestStruct_destroy(TS)
endfunction</i></i>

That's the best I can do using my brain... and there was a lot of guessing involved in that. Anything more intense would give me a bit of a headache.


Why I'll be damned, Fegga5, the download was broken. Now it's fixed.
 
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