Support for extractable item long quantity.
This commit is contained in:
@@ -87,9 +87,9 @@ public class ExtractableItems implements IItemHandler
|
||||
|
||||
if (Rnd.get(100000) <= expi.getChance())
|
||||
{
|
||||
final int min = (int) (expi.getMin() * Config.RATE_EXTRACTABLE);
|
||||
final int max = (int) (expi.getMax() * Config.RATE_EXTRACTABLE);
|
||||
int createItemAmount = (max == min) ? min : (Rnd.get((max - min) + 1) + min);
|
||||
final long min = (long) (expi.getMin() * Config.RATE_EXTRACTABLE);
|
||||
final long max = (long) (expi.getMax() * Config.RATE_EXTRACTABLE);
|
||||
long createItemAmount = (max == min) ? min : (Rnd.get((max - min) + 1) + min);
|
||||
if (createItemAmount == 0)
|
||||
{
|
||||
continue;
|
||||
@@ -112,7 +112,7 @@ public class ExtractableItems implements IItemHandler
|
||||
|
||||
if (expi.getId() == -1) // Prime points
|
||||
{
|
||||
player.setPrimePoints(player.getPrimePoints() + createItemAmount);
|
||||
player.setPrimePoints(player.getPrimePoints() + (int) createItemAmount);
|
||||
player.sendMessage("You have obtained " + (createItemAmount / 100) + " Euro!");
|
||||
primeReward = true;
|
||||
continue;
|
||||
@@ -157,9 +157,9 @@ public class ExtractableItems implements IItemHandler
|
||||
|
||||
if (Rnd.get(100000) <= expi.getChance())
|
||||
{
|
||||
final int min = (int) (expi.getMin() * Config.RATE_EXTRACTABLE);
|
||||
final int max = (int) (expi.getMax() * Config.RATE_EXTRACTABLE);
|
||||
int createItemAmount = (max == min) ? min : (Rnd.get((max - min) + 1) + min);
|
||||
final long min = (long) (expi.getMin() * Config.RATE_EXTRACTABLE);
|
||||
final long max = (long) (expi.getMax() * Config.RATE_EXTRACTABLE);
|
||||
long createItemAmount = (max == min) ? min : (Rnd.get((max - min) + 1) + min);
|
||||
if (createItemAmount == 0)
|
||||
{
|
||||
continue;
|
||||
@@ -167,7 +167,7 @@ public class ExtractableItems implements IItemHandler
|
||||
|
||||
if (expi.getId() == -1) // Prime points
|
||||
{
|
||||
player.setPrimePoints(player.getPrimePoints() + createItemAmount);
|
||||
player.setPrimePoints(player.getPrimePoints() + (int) createItemAmount);
|
||||
player.sendMessage("You have obtained " + (createItemAmount / 100) + " Euro!");
|
||||
primeReward = true;
|
||||
continue;
|
||||
|
@@ -248,6 +248,10 @@
|
||||
<set name="is_dropable" val="false" />
|
||||
<set name="is_sellable" val="false" />
|
||||
<set name="is_stackable" val="true" />
|
||||
<set name="handler" val="ExtractableItems" />
|
||||
<capsuled_items>
|
||||
<item id="57" min="10000000000" max="10000000000" chance="100" /> <!-- Adena -->
|
||||
</capsuled_items>
|
||||
</item>
|
||||
<item id="80417" name="Box of 10,000 Mammon's Keys" type="EtcItem">
|
||||
<!-- Use it to obtain 10,000 Mammon's Keys. -->
|
||||
|
@@ -80,8 +80,8 @@
|
||||
<xs:element maxOccurs="unbounded" name="item">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="id" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="min" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="max" type="xs:unsignedInt" use="required" />
|
||||
<xs:attribute name="min" type="xs:unsignedLong" use="required" />
|
||||
<xs:attribute name="max" type="xs:unsignedLong" use="required" />
|
||||
<xs:attribute name="chance" type="xs:decimal" use="required" />
|
||||
<xs:attribute name="minEnchant" type="xs:unsignedByte" use="optional" />
|
||||
<xs:attribute name="maxEnchant" type="xs:unsignedByte" use="optional" />
|
||||
|
Reference in New Issue
Block a user