--- deliantra/server/ext/dmcommands.ext 2007/01/13 23:06:13 1.12 +++ deliantra/server/ext/dmcommands.ext 2007/02/28 16:38:56 1.14 @@ -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 $arg + or return $ob->reply (undef, "$arg: no such player."); + + $ob->goto ($other->maplevel, $other->ob->x, $other->ob->y); + }; 1 }; @@ -89,7 +98,7 @@ 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 {