Removed 'petid', a command from r284 to look up pet ids by name.

Cleaned up some pet-related code.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11586 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ultramage
2007-10-27 12:45:12 +00:00
parent 2cb8a5838e
commit 0031c1553e
5 changed files with 42 additions and 90 deletions

View File

@@ -201,7 +201,6 @@ ACMD_FUNC(uptime); // by MC Cameri
ACMD_FUNC(changesex); // by MC Cameri
ACMD_FUNC(mute); // celest
ACMD_FUNC(refresh); // by MC Cameri
ACMD_FUNC(petid); // by MC Cameri
ACMD_FUNC(identify); // by MC Cameri
ACMD_FUNC(gmotd); // Added by MC Cameri, created by davidsiaw
ACMD_FUNC(misceffect); // by MC Cameri
@@ -486,7 +485,6 @@ static AtCommandInfo atcommand_info[] = {
{ AtCommand_Mute, "@mute", 80, atcommand_mute }, // [celest]
{ AtCommand_WhoZeny, "@whozeny", 20, atcommand_whozeny }, // [Valaris]
{ AtCommand_Refresh, "@refresh", 1, atcommand_refresh }, // by MC Cameri
{ AtCommand_PetId, "@petid", 40, atcommand_petid }, // by MC Cameri
{ AtCommand_Identify, "@identify", 40, atcommand_identify }, // by MC Cameri
{ AtCommand_Gmotd, "@gmotd", 20, atcommand_gmotd }, // Added by MC Cameri, created by davidsiaw
{ AtCommand_MiscEffect, "@misceffect", 50, atcommand_misceffect }, // by MC Cameri
@@ -7591,44 +7589,6 @@ int atcommand_refresh(const int fd, struct map_session_data* sd, const char* com
return 0;
}
/*==========================================
* @petid <part of pet name>
* => Displays a list of matching pets.
*------------------------------------------*/
int atcommand_petid(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
char searchtext[100];
char temp0[100];
int cnt = 0, i = 0;
nullpo_retr(-1, sd);
if (!message || !*message || sscanf(message, "%99s", searchtext) < 1)
{
clif_displaymessage(fd, "Please, enter a pet name (usage: @petid <part of pet name>).");
return -1;
}
snprintf(temp0, sizeof(temp0), "First %i search results for: %s", MAX_SEARCH, searchtext);
clif_displaymessage(fd,temp0);
for (i = 0; i < MAX_PET_DB; i++)
{
if (stristr(pet_db[i].name, searchtext) || stristr(pet_db[i].jname, searchtext))
{
cnt++;
if (cnt <= MAX_SEARCH) { // limits the number of search results
snprintf(temp0, sizeof(temp0), "ID: %i -- Name: %s", pet_db[i].class_, pet_db[i].jname);
clif_displaymessage(fd, temp0);
}
}
}
snprintf(temp0, sizeof(temp0), "%i pets have '%s' in their name.", cnt, searchtext);
clif_displaymessage(fd, temp0);
return 0;
}
/*==========================================
* @identify
* => GM's magnifier.