• 0
Sign in to follow this  
Followers 0
utofaery

Specific Monster count on a map ( not mobcount command)

Question

Spoiler
-    script    BmapMobList    -1,{
OnInit:
    bindatcmd "mapmoblist2", strnpcinfo(0)+"::Onaaa";
    end;
Onaaa:
    if ( [email protected]_numparameters ) {
        if ( getmapusers([email protected]_parameters$) == -1 ) {
            dispbottom "Map not exist";
            end;
        }
        [email protected]$ = [email protected]_parameters$;
    }
    else
        [email protected]$ = strcharinfo(3);
    [email protected] = getunits( BL_MOB, [email protected], false, [email protected]$ );
    freeloop true;
    for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) {
        [email protected]$ = rid2name([email protected][[email protected]]);
        if ( !getd("[email protected]"+ [email protected]$) ) {
            [email protected]$[[email protected]] = [email protected]$;
            getmapxy [email protected]$, [email protected], [email protected], UNITTYPE_MOB, [email protected][[email protected]];
            [email protected][[email protected]] = [email protected];
            [email protected][[email protected]] = [email protected];
            [email protected][[email protected]] = getunitdata( [email protected][[email protected]], UDT_HP );
            [email protected][[email protected]] = getunitdata( [email protected][[email protected]], UDT_MAXHP );
            [email protected];
        }
        setd "[email protected]"+ [email protected]$, getd("[email protected]"+ [email protected]$) +1;
    }
    dispbottom " === These are monsters in "+ [email protected]$ +" ===";
    for ( [email protected] = 0; [email protected] < [email protected]; [email protected] )
        if ( getd("[email protected]"+ [email protected]$[[email protected]]) )
            dispbottom ( [email protected] )+". "+ [email protected]$[[email protected]] +" : "+ getd("[email protected]"+ [email protected]$[[email protected]])+"x";
    if ( getgmlevel() < 99 ) end; // Hercules doesn't catch dead monsters as being alive
    dispbottom " === Location of unique monsters === ";
    for ( [email protected] = 0; [email protected] < [email protected]; [email protected] )
        if ( getd("[email protected]"+ [email protected]$[[email protected]]) == 1 )
            dispbottom [email protected]$[[email protected]] +" --> X = "+ [email protected][[email protected]] +" Y = "+ [email protected][[email protected]] +" | Hp left = "+ [email protected][[email protected]] +"/"+ [email protected][[email protected]];
    end;
}

 

I found this script 

1. I hope to know how do I make a script to check for only a specific monster count from script without use bindatcmd?
like directly check for specific monster count in a map but not other monster on the same map.

 

Edited by AnnieRuru
just edit the post so its easier to read, you can remove this msg any time

Share this post


Link to post
Share on other sites

4 answers to this question

  • 0
-	script	dsfsfsasda	FAKE_NPC,{
OnInit:
	bindatcmd "mobcount", strnpcinfo(NPC_NAME)+"::Onaaa";
	end;
Onaaa:
	if ( !.@atcmd_numparameters ) {
		dispbottom "input a mob ID";
		end;
	}
	.@mobid = atoi( .@atcmd_parameters$ );
	if ( getmonsterinfo( .@mobid, MOB_LV ) == -1 ) {
		dispbottom "invalid monster ID";
		end;
	}
	.@size = getunits( BL_MOB, .@bl, false, strcharinfo(PC_MAP) );
	for ( .@i = 0; .@i < .@size; ++.@i )
		if ( getunitdata( .@bl[.@i], UDT_CLASS ) == .@mobid )
			++.@c;
	dispbottom sprintf(_("There are %1$dx %2$s in %3$s."), .@c, getmonsterinfo( .@mobid, MOB_NAME ), strcharinfo(PC_MAP) );
	end;
}

 

On 2/8/2019 at 6:01 PM, utofaery said:

I found this script 

1. I hope to know how do I make a script to check for only a specific monster count from script without use bindatcmd?
like directly check for specific monster count in a map but not other monster on the same map.

 

12 hours ago, utofaery said:

Is there script way ?? apart from @mobsearch?

why you start your topic by saying NOT using bindatcmd, but then 2nd post says want to use bindatcmd ?
if using script way WITHOUT using bindatcmd, then its impossible

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0
41 minutes ago, AnnieRuru said:

why you start your topic by saying NOT using bindatcmd, but then 2nd post says want to use bindatcmd ?
if using script way WITHOUT using bindatcmd, then its impossible

May be high on coffee or something lol

any way thanks for that script haven't test it yet.

Edited by utofaery

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0