Well the new perl command system is in CVS. This lets you add new '#command' style in game commands written in perl. All old commands still work, this just allows you to extend it withouth coding in c++.
The commands go into a file named commands.pl in the same dir as the exe's.
things in features.h:
EMBPERL_COMMANDS - enable perl commands
EMBPERL_XS & EMBPERL_XS_CLASSES - not required, but theres not a lot you can do without them.
COMMANDS_PERL_OVERRIDE - allow perl commands to override C++ commands with the same name.
the only required sub in commands.pl is commands_init...
which should basically consist of a bunch of calls to command_add(command name, description, access_level).
Example commands.pl file displaying some example perl commands, as well as some of the stuff you can do with XS classes:
Code:
sub commands_init {
command_add("bank", "- spawn a temporary banker", 200);
command_add("giveitem", " (itemid) [charges] - give an item to a mob", 200);
}
sub bank {
#spawn Banker_Javen
quest::spawn(45054, 0, 0, $client->GetX()+10, $client->GetY(), $client->GetZ());
}
sub giveitem {
my $item = shift;
my $charges = 0;
if(defined($_[0])) {
$charges = shift;
}
my $target = $client->GetTarget();
if(!$target) {
$client->Message(13, "Error: You need a target!");
return;
} elsif(!$target->IsNPC()) {
$client->Message(13, "Error: your target must be an NPC!");
return;
}
my $n = $target->CastToNPC();
$client->Message(0, "Giving item $item to ".$n->GetName());
$n->AddItem($item, $charges);
}