--- deliantra/server/ext/dmcommands.ext 2007/01/02 11:08:35 1.6 +++ deliantra/server/ext/dmcommands.ext 2007/03/02 13:32:50 1.17 @@ -2,20 +2,41 @@ # wizard commands +cf::register_command kick => sub { + my ($ob, $arg) = @_; + return unless $ob->flag (cf::FLAG_WIZ); + + my $other = cf::player::find_active $arg + or return 0; + $other->kick ($ob); + $ob->reply (undef, "$arg is kicked out of the game.", cf::NDI_UNIQUE | cf::NDI_ALL | cf::NDI_RED); + + 1 +}; + cf::register_command goto => sub { my ($ob, $arg) = @_; return unless $ob->may ("command_goto"); - my $portal = cf::object::new "exit"; + my ($path, $x, $y) = split /\s+/, $arg, 3; + + $ob->goto ($path, $x, $y); - $portal->slaying ($arg); - $portal->stats->hp (0); - $portal->stats->sp (0); + 1 +}; + +cf::register_command teleport => sub { + my ($ob, $arg) = @_; - $portal->apply ($ob); + return unless $ob->may ("command_teleport"); - $portal->destroy; + cf::async { + my $other = cf::player::find $arg + or return $ob->reply (undef, "$arg: no such player."); + + $ob->goto ($other->maplevel, $other->ob->x, $other->ob->y); + }; 1 }; @@ -77,18 +98,19 @@ my @pl = $map->players; $_->enter_link for @pl; - Coro::async { - Coro::Timer::sleep 10; + cf::async { + my $name = $map->visible_name; + $map->reset; $_->leave_link for @pl; - $ob->reply (undef, $map->{path}->as_string . " was reset."); + $ob->reply (undef, "$name was reset."); }; 1 }; -for my $command (qw(teleport summon arrest kick banish)) { +for my $command (qw(summon arrest banish)) { my $method = "command_$command"; cf::register_command $command => sub {