--- deliantra/server/ext/dmcommands.ext 2007/01/02 14:10:23 1.7 +++ deliantra/server/ext/dmcommands.ext 2007/03/01 20:17:01 1.15 @@ -7,15 +7,24 @@ return unless $ob->may ("command_goto"); - my $portal = cf::object::new "exit"; + my ($path, $x, $y) = split /\s+/, $arg, 3; - $portal->slaying ($arg); - $portal->stats->hp (0); - $portal->stats->sp (0); + $ob->goto ($path, $x, $y); - $portal->apply ($ob); + 1 +}; + +cf::register_command teleport => sub { + my ($ob, $arg) = @_; - $portal->destroy; + return unless $ob->may ("command_teleport"); + + cf::async { + my $other = cf::player::find_active $arg + or return $ob->reply (undef, "$arg: no such player."); + + $ob->goto ($other->maplevel, $other->ob->x, $other->ob->y); + }; 1 }; @@ -77,17 +86,19 @@ my @pl = $map->players; $_->enter_link for @pl; - Coro::async { + 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 kick banish)) { my $method = "command_$command"; cf::register_command $command => sub {