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

Comparing deliantra/server/ext/bank.ext (file contents):
Revision 1.6 by root, Fri May 2 16:16:02 2008 UTC vs.
Revision 1.7 by root, Mon Sep 22 01:33:09 2008 UTC

90sub help { 90sub help {
91 my ($command) = @_; 91 my ($command) = @_;
92 92
93 if ($command eq "") { 93 if ($command eq "") {
94 return "You can: 94 return "You can:
95
95 deposit <amount> <currency> 96 deposit <amount> <currency>
96 withdraw <amount> <currency> 97 withdraw <amount> <currency>
97 balance 98 balance
98 help rates 99 help rates
99 help <deposit|withdraw|balance>"; 100 help <deposit|withdraw|balance>";
105 withdraw <amount> <currency>"; 106 withdraw <amount> <currency>";
106 } elsif ($command eq "balance") { 107 } elsif ($command eq "balance") {
107 return "I can tell you how much money you are saving in our bank, just ask me about your balance."; 108 return "I can tell you how much money you are saving in our bank, just ask me about your balance.";
108 } elsif ($command eq "rates") { 109 } elsif ($command eq "rates") {
109 my @coins = cf::coin_archetypes; 110 my @coins = cf::coin_archetypes;
110 my $exchange_rates = "Here is a list of exchange rates:\n\n\n"; 111 my $exchange_rates = "Here is a list of exchange rates:\n\n";
111 112
112 for my $f (0 .. $#coins) { 113 for my $f (0 .. $#coins) {
113 for my $t ($f + 1 .. $#coins) { 114 for my $t ($f + 1 .. $#coins) {
114 $exchange_rates .= 115 $exchange_rates .=
115 sprintf "One %s is %d %s.\n\n", 116 sprintf " One %s is %d %s.\n",
116 $coins[$f]->name, 117 $coins[$f]->name,
117 (calc_exchange_rate 1, $coins[$f], $coins[$t]), 118 (calc_exchange_rate 1, $coins[$f], $coins[$t]),
118 $coins[$t]->name_pl; 119 $coins[$t]->name_pl;
119 } 120 }
120 } 121 }
121 122
122 return "$exchange_rates\n\nThis may change a bit with the stock markets but don't expect it to be much."; 123 return "$exchange_rates\nThis may change a bit with the stock markets but don't expect it to be much.";
123 } 124 }
124} 125}
125 126
126cf::register_script_function "bank::command" => sub { 127cf::register_script_function "bank::command" => sub {
127 my ($who, $msg, $npc) = @_; 128 my ($who, $msg, $npc) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines