Spellpack Ice Themed

0zaru

Learning vJASS ;)
Reaction score
60
JASS/GUI: JASS
MUI: Yes
Leaks: No one i thing :rolleyes:

Ice Ball​
Code:
Throws a Iceball from your position to a certain distance. All units in the way of the IceBall are carried with the ball or pushed back from it.
screen1gw1.jpg

JASS:
scope IceBall

globals
  private integer IceBallId='A002'
  private integer IceballDummy='h000'
  private real MaxDistance=600 //Max Distance of the Ball
  private real MaxPickRange=250 //The Pick range of all units in the way
  private real DamagePerIntervalPlusDistance=10 //Damage per level and per .1 seconds that the ball is moved
  private boolean AffectImmunes=false// Will this move immunes ? <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite7" alt=":p" title="Stick Out Tongue    :p" loading="lazy" data-shortname=":p" />
endglobals

private function Trig_Ice_Ball_Conditions takes nothing returns boolean
  return GetSpellAbilityId() == IceBallId
endfunction

private function ICBMove takes nothing returns nothing
  local timer t=GetExpiredTimer()
  local string ttable=GetAttachmentTable(t)
  local unit Hero=GetTableUnit(ttable,&quot;ICBCaster&quot;)
  local unit IceBall=GetTableUnit(ttable,&quot;ICBall&quot;)
  local real x=GetUnitX(IceBall)
  local real y=GetUnitY(IceBall)
  local real angle=GetTableReal(ttable,&quot;angle&quot;) 
  local group g=CreateGroup()
  local trigger t2
  local unit w
  local real newx
  local real newy
  local real Distance=GetTableReal(ttable,&quot;Distance&quot;)
  local real Damage=(DamagePerIntervalPlusDistance*GetUnitAbilityLevel(Hero,IceBallId))+Distance
   if Distance&lt;MaxDistance and GetWidgetLife(IceBall)&gt;0.465 then
      call SetUnitScale(IceBall,(100*GetUnitAbilityLevel(Hero,IceBallId)+Distance)*0.01,(100*GetUnitAbilityLevel(Hero,IceBallId)+Distance)*0.01,(100*GetUnitAbilityLevel(Hero,IceBallId)+Distance)*0.01)
      set newx=x+Distance*Cos(angle*bj_DEGTORAD)
      set newy=y+Distance*Sin(angle*bj_DEGTORAD)
      call SetUnitPosition(IceBall,newx,newy)
      call GroupEnumUnitsInRange(g,newx,newy,MaxPickRange,null)
       loop
        set w=FirstOfGroup(g)
        exitwhen w==null
        call GroupRemoveUnit(g,w)
         if IsUnitEnemy(w,GetOwningPlayer(Hero))==true and IsUnitType(w,UNIT_TYPE_STRUCTURE)==false then
            if IsUnitType(w,UNIT_TYPE_MAGIC_IMMUNE)==true and AffectImmunes==true and GetWidgetLife(w)&gt;0.465 then
              call SetUnitPosition(w,newx,newy)
              call UnitDamageTarget(Hero,w,Damage,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,null)
            elseif IsUnitType(w,UNIT_TYPE_MAGIC_IMMUNE)==true and AffectImmunes==false and GetWidgetLife(w)&gt;0.465 then
            elseif GetWidgetLife(w)&gt;0.465 then
            call SetUnitPosition(w,newx,newy)
            call UnitDamageTarget(Hero,w,Damage,true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,null)
         endif   
         endif
       endloop
      call DestroyGroup(g)
      set Distance=Distance+50
      call SetTableReal(ttable,&quot;Distance&quot;,Distance)
   else
     set t2=GetTableTrigger(ttable,&quot;Trigger&quot;)
     call DestroyTrigger(t2)
     call KillUnit(IceBall)
     call RemoveUnit(IceBall)
     call DestroyGroup(g)
     call CleanAttachedVars(t)
     call DestroyTimer(t)
     set t=null
     set w=null
     set IceBall=null
     set Hero=null
   endif
  set Hero=null
  set IceBall=null
  set w=null
endfunction

private function KillIfOutOfMap takes nothing returns boolean
return GetUnitTypeId(GetLeavingUnit())==IceballDummy
endfunction

private function KillIB takes nothing returns nothing
call KillUnit(GetTriggerUnit())
call TriggerSleepAction(1.1)
call RemoveUnit(GetTriggerUnit())
call DestroyTrigger(GetTriggeringTrigger())
endfunction

private function Trig_Ice_Ball_Actions takes nothing returns nothing
  local trigger t2=CreateTrigger()
  local unit Hero=GetSpellAbilityUnit()
  local timer t=CreateTimer()
  local string ttable=GetAttachmentTable(t)
  local location l=GetSpellTargetLoc()
  local real x=GetLocationX(l)
  local real y=GetLocationY(l)
  local boolexpr Boolexpr=Condition(function KillIfOutOfMap)
  local real Angle=bj_RADTODEG*Atan2(y-GetUnitY(Hero),x-GetUnitX(Hero))   
  local region rectRegion = CreateRegion()
  call RegionAddRect(rectRegion,bj_mapInitialPlayableArea)
  call RemoveLocation(l)
  call TriggerRegisterLeaveRegion(t2,rectRegion,null)
  call TriggerAddCondition(t2,Boolexpr)
  call TriggerAddAction(t2,function KillIB)
  set bj_lastCreatedUnit=CreateUnit(GetOwningPlayer(Hero),IceballDummy,x,y,Angle)
  call SetTableObject(ttable,&quot;ICBall&quot;,bj_lastCreatedUnit)
  call SetTableReal(ttable,&quot;angle&quot;,Angle)
  call SetTableObject(ttable,&quot;ICBCaster&quot;,Hero)
  call SetTableObject(ttable,&quot;Trigger&quot;,t2)
  call TimerStart(t,0.1,true,function ICBMove)
  set Hero=null
  call DestroyBoolExpr(Boolexpr)
endfunction

//===========================================================================
function InitTrig_Ice_Ball takes nothing returns nothing
    set gg_trg_Ice_Ball = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Ice_Ball, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_Ice_Ball, Condition( function Trig_Ice_Ball_Conditions ) )
    call TriggerAddAction( gg_trg_Ice_Ball, function Trig_Ice_Ball_Actions )
    call PreloadUnit(IceballDummy)
    call PreloadSpell(IceBallId)
endfunction

endscope

Freezing Soul​
Code:
With every attack you have a chance to steal part of the Soul of the enemy, damaging it. Also when you steal the part of the soul, you transfer it to your hands giving you more attack speed.
screen2eb3.jpg

JASS:
scope FreezingSoul

globals
  private integer IBS_ID=&#039;A000&#039;
  private integer IBS_SpellDummyLife=&#039;A005&#039;
  private integer IBS_SpellSpeedGain=&#039;A001&#039;
  private real IBS_ChancesPerLevel=10 //Chances per level 10*level
  private real IBS_DamagePerLevel=30//Damage per level 30*level
  private real DurationPerLevel=5//Duration per level 5*level
  private string SoulHeroEffect=&quot;Abilities\\Weapons\\FrostWyrmMissile\\FrostWyrmMissile.mdl&quot;
  private string SoulStealEffect=&quot;Abilities\\Spells\\Undead\\FreezingBreath\\FreezingBreathTargetArt.mdl&quot;
endglobals

private function IBS_Stop takes nothing returns nothing
  local timer t=GetExpiredTimer()
  local string shtable=GetAttachmentTable(t)
  local unit SoulHero=GetTableUnit(shtable,&quot;SH&quot;)
  local unit Target=GetTableUnit(shtable,&quot;SHT&quot;)
  local effect array Effect
  local integer i=0
  set Effect[1]=GetTableEffect(shtable,&quot;effect1&quot;)
  set Effect[2]=GetTableEffect(shtable,&quot;effect2&quot;)
  set Effect[3]=GetTableEffect(shtable,&quot;effect3&quot;)
  set Effect[4]=GetTableEffect(shtable,&quot;effect4&quot;)
  loop
      exitwhen i&gt;4
      call DestroyEffect(Effect<i>)
      set i=i+1
  endloop
  call UnitRemoveAbility(SoulHero,IBS_SpellSpeedGain)
  call UnitRemoveAbility(Target,IBS_SpellDummyLife)
  call CleanAttachedVars(SoulHero)
  set SoulHero=null
  call CleanAttachedVars(t)
  call DestroyTimer(t)
  set t=null
endfunction

private function Trig_Freezing_Soul_Actions takes nothing returns nothing
  local unit SoulHero=GetEventDamageSource()
  local unit Target=GetTriggerUnit()
  local timer t=CreateTimer()
  local string shtable=GetAttachmentTable(t)
  local string HeroTable=GetAttachmentTable(SoulHero)
  local real Chances=IBS_ChancesPerLevel*GetUnitAbilityLevel(SoulHero,IBS_ID)
  local boolean Bool=GetTableBoolean(HeroTable,&quot;Bool&quot;)
  local effect Effect
  local effect Attach
  local effect Attach2
  local effect Attach3
   if GetRandomReal(1,100)&lt;=Chances and Bool==null and GetUnitAbilityLevel(SoulHero,IBS_ID)&gt;0 then
      call UnitAddAbility(SoulHero,IBS_SpellSpeedGain)
      call SetUnitAbilityLevel(SoulHero,IBS_SpellSpeedGain,GetUnitAbilityLevel(SoulHero,IBS_ID))
      call UnitAddAbility(Target,IBS_SpellDummyLife)
      call SetUnitAbilityLevel(Target,IBS_SpellDummyLife,GetUnitAbilityLevel(SoulHero,IBS_ID))
      call UnitDamageTarget(SoulHero,Target,IBS_DamagePerLevel*GetUnitAbilityLevel(SoulHero,IBS_ID),true,false,ATTACK_TYPE_CHAOS,DAMAGE_TYPE_UNIVERSAL,null)
      call SetTableBoolean(HeroTable,&quot;Bool&quot;,true)
      set Effect=AddSpecialEffectTarget(SoulStealEffect,Target,&quot;chest&quot;)
      set Attach=AddSpecialEffectTarget(SoulHeroEffect,SoulHero,&quot;hand,left&quot;)
      set Attach2=AddSpecialEffectTarget(SoulHeroEffect,SoulHero,&quot;hand,right&quot;)
      set Attach3=AddSpecialEffectTarget(SoulHeroEffect,SoulHero,&quot;weapon&quot;)
      call SetTableObject(shtable,&quot;SH&quot;,SoulHero)
      call SetTableObject(shtable,&quot;SHT&quot;,Target)
      call SetTableObject(shtable,&quot;effect1&quot;,Effect)
      call SetTableObject(shtable,&quot;effect2&quot;,Attach)
      call SetTableObject(shtable,&quot;effect3&quot;,Attach2)
      call SetTableObject(shtable,&quot;effect4&quot;,Attach3)
      call TimerStart(t,DurationPerLevel*GetUnitAbilityLevel(SoulHero,IBS_ID),false,function IBS_Stop)
   endif
  set SoulHero=null
  set Target=null
endfunction

//===========================================================================
function InitTrig_Freezing_Soul takes nothing returns nothing
    call DamDetect_Init()
    call DamDetect_Attacks(SCOPE_PRIVATE+&quot;Trig_Freezing_Soul_Actions&quot;)
    call PreloadSpell(IBS_ID)
    call PreloadSpell(IBS_SpellSpeedGain)
    call PreloadSpell(IBS_SpellDummyLife)
    call Preload(SoulHeroEffect)
    call Preload(SoulStealEffect)
endfunction

endscope

</i>



Frozen Desire​
Code:
Cast upon a mystical ice shard. Hits all units within a 500 range with full ice force.

Note: I wanted to do this in a spiral, but it with look like the Frost Spiral spell that -Thanatos- did.
screen3yy3.jpg

JASS:
scope FrozenDesire

globals
  private integer FS_ID=&#039;A004&#039;
  private integer FS_DummyID=&#039;h001&#039;
  private integer FS_DummyAb=&#039;A003&#039;
  private integer FS_FlyingDummy=&#039;h002&#039;
  private integer SpellDurationPerLevel=3//Spell duration per level
  private real RangeForCreation=500.00 //Range of the circle
  private real DamageIntermediate=0.40//Nova -Wait this global- Nova
  private real RangeForDummycast=500.00 //Range of the units that are going to be affected by ice
endglobals

private function Trig_Frozen_Desire_Conditions takes nothing returns boolean
  return GetSpellAbilityId() == FS_ID
endfunction

private function Damage takes nothing returns nothing
  local timer t=GetExpiredTimer()
  local string ttable=GetAttachmentTable(t)
  local unit dummy=GetTableUnit(ttable,&quot;dummy&quot;)
  local group g=CreateGroup()
  local unit w
  call GroupEnumUnitsInRange(g,GetUnitX(dummy),GetUnitY(dummy),RangeForDummycast,null)
  loop
      set w=FirstOfGroup(g)
      exitwhen w==null
      call GroupRemoveUnit(g,w)
         if IsUnitEnemy(w,GetOwningPlayer(dummy))==true then
            call IssueTargetOrder(dummy,&quot;frostnova&quot;,w)
         endif
  endloop
  set dummy=null
  call DestroyGroup(g)
endfunction

private function FS_Stop takes nothing returns nothing
local unit Hero=GetTriggerUnit()
local string htable=GetAttachmentTable(Hero)
local unit dummy=GetTableUnit(htable,&quot;Dummy&quot;)
local unit Dummys
local string ttable=GetTableString(htable,&quot;ttable&quot;)
local timer t=GetTableTimer(htable,&quot;Timer&quot;)
local integer i=0
loop
exitwhen i&gt;180
set Dummys=GetTableUnit(htable,&quot;Dummy&quot;+I2S(i))
call KillUnit(Dummys)
set i=i+1
endloop
call RemoveUnit(dummy)
call CleanAttachedVars(t)
call CleanAttachedVars(Hero)
call DestroyTimer(t)
set Hero=null
set t=null
set Dummys=null
set dummy=null
call DestroyTrigger(GetTriggeringTrigger())
endfunction

private function Trig_Frozen_Desire_Actions takes nothing returns nothing
  local timer t=CreateTimer()
  local trigger t2=CreateTrigger()
  local string ttable=GetAttachmentTable(t)
  local unit Hero=GetSpellAbilityUnit()
  local string t2table=GetAttachmentTable(Hero)
  local real x=GetUnitX(Hero)
  local real y=GetUnitY(Hero)
  local unit Dummys
  local unit dummy=CreateUnit(GetOwningPlayer(Hero),FS_DummyID,x,y,GetUnitFacing(Hero))
  local real angle=0
  local integer i=0
  local real newx
  local real newy
  local real dur=SpellDurationPerLevel*GetUnitAbilityLevel(Hero,FS_ID)
  call SetUnitAnimation(Hero,&quot;channel&quot;)
  call UnitAddAbility(dummy,FS_DummyAb)
  call SetUnitAbilityLevel(dummy,FS_DummyAb,GetUnitAbilityLevel(Hero,FS_ID))
  call SetUnitScale(dummy,(150+I2R(GetUnitAbilityLevel(Hero,FS_ID)))*0.01,(150+I2R(GetUnitAbilityLevel(Hero,FS_ID)))*0.01,(150+I2R(GetUnitAbilityLevel(Hero,FS_ID)))*0.01)
  loop
      exitwhen i&gt;180
              set newx=x+RangeForCreation*Cos(angle)
              set newy=y+RangeForCreation*Sin(angle)
              set Dummys=CreateUnit(GetOwningPlayer(Hero),FS_FlyingDummy,newx,newy,270.00)
              call SetTableObject(t2table,&quot;Dummy&quot;+I2S(i),Dummys)
              set i=i+1
              set angle=angle+10
                if angle&gt;360 then
                   set angle=0
                endif
  endloop
  call SetTableObject(ttable,&quot;dummy&quot;,dummy)
  call SetTableObject(t2table,&quot;Dummy&quot;,dummy)
  call SetTableString(t2table,&quot;ttable&quot;,ttable)
  call SetTableObject(t2table,&quot;Timer&quot;,t)
  call TimerStart(t,DamageIntermediate,true,function Damage)
  call TriggerRegisterUnitEvent(t2,Hero,EVENT_UNIT_SPELL_ENDCAST)
  call TriggerAddCondition(t2,Condition(function Trig_Frozen_Desire_Conditions))
  call TriggerAddAction(t2,function FS_Stop)
  set t=null
  set dummy=null
  set Hero=null
  set Dummys=null
endfunction

//===========================================================================
function InitTrig_Frozen_Desire takes nothing returns nothing
    set gg_trg_Frozen_Desire = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Frozen_Desire, EVENT_PLAYER_UNIT_SPELL_CHANNEL )
    call TriggerAddCondition( gg_trg_Frozen_Desire, Condition( function Trig_Frozen_Desire_Conditions ) )
    call TriggerAddAction( gg_trg_Frozen_Desire, function Trig_Frozen_Desire_Actions )
    call PreloadUnit(FS_DummyID)
    call PreloadUnit(FS_FlyingDummy)
    call PreloadSpell(FS_ID)
    call PreloadSpell(FS_DummyAb)
endfunction

endscope

Note: I don't really put all things like:
JASS:
//Replace this with your rawcode bla bla bla

because i have put all these things in the Readme. Only aclared those that weren't in the readme
 

Attachments

  • [Spellpack]Ice Themed.w3x
    74.8 KB · Views: 250

Sim

Forum Administrator
Staff member
Reaction score
534
Ice Ball

It is not smooth enough. Reduce the repeating timer's frequency to something like 0.02, and decrease the distance greatly. Other than that, looks good!

Ice Being Soul

You should call it something else, like Freezing Soul, Drain Soul, or Soul Freeze ;)

It should add a buff to the Lich when it procs.

Frozen Desire

It should not damage the units every second. It should instead be smoother and damage them very often, but for a low amount of damage. Looks weird right now. It should be also be channeling but interruptable, do not pause the caster.

Great spells, keep it up!
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
Pessimistic comments:
  • You're using the "A Unit is Attacked" event. This is bad. Very bad. Mainly because it fires when the attack is initiated, not when the damage occurs, or even when the attack is committed but before the damage occurs.

    You need an attack detection method/system for this spell.
  • The last one... can't you just use a nova spell template?
  • This line is pointless: call ClearTable(ttable). It should be replaced with call CleanAttachedVars(t).
  • In fact, using tables is pointless if you're only storing one thing on the table.
  • call TriggerSleepAction(dur) is also very bad. Use a timer instead.
  • angle*bj_DEGTORAD is inefficient. Just work in radians the whole time.

I'm sure there's more, I'd just have to look.
 

0zaru

Learning vJASS ;)
Reaction score
60
Thanks for the comments but i have some quetions in pyrogams things:

>You need an attack detection method/system for this spell.


I knowed this somewhat but... if a use a system like Emjlr3 dam detect system, i need to take all out the scope, so no use for privates and can be interfered in anothers triggers =/

>This line is pointless: call ClearTable(ttable). It should be replaced with call CleanAttachedVars(t).


That would be if a use AttachedVars 'cause Tables don't have a call CleanAttachedVars(t), and i think that the things are attached to the table =/

>call TriggerSleepAction(dur) is also very bad. Use a timer instead.
going to fix :)

># In fact, using tables is pointless if you're only storing one thing on the table.

If i use DamDetect system, i will need tables
 

Sim

Forum Administrator
Staff member
Reaction score
534
> The last one... can't you just use a nova spell template?

It is not a nova. It is some kind of "circular" barrier that doesn't move and which damages any enemy unit that comes within x of the hero. The "barrier" itself doesn't move, as opposed to a nova.
 

NapaHero

Back from the dead...
Reaction score
43
2 things I didn't like from this spellpack:

Ice Ball should look better. It should start small and slow and then become bigger and faster as it proceed, knocking back units in its way according to the speed.

Frozen Desire lags. Really. If more than 1 unit casts it, Then the Game lags a lot, Else lags only for the owner of the triggering unit
 

0zaru

Learning vJASS ;)
Reaction score
60
>
I knowed this somewhat but... if a use a system like Emjlr3 dam detect system, i need to take all out the scope, so no use for privates and can be interfered in anothers triggers =/

(Quote of myselft)

Fixed it adding the SCOPE_PRIVATE+"funcname" thing ^^

Going to update temorrow, now i have a birthday

EDIT:
>Ice Ball should look better. It should start small and slow and then become bigger and faster as it proceed, knocking back units in its way according to the speed.

Well it's like that only that you can't notice because it makes it fast, very fast actually... going to edit this. Also it does not knockback always, most of the time it just take the units with it.

>
Frozen Desire lags. Really. If more than 1 unit casts it, Then the Game lags a lot, Else lags only for the owner of the triggering unit

It doesn't lag =/ not for me
 

Sim

Forum Administrator
Staff member
Reaction score
534
> Well it's like that only that you can't notice because it makes it fast, very fast actually... going to edit this.

Do as I said: Reduce the repeating timer's duration and reduce the distance.

> It doesn't lag =/ not for me

It doesn't lag for me neither but then again I have a great computer.

Comments coming from more people concerning this lag would be neat.
 

Pyrogasm

There are some who would use any excuse to ban me.
Reaction score
134
0zaru said:
That would be if a use AttachedVars 'cause Tables don't have a call CleanAttachedVars(t), and i think that the things are attached to the table =/
Attachment tables are Attachable Variables.

It even says that DestroyTable is to be used on dynamic tables, but not on Attachment Tables:
CSCache said:
NewTable and DestroyTable were created to allow to create tables in the fly
 

NapaHero

Back from the dead...
Reaction score
43
You should consider the fact that not everyone have a great computer. Can't you spell cause less lag?
 

0zaru

Learning vJASS ;)
Reaction score
60
That's not the problem, the problem is that i don't know how much lag it does for you...
 

NapaHero

Back from the dead...
Reaction score
43
It's not a heavy lag to freeze the game, my luck :rolleyes: But causes the game to run really slow (only during the spell)
 

0zaru

Learning vJASS ;)
Reaction score
60
Update
-Change somethings in Frozen Desire, channel interruptable and some things in damage..
-Iceball a little more smaller, more speed, reduced range..
-Freezing Soul now has some things more (Code improvement with timer and Attack detect system by Emljr3)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top