- Joined
- May 18, 2009
- Messages
- 30
hello all, i try to make this spell but that not works...
what is wrong? i need to fix this please. Thanks for help
EDIT:i optimized the code but stills not works
JASS:
//This spell pauses all unit within 300/400/500 range
//for 3/4/5 seconds and change his vertex color to Blue.
library ParalizingField
globals
private integer array SPELL_DUR
private integer array SPELL_AOE
private integer AbilityID = 'A000'
endglobals
private function SetUpDuration takes nothing returns nothing
set SPELL_DUR[1] = 3
set SPELL_DUR[2] = 4
set SPELL_DUR[3] = 5
endfunction
private function SetUpSpellAoe takes nothing returns nothing
set SPELL_AOE[1] = 300
set SPELL_AOE[2] = 400
set SPELL_AOE[3] = 500
endfunction
private function Spell_Dur takes integer level returns integer
return SPELL_DUR[level]
endfunction
private function Spell_Aoe takes integer level returns integer
return SPELL_AOE[level]
endfunction
function ParalizingCondition takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A000' ) ) then
return false
endif
return true
endfunction
function CallBack takes nothing returns nothing
call BJDebugMsg(GetUnitName(GetEnumUnit()))
endfunction
function ParalizingField takes nothing returns nothing
local unit e
local group g
local unit u = GetTriggerUnit()
local integer level = GetUnitAbilityLevel (u, AbilityID)
set g = CreateGroup()
call ForGroupBJ( GetUnitsInRangeOfLocAll(300.00, GetUnitLoc(GetTriggerUnit())), function CallBack )
set e = GetEnumUnit()
call GroupAddUnit(g, e)
call PauseUnit(e, true)
call SetUnitVertexColorBJ(e, 0.00, 0.00, 100, 0 )
call TriggerSleepAction(SPELL_DUR[level])
call PauseUnit(e, false)
call SetUnitVertexColorBJ(e, 100, 100, 100, 0 )
call DestroyGroup(g)
set u = null
set e = null
set g = null
endfunction
//===========================================================================
function InitTrig_Paralizing_Field takes nothing returns nothing
set gg_trg_Paralizing_Field = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Paralizing_Field, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Paralizing_Field, Condition( function ParalizingCondition ) )
call TriggerAddAction( gg_trg_Paralizing_Field, function ParalizingField )
endfunction
endlibrary
what is wrong? i need to fix this please. Thanks for help
EDIT:i optimized the code but stills not works
Last edited: