Jump to content
  • 0

Mobs 2500~2520 drops certain equips in lhz_dun04?


Currently

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.03
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

Just like the title says, "Mobs 2500~2520 drops certain equips in lhz_dun04?"

Will it be possible for the certain equips set in an array?

and drop percent will be set to 1.5%. not being affected by the drop rate.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Here's an idea:

  • edit the mob spawns in trunk/npc/re/mobs/dungeons/lhz_dun.txt and add an event label
  • so when those monsters are killed, they trigger a script
  • the script could do calculations for 1.5% drop rate
    and also calculate which random item to drop from an array

1. (this example is with the default lhz_dun04 mobs)

You would edit your permanent monsters spawns for mob ID 2500-2520.

lhz_dun04,0,0,0,0	monster	Randel	2221,50,5000,0,"custom_lhz4_drops::OnLhz4MobDead"
lhz_dun04,0,0,0,0	monster	Flamel	2222,50,5000,0,"custom_lhz4_drops::OnLhz4MobDead"
lhz_dun04,0,0,0,0	monster	Celia	2223,50,5000,0,"custom_lhz4_drops::OnLhz4MobDead"
lhz_dun04,0,0,0,0	monster	Chen	2224,50,5000,0,"custom_lhz4_drops::OnLhz4MobDead"
lhz_dun04,0,0,0,0	monster	Gertie	2225,50,5000,0,"custom_lhz4_drops::OnLhz4MobDead"
lhz_dun04,0,0,0,0	monster	Alphoccio	2226,50,5000,0,"custom_lhz4_drops::OnLhz4MobDead"
lhz_dun04,0,0,0,0	monster	Trentini	2227,50,5000,0,"custom_lhz4_drops::OnLhz4MobDead"

2. the custom drop script:

-	script	custom_lhz4_drops	-1,{
OnInit:
// list the item_id of your equips here
setarray .items[0], 2607,2285,5170;
end;
OnLhz4MobDead:
if (rand(1000) < 15) { // 1.5% chance
	set .@item_id, .items[rand(getarraysize(.items))];

	if (checkweight(.@item_id,1)) {
		getitem .@item_id,1;
	} else {
		getmapxy(.@map$,.@x,.@y,0);
		makeitem .@item_id,1, .@map$,.@x,.@y;
	}
}
end;
}

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.03
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

Just tested it today! And it's working perfectly :) Thank you!

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