--- deliantra/server/ext/dmcommands.ext 2007/01/01 16:50:09 1.4 +++ 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) = @_; + + return unless $ob->may ("command_teleport"); - $portal->destroy; + 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 }; @@ -75,20 +84,21 @@ my $map = $ob->map; - cf::sync_job { - my @pl = $map->players; + my @pl = $map->players; + $_->enter_link for @pl; + cf::async { + my $name = $map->visible_name; - $_->enter_link for @pl; $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 {