Jump to content
  • 0
hyuna

Mobsearch(no coords)for players

Question

Hello...I wanna ask for a patch for a new mobsearch ex. @mobsearch2 where it will say dead or alive instead of saying the coordinates or dead...I wanna have this so that players can search for something that is still alive yet not given directly (not making it so easy)...THX

Edited by hyuna
Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Sorry, i made a mistake with copy\paste -_-

Please, replace

snprintf(atcmd_output, sizeof(atcmd_output), "-[%s] %s", number, "alive", md->name);
with
snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%s] %s", number, "alive", md->name);
  • Upvote 1
Link to comment
Share on other sites

ACMD_FUNC(mobsearch)

{

char mob_name[100];

int mob_id;

int number = 0;

struct s_mapiterator* it;

nullpo_retr(-1, sd);

if (!message || !*message || sscanf(message, "[^\n]", mob_name) < 1) {

clif_displaymessage(fd, msg_txt(sd,1218)); // Please enter a monster name (usage: @mobsearch <monster name>).

return -1;

}

if ((mob_id = atoi(mob_name)) == 0)

mob_id = mobdb_searchname(mob_name);

if(mob_id > 0 && mobdb_checkid(mob_id) == 0){

snprintf(atcmd_output, sizeof atcmd_output, msg_txt(sd,1219),mob_name); // Invalid mob ID %s!

clif_displaymessage(fd, atcmd_output);

return -1;

}

if(mob_id == atoi(mob_name) && mob_db(mob_id)->jname)

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_txt(sd,1220), mob_name, mapindex_id2name(sd->mapindex)); // Mob Search... %s %s

clif_displaymessage(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 )

+ if (pc_get_group_level(sd) < 99)

+ snprintf(atcmd_output, sizeof(atcmd_output), "2d[%s] %s", number, "alive", md->name);

+ else

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_displaymessage(fd, atcmd_output);

}

mapit_free(it);

return 0;

}

With this modification only 99 Gms can see mob coordinates
Link to comment
Share on other sites

@Jarek...wow you made something that solved 2 problems at once...

Um...may I ask where do I paste this code...I'm not yet that familiar with exact locations...

Link to comment
Share on other sites

src\map\atcommand.c

find

		++number;
		if( md->spawn_timer == INVALID_TIMER )
add after
			if (pc_get_group_level(sd) < 99)
				snprintf(atcmd_output, sizeof(atcmd_output), "%2d[%s] %s", number, "alive", md->name);
			else
And don't forget to recompile
  • Like 1
Link to comment
Share on other sites

src\map\atcommand.c

find

        ++number;

        if( md->spawn_timer == INVALID_TIMER )add after            if (pc_get_group_level(sd) < 99)

                snprintf(atcmd_output, sizeof(atcmd_output), "-[%s] %s", number, "alive", md->name);

            elseAnd don't forget to recompile

post-9527-0-86813700-1366792976_thumb.jpg

this is what happened after I added and recompiled it....idk why...tested it with id 99 and 0(same result)

Edited by hyuna
Link to comment
Share on other sites

yep ur right but also need to change all "-[%s] %s" to "%2d[%s] %s"...SOLVED!!! THX @Jarek...+1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.