Addition of support for multiple champion monster drops.

Contributed by CostyKiller.
This commit is contained in:
MobiusDevelopment
2021-11-22 14:00:47 +00:00
parent 7d81ad1d2d
commit 542c7d0b05
89 changed files with 594 additions and 517 deletions

View File

@ -1086,8 +1086,7 @@ public class Config
public static float CHAMPION_SPD_ATK;
public static int CHAMPION_REWARD_LOWER_LEVEL_ITEM_CHANCE;
public static int CHAMPION_REWARD_HIGHER_LEVEL_ITEM_CHANCE;
public static int CHAMPION_REWARD_ID;
public static int CHAMPION_REWARD_QTY;
public static List<ItemHolder> CHAMPION_REWARD_ITEMS;
public static boolean CHAMPION_ENABLE_VITALITY;
public static boolean CHAMPION_ENABLE_IN_INSTANCES;
public static boolean BANKING_SYSTEM_ENABLED;
@ -2704,8 +2703,15 @@ public class Config
CHAMPION_SPD_ATK = championMonsterConfig.getFloat("ChampionSpdAtk", 1);
CHAMPION_REWARD_LOWER_LEVEL_ITEM_CHANCE = championMonsterConfig.getInt("ChampionRewardLowerLvlItemChance", 0);
CHAMPION_REWARD_HIGHER_LEVEL_ITEM_CHANCE = championMonsterConfig.getInt("ChampionRewardHigherLvlItemChance", 0);
CHAMPION_REWARD_ID = championMonsterConfig.getInt("ChampionRewardItemID", 6393);
CHAMPION_REWARD_QTY = championMonsterConfig.getInt("ChampionRewardItemQty", 1);
CHAMPION_REWARD_ITEMS = new ArrayList<>();
for (String s : championMonsterConfig.getString("ChampionRewardItems", "4356,10").split(";"))
{
if (s.isEmpty())
{
continue;
}
CHAMPION_REWARD_ITEMS.add(new ItemHolder(Integer.parseInt(s.split(",")[0]), Integer.parseInt(s.split(",")[1])));
}
CHAMPION_ENABLE_VITALITY = championMonsterConfig.getBoolean("ChampionEnableVitality", false);
CHAMPION_ENABLE_IN_INSTANCES = championMonsterConfig.getBoolean("ChampionEnableInInstances", false);

View File

@ -770,7 +770,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
calculatedDrops = new ArrayList<>();
}
calculatedDrops.add(new ItemHolder(Config.CHAMPION_REWARD_ID, Config.CHAMPION_REWARD_QTY));
calculatedDrops.addAll(Config.CHAMPION_REWARD_ITEMS);
}
return calculatedDrops;
@ -866,7 +866,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
rateAmount *= Config.RATE_DEATH_DROP_AMOUNT_MULTIPLIER * (champion ? Config.CHAMPION_REWARDS_AMOUNT : 1);
}
// premium chance
// premium amount
if (Config.PREMIUM_SYSTEM_ENABLED && (killer.getActingPlayer() != null) && killer.getActingPlayer().hasPremiumStatus())
{
if (Config.PREMIUM_RATE_DROP_AMOUNT_BY_ID.get(itemId) != null)
@ -917,7 +917,7 @@ public class NpcTemplate extends CreatureTemplate implements IIdentifiable
{
rateChance *= Config.PREMIUM_RATE_SPOIL_CHANCE;
}
// bonus drop rate effect
// bonus spoil rate effect
rateChance *= killer.getStat().getMul(Stat.BONUS_SPOIL_RATE, 1);
// calculate if item will be rewarded