Jump to content
  • 0

summon another monster when mvp killed


Question

Posted
	if ( getmonsterinfo( killedrid, MOB_MVPEXP ) ) {
		getmapxy(.@map$,.@x,.@y,BL_PC);
		monster .@map$,rand(.@x,.@x-3),rand(.@y-3,.@y),"--ja--",1324,1;
	}
	
	// add mvp & mini boss mob id's here
	setarray .@monster_list[0], 1312, 1087,1086,1511;

also only the  monster that is available that are in the array list here

i can't figure it out can someone do a quick fix

1 answer to this question

Recommended Posts

  • 1
Posted

Hi. You need to set the array with IDs before using the conditional.
You can use inarray to check if the monster killed ID is in the array.

Quote

*inarray <array name>,<value>;

This command returns the index of the first matching value found in the array.
It will return -1 if the value is not found.

 

//Only monsters in the given array
if ( inarray(.@monster_list, killedrid) > -1)

//Only monsters who give MvP exp
if ( getmonsterinfo( killedrid, MOB_MVPEXP) )

//Or both
if ( inarray(.@monster_list, killedrid) > -1 || getmonsterinfo( killedrid, MOB_MVPEXP) )
    

Example:

-	script	boss_treasure	HIDDEN_WARP_NPC,{
	end;

OnNPCKillEvent:

	// add mvp & mini boss mob id's here
	setarray .@monster_list[0], 1312,1087,1086,1511;

	if ( inarray(.@monster_list, killedrid) > -1 || getmonsterinfo( killedrid, MOB_MVPEXP) ) {
		getmapxy(.@map$,.@x,.@y, BL_PC);
		monster .@map$, rand(.@x,.@x-3),rand(.@y-3,.@y), "--ja--", 1324, 1;
	}
	end;
}

 

  • Upvote 1

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...