… | |
… | |
4 | # level 2: private rooms and saving maps (guilds, some other public saving maps) |
4 | # level 2: private rooms and saving maps (guilds, some other public saving maps) |
5 | # level 3: invite everywhere where no monsters are on the map |
5 | # level 3: invite everywhere where no monsters are on the map |
6 | # level 4: invite everywhere |
6 | # level 4: invite everywhere |
7 | |
7 | |
8 | # implement a 'follow' command |
8 | # implement a 'follow' command |
|
|
9 | |
|
|
10 | #TODO: fon't invite on damned ground |
9 | |
11 | |
10 | my $TIMEOUT = 60; |
12 | my $TIMEOUT = 60; |
11 | |
13 | |
12 | # determine level available to the player |
14 | # determine level available to the player |
13 | sub player_level { |
15 | sub player_level { |
… | |
… | |
36 | my $path = $map->path; |
38 | my $path = $map->path; |
37 | my $player = sprintf "%s/%s/", cf::localdir, cf::playerdir; |
39 | my $player = sprintf "%s/%s/", cf::localdir, cf::playerdir; |
38 | |
40 | |
39 | if ($player eq substr $path, 0, length $player) { |
41 | if ($player eq substr $path, 0, length $player) { |
40 | 1 |
42 | 1 |
41 | } elsif (grep $_->flag (cf::FLAG_UNIQUE) && $_->flag (cf::FLAG_IS_FLOOR), |
43 | } elsif (grep $_->flag (cf::FLAG_UNIQUE) && $_->flag (cf::FLAG_IS_FLOOR), $map->at ($x, $y)) { |
42 | $map->at ($x, $y)) { |
|
|
43 | 2 |
44 | 2 |
44 | } else { |
45 | } else { |
45 | 3 |
46 | 3 |
46 | } |
47 | } |
47 | } |
48 | } |
48 | |
49 | |
49 | my @maplevel = ( |
50 | my @maplevel = ( |
50 | "some mysterious hideout", |
51 | "some mysterious hideout", |
51 | "his home", |
52 | "his home", |
52 | "his guild", # wrong |
53 | "his guild", # wrong, this is any unique place !player-specific |
53 | "a nice place", |
54 | "a nice place", |
54 | "a place with monsters", |
55 | "a place with monsters", |
55 | ); |
56 | ); |
56 | |
57 | |
57 | my %invite; |
58 | my %invite; |
… | |
… | |
108 | if (!exists $invite{$args} || !exists $invite{$args}{$name}) { |
109 | if (!exists $invite{$args} || !exists $invite{$args}{$name}) { |
109 | $who->message ("Sorry, $args hasn't invited you."); |
110 | $who->message ("Sorry, $args hasn't invited you."); |
110 | } elsif ($invite{$args}{$name}[0] < time) { |
111 | } elsif ($invite{$args}{$name}[0] < time) { |
111 | $who->message ("Sorry, $args\'s invitation has expired."); |
112 | $who->message ("Sorry, $args\'s invitation has expired."); |
112 | } else { |
113 | } else { |
|
|
114 | my $inv = delete $invite{$args}{$name}; |
113 | $who->message ("A godly force starts to pull you up..."); |
115 | $who->message ("A godly force starts to pull you up..."); |
114 | teleport $who, @{$invite{$args}{$name}}[1,2,3]; |
116 | teleport $who, @{$inv}[1,2,3]; |
115 | $who->message ("... and sets you down where $args invited you to."); |
117 | $who->message ("... and sets you down where $args invited you to."); |
|
|
118 | |
116 | } |
119 | } |
117 | } |
120 | } |
118 | |
121 | |