Jump to content
  • 0

summon another monster when mvp killed


kalabasa

Question


  • Group:  Members
  • Topic Count:  123
  • Topics Per Day:  0.05
  • Content Count:  478
  • Reputation:   14
  • Joined:  11/30/17
  • Last Seen:  

	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

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  132
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

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
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...