View Single Post
  #2  
Old 03-12-2016, 09:44 PM
Tabasco's Avatar
Tabasco
Discordant
 
Join Date: Sep 2009
Posts: 270
Default

This comes from intercepting a command like !petname <name>. I was flowing those through a universal world script at the time so that a player could just type it in chat without needing an NPC receiver, but these days I gather there are more convenient ways to do it.

Code:
    if($text =~/^!petname/i)
    {
        my $pid = $client->GetPetID();
        my $pet = $entity_list->GetMobByID($pid);

        if($pet)
        {
            ($cm, $petname) = split(/\ /, $text, 2);
            $pet->TempName($petname);
            $client->Message(315, "Your pet name has been changed.");
            $client->Message(315, "This is a family friendly server.  Please be considerate when choosing a pet name.");
        }
    }
While we're at this, I also see I had a pet size function.

Code:
    if($text =~/^!petsize/i)
    {
	my $pid = $client->GetPetID();
        my $pet = $entity_list->GetMobByID($pid);
        if($pet)
        {
  	    my $cursize = $pet->GetSize();
            ($cm, $petsize) = split(/\ /, $text, 2);
			if ($petsize > 9)
			{
				$petsize = 9;  ## Not abnormally large
			}
			if ($petsize < 1)
			{
				$petsize = 1;  ## Not abnormally small
			}
			$newsize = $petsize - $cursize;
            $pet->ChangeSize($petsize);
            $client->Message(315, "Your pet's size has been changed.");
            $client->Message(315, "Please do not abuse this function.  Extremely large pets can lag the zone and cause issues for other people.");
        }
    }
__________________
http://dungeoncrawl.us.to
Reply With Quote