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

Comparing deliantra/maps/perl/bank.ext (file contents):
Revision 1.9 by pippijn, Mon May 22 19:09:36 2006 UTC vs.
Revision 1.10 by pippijn, Mon May 22 19:14:47 2006 UTC

10# - balance, simply shows how much money one has on his/her account. 10# - balance, simply shows how much money one has on his/her account.
11# 11#
12# TODO: 12# TODO:
13# - Comment more steps 13# - Comment more steps
14# - Implement exchange() 14# - Implement exchange()
15# - Add a DM command to view any user's balance.
16 15
17# The units are being used in each sub so they are declared globally. 16# The units are being used in each sub so they are declared globally.
18my %unit = ( 17my %unit = (
19 silver => 1, 18 silver => 1,
20 gold => 10, 19 gold => 10,
32# Calculates and returns how much money someone has starting with the 31# Calculates and returns how much money someone has starting with the
33# highest value currency going down. Think of it like having the date 32# highest value currency going down. Think of it like having the date
34# and time in the format of 2006-05-19 03:21:31 UTC instead of 1148001691 33# and time in the format of 2006-05-19 03:21:31 UTC instead of 1148001691
35# seconds since 1970-01-01 00:00:00 UTC. 34# seconds since 1970-01-01 00:00:00 UTC.
36sub balance { 35sub balance {
37 my ($who) = @_; 36 my ($who, $is_wiz) = @_;
38 my $balance = $who->{bank_balance}; 37 my $balance = $who->{bank_balance};
39 38
40 return "Sorry, you have no balance." 39 return "Sorry, you have no balance."
41 unless $balance; 40 unless $balance;
42 41
142 my $units = join ", ", @units; 141 my $units = join ", ", @units;
143 my $fees = - ($service_charge / 100) + 1; 142 my $fees = - ($service_charge / 100) + 1;
144 143
145 if ($cmd eq "balance") { 144 if ($cmd eq "balance") {
146 if ($who->flag (cf::FLAG_WIZ)) { 145 if ($who->flag (cf::FLAG_WIZ)) {
147 my $player = cf::player::find $who->name; 146 my $player = cf::player::find $arguments;
148 #$who->message ("$name says: ".balance ($player), cf::NDI_WHITE); 147 $who->message ("$name says: ".balance ($player->ob, 1), cf::NDI_WHITE);
149 #} else { 148 } else {
150 $who->message ("$name says: ".balance ($who), cf::NDI_WHITE); 149 $who->message ("$name says: ".balance ($who, 0), cf::NDI_WHITE);
151 } 150 }
152 151
153 } elsif ($cmd eq "deposit" and $currency) { 152 } elsif ($cmd eq "deposit" and $currency) {
154 $who->message ("$name says: " . (transaction $who, "deposit", $amount, $currency), cf::NDI_WHITE); 153 $who->message ("$name says: " . (transaction $who, "deposit", $amount, $currency), cf::NDI_WHITE);
155 $who->message ("$name says: " . (balance $who), cf::NDI_WHITE); 154 $who->message ("$name says: " . (balance $who), cf::NDI_WHITE);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines