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

Comparing deliantra/server/ext/rent.ext (file contents):
Revision 1.8 by root, Tue May 22 10:42:48 2007 UTC vs.
Revision 1.9 by root, Sun Jun 17 13:56:09 2007 UTC

58 if ($deduct <= $pl->ob->{bank_balance}) { 58 if ($deduct <= $pl->ob->{bank_balance}) {
59 cf::db_put rent => balance => $deduct + cf::db_get rent => "balance"; 59 cf::db_put rent => balance => $deduct + cf::db_get rent => "balance";
60 $pl->ob->{bank_balance} -= $deduct; 60 $pl->ob->{bank_balance} -= $deduct;
61 $pl->{rent}{balance} -= $deduct; 61 $pl->{rent}{balance} -= $deduct;
62 $pl->ob->reply (undef, "Something whispers into your ear:\n" 62 $pl->ob->reply (undef, "Something whispers into your ear:\n"
63 . "Sir, we deducted your apartment rent ($deduct_string) from your bank account."); 63 . "Your highness, we deducted your apartment rent ($deduct_string) from your bank account.");
64 } else { 64 } else {
65 $pl->ob->reply (undef, "Something whispers into your ear:\n" 65 $pl->ob->reply (undef, "Something whispers into your ear:\n"
66 . "Sir, we want to deduct the apartment rent ($deduct_string), but the bank informed us that they cannot perform the transaction. " 66 . "Your highness, we want to deduct the apartment rent ($deduct_string), but the bank informed us that they cannot perform the transaction. "
67 . "Please even out your balance so we can deduct the fees, otherwise we will be forced to shut down your access to the apartment."); 67 . "Please even out your balance so we can deduct the fees, otherwise we will be forced to shut down your access to the apartment.");
68 } 68 }
69} 69}
70 70
71sub check_balance { 71sub check_balance {
115 115
116 update_balance $pl; 116 update_balance $pl;
117 117
118 $pl->{rent}{apartment}{$apartment} = undef; 118 $pl->{rent}{apartment}{$apartment} = undef;
119 119
120 $pl->ob->reply (undef, "Wonderful decision, sir! " 120 $pl->ob->reply (undef, "Wonderful decision, your highness! "
121 . "We told the proprietor in $apartment{$apartment}[1] to expect you and let you in. " 121 . "We told the proprietor in $apartment{$apartment}[1] to expect you and let you in. "
122 . "We are sure you will be satisfied!"); 122 . "We are sure you will be satisfied!");
123}; 123};
124 124
125cf::register_script_function "rent::stop" => sub { 125cf::register_script_function "rent::stop" => sub {
165 for my $path (keys %{ $pl->{rent}{apartment} }) { 165 for my $path (keys %{ $pl->{rent}{apartment} }) {
166 $path = sprintf "~%s%s", $pl->ob->name, $path; 166 $path = sprintf "~%s%s", $pl->ob->name, $path;
167 167
168 if ($map->path eq $path) { 168 if ($map->path eq $path) {
169 if (check_balance $pl) { 169 if (check_balance $pl) {
170 $pl->ob->reply (undef, "Welcome to your apartment, sir!"); 170 $pl->ob->reply (undef, "Welcome to your apartment, your highness!");
171 } else { 171 } else {
172 $pl->ob->reply (undef, "We are sorry, sir, you have to pay your rent first."); 172 $pl->ob->reply (undef, "We are sorry, your highness, you have to pay your rent first.");
173 reject_entry $pl; 173 reject_entry $pl;
174 } 174 }
175 175
176 return; 176 return;
177 } 177 }
178 } 178 }
179 179
180 $pl->ob->reply (undef, "Sir, you have to rent this apartment in The Apartment Shop in Scorn first!"); 180 $pl->ob->reply (undef, "Your highness, you have to rent this apartment in The Apartment Shop in Scorn first!");
181 reject_entry $pl; 181 reject_entry $pl;
182 } 182 }
183 }, 183 },
184; 184;
185 185

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines