Simplified drop replacement logic.
This commit is contained in:
parent
eff982c293
commit
55c18870df
@ -614,7 +614,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -693,7 +693,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -702,10 +702,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -741,9 +741,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -614,7 +614,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -693,7 +693,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -702,10 +702,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -741,9 +741,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -614,7 +614,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -693,7 +693,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -702,10 +702,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -741,9 +741,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -614,7 +614,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -693,7 +693,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -702,10 +702,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -741,9 +741,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -614,7 +614,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -693,7 +693,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -702,10 +702,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -741,9 +741,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -614,7 +614,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -693,7 +693,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -702,10 +702,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -741,9 +741,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -614,7 +614,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -693,7 +693,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -702,10 +702,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -741,9 +741,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -614,7 +614,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -693,7 +693,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -702,10 +702,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -741,9 +741,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -614,7 +614,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -693,7 +693,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -702,10 +702,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -741,9 +741,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -614,7 +614,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -693,7 +693,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -702,10 +702,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -741,9 +741,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -632,7 +632,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -632,7 +632,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -641,10 +641,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -680,9 +680,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -632,7 +632,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -632,7 +632,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -641,10 +641,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -680,9 +680,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -614,7 +614,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -694,7 +694,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -703,10 +703,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -742,9 +742,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -614,7 +614,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -694,7 +694,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -703,10 +703,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -742,9 +742,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -614,7 +614,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -694,7 +694,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -703,10 +703,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -742,9 +742,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -617,7 +617,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -709,7 +709,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -718,10 +718,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -757,9 +757,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -617,7 +617,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -709,7 +709,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -718,10 +718,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -757,9 +757,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -617,7 +617,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -709,7 +709,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -718,10 +718,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -757,9 +757,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -624,7 +624,8 @@ public class NpcData implements IXmlReader
|
|||||||
|
|
||||||
if (dropLists != null)
|
if (dropLists != null)
|
||||||
{
|
{
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
switch (dropHolder.getDropType())
|
switch (dropHolder.getDropType())
|
||||||
|
@ -693,7 +693,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -702,10 +702,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -741,9 +741,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -632,7 +632,8 @@ public class NpcData implements IXmlReader
|
|||||||
dropLists.add(new DropHolder(DropType.DROP, Inventory.LCOIN_ID, Config.LCOIN_MIN_QUANTITY, Config.LCOIN_MAX_QUANTITY, Config.LCOIN_DROP_CHANCE));
|
dropLists.add(new DropHolder(DropType.DROP, Inventory.LCOIN_ID, Config.LCOIN_MIN_QUANTITY, Config.LCOIN_MAX_QUANTITY, Config.LCOIN_DROP_CHANCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
// Drop materials for random craft configuration.
|
// Drop materials for random craft configuration.
|
||||||
|
@ -708,7 +708,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -717,10 +717,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -756,9 +756,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
@ -632,7 +632,8 @@ public class NpcData implements IXmlReader
|
|||||||
dropLists.add(new DropHolder(DropType.DROP, Inventory.LCOIN_ID, Config.LCOIN_MIN_QUANTITY, Config.LCOIN_MAX_QUANTITY, Config.LCOIN_DROP_CHANCE));
|
dropLists.add(new DropHolder(DropType.DROP, Inventory.LCOIN_ID, Config.LCOIN_MIN_QUANTITY, Config.LCOIN_MAX_QUANTITY, Config.LCOIN_DROP_CHANCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
Collections.shuffle(dropLists);
|
// Drops are sorted by chance (high to low).
|
||||||
|
Collections.sort(dropLists, (d1, d2) -> Double.valueOf(d2.getChance()).compareTo(Double.valueOf(d1.getChance())));
|
||||||
for (DropHolder dropHolder : dropLists)
|
for (DropHolder dropHolder : dropLists)
|
||||||
{
|
{
|
||||||
// Drop materials for random craft configuration.
|
// Drop materials for random craft configuration.
|
||||||
|
@ -708,7 +708,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||||
List<ItemHolder> calculatedDrops = null;
|
List<ItemHolder> calculatedDrops = null;
|
||||||
List<ItemHolder> randomDrops = null;
|
List<ItemHolder> randomDrops = null;
|
||||||
ItemHolder replacedItem = null;
|
ItemHolder cachedItem = null;
|
||||||
if (dropOccurrenceCounter > 0)
|
if (dropOccurrenceCounter > 0)
|
||||||
{
|
{
|
||||||
for (DropHolder dropItem : dropList)
|
for (DropHolder dropItem : dropList)
|
||||||
@ -717,10 +717,10 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
// items that have 100% drop chance without server rate multipliers drop normally
|
// items that have 100% drop chance without server rate multipliers drop normally
|
||||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100) && (randomDrops != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
// remove a random existing drop (temporarily if not other item replaces it)
|
// remove highest chance item (temporarily if no other item replaces it)
|
||||||
dropOccurrenceCounter++;
|
cachedItem = randomDrops.remove(0);
|
||||||
replacedItem = randomDrops.remove(Rnd.get(randomDrops.size()));
|
calculatedDrops.remove(cachedItem);
|
||||||
calculatedDrops.remove(replacedItem);
|
dropOccurrenceCounter = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check level gap that may prevent to drop item
|
// check level gap that may prevent to drop item
|
||||||
@ -756,9 +756,9 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// add temporarily removed item when not replaced
|
// add temporarily removed item when not replaced
|
||||||
if ((dropOccurrenceCounter > 0) && (replacedItem != null) && (calculatedDrops != null))
|
if ((dropOccurrenceCounter > 0) && (cachedItem != null) && (calculatedDrops != null))
|
||||||
{
|
{
|
||||||
calculatedDrops.add(replacedItem);
|
calculatedDrops.add(cachedItem);
|
||||||
}
|
}
|
||||||
// clear random drops
|
// clear random drops
|
||||||
if (randomDrops != null)
|
if (randomDrops != null)
|
||||||
|
Loading…
Reference in New Issue
Block a user