Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scope Ultimate initializer init
- globals
- // Ability Rawcode.
- private constant integer ABIL_ID = 'A000'
- // Tornado Rawcode.
- private constant integer TORNADO_ID = 'h000'
- // Amount of Tornado's created.
- private constant integer MAX_TORNADOS = 6
- // Distance that the Tornado's are created at.
- private constant real TORNADO_OFFSET = 600.00
- // The periodic time to move tornados, and units.
- private constant real PERIODIC = 0.03125
- endglobals
- native IsUnitAlive takes unit whichUnit returns boolean
- private struct Ultimate
- unit caster
- player owner
- integer level
- real casterX
- real casterY
- unit array tornado[MAX_TORNADOS]
- real array tornadoX[MAX_TORNADOS]
- real array tornadoY[MAX_TORNADOS]
- static method onLoop takes nothing returns nothing
- local thistype this = thistype.allocate()
- if (IsUnitAlive(this.caster)) then
- endif
- endmethod
- static method onCreate takes unit whichUnit returns thistype
- local thistype this = thistype.allocate()
- local timer t = NewTimer()
- local integer index = 1
- set this.caster=whichUnit
- set this.owner=GetOwningPlayer(whichUnit)
- set this.level=GetUnitAbilityLevel(whichUnit,ABIL_ID)
- set this.casterX=GetUnitX(whichUnit)
- set this.casterY=GetUnitY(whichUnit)
- loop
- exitwhen index>=MAX_TORNADOS
- set tornado[index]=CreateUnit(this.owner,TORNADO_ID,this.casterX,this.casterY,270.00)
- set index=index+1
- endloop
- call SetTimerData(t,this)
- call TimerStart(t,PERIODIC,true,function thistype.onLoop)
- set t=null
- return this
- endmethod
- endstruct
- private function Actions takes nothing returns boolean
- call Ultimate.onCreate(GetTriggerUnit())
- return false
- endfunction
- private function init takes nothing returns nothing
- local trigger trig = CreateTrigger()
- call GT_RegisterStartsEffectEvent(trig,ABIL_ID)
- call TriggerAddCondition(trig,Condition(function Actions))
- set trig=null
- endfunction
- endscope
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement