1 //script for chest with all magic potion
2 
main(void)3 void main( void)
4 {
5 preload_seq(175);
6 preload_seq(56);
7 sp_brain(&current_sprite, 0);
8 sp_hitpoints(&current_sprite, 0);
9 }
10 
hit(void)11 void hit ( void )
12  {
13   //play noise
14   int &hold = sp_editor_num(&current_sprite);
15 
16   if (&hold != 0)
17     {
18      //this was placed by the editor, lets make the chest stay open
19      editor_type(&hold, 4);
20      editor_seq(&hold, 175);
21      editor_frame(&hold, 4);
22      //type means show this seq/frame combo as background in the future
23     }
24   &save_x = sp_x(&current_sprite, -1);
25   &save_y = sp_y(&current_sprite, -1);
26   external("make", "rpotion");
27 
28   sp_seq(&current_sprite, 175);
29  sp_script(&current_sprite, "");
30   sp_notouch(&current_sprite, 1);
31   sp_nohit(&current_sprite, 1);
32  sp_script(&current_sprite, "");
33  kill_this_task();
34  }
35