Droplists randomization and maximum drop occurrences setting.
This commit is contained in:
@ -864,12 +864,6 @@ public final class Config
|
||||
public static int INVENTORY_MAXIMUM_PET;
|
||||
public static double PET_HP_REGEN_MULTIPLIER;
|
||||
public static double PET_MP_REGEN_MULTIPLIER;
|
||||
public static int DROP_ADENA_MIN_LEVEL_DIFFERENCE;
|
||||
public static int DROP_ADENA_MAX_LEVEL_DIFFERENCE;
|
||||
public static double DROP_ADENA_MIN_LEVEL_GAP_CHANCE;
|
||||
public static int DROP_ITEM_MIN_LEVEL_DIFFERENCE;
|
||||
public static int DROP_ITEM_MAX_LEVEL_DIFFERENCE;
|
||||
public static double DROP_ITEM_MIN_LEVEL_GAP_CHANCE;
|
||||
|
||||
// --------------------------------------------------
|
||||
// PvP Settings
|
||||
@ -913,6 +907,14 @@ public final class Config
|
||||
public static float RATE_RAID_DROP_CHANCE_MULTIPLIER;
|
||||
public static Map<Integer, Float> RATE_DROP_AMOUNT_BY_ID;
|
||||
public static Map<Integer, Float> RATE_DROP_CHANCE_BY_ID;
|
||||
public static int DROP_MAX_OCCURRENCES_NORMAL;
|
||||
public static int DROP_MAX_OCCURRENCES_RAIDBOSS;
|
||||
public static int DROP_ADENA_MIN_LEVEL_DIFFERENCE;
|
||||
public static int DROP_ADENA_MAX_LEVEL_DIFFERENCE;
|
||||
public static double DROP_ADENA_MIN_LEVEL_GAP_CHANCE;
|
||||
public static int DROP_ITEM_MIN_LEVEL_DIFFERENCE;
|
||||
public static int DROP_ITEM_MAX_LEVEL_DIFFERENCE;
|
||||
public static double DROP_ITEM_MIN_LEVEL_GAP_CHANCE;
|
||||
public static float RATE_KARMA_LOST;
|
||||
public static float RATE_KARMA_EXP_LOST;
|
||||
public static float RATE_SIEGE_GUARDS_PRICE;
|
||||
@ -2216,6 +2218,9 @@ public final class Config
|
||||
}
|
||||
}
|
||||
|
||||
DROP_MAX_OCCURRENCES_NORMAL = RatesSettings.getInt("DropMaxOccurrencesNormal", 2);
|
||||
DROP_MAX_OCCURRENCES_RAIDBOSS = RatesSettings.getInt("DropMaxOccurrencesRaidboss", 7);
|
||||
|
||||
DROP_ADENA_MIN_LEVEL_DIFFERENCE = RatesSettings.getInt("DropAdenaMinLevelDifference", 8);
|
||||
DROP_ADENA_MAX_LEVEL_DIFFERENCE = RatesSettings.getInt("DropAdenaMaxLevelDifference", 15);
|
||||
DROP_ADENA_MIN_LEVEL_GAP_CHANCE = RatesSettings.getDouble("DropAdenaMinLevelGapChance", 10);
|
||||
|
@ -551,10 +551,21 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
|
||||
return null;
|
||||
}
|
||||
|
||||
// randomize drop order
|
||||
Collections.shuffle(dropList);
|
||||
|
||||
final int levelDifference = victim.getLevel() - killer.getLevel();
|
||||
int dropOccurrenceCounter = victim.isRaid() ? Config.DROP_MAX_OCCURRENCES_RAIDBOSS : Config.DROP_MAX_OCCURRENCES_NORMAL;
|
||||
Collection<ItemHolder> calculatedDrops = null;
|
||||
for (DropHolder dropItem : dropList)
|
||||
{
|
||||
// check if maximum drop occurrences have been reached
|
||||
// items that have 100% drop chance without server rate multipliers drop normally
|
||||
if ((dropOccurrenceCounter == 0) && (dropItem.getChance() < 100))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// check level gap that may prevent drop this item
|
||||
final double levelGapChanceToDrop;
|
||||
if (dropItem.getItemId() == Inventory.ADENA_ID)
|
||||
@ -584,6 +595,10 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
|
||||
}
|
||||
|
||||
// finally
|
||||
if (dropItem.getChance() < 100)
|
||||
{
|
||||
dropOccurrenceCounter--;
|
||||
}
|
||||
calculatedDrops.add(drop);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user