L2J Change Drop Amount for all items

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
PacWhite
Posts: 22
Joined: Sat Sep 22, 2012 9:56 pm

L2J Change Drop Amount for all items

Post by PacWhite »

Peace & Love Guys,

In the New Version all "Items" the Droprates in XML files (MIN="" |Max="")(Holy crap? Why?) When i change now the DeathDropAmount to 2 all items that dropps are amount of two... etc... if i change to 4 all items 4..

so but what i want is that the Items Amount between 2 - 10 ..
... i hope i dont must change all XML for this crap...... ?

now to my question: It is Possible to Change the Drop Amount between to numbers.. (like 10 - 25 something..) or per percent...

PS: Sorry for my very very very good englisch..^^
User avatar
Bencratus
Posts: 51
Joined: Wed Jan 07, 2015 11:38 pm
Contact:

Re: L2J Change Drop Amount for all items

Post by Bencratus »

PacWhite wrote:In the New Version all "Items" the Droprates in XML files (MIN="" |Max="")(Holy crap? Why?) When i change now the DeathDropAmount to 2 all items that dropps are amount of two... etc... if i change to 4 all items 4..
Seems everything good as you said by yourself.
PacWhite wrote: so but what i want is that the Items Amount between 2 - 10
In XML files it have min,max.
<item id="57" min="902" max="1804" chance="100" />
it means it can be from 902 to 1804 rnd also it can be 902 or 1804
PacWhite wrote:now to my question: It is Possible to Change the Drop Amount between to numbers.. (like 10 - 25 something..) or per percent...
Need rework core, you can do only this.
<item id="57" min="902" max="1804" chance="100" />
PacWhite
Posts: 22
Joined: Sat Sep 22, 2012 9:56 pm

Re: L2J Change Drop Amount for all items

Post by PacWhite »

Really?... what is that 4 a crap?

I want to change the Drop chance percently .... or like factor X ..

Is this the only way?...
PacWhite
Posts: 22
Joined: Sat Sep 22, 2012 9:56 pm

Re: L2J Change Drop Amount for all items

Post by PacWhite »

Ok.. now, i change the Problem.. with PHP Code^^

Yu need only 2 Folders xml (for all XML from data/stats/npc/) and empty folder edit (here you found the changed XMLs)

The Vars = $rate (the normal deathdroprate) and $spoilrate (for spoilrate)...

Have fun use it extend it.. Thanks to all.

Code: Select all

<?php 
	$handle = opendir("xml/");
	$rate = 1.3;
	$spoilrate = 1.3;
	while($xmls = readdir($handle))
	{
		$isxml = pathinfo($xmls, PATHINFO_EXTENSION);
		if($isxml == "xml")
		{
			$xml = simplexml_load_file("xml/".$xmls);
			echo "Edit of File: ".$xmls;
			foreach($xml->children() as $childs)
			{
				foreach($childs->drop_lists->death->group as $dropgroups)
				{
					foreach($dropgroups->item as $item)
					{
						$newrate = (float)$item["chance"];
						$newrate =  $newrate*$rate;
						$item["chance"] = $newrate;
					}
				}
				foreach($childs->drop_lists->corpse->group as $dropgroups)
				{
					foreach($dropgroups->item as $item)
					{
						$newrate = (float)$item["chance"];
						$newrate =  $newrate*$spoilrate;
						$item["chance"] = $newrate;
					}
				}
			}
			echo "End of File: ".$xmls;
		$xml->asXML("edit/".$xmls);
		}
	}
?>
Can be Close...
User avatar
Battlecruiser
L2j Veteran
L2j Veteran
Posts: 332
Joined: Thu May 01, 2008 9:44 am

Re: L2J Change Drop Amount for all items

Post by Battlecruiser »

shouldn't that do the Chance multiplier?
Git user
Post Reply