ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/ipo.ext
(Generate patch)

Comparing deliantra/server/ext/ipo.ext (file contents):
Revision 1.4 by root, Sun Jan 7 02:39:14 2007 UTC vs.
Revision 1.5 by elmex, Sun Jan 14 11:00:48 2007 UTC

118 my $mail = cf::object::new $type->[0]; 118 my $mail = cf::object::new $type->[0];
119 $mail->name ("$type->[1] F: $from T: " .$pl->name); 119 $mail->name ("$type->[1] F: $from T: " .$pl->name);
120 $mail->name_pl ("$type->[1]s F: $from T: " .$pl->name); 120 $mail->name_pl ("$type->[1]s F: $from T: " .$pl->name);
121 $mail->msg ($msg); 121 $mail->msg ($msg);
122 $mail->value (0); 122 $mail->value (0);
123 $mail->insert_in_ob ($box); 123 $box->insert ($mail);
124 } 124 }
125 125
126 $cnt += @$mails; 126 $cnt += @$mails;
127 127
128 if ($cnt == 1) { 128 if ($cnt == 1) {
184 create_object ($pr->[1], $who->map, $x, $y, $pr->[2], $who->name, $arguments); 184 create_object ($pr->[1], $who->map, $x, $y, $pr->[2], $who->name, $arguments);
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 my $storage = cf::map::find ("/planes/IPO_storage"); 190 my $storage = cf::map::find ("/planes/IPO_storage");
190 unless ($storage) { 191 unless ($storage) {
191 $who->reply ($npc, "Sorry, our package delivery service is currently in strike. Please come back later."); 192 $who->reply ($npc, "Sorry, our package delivery service is currently in strike. Please come back later.");
192 return 1; 193 return 1;
193 } 194 }
194 195
195 my $plname = $who->name; 196 my $plname = $who->name;
196 my $cnt; 197 my $cnt;
197 for ($storage->at (2, 2)) { 198 for ($storage->at (2, 2)) {
198 if ($_->name () =~ /^\S+ F: \S+ T: \Q$plname\E$/) { 199 if ($_->name () =~ /^\S+ F: \S+ T: \Q$plname\E$/) {
199 $_->insert_in_ob ($who); 200 $who->insert ($_);
200 $cnt++; 201 $cnt++;
201 } 202 }
202 } 203 }
203 204
204 if ($cnt) { 205 if ($cnt) {
205 $who->reply ($npc, $cnt == 1 ? "Here is your pakage." : "Here are your packages."); 206 $who->reply ($npc, $cnt == 1 ? "Here is your pakage." : "Here are your packages.");
206 } else { 207 } else {
207 $who->reply ($npc, "Sorry, no deliverys for you sir."); 208 $who->reply ($npc, "Sorry, no deliverys for you sir.");
209 }
208 } 210 }
209 211
210 } elsif ($cmd eq 'send') { 212 } elsif ($cmd eq 'send') {
211 unless ($arguments =~ /^\S+$/) { 213 unless ($arguments =~ /^\S+$/) {
212 $who->reply ($npc, "Send to who?"); 214 $who->reply ($npc, "Send to who?");
213 return 1; 215 return 1;
214 } 216 }
215 217
218 cf::async {
216 my $storage = cf::map::find ("/planes/IPO_storage"); 219 my $storage = cf::map::find ("/planes/IPO_storage");
217 unless ($storage) { 220 unless ($storage) {
218 $who->reply ($npc, "Sorry, our package delivery service is currently in strike. Please come back later."); 221 $who->reply ($npc, "Sorry, our package delivery service is currently in strike. Please come back later.");
219 return 1; 222 return 1;
220 } 223 }
221 224
222 my $cnt; 225 my $cnt;
223 for ($who->inv) { 226 for ($who->inv) {
224 if ($_->name () =~ /^(bag|package|carton) T: \Q$arguments\E F: (\S+)$/) { 227 if ($_->name () =~ /^(bag|package|carton) T: \Q$arguments\E F: (\S+)$/) {
225 $_->name ("$1 F: $2 T: $arguments"); 228 $_->name ("$1 F: $2 T: $arguments");
226 $_->teleport ($storage, 2, 2); 229 $_->teleport ($storage, 2, 2);
227 $cnt++; 230 $cnt++;
228 } 231 }
229 } 232 }
230 233
231 if ($cnt) { 234 if ($cnt) {
232 $who->reply ($npc, $cnt == 1 ? "Package sent to $arguments." : "Sent $cnt packages to $arguments\n"); 235 $who->reply ($npc, $cnt == 1 ? "Package sent to $arguments." : "Sent $cnt packages to $arguments\n");
233 CFMail::send_mail (1, $arguments, $who->name, "You got $cnt packages from " . $who->name); 236 CFMail::send_mail (1, $arguments, $who->name, "You got $cnt packages from " . $who->name);
234 notify_players ($arguments => 1); 237 notify_players ($arguments => 1);
235 } else { 238 } else {
236 $who->reply ($npc, "Sorry, found no package to send to $arguments."); 239 $who->reply ($npc, "Sorry, found no package to send to $arguments.");
240 }
237 } 241 }
238 242
239 } else { 243 } else {
240 $who->reply ($npc, 244 $who->reply ($npc,
241 sprintf "How can I help you?\n" 245 sprintf "How can I help you?\n"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines