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

@@ -50,11 +50,10 @@ ChampionAtk = 1.0
# Physical/Magical Attack Speed bonus for Champion mobs.
ChampionSpdAtk = 1.0
# Specified reward item ID
ChampionRewardItemID = 6393
# The amount of the specified reward a player will receive if they are awarded the item.
ChampionRewardItemQty = 1
# Specified id and amount of reward a player will receive if they are awarded the item.
# Separated by ;
# Example: 6393,1;57,5000
ChampionRewardItems = 6393,1
# % Chance to obtain a specified reward item from a lower level Champion mob.
# Default: 0

View File

@@ -1102,8 +1102,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 ALLOW_WEDDING;
@@ -2709,8 +2708,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

@@ -709,7 +709,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;
@@ -802,7 +802,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)