tuantai120
Cool Member
- Reaction score
- 1
I want to make a spell Ice Wall
but i dont know how to do
but i dont know how to do
JASS:
scope Ice initializer Init
globals
private constant integer SID = 039;A000039;
private constant integer DID = 039;h000039;
private constant integer max = 5
private constant real Distance = 500.
private constant real Life = 5.
endglobals
private constant function Lifes takes integer lvl returns real
return Life*lvl
endfunction
private function Con takes nothing returns boolean
return GetSpellAbilityId() == SID
endfunction
private struct IceData
unit caster
unit dummy
real x
real y
real x2
real y2
integer lvl
timer t
player P
static method take takes unit u returns IceData
local IceData i = IceData.allocate()
set i.caster = u
set i.P = GetOwningPlayer(i.caster)
set i.x = GetUnitX(i.caster)
set i.y = GetUnitY(i.caster)
set i.lvl = 0
set i.dummy = CreateUnit(i.P,DID,i.x,i.y,0.)
return i
endmethod
endstruct
function Act takes nothing returns nothing
endfunction
//===========================================================================
function Init takes nothing returns nothing
local trigger ice = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( ice ,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition( ice , Condition ( function Con) )
call TriggerAddAction( ice , function Act )
endfunction
endscope