… | |
… | |
19 | literacy => [ |
19 | literacy => [ |
20 | 1000, 'scroll_literacy', |
20 | 1000, 'scroll_literacy', |
21 | sub { $_[0]->value (1000 * $price_fact) } |
21 | sub { $_[0]->value (1000 * $price_fact) } |
22 | ], |
22 | ], |
23 | mailscroll => [ |
23 | mailscroll => [ |
24 | 1, 'scroll', |
24 | 1, 'mailscroll_empty', |
25 | sub { |
25 | sub { |
26 | $_[0]->name ("mailscroll T: $_[2] F: $_[1]"); |
26 | $_[0]->name ("mailscroll T: $_[2] F: $_[1]"); |
27 | $_[0]->name_pl ("mailscrolls T: $_[2] F: $_[1]"); |
27 | $_[0]->name_pl ("mailscrolls T: $_[2] F: $_[1]"); |
28 | $_[0]->value (1 * $price_fact); |
28 | $_[0]->value (1 * $price_fact); |
29 | }, |
29 | }, |
… | |
… | |
185 | $who->reply ($npc, "Here is your $cmd"); |
185 | $who->reply ($npc, "Here is your $cmd"); |
186 | } |
186 | } |
187 | |
187 | |
188 | } elsif ($cmd eq 'receive') { |
188 | } elsif ($cmd eq 'receive') { |
189 | cf::async { |
189 | cf::async { |
|
|
190 | $Coro::current->{desc} = "ipo receive"; |
|
|
191 | |
190 | my $storage = cf::map::find ("/planes/IPO_storage"); |
192 | my $storage = cf::map::find ("/planes/IPO_storage"); |
191 | unless ($storage) { |
193 | unless ($storage) { |
192 | $who->reply ($npc, "Sorry, our package delivery service is currently in strike. Please come back later."); |
194 | $who->reply ($npc, "Sorry, our package delivery service is currently in strike. Please come back later."); |
193 | return 1; |
195 | return 1; |
194 | } |
196 | } |
… | |
… | |
201 | $cnt++; |
203 | $cnt++; |
202 | } |
204 | } |
203 | } |
205 | } |
204 | |
206 | |
205 | if ($cnt) { |
207 | if ($cnt) { |
206 | $who->reply ($npc, $cnt == 1 ? "Here is your pakage." : "Here are your packages."); |
208 | $who->reply ($npc, $cnt == 1 ? "Here is your package." : "Here are your packages."); |
207 | } else { |
209 | } else { |
208 | $who->reply ($npc, "Sorry, no deliverys for you sir."); |
210 | $who->reply ($npc, "Sorry, no deliveries for you sir."); |
209 | } |
211 | } |
210 | } |
212 | } |
211 | |
213 | |
212 | } elsif ($cmd eq 'send') { |
214 | } elsif ($cmd eq 'send') { |
213 | unless ($arguments =~ /^\S+$/) { |
215 | unless ($arguments =~ /^\S+$/) { |
214 | $who->reply ($npc, "Send to who?"); |
216 | $who->reply ($npc, "Send to who?"); |
215 | return 1; |
217 | return 1; |
216 | } |
218 | } |
217 | |
219 | |
218 | cf::async { |
220 | cf::async { |
|
|
221 | $Coro::current->{desc} = "ipo send"; |
|
|
222 | |
219 | my $storage = cf::map::find ("/planes/IPO_storage"); |
223 | my $storage = cf::map::find ("/planes/IPO_storage"); |
220 | unless ($storage) { |
224 | unless ($storage) { |
221 | $who->reply ($npc, "Sorry, our package delivery service is currently in strike. Please come back later."); |
225 | $who->reply ($npc, "Sorry, our package delivery service is currently in strike. Please come back later."); |
222 | return 1; |
226 | return 1; |
223 | } |
227 | } |
… | |
… | |
262 | package CFMail; |
266 | package CFMail; |
263 | |
267 | |
264 | use POSIX qw/strftime/; |
268 | use POSIX qw/strftime/; |
265 | use CFDB; |
269 | use CFDB; |
266 | |
270 | |
267 | my $MAILDB = CFDB->new (db_file => cf::localdir . "/crossfiremail"); |
271 | my $MAILDB = CFDB->new (db_file => "$LOCALDIR/crossfiremail"); |
268 | |
272 | |
269 | sub get_mail { |
273 | sub get_mail { |
270 | my ($toname) = @_; |
274 | my ($toname) = @_; |
271 | $MAILDB->get ($toname); |
275 | $MAILDB->get ($toname); |
272 | } |
276 | } |