ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/dmcommands.ext
(Generate patch)

Comparing deliantra/server/ext/dmcommands.ext (file contents):
Revision 1.12 by root, Sat Jan 13 23:06:13 2007 UTC vs.
Revision 1.17 by pippijn, Fri Mar 2 13:32:50 2007 UTC

1#! perl 1#! perl
2 2
3# wizard commands 3# wizard commands
4
5cf::register_command kick => sub {
6 my ($ob, $arg) = @_;
7 return unless $ob->flag (cf::FLAG_WIZ);
8
9 my $other = cf::player::find_active $arg
10 or return 0;
11 $other->kick ($ob);
12 $ob->reply (undef, "$arg is kicked out of the game.", cf::NDI_UNIQUE | cf::NDI_ALL | cf::NDI_RED);
13
14 1
15};
4 16
5cf::register_command goto => sub { 17cf::register_command goto => sub {
6 my ($ob, $arg) = @_; 18 my ($ob, $arg) = @_;
7 19
8 return unless $ob->may ("command_goto"); 20 return unless $ob->may ("command_goto");
9 21
10 my $portal = cf::object::new "exit"; 22 my ($path, $x, $y) = split /\s+/, $arg, 3;
11 23
12 $portal->slaying ($arg); 24 $ob->goto ($path, $x, $y);
13 $portal->stats->hp (0);
14 $portal->stats->sp (0);
15 25
16 $portal->apply ($ob); 26 1
27};
17 28
18 $portal->destroy; 29cf::register_command teleport => sub {
30 my ($ob, $arg) = @_;
31
32 return unless $ob->may ("command_teleport");
33
34 cf::async {
35 my $other = cf::player::find $arg
36 or return $ob->reply (undef, "$arg: no such player.");
37
38 $ob->goto ($other->maplevel, $other->ob->x, $other->ob->y);
39 };
19 40
20 1 41 1
21}; 42};
22 43
23cf::register_command wizpass => sub { 44cf::register_command wizpass => sub {
87 }; 108 };
88 109
89 1 110 1
90}; 111};
91 112
92for my $command (qw(teleport summon arrest kick banish)) { 113for my $command (qw(summon arrest banish)) {
93 my $method = "command_$command"; 114 my $method = "command_$command";
94 115
95 cf::register_command $command => sub { 116 cf::register_command $command => sub {
96 my ($ob, $arg) = @_; 117 my ($ob, $arg) = @_;
97 118

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines