- Joined
- May 4, 2007
- Messages
- 2,260
Hi guys. I am trying to create an ice bomb. When it lands it will slow down enemy units caught by it. I found a map made by Emil, Which is posted here.
However, my modifications didn't work very well.
My problem is creating the circle of frosts. It just doesn't create...
I will paste my code here:
Down here you will find the Emil map i talked about.
Plz help. You shall be credited and receive +rep.
However, my modifications didn't work very well.
My problem is creating the circle of frosts. It just doesn't create...
I will paste my code here:
JASS:
function IceBombs_Conditions takes nothing returns boolean
return GetUnitTypeId(GetTriggerUnit()) == 'h00D'
endfunction
//===========================================================================
function IceBombs_Actions takes nothing returns nothing
local unit u = GetTriggerUnit() // the caster
local unit ice // the dummy unit
local integer i = 1 //GetUnitAbilityLevel(u, 'A005') //the level of the ability
local integer l = 4 + i * 1 //Number of nova rings
local integer m = 0 //counts how many rings were created
local integer n = 50 //size of the dummy unit, where the unit will be created, cummulative size
local integer o = 8 + i * 2 //Number of novas per ring
local integer q = 0 //counts how many novas were created
local integer r = 75 + i * 0 //Distance between rings
local integer s = 360 / o
local real T = .07 - i * 0 //Wait between each ring
local location L = GetUnitLoc(u)
local player p = GetOwningPlayer(u)
local group g //group that will select units and damage them
local unit f //first unit of group g
local unit dum
//this main loop counts how many rings were created
loop
set m = m + 1
exitwhen m > l
//This secondary loop counts how many ice effects exist per ring
loop
set q = q + 1
exitwhen q > o
set ice = CreateUnitAtLoc(p, 'h00B', PolarProjectionBJ(L, n, ( s * I2R(q) )), bj_UNIT_FACING )
call UnitApplyTimedLife( dum, 'BTLF', 1.00 )
//this loop selects units near the ice effect and damages them
set g = CreateGroup()
call GroupEnumUnitsInRange(g, GetUnitX( dum ), GetUnitY( dum ), 50, Filter(null) )
loop
set f = FirstOfGroup(g)
exitwhen (f == null)
call GroupRemoveUnit(g, f)
set dum = CreateUnit(p, 'h007', GetUnitX(f), GetUnitY(f), 0.0)
call UnitAddAbility(dum, 'A00C')
call IssueTargetOrder(dum, "frostnova", f)
call UnitApplyTimedLife(dum, 'BTLF', 1.0)
endloop
call DestroyGroup(g)
//end of selections and damaging part
endloop
call TriggerSleepAction( T )
set q = 0
set n = n + r
endloop
call RemoveLocation(L)
set L = null
set u = null
set ice = null
set g = null
set p = null
endfunction
//===========================================================================
function InitTrig_Ice_Bombs takes nothing returns nothing
set gg_trg_Ice_Bombs = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Ice_Bombs, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_Ice_Bombs, Condition( function IceBombs_Conditions ) )
call TriggerAddAction( gg_trg_Ice_Bombs, function IceBombs_Actions )
endfunction
Down here you will find the Emil map i talked about.
Plz help. You shall be credited and receive +rep.