… | |
… | |
68 | |
68 | |
69 | sub create_object { |
69 | sub create_object { |
70 | my ($name, $map, $x, $y, $cb, @a) = @_; |
70 | my ($name, $map, $x, $y, $cb, @a) = @_; |
71 | my $o = cf::object::new $name; |
71 | my $o = cf::object::new $name; |
72 | my $r = $cb->($o, @a); |
72 | my $r = $cb->($o, @a); |
73 | $map->insert_object ($o, $x, $y); |
73 | $map->insert ($o, $x, $y); |
74 | $r |
74 | $r |
75 | } |
75 | } |
76 | |
76 | |
77 | # this handler notifies the player of new mail |
77 | # this handler notifies the player of new mail |
78 | cf::player->attach ( |
78 | cf::player->attach ( |
… | |
… | |
192 | my $storage = cf::map::find ("/planes/IPO_storage"); |
192 | my $storage = cf::map::find ("/planes/IPO_storage"); |
193 | unless ($storage) { |
193 | unless ($storage) { |
194 | $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."); |
195 | return 1; |
195 | return 1; |
196 | } |
196 | } |
|
|
197 | $storage->load; |
197 | |
198 | |
198 | my $plname = $who->name; |
199 | my $plname = $who->name; |
199 | my $cnt; |
200 | my $cnt; |
200 | for ($storage->at (2, 2)) { |
201 | for ($storage->at (2, 2)) { |
201 | if ($_->name () =~ /^\S+ F: \S+ T: \Q$plname\E$/) { |
202 | if ($_->name () =~ /^\S+ F: \S+ T: \Q$plname\E$/) { |
… | |
… | |
223 | my $storage = cf::map::find ("/planes/IPO_storage"); |
224 | my $storage = cf::map::find ("/planes/IPO_storage"); |
224 | unless ($storage) { |
225 | unless ($storage) { |
225 | $who->reply ($npc, "Sorry, our package delivery service is currently in strike. Please come back later."); |
226 | $who->reply ($npc, "Sorry, our package delivery service is currently in strike. Please come back later."); |
226 | return 1; |
227 | return 1; |
227 | } |
228 | } |
|
|
229 | $storage->load; |
228 | |
230 | |
229 | my $cnt; |
231 | my $cnt; |
230 | for ($who->inv) { |
232 | for ($who->inv) { |
231 | if ($_->name () =~ /^(bag|package|carton) T: \Q$arguments\E F: (\S+)$/) { |
233 | if ($_->name () =~ /^(bag|package|carton) T: \Q$arguments\E F: (\S+)$/) { |
232 | $_->name ("$1 F: $2 T: $arguments"); |
234 | $_->name ("$1 F: $2 T: $arguments"); |
233 | $_->teleport ($storage, 2, 2); |
235 | $storage->insert ($_, 2, 2); |
|
|
236 | $who->esrv_del_item ($_->count); |
234 | $cnt++; |
237 | $cnt++; |
235 | } |
238 | } |
236 | } |
239 | } |
237 | |
240 | |
238 | if ($cnt) { |
241 | if ($cnt) { |