… | |
… | |
54 | cf::player->attach ( |
54 | cf::player->attach ( |
55 | prio => -1000, |
55 | prio => -1000, |
56 | on_login => sub { |
56 | on_login => sub { |
57 | my ($pl) = @_; |
57 | my ($pl) = @_; |
58 | |
58 | |
|
|
59 | cf::async { |
59 | clean_timeouts $pl->ob; |
60 | clean_timeouts $pl->ob; |
|
|
61 | }; |
60 | |
62 | |
61 | $pl->send_msg ($cf::SAY_CHANNEL); |
63 | $pl->send_msg ($cf::SAY_CHANNEL); |
62 | $pl->send_msg ($cf::CHAT_CHANNEL); |
64 | $pl->send_msg ($cf::CHAT_CHANNEL); |
63 | }, |
65 | }, |
64 | ); |
66 | ); |
65 | |
67 | |
|
|
68 | # TODO: remove once safe |
66 | cf::register_command listen => sub { |
69 | cf::register_command listen => sub { |
67 | my ($pl, $msg) = @_; |
|
|
68 | my $player = cf::player::find_active $pl->name; |
|
|
69 | |
|
|
70 | if ($msg ne "") { |
|
|
71 | $msg = 10 if $msg > 10; |
|
|
72 | |
|
|
73 | my $prev_listen = $player->listening; |
|
|
74 | $player->listening ($msg); |
|
|
75 | if ($prev_listen == $player->listening) { |
|
|
76 | $pl->message ("Your verbose level stays at $prev_listen.", cf::NDI_REPLY); |
|
|
77 | } else { |
|
|
78 | $pl->message ("Your verbose level is now " . $player->listening . ". (previously: $prev_listen)", cf::NDI_REPLY); |
|
|
79 | } |
|
|
80 | } else { |
|
|
81 | $pl->message ("Your verbose level is " . $player->listening . ".", cf::NDI_REPLY); |
|
|
82 | } |
|
|
83 | }; |
70 | }; |
84 | |
71 | |
85 | cf::register_command cointoss => sub { |
72 | cf::register_command cointoss => sub { |
86 | my ($ob, $msg) = @_; |
73 | my ($ob, $msg) = @_; |
87 | |
74 | |
88 | my $pl = $ob->contr; |
75 | my $pl = $ob->contr; |
89 | my $name = $ob->name; |
76 | my $name = $ob->name; |
90 | |
77 | |
91 | my $coin = int rand 2 ? "Heads" : "Tails"; |
78 | my $coin = (cf::rndm 2) ? "Heads" : "Tails"; |
92 | |
79 | |
93 | send_msg $_, $cf::SAY_CHANNEL => "$name flips a coin.... $coin!", cf::NDI_GREY, "msg_say" |
80 | send_msg $_, $cf::SAY_CHANNEL => "$name flips a coin.... $coin!", cf::NDI_GREY, "msg_say" |
94 | for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl} cf::player::list; |
81 | for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl} cf::player::list; |
95 | |
82 | |
96 | $pl->send_msg ($cf::SAY_CHANNEL => "You flip a coin.... $coin!", cf::NDI_GREY | cf::NDI_REPLY); |
83 | $pl->send_msg ($cf::SAY_CHANNEL => "You flip a coin.... $coin!", cf::NDI_GREY | cf::NDI_REPLY); |
… | |
… | |
101 | |
88 | |
102 | my $pl = $ob->contr; |
89 | my $pl = $ob->contr; |
103 | my $name = $ob->name; |
90 | my $name = $ob->name; |
104 | |
91 | |
105 | my @orcknuckle = ("beholder", "ghost", "knight", "princess", "dragon", "orc"); |
92 | my @orcknuckle = ("beholder", "ghost", "knight", "princess", "dragon", "orc"); |
106 | my ($i, $j, $k, $l) = (rand 5, rand 5, rand 5, rand 6); |
93 | my ($i, $j, $k, $l) = map +(cf::rndm $_), 5, 5, 5, 6; |
107 | my $result = "$orcknuckle[$i], $orcknuckle[$j], $orcknuckle[$k], $orcknuckle[$l]"; |
94 | my $result = "$orcknuckle[$i], $orcknuckle[$j], $orcknuckle[$k], $orcknuckle[$l]"; |
108 | |
95 | |
109 | send_msg $_, $cf::SAY_CHANNEL => "$name throws his orc-knuckles and rolls $result!", cf::NDI_GREY, "msg_say" |
96 | send_msg $_, $cf::SAY_CHANNEL => "$name throws his orc-knuckles and rolls $result!", cf::NDI_GREY, "msg_say" |
110 | for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl} cf::player::list; |
97 | for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl} cf::player::list; |
111 | |
98 | |
… | |
… | |
163 | self => { |
150 | self => { |
164 | }, |
151 | }, |
165 | }, |
152 | }, |
166 | scream => { |
153 | scream => { |
167 | noparams => { |
154 | noparams => { |
168 | other => "<self> screams at the top of his lungs!", |
155 | other => "<self> screams at the top of G<his|her> lungs!", |
169 | self => "ARRRRRRRRRRGH!!!!!", |
156 | self => "ARRRRRRRRRRGH!!!!!", |
170 | }, |
157 | }, |
171 | params => { |
158 | params => { |
172 | }, |
159 | }, |
173 | self => { |
160 | self => { |
… | |
… | |
182 | target => "<self> pukes on your clothes!", |
169 | target => "<self> pukes on your clothes!", |
183 | other => "<self> pukes on <other>.", |
170 | other => "<self> pukes on <other>.", |
184 | self => "You puke on <other>.", |
171 | self => "You puke on <other>.", |
185 | }, |
172 | }, |
186 | self => { |
173 | self => { |
187 | other => "<self> pukes on his clothes.", |
174 | other => "<self> pukes on G<his|her> clothes.", |
188 | self => "You puke on yourself.", |
175 | self => "You puke on yourself.", |
189 | }, |
176 | }, |
190 | }, |
177 | }, |
191 | strut => { |
178 | strut => { |
192 | noparams => { |
179 | noparams => { |
… | |
… | |
231 | }, |
218 | }, |
232 | }, |
219 | }, |
233 | kiss => { |
220 | kiss => { |
234 | noparams => { |
221 | noparams => { |
235 | other => "<self> makes a weird facial contortion", |
222 | other => "<self> makes a weird facial contortion", |
236 | self => "All the lonely people..", |
223 | self => "All the lonely people...", |
237 | }, |
224 | }, |
238 | params => { |
225 | params => { |
239 | target => "<self> kisses you.", |
226 | target => "<self> kisses you.", |
240 | other => "<self> kisses <other>.", |
227 | other => "<self> kisses <other>.", |
241 | self => "You kiss <other>.", |
228 | self => "You kiss <other>.", |
242 | }, |
229 | }, |
243 | self => { |
230 | self => { |
244 | }, |
231 | }, |
245 | }, |
232 | }, |
|
|
233 | hug => { |
|
|
234 | noparams => { |
|
|
235 | other => "<self> makes weird body movements.", |
|
|
236 | self => "All the lonely people...", |
|
|
237 | }, |
|
|
238 | params => { |
|
|
239 | target => "<self> suddenly grabs you and gives you a bear hug.", |
|
|
240 | other => "<self> hugs <other>.", |
|
|
241 | self => "You hug <other>.", |
|
|
242 | }, |
|
|
243 | self => { |
|
|
244 | other => "<self> tries to hug G<himself|herself>, but stumbles and now feels stupid.", |
|
|
245 | self => "You try and fail to hug yourself.", |
|
|
246 | }, |
|
|
247 | }, |
246 | smother => { |
248 | smother => { |
247 | noparams => { |
249 | noparams => { |
248 | other => "<self> makes weird facial contortions", |
250 | other => "<self> makes weird facial contortions", |
249 | self => "All the lonely people..", |
251 | self => "All the lonely people...", |
250 | }, |
252 | }, |
251 | params => { |
253 | params => { |
252 | target => "<self> smothers you with kisses.", |
254 | target => "<self> smothers you with kisses.", |
253 | other => "<self> smothers <other> with kisses.", |
255 | other => "<self> smothers <other> with kisses.", |
254 | self => "You smother <other> with kisses.", |
256 | self => "You smother <other> with kisses.", |
… | |
… | |
265 | target => "<self> winks at you.", |
267 | target => "<self> winks at you.", |
266 | other => "<self> winks at <other>.", |
268 | other => "<self> winks at <other>.", |
267 | self => "You wink suggestively at <other>.", |
269 | self => "You wink suggestively at <other>.", |
268 | }, |
270 | }, |
269 | self => { |
271 | self => { |
270 | other => "<self> winks at himself - something strange is going on...", |
272 | other => "<self> winks at G<him|her>self - something strange is going on...", |
271 | self => "You wink at yourself?? What are you up to?", |
273 | self => "You wink at yourself?? What are you up to?", |
272 | }, |
274 | }, |
273 | }, |
275 | }, |
274 | pout => { |
276 | pout => { |
275 | noparams => { |
277 | noparams => { |
… | |
… | |
281 | self => { |
283 | self => { |
282 | }, |
284 | }, |
283 | }, |
285 | }, |
284 | cackle => { |
286 | cackle => { |
285 | noparams => { |
287 | noparams => { |
286 | other => "<self> throws back his head and cackles with insane glee!", |
288 | other => "<self> throws back G<his|her> head and cackles with insane glee!", |
287 | self => "You cackle gleefully.", |
289 | self => "You cackle gleefully.", |
288 | }, |
290 | }, |
289 | params => { |
291 | params => { |
290 | }, |
292 | }, |
291 | self => { |
293 | self => { |
… | |
… | |
300 | target => "<self> sniffs you.", |
302 | target => "<self> sniffs you.", |
301 | other => "<self> sniffs <other>", |
303 | other => "<self> sniffs <other>", |
302 | self => "You sniff <other>.", |
304 | self => "You sniff <other>.", |
303 | }, |
305 | }, |
304 | self => { |
306 | self => { |
305 | other => "<self> sniffs himself.", |
307 | other => "<self> sniffs G<him|her>self.", |
306 | self => "You sniff yourself.", |
308 | self => "You sniff yourself.", |
307 | }, |
309 | }, |
308 | }, |
310 | }, |
309 | nod => { |
311 | nod => { |
310 | noparams => { |
312 | noparams => { |
311 | other => "<self> nods solemnly.", |
313 | other => "<self> nods solemnly.", |
312 | self => "You nod solemnly.", |
314 | self => "You nod solemnly.", |
313 | }, |
315 | }, |
314 | params => { |
316 | params => { |
315 | target => "<self> nods solemnly to you.", |
317 | target => "<self> nods solemnly at you.", |
316 | other => "<self> nods solemnly to <other>.", |
318 | other => "<self> nods solemnly at <other>.", |
317 | self => "You nod solemnly to <other>.", |
319 | self => "You nod solemnly at <other>.", |
318 | }, |
320 | }, |
319 | self => { |
321 | self => { |
320 | }, |
322 | }, |
321 | }, |
323 | }, |
322 | frown => { |
324 | frown => { |
… | |
… | |
328 | target => "<self> frowns darkly at you.", |
330 | target => "<self> frowns darkly at you.", |
329 | other => "<self> frowns darkly at <other>.", |
331 | other => "<self> frowns darkly at <other>.", |
330 | self => "You frown darkly at <other>.", |
332 | self => "You frown darkly at <other>.", |
331 | }, |
333 | }, |
332 | self => { |
334 | self => { |
333 | other => "<self> frowns at himself.", |
335 | other => "<self> frowns at G<him|her>self.", |
334 | self => "You frown at yourself.", |
336 | self => "You frown at yourself.", |
335 | }, |
337 | }, |
336 | }, |
338 | }, |
337 | snicker => { |
339 | snicker => { |
338 | noparams => { |
340 | noparams => { |
… | |
… | |
361 | noparams => { |
363 | noparams => { |
362 | other => "<self> is bleeding all over the carpet - got a spare tourniquet?", |
364 | other => "<self> is bleeding all over the carpet - got a spare tourniquet?", |
363 | self => "You bleed all over your nice new armour.", |
365 | self => "You bleed all over your nice new armour.", |
364 | }, |
366 | }, |
365 | params => { |
367 | params => { |
366 | target => "<self> slashes his wrist and bleeds all over you.", |
368 | target => "<self> slashes G<his|her> wrist and bleeds all over you.", |
367 | other => "<self> slashes his wrist and bleeds all over <other>.", |
369 | other => "<self> slashes G<his|her> wrist and bleeds all over <other>.", |
368 | self => "You slash your wrist and bleed all over <other>", |
370 | self => "You slash your wrist and bleed all over <other>", |
369 | }, |
371 | }, |
370 | self => { |
372 | self => { |
371 | other => "<self> performs some satanic ritual while wiping his blood on himself.", |
373 | other => "<self> performs some satanic ritual while wiping G<his|her> blood on G<him|her>self.", |
372 | self => "Very impressive! You wipe your blood all over yourself.", |
374 | self => "Very impressive! You wipe your blood all over yourself.", |
373 | }, |
375 | }, |
374 | }, |
376 | }, |
375 | twiddle => { |
377 | twiddle => { |
376 | noparams => { |
378 | noparams => { |
377 | other => "<self> patiently twiddles his thumbs.", |
379 | other => "<self> patiently twiddles G<his|her> thumbs.", |
378 | self => "You patiently twiddle your thumbs.", |
380 | self => "You patiently twiddle your thumbs.", |
379 | }, |
381 | }, |
380 | params => { |
382 | params => { |
381 | }, |
383 | }, |
382 | self => { |
384 | self => { |
383 | }, |
385 | }, |
384 | }, |
386 | }, |
385 | spit => { |
387 | spit => { |
386 | noparams => { |
388 | noparams => { |
387 | other => "<self> spits over his left shoulder.", |
389 | other => "<self> spits over G<his|her> left shoulder.", |
388 | self => "You spit over your left shoulder.", |
390 | self => "You spit over your left shoulder.", |
389 | }, |
391 | }, |
390 | params => { |
392 | params => { |
391 | target => "<self> spits in your face!", |
393 | target => "<self> spits in your face!", |
392 | other => "<self> spits in <other>'s face.", |
394 | other => "<self> spits in <other>'s face.", |
393 | self => "You spit on <other>.", |
395 | self => "You spit on <other>.", |
394 | }, |
396 | }, |
395 | self => { |
397 | self => { |
396 | other => "<self> drools all over himself.", |
398 | other => "<self> drools all over G<him|her>self.", |
397 | self => "You drool all over yourself.", |
399 | self => "You drool all over yourself.", |
398 | }, |
400 | }, |
399 | }, |
401 | }, |
400 | glare => { |
402 | glare => { |
401 | noparams => { |
403 | noparams => { |
402 | other => "<self> glares around him.", |
404 | other => "<self> glares around G<him|her>.", |
403 | self => "You glare at nothing in particular.", |
405 | self => "You glare at nothing in particular.", |
404 | }, |
406 | }, |
405 | params => { |
407 | params => { |
406 | target => "<self> glares icily at you, you feel cold to your bones.", |
408 | target => "<self> glares icily at you, you feel cold to your bones.", |
407 | other => "<self> glares at <other>.", |
409 | other => "<self> glares at <other>.", |
408 | self => "You glare icily at <other>.", |
410 | self => "You glare icily at <other>.", |
409 | }, |
411 | }, |
410 | self => { |
412 | self => { |
411 | other => "<self> glares at his feet, what is bothering him?", |
413 | other => "<self> glares at G<his|her> feet, what is bothering G<him|her>?", |
412 | self => "You glare icily at your feet, they are suddenly very cold.", |
414 | self => "You glare icily at your feet, they are suddenly very cold.", |
413 | }, |
415 | }, |
414 | }, |
416 | }, |
415 | bow => { |
417 | bow => { |
416 | noparams => { |
418 | noparams => { |
… | |
… | |
421 | target => "<self> bows before you.", |
423 | target => "<self> bows before you.", |
422 | other => "<self> bows before <other>.", |
424 | other => "<self> bows before <other>.", |
423 | self => "You bow before <other>.", |
425 | self => "You bow before <other>.", |
424 | }, |
426 | }, |
425 | self => { |
427 | self => { |
426 | other => "<self> folds up like a jackknife and kisses his own toes.", |
428 | other => "<self> folds up like a jackknife and kisses G<his|her> own toes.", |
427 | self => "You kiss your toes.", |
429 | self => "You kiss your toes.", |
428 | }, |
430 | }, |
429 | }, |
431 | }, |
430 | dance => { |
432 | dance => { |
431 | noparams => { |
433 | noparams => { |
432 | other => "<self> expresses himself through interpretive dance.", |
434 | other => "<self> expresses G<him|her>self through interpretive dance.", |
433 | self => "You dance with glee.", |
435 | self => "You dance with glee.", |
434 | }, |
436 | }, |
435 | params => { |
437 | params => { |
436 | target => "<self> grabs you, and begins dancing!", |
438 | target => "<self> grabs you, and begins dancing!", |
437 | other => "Yipe! <self> and <other> are doing the Macarena!", |
439 | other => "Yipe! <self> and <other> are doing the Macarena!", |
438 | self => "You grab <other> and begin doing the Cha-Cha!", |
440 | self => "You grab <other> and begin doing the Cha-Cha!", |
439 | }, |
441 | }, |
440 | self => { |
442 | self => { |
441 | other => "<self> embraces himself and begins to dance!", |
443 | other => "<self> embraces G<him|her>self and begins to dance!", |
442 | self => "You skip and dance around by yourself.", |
444 | self => "You skip and dance around by yourself.", |
443 | }, |
445 | }, |
444 | }, |
446 | }, |
445 | snore => { |
447 | snore => { |
446 | noparams => { |
448 | noparams => { |
… | |
… | |
462 | self => { |
464 | self => { |
463 | }, |
465 | }, |
464 | }, |
466 | }, |
465 | snap => { |
467 | snap => { |
466 | noparams => { |
468 | noparams => { |
467 | other => "<self> snaps his fingers.", |
469 | other => "<self> snaps G<his|her> fingers.", |
468 | self => "PRONTO! you snap your fingers.", |
470 | self => "PRONTO! you snap your fingers.", |
469 | }, |
471 | }, |
470 | params => { |
472 | params => { |
471 | }, |
473 | }, |
472 | self => { |
474 | self => { |
… | |
… | |
481 | target => "<self> waves goodbye to you. Have a good journey.", |
483 | target => "<self> waves goodbye to you. Have a good journey.", |
482 | other => "<self> waves goodbye to <other>.", |
484 | other => "<self> waves goodbye to <other>.", |
483 | self => "You wave goodbye to <other>.", |
485 | self => "You wave goodbye to <other>.", |
484 | }, |
486 | }, |
485 | self => { |
487 | self => { |
486 | other => "<self> waves goodbye to himself.", |
488 | other => "<self> waves goodbye to G<him|her>self.", |
487 | self => "Are you going on adventures as well??", |
489 | self => "Are you going on adventures as well??", |
488 | }, |
490 | }, |
489 | }, |
491 | }, |
490 | smile => { |
492 | smile => { |
491 | noparams => { |
493 | noparams => { |
… | |
… | |
505 | other => "<self> sneezes.", |
507 | other => "<self> sneezes.", |
506 | self => "Gesundheit!", |
508 | self => "Gesundheit!", |
507 | }, |
509 | }, |
508 | params => { |
510 | params => { |
509 | target => "<self> sneezes on you, you feel the snot cover you. EEEEEEW.", |
511 | target => "<self> sneezes on you, you feel the snot cover you. EEEEEEW.", |
510 | other => "<self> sneezes on <other> and a film of snot covers him.", |
512 | other => "<self> sneezes on <other> and a film of snot covers G<him|her>.", |
511 | self => "You sneeze at <other> and a film of snot shoots onto him.", |
513 | self => "You sneeze at <other> and a film of snot shoots onto G<him|her>.", |
512 | }, |
514 | }, |
513 | self => { |
515 | self => { |
514 | other => "<self> sneezes, and covers himself in a slimy substance.", |
516 | other => "<self> sneezes, and covers G<him|her>self in a slimy substance.", |
515 | self => "You sneeze on yourself, what a mess!", |
517 | self => "You sneeze on yourself, what a mess!", |
516 | }, |
518 | }, |
517 | }, |
519 | }, |
518 | bounce => { |
520 | bounce => { |
519 | noparams => { |
521 | noparams => { |
… | |
… | |
528 | self => { |
530 | self => { |
529 | }, |
531 | }, |
530 | }, |
532 | }, |
531 | shake => { |
533 | shake => { |
532 | noparams => { |
534 | noparams => { |
533 | other => "<self> shakes his head.", |
535 | other => "<self> shakes G<his|her> head.", |
534 | self => "You shake your head.", |
536 | self => "You shake your head.", |
535 | }, |
537 | }, |
536 | params => { |
538 | params => { |
537 | target => "<self> shakes your hand.", |
539 | target => "<self> shakes your hand.", |
538 | other => "<self> shakes <other>'s hand.", |
540 | other => "<self> shakes <other>'s hand.", |
… | |
… | |
543 | self => "You are shaken by yourself.", |
545 | self => "You are shaken by yourself.", |
544 | }, |
546 | }, |
545 | }, |
547 | }, |
546 | lick => { |
548 | lick => { |
547 | noparams => { |
549 | noparams => { |
548 | other => "<self> licks his mouth and smiles.", |
550 | other => "<self> licks G<his|her> mouth and smiles.", |
549 | self => "You lick your mouth and smile.", |
551 | self => "You lick your mouth and smile.", |
550 | }, |
552 | }, |
551 | params => { |
553 | params => { |
552 | target => "<self> licks you.", |
554 | target => "<self> licks you.", |
553 | other => "<self> licks <other>.", |
555 | other => "<self> licks <other>.", |
554 | self => "You lick <other>.", |
556 | self => "You lick <other>.", |
555 | }, |
557 | }, |
556 | self => { |
558 | self => { |
557 | other => "<self> licks himself - YUCK.", |
559 | other => "<self> licks G<him|her>self - YUCK.", |
558 | self => "You lick yourself.", |
560 | self => "You lick yourself.", |
559 | }, |
561 | }, |
560 | }, |
562 | }, |
561 | flip => { |
563 | flip => { |
562 | noparams => { |
564 | noparams => { |
… | |
… | |
568 | self => { |
570 | self => { |
569 | }, |
571 | }, |
570 | }, |
572 | }, |
571 | think => { |
573 | think => { |
572 | noparams => { |
574 | noparams => { |
573 | other => "<self> closes his eyes and thinks really hard.", |
575 | other => "<self> closes G<his|her> eyes and thinks really hard.", |
574 | self => "Anything in particular that you'd care to think about?", |
576 | self => "Anything in particular that you'd care to think about?", |
575 | }, |
577 | }, |
576 | params => { |
578 | params => { |
577 | }, |
579 | }, |
578 | self => { |
580 | self => { |
… | |
… | |
642 | target => "<self> cries on your shoulder.", |
644 | target => "<self> cries on your shoulder.", |
643 | other => "<self> cries on <other>'s shoulder.", |
645 | other => "<self> cries on <other>'s shoulder.", |
644 | self => "You cry on <other>'s shoulder.", |
646 | self => "You cry on <other>'s shoulder.", |
645 | }, |
647 | }, |
646 | self => { |
648 | self => { |
647 | other => "<self> sobs quietly to himself.", |
649 | other => "<self> sobs quietly to G<him|her>self.", |
648 | self => "You cry to yourself.", |
650 | self => "You cry to yourself.", |
649 | }, |
651 | }, |
650 | }, |
652 | }, |
651 | sulk => { |
653 | sulk => { |
652 | noparams => { |
654 | noparams => { |
… | |
… | |
666 | params => { |
668 | params => { |
667 | target => "<self> whistles at <other>.", |
669 | target => "<self> whistles at <other>.", |
668 | self => "You whistle at <other>.", |
670 | self => "You whistle at <other>.", |
669 | }, |
671 | }, |
670 | self => { |
672 | self => { |
671 | other => "<self> whistles to himself in boredom.", |
673 | other => "<self> whistles to G<him|her>self in boredom.", |
672 | self => "You whistle while you work.", |
674 | self => "You whistle while you work.", |
673 | }, |
675 | }, |
674 | }, |
676 | }, |
675 | groan => { |
677 | groan => { |
676 | noparams => { |
678 | noparams => { |
… | |
… | |
722 | |
724 | |
723 | $emote{other} ||= "You look away from <self>."; |
725 | $emote{other} ||= "You look away from <self>."; |
724 | $emote{self} ||= "My god! Is that LEGAL?"; |
726 | $emote{self} ||= "My god! Is that LEGAL?"; |
725 | |
727 | |
726 | $emote{other} =~ s/<self>/$name/; |
728 | $emote{other} =~ s/<self>/$name/; |
|
|
729 | |
|
|
730 | $_ = $pl->expand_cfpod ($_) |
|
|
731 | for values %emote; |
727 | |
732 | |
728 | send_msg $_, $cf::CHAT_CHANNEL, $emote{other}, cf::NDI_GREY, "msg_chat" |
733 | send_msg $_, $cf::CHAT_CHANNEL, $emote{other}, cf::NDI_GREY | cf::NDI_VERBATIM, "msg_chat" |
729 | for grep { $ob->on_same_map_as ($_->ob) && $_ != $ob} cf::player::list; |
734 | for grep { $ob->on_same_map_as ($_->ob) && $_ != $ob} cf::player::list; |
730 | |
735 | |
731 | $pl->send_msg ($emote{self}, cf::NDI_GREY | cf::NDI_REPLY); |
736 | $pl->send_msg ($emote{self}, cf::NDI_GREY | cf::NDI_REPLY | cf::NDI_VERBATIM); |
732 | } elsif ($tname) { |
737 | } elsif ($tname) { |
733 | my $target = cf::player::find $tname |
738 | my $target = cf::player::find $tname |
734 | or return send_msg $pl, tell_channel $tname, "$tname is not around.", cf::NDI_DK_ORANGE | cf::NDI_REPLY, "msg_chat"; |
739 | or return send_msg $pl, tell_channel $tname, "$tname is not around.", cf::NDI_DK_ORANGE | cf::NDI_REPLY, "msg_chat"; |
735 | |
740 | |
736 | my %emote = %{ $emotes->{$emotion}->{params} || {} }; |
741 | my %emote = %{ $emotes->{$emotion}->{params} || {} }; |
… | |
… | |
742 | $emote{self} =~ s/<other>/$tname/; |
747 | $emote{self} =~ s/<other>/$tname/; |
743 | $emote{target} =~ s/<self>/$name/; |
748 | $emote{target} =~ s/<self>/$name/; |
744 | $emote{other} =~ s/<other>/$tname/; |
749 | $emote{other} =~ s/<other>/$tname/; |
745 | $emote{other} =~ s/<self>/$name/; |
750 | $emote{other} =~ s/<self>/$name/; |
746 | |
751 | |
|
|
752 | $_ = $pl->expand_cfpod ($_) |
|
|
753 | for values %emote; |
|
|
754 | |
747 | send_msg $_, $cf::CHAT_CHANNEL, $emote{other}, cf::NDI_GREY, "msg_chat" |
755 | send_msg $_, $cf::CHAT_CHANNEL, $emote{other}, cf::NDI_GREY | cf::NDI_VERBATIM, "msg_chat" |
748 | for grep { $_ != $pl && $_ != $target && $ob->on_same_map_as ($_->ob) } cf::player::list; |
756 | for grep { $_ != $pl && $_ != $target && $ob->on_same_map_as ($_->ob) } cf::player::list; |
749 | |
757 | |
750 | send_msg $target, tell_channel $name, $emote{target}, cf::NDI_GREY, "msg_shout"; |
758 | send_msg $target, tell_channel $name, $emote{target}, cf::NDI_GREY | cf::NDI_VERBATIM, "msg_shout"; |
751 | $pl->send_msg (tell_channel $tname, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY); |
759 | $pl->send_msg (tell_channel $tname, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY | cf::NDI_VERBATIM); |
752 | } else { |
760 | } else { |
753 | my %emote = %{ $emotes->{$emotion}->{noparams} || {} }; |
761 | my %emote = %{ $emotes->{$emotion}->{noparams} || {} }; |
754 | |
762 | |
755 | $emote{other} ||= "<self> dances with glee."; |
763 | $emote{other} ||= "<self> dances with glee."; |
756 | $emote{self} ||= "You are a nut."; |
764 | $emote{self} ||= "You are a nut."; |
757 | |
765 | |
758 | $emote{other} =~ s/<self>/$name/; |
766 | $emote{other} =~ s/<self>/$name/; |
759 | |
767 | |
|
|
768 | $_ = $pl->expand_cfpod ($_) |
|
|
769 | for values %emote; |
|
|
770 | |
760 | send_msg $_, $cf::CHAT_CHANNEL, $emote{other}, cf::NDI_GREY, "msg_chat" |
771 | send_msg $_, $cf::CHAT_CHANNEL, $emote{other}, cf::NDI_GREY | cf::NDI_VERBATIM, "msg_chat" |
761 | for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl } cf::player::list; |
772 | for grep { $ob->on_same_map_as ($_->ob) && $_ != $pl } cf::player::list; |
762 | |
773 | |
763 | $pl->send_msg ($cf::CHAT_CHANNEL, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY); |
774 | $pl->send_msg ($cf::CHAT_CHANNEL, $emote{self}, cf::NDI_GREY | cf::NDI_REPLY | cf::NDI_VERBATIM); |
764 | } |
775 | } |
765 | }; |
776 | }; |
766 | }; |
777 | }; |
767 | } |
778 | } |
768 | |
779 | |
769 | cf::register_command me => sub { |
|
|
770 | my ($pl, $msg) = @_; |
|
|
771 | |
|
|
772 | my $name = $pl->name; |
|
|
773 | |
|
|
774 | send_msg $_, $cf::SAY_CHANNEL => "* $name $msg", cf::NDI_GREY | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_say" |
|
|
775 | for grep $pl->on_same_map_as ($_->ob), cf::player::list; |
|
|
776 | }; |
|
|
777 | |
|
|
778 | cf::register_command say => sub { |
780 | cf::register_command say => sub { |
779 | my ($ob, $msg) = @_; |
781 | my ($ob, $msg) = @_; |
780 | |
782 | |
781 | utf8::decode $msg; |
783 | utf8::decode $msg; |
782 | |
784 | |
… | |
… | |
787 | my @plonmap = grep $ob->on_same_map_as ($_->ob), cf::player::list; |
789 | my @plonmap = grep $ob->on_same_map_as ($_->ob), cf::player::list; |
788 | |
790 | |
789 | send_msg $_, $cf::SAY_CHANNEL => "$name says: $msg", cf::NDI_GREY, "msg_say" |
791 | send_msg $_, $cf::SAY_CHANNEL => "$name says: $msg", cf::NDI_GREY, "msg_say" |
790 | for grep $_ != $ob->contr, @plonmap; |
792 | for grep $_ != $ob->contr, @plonmap; |
791 | $ob->contr->send_msg ($cf::SAY_CHANNEL => "$name says: $msg", cf::NDI_GREY | cf::NDI_REPLY); |
793 | $ob->contr->send_msg ($cf::SAY_CHANNEL => "$name says: $msg", cf::NDI_GREY | cf::NDI_REPLY); |
|
|
794 | |
|
|
795 | my @npc; |
792 | |
796 | |
793 | # npcs, magic_ears etc. |
797 | # npcs, magic_ears etc. |
794 | # first find all objects and their first-level inventories |
798 | # first find all objects and their first-level inventories |
795 | # within a 5x5 square that have something resembling |
799 | # within a 5x5 square that have something resembling |
796 | # dialogue or support on_say. |
800 | # dialogue or support on_say. |
|
|
801 | # we prefer the nearest items NOT in the player, otherwise in player. |
797 | my ($map, $x, $y) = ($ob->map, $ob->x - 2, $ob->y - 2); |
802 | my ($map, $x, $y) = ($ob->map, $ob->x, $ob->y); |
798 | |
803 | |
799 | for my $npc ( |
804 | for my $dir ( |
800 | grep +($_->invoke (cf::EVENT_OBJECT_SAY, $ob->contr, $msg) && return) || NPC_Dialogue::has_dialogue $_, |
805 | 0, |
801 | map +($_, $_->inv), |
806 | 1, 3, 5, 7, |
802 | grep $_, |
807 | 2, 4, 6, 8, |
803 | map $map->at ($x + $_ % 5, $y + (int $_ / 5)), |
808 | 9 .. cf::SIZEOFFREE2 |
804 | 0..24 |
|
|
805 | ) { |
809 | ) { |
|
|
810 | @npc = grep $_->should_invoke (cf::EVENT_OBJECT_SAY) || $_->has_dialogue, |
|
|
811 | map +($_, $_->inv), |
|
|
812 | grep $_ != $ob, |
|
|
813 | $map->at ($x, $y, $dir) |
|
|
814 | and last; |
|
|
815 | } |
|
|
816 | |
|
|
817 | unless (@npc) { |
|
|
818 | # nothing found, try the player inventory |
|
|
819 | @npc = grep $_->should_invoke (cf::EVENT_OBJECT_SAY) || $_->has_dialogue, |
|
|
820 | $ob->inv; |
|
|
821 | } |
|
|
822 | |
|
|
823 | for my $npc (@npc) { |
|
|
824 | return if $npc->invoke (cf::EVENT_OBJECT_SAY); |
|
|
825 | |
806 | # if some listener teleported us somewhere else, stop right here |
826 | # if some listener teleported us somewhere else, stop right here |
807 | last unless $map->path == $ob->map->path; |
827 | last unless $map->path == $ob->map->path; |
808 | |
828 | |
|
|
829 | if ($npc->has_dialogue) { |
809 | my $dialog = new NPC_Dialogue pl => $ob->contr, npc => $npc; |
830 | my $dialog = new NPC_Dialogue pl => $ob->contr, npc => $npc; |
810 | my ($reply, @kw) = $dialog->tell ($msg); |
831 | my ($reply, @kw) = $dialog->tell ($msg); |
811 | |
832 | |
812 | if (defined $reply) { |
833 | if (defined $reply) { |
813 | if ($npc->type == cf::MAGIC_EAR) { |
834 | if ($npc->type == cf::MAGIC_EAR) { |
814 | if (length $reply) { |
|
|
815 | send_msg $_, $cf::SAY_CHANNEL => $reply, cf::NDI_BROWN, "msg_say" |
835 | send_msg $_, $cf::SAY_CHANNEL => $reply, cf::NDI_BROWN, "msg_say" |
816 | for @plonmap; |
836 | for @plonmap; |
817 | } |
|
|
818 | $npc->use_trigger; |
|
|
819 | } else { |
837 | } else { |
820 | if (length $reply) { |
|
|
821 | send_msg $_, $cf::SAY_CHANNEL => $npc->name . " says: $reply", cf::NDI_BROWN, "msg_say" |
838 | send_msg $_, $cf::SAY_CHANNEL => $npc->name . " says: $reply", cf::NDI_BROWN, "msg_say" |
822 | for @plonmap; |
839 | for @plonmap; |
823 | } |
840 | } |
824 | } |
841 | } |
825 | } |
|
|
826 | |
842 | |
827 | if (@kw) { |
843 | if (@kw) { |
828 | $_->send_msg ($cf::SAY_CHANNEL => "[further topics: " . (join ", ", @kw) . "]", cf::NDI_BROWN) |
844 | $_->send_msg ($cf::SAY_CHANNEL => "[further topics: " . (join ", ", @kw) . "]", cf::NDI_BROWN) |
829 | for @plonmap; |
845 | for @plonmap; |
|
|
846 | } |
830 | } |
847 | } |
831 | } |
848 | } |
832 | |
849 | |
833 | } else { |
850 | } else { |
834 | $ob->send_msg ($cf::SAY_CHANNEL => "What do you want to say?", cf::NDI_GREY | cf::NDI_REPLY); |
851 | $ob->send_msg ($cf::SAY_CHANNEL => "What do you want to say?", cf::NDI_GREY | cf::NDI_REPLY); |
835 | } |
852 | } |
836 | }; |
853 | }; |
837 | |
854 | |
838 | cf::register_command chat => sub { |
855 | |
|
|
856 | sub _chat { |
839 | my ($ob, $msg) = @_; |
857 | my ($ob, $msg) = @_; |
840 | |
|
|
841 | utf8::decode $msg; |
|
|
842 | |
858 | |
843 | my $pl = $ob->contr; |
859 | my $pl = $ob->contr; |
844 | |
860 | |
845 | return if $pl->invoke (cf::EVENT_PLAYER_CHAT, $msg); |
861 | return if $pl->invoke (cf::EVENT_PLAYER_CHAT, $msg); |
846 | |
862 | |
847 | if ($msg) { |
863 | if ($msg) { |
848 | my $name = $ob->name; |
864 | my $name = $ob->name; |
849 | my $NOW = time; |
865 | my $NOW = time; |
850 | |
866 | |
851 | cf::LOG cf::llevDebug, sprintf "QBERT [%s] %s\n", $name, $msg; |
867 | cf::LOG cf::llevDebug, sprintf "QBERT %s\n", $msg; |
852 | send_irc ("[%s] %s", $name, $msg); |
868 | send_irc ("%s", $msg); |
853 | |
869 | |
854 | send_msg $_, $cf::CHAT_CHANNEL => "$name chats: $msg", cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_chat" |
870 | send_msg $_, $cf::CHAT_CHANNEL => $msg, cf::NDI_BLUE | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_chat" |
855 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 10 } cf::player::list; |
871 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW } cf::player::list; |
856 | |
872 | |
857 | } else { |
873 | } else { |
858 | $pl->send_msg ($cf::CHAT_CHANNEL => "Chat what?", cf::NDI_BLUE | cf::NDI_DEF | cf::NDI_REPLY); |
874 | $pl->send_msg ($cf::CHAT_CHANNEL => "Chat what?", cf::NDI_BLUE | cf::NDI_DEF | cf::NDI_REPLY); |
859 | } |
875 | } |
|
|
876 | } |
|
|
877 | |
|
|
878 | cf::register_command chat => sub { |
|
|
879 | my ($ob, $msg) = @_; |
|
|
880 | |
|
|
881 | utf8::decode $msg; |
|
|
882 | _chat $ob, $ob->name . " chats: $msg"; |
|
|
883 | }; |
|
|
884 | |
|
|
885 | cf::register_command me => sub { |
|
|
886 | my ($ob, $msg) = @_; |
|
|
887 | |
|
|
888 | utf8::decode $msg; |
|
|
889 | _chat $ob, "* " . $ob->name . " $msg"; |
860 | }; |
890 | }; |
861 | |
891 | |
862 | cf::register_command shout => sub { |
892 | cf::register_command shout => sub { |
863 | my ($ob, $msg) = @_; |
893 | my ($ob, $msg) = @_; |
864 | |
894 | |
… | |
… | |
874 | |
904 | |
875 | cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; |
905 | cf::LOG cf::llevDebug, sprintf "QBERT {%s} %s\n", $name, $msg; |
876 | send_irc ("\007\0034{%s} %s\n", $name, $msg); |
906 | send_irc ("\007\0034{%s} %s\n", $name, $msg); |
877 | |
907 | |
878 | send_msg $_, $cf::CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_RED | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_shout" |
908 | send_msg $_, $cf::CHAT_CHANNEL => "$name shouts: $msg", cf::NDI_RED | cf::NDI_DEF | ($_ == $pl ? cf::NDI_REPLY : 0), "msg_shout" |
879 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW && $_->listening >= 2 } cf::player::list; |
909 | for grep { $_->ob->{ext_ignore_shout}{$name} < $NOW } cf::player::list; |
880 | |
910 | |
881 | } else { |
911 | } else { |
882 | $pl->send_msg ($cf::CHAT_CHANNEL => "Shout what?", cf::NDI_RED | cf::NDI_DEF | cf::NDI_REPLY); |
912 | $pl->send_msg ($cf::CHAT_CHANNEL => "Shout what?", cf::NDI_RED | cf::NDI_DEF | cf::NDI_REPLY); |
883 | } |
913 | } |
884 | }; |
914 | }; |
… | |
… | |
929 | |
959 | |
930 | cf::register_command ignore => sub { |
960 | cf::register_command ignore => sub { |
931 | my ($pl, $args) = @_; |
961 | my ($pl, $args) = @_; |
932 | my ($target, $type, $timeout) = split /\s+/, $args; |
962 | my ($target, $type, $timeout) = split /\s+/, $args; |
933 | |
963 | |
|
|
964 | cf::async { |
934 | if ($args eq "list") { |
965 | if ($args eq "list") { |
935 | clean_timeouts $pl; |
966 | clean_timeouts $pl; |
936 | |
967 | |
937 | if ((my @ignored_tell = sort keys %{$pl->{ext_ignore_tell}}) |
968 | if ((my @ignored_tell = sort keys %{$pl->{ext_ignore_tell}}) |
938 | + (my @ignored_shout = sort keys %{$pl->{ext_ignore_shout}})) { |
969 | + (my @ignored_shout = sort keys %{$pl->{ext_ignore_shout}})) { |
939 | $pl->message ("Currently ignoring private messages from: ", cf::NDI_REPLY); |
970 | $pl->message ("Currently ignoring private messages from: ", cf::NDI_REPLY); |
940 | $pl->message ((join ", ", @ignored_tell), cf::NDI_REPLY); |
971 | $pl->message ((join ", ", @ignored_tell), cf::NDI_REPLY); |
941 | $pl->message ("Currently ignoring shouts from: ", cf::NDI_REPLY); |
972 | $pl->message ("Currently ignoring shouts from: ", cf::NDI_REPLY); |
942 | $pl->message ((join ", ", @ignored_shout), cf::NDI_REPLY); |
973 | $pl->message ((join ", ", @ignored_shout), cf::NDI_REPLY); |
943 | $pl->message ("To stop ignoring one, use unignore.", cf::NDI_REPLY); |
974 | $pl->message ("To stop ignoring one, use unignore.", cf::NDI_REPLY); |
|
|
975 | } else { |
|
|
976 | $pl->message ("Not ignoring anyone", cf::NDI_REPLY); |
|
|
977 | } |
|
|
978 | |
|
|
979 | } elsif ($target && $type) { |
|
|
980 | $timeout ne "" or $timeout = 24; |
|
|
981 | my $absolute_timeout = time + $timeout * 3600; |
|
|
982 | |
|
|
983 | if (cf::player::exists $target) { |
|
|
984 | if ($type eq "tell") { |
|
|
985 | $pl->message ("Now ignoring private messages from $target for $timeout hours.", cf::NDI_REPLY); |
|
|
986 | $pl->{ext_ignore_tell}{$target} = $absolute_timeout; |
|
|
987 | } elsif ($type eq "shout") { |
|
|
988 | $pl->message ("Now ignoring shouts from $target for $timeout hours.", cf::NDI_REPLY); |
|
|
989 | $pl->{ext_ignore_shout}{$target} = $absolute_timeout; |
|
|
990 | } elsif ($type eq "all") { |
|
|
991 | $pl->message ("Now ignoring everything from $target for $timeout hours.", cf::NDI_REPLY); |
|
|
992 | $pl->{ext_ignore_tell}{$target} = $absolute_timeout; |
|
|
993 | $pl->{ext_ignore_shout}{$target} = $absolute_timeout; |
|
|
994 | } else { |
|
|
995 | $pl->message ("You need to specify tell, shout or all.", cf::NDI_REPLY); |
|
|
996 | } |
|
|
997 | } else { |
|
|
998 | $pl->message ("No such player: $target", cf::NDI_REPLY); |
|
|
999 | } |
|
|
1000 | |
944 | } else { |
1001 | } else { |
945 | $pl->message ("Not ignoring anyone", cf::NDI_REPLY); |
1002 | $pl->message ("Usage: ignore <player> <tell|shout|all> <timeout>\n" |
|
|
1003 | . "will ignore a player for <timeout> hours.\n" |
|
|
1004 | . "Usage: ignore list\n" |
|
|
1005 | . "will show you a list of players currently ignored.", cf::NDI_REPLY); |
946 | } |
1006 | } |
947 | |
|
|
948 | } elsif ($target && $type) { |
|
|
949 | |
|
|
950 | $timeout ne "" or $timeout = 24; |
|
|
951 | my $absolute_timeout = time + $timeout * 3600; |
|
|
952 | |
|
|
953 | if (cf::player::exists $target) { |
|
|
954 | if ($type eq "tell") { |
|
|
955 | $pl->message ("Now ignoring private messages from $target for $timeout hours.", cf::NDI_REPLY); |
|
|
956 | $pl->{ext_ignore_tell}{$target} = $absolute_timeout; |
|
|
957 | } elsif ($type eq "shout") { |
|
|
958 | $pl->message ("Now ignoring shouts from $target for $timeout hours.", cf::NDI_REPLY); |
|
|
959 | $pl->{ext_ignore_shout}{$target} = $absolute_timeout; |
|
|
960 | } elsif ($type eq "all") { |
|
|
961 | $pl->message ("Now ignoring everything from $target for $timeout hours.", cf::NDI_REPLY); |
|
|
962 | $pl->{ext_ignore_tell}{$target} = $absolute_timeout; |
|
|
963 | $pl->{ext_ignore_shout}{$target} = $absolute_timeout; |
|
|
964 | } else { |
|
|
965 | $pl->message ("You need to specify tell, shout or all.", cf::NDI_REPLY); |
|
|
966 | } |
|
|
967 | } else { |
|
|
968 | $pl->message ("No such player: $target", cf::NDI_REPLY); |
|
|
969 | } |
|
|
970 | |
|
|
971 | } else { |
|
|
972 | $pl->message ("Usage: ignore <player> <tell|shout|all> <timeout>\n" |
|
|
973 | . "will ignore a player for <timeout> hours.\n" |
|
|
974 | . "Usage: ignore list\n" |
|
|
975 | . "will show you a list of players currently ignored.", cf::NDI_REPLY); |
|
|
976 | } |
1007 | }; |
977 | }; |
1008 | }; |
978 | |
1009 | |
979 | cf::register_command unignore => sub { |
1010 | cf::register_command unignore => sub { |
980 | my ($pl, $args) = @_; |
1011 | my ($pl, $args) = @_; |
981 | my ($target, $type) = split /\s+/, $args; |
1012 | my ($target, $type) = split /\s+/, $args; |
982 | |
1013 | |
|
|
1014 | cf::async { |
983 | if ($args eq "") { |
1015 | if ($args eq "") { |
984 | if ($pl->{ext_ignore_tell}) { |
1016 | if ($pl->{ext_ignore_tell}) { |
985 | $pl->message ("Currently ignoring private messages from: ", cf::NDI_REPLY); |
1017 | $pl->message ("Currently ignoring private messages from: ", cf::NDI_REPLY); |
986 | $pl->message ((join ", ", sort keys %{ $pl->{ext_ignore_tell} }), cf::NDI_REPLY); |
1018 | $pl->message ((join ", ", sort keys %{ $pl->{ext_ignore_tell} }), cf::NDI_REPLY); |
987 | $pl->message ("Currently ignoring shouts from: ", cf::NDI_REPLY); |
1019 | $pl->message ("Currently ignoring shouts from: ", cf::NDI_REPLY); |
988 | $pl->message ((join ", ", sort keys %{ $pl->{ext_ignore_shout} }), cf::NDI_REPLY); |
1020 | $pl->message ((join ", ", sort keys %{ $pl->{ext_ignore_shout} }), cf::NDI_REPLY); |
989 | } else { |
|
|
990 | $pl->message ("Not ignoring anyone", cf::NDI_REPLY); |
|
|
991 | } |
|
|
992 | } else { |
|
|
993 | if (cf::player::exists $target) { |
|
|
994 | if ($type eq "tell") { |
|
|
995 | $pl->message ("Not ignoring private messages from $target anymore.", cf::NDI_REPLY); |
|
|
996 | delete $pl->{ext_ignore_tell} {$target}; |
|
|
997 | } elsif ($type eq "shout") { |
|
|
998 | $pl->message ("Not ignoring shouts from $target anymore.", cf::NDI_REPLY); |
|
|
999 | delete $pl->{ext_ignore_shout}{$target}; |
|
|
1000 | } elsif ($type eq "all") { |
|
|
1001 | $pl->message ("Not ignoring anything from $target anymore.", cf::NDI_REPLY); |
|
|
1002 | delete $pl->{ext_ignore_tell} {$target}; |
|
|
1003 | delete $pl->{ext_ignore_shout}{$target}; |
|
|
1004 | } else { |
1021 | } else { |
1005 | $pl->message ("You need to specify tell, shout or all.", cf::NDI_REPLY); |
1022 | $pl->message ("Not ignoring anyone", cf::NDI_REPLY); |
1006 | } |
1023 | } |
1007 | } else { |
1024 | } else { |
|
|
1025 | if (cf::player::exists $target) { |
|
|
1026 | if ($type eq "tell") { |
|
|
1027 | $pl->message ("Not ignoring private messages from $target anymore.", cf::NDI_REPLY); |
|
|
1028 | delete $pl->{ext_ignore_tell} {$target}; |
|
|
1029 | } elsif ($type eq "shout") { |
|
|
1030 | $pl->message ("Not ignoring shouts from $target anymore.", cf::NDI_REPLY); |
|
|
1031 | delete $pl->{ext_ignore_shout}{$target}; |
|
|
1032 | } elsif ($type eq "all") { |
|
|
1033 | $pl->message ("Not ignoring anything from $target anymore.", cf::NDI_REPLY); |
|
|
1034 | delete $pl->{ext_ignore_tell} {$target}; |
|
|
1035 | delete $pl->{ext_ignore_shout}{$target}; |
|
|
1036 | } else { |
|
|
1037 | $pl->message ("You need to specify tell, shout or all.", cf::NDI_REPLY); |
|
|
1038 | } |
|
|
1039 | } else { |
1008 | $pl->message ("No such player or ambiguous name: $target", cf::NDI_REPLY); |
1040 | $pl->message ("No such player or ambiguous name: $target", cf::NDI_REPLY); |
|
|
1041 | } |
1009 | } |
1042 | } |
1010 | } |
1043 | }; |
1011 | }; |
1044 | }; |
1012 | |
1045 | |