Jump to content
  • 0
Sign in to follow this  
Alexandria

double drop on random mobs

Question

Hello guys,

 

I would like to request this easy npc. thank you so much for any help!

 

First step:

 

We have 10 types of Elements and we have 5 mobs in each elements:

 

Water:

Mobs: 1001,1002,1004,1005,1007

 

Neutral:

Mobs: 1001,1002,1004,1005,1007 (We will use the same monster as example, I will edit it when the npc is finished, thank you)

 

Earth:

Mobs: 1001,1002,1004,1005,1007 (We will use the same monster as example, I will edit it when the npc is finished, thank you)

 

Fire:

Mobs: 1001,1002,1004,1005,1007 (We will use the same monster as example, I will edit it when the npc is finished, thank you)

 

Wind:

Mobs: 1001,1002,1004,1005,1007 (We will use the same monster as example, I will edit it when the npc is finished, thank you)

 

Poison:

Mobs: 1001,1002,1004,1005,1007 (We will use the same monster as example, I will edit it when the npc is finished, thank you)

 

Holy:

Mobs: 1001,1002,1004,1005,1007 (We will use the same monster as example, I will edit it when the npc is finished, thank you)

 

Shadow:

Mobs: 1001,1002,1004,1005,1007 (We will use the same monster as example, I will edit it when the npc is finished, thank you)

 

Ghost:

Mobs: 1001,1002,1004,1005,1007 (We will use the same monster as example, I will edit it when the npc is finished, thank you)

 

Undead:

Mobs: 1001,1002,1004,1005,1007 (We will use the same monster as example, I will edit it when the npc is finished, thank you)

 

 

Second step:

On mondays at 00:00 time, it will display a broadcast for all users: The Element "MobType" has been doubled for this week

 

Third step:

When a user types @ddw, it will display a message to keep the user update what element has the double drop for the current week.

 

Example:

 

User types: @ddw

broadcast: The Element Fire has been doubled for this week

 

Thank you so much!

Edited by Fluffle Puff

Share this post


Link to post
Share on other sites

15 answers to this question

Recommended Posts

  • 0

Some information missing.
 
You want...

 

a.- Monsters with double drops will drop with twice as much the drops than the original drops, so that they will drop 2 items of a kind instead of 1 when you get a drop (currently not achievable in scripting to my knowledge).

b.- Monsters with double drops will have twice the odds for dropping an item, so that i.e. a 30% item would become a 60% item (same).

c.- Monsters with double drops will drop their regular items, then reroll for an extra drop possibility so you get 2 chances of getting the same item but it's not guaranteed (achievable via OnNPCKillEvent and getmobdrops script command).

 

I think you want c, but better to ask before doing anything.

 

P.S: I'm pretty sure that if it's c, you could do it yourself with a little help after the small insight I gave you, the rest is not that tricky :P

Share this post


Link to post
Share on other sites
  • 0

Hello jaBote!

 

Well, the drop rate is 3x.

 

As example, this week has doble rates for Water Element, If poring drops is 3x, it would be 6x.

 

Drops at 3x, using @mi 1002

 

Monster: 'Poring'/'Poring'/'PORING' (1002)
Lv:1  HP:50  Base EXP:20  Job EXP:10  HIT:7  FLEE:2
DEF:0  MDEF:5  STR:1  AGI:1  VIT:1  INT:1  DEX:6  LUK:30
ATK:7~10  Range:1~10~12  Size:Medium  Race: Plant  Element: Water (Lv:1)
Drops:
  - Jellopy  100.00% - Knife[4]  3.00% - Sticky Mucus  12.00%
  - Apple  30.00% - Empty Bottle  45.00% - Apple  4.50%
  - Unripe Apple  0.60% - Poring Card  0.03%

 

Drops at 6x, using @mi 1002

 

Monster: 'Poring'/'Poring'/'PORING' (1002)
Lv:1  HP:50  Base EXP:20  Job EXP:10  HIT:7  FLEE:2
DEF:0  MDEF:5  STR:1  AGI:1  VIT:1  INT:1  DEX:6  LUK:30
ATK:7~10  Range:1~10~12  Size:Medium  Race: Plant  Element: Water (Lv:1)
Drops:
  - Jellopy  100.00% - Knife[4]  6.00% - Sticky Mucus  24.00%
  - Apple  60.00% - Empty Bottle  90.00% - Apple  9.00%
  - Unripe Apple  1.20% - Poring Card  0.06%

 

I don't know if it is clearer than before!

 

and also, can @mi command be update when the mobs have double drops?

 

Thank youuuuuuuuuuuuuuuuuu!!

Share this post


Link to post
Share on other sites
  • 0

Will try if I get enough spare time today, or tomorrow.

 

Anybody else is encouraged to give it a try too.

 

P.S.: Honestly don't know if it'll be possible to update @mi. Yes if it gets updated by using addmobdrops/delmobdrops, no in other case.

Share this post


Link to post
Share on other sites
  • 0

I'm done with it, but I haven't tested.

 

Would like to release it, that's the reason of doing the script in a more general and configurable way than what you just asked.

 

Upaste mirror: http://upaste.me/fb7712684462cbaf3

 

//===== Hercules Script =======================================================//= Multiple droprate on mob elements from a set (default set: elements).//===== By: ===================================================================//= jaBote//===== Current Version: ======================================================//= 0.9.0 alpha//===== Changelog =============================================================//= 0.9.0 Initial version [jaBote]//===== Description: ==========================================================//= Implements multiple drop rates on mob sets that change each week.//===== Warning: ==============================================================//= -> addmonsterdrop/delmonsterdrop script commands don't work well with mobs//=    that drop the same item more than once.//= -> Doesn't work well with @reloadscript and/or server restarts (it will//=    reassign a new set).//===== Additional information: ===============================================//= Configurations are located from line 22 (OnInit label).//=============================================================================-	script	element_drops	-1,{OnInit:	// Configurations START.		// Add in mob IDs on the place of the numbers	setarray .set_0[0], 1001, 1002, 1004, 1005, 1007; // Neutral	setarray .set_1[0], 1001, 1002, 1004, 1005, 1007; // Water	setarray .set_2[0], 1001, 1002, 1004, 1005, 1007; // Earth	setarray .set_3[0], 1001, 1002, 1004, 1005, 1007; // Fire	setarray .set_4[0], 1001, 1002, 1004, 1005, 1007; // Wind	setarray .set_5[0], 1001, 1002, 1004, 1005, 1007; // Poison	setarray .set_6[0], 1001, 1002, 1004, 1005, 1007; // Holy	setarray .set_7[0], 1001, 1002, 1004, 1005, 1007; // Shadow	setarray .set_8[0], 1001, 1002, 1004, 1005, 1007; // Ghost	setarray .set_9[0], 1001, 1002, 1004, 1005, 1007; // Undead		// Set to the name of the type of each set of $@set_X	// BEWARE! Number of set of this array MUST be the same than the total	// amount of sets (which is quite obvious). This is VERY IMPORTANT.	setarray .names$[0], "Neutral", "Water", "Earth", "Fire", "Wind", 		"Poison", "Holy", "Shadow", "Ghost", "Undead";	// Set to the multiplication rate of drops (should be >= 1)	// Examples: 100 = x1 (useless); 200 = x2; 50 = x0.5	// Based on final drop rates after battle conf calculations.	.multiplicator = 200;		// Force change of element each week? (1 = Yes; 0 = No)	.force_change = 1;		// Text message. You can change or translate it if you want, but be careful	// not to touch the %s since you'll screw the dynamic formatting	.announce_format$ = "The element %s has been doubled for this week.";		// Atcommand name you want to use for keeping your users informed	.atcommand$ = "ddw";		// Configurations END. Don't touch unless you know what you're doing.		// Bind an atcommand	bindatcmd .atcommand$,strnpcinfo(3)+"::OnCommand";		// Get the amount of sets and use an impossible set	.amount = getarraysize(.names$);	.set = -1;		// Let it fall through the OnMon0000: label to assign first set on server	// startup (or reloadscript)OnMon0000:	.@old_set = .set;		// Force the change of set if required	if (.force_change) {		do {			.set = rand(.amount);		} while (.set == .@old_set);	} else {		.set = rand(.amount);	}		// Restore old drops and assign new ones... if set hasn't changed	if (.@old_set != .set) {		freeloop(1); // We could be needing it				// Restoring old sets, just if there was an old set		if (.@old_set >= 0) {			.@old_set_size = getarraysize(getd( ".set_" + .@old_set));			for (.@i = 0; .@i < .@old_set_size; .@i++) {				// This is pretty ugly, but there's no other mean to do this.				.@mobid = getd( ".set_" + .@old_set + "[" + .@i + "]" );				.@drop_count = getd(".mobdrop_count_[" + .@i + "]");				for (.@j = 0; .@j <= .@drop_count; .@j++) {					// We only have to restore previously saved originals					.@drop_item = getd(".mobdrop_item_" + .@i + "[" + .@j + "]");					.@drop_rate = getd(".mobdrop_rate_" + .@i + "[" + .@j + "]");					// This updates monster drop back to original state					addmonsterdrop(.@mobid, .@drop_item, .@drop_rate);				}			}		}				// Applying multiplicator to new set		for (.@i = 0; .@i < getarraysize( getd( ".set_" + .set ) ); .@i++) {			// Get original mob drops 			.@mobid = getd( ".set_" + .set + "[" + .@i + "]" );			getmobdrops(.@mobid);			setd ".mobdrop_count_[" + .@i + "]", $@MobDrop_count; // We'll need it						for (.@j = 0; .@j <= $@MobDrop_count; .@j++) {				// We only have to save originals				setd ".mobdrop_item_" + .@i + "[" + .@j + "]", $@MobDrop_item[.@i];				setd ".mobdrop_rate_" + .@i + "[" + .@j + "]", $@MobDrop_rate[.@i];								// Calculate new rate. If it gives a value out of bounds,				// addmonsterdrop will then take care of capping it inbounds				// along with a warning we can safely ignore.				.@new_rate = ($@MobDrop_rate[.@i] * .multiplicator) / 100;								// This updates monster drop item if the mob already drops it				addmonsterdrop(.@mobid, $@MobDrop_item[.@i], .@new_rate);			}		}				freeloop(0);	}		// Announce new set for everyone and finish.	.@announce_text$ = sprintf(.announce_format$, .names$[.set]);	announce .@announce_text$, bc_all|bc_blue;	end;OnCommand:	// Announce set just for yourself and finish.	.@announce_text$ = sprintf(.announce_format$, .names$[.set]);	announce .@announce_text$, bc_self|bc_blue;	end;}

Please test it and point any bugs or errors you can find on it.

 

P.S.: I've made an effort to make it extra readable so that anybody could modify it if they wanted.

Share this post


Link to post
Share on other sites
  • 0

I know this is not how script revisions work, but if Fluffle Puff can also certify me it does indeed work I'll just upgrade it to version 1.0.0 and release it without waiting anymore. Problems of not being able to test your own scripts :D.

 

Please note that addmonsterdrop/delmonsterdrop doesn't work well with monsters that drop the same item more than once. It's not my fault but script command fault.

Share this post


Link to post
Share on other sites
  • 0

Thank you so much! :D

 

I'm testing the npc.

 

What do you mean with:

 

Please note that addmonsterdrop/delmonsterdrop doesn't work well with
monsters that drop the same item more than once. It's not my fault but
script command fault.

 

??

Share this post


Link to post
Share on other sites
  • 0

I'm on mobile phone currently, but I think you'll get it better in you go read addmonsterdrop and delmonsterdrop docs.

 

In case of addmonsterdrop it just modifies an existing mob drop if found a drop with the same name/ID or adds a new drop if there's space available and the item name/ID isn't on the list of mob drops. That first coincidence behaviour makes that, if two "drop item slots" are occupied by the same kind of item (e.g. poring has two jellopies to drop, doesn't matter if they don't have the same rate), then addmonsterdrop trying to modify jellopy drop rate will be called twice and only access first jellopy drop slot both times. That's what I was trying to tell, and same applies to delmonsterdrop.

Share this post


Link to post
Share on other sites
  • 0

Haven't forgotten about this. Will make it a release later today after I shake off some other duties, and will cheekily change its version to 1.0.0 as said.

Share this post


Link to post
Share on other sites
  • 0

Hello again (sorry for the double post, will merge when I make sure Fluffle Puff has read it).

 

It would be nice if someone suggested an amount of mobs to have a fully functional event out of the box. I'm very bad coming up with suitable mobs for this kind of events and end up screwing badly because the quality of my choices are more than questionable. Thanks!

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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