Page 1 of 1

L2J Change Drop Amount for all items

Posted: Fri Feb 13, 2015 2:38 pm
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..^^

Re: L2J Change Drop Amount for all items

Posted: Fri Feb 13, 2015 3:36 pm
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" />

Re: L2J Change Drop Amount for all items

Posted: Sat Feb 14, 2015 10:04 pm
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?...

Re: L2J Change Drop Amount for all items

Posted: Sun Feb 15, 2015 11:47 am
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...

Re: L2J Change Drop Amount for all items

Posted: Sun Feb 15, 2015 11:55 am
by Battlecruiser
shouldn't that do the Chance multiplier?