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.2 by root, Thu Dec 21 22:41:34 2006 UTC vs.
Revision 1.5 by root, Fri Jan 5 01:06:27 2007 UTC

12 "/pup_land/nurnberg/apartment/main" => [ 300, "nürnberg", "sauerkraut"], 12 "/pup_land/nurnberg/apartment/main" => [ 300, "nürnberg", "sauerkraut"],
13 "/pup_land/lone_town/apartment/groundfloor" => [50000, "lone town", "looney"], 13 "/pup_land/lone_town/apartment/groundfloor" => [50000, "lone town", "looney"],
14 "/brest/apartments/brest_town_house" => [30000, "brest", "brecht"], 14 "/brest/apartments/brest_town_house" => [30000, "brest", "brecht"],
15); 15);
16 16
17sub teleport {
18 my ($pl, $map, $x, $y) = @_;
19
20 my $portal = cf::object::new "exit";
21
22 $portal->slaying ($map);
23 $portal->stats->hp ($x);
24 $portal->stats->sp ($y);
25 $portal->apply ($pl->ob);
26 $portal->destroy;
27}
28
29# we have to special case some special cases :) 17# we have to special case some special cases :)
30sub reject_entry { 18sub reject_entry {
31 my ($pl) = @_; 19 my ($pl) = @_;
32 20
33 cf::override; 21 cf::override;
34 22
35 teleport $pl, "/world/world_105_115", 2, 34 23 $pl->goto ("/world/world_105_115", 2, 34)
36 unless 24 unless
37 $pl->ob->map 25 $pl->ob->map
38 && $pl->ob->map->path !~ /nimbus/ 26 && !$pl->ob->map->{path}{user_rel};
39 && $pl->ob->map->path !~ m%/var/crossfire/players/%;
40} 27}
41 28
42sub update_balance { 29sub update_balance {
43 my ($pl) = @_; 30 my ($pl) = @_;
44 31
201 $pl->ob->reply (undef, "Sir, you have to rent this apartment in The Apartment Shop in Scorn first!"); 188 $pl->ob->reply (undef, "Sir, you have to rent this apartment in The Apartment Shop in Scorn first!");
202 reject_entry $pl; 189 reject_entry $pl;
203 }, 190 },
204; 191;
205 192
206Event->timer (after => 60, interval => 3600, data => cf::WF_AUTOCANCEL, cb => sub { 193our $RENT_TIMER = Event->timer (after => 60, interval => 3600, data => cf::WF_AUTOCANCEL, cb => sub {
207 pay_balance $_ for cf::player::list; 194 pay_balance $_ for cf::player::list;
208}); 195});
209 196

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines