Quote:
Originally Posted by Minlail
ok so in short if i wanted to create a #stuck command i could do it there in perl insted of doing it in the source code?
|
You could do this..
Code:
sub commands_init {
command_add("stuck", "- Unsticks your character", 0);
}
sub rewind {
@choices=(-5,-4,-3,-2,-1,1,2,3,4,5);
$pick = $choices[int(rand(scalar @choices))];
return $pick;
}
sub stuck {
$client->MovePC($zoneid, $client->GetX()+rewind(), $client->GetY()+rewind(), $client->GetZ()+rewind());
$client->Message(15, "Character moved.");
}
I take no responsibility for the functionality of this code (havent tested it), nor any exploits that may come out of it :P