… | |
… | |
176 | if ($cmd eq 'mailwarning' and !$who->flag (cf::FLAG_WIZ)) { |
176 | if ($cmd eq 'mailwarning' and !$who->flag (cf::FLAG_WIZ)) { |
177 | return 1; |
177 | return 1; |
178 | } |
178 | } |
179 | |
179 | |
180 | if ($who->pay_amount ($pr->[0] * $price_fact)) { |
180 | if ($who->pay_amount ($pr->[0] * $price_fact)) { |
|
|
181 | cf::async { |
181 | if ($pr->[3] && not cf::player::exists $arguments) { |
182 | if ($pr->[3] && not cf::player::exists $arguments) { |
182 | $who->reply ($npc, "Sorry, there is no '$arguments'"); |
183 | $who->reply ($npc, "Sorry, there is no '$arguments'"); |
183 | } else { |
184 | } else { |
184 | create_object ($pr->[1], $who->map, $x, $y, $pr->[2], $who->name, $arguments); |
185 | create_object ($pr->[1], $who->map, $x, $y, $pr->[2], $who->name, $arguments); |
185 | $who->reply ($npc, "Here is your $cmd"); |
186 | $who->reply ($npc, "Here is your $cmd"); |
|
|
187 | } |
186 | } |
188 | } |
187 | } else { |
189 | } else { |
188 | $who->reply ($npc, "Sorry, you don't have enough money."); |
190 | $who->reply ($npc, "Sorry, you don't have enough money."); |
189 | } |
191 | } |
190 | |
192 | |
… | |
… | |
234 | my $cnt; |
236 | my $cnt; |
235 | for ($who->inv) { |
237 | for ($who->inv) { |
236 | if ($_->name () =~ /^(bag|package|carton) T: \Q$arguments\E F: (\S+)$/) { |
238 | if ($_->name () =~ /^(bag|package|carton) T: \Q$arguments\E F: (\S+)$/) { |
237 | $_->name ("$1 F: $2 T: $arguments"); |
239 | $_->name ("$1 F: $2 T: $arguments"); |
238 | $storage->insert ($_, 2, 2); |
240 | $storage->insert ($_, 2, 2); |
239 | $who->esrv_del_item ($_->count); |
|
|
240 | $cnt++; |
241 | $cnt++; |
241 | } |
242 | } |
242 | } |
243 | } |
243 | |
244 | |
244 | if ($cnt) { |
245 | if ($cnt) { |
… | |
… | |
252 | |
253 | |
253 | } else { |
254 | } else { |
254 | $who->reply ($npc, |
255 | $who->reply ($npc, |
255 | sprintf "How can I help you?\n" |
256 | sprintf "How can I help you?\n" |
256 | . "Here is a quick list of commands I understand:\n\n" |
257 | . "Here is a quick list of commands I understand:\n\n" |
257 | . "- pen (%s platinum)\n" |
258 | . " - pen (%s platinum)\n" |
258 | . "- literacy (%s platinum)\n" |
259 | . " - literacy (%s platinum)\n" |
259 | . "- mailscroll <friend> (%s platinum)\n" |
260 | . " - mailscroll <friend> (%s platinum)\n" |
260 | . "- bag <friend> (%s platinum)\n" |
261 | . " - bag <friend> (%s platinum)\n" |
261 | . "- package <friend> (%s platinum)\n" |
262 | . " - package <friend> (%s platinum)\n" |
262 | . "- carton <friend> (%s platinum)\n" |
263 | . " - carton <friend> (%s platinum)\n" |
263 | . "- send <friend> (send bags/packages/cartons)\n" |
264 | . " - send <friend> (send bags/packages/cartons)\n" |
264 | . "- receive (to receive packages for you)\n" |
265 | . " - receive (to receive packages for you)\n" |
265 | . ($who->flag (cf::FLAG_WIZ) ? "- mailwarning <player>" : ""), |
266 | . ($who->flag (cf::FLAG_WIZ) ? " - mailwarning <player>\n" : ""), |
266 | 40, 1000, 1, 1, 5, 10 |
267 | 40, 1000, 1, 1, 5, 10 |
267 | ); |
268 | ); |
268 | } |
269 | } |
269 | 1 |
270 | 1 |
270 | }; |
271 | }; |
… | |
… | |
294 | } |
295 | } |
295 | |
296 | |
296 | sub send_mail { |
297 | sub send_mail { |
297 | my ($type, $toname, $fromname, $message) = @_; |
298 | my ($type, $toname, $fromname, $message) = @_; |
298 | my $time = strftime ("%a, %d %b %Y %H:%M:%S CEST", localtime (time)); |
299 | my $time = strftime ("%a, %d %b %Y %H:%M:%S CEST", localtime (time)); |
299 | my $msg = "From: $fromname\nTo: $toname\nDate: $time\n\n$message\n"; |
300 | my $msg = "From: $fromname\rTo: $toname\rDate: $time\n\n$message\n"; |
300 | store_mail ($type, $toname, $fromname, $msg); |
301 | store_mail ($type, $toname, $fromname, $msg); |
301 | } |
302 | } |
302 | |
303 | |
303 | 1; |
304 | 1; |
|
|
305 | |