--- deliantra/server/ext/ipo.ext 2007/09/30 16:24:29 1.11 +++ deliantra/server/ext/ipo.ext 2008/09/22 01:33:09 1.15 @@ -14,18 +14,18 @@ my %prices = ( pen => [ 40, 'stylus', - sub { $_[0]->name ('IPO Writing Pen'); $_[0]->value (40 * $price_fact); } + sub { $_[0]->name ('IPO Writing Pen'); $_[0]->value (0); } ], literacy => [ 1000, 'scroll_literacy', - sub { $_[0]->value (1000 * $price_fact) } + sub { $_[0]->value (0) } ], mailscroll => [ 1, 'mailscroll_empty', sub { $_[0]->name ("mailscroll T: $_[2] F: $_[1]"); $_[0]->name_pl ("mailscrolls T: $_[2] F: $_[1]"); - $_[0]->value (1 * $price_fact); + $_[0]->value (0); }, 'plarg' ], @@ -177,12 +177,17 @@ return 1; } - $who->pay_amount ($pr->[0] * $price_fact); - if ($pr->[3] && not cf::player::exists $arguments) { - $who->reply ($npc, "Sorry, there is no '$arguments'"); + if ($who->pay_amount ($pr->[0] * $price_fact)) { + cf::async { + if ($pr->[3] && not cf::player::exists $arguments) { + $who->reply ($npc, "Sorry, there is no '$arguments'"); + } else { + create_object ($pr->[1], $who->map, $x, $y, $pr->[2], $who->name, $arguments); + $who->reply ($npc, "Here is your $cmd"); + } + } } else { - create_object ($pr->[1], $who->map, $x, $y, $pr->[2], $who->name, $arguments); - $who->reply ($npc, "Here is your $cmd"); + $who->reply ($npc, "Sorry, you don't have enough money."); } } elsif ($cmd eq 'receive') { @@ -233,7 +238,6 @@ if ($_->name () =~ /^(bag|package|carton) T: \Q$arguments\E F: (\S+)$/) { $_->name ("$1 F: $2 T: $arguments"); $storage->insert ($_, 2, 2); - $who->esrv_del_item ($_->count); $cnt++; } } @@ -251,15 +255,15 @@ $who->reply ($npc, sprintf "How can I help you?\n" . "Here is a quick list of commands I understand:\n\n" - . "- pen (%s platinum)\n" - . "- literacy (%s platinum)\n" - . "- mailscroll (%s platinum)\n" - . "- bag (%s platinum)\n" - . "- package (%s platinum)\n" - . "- carton (%s platinum)\n" - . "- send (send bags/packages/cartons)\n" - . "- receive (to receive packages for you)\n" - . ($who->flag (cf::FLAG_WIZ) ? "- mailwarning " : ""), + . " - pen (%s platinum)\n" + . " - literacy (%s platinum)\n" + . " - mailscroll (%s platinum)\n" + . " - bag (%s platinum)\n" + . " - package (%s platinum)\n" + . " - carton (%s platinum)\n" + . " - send (send bags/packages/cartons)\n" + . " - receive (to receive packages for you)\n" + . ($who->flag (cf::FLAG_WIZ) ? " - mailwarning \n" : ""), 40, 1000, 1, 1, 5, 10 ); } @@ -293,8 +297,9 @@ sub send_mail { my ($type, $toname, $fromname, $message) = @_; my $time = strftime ("%a, %d %b %Y %H:%M:%S CEST", localtime (time)); - my $msg = "From: $fromname\nTo: $toname\nDate: $time\n\n$message\n"; + my $msg = "From: $fromname\rTo: $toname\rDate: $time\n\n$message\n"; store_mail ($type, $toname, $fromname, $msg); } 1; +