Advertisement
Guest User

Untitled

a guest
Sep 13th, 2017
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
J 1.97 KB | None | 0 0
  1. scope Sprout initializer init
  2.     globals
  3.         private constant integer ABIL_ID = 'A000'
  4.         private constant integer TREE_ID = 'LTlt'
  5.         private constant integer AMOUNT = 8
  6.         private constant integer VARIATION = 1
  7.         private constant real ANGLE = 45.00
  8.         private constant real DISTANCE = 275.00
  9.         private constant real SCALE = 1.10
  10.         private constant real DURATION = 2.50
  11.         private constant string EFFECT_ID = "Objects\\Spawnmodels\\NightElf\\EntBirthTarget\\EntBirthTarget.mdl"
  12.     endglobals
  13.    
  14.     private function Conditions takes nothing returns boolean
  15.         return (GetSpellAbilityId()==ABIL_ID)
  16.     endfunction
  17.  
  18.     private function Actions takes nothing returns nothing
  19.         local destructable array d
  20.         local integer index = 1
  21.         local real x
  22.         local real y
  23.         loop
  24.             exitwhen index>=AMOUNT
  25.             set x = GetSpellTargetX()+DISTANCE*Cos(ANGLE*index*bj_DEGTORAD)
  26.             set y = GetSpellTargetY()+DISTANCE*Sin(ANGLE*index*bj_DEGTORAD)
  27.             set d[index]=CreateDestructable(TREE_ID,x,y,0.00,SCALE,VARIATION)
  28.             call DestroyEffect(AddSpecialEffect(EFFECT_ID,x,y))
  29.             set index=index+1
  30.         endloop
  31.         call PolledWait2(DURATION)
  32.         set index=1
  33.         loop
  34.             exitwhen index>=AMOUNT
  35.             call RemoveDestructable(d[1])
  36.             set x = GetSpellTargetX()+DISTANCE*Cos(ANGLE*index*bj_DEGTORAD)
  37.             set y = GetSpellTargetY()+DISTANCE*Sin(ANGLE*index*bj_DEGTORAD)
  38.             call DestroyEffect(AddSpecialEffect(EFFECT_ID,x,y))
  39.             set d[1]=null
  40.             set index=index+1
  41.         endloop
  42.     endfunction
  43.  
  44.     //===========================================================================
  45.     private function init takes nothing returns nothing
  46.         local trigger trig = CreateTrigger()
  47.         call RegisterEventUnit(trig,EVENT_PLAYER_UNIT_SPELL_EFFECT,function Actions,function Conditions,null)
  48.         set trig=null
  49.     endfunction
  50. endscope
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement