Tom_Kazansky
--- wraith it ! ---
- Reaction score
- 157
Frozen Orb
There is Frozen Orb made by Flare (right ?), but I made this because someone request me to.
MUI: yes
Lagless: maybe
Leakless: (I think)
vJass
------------------------
Description:
Creates a globe of frozen death that spreads out ice bolts.
Screenshot
Code
(non Safe XY )
JASS:
scope FrozenOrb initializer Init
globals
private constant integer AbilID = 039;A000039; //raw id of the Frozen Orb ability
private constant integer IceID = 039;A001039; //raw id of the Frozen Orb Slow and Damage ability
private constant string IceOrder = "frostnova" //order string of the Frozen Orb Slow and Damage ability
private constant integer DummyId = 039;n000039; //dummy unit's raw id (caster)
private constant integer OrbId = 039;n001039; //raw id of the Frozen Orb dummy
private constant integer BoltId = 039;n002039; //raw id of the Ice Bolt dummy
private constant real OrbHitRange = 150. //when a unit comes within this range of the Orb, it will spread out more ice bolts
private constant real OrbSpeed = 500 // speed of the Frozen Orb
private constant real BoltHitRange = 50. //when a unit comes within this range of the ice bolt, it got hit.
private constant real BoltSpeed = 1000 // speed of the Ice Bolts
private constant string SOUNDPATH = "Abilities\\Spells\\Human\\Blizzard\\BlizzardLoop1.wav" //sound which is played during the spell
endglobals
//=======================
private function GetIceBoltDist takes integer lvl returns real
return 750.
endfunction
private function GetOrbDist takes integer lvl returns real
return 1000.
endfunction
//==== Do not modify anything below ====
//=============================
private struct dataI
unit c
unit d
integer lvl
integer tick
real angle
real speed
endstruct
//=============================
private struct data
unit c
unit d1
unit d2
unit d3
group hit
sound bliz
real dx
real dy
real df
integer lvl
real speed
real angle
real shootAngle
integer tick = 40
integer tks = 0
endstruct
globals
private group ENUMER = CreateGroup()
private data array ORBDATA
private integer ORBDATACOUNT = -1
private dataI array BOLTDATA
private integer BOLTDATACOUNT = -1
private integer TEMPINT
endglobals
private function GetPPX takes real x, real dist, real angle returns real
return x + dist * Cos(angle * bj_DEGTORAD)
endfunction
private function GetPPY takes real y, real dist, real angle returns real
return y + dist * Sin(angle * bj_DEGTORAD)
endfunction
private function SetUnitZ takes unit u, real h returns nothing
call UnitAddAbility( u , 039;Amrf039;)
call UnitRemoveAbility( u , 039;Amrf039; )
call SetUnitFlyHeight( u , h, 0. )
endfunction
private function AngleLocXY takes real x1, real y1, real x2, real y2 returns real
return bj_RADTODEG * Atan2(y2 - y1, x2 - x1)
endfunction
private function IceBoltF takes nothing returns boolean
local dataI d = TEMPINT
local unit a = GetFilterUnit()
local boolean ok = false
if IsUnitInRange(a,d.d,BoltHitRange) then
if GetWidgetLife(a) > 0.405 then
if IsUnitEnemy(a,GetOwningPlayer(d.c)) then
if IsUnitType(a,UNIT_TYPE_STRUCTURE) == false then
if IsUnitType(a,UNIT_TYPE_MAGIC_IMMUNE) == false then
set ok = true
endif
endif
endif
endif
endif
set a = null
return ok
endfunction
private function IceBoltM takes dataI d returns boolean
local boolexpr bx
local unit a
local unit c
set d.tick = d.tick - 1
if d.tick == 0 then
call KillUnit(d.d)
return true
endif
set TEMPINT = d
call GroupEnumUnitsInRange( ENUMER, GetUnitX(d.d), GetUnitY(d.d) , BoltHitRange + 100 , Condition( function IceBoltF ) )
set a = FirstOfGroup(ENUMER)
call GroupClear(ENUMER)
if a != null then
set c = CreateUnit(GetOwningPlayer(d.c),DummyId,GetUnitX(a),GetUnitY(a),0. )
call UnitApplyTimedLife(c,039;BTLF039;,0.5)
call UnitAddAbility(c, IceID )
call SetUnitAbilityLevel(c, IceID, d.lvl)
call IssueTargetOrder(c,IceOrder,a)
set c = null
set a = null
call KillUnit(d.d)
return true
endif
call SetUnitX( d.d, GetPPX(GetUnitX(d.d),d.speed, d.angle ) )
call SetUnitY( d.d, GetPPY(GetUnitY(d.d),d.speed, d.angle ) )
return false
endfunction
private function IceBolt takes unit c, integer lvl, real x, real y, real f returns nothing
set BOLTDATACOUNT = BOLTDATACOUNT + 1
set BOLTDATA[BOLTDATACOUNT] = dataI.create()
set BOLTDATA[BOLTDATACOUNT].c = c
set BOLTDATA[BOLTDATACOUNT].d = CreateUnit( GetOwningPlayer(c), BoltId , x, y, f )
call SetUnitZ( BOLTDATA[BOLTDATACOUNT].d , 125. )
set BOLTDATA[BOLTDATACOUNT].lvl = lvl
set BOLTDATA[BOLTDATACOUNT].angle = f
set BOLTDATA[BOLTDATACOUNT].speed = BoltSpeed / 25.
set BOLTDATA[BOLTDATACOUNT].tick = R2I(GetIceBoltDist( lvl ) / BOLTDATA[BOLTDATACOUNT].speed)
endfunction
//=============================
private function OrbF takes nothing returns boolean
local data d = TEMPINT
local unit a = GetFilterUnit()
local boolean ok = false
if IsUnitInRangeXY(a,d.dx,d.dy,OrbHitRange) then
if not IsUnitInGroup(a,d.hit) then
if GetWidgetLife(a) > 0.405 then
if IsUnitEnemy(a,GetOwningPlayer(d.c)) then
if IsUnitType(a,UNIT_TYPE_STRUCTURE) == false then
if IsUnitType(a,UNIT_TYPE_MAGIC_IMMUNE) == false then
set ok = true
endif
endif
endif
endif
endif
endif
set a = null
return ok
endfunction
private function ActE takes data d returns boolean
local integer i = 0
local unit a
local unit c
local real dx
local real dy
set d.tick = d.tick - 1
if d.tick == 0 then
call StopSound( d.bliz, true, false )
call SetUnitX(d.d1,d.dx)
call SetUnitX(d.d2,d.dx)
call SetUnitX(d.d3,d.dx)
call SetUnitY(d.d1,d.dy)
call SetUnitY(d.d2,d.dy)
call SetUnitY(d.d3,d.dy)
call KillUnit(d.d1)
call KillUnit(d.d2)
call KillUnit(d.d3)
loop
exitwhen i > 11
call IceBolt( d.c, d.lvl, GetPPX(d.dx,50.,i*30), GetPPY(d.dy,50.,i*30), i*30. + 90. )
set i = i + 1
endloop
call DestroyGroup(d.hit)
return true
endif
set d.df = d.df + 5
set d.dx = GetPPX( d.dx, d.speed, d.angle )
set d.dy = GetPPY( d.dy, d.speed, d.angle )
call SetSoundPosition(d.bliz, d.dx, d.dy, 0 )
call SetUnitX(d.d1,GetPPX(d.dx,-75,d.df))
call SetUnitY(d.d1,GetPPY(d.dy,-75,d.df))
call SetUnitFacing(d.d1,d.df)
call SetUnitX(d.d2,GetPPX(d.dx,-75,d.df+120.))
call SetUnitY(d.d2,GetPPY(d.dy,-75,d.df+120.))
call SetUnitFacing(d.d2,d.df+120.)
call SetUnitX(d.d3,GetPPX(d.dx,-75,d.df+240.))
call SetUnitY(d.d3,GetPPY(d.dy,-75,d.df+240.))
call SetUnitFacing(d.d3,d.df+240.)
set TEMPINT = d
call GroupEnumUnitsInRange( ENUMER, d.dx, d.dy , OrbHitRange + 100 , Condition( function OrbF ) )
set a = FirstOfGroup(ENUMER)
call GroupClear(ENUMER)
if a != null then
call GroupAddUnit(d.hit,a)
loop
exitwhen i > 11
call IceBolt( d.c, d.lvl, GetPPX(d.dx,50.,i*30), GetPPY(d.dy,50.,i*30), i*30. + 90. )
set i = i + 1
endloop
set a = null
endif
if d.tks == 0 then
set dx = GetPPX( d.dx, 50., d.shootAngle)
set dy = GetPPY( d.dy, 50., d.shootAngle)
call IceBolt( d.c, d.lvl, dx, dy, d.shootAngle + 90 )
set dx = GetPPX( d.dx, 50., d.shootAngle+180.)
set dy = GetPPY( d.dy, 50., d.shootAngle+180.)
call IceBolt( d.c, d.lvl, dx, dy, d.shootAngle + 180. + 90 )
set d.shootAngle = d.shootAngle + (30. + 15 * GetRandomInt(0,1))
set d.tks = 3
endif
set d.tks = d.tks - 1
return false
endfunction
private function Act takes nothing returns nothing
local location loc = GetSpellTargetLoc()
set ORBDATACOUNT = ORBDATACOUNT + 1
set ORBDATA[ORBDATACOUNT] = data.create()
set ORBDATA[ORBDATACOUNT].c = GetTriggerUnit()
set ORBDATA[ORBDATACOUNT].lvl = GetUnitAbilityLevel(ORBDATA[ORBDATACOUNT].c,AbilID)
set ORBDATA[ORBDATACOUNT].dx = GetUnitX(ORBDATA[ORBDATACOUNT].c)
set ORBDATA[ORBDATACOUNT].dy = GetUnitY(ORBDATA[ORBDATACOUNT].c)
set ORBDATA[ORBDATACOUNT].df = AngleLocXY( ORBDATA[ORBDATACOUNT].dx, ORBDATA[ORBDATACOUNT].dy, GetLocationX(loc), GetLocationY(loc) )
set ORBDATA[ORBDATACOUNT].d1 = CreateUnit( GetOwningPlayer(ORBDATA[ORBDATACOUNT].c),OrbId,ORBDATA[ORBDATACOUNT].dx, ORBDATA[ORBDATACOUNT].dy, ORBDATA[ORBDATACOUNT].df )
call SetUnitZ(ORBDATA[ORBDATACOUNT].d1,100. )
set ORBDATA[ORBDATACOUNT].d2 = CreateUnit( GetOwningPlayer(ORBDATA[ORBDATACOUNT].c),OrbId,ORBDATA[ORBDATACOUNT].dx, ORBDATA[ORBDATACOUNT].dy, ORBDATA[ORBDATACOUNT].df+120 )
call SetUnitZ(ORBDATA[ORBDATACOUNT].d2,100. )
set ORBDATA[ORBDATACOUNT].d3 = CreateUnit( GetOwningPlayer(ORBDATA[ORBDATACOUNT].c),OrbId,ORBDATA[ORBDATACOUNT].dx, ORBDATA[ORBDATACOUNT].dy, ORBDATA[ORBDATACOUNT].df+240 )
call SetUnitZ(ORBDATA[ORBDATACOUNT].d3,100. )
set ORBDATA[ORBDATACOUNT].speed = OrbSpeed / 25.
set ORBDATA[ORBDATACOUNT].angle = ORBDATA[ORBDATACOUNT].df
set ORBDATA[ORBDATACOUNT].tick = R2I( GetOrbDist(ORBDATA[ORBDATACOUNT].lvl) / ORBDATA[ORBDATACOUNT].speed )
set ORBDATA[ORBDATACOUNT].shootAngle = ORBDATA[ORBDATACOUNT].angle
set ORBDATA[ORBDATACOUNT].bliz = CreateSound(SOUNDPATH,true,true,true,12700, 12700, "")
call SetSoundPosition(ORBDATA[ORBDATACOUNT].bliz, ORBDATA[ORBDATACOUNT].dx, ORBDATA[ORBDATACOUNT].dy, 0 )
call SetSoundVolume(ORBDATA[ORBDATACOUNT].bliz,127)
call StartSound(ORBDATA[ORBDATACOUNT].bliz)
set ORBDATA[ORBDATACOUNT].hit = CreateGroup()
call RemoveLocation( loc )
set loc = null
endfunction
private function Time takes nothing returns nothing
local integer i = 0
local integer j
local boolean stop
loop
exitwhen i > ORBDATACOUNT
set stop = ActE(ORBDATA<i>)
if stop then
call ORBDATA<i>.destroy()
if i < ORBDATACOUNT then
set ORBDATA<i> = ORBDATA[ORBDATACOUNT]
endif
set ORBDATACOUNT = ORBDATACOUNT - 1
set i = i - 1
endif
set i = i + 1
endloop
set i = 0
loop
exitwhen i > BOLTDATACOUNT
set stop = IceBoltM(BOLTDATA<i>)
if stop then
call BOLTDATA<i>.destroy()
if i < BOLTDATACOUNT then
set BOLTDATA<i> = BOLTDATA[BOLTDATACOUNT]
endif
set BOLTDATACOUNT = BOLTDATACOUNT - 1
set i = i - 1
endif
set i = i + 1
endloop
endfunction
private function Cond takes nothing returns boolean
return GetSpellAbilityId() == AbilID
endfunction
public function Init takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( t, function Act )
call TriggerAddCondition( t, Condition ( function Cond ) )
set t = CreateTrigger( )
call TriggerRegisterTimerEvent(t,0.04, true )
call TriggerAddAction( t, function Time )
endfunction
endscope</i></i></i></i></i></i>
(Safe XY)
JASS:
scope FrozenOrb initializer Init
globals
private constant integer AbilID = 039;A000039; //raw id of the Frozen Orb ability
private constant integer IceID = 039;A001039; //raw id of the Frozen Orb Slow and Damage ability
private constant string IceOrder = "frostnova" //order string of the Frozen Orb Slow and Damage ability
private constant integer DummyId = 039;n000039; //dummy unit's raw id (caster)
private constant integer OrbId = 039;n001039; //raw id of the Frozen Orb dummy
private constant integer BoltId = 039;n002039; //raw id of the Ice Bolt dummy
private constant real OrbHitRange = 150. //when a unit comes within this range of the Orb, it will spread out more ice bolts
private constant real OrbSpeed = 500 // speed of the Frozen Orb
private constant real BoltHitRange = 50. //when a unit comes within this range of the ice bolt, it got hit.
private constant real BoltSpeed = 1000 // speed of the Ice Bolts
private constant string SOUNDPATH = "Abilities\\Spells\\Human\\Blizzard\\BlizzardLoop1.wav" //sound which is played during the spell
endglobals
//=======================
private function GetIceBoltDist takes integer lvl returns real
return 750.
endfunction
private function GetOrbDist takes integer lvl returns real
return 1000.
endfunction
//==== Do not modify anything below ====
//=============================
private struct dataI
unit c
unit d
integer lvl
integer tick
real angle
real speed
endstruct
//=============================
private struct data
unit c
unit d1
unit d2
unit d3
group hit
sound bliz
real dx
real dy
real df
integer lvl
real speed
real angle
real shootAngle
integer tick = 40
integer tks = 0
endstruct
globals
private group ENUMER = CreateGroup()
private real MAPMIN_X
private real MAPMAX_X
private real MAPMIN_Y
private real MAPMAX_Y
private data array ORBDATA
private integer ORBDATACOUNT = -1
private dataI array BOLTDATA
private integer BOLTDATACOUNT = -1
private integer TEMPINT
endglobals
private function CheckSafeX takes real x returns real
if x>MAPMAX_X then
return MAPMAX_X
endif
if x<MAPMIN_X then
return MAPMIN_X
endif
return x
endfunction
private function CheckSafeY takes real y returns real
if y>MAPMAX_Y then
return MAPMAX_Y
endif
if y<MAPMIN_Y then
return MAPMIN_Y
endif
return y
endfunction
private function GetPPX takes real x, real dist, real angle returns real
return x + dist * Cos(angle * bj_DEGTORAD)
endfunction
private function GetPPY takes real y, real dist, real angle returns real
return y + dist * Sin(angle * bj_DEGTORAD)
endfunction
private function SetUnitZ takes unit u, real h returns nothing
call UnitAddAbility( u , 039;Amrf039;)
call UnitRemoveAbility( u , 039;Amrf039; )
call SetUnitFlyHeight( u , h, 0. )
endfunction
private function AngleLocXY takes real x1, real y1, real x2, real y2 returns real
return bj_RADTODEG * Atan2(y2 - y1, x2 - x1)
endfunction
private function IceBoltF takes nothing returns boolean
local dataI d = TEMPINT
local unit a = GetFilterUnit()
local boolean ok = false
if IsUnitInRange(a,d.d,BoltHitRange) then
if GetWidgetLife(a) > 0.405 then
if IsUnitEnemy(a,GetOwningPlayer(d.c)) then
if IsUnitType(a,UNIT_TYPE_STRUCTURE) == false then
if IsUnitType(a,UNIT_TYPE_MAGIC_IMMUNE) == false then
set ok = true
endif
endif
endif
endif
endif
set a = null
return ok
endfunction
private function IceBoltM takes dataI d returns boolean
local boolexpr bx
local unit a
local unit c
set d.tick = d.tick - 1
if d.tick == 0 then
call KillUnit(d.d)
return true
endif
set TEMPINT = d
call GroupEnumUnitsInRange( ENUMER, GetUnitX(d.d), GetUnitY(d.d) , BoltHitRange + 100 , Condition( function IceBoltF ) )
set a = FirstOfGroup(ENUMER)
call GroupClear(ENUMER)
if a != null then
set c = CreateUnit(GetOwningPlayer(d.c),DummyId,GetUnitX(a),GetUnitY(a),0. )
call UnitApplyTimedLife(c,039;BTLF039;,0.5)
call UnitAddAbility(c, IceID )
call SetUnitAbilityLevel(c, IceID, d.lvl)
call IssueTargetOrder(c,IceOrder,a)
set c = null
set a = null
call KillUnit(d.d)
return true
endif
call SetUnitX( d.d, CheckSafeX(GetPPX(GetUnitX(d.d),d.speed, d.angle )) )
call SetUnitY( d.d, CheckSafeY(GetPPY(GetUnitY(d.d),d.speed, d.angle ) ) )
return false
endfunction
private function IceBolt takes unit c, integer lvl, real x, real y, real f returns nothing
set BOLTDATACOUNT = BOLTDATACOUNT + 1
set BOLTDATA[BOLTDATACOUNT] = dataI.create()
set BOLTDATA[BOLTDATACOUNT].c = c
set BOLTDATA[BOLTDATACOUNT].d = CreateUnit( GetOwningPlayer(c), BoltId , x, y, f )
call SetUnitZ( BOLTDATA[BOLTDATACOUNT].d , 125. )
set BOLTDATA[BOLTDATACOUNT].lvl = lvl
set BOLTDATA[BOLTDATACOUNT].angle = f
set BOLTDATA[BOLTDATACOUNT].speed = BoltSpeed / 25.
set BOLTDATA[BOLTDATACOUNT].tick = R2I(GetIceBoltDist( lvl ) / BOLTDATA[BOLTDATACOUNT].speed)
endfunction
//=============================
private function OrbF takes nothing returns boolean
local data d = TEMPINT
local unit a = GetFilterUnit()
local boolean ok = false
if IsUnitInRangeXY(a,d.dx,d.dy,OrbHitRange) then
if not IsUnitInGroup(a,d.hit) then
if GetWidgetLife(a) > 0.405 then
if IsUnitEnemy(a,GetOwningPlayer(d.c)) then
if IsUnitType(a,UNIT_TYPE_STRUCTURE) == false then
if IsUnitType(a,UNIT_TYPE_MAGIC_IMMUNE) == false then
set ok = true
endif
endif
endif
endif
endif
endif
set a = null
return ok
endfunction
private function ActE takes data d returns boolean
local integer i = 0
local unit a
local unit c
local real dx
local real dy
set d.tick = d.tick - 1
if d.tick == 0 then
call StopSound( d.bliz, true, false )
call SetUnitX(d.d1,d.dx)
call SetUnitX(d.d2,d.dx)
call SetUnitX(d.d3,d.dx)
call SetUnitY(d.d1,d.dy)
call SetUnitY(d.d2,d.dy)
call SetUnitY(d.d3,d.dy)
call KillUnit(d.d1)
call KillUnit(d.d2)
call KillUnit(d.d3)
loop
exitwhen i > 11
call IceBolt( d.c, d.lvl, GetPPX(d.dx,50.,i*30), GetPPY(d.dy,50.,i*30), i*30. + 90. )
set i = i + 1
endloop
call DestroyGroup(d.hit)
return true
endif
set d.df = d.df + 5
set d.dx = CheckSafeX(GetPPX( d.dx, d.speed, d.angle ))
set d.dy = CheckSafeY(GetPPY( d.dy, d.speed, d.angle ))
call SetSoundPosition(d.bliz, d.dx, d.dy, 0 )
call SetUnitX(d.d1,GetPPX(d.dx,-75,d.df))
call SetUnitY(d.d1,GetPPY(d.dy,-75,d.df))
call SetUnitFacing(d.d1,d.df)
call SetUnitX(d.d2,GetPPX(d.dx,-75,d.df+120.))
call SetUnitY(d.d2,GetPPY(d.dy,-75,d.df+120.))
call SetUnitFacing(d.d2,d.df+120.)
call SetUnitX(d.d3,GetPPX(d.dx,-75,d.df+240.))
call SetUnitY(d.d3,GetPPY(d.dy,-75,d.df+240.))
call SetUnitFacing(d.d3,d.df+240.)
set TEMPINT = d
call GroupEnumUnitsInRange( ENUMER, d.dx, d.dy , OrbHitRange + 100 , Condition( function OrbF ) )
set a = FirstOfGroup(ENUMER)
call GroupClear(ENUMER)
if a != null then
call GroupAddUnit(d.hit,a)
loop
exitwhen i > 11
call IceBolt( d.c, d.lvl, GetPPX(d.dx,50.,i*30), GetPPY(d.dy,50.,i*30), i*30. + 90. )
set i = i + 1
endloop
set a = null
endif
if d.tks == 0 then
set dx = GetPPX( d.dx, 50., d.shootAngle)
set dy = GetPPY( d.dy, 50., d.shootAngle)
call IceBolt( d.c, d.lvl, dx, dy, d.shootAngle + 90 )
set dx = GetPPX( d.dx, 50., d.shootAngle+180.)
set dy = GetPPY( d.dy, 50., d.shootAngle+180.)
call IceBolt( d.c, d.lvl, dx, dy, d.shootAngle + 180. + 90 )
set d.shootAngle = d.shootAngle + (30. + 15 * GetRandomInt(0,1))
set d.tks = 3
endif
set d.tks = d.tks - 1
return false
endfunction
private function Act takes nothing returns nothing
local location loc = GetSpellTargetLoc()
set ORBDATACOUNT = ORBDATACOUNT + 1
set ORBDATA[ORBDATACOUNT] = data.create()
set ORBDATA[ORBDATACOUNT].c = GetTriggerUnit()
set ORBDATA[ORBDATACOUNT].lvl = GetUnitAbilityLevel(ORBDATA[ORBDATACOUNT].c,AbilID)
set ORBDATA[ORBDATACOUNT].dx = GetUnitX(ORBDATA[ORBDATACOUNT].c)
set ORBDATA[ORBDATACOUNT].dy = GetUnitY(ORBDATA[ORBDATACOUNT].c)
set ORBDATA[ORBDATACOUNT].df = AngleLocXY( ORBDATA[ORBDATACOUNT].dx, ORBDATA[ORBDATACOUNT].dy, GetLocationX(loc), GetLocationY(loc) )
set ORBDATA[ORBDATACOUNT].d1 = CreateUnit( GetOwningPlayer(ORBDATA[ORBDATACOUNT].c),OrbId,ORBDATA[ORBDATACOUNT].dx, ORBDATA[ORBDATACOUNT].dy, ORBDATA[ORBDATACOUNT].df )
call SetUnitZ(ORBDATA[ORBDATACOUNT].d1,100. )
set ORBDATA[ORBDATACOUNT].d2 = CreateUnit( GetOwningPlayer(ORBDATA[ORBDATACOUNT].c),OrbId,ORBDATA[ORBDATACOUNT].dx, ORBDATA[ORBDATACOUNT].dy, ORBDATA[ORBDATACOUNT].df+120 )
call SetUnitZ(ORBDATA[ORBDATACOUNT].d2,100. )
set ORBDATA[ORBDATACOUNT].d3 = CreateUnit( GetOwningPlayer(ORBDATA[ORBDATACOUNT].c),OrbId,ORBDATA[ORBDATACOUNT].dx, ORBDATA[ORBDATACOUNT].dy, ORBDATA[ORBDATACOUNT].df+240 )
call SetUnitZ(ORBDATA[ORBDATACOUNT].d3,100. )
set ORBDATA[ORBDATACOUNT].speed = OrbSpeed / 25.
set ORBDATA[ORBDATACOUNT].angle = ORBDATA[ORBDATACOUNT].df
set ORBDATA[ORBDATACOUNT].tick = R2I( GetOrbDist(ORBDATA[ORBDATACOUNT].lvl) / ORBDATA[ORBDATACOUNT].speed )
set ORBDATA[ORBDATACOUNT].shootAngle = ORBDATA[ORBDATACOUNT].angle
set ORBDATA[ORBDATACOUNT].bliz = CreateSound(SOUNDPATH,true,true,true,12700, 12700, "")
call SetSoundPosition(ORBDATA[ORBDATACOUNT].bliz, ORBDATA[ORBDATACOUNT].dx, ORBDATA[ORBDATACOUNT].dy, 0 )
call SetSoundVolume(ORBDATA[ORBDATACOUNT].bliz,127)
call StartSound(ORBDATA[ORBDATACOUNT].bliz)
set ORBDATA[ORBDATACOUNT].hit = CreateGroup()
call RemoveLocation( loc )
set loc = null
endfunction
private function Time takes nothing returns nothing
local integer i = 0
local integer j
local boolean stop
loop
exitwhen i > ORBDATACOUNT
set stop = ActE(ORBDATA<i>)
if stop then
call ORBDATA<i>.destroy()
if i < ORBDATACOUNT then
set ORBDATA<i> = ORBDATA[ORBDATACOUNT]
endif
set ORBDATACOUNT = ORBDATACOUNT - 1
set i = i - 1
endif
set i = i + 1
endloop
set i = 0
loop
exitwhen i > BOLTDATACOUNT
set stop = IceBoltM(BOLTDATA<i>)
if stop then
call BOLTDATA<i>.destroy()
if i < BOLTDATACOUNT then
set BOLTDATA<i> = BOLTDATA[BOLTDATACOUNT]
endif
set BOLTDATACOUNT = BOLTDATACOUNT - 1
set i = i - 1
endif
set i = i + 1
endloop
endfunction
private function Cond takes nothing returns boolean
return GetSpellAbilityId() == AbilID
endfunction
public function Init takes nothing returns nothing
local trigger t = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( t, function Act )
call TriggerAddCondition( t, Condition ( function Cond ) )
set t = CreateTrigger( )
call TriggerRegisterTimerEvent(t,0.04, true )
call TriggerAddAction( t, function Time )
set MAPMAX_X = GetRectMaxX(bj_mapInitialPlayableArea)
set MAPMAX_Y = GetRectMaxY(bj_mapInitialPlayableArea)
set MAPMIN_X = GetRectMinX(bj_mapInitialPlayableArea)
set MAPMIN_Y = GetRectMinY(bj_mapInitialPlayableArea)
endfunction
endscope</i></i></i></i></i></i>
------------------------
Implementation Instructions
- Copy ability: Frozen Orb ( A000 ) and Frozen Orb- Slow & Damage ( A001 )
- Copy dummy unit: Dummy Unit (n000), Dummy Unit - Frozen Orb (n001), Dummy Unit - Ice Bolt (n002)
- Copy trigger FrozenOrb, change raw id and some other data.
------------------------
Credit:
- thanks Tinki3 for the Test map Template
-------
EDIT: 7th update !