# T o u h o u D a n m a k u f u [ S i n g l e ] 
 
 # S c r i p t V e r s i o n [ 3 ] 
 
 # T i t l e [ " D j   s p e l l   0 4   h a r d " ] 
 
 # T e x t [ " D j   s p e l l   0 4   h a r d " ] 
 
 
 
 / /   v a r s 
 
 l e t   g r a m S p e e d   =   0 ; 	 	 	 	 	 / /   s p e e d   o f   t h e   r e c o r d 
 
 l e t   a r m D r a a i   =   2 7 0 ; 	 	 	 	 	 / /   s t a r t i n g   p o s i t i o n   o f   t h e   a r m 
 
 l e t   a r m F r a m e   =   0 ; 
 
 l e t   s t i c k y   =   t r u e ; 
 
 
 
 l e t   a r m O b j   =   O b j P r i m _ C r e a t e ( O B J _ S P R I T E _ 2 D ) ; 
 
 l e t   n e e d l e O b j   =   O b j P r i m _ C r e a t e ( O B J _ S P R I T E _ 2 D ) ; 
 
 	 
 
 / /   t e x 
 
 l e t   g r a m T e x   =   " s c r i p t / t h d c s / s y s t e m / e n m 0 3 / g r a m b g . p n g " ; 
 
 l e t   a r m T e x   =   " s c r i p t / t h d c s / s y s t e m / e n m 0 3 / g r a m a r m . p n g " ; 
 
 
 
 # i n c l u d e   " s c r i p t / t h d c s / s y s t e m / s h o t l i b r a r y . t x t " 
 
 # i n c l u d e   " s c r i p t / t h d c s / f u n c t i o n s / f u n c t i o n _ c o m m o n . t x t " 
 
 # i n c l u d e   " s c r i p t / t h d c s / f u n c t i o n s / f u n c t i o n _ g l o b a l . t x t " 
 
 # i n c l u d e   " s c r i p t / t h d c s / f u n c t i o n s / f u n c t i o n _ b o s s e f f . t x t " 
 
 
 
 @ I n i t i a l i z e   { 
 
 	 S e t C o m m o n D a t a ( " s p e l l S c r i p t I D " , G e t O w n S c r i p t I D ) ; 
 
 	 r e n d e r B o s s ( 3 ) ; 
 
 	 s e t A u r a ( b o s s O b j , 6 4 , 2 5 5 , 1 2 8 ) ; 
 
 	 S e t C o m m o n D a t a ( " b o s s C i r c l e T y p e " , 3 ) ; 
 
 	 S e t C o m m o n D a t a ( " b o s s A t t a c k T y p e " , 2 ) ; 
 
 	 S e t C o m m o n D a t a ( " b o s s B g T y p e " , 3 ) ; 
 
 	 i f ( G e t A r e a C o m m o n D a t a ( " s y s t e m " , " g a m e L a n g " , 0 )   = =   0 )   {   S e t C o m m o n D a t a ( " c a r d N a m e " , " bϑ 00⎍Q
0" ) ;   }   
 
 	 i f ( G e t A r e a C o m m o n D a t a ( " s y s t e m " , " g a m e L a n g " , 0 )   = =   1 )   {   S e t C o m m o n D a t a ( " c a r d N a m e " , " S k i l l   0R e v e r s e   t i m e 
0" ) ;   }   	 
 
 	 O b j E n e m y _ S e t D a m a g e R a t e ( b o s s O b j , 0 , 0 ) ; 
 
 	 O b j M o v e _ S e t D e s t A t S p e e d ( b o s s O b j , G e t C e n t e r X , 1 0 0 , 5 ) ; 	 
 
 
 
 	 S e t A u t o D e l e t e O b j e c t ( t r u e ) ; 
 
 	 S e t S h o t A u t o D e l e t e C l i p ( 1 6 , 1 6 , 1 6 , 1 6 ) ; 
 
 	 m a i n T a s k ; 
 
 }   
 
 
 
 @ E v e n t   {   
 
 	 a l t e r n a t i v e ( G e t E v e n t T y p e ( ) )   
 
 	 c a s e ( E V _ R E Q U E S T _ L I F E )   {   
 
 	 	 S e t S c r i p t R e s u l t ( 4 0 0 ) ; 
 
 	 } 
 
 	 c a s e ( E V _ R E Q U E S T _ T I M E R )   {   
 
 	 	 S e t S c r i p t R e s u l t ( 4 0 ) ; 
 
 	 } 	 
 
 	 c a s e ( E V _ R E Q U E S T _ I S _ D U R A B L E _ S P E L L )   { 
 
 	 	 S e t S c r i p t R e s u l t ( t r u e ) ; 
 
 	 } 
 
 	 c a s e ( E V _ R E Q U E S T _ S P E L L _ S C O R E )   { 
 
 	         l e t   s p e l l C a r d B o n u s   =   c a l c u l a t e A n d G e t S p e l l C a r d B o n u s ( ) ; 
 
 	 	 S e t S c r i p t R e s u l t ( s p e l l C a r d B o n u s ) ; 
 
 	 } 	 
 
 	 c a s e ( E V _ U S E R + 9 9 9 9 )   { 
 
 	 	 S e t C o m m o n D a t a ( " s p e l l c a r d I D " , " d j 0 4 h a r d " ) ;   
 
 	 } 
 
 }   
 
 
 
 @ M a i n L o o p   {   y i e l d ;   }   
 
 @ F i n a l i z e   {   }   
 
 
 
 
 
 t a s k   m a i n T a s k   {   
 
 	 y i e l d ; 
 
 	 s c r i p t E n d i n g ; 
 
 	 w a i t ( 1 2 0 ) ; 
 
 	 O b j M o v e _ S e t D e s t A t S p e e d ( b o s s O b j , G e t C e n t e r X , G e t C e n t e r Y , 3 ) ; 	 
 
 	 e x p l o E f f e c t ( b o s s X , b o s s X , 4 , 3 ) ; 	 	 
 
 	 g r a m F a m ( G e t C e n t e r X , G e t C e n t e r Y ) ; 
 
 	 g r a m F a m A r m ( G e t C l i p M i n X + 9 6 , G e t C l i p M i n Y ) ; 
 
 	 g r a m N e e d l e ( G e t C e n t e r X , G e t C e n t e r Y ) ; 	 
 
 	 m o v e m e n t ;   
 
 	 e d g e B u l l e t s ; 
 
 }   
 
 
 
 / /   e d g e   b u l l e t s   
 
 t a s k   e d g e B u l l e t s   {   
 
 	 l e t   d i r   =   0 ; 
 
 	 w h i l e ( !   O b j _ I s D e l e t e d ( b o s s O b j ) )   { 	 
 
 	 	 a s c e n t ( i   i n   0 . . 5 6 )   { 
 
 	 	 	 C r e a t e S h o t A 1 ( G e t C e n t e r X + 2 4 0 * c o s ( d i r ) , G e t C e n t e r Y + 2 4 0 * s i n ( d i r ) , 1 , d i r , 2 4 1 , 2 5 ) ; 
 
 	 	 	 d i r + = 3 6 0 / 5 6 ; 
 
 	 	 } 
 
 	 	 d i r + = 1 ; 
 
 	 	 w a i t ( 1 5 ) ; 
 
 	 } 
 
 } 
 
 
 
 / /   M a k i n g   t h e   a r m   m o v e   i n   a   f l u e n t   m o v e m e n t 
 
 t a s k   m o v e m e n t   { 
 
 	 l e t   f i r s t t i m e   =   t r u e ; 
 
 	 w h i l e ( !   O b j _ I s D e l e t e d ( b o s s O b j ) )   { 
 
 	 	 i f ( f i r s t t i m e )   {   
 
 	 	 	 g r a m V u u r ; 
 
 	 	 	 g r a m S p e e d   =   1 ; 
 
 	 	 	 l o o p ( 1 )   {   
 
 	 	 	 	 m o v e A r m ( " d o w n " , 6 0 , 1 ) ;   
 
 	 	 	 	 m o v e A r m ( " u p " , 3 0 , 2 ) ;   
 
 	 	 	 	 m o v e A r m ( " d o w n " , 1 5 , 2 ) ;   
 
 	 	 	 	 m o v e A r m ( " d o w n " , 1 5 , 2 ) ;   
 
 	 	 	 	 m o v e A r m ( " u p " , 2 0 , 3 ) ;   
 
 	 	 	 } 	 
 
 	 	 	 c o n c e n E f f e c t ( b o s s O b j , 3 0 , 1 , 6 4 , 1 2 8 , 6 4 ) ; 
 
 	 	 	 c o n c e n E f f e c t ( b o s s O b j , 3 0 , 1 , 1 2 8 , 1 2 8 , 1 2 8 ) ; 
 
 	 	 	 c o n c e n E f f e c t ( b o s s O b j , 1 5 , 5 , 6 4 , 6 4 , 2 5 5 ) ; 
 
 	 	 	 c o n c e n E f f e c t ( b o s s O b j , 1 5 , 5 , 6 4 , 2 5 5 , 6 4 ) ; 	 	 	 	 
 
 	 	 	 P l a y S F X ( S F X _ C H 0 2 ) ; 
 
 	 	 	 e x p l o E f f e c t ( b o s s X , b o s s X , 1 5 , 1 . 9 ) ; 
 
 	 	 	 w a i t ( 3 0 ) ; 	 	 
 
 	 	 	 s c r a t c h ( 3 ) ; 
 
 	 	 	 s t i c k y   =   f a l s e ; 
 
 	 	 	 g r a m S p e e d   =   - 5 ; 	 	 	 
 
 	 	 	 w a i t ( 1 2 0 ) ; 
 
 	 	 	 D e l e t e S h o t I n C i r c l e ( T Y P E _ A L L , T Y P E _ F A D E , G e t C e n t e r X , G e t C e n t e r Y , 2 4 8 ) ; 	 	 	 
 
 	 	 } 
 
 	 	 c o n c e n E f f e c t ( b o s s O b j , 3 0 , 1 , 6 4 , 1 2 8 , 6 4 ) ; 
 
 	 	 c o n c e n E f f e c t ( b o s s O b j , 3 0 , 1 , 1 2 8 , 1 2 8 , 1 2 8 ) ; 
 
 	 	 c o n c e n E f f e c t ( b o s s O b j , 1 5 , 5 , 6 4 , 6 4 , 2 5 5 ) ; 
 
 	 	 c o n c e n E f f e c t ( b o s s O b j , 1 5 , 5 , 6 4 , 2 5 5 , 6 4 ) ; 	 
 
 	 	 f i r s t t i m e   =   f a l s e ; 
 
 	 	 s t i c k y   =   t r u e ; 
 
 	 	 s c r a t c h ( 2 ) ; 
 
 	 	 g r a m V u u r ; 
 
 	 	 g r a m S p e e d   =   3 ; 
 
 	 	 l o o p ( 3 )   {   
 
 	 	 	 m o v e A r m ( " d o w n " , 6 0 , 1 ) ;   
 
 	 	 	 m o v e A r m ( " u p " , 3 0 , 2 ) ;   
 
 	 	 	 m o v e A r m ( " d o w n " , 1 5 , 2 ) ;   
 
 	 	 	 m o v e A r m ( " d o w n " , 1 5 , 2 ) ;   
 
 	 	 	 m o v e A r m ( " u p " , 2 0 , 3 ) ;   
 
 	 	 } 
 
 	 	 c o n c e n E f f e c t ( b o s s O b j , 3 0 , 1 , 6 4 , 1 2 8 , 6 4 ) ; 
 
 	 	 c o n c e n E f f e c t ( b o s s O b j , 3 0 , 1 , 1 2 8 , 1 2 8 , 1 2 8 ) ; 
 
 	 	 c o n c e n E f f e c t ( b o s s O b j , 1 5 , 5 , 6 4 , 6 4 , 2 5 5 ) ; 
 
 	 	 c o n c e n E f f e c t ( b o s s O b j , 1 5 , 5 , 6 4 , 2 5 5 , 6 4 ) ; 	 
 
 	 	 P l a y S F X ( S F X _ C H 0 2 ) ; 
 
 	 	 e x p l o E f f e c t ( b o s s X , b o s s X , 1 5 , 1 . 9 ) ; 
 
 	 	 w a i t ( 4 5 ) ; 	 	 
 
 	 	 s c r a t c h ( 4 ) ; 
 
 	 	 s t i c k y   =   f a l s e ; 
 
 	 	 g r a m S p e e d   =   - 5 ; 
 
 	 	 w a i t ( 2 1 0 ) ; 
 
 	 } 
 
 } 
 
 
 
 / /   M o v i n g   t h e   a r m   u p   o r   d o w n   i n   a   f l u e n t   m o v e m e n t .   2 7 0   =   s t a r t ,   3 3 0   =   m a x . 
 
 f u n c t i o n   m o v e A r m ( s i d e , d , s )   { 
 
 	 a s c e n t ( i   i n   0 . . d )   {   
 
 	 	 i f ( s i d e   = =   " u p " )   {   a r m D r a a i   - =   s ;   } 
 
 	 	 i f ( s i d e   = =   " d o w n " )   {   a r m D r a a i   + =   s ;   } 
 
 	 	 y i e l d ; 
 
 	 } 
 
 } 
 
 
 
 / /   
 
 t a s k   g r a m V u u r   {   
 
 	 l o o p ( 4 5 )   {   
 
 	 	 g r a m B u l l e t ( O b j R e n d e r _ G e t X ( n e e d l e O b j ) , O b j R e n d e r _ G e t Y ( n e e d l e O b j ) , 2 7 7 ) ; 
 
 	 	 w a i t ( r a n d _ i n t ( 3 0 , 4 5 ) ) ;   
 
 	 } 	 
 
 } 
 
 
 
 / /   S c r a t c h   a   g i v e n   n u m b e r   t i m e s .   
 
 f u n c t i o n   s c r a t c h ( t )   { 
 
 	 g r a m S p e e d   =   0 ; 
 
 	 P l a y S F X ( S F X _ M I X 0 1 ) ; 
 
 	 b o s s A t t a c k   =   1 ; 
 
 	 a s c e n t ( i   i n   0 . . t )   { 
 
 	 	 g r a m S p e e d   =   8 ; 
 
 	 	 P l a y S F X ( S F X _ M I X 0 0 ) ; 
 
 	 	 w a i t ( 5 ) ; 
 
 	 	 P l a y S F X ( S F X _ M I X 0 0 ) ; 
 
 	 	 g r a m S p e e d   =   - 8 ; 
 
 	 	 w a i t ( 5 ) ; 
 
 	 } 
 
 	 b o s s A t t a c k   =   0 ; 
 
 	 g r a m S p e e d   =   0 ; 
 
 } 
 
 
 
 / /   B u l l e t   s p a w n e d   b y   t h e   a r m . 
 
 t a s k   g r a m B u l l e t ( x , y , k l e u r )   {   
 
 	 l e t   o b j   =   O b j S h o t _ C r e a t e ( O B J _ S H O T ) ; 
 
 	 l e t   d i r   =   a t a n 2 ( y - G e t C e n t e r Y , x - G e t C e n t e r X ) ; 
 
 	 l e t   r   =   G e t D i s t a n c e X Y ( x , y , G e t C e n t e r X , G e t C e n t e r Y ) ; 
 
 
 
 	 O b j S h o t _ R e g i s t ( o b j ) ; 
 
 	 O b j M o v e _ S e t P o s i t i o n ( o b j , x , y ) ; 
 
 	 O b j M o v e _ S e t A n g l e ( o b j , 9 0 ) ; 
 
 	 O b j M o v e _ S e t S p e e d ( o b j , 0 ) ; 
 
 	 O b j S h o t _ S e t G r a p h i c ( o b j , k l e u r ) ; 
 
 	 O b j S h o t _ S e t D e l a y ( o b j , 0 ) ; 	 	 
 
 	 
 
 	 w h i l e ( !   O b j _ I s D e l e t e d ( o b j ) )   { 	 
 
 	 	 O b j M o v e _ S e t P o s i t i o n ( o b j , G e t C e n t e r X + r * c o s ( d i r ) , G e t C e n t e r Y + r * s i n ( d i r ) ) ;   
 
 	 	 d i r   + =   g r a m S p e e d / 4 ; 
 
 	 	 i f ( ! s t i c k y )   {   g r a m B u l l e t 2 ( O b j M o v e _ G e t X ( o b j ) , O b j M o v e _ G e t Y ( o b j ) , k l e u r ) ;   O b j _ D e l e t e ( o b j ) ;   } 
 
 	 	 y i e l d ; 
 
 	 } 
 
 } 
 
 
 
 / /   B u l l e t   s p a w n e d   b y   t h e   a r m   ( a f t e r   s c r a t c h   /   n o n   s t i c k y ) 
 
 t a s k   g r a m B u l l e t 2 ( x , y , k l e u r )   {   
 
 	 l e t   o b j   =   O b j S h o t _ C r e a t e ( O B J _ S H O T ) ; 
 
 	 l e t   d i r   =   a t a n 2 ( y - G e t C e n t e r Y , x - G e t C e n t e r X ) ; 
 
 	 l e t   r   =   G e t D i s t a n c e X Y ( x , y , G e t C e n t e r X , G e t C e n t e r Y ) ; 
 
 
 
 	 O b j S h o t _ R e g i s t ( o b j ) ; 
 
 	 O b j M o v e _ S e t P o s i t i o n ( o b j , x , y ) ; 
 
 	 O b j M o v e _ S e t A n g l e ( o b j , 9 0 ) ; 
 
 	 O b j M o v e _ S e t S p e e d ( o b j , 0 ) ; 
 
 	 O b j S h o t _ S e t G r a p h i c ( o b j , k l e u r + 1 ) ; 
 
 	 O b j S h o t _ S e t D e l a y ( o b j , 0 ) ; 	 	 
 
 	 
 
 	 w h i l e ( !   O b j _ I s D e l e t e d ( o b j ) )   { 	 
 
 	 	 O b j M o v e _ S e t P o s i t i o n ( o b j , G e t C e n t e r X + r * c o s ( d i r ) , G e t C e n t e r Y + r * s i n ( d i r ) ) ;   
 
 	 	 d i r   + =   g r a m S p e e d / 4 ; 
 
 	 	 r   + =   g r a m S p e e d / 5 ;   
 
 	 	 y i e l d ; 
 
 	 } 
 
 } 
 
 
 
 / /   N e e d l e   s p a w n i n g   t h e   b u l l e t s 
 
 t a s k   g r a m N e e d l e ( x , y )   {   
 
 
 
 	 l e t   d i r   =   a r m D r a a i ; 
 
 	 l e t   r   =   2 5 6 ; 
 
 	 
 
 	 O b j P r i m _ S e t T e x t u r e ( n e e d l e O b j , g r a m T e x ) ; 
 
 	 O b j R e n d e r _ S e t B l e n d T y p e ( n e e d l e O b j , B L E N D _ A D D _ A R G B ) ; 
 
 	 O b j _ S e t R e n d e r P r i o r i t y I ( n e e d l e O b j , 7 0 ) ; 
 
 	 O b j R e n d e r _ S e t P o s i t i o n ( n e e d l e O b j , x , y , 0 ) ; 
 
 	 O b j M o v e _ S e t P o s i t i o n ( n e e d l e O b j , x , y ) ; 
 
 	 O b j R e n d e r _ S e t A l p h a ( n e e d l e O b j , 2 5 5 ) ; 
 
 	 O b j R e n d e r _ S e t S c a l e X Y Z ( n e e d l e O b j , 0 . 0 , 0 . 0 , 0 ) ; 
 
 	 O b j S p r i t e 2 D _ S e t S o u r c e R e c t ( n e e d l e O b j , 0 , 0 , 4 7 0 , 4 7 0 ) ; 
 
 	 O b j S p r i t e 2 D _ S e t D e s t C e n t e r ( n e e d l e O b j ) ; 
 
 	 
 
 	 w h i l e ( !   O b j _ I s D e l e t e d ( n e e d l e O b j ) )   { 	 
 
 	 	 O b j R e n d e r _ S e t P o s i t i o n ( n e e d l e O b j , O b j R e n d e r _ G e t X ( a r m O b j ) - 6 + r * c o s ( d i r ) , O b j R e n d e r _ G e t Y ( a r m O b j ) + 1 3 + r * s i n ( d i r ) , 0 ) ; 
 
 	 	 d i r   =   O b j R e n d e r _ G e t A n g l e Z ( a r m O b j )   +   9 0 ; 
 
 	 	 y i e l d ; 
 
 	 } 
 
 } 
 
 
 
 / /   M e c h a n i c a l   a r m ,   s u m m o n s   t h e   b u l l e t s   w h e n   o n   t h e   r e c o r d . 
 
 t a s k   g r a m F a m A r m ( x , y )   { 
 
 	 O b j P r i m _ S e t T e x t u r e ( a r m O b j , a r m T e x ) ; 
 
 	 O b j R e n d e r _ S e t B l e n d T y p e ( a r m O b j , B L E N D _ A L P H A ) ; 
 
 	 O b j _ S e t R e n d e r P r i o r i t y I ( a r m O b j , 5 0 ) ; 
 
 	 O b j R e n d e r _ S e t P o s i t i o n ( a r m O b j , x , y , 0 ) ; 
 
 	 O b j M o v e _ S e t P o s i t i o n ( a r m O b j , x , y ) ; 
 
 	 O b j R e n d e r _ S e t A l p h a ( a r m O b j , 2 5 5 ) ; 
 
 	 O b j R e n d e r _ S e t S c a l e X Y Z ( a r m O b j , 1 . 2 5 , 1 . 2 5 , 0 ) ; 
 
 	 O b j S p r i t e 2 D _ S e t S o u r c e R e c t ( a r m O b j , 0 , 0 , 9 6 , 5 1 2 ) ; 
 
 	 O b j S p r i t e 2 D _ S e t D e s t C e n t e r ( a r m O b j ) ; 
 
 	 
 
 	 O b j R e n d e r _ S e t A n g l e Z ( a r m O b j , a r m D r a a i ) ; 	 
 
 	 
 
 	 w h i l e ( !   O b j _ I s D e l e t e d ( a r m O b j ) )   { 
 
 	 	 O b j R e n d e r _ S e t A n g l e Z ( a r m O b j , a r m D r a a i ) ; 
 
 	 	 y i e l d ; 
 
 	 } 
 
 } 
 
 
 
 / /   R e c o r d   i t   s e l f .   S p i n s   a r o u n d   a s   b g   a n i m a t i o n 
 
 t a s k   g r a m F a m ( x , y )   { 
 
 
 
 	 l e t   o b j   =   O b j P r i m _ C r e a t e ( O B J _ S P R I T E _ 2 D ) ; 
 
 
 
 	 l e t   d r a a i   =   0 ; 
 
 
 
 	 O b j P r i m _ S e t T e x t u r e ( o b j , g r a m T e x ) ; 
 
 	 O b j R e n d e r _ S e t B l e n d T y p e ( o b j , B L E N D _ A L P H A ) ; 
 
 	 O b j _ S e t R e n d e r P r i o r i t y I ( o b j , 2 0 ) ; 
 
 	 O b j R e n d e r _ S e t P o s i t i o n ( o b j , x , y , 0 ) ; 
 
 	 O b j M o v e _ S e t P o s i t i o n ( o b j , x , y ) ; 
 
 	 O b j R e n d e r _ S e t A l p h a ( o b j , 2 0 5 ) ; 
 
 	 O b j R e n d e r _ S e t S c a l e X Y Z ( o b j , 1 . 0 , 1 . 0 , 0 ) ; 
 
 	 O b j S p r i t e 2 D _ S e t S o u r c e R e c t ( o b j , 1 , 1 , 5 1 1 , 5 1 1 ) ; 
 
 	 O b j S p r i t e 2 D _ S e t D e s t C e n t e r ( o b j ) ; 
 
 	 O b j R e n d e r _ S e t C o l o r ( o b j , 1 2 8 , 2 5 5 , 1 2 8 ) ; 
 
 	 
 
 	 w h i l e ( !   O b j _ I s D e l e t e d ( o b j ) )   { 
 
 	 	 O b j R e n d e r _ S e t A n g l e Z ( o b j , d r a a i ) ; 
 
 	 	 d r a a i + = g r a m S p e e d ; 
 
 	 	 y i e l d ; 
 
 	 } 
 
 } 
 
 
 
 t a s k   s c r i p t E n d i n g   { 
 
 	 w h i l e ( O b j E n e m y _ G e t I n f o ( b o s s O b j ,   I N F O _ L I F E )   >   0 )   { 
 
 	 	 y i e l d ; 
 
 	 } 
 
 
 
 	 D e l e t e S h o t A l l ( T Y P E _ A L L ,   T Y P E _ I T E M ) ; 
 
 	 O b j _ D e l e t e ( b o s s O b j ) ; 
 
 
 
 	 C l o s e S c r i p t ( G e t O w n S c r i p t I D ( ) ) ; 
 
 } 