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