… | |
… | |
70 | |
70 | |
71 | my $plevel = player_level $who; |
71 | my $plevel = player_level $who; |
72 | my $mlevel = map_level $map, $x, $y; |
72 | my $mlevel = map_level $map, $x, $y; |
73 | |
73 | |
74 | if (is_damned ($map, $x, $y)) { |
74 | if (is_damned ($map, $x, $y)) { |
75 | $who->message ("Your god isn't present here, you can't invite someone to unholy ground."); |
75 | $who->message ("Your god isn't present here, you can't invite someone to unholy ground. " |
|
|
76 | . "H<You can only use invite at places where you can use prayers.>"); |
76 | } elsif ($plevel >= $mlevel) { |
77 | } elsif ($plevel >= $mlevel) { |
77 | if (my $other = cf::player::find_active $args) { |
78 | if (my $other = cf::player::find_active $args) { |
78 | $who->message ("inviting player '$args', to cancel, use invite with no arguments or wait $TIMEOUT seconds"); |
79 | $who->message ("inviting player '$args', to cancel, use invite with no arguments or wait $TIMEOUT seconds"); |
79 | $other->ob->message ("$name invites you to $maplevel[$mlevel], to accept, use 'accept-invitation $name"); |
80 | $other->ob->message ("$name invites you to $maplevel[$mlevel], to accept, use 'accept-invitation $name"); |
80 | $invite{$name}{$args} = [time + $TIMEOUT, $map, $x, $y]; |
81 | $invite{$name}{$args} = [time + $TIMEOUT, $map, $x, $y]; |
81 | } else { |
82 | } else { |
82 | $who->message ("cannot invite '$args': no such player"); |
83 | $who->message ("cannot invite '$args': no such player"); |
83 | } |
84 | } |
84 | } elsif ($plevel) { |
85 | } elsif ($plevel) { |
85 | $who->message ("Valriel deems you not worthy yet. Gorokh is annoyed by your sacrilege."); |
86 | $who->message ("Valriel deems you not worthy yet. Gorokh is annoyed by your sacrilege. " |
|
|
87 | . "H<Your invite level is not high enough to invite to this place.>"); |
86 | } else { |
88 | } else { |
87 | $who->message ("You haven't proven your worthyness in the mountain maze."); |
89 | $who->message ("You haven't proven your worthyness in the mountain maze. " |
|
|
90 | . "H<To use the invite command you have to do one or more of the invite quests. The first one can be found south-east of Scorn.>"); |
88 | } |
91 | } |
89 | } else { |
92 | } else { |
90 | $who->message ("canceling all invites"); |
93 | $who->message ("canceling all invites"); |
91 | delete $invite{$name}; |
94 | delete $invite{$name}; |
92 | } |
95 | } |
… | |
… | |
113 | |
116 | |
114 | my $name = $who->name; |
117 | my $name = $who->name; |
115 | my ($map, $x, $y) = ($who->map, $who->x, $who->y); |
118 | my ($map, $x, $y) = ($who->map, $who->x, $who->y); |
116 | |
119 | |
117 | if (is_damned ($map, $x, $y)) { |
120 | if (is_damned ($map, $x, $y)) { |
118 | $who->message ("You can't be invited from a place where your god isn't present."); |
121 | $who->message ("You can't be invited from a place where your god isn't present. " |
|
|
122 | . "H<Go to a place where your prayers work and try again.>"); |
119 | } elsif (!exists $invite{$args} || !exists $invite{$args}{$name}) { |
123 | } elsif (!exists $invite{$args} || !exists $invite{$args}{$name}) { |
120 | $who->message ("Sorry, $args hasn't invited you."); |
124 | $who->message ("Sorry, $args hasn't invited you."); |
121 | } elsif ($invite{$args}{$name}[0] < time) { |
125 | } elsif ($invite{$args}{$name}[0] < time) { |
122 | $who->message ("Sorry, $args\'s invitation has expired."); |
126 | $who->message ("Sorry, $args\'s invitation has expired. " |
|
|
127 | . "H<Invites are only valid for $TIMEOUT seconds, ask $args to invite you again.>"); |
123 | } else { |
128 | } else { |
124 | my $inv = delete $invite{$args}{$name}; |
129 | my $inv = delete $invite{$args}{$name}; |
125 | $who->message ("A godly force starts to pull you up..."); |
130 | $who->message ("A godly force starts to pull you up..."); |
126 | teleport $who, @{$inv}[1,2,3]; |
131 | teleport $who, @{$inv}[1,2,3]; |
127 | $who->message ("... and sets you down where $args invited you to."); |
132 | $who->message ("... and sets you down where $args invited you to."); |
128 | |
|
|
129 | } |
133 | } |
130 | }; |
134 | }; |
131 | |
135 | |