Andre Klose
New member
- Messages
- 5
- Points
- 0
Hello guys someone can help me?
I'm trying change the command mobsearch in srcmapatcommand.c , but I don't know how to do it.
I need that the command (mobsearch), shows only if the mob are live or dead for vip players and normal players, for the admin the command would work normal showing the coords.
Original Code:
Sorry about my english, i'm brazilian.
I will be very happy if you can help me, since now, thank you very much.
I'm trying change the command mobsearch in srcmapatcommand.c , but I don't know how to do it.
I need that the command (mobsearch), shows only if the mob are live or dead for vip players and normal players, for the admin the command would work normal showing the coords.
Original Code:
/*==========================================
* MOB Search
*------------------------------------------*/
ACMD(mobsearch)
{
char mob_name[100];
int mob_id;
int number = 0;
struct s_mapiterator* it;
if (!message || !*message || sscanf(message, "%99[^n]", mob_name) < 1) {
clif->message(fd, msg_fd(fd,1218)); // Please enter a monster name (usage: @mobsearch <monster name>
.
return false;
}
if ((mob_id = atoi(mob_name)) == 0)
mob_id = mob->db_searchname(mob_name);
if(mob_id > 0 && mob->db_checkid(mob_id) == 0){
snprintf(atcmd_output, sizeof atcmd_output, msg_fd(fd,1219),mob_name); // Invalid mob ID %s!
clif->message(fd, atcmd_output);
return false;
}
if (mob_id == atoi(mob_name))
strcpy(mob_name,mob->db(mob_id)->jname); // --ja--
//strcpy(mob_name,mob_db(mob_id)->name); // --en--
snprintf(atcmd_output, sizeof atcmd_output, msg_fd(fd,1220), mob_name, mapindex_id2name(sd->mapindex)); // Mob Search... %s %s
clif->message(fd, atcmd_output);
it = mapit_geteachmob();
for(;
{
TBL_MOB* md = (TBL_MOB*)mapit->next(it);
if( md == NULL )
break;// no more mobs
if( md->bl.m != sd->bl.m )
continue;
if( mob_id != -1 && md->class_ != mob_id )
continue;
++number;
if( md->spawn_timer == INVALID_TIMER )
snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%3d:%3d] %s", number, md->bl.x, md->bl.y, md->name);
else
snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%s] %s", number, "dead", md->name);
clif->message(fd, atcmd_output);
}
mapit->free(it);
return true;
}
* MOB Search
*------------------------------------------*/
ACMD(mobsearch)
{
char mob_name[100];
int mob_id;
int number = 0;
struct s_mapiterator* it;
if (!message || !*message || sscanf(message, "%99[^n]", mob_name) < 1) {
clif->message(fd, msg_fd(fd,1218)); // Please enter a monster name (usage: @mobsearch <monster name>
return false;
}
if ((mob_id = atoi(mob_name)) == 0)
mob_id = mob->db_searchname(mob_name);
if(mob_id > 0 && mob->db_checkid(mob_id) == 0){
snprintf(atcmd_output, sizeof atcmd_output, msg_fd(fd,1219),mob_name); // Invalid mob ID %s!
clif->message(fd, atcmd_output);
return false;
}
if (mob_id == atoi(mob_name))
strcpy(mob_name,mob->db(mob_id)->jname); // --ja--
//strcpy(mob_name,mob_db(mob_id)->name); // --en--
snprintf(atcmd_output, sizeof atcmd_output, msg_fd(fd,1220), mob_name, mapindex_id2name(sd->mapindex)); // Mob Search... %s %s
clif->message(fd, atcmd_output);
it = mapit_geteachmob();
for(;
{
TBL_MOB* md = (TBL_MOB*)mapit->next(it);
if( md == NULL )
break;// no more mobs
if( md->bl.m != sd->bl.m )
continue;
if( mob_id != -1 && md->class_ != mob_id )
continue;
++number;
if( md->spawn_timer == INVALID_TIMER )
snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%3d:%3d] %s", number, md->bl.x, md->bl.y, md->name);
else
snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%s] %s", number, "dead", md->name);
clif->message(fd, atcmd_output);
}
mapit->free(it);
return true;
}
Sorry about my english, i'm brazilian.
I will be very happy if you can help me, since now, thank you very much.
Last edited by a moderator: