--- deliantra/server/ext/commands.ext 2007/03/02 11:41:14 1.27 +++ deliantra/server/ext/commands.ext 2007/03/02 12:14:57 1.28 @@ -115,6 +115,28 @@ 1 }; +cf::register_command mark => sub { + my ($pl, $arg) = @_; + + if (!$arg) { + my $ob = $pl->find_marked_object; + + $pl->reply (undef, $ob + ? (sprintf "%s %s * is marked.", $ob->name, $ob->title) + : "You have no marked object."); + } else { + my $ob = $pl->find_best_object_match ($arg); + + return $pl->reply (undef, "Could not find an object that matches $arg") + unless $ob; + + $pl->contr->mark = $ob; + $pl->reply (undef, (sprintf "Marked item %s", $ob->name, $ob->title)); + } + + 1 +}; + cf::register_command who => sub { my ($ob, $arg) = @_; @@ -125,6 +147,29 @@ 1 }; +for my $cmd ("run", "fire") { + my $oncmd = "${cmd}_on"; + cf::register_command $cmd => sub { + my ($ob, $arg) = @_; + + return $ob->reply (undef, "Can't $cmd into a non adjacent square.") + if $arg < 0 or $arg >= 9; + + $ob->contr->$oncmd (1); + $ob->move ($arg); + + 1 + }; + + cf::register_command "${cmd}_stop" => sub { + my ($ob) = @_; + + $ob->contr->$oncmd (0); + + 1 + }; +} + cf::register_command mapinfo => sub { my ($ob) = @_;