… | |
… | |
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 | |
17 | sub 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 :) |
30 | sub reject_entry { |
18 | sub 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 | |
42 | sub update_balance { |
29 | sub 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 | |
206 | Event->timer (after => 60, interval => 3600, data => cf::WF_AUTOCANCEL, cb => sub { |
193 | our $RENT_TIMER = Event->timer ( |
|
|
194 | reentrant => 0, |
|
|
195 | after => 60, |
|
|
196 | interval => 3600, |
|
|
197 | data => cf::WF_AUTOCANCEL, |
|
|
198 | cb => sub { |
207 | pay_balance $_ for cf::player::list; |
199 | pay_balance $_ for cf::player::list; |
|
|
200 | }, |
208 | }); |
201 | ); |
209 | |
202 | |