Spell Ice Pillar

BlackRose

Forum User
Reaction score
239
Ice Pillar v1.02 by BlackRose

What?
Creates a pillar of ice that spirals upwards, after reaching a height, the pillar explodes and pushes all nearby units outwards, and freezes them.

Requirements:
  • NewGen
  • KeyTimers2 by Jesus4Lyf
  • KBS by Kenny!
  • xefx by Vexorian

Document
JASS:
Ice Pillar by BlackRose
---------------------------

Version: 1.02
Date released: 4th September 2009
Date updated: 6th September 2009

Creates a pillar of ice that spirals upwards, after reaching a height, the pillar explodes 
and pushes all nearby units outwards, and freezes them.

This ability IS MUI.
This ability may lower FPS depending on Duration, TIMER_INTERVAL, and how many instances are summoned.

How to import:
--------------

 - Make sure you have JassNewGenPack.

1. Copy the Systems folder and Ice Pillar trigger into your map.
2. Copy all objects needed. Copy "Ice Pillar - SFX" and "xe unit (Caster System?", and the abilities and buff.
3. Make sure to update rawcode (of Ice Pillar trigger and xebasic)
4. Make sure to import the imported files, FrostWyrmMissile(New) and Dummy.
5. Done!

Version history:
----------------
v1.00: 4th September 2009 Friday
 - Initial release.
 
v1.01: 5th September 2009 Saturday
 - Code update.
 
v1.02: 6th September 2009 Sunday
 - SFX UPDATE!
 - MYFLASH is configurable now!

Credits:
--------

- Jesus4Lyf for KeyTimers2.
- Vexorian for xe.

- JassNewGenPack team.

- Made for TheHelper.net AND hiveworkshop.com Resources forum, DO NOT REDISTRUBUTE at all. 
  Contact can be made by PMing me at TheHelper forums, Username: BlackRose


Coding:
(We all know no one checks the actual spell, only the coding)
JASS:
// Version 1.02.
scope IcePillar initializer Init //requires KT, KBS, xefx
globals
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //   OBJECT RAWCODE
    //   UPDATE HERE! CTRL + D
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    private constant integer SPELL_ID = 'A000'
    private constant integer DUMMY_ID = 'e000'
    
    private constant integer BUFF_ID = 'B000'
    
    private constant integer LICH_SFX_ID = 'A001'
    private constant integer WYRM_SFX_ID = 'A002'
    
    private constant integer STUN_ID = 'A003'
    private constant string STUN_STRING = "thunderbolt"
        
    private constant boolean IS_ULTIMATE = false    // - Is this ability ultimate? Target immune.

    
    private constant real TIMER_INTERVAL = 0.03125
    private constant real ROTATE_SPEED = 10.

    private constant attacktype ATK_TYPE = ATTACK_TYPE_NORMAL
    private constant damagetype DMG_TYPE = DAMAGE_TYPE_MAGIC
    private constant weapontype WPN_TYPE = null

    private constant real MAX_HEIGHT = 1000// - Height the pillar will reach.

    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    //  COSMETICS
    //  If you want to edit the model of the pillar, go to Object Editor Abilities and modify the SFX.
    //  To disable FLASH_SFX or TRIAL_SFX just put " ".
    //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    private constant real PILLAR_SCALE = 1.00   // SCALE of the parts of the pillar
    private constant real TRAIL_SCALE = 1.00    // Scale of the trail.
    private constant string FLASH_SFX = " "//"Abilities\\Weapons\\FrostWyrmMissile\\FrostWyrmMissile.mdx"
    private constant string TRAIL_SFX = "Abilities\\Spells\\NightElf\\SpiritOfVengeance\\SpiritOfVengeanceBirthMissile.mdx"
    private constant boolean FREEZE_ANIMATION = true// Enemy units freeze animation when frozen?
    private constant real HEIGHT_VISIBILITY = 1100  // Cannot see usually above here.
                                                    // Units won't be created if height > this.
endglobals

private function SPELL_AOE takes integer level returns real
    return 350. + ( level * 0. )
endfunction

private function SPELL_DURATION takes integer level returns real
    return 2. + ( level * 0. )
endfunction

// Distance of the knockback? Add levels as necessary, level being in [x]
private function SPELL_KB_DISTANCE takes integer level returns real
    return 150. * level
endfunction

private function SPELL_DAMAGE takes integer level returns real
    return 50. * level
endfunction

/*------------------------------------------------------------
    !!! <>< FISHY TRIAL ><> !!! Fish Pillar begins here.
-------------------------------------------------------------*/
globals
    private constant group Group = CreateGroup() // For instant enum. NO DYNAMIC-STABILITY! ??? lolwut.

    private unit DUMMY_CASTER   // Have 1 dummy unit cast all Storm Bolts.
    
    // Unit Filtering.
    private boolexpr G_UFilter = null   // Save 1 call.
    private unit TempUnit     = null    // Save a fe calls.
    private player TempPlayer = null    // Passing.
    private integer TempInt = 0

    private unit TempCaster = null
    private real KBDist
    private real Damage
    private real TempX
    private real TempY
endglobals

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//                          ANIMATION FREEZING
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
private struct BFData
    unit Target

    static method create takes unit u returns BFData
        local BFData d = BFData.allocate()
        
        set d.Target = u
        
        return d
    endmethod
    
    method onDestroy takes nothing returns nothing
        call SetUnitTimeScale( .Target, 1.00 )
    endmethod
    
    static method Update takes nothing returns boolean
        local BFData d  = KT_GetData()
        
        call SetUnitTimeScale( d.Target, 0 )
        // If they somehow lose the bugg, or they become magic immune and the spell is not an ultimate, or they die.
        if (GetUnitAbilityLevel( d.Target, BUFF_ID ) == 0) or (IsUnitType( d.Target, UNIT_TYPE_MAGIC_IMMUNE ) and not IS_ULTIMATE ) /*
        */ or ( IsUnitType( d.Target, UNIT_TYPE_DEAD )) then
            call d.destroy()
            return true
        endif
    
        return false
    endmethod
endstruct

// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//                          I C E  P I L L A R
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
private struct IPData
    unit Caster

    
    player Owner
    real TX
    real TY
    
    real Height = 0.00
    integer Counter = 0

    integer LevelX
    
    real AoE
    real angle = 0
    real SECONDS = 0.00
    real Damage
    real HeightModifier
    real Duration
    
    real a2n = 0
    
    group IcePillar = CreateGroup()
    
    xefx fx

    static method UFilter takes nothing returns boolean
        local real angle = 0.00
        local boolean b
        set TempUnit = GetFilterUnit()

        if IsUnitEnemy( TempUnit, TempPlayer ) and not IsUnitType( TempUnit, UNIT_TYPE_DEAD ) then
            call SetUnitAbilityLevel( DUMMY_CASTER, STUN_ID, TempInt )
            call SetUnitPosition( DUMMY_CASTER, TempX , TempX )
            call SetUnitOwner( DUMMY_CASTER, TempPlayer, false )
            
            // If this spell is not an ultimate, and the target is a magic immune, yes, let them be hurt.
            if IsUnitType( TempUnit, UNIT_TYPE_MAGIC_IMMUNE ) and not IS_ULTIMATE then
                debug call BJDebugMsg ("THIS SPELL IS NOT AN ULTIMATE, DOES NOT HURT " + GetUnitName( TempUnit ) )
                return false
            endif
            
                set angle = Atan2( GetUnitY( TempUnit ) - TempY, GetUnitX( TempUnit ) - TempX  ) * bj_RADTODEG

                call UnitDamageTarget( TempCaster, TempUnit, Damage, true, false, ATK_TYPE, DMG_TYPE, WPN_TYPE )
                set b = IssueTargetOrder( DUMMY_CASTER, STUN_STRING, TempUnit )

                call KBS_BeginCommon( TempUnit, KBDist,.8,angle) 
                if FREEZE_ANIMATION then
                    call KT_Add( function BFData.Update, BFData.create( TempUnit ), TIMER_INTERVAL )
                endif
                if not b then
                    debug call BJDebugMsg( &quot;Target cannot be stunned <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown    :(" loading="lazy" data-shortname=":(" />&quot;)
                endif
        endif

        return false
    endmethod

     method onDestroy takes nothing returns nothing
        local unit u
        local real angle
        local BFData d

        // Initial dummy death.
        loop
            set u = FirstOfGroup( .IcePillar )
            exitwhen u == null
            call GroupRemoveUnit( .IcePillar, u )
            call UnitRemoveAbility( u, LICH_SFX_ID )
            call UnitAddAbility( u, WYRM_SFX_ID )
            call UnitRemoveAbility( u, WYRM_SFX_ID )
            call KillUnit( u )
            set u = null
        endloop
        
        set TempX = .TX
        set TempY = .TY
        set TempPlayer = .Owner
        set TempInt = .LevelX
        set TempCaster = .Caster
        set Damage = SPELL_DAMAGE( .LevelX )
        debug call BJDebugMsg( &quot;Damage: &quot; + R2S( Damage ) )
        set KBDist = SPELL_KB_DISTANCE( .LevelX )
        call GroupEnumUnitsInRange( Group, .TX, .TY, .AoE, G_UFilter )        
        call GroupClear( .IcePillar )
        call .fx.destroy()
    endmethod
    
    static method create takes nothing returns IPData
        local IPData d = IPData.allocate()
                
        set d.Caster = GetTriggerUnit()
        set d.Owner = GetOwningPlayer( d.Caster )
        set d.TX = GetSpellTargetX()
        set d.TY = GetSpellTargetY()
        
        set d.LevelX = GetUnitAbilityLevel( d.Caster, SPELL_ID )
        set d.AoE = SPELL_AOE( d.LevelX )
        set d.Duration = SPELL_DURATION( d.LevelX )
        set d.HeightModifier = MAX_HEIGHT / ( d.Duration / TIMER_INTERVAL )
        set d.a2n = 90
        debug call BJDebugMsg( &quot;LevelX: &quot; + R2S( d.LevelX ) )
        debug call BJDebugMsg( &quot;AoE: &quot; + R2S( d.AoE ) )
        debug call BJDebugMsg( &quot;Duration: &quot; + R2S( d.Duration ) )

        set d.fx = xefx.create( d.TX, d.TY, bj_UNIT_FACING )
        set d.fx.fxpath = TRAIL_SFX
        set d.fx.scale = TRAIL_SCALE
        
        return d
    endmethod
endstruct

    private function Callback takes nothing returns boolean
        local IPData d = KT_GetData()
        local integer i = 0
        local real x
        local real y
        local real angle = 0
        local unit u = null
        
        set d.SECONDS = d.SECONDS + TIMER_INTERVAL
        set d.angle = d.angle + ROTATE_SPEED
        set d.Height = d.Counter * d.HeightModifier
        
        //set d.ZANGLE = d.ZANGLE - 7
        //if d.ZANGLE &lt; -360 then
            //set d.ZANGLE = d.ZANGLE + 360
        //endif

            set x = d.TX + d.AoE * Cos( d.angle * bj_DEGTORAD )
            set y = d.TY + d.AoE * Sin( d.angle * bj_DEGTORAD )
            call d.fx.flash( FLASH_SFX )
            set d.a2n = d.a2n + ROTATE_SPEED
            if d.Height &lt; HEIGHT_VISIBILITY then
                set u = CreateUnit( d.Owner, DUMMY_ID, x, y, d.a2n )
                call SetUnitFlyHeight( u, d.Height, 0 )
                call GroupAddUnit( d.IcePillar, u )
                call SetUnitScale( u, PILLAR_SCALE,PILLAR_SCALE,PILLAR_SCALE)
                
                set d.fx.x=x
                set d.fx.y=y
                set d.fx.z=d.Height

                // NORMAL PILLAR
                set u = CreateUnit( d.Owner, DUMMY_ID, d.TX, d.TY, bj_UNIT_FACING )
                call SetUnitFlyHeight( u, d.Height, 0 )
                call GroupAddUnit( d.IcePillar, u )
            endif
        set d.Counter = d.Counter + 1
        set u = null
        if d.SECONDS &gt;= d.Duration then
            call d.destroy()
            return true
        endif
        return false
    endfunction
    
    private function Cond takes nothing returns boolean
        return GetSpellAbilityId() == SPELL_ID
    endfunction

    private function Actions takes nothing returns nothing
        call KT_Add( function Callback, IPData.create(), TIMER_INTERVAL )
    endfunction

private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( t, Condition( function Cond ) )
    call TriggerAddAction( t, function Actions )
    
    set G_UFilter = Condition( function IPData.UFilter )
    
    set DUMMY_CASTER = CreateUnit( Player(12), DUMMY_ID, 0, 0, bj_UNIT_FACING )
    call UnitRemoveAbility( DUMMY_CASTER, &#039;Amov&#039; )
    call UnitRemoveAbility( DUMMY_CASTER, LICH_SFX_ID )
    call UnitAddAbility( DUMMY_CASTER, STUN_ID )
endfunction

endscope
 

XeNiM666

I lurk for pizza
Reaction score
138
1. Why not use GTrigger?
2. Which is better? Create a timed special effect..
3. Maybe make AOE and DURATION configurable for each level..

Other than that, great spell! Might use it in my map. +rep
 

RaiJin

New Member
Reaction score
40
1. Why not use GTrigger?
2. Which is better? Create a timed special effect..
3. Maybe make AOE and DURATION configurable for each level..

Other than that, great spell! Might use it in my map. +rep

doesn't have to use GTrigger, some people use it, some people don't its best to leave it and the conversion to gtrigger is not even hard.
 

BlackRose

Forum User
Reaction score
239
1. Why not use GTrigger?
2. Which is better? Create a timed special effect..
3. Maybe make AOE and DURATION configurable for each level..

Other than that, great spell! Might use it in my map. +rep
1. Why?
2. I don't like creating effects :p I hear they add too much handle, espcially when I'm creating them like mad.
3. Added to Do-List for v1.01.

Glad you liked it! What map :O?

doesn't have to use GTrigger, some people use it, some people don't its best to leave it and the conversion to gtrigger is not even hard.
Thanks for clearing that up.
 

RaiJin

New Member
Reaction score
40
JASS:
UnitHasBuffBJ( d.Target, BUFF_ID )


change this, its just a BJ change it to

if not GetUnitAbilityLevel( d.Target, BUFF_ID )>0 and....
 

Viikuna

No Marlo no game.
Reaction score
265
Its pretty easy for people to convert some spell to use GTrigger or SpellEvent or whatever they use in their map anyways even if spell doesn use them.

Actually, I think those systems should only be used when you really need them; when you have to use some event response function in some event, that doesnt have it.

( Well, I did used SpellEvent in my Quicksand spell, even I could have done it without it, and Im starting to think that I shouldnt have done that. )
 

Weep

Godspeed to the sound of the pounding
Reaction score
400
Hmm, no tooltips, AOE indicator doesn't seem accurate, annoying sound...I can't really say I like it as a spell. :eek: Could use some polish and revision in terms of FX.
 

BlackRose

Forum User
Reaction score
239
+Looks smoother now.
+Can be chosen to stun immunes if the spell is ultimate (GetTriggerUnit- ;))
+Extra configs.
 

BlackRose

Forum User
Reaction score
239
How many instances, my computer can handle about 5 instances then FPS lowers, 7 - 8 makes it like 10 FPS, more.... :|

And my graphics card isn't the latest! nvidia 7700 :|
 

039-issac

New Member
Reaction score
1
nice spell :thup:
i had no problems with multi instance(i added about 30 level6 mobs and removed the dragons, then started spamming away(just so i could see things getting knocked away))
only got to about 5 frames after 20 seconds of this, wasnt really counting instances of the spell:nuts: there were a few:D
 

BlackRose

Forum User
Reaction score
239
1? And your computer lags..... How laggy? LAG LIKE FUCK TO 1 FPS? Or just a big FPS drop to like 10.

Well, that has nothing to do with me.
 

Bloodcount

Starcraft II Moderator
Reaction score
297
I can only say "Pretty, pretty, shiny, shiny.... (loop) "

nicely done there pal!
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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