1 //script for store manager, actually attached to the bench
2 
main(void)3 void main( void )
4 {
5 
6  int &crap = create_sprite(185,150, 0, 0, 0);
7  &temphold = &crap;
8  int &amount = 0;
9 
10 preload_seq(251);
11 preload_seq(253);
12 int &myrand;
13 sp_brain(&temphold, 0);
14 sp_base_walk(&temphold, 250);
15 sp_speed(&temphold, 0);
16 
17 //set starting pic
18 
19 sp_pseq(&temphold, 253);
20 sp_pframe(&temphold, 1);
21 
22 mainloop:
23 wait(500);
24 &myrand = random(8, 1);
25 
26   if (&myrand == 1)
27   {
28   sp_pseq(&temphold, 253);
29   }
30 
31   if (&myrand == 2)
32   {
33   sp_pseq(&temphold, 251);
34   }
35 
36 &myrand = random(20, 1);
37 goto mainloop;
38 }
39 
buybottle(void)40 void buybottle( void)
41 {
42 int &junk = free_items();
43 
44 
45 if (&junk < 1)
46  {
47          choice_start()
48         set_y 240
49         title_start();
50 You are carrying too much.
51         title_end();
52          "Ok"
53          choice_end()
54  return;
55  }
56 
57 
58 if (&gold < 100)
59  {
60          choice_start()
61         set_y 240
62         title_start();
63 You don't have enough gold to buy elixer.
64         title_end();
65          "Ok"
66          choice_end()
67  return;
68  }
69 
70 &gold -= 100;
71 add_item("item-eli",438, 9);
72 
73 }
74 
75 
76 void hit( void )
77 {
78 sp_speed(&current_sprite, 0);
79 wait(400);
80 say_stop("`%Please don't wreck the place, thanks.", &temphold);
81 wait(800);
82 goto mainloop;
83 }
84 
85 void talk( void )
86 {
87 
88  freeze(1);
89 startok:
90 
91 if (&life >= &lifemax)
92 {
93  choice_start();
94         set_y 240
95         set_title_color 15
96         title_start();
97 "You are the perfect picture of health, sir."
98         title_end();
99          "Buy a bottle of elixer for $100"
100          "Leave"
101  choice_end();
102 
103   if (&result == 1)
104   {
105   buybottle();
106   }
107    unfreeze(1);
108    goto mainloop;
109    return;
110 }
111 
112 
113 }
114 startchoice:
115 &amount = &lifemax;
116 &amount -= &life;
117 
118          choice_start()
119         set_y 240
120         set_title_color 15
121         title_start();
122 "You are injured!  It will cost $&amount gold to heal you."
123         title_end();
124          "Get healed"
125          "Buy a bottle of elixer for $100"
126          "Leave"
127          choice_end()
128 
129 if (&result == 1)
130   {
131    if (&gold < &amount)
132    {
133          choice_start()
134         set_y 240
135         title_start();
136 You don't have enough gold.
137         title_end();
138          "Ok"
139          choice_end()
140    goto startchoice;
141    }
142 &life = &lifemax;
143 &gold -= &amount;
144 Playsound(22,22050,0,0,0);
145 say("I am healed.", 1);
146  unfreeze(1);
147  goto mainloop;
148   }
149 
150   if (&result == 2)
151   {
152    buybottle();
153   }
154 
155    unfreeze(1);
156    goto mainloop;
157    return;
158 
159 }
160 
161