… | |
… | |
62 | my %res; |
62 | my %res; |
63 | |
63 | |
64 | if ($pl->cell_visible ($dx, $dy)) { |
64 | if ($pl->cell_visible ($dx, $dy)) { |
65 | for my $ob ($pl->ob->map->at ($pl->ob->x + $dx, $pl->ob->y + $dy)) { |
65 | for my $ob ($pl->ob->map->at ($pl->ob->x + $dx, $pl->ob->y + $dy)) { |
66 | $res{npc_dialog} = [$ob->name, $dx, $dy] |
66 | $res{npc_dialog} = [$ob->name, $dx, $dy] |
67 | if $near && NPC_Dialogue::has_dialogue $ob && !$pl->{npc_dialog}; |
67 | if $near && $ob->has_dialogue && !$pl->{npc_dialog}; |
68 | } |
68 | } |
69 | } |
69 | } |
70 | |
70 | |
71 | %res |
71 | %res |
72 | }; |
72 | }; |
… | |
… | |
96 | return (error => "too far away") unless (abs $dx) <= 2 && (abs $dy) <= 2; |
96 | return (error => "too far away") unless (abs $dx) <= 2 && (abs $dy) <= 2; |
97 | return (error => "nothing to talk there") unless $pl->cell_visible ($dx, $dy); |
97 | return (error => "nothing to talk there") unless $pl->cell_visible ($dx, $dy); |
98 | return (error => "only one dialog can be open at a time") if $pl->{npc_dialog}; # only one dialog at a time |
98 | return (error => "only one dialog can be open at a time") if $pl->{npc_dialog}; # only one dialog at a time |
99 | |
99 | |
100 | for my $npc ($pl->ob->map->at ($pl->ob->x + $dx, $pl->ob->y + $dy)) { |
100 | for my $npc ($pl->ob->map->at ($pl->ob->x + $dx, $pl->ob->y + $dy)) { |
101 | if (NPC_Dialogue::has_dialogue $npc) { |
101 | if ($npc->has_dialogue) { |
102 | $pl->attach ("npc_dialog_active"); |
102 | $pl->attach ("npc_dialog_active"); |
103 | $pl->{npc_dialog} = new NPC_Dialogue pl => $pl, npc => $npc, id => $id; |
103 | $pl->{npc_dialog} = new NPC_Dialogue pl => $pl, npc => $npc, id => $id; |
104 | dialog_tell $id, $pl->{npc_dialog}, "hi"; |
104 | dialog_tell $id, $pl->{npc_dialog}, "hi"; |
105 | return; |
105 | return; |
106 | } |
106 | } |
… | |
… | |
149 | |
149 | |
150 | servertype => (game|test) type of this server |
150 | servertype => (game|test) type of this server |
151 | gameserver => the hostname:port of the normal game server |
151 | gameserver => the hostname:port of the normal game server |
152 | testserver => the hostname:port of the test server the maps can be tested on |
152 | testserver => the hostname:port of the test server the maps can be tested on |
153 | cvs_root => the (http) url where the cvs root for downloading is located |
153 | cvs_root => the (http) url where the cvs root for downloading is located |
154 | lib_root => the (http) url where crossfire.0 and archetypes can be found |
154 | lib_root => the (http) url where archetypes data can be found |
155 | upload => the (http) url where clients can upload maps |
155 | upload => the (http) url where clients can upload maps |
156 | |
156 | |
157 | If those values are not supplied or empty strings, the server does not |
157 | If those values are not supplied or empty strings, the server does not |
158 | support downloading, uploading, testing, respectively. |
158 | support downloading, uploading, testing, respectively. |
159 | |
159 | |
… | |
… | |
163 | path: absolute server-side map path beginning with / |
163 | path: absolute server-side map path beginning with / |
164 | map: the map file itself |
164 | map: the map file itself |
165 | mapdir: the cvs root url originally used to download the map |
165 | mapdir: the cvs root url originally used to download the map |
166 | revision: cvs-revision originally used to download the map |
166 | revision: cvs-revision originally used to download the map |
167 | comment: a comment supplied by the user that documents the changes |
167 | comment: a comment supplied by the user that documents the changes |
168 | cf_login: crossfire server login |
168 | login: deliantra server login |
169 | cf_password: crossfire server password, optionally used for authentication purposes |
169 | password: deliantra server password, optionally used for authentication purposes |
170 | |
170 | |
171 | =cut |
171 | =cut |
172 | |
172 | |
173 | cf::register_extcmd editor_support => sub { |
173 | cf::register_extcmd editor_support => sub { |
174 | my ($pl, %msg) = @_; |
174 | my ($pl, %msg) = @_; |
… | |
… | |
207 | $pl->ext_msg ($dialog->{id} => error => "out of range"); |
207 | $pl->ext_msg ($dialog->{id} => error => "out of range"); |
208 | } |
208 | } |
209 | |
209 | |
210 | delete $pl->{npc_dialog}; |
210 | delete $pl->{npc_dialog}; |
211 | $pl->detach ("npc_dialog_active"); |
211 | $pl->detach ("npc_dialog_active"); |
212 | }); |
212 | }; |
213 | }, |
213 | }, |
214 | ; |
214 | ; |
215 | |
215 | |
216 | cf::player->attach ( |
216 | cf::player->attach ( |
217 | on_login => sub { |
217 | on_login => sub { |