Spellpack Frosted Spellpack

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
MUI: Totally
JASS: Yup
JESP: I think so
Leakless: So it would seem
Requires: NewGen


Contains:
- Tundra Escape (escape ability)
- Frozen Soul (boost/heal ability)
- Cold As Ice (defensive ability)
- Cryogenetic Strike (AoE nuke)


THIS ALSO CONTAINS MY PREVIOUS INFERNO SPELLPACK, since I tend to put everything in one map...
I'm still fixing/updating Inferno, but decided to release this one meanwhile.

Just copy everything in the Frosted Triggers map and read the Implementation trigger in there.



TUNDRA ESCAPE

Sublimate yourself, allowing you to escape through the very air you're breathing, slowing nearby opponents for 5 seconds.
Level 1 - 10% max hp lost during sublimation.
Level 2 - 8% max hp lost during sublimation.
Level 3 - 6% max hp lost during sublimation.

22/20/18 second cooldown.
50/60/75 mana cost.
tepd4.jpg

JASS:
library TundraEscape requires FrozenSoul
/////////////////////////////////////////////////////////////////////////////////
//                                                                             //
//                        TUNDRA ESCAPE CONFIGURATION                          //
//                               BY MAGENTIX                                   //
//                                                                             //
//=============================================================================//
//                                                                             //
// Set the Raw Data code for the Tundra Escape ability                         //
private constant function GetAbilityID takes nothing returns integer           //
    return 'A009'                                                              //
endfunction                                                                    //
//                                                                             //
// Set the Raw Data code for the TE Slow ability                               //
private constant function GetNovaID takes nothing returns integer              //
    return 'A00A'                                                              //
endfunction                                                                    //
//                                                                             //
// Set the Raw Data code for the Caster Dummy (Basic Dummy) unit               //
private constant function GetUnitID takes nothing returns integer              //
    return 'n005'                                                              //
endfunction                                                                    //
//                                                                             //
// Set the health you want to be lost with each jump                           //
// FS stands for the effect of Frozen Soul on the spell                        //
// FSE becomes 0 if FS isn't active and 1 if FS is active                      //
private constant function GetHP takes integer Tundra_level, integer FS_level, integer FSE_level returns real
    return (0.12 - (Tundra_level * 0.02) - ((FS_level * 0.02) * FSE_level))    //
endfunction                                                                    //
//                                                                             //
//=============================================================================//
//                                                                             //
//                 DO NOT EDIT ANYTHING BEYOND THIS POINT                      //
//                   PLEASE GIVE CREDIT WHEN USING THIS!                       //
//                                                                             //
/////////////////////////////////////////////////////////////////////////////////

private function Conditions takes nothing returns boolean
    return( GetSpellAbilityId() == GetAbilityID() )
endfunction

private function Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local player p = GetOwningPlayer(u) 
    local real X = GetUnitX(u)
    local real Y = GetUnitY(u)
    call UnitDamageTarget(u, u, GetHP(GetUnitAbilityLevel(u,GetAbilityID()),GetUnitAbilityLevel(u,FrozenSoul_GetAbilityID()),GetUnitAbilityLevel(u,FrozenSoul_GetEffectAbilityID()))*GetUnitState(u,UNIT_STATE_MAX_LIFE), true, true, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_DIVINE, WEAPON_TYPE_WHOKNOWS)
    if (GetUnitAbilityLevel(u,FrozenSoul_GetEffectAbilityID()) > 0) then
        call UnitRemoveAbility(u,FrozenSoul_GetEffectAbilityID())
        call UnitRemoveAbility(u,FrozenSoul_GetTooltipAbilityID())
    endif
    set u = CreateUnit(p,GetUnitID(),X,Y,270.00)
    call UnitApplyTimedLife(u,'BTLF',1.00)
    call UnitAddAbility(u,GetNovaID())
    call IssueTargetOrder(u,"frostnova",u)
    set u = null
    set p = null
endfunction

//===========================================================================
function InitTrig_TundraEscape takes nothing returns nothing
    set gg_trg_TundraEscape = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_TundraEscape, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_TundraEscape, Condition( function Conditions ) )
    call TriggerAddAction( gg_trg_TundraEscape, function Actions )
endfunction
endlibrary


FROZEN SOUL

Sacrifices a target friendly unit and use its soul to empower your next spell. If used while already having a soul stored, you will consume both the soul and target unit, regaining mana and health.

Level 1 - 2% less hp lost with Tundra Escape, adds 4% chance to Cold As Ice and 5% more shard damage.
Heals 200 hp and 150 mana.
Level 2 - 4% less hp lost with Tundra Escape, adds 8% chance to Cold As Ice and 10% more shard damage.
Heals 300 hp and 300 mana.
Level 3 - 6% less hp lost with Tundra Escape, adds 12% chance to Cold As Ice and 15% more shard damage.
Heals 400 hp and 450 mana.

Lasts 90 seconds.

30/25/20 second cooldown.
90/150/210 mana cost.
fs1wi0.jpg
fs2ga1.jpg

JASS:
library FrozenSoul
/////////////////////////////////////////////////////////////////////////////////
//                                                                             //
//                        FROZEN SOUL CONFIGURATION                            //
//                               BY MAGENTIX                                   //
//                                                                             //
//=============================================================================//
//                                                                             //
// Set the Raw Data code for the Frozen Soul ability                           //
public constant function GetAbilityID takes nothing returns integer            //
    return 'A00C'                                                              //
endfunction                                                                    //
//                                                                             //
// Set the Raw Data code for the Frozen Soul Tooltip ability                   //
public constant function GetTooltipAbilityID takes nothing returns integer     //
    return 'A00B'                                                              //
endfunction                                                                    //
//                                                                             //
// Set the Raw Data code for the Frozen Soul Effect ability                    //
public constant function GetEffectAbilityID takes nothing returns integer      //
    return 'A00D'                                                              //
endfunction                                                                    //
//                                                                             //
// Set the health it should heal per level                                     //
private constant function GetHP takes integer Frozen_level returns real        //
    return ((Frozen_level * 100.00) + 100.00)                                  //
endfunction                                                                    //
//                                                                             //
// Set the mana it should heal per level                                       //
private constant function GetMana takes integer Frozen_level returns real      //
    return (Frozen_level * 150.00)                                             //
endfunction                                                                    //
//                                                                             //
// Set the expiration time on the Frozen Soul buff                             //
private constant function GetDuration takes nothing returns real               //
    return 60.00                                                               //
endfunction                                                                    //
//                                                                             //
//=============================================================================//
//                                                                             //
//                 DO NOT EDIT ANYTHING BEYOND THIS POINT                      //
//                   PLEASE GIVE CREDIT WHEN USING THIS!                       //
//                                                                             //
//=============================================================================//
//                                                                             //
//          // Start of needed Handle Var functions for this spell \\          //
//                          // By Kattana \\                                   //
globals                                                                        //
    gamecache globalcache = null                                               //
endglobals                                                                     //
//                                                                             //
private function H2I takes handle h returns integer                            //
    return h                                                                   //
    return 0                                                                   //
endfunction                                                                    //
private function LocalVars takes nothing returns gamecache                     //
    if (globalcache == null) then                                              //
         set globalcache = InitGameCache("jasslocalvars.w3v")                  //
    endif                                                                      //
    return globalcache                                                         //
endfunction                                                                    //
private function SetHandleHandle takes handle subject, string name, handle value returns nothing
    if value==null then                                                        //
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)            //
    else                                                                       //
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, H2I(value))    //
    endif                                                                      //
endfunction                                                                    //
private function GetHandleUnit takes handle subject, string name returns unit  //
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)              //
    return null                                                                //
endfunction                                                                    //
private function GetHandleTimer takes handle subject, string name returns timer//
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)              //
    return null                                                                //
endfunction                                                                    //
private function FlushHandleLocals takes handle subject returns nothing        //
    call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )                   //
endfunction                                                                    //
//          // End of needed Handle Var functions for this spell \\            //
//                                                                             //
//=============================================================================//
//                                                                             //
//                 DO NOT EDIT ANYTHING BEYOND THIS POINT                      //
//                   PLEASE GIVE CREDIT WHEN USING THIS!                       //
//                                                                             //
/////////////////////////////////////////////////////////////////////////////////

private function Conditions takes nothing returns boolean
    return( GetSpellAbilityId() == GetAbilityID())
endfunction

private function Callback takes nothing returns nothing
    local timer t = GetExpiredTimer()
    local unit u = GetHandleUnit(t,"unit")
    if (GetUnitAbilityLevel(u,GetEffectAbilityID()) > 0) then
        call UnitRemoveAbility(u,GetEffectAbilityID())
        call UnitRemoveAbility(u,GetTooltipAbilityID())
    endif
    set u = null
    set t = null
endfunction

private function Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local integer i = GetUnitAbilityLevel(u,GetAbilityID())
    local timer t = null
    call KillUnit(GetSpellTargetUnit())
    if (GetUnitAbilityLevel(u,GetEffectAbilityID()) <= 0) then
        call UnitAddAbility(u,GetEffectAbilityID())
        call UnitAddAbility(u,GetTooltipAbilityID())
        call SetUnitAbilityLevel(u,GetTooltipAbilityID(),i)
        set t = GetHandleTimer(u,"timer")
        if ( t != null) then
            call PauseTimer(t)
            call TimerStart(t,GetDuration(),false,function Callback)
        else
            set t = CreateTimer()
            call SetHandleHandle(u,"timer",t)
            call SetHandleHandle(t,"unit",u)
            call TimerStart(t,GetDuration(),false,function Callback)
        endif
    else
        call UnitRemoveAbility(u,GetEffectAbilityID())
        call UnitRemoveAbility(u,GetTooltipAbilityID())
        call SetUnitState(u, UNIT_STATE_LIFE, GetUnitState(u,UNIT_STATE_LIFE)+GetHP(i))
        call TriggerSleepAction(0.27)
        call SetUnitState(u, UNIT_STATE_MANA, GetUnitState(u,UNIT_STATE_MANA)+GetMana(i)) 
    endif
    set u = null
    set t = null
endfunction

//===========================================================================
function InitTrig_FrozenSoul takes nothing returns nothing
    set gg_trg_FrozenSoul = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_FrozenSoul, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_FrozenSoul, Condition( function Conditions ) )
    call TriggerAddAction( gg_trg_FrozenSoul, function Actions )
endfunction
endlibrary


COLD AS ICE

Gives a small chance to freeze a melee attacker, dealing 50 damage and stunning them for 2 seconds.

Level 1 - 4% chance.
Level 2 - 8% chance.
Level 3 - 12% chance.
JASS:
library ColdAsIce requires FrozenSoul
/////////////////////////////////////////////////////////////////////////////////
//                                                                             //
//                         COLD AS ICE CONFIGURATION                           //
//                               BY MAGENTIX                                   //
//                                                                             //
//=============================================================================//
//                                                                             //
// Set the Raw Data code for the Cold As Ice ability                           //
private constant function GetAbilityID takes nothing returns integer           //
    return 'A00E'                                                              //
endfunction                                                                    //
//                                                                             //
// Set the Raw Data code for the Cold As Ice Stun ability                      //
private constant function GetStunID takes nothing returns integer              //
    return 'A00F'                                                              //
endfunction                                                                    //
//                                                                             //
// Set the Raw Data code for the Caster Dummy (Basic Dummy) unit               //
private constant function GetUnitID takes nothing returns integer              //
    return 'n005'                                                              //
endfunction                                                                    //
//                                                                             //
// Set the damage you want the melee attacker to take (Can be level based)     //
private constant function GetDamage takes integer CAI_level returns real       //
   return ( 50.00 )                                                            //
endfunction                                                                    //
//                                                                             //
// Set the chance of stunning a melee attacker                                 //
// FS stands for the effect of Frozen Soul on the spell                        //
// FSE becomes 0 if FS isn't active and 1 if FS is active                      //
private constant function GetChance takes integer CAI_level, integer FS_level, integer FSE_level returns integer
    return ( (4 * CAI_level) + ((FS_level * 4) * FSE_level) )                  //
endfunction                                                                    //
//                                                                             //
//=============================================================================//
//                                                                             //
//                 DO NOT EDIT ANYTHING BEYOND THIS POINT                      //
//                   PLEASE GIVE CREDIT WHEN USING THIS!                       //
//                                                                             //
/////////////////////////////////////////////////////////////////////////////////

private function Conditions takes nothing returns boolean
    return( GetUnitAbilityLevel(GetTriggerUnit(),GetAbilityID()) > 0 and IsUnitType(GetAttacker(),UNIT_TYPE_MELEE_ATTACKER) and not IsUnitType(GetAttacker(),UNIT_TYPE_MAGIC_IMMUNE) )
endfunction

private function Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local unit v = GetAttacker()
    local player p = GetOwningPlayer(u) 
    local real X = GetUnitX(u)
    local real Y = GetUnitY(u)
    local integer i = GetUnitAbilityLevel(u,GetAbilityID())
    local integer j = GetRandomInt(0,100)
    if ( j <= GetChance(i,GetUnitAbilityLevel(u,FrozenSoul_GetAbilityID()),GetUnitAbilityLevel(u,FrozenSoul_GetEffectAbilityID())) ) then
        call UnitDamageTarget(u, v, GetDamage(i), true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
        set u = CreateUnit(p,GetUnitID(),X,Y,270.00)
        call UnitApplyTimedLife(u,'BTLF',5.00)
        call UnitAddAbility(u,GetStunID())
        call IssueTargetOrder(u,"thunderbolt",v)
    endif
    set u = null
    set v = null
    set p = null
endfunction

//===========================================================================
function InitTrig_ColdAsIce takes nothing returns nothing
    set gg_trg_ColdAsIce = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_ColdAsIce, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddCondition( gg_trg_ColdAsIce, Condition( function Conditions ) )
    call TriggerAddAction( gg_trg_ColdAsIce, function Actions )
endfunction
endlibrary


CRYOGENETIC STRIKE

Creates a spiral of frozen shards which explodes after 2 seconds, sending the shards flying out randomly.
Each shard has a 750 range and deals 40 damage on impact. (84 shards)

Channeling
120 second cooldown.
cs1up9.jpg
cs2pw1.jpg

JASS:
library CryogeneticStrike requires FrozenSoul
/////////////////////////////////////////////////////////////////////////////////
//                                                                             //
//                     CRYOGENETIC STRIKE CONFIGURATION                        //
//                               BY MAGENTIX                                   //
//                                                                             //
//=============================================================================//
//                                                                             //
// Set the Raw Data code for the Cryogenetic Strike ability                    //
private constant function GetAbilityID takes nothing returns integer           //
    return 'A008'                                                              //
endfunction                                                                    //
//                                                                             //
// Set the Raw Data code for the Cryogenetic Strike dummy unit                 //
private constant function GetUnitID takes nothing returns integer              //
    return 'n004'                                                              //
endfunction                                                                    //
//                                                                             //
// Set whether you want the spell to damage trees as well                      //
private constant function ShardsDestroyTrees takes nothing returns boolean     //
    return true                                                                //
endfunction                                                                    //
//                                                                             //
// Set the damage you want each shard to do for every level                    //
// FS stands for the effect of Frozen Soul on the spell                        //
// FSE becomes 0 if FS isn't active and 1 if FS is active                      //
private constant function GetDamage takes integer Cryo_level, integer FS_level, integer FSE_level returns real
    return ((Cryo_level * 20.00) + 20.00 + ((Cryo_level * 20.00) + 20.00) * (FS_level * 0.05) * FSE_level)
endfunction                                                                    //
//                                                                             //
//=============================================================================//
//                                                                             //
//                 DO NOT EDIT ANYTHING BEYOND THIS POINT                      //
//                   PLEASE GIVE CREDIT WHEN USING THIS!                       //
//                                                                             //
//=============================================================================//
//                                                                             //
//          // Start of needed Handle Var functions for this spell \\          //
//                          // By Kattana \\                                   //
private function H2I takes handle h returns integer                            //
    return h                                                                   //
    return 0                                                                   //
endfunction                                                                    //
private function LocalVars takes nothing returns gamecache                     //
    if (globalcache == null) then                                              //
         set globalcache = InitGameCache("jasslocalvars.w3v")                  //
    endif                                                                      //
    return globalcache                                                         //
endfunction                                                                    //
private function SetHandleInt takes handle subject, string name, integer value returns nothing
    if value==0 then                                                           //
        call FlushStoredInteger(LocalVars(),I2S(H2I(subject)),name)            //
    else                                                                       //
        call StoreInteger(LocalVars(), I2S(H2I(subject)), name, value)         //
    endif                                                                      //
endfunction                                                                    //
private function GetHandleInt takes handle subject, string name returns integer//
    return GetStoredInteger(LocalVars(), I2S(H2I(subject)), name)              //
endfunction                                                                    //
private function FlushHandleLocals takes handle subject returns nothing        //
    call FlushStoredMission(LocalVars(), I2S(H2I(subject)) )                   //
endfunction                                                                    //
//          // End of needed Handle Var functions for this spell \\            //
//                                                                             //
//=============================================================================//
//                                                                             //
//                 DO NOT EDIT ANYTHING BEYOND THIS POINT                      //
//                   PLEASE GIVE CREDIT WHEN USING THIS!                       //
//                                                                             //
/////////////////////////////////////////////////////////////////////////////////

globals
    private integer TempInt
    private destructable TempDestructable
endglobals

struct ShardData
    real array ShardAngles[84]
    unit array ShardUnits[84]
    integer i = 0
    real Damage = 0
endstruct

struct CryoData
    effect e
    integer i = 0
    integer Level = 0
    group g
    unit u
    player p
    real X = 0
    real Y = 0
    real Damage = 0
    real Angle = 0
endstruct

private function Damage_VT takes nothing returns boolean
    local player p = Player(TempInt)
    local unit u = GetFilterUnit()
    local boolean b = (GetUnitState(u, UNIT_STATE_LIFE) > 0 and IsUnitEnemy(u,p) and GetUnitAbilityLevel(u,'Aloc')==0)
    set u = null
    set p = null
    return b
endfunction

private function CountDestructables takes nothing returns nothing
    local destructable d = GetEnumDestructable()
    if (GetDestructableLife(d) > 0) then
        set TempDestructable = d
    endif
    set d = null
endfunction

function MoveShard takes nothing returns nothing
    local timer t=GetExpiredTimer()
    local group g
    local integer i = 0
    local unit TargetUnit
    local ShardData dat = ShardData( GetHandleInt(t,"dat") ) 
    local real X
    local real Y 
    if (dat.i < 50) then
        set g = CreateGroup()
        loop
        exitwhen (i == 84)
            if (dat.ShardUnits<i> != null) then
                set X = GetUnitX(dat.ShardUnits<i>)
                set Y = GetUnitY(dat.ShardUnits<i>)
                if (GetUnitFlyHeight(dat.ShardUnits<i>) &gt; 0.00 and dat.i==0) then
                    call SetUnitFlyHeight(dat.ShardUnits<i>,0.00,100.00)
                endif
                call SetUnitX(dat.ShardUnits<i>,X + 15.00 * Cos(dat.ShardAngles<i> * bj_DEGTORAD))
                call SetUnitY(dat.ShardUnits<i>,Y + 15.00 * Sin(dat.ShardAngles<i> * bj_DEGTORAD)) 
                set TempInt = GetPlayerId(GetOwningPlayer(dat.ShardUnits<i>))
                call GroupEnumUnitsInRange(g, X, Y, 80.00, Condition(function Damage_VT))
                set TargetUnit = FirstOfGroup(g)
                call GroupClear(g)
                if (TargetUnit != null) then
                    call UnitDamageTarget(dat.ShardUnits<i>, TargetUnit, dat.Damage, false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS) 
                    call KillUnit(dat.ShardUnits<i>)
                    set dat.ShardUnits<i> = null
                elseif (ShardsDestroyTrees()) then
                    set TempDestructable = null
                    call EnumDestructablesInRect(Rect(X-50.00,Y-50.00,X+50.00,Y+50.00), null, function CountDestructables)
                    if (TempDestructable != null) then
                        call UnitDamageTarget(dat.ShardUnits<i>, TempDestructable, dat.Damage, false, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS)
                        call KillUnit(dat.ShardUnits<i>)
                        set dat.ShardUnits<i> = null
                    endif
                endif
            endif
            set i = i +1
        endloop
        call DestroyGroup(g)
        set dat.i = dat.i + 1
        call SetHandleInt(t,&quot;dat&quot;,dat)
    else
        // Clean up the struct
        call ShardData.destroy(dat)
        call FlushHandleLocals(t)
        call PauseTimer(t)
        call DestroyTimer(t)
    endif
    set t = null
    set g = null
    set TargetUnit = null
endfunction

function CryoShard takes group shards, real damage returns nothing
    local timer t = CreateTimer()
    local ShardData dat = ShardData.create()
    local unit u
    local integer i = 0
    loop
        set u = FirstOfGroup(shards)
    exitwhen (u == null)
        call GroupRemoveUnit(shards,u)
        set dat.ShardUnits<i> = u
        set dat.ShardAngles<i> = GetRandomReal(0.00,360.00)
        set i = i + 1
    endloop
    set dat.i = 0
    set dat.Damage = damage
    call SetHandleInt(t,&quot;dat&quot;,dat)
    call TimerStart(t,0.04,true,function MoveShard)
    set t = null
    set u = null    
endfunction

function CryoEffect takes nothing returns nothing
    local timer t=GetExpiredTimer()
    local unit u
    local integer i = 0
    local real CurrentX
    local real CurrentY
    local CryoData dat = CryoData( GetHandleInt(t,&quot;dat&quot;) )
    if (OrderId2String(GetUnitCurrentOrder(dat.u)) != &quot;channel&quot; and dat.i &lt; 20) then
        set dat.i = 21
        call SetHandleInt(t,&quot;dat&quot;,dat)
        call TimerStart(t,0.50,false,function CryoEffect)
    elseif (dat.i &lt; 21) then
        loop
        exitwhen (i == 2)
            set i = i+1
            set CurrentX = dat.X + 75.00 * Cos((dat.Angle + (dat.i * 18.00) + (180.00*i)) * bj_DEGTORAD)
            set CurrentY = dat.Y + 75.00 * Sin((dat.Angle + (dat.i * 18.00) + (180.00*i)) * bj_DEGTORAD)
            set u = CreateUnit(dat.p,GetUnitID(),CurrentX,CurrentY,bj_UNIT_FACING)
            call SetUnitFlyHeight(u,(dat.i*10.00),5000.00)
            call UnitApplyTimedLife(u,&#039;BTLF&#039;,2.50+((20-dat.i)*0.05))
            call GroupAddUnit(dat.g,u)
            set CurrentX = dat.X + 75.00 * Cos((dat.Angle - (dat.i * 18.00) + (180.00*i)) * bj_DEGTORAD)
            set CurrentY = dat.Y + 75.00 * Sin((dat.Angle - (dat.i * 18.00) + (180.00*i)) * bj_DEGTORAD)
            set u = CreateUnit(dat.p,GetUnitID(),CurrentX,CurrentY,bj_UNIT_FACING)
            call SetUnitFlyHeight(u,(dat.i*10.00),5000.00)
            call UnitApplyTimedLife(u,&#039;BTLF&#039;,2.50+((20-dat.i)*0.05))
            call GroupAddUnit(dat.g,u)
        endloop
        set dat.i = dat.i + 1
        call SetHandleInt(t,&quot;dat&quot;,dat)
        if (dat.i &lt; 21) then
            call TimerStart(t,0.05,false,function CryoEffect)
        else
            call TimerStart(t,0.50,false,function CryoEffect)
        endif
    else
        call CryoShard(dat.g,dat.Damage)
        // Create Special Effect upon shatter
        call DestroyEffect(dat.e)
        call DestroyEffect(AddSpecialEffectTarget(&quot;Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl&quot;,dat.u,&quot;origin&quot;))
        // Clean up the struct
        call DestroyGroup(dat.g)
        call CryoData.destroy(dat)
        call FlushHandleLocals(t)
        call DestroyTimer(t)
    endif
    set t = null
    set u = null
endfunction

function Conditions takes nothing returns boolean
    return ( GetSpellAbilityId() == GetAbilityID() )
endfunction

function Actions takes nothing returns nothing
    local timer t = CreateTimer()
    local integer FSELevel
    local CryoData dat = CryoData.create()
    set dat.i = 0
    set dat.g = CreateGroup()
    set dat.u = GetTriggerUnit()
    set dat.X = GetUnitX(dat.u)
    set dat.Y = GetUnitY(dat.u)
    set dat.Level = GetUnitAbilityLevel(dat.u,GetAbilityID())
    set FSELevel = GetUnitAbilityLevel(dat.u,FrozenSoul_GetEffectAbilityID())
    set dat.Damage = GetDamage(dat.Level,GetUnitAbilityLevel(dat.u,FrozenSoul_GetAbilityID()),FSELevel)
    set dat.Angle = GetUnitFacing(dat.u)
    set dat.p = GetOwningPlayer(dat.u)
    set dat.e = AddSpecialEffectTarget(&quot;Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathTargetArt.mdl&quot;,dat.u,&quot;origin&quot;)
    call SetHandleInt(t,&quot;dat&quot;,dat)
    call TimerStart(t,1.00,false,function CryoEffect)
    if (FSELevel &gt; 0) then
        call UnitRemoveAbility(dat.u,FrozenSoul_GetEffectAbilityID())
        call UnitRemoveAbility(dat.u,FrozenSoul_GetTooltipAbilityID())
    endif
    set t = null
endfunction

//===========================================================================
function InitTrig_CryogeneticStrike takes nothing returns nothing
    set gg_trg_CryogeneticStrike = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_CryogeneticStrike, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_CryogeneticStrike, Condition( function Conditions ) )
    call TriggerAddAction( gg_trg_CryogeneticStrike, function Actions )
endfunction
endlibrary</i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i></i>



JESP Document:
JASS:
//  This is the JESP standard document, if a map contains this document it means that there are
// spells that follow this standard.
//
// Spells of this map that follow the standard:
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
// - Cryogenetic Strike
// - Tundra Escape
// - Frozen Soul
// - Cold As Ice
//
// Advantages of the Standard
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
// - Implementing spells that follow the standard is relatively easier than implementing JASS
// spells that don&#039;t follow the standard.
//
// - Configuring/Balancing spells that follow the standard is relatively easier than
// implementing JASS spells that don&#039;t follow the standard.
//
// - Users may do the following procedure to make a new ability that uses the spell&#039;s script :
//
// * Create a new Trigger with a name (case sensitive)
// * Convert that trigger to custom text.
// * Copy the spell&#039;s script to a text editor like Notepad or your OS equivalent.
// * Replace the spell&#039;s Code name with the name you used on the trigger.
// * Copy the new text to the new trigger
// * Duplicate the Spell&#039;s original objects to have new ones for the new spell script.
//
//   You are now able to use that new version of the spell.
//
// - In case two guys give the same name to 2 different spells, there are no conflict problems
// because you can easily change the name of one of them
//
// What is the JESP Standard?
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
//   The JESP standard was designed to make spell sharing much better. And to make sure JASS
// enhanced spells follow a rule, to prevent chaos.
//
// What does JESP Standard stands for?
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
// JASS
// Enhanced
// Spell
// Pseudotemplate
//
// Requirements for a spell to follow the JESP Standard
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
// - The spell is written in JASS
// - The spell is 100% multi instanceable.
// - The spell script is ready to support spells of any number of levels.
//   (default config header is not required to support all of them)
//
// - The Spell has an specific code name.
//
// - The Spell&#039;s trigger must have the spell&#039;s codename as name
//
// - The Spell&#039;s InitTrig function must be named: InitTrig_&lt;CodeName&gt;
//
// - The spell has a configuration header.
//
// - It is mandatory that rawcodes of objects are configurable in the header.
//
// - All the spell&#039;s specific code is inside the spell&#039;s &quot;Trigger&quot; (Trigger== that custom text
//   slot that world editor calls Trigger, the spell may use as many &#039;trigger&#039; OBJECTS as needed)
//
// - Every spell-specific single identifier or key works in such a way that reproducing the
//   spell&#039;s trigger but after performing a text-replace of codename with another name (and thus
//   renaming the cloned trigger to the new code name) it won&#039;t cause compile errors / conflicts
//   when playing the map.
//
// - There is no code inside the spell&#039;s &quot;Trigger&quot; that is not specific to the spell.
//
// - There are no requirements for GUI variables that are specific to the spell. If a system
//   used by the spell requires GUI variables the code for the system must be outside the &quot;Trigger&quot;
//
// - Eyecandy and spell&#039;s balance have to be easy to configure
//
// - The name of the author should be included in the spell&#039;s script.
//
// - The reason to exist of this standard is spell sharing. This document should be included
// within the map. And it should specify which spell follows the standard, in the top list.
 

Attachments

  • Magentix Spellpacks.w3x
    72.7 KB · Views: 239

0zaru

Learning vJASS ;)
Reaction score
60
Well before check leaks i have a few comments:
-Why do an entire out function to get hp damage etc ?, you can make more constant and calculate it outside the code.... I think that it will do it a little more faster.. Since you are calling a function everytime.
-I know why you made Constant functions (To keep JESP i think..) but i think that constant globals are a little more accurate... I don't know exactly..

Anyway the spell looks nice +rep i will check for leaks..
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
I read somewhere that when optimising with Vex' Optimizer, the program replaces constant function calls with the result, saving calls and code space...
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
In the spoilers.. to save the world from screen clogging
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Don't ever use the "EVENT_PLAYER_UNIT_ATTACKED" event in a spell trigger. Ever.

It runs when the unit initiates an attack (when the animation starts playing), not when the damage happens. Try this over and over again whilst Cold as Ice is active: press "A", then click on a unit. You will see the trigger fire over and over again without the unit ever attacking.
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Name a good one. The only one I can think of is stopping units from attacking other units (like an anti-teamkilling trigger), but that's not a spell.
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
Don't ever use the "EVENT_PLAYER_UNIT_ATTACKED" event in a spell trigger. Ever.

It runs when the unit initiates an attack (when the animation starts playing), not when the damage happens. Try this over and over again whilst Cold as Ice is active: press "A", then click on a unit. You will see the trigger fire over and over again without the unit ever attacking.

Well, instead of just saying what I shouldn't use... mind helping me out on what I should use?
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
You could simple create 2 trigger easily which 1 for EVENT_PLAYER_UNIT_ATTACKED event and another for EVENT_UNIT_DAMAGED.
I know, I know...EVENT_UNIT_DAMAGED need 1 unit for that event only..right?

That's easy to be fix by EVENT_PLAYER_UNIT_ATTACKED trigger.
Let say now we have 2 trigger...
A - EVENT_PLAYER_UNIT_ATTACKED event
B - EVENT_UNIT_DAMAGED event ( but don't write the TriggerRegisterUnitEvent first )

Now, when A is fired, you got the trigger unit as variable..right?
Then, you could use TriggerRegisterUnitEvent to add the event to B.
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
Yeah, I read about the damage event, but the thing is: If i order to attack a unit and the unit meanwhile gets damaged by a dot, spell, whatever... the "OnAttack" functions would already fire.

So basically I need an ATTACK->DAMAGE system which detects whether the damage was from a normal attack and not a spell or something.
 
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