Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scope Sprout initializer init
- globals
- private constant integer ABIL_ID = 'A000'
- private constant integer TREE_ID = 'LTlt'
- private constant integer AMOUNT = 8
- private constant integer VARIATION = 1
- private constant real ANGLE = 45.00
- private constant real DISTANCE = 275.00
- private constant real SCALE = 1.10
- private constant real DURATION = 2.50
- private constant string EFFECT_ID = "Objects\\Spawnmodels\\NightElf\\EntBirthTarget\\EntBirthTarget.mdl"
- endglobals
- private function Conditions takes nothing returns boolean
- return (GetSpellAbilityId()==ABIL_ID)
- endfunction
- private function Actions takes nothing returns nothing
- local destructable array d
- local integer index = 1
- local real x
- local real y
- loop
- exitwhen index>=AMOUNT
- set x = GetSpellTargetX()+DISTANCE*Cos(ANGLE*index*bj_DEGTORAD)
- set y = GetSpellTargetY()+DISTANCE*Sin(ANGLE*index*bj_DEGTORAD)
- set d[index]=CreateDestructable(TREE_ID,x,y,0.00,SCALE,VARIATION)
- call DestroyEffect(AddSpecialEffect(EFFECT_ID,x,y))
- set index=index+1
- endloop
- call PolledWait2(DURATION)
- set index=1
- loop
- exitwhen index>=AMOUNT
- call RemoveDestructable(d[1])
- set x = GetSpellTargetX()+DISTANCE*Cos(ANGLE*index*bj_DEGTORAD)
- set y = GetSpellTargetY()+DISTANCE*Sin(ANGLE*index*bj_DEGTORAD)
- call DestroyEffect(AddSpecialEffect(EFFECT_ID,x,y))
- set d[1]=null
- set index=index+1
- endloop
- endfunction
- //===========================================================================
- private function init takes nothing returns nothing
- local trigger trig = CreateTrigger()
- call RegisterEventUnit(trig,EVENT_PLAYER_UNIT_SPELL_EFFECT,function Actions,function Conditions,null)
- set trig=null
- endfunction
- endscope
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement