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

@ -1042,8 +1042,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;
@ -2609,8 +2608,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

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

@ -1052,8 +1052,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;
@ -2632,8 +2631,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

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

@ -1065,8 +1065,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;
@ -2654,8 +2653,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

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

@ -1052,8 +1052,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;
@ -2628,8 +2627,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

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

@ -1051,8 +1051,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;
@ -2637,8 +2636,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

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

@ -1058,8 +1058,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;
@ -2649,8 +2648,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

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

@ -1080,8 +1080,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;
@ -2692,8 +2691,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

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

@ -1088,8 +1088,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;
@ -2708,8 +2707,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

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

@ -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

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

@ -1097,8 +1097,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;
@ -2740,8 +2739,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

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

@ -1097,8 +1097,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;
@ -2740,8 +2739,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

View File

@ -38,12 +38,10 @@ ChampionSpdAtk = 1.
# Default is 0 (off).
ChampionRewardItem = 0
# Specified reward item id.
# Default: 6393 (glittering medal)
ChampionRewardItemID = 6393
# Specified reward item quantity.
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
# Custom title for champion monsters.
ChampionTitle = Champion

View File

@ -39,6 +39,7 @@ import org.l2jmobius.commons.util.ClassMasterSettings;
import org.l2jmobius.commons.util.PropertiesParser;
import org.l2jmobius.commons.util.StringUtil;
import org.l2jmobius.gameserver.enums.GeoType;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.olympiad.OlympiadPeriod;
import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util;
@ -441,8 +442,7 @@ public class Config
public static float CHAMPION_ATK;
public static float CHAMPION_SPD_ATK;
public static int CHAMPION_REWARD;
public static int CHAMPION_REWARD_ID;
public static int CHAMPION_REWARD_QTY;
public static List<ItemHolder> CHAMPION_REWARD_ITEMS;
public static String CHAMP_TITLE;
public static int CHAMPION_AURA;
@ -1569,8 +1569,15 @@ public class Config
CHAMPION_ATK = championConfig.getFloat("ChampionAtk", 1f);
CHAMPION_SPD_ATK = championConfig.getFloat("ChampionSpdAtk", 1f);
CHAMPION_REWARD = championConfig.getInt("ChampionRewardItem", 0);
CHAMPION_REWARD_ID = championConfig.getInt("ChampionRewardItemID", 6393);
CHAMPION_REWARD_QTY = championConfig.getInt("ChampionRewardItemQty", 1);
CHAMPION_REWARD_ITEMS = new ArrayList<>();
for (String s : championConfig.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])));
}
CHAMP_TITLE = championConfig.getString("ChampionTitle", "Champion");
CHAMPION_AURA = championConfig.getInt("ChampionAura", 0);
if ((CHAMPION_AURA < 0) || (CHAMPION_AURA > 2))

View File

@ -24,11 +24,10 @@ import org.l2jmobius.gameserver.handler.ISkillHandler;
import org.l2jmobius.gameserver.model.Skill;
import org.l2jmobius.gameserver.model.Skill.SkillType;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Attackable.RewardItem;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.actor.instance.Monster;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
@ -88,19 +87,19 @@ public class Harvest implements ISkillHandler
{
if (calcSuccess())
{
final List<RewardItem> items = _target.takeHarvest();
final List<ItemHolder> items = _target.takeHarvest();
if ((items != null) && !items.isEmpty())
{
for (Attackable.RewardItem ritem : items)
for (ItemHolder ritem : items)
{
cropId = ritem.getItemId(); // Always got 1 type of crop as reward.
cropId = ritem.getId(); // Always got 1 type of crop as reward.
if (_player.isInParty())
{
_player.getParty().distributeItem(_player, ritem, true, _target);
}
else
{
final Item item = _player.getInventory().addItem("Manor", ritem.getItemId(), ritem.getCount(), _player, _target);
final Item item = _player.getInventory().addItem("Manor", ritem.getId(), ritem.getCount(), _player, _target);
if (iu != null)
{
iu.addItem(item);

View File

@ -24,10 +24,10 @@ import org.l2jmobius.gameserver.model.Skill;
import org.l2jmobius.gameserver.model.Skill.SkillType;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Attackable.RewardItem;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import org.l2jmobius.gameserver.network.serverpackets.ItemList;
@ -62,7 +62,7 @@ public class Sweep implements ISkillHandler
}
final Attackable target = (Attackable) target1;
List<RewardItem> items = null;
List<ItemHolder> items = null;
boolean isSweeping = false;
synchronized (target)
{
@ -79,7 +79,7 @@ public class Sweep implements ISkillHandler
{
continue;
}
for (Attackable.RewardItem ritem : items)
for (ItemHolder ritem : items)
{
if (player.isInParty())
{
@ -87,7 +87,7 @@ public class Sweep implements ISkillHandler
}
else
{
final Item item = player.getInventory().addItem("Sweep", ritem.getItemId(), ritem.getCount(), player, target);
final Item item = player.getInventory().addItem("Sweep", ritem.getId(), ritem.getCount(), player, target);
if (iu != null)
{
iu.addItem(item);
@ -97,13 +97,13 @@ public class Sweep implements ISkillHandler
if (ritem.getCount() > 1)
{
smsg = new SystemMessage(SystemMessageId.YOU_HAVE_EARNED_S2_S1_S);
smsg.addItemName(ritem.getItemId());
smsg.addItemName(ritem.getId());
smsg.addNumber(ritem.getCount());
}
else
{
smsg = new SystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1);
smsg.addItemName(ritem.getItemId());
smsg.addItemName(ritem.getId());
}
player.sendPacket(smsg);
}

View File

@ -73,7 +73,7 @@ public class CustomMailManager
final String itemCount = str.split(" ")[1];
if (Util.isDigit(itemId) && Util.isDigit(itemCount))
{
itemHolders.add(new ItemHolder(Integer.parseInt(itemId), Long.parseLong(itemCount)));
itemHolders.add(new ItemHolder(Integer.parseInt(itemId), Integer.parseInt(itemCount)));
}
}
else if (Util.isDigit(str))
@ -85,7 +85,7 @@ public class CustomMailManager
{
for (ItemHolder itemHolder : itemHolders)
{
player.addItem("Custom-Mail", itemHolder.getId(), (int) itemHolder.getCount(), null, true);
player.addItem("Custom-Mail", itemHolder.getId(), itemHolder.getCount(), null, true);
}
}

View File

@ -31,6 +31,7 @@ import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.actor.instance.Pet;
import org.l2jmobius.gameserver.model.actor.instance.Servitor;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.partymatching.PartyMatchRoom;
import org.l2jmobius.gameserver.model.partymatching.PartyMatchRoomList;
@ -606,28 +607,28 @@ public class Party
* @param spoil
* @param target
*/
public void distributeItem(Player player, Attackable.RewardItem item, boolean spoil, Attackable target)
public void distributeItem(Player player, ItemHolder item, boolean spoil, Attackable target)
{
if (item == null)
{
return;
}
if (item.getItemId() == 57)
if (item.getId() == 57)
{
distributeAdena(player, item.getCount(), target);
return;
}
final Player looter = getActualLooter(player, item.getItemId(), spoil, target);
looter.addItem(spoil ? "Sweep" : "Party", item.getItemId(), item.getCount(), player, true);
final Player looter = getActualLooter(player, item.getId(), spoil, target);
looter.addItem(spoil ? "Sweep" : "Party", item.getId(), item.getCount(), player, true);
// Send messages to other aprty members about reward
if (item.getCount() > 1)
{
final SystemMessage msg = spoil ? new SystemMessage(SystemMessageId.S1_HAS_OBTAINED_S3_S2_BY_USING_SWEEPER) : new SystemMessage(SystemMessageId.S1_HAS_OBTAINED_S3_S2);
msg.addString(looter.getName());
msg.addItemName(item.getItemId());
msg.addItemName(item.getId());
msg.addNumber(item.getCount());
broadcastToPartyMembers(looter, msg);
}
@ -635,7 +636,7 @@ public class Party
{
final SystemMessage msg = spoil ? new SystemMessage(SystemMessageId.S1_HAS_OBTAINED_S2_BY_USING_SWEEPER) : new SystemMessage(SystemMessageId.S1_HAS_OBTAINED_S2);
msg.addString(looter.getName());
msg.addItemName(item.getItemId());
msg.addItemName(item.getId());
broadcastToPartyMembers(looter, msg);
}
}

View File

@ -47,10 +47,11 @@ import org.l2jmobius.gameserver.model.actor.instance.Minion;
import org.l2jmobius.gameserver.model.actor.instance.Monster;
import org.l2jmobius.gameserver.model.actor.instance.Pet;
import org.l2jmobius.gameserver.model.actor.instance.RaidBoss;
import org.l2jmobius.gameserver.model.actor.instance.SiegeGuard;
import org.l2jmobius.gameserver.model.actor.instance.Servitor;
import org.l2jmobius.gameserver.model.actor.instance.SiegeGuard;
import org.l2jmobius.gameserver.model.actor.knownlist.AttackableKnownList;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.item.ItemTemplate;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.item.type.EtcItemType;
@ -236,31 +237,6 @@ public class Attackable extends Npc
}
}
/**
* This class is used to create item reward lists instead of creating item instances.
*/
public class RewardItem
{
protected int _itemId;
protected int _count;
public RewardItem(int itemId, int count)
{
_itemId = itemId;
_count = count;
}
public int getItemId()
{
return _itemId;
}
public int getCount()
{
return _count;
}
}
/**
* The table containing all autoAttackable Creature in its Aggro Range and Creature that attacked the Attackable This Map is Thread Safe, but Removing Object While Interating Over It Will Result NPE
*/
@ -300,10 +276,10 @@ public class Attackable extends Npc
}
/** Table containing all Items that a Dwarf can Sweep on this Attackable */
private List<RewardItem> _sweepItems;
private List<ItemHolder> _sweepItems;
/** crops */
private List<RewardItem> _harvestItems;
private List<ItemHolder> _harvestItems;
private boolean _seeded;
private int _seedType = 0;
private Player _seeder = null;
@ -1193,7 +1169,7 @@ public class Attackable extends Npc
* @param isSweep
* @return
*/
private RewardItem calculateRewardItem(Player lastAttacker, DropData drop, int levelModifier, boolean isSweep)
private ItemHolder calculateRewardItem(Player lastAttacker, DropData drop, int levelModifier, boolean isSweep)
{
// Get default drop chance
if ((Config.HIGH_RATE_SERVER_DROPS && !drop.isQuestDrop() && (drop.getItemId() != 57)))
@ -1419,7 +1395,7 @@ public class Attackable extends Npc
if (itemCount > 0)
{
return new RewardItem(drop.getItemId(), itemCount);
return new ItemHolder(drop.getItemId(), itemCount);
}
return null;
@ -1433,7 +1409,7 @@ public class Attackable extends Npc
* @param levelModifier level modifier in %'s (will be subtracted from drop chance)
* @return
*/
private RewardItem calculateCategorizedRewardItem(Player lastAttacker, DropCategory categoryDrops, int levelModifier)
private ItemHolder calculateCategorizedRewardItem(Player lastAttacker, DropCategory categoryDrops, int levelModifier)
{
if (categoryDrops == null)
{
@ -1706,7 +1682,7 @@ public class Attackable extends Npc
if (itemCount > 0)
{
return new RewardItem(drop.getItemId(), itemCount);
return new ItemHolder(drop.getItemId(), itemCount);
}
}
return null;
@ -1791,13 +1767,13 @@ public class Attackable extends Npc
// now throw all categorized drops and handle spoil.
for (DropCategory cat : npcTemplate.getDropData())
{
RewardItem item = null;
ItemHolder item = null;
if (cat.isSweep())
{
// according to sh1ny, seeded mobs CAN be spoiled and swept.
if (isSpoil() /* && !_seeded */)
{
final List<RewardItem> sweepList = new ArrayList<>();
final List<ItemHolder> sweepList = new ArrayList<>();
for (DropData drop : cat.getAllDrops())
{
item = calculateRewardItem(player, drop, levelModifier, true);
@ -1838,10 +1814,10 @@ public class Attackable extends Npc
// Check if the autoLoot mode is active
if (Config.AUTO_LOOT)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (itemTemplate == null)
{
LOGGER.info("ERROR: Item id to autoloot " + item.getItemId() + " has not template into items/armor/weapon tables.. It cannot be dropped..");
LOGGER.info("ERROR: Item id to autoloot " + item.getId() + " has not template into items/armor/weapon tables.. It cannot be dropped..");
}
else if (!player.getInventory().validateCapacity(itemTemplate) || (!Config.AUTO_LOOT_BOSS && (this instanceof RaidBoss)) || (!Config.AUTO_LOOT_BOSS && (this instanceof GrandBoss)))
{
@ -1863,7 +1839,7 @@ public class Attackable extends Npc
SystemMessage sm;
sm = new SystemMessage(SystemMessageId.S1_DIED_AND_DROPPED_S3_S2);
sm.addString(getName());
sm.addItemName(item.getItemId());
sm.addItemName(item.getId());
sm.addNumber(item.getCount());
broadcastPacket(sm);
}
@ -1874,27 +1850,26 @@ public class Attackable extends Npc
// Apply Special Item drop with rnd qty for champions
if (Config.CHAMPION_ENABLE && isChampion() && (player.getLevel() <= (getLevel() + 3)) && (Config.CHAMPION_REWARD > 0) && (Rnd.get(100) < Config.CHAMPION_REWARD))
{
int champqty = Rnd.get(Config.CHAMPION_REWARD_QTY);
champqty++; // quantity should actually vary between 1 and whatever admin specified as max, inclusive.
// Give this or these Item(s) to the Player that has killed the Attackable
final RewardItem item = new RewardItem(Config.CHAMPION_REWARD_ID, champqty);
if (Config.AUTO_LOOT)
for (ItemHolder itemHolder : Config.CHAMPION_REWARD_ITEMS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
if (!player.getInventory().validateCapacity(itemTemplate))
if (Config.AUTO_LOOT)
{
dropItem(player, item);
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(itemHolder.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, itemHolder);
}
else
{
player.addItem("ChampionLoot", itemHolder.getId(), itemHolder.getCount(), this, true);
}
}
else
{
player.addItem("ChampionLoot", item.getItemId(), item.getCount(), this, true);
dropItem(player, itemHolder);
}
}
else
{
dropItem(player, item);
}
}
}
@ -1940,10 +1915,10 @@ public class Attackable extends Npc
{
if (Rnd.get(DropData.MAX_CHANCE) < drop.chance)
{
final RewardItem item = new RewardItem(drop.items[Rnd.get(drop.items.length)], Rnd.get(drop.min, drop.max));
final ItemHolder item = new ItemHolder(drop.items[Rnd.get(drop.items.length)], Rnd.get(drop.min, drop.max));
if (Config.AUTO_LOOT)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
@ -1967,10 +1942,10 @@ public class Attackable extends Npc
* @param item
* @return
*/
public Item dropItem(Player mainDamageDealer, RewardItem item)
public Item dropItem(Player mainDamageDealer, ItemHolder item)
{
// Make sure item template exists.
if (ItemTable.getInstance().getTemplate(item.getItemId()) == null)
if (ItemTable.getInstance().getTemplate(item.getId()) == null)
{
return null;
}
@ -1985,12 +1960,12 @@ public class Attackable extends Npc
final int newZ = Math.max(getZ(), mainDamageDealer.getZ()) + 20; // TODO: temp hack, do something nicer when we have geodata
// Init the dropped Item and add it in the world as a visible object at the position where mob was last
ditem = ItemTable.getInstance().createItem("Loot", item.getItemId(), item.getCount(), mainDamageDealer, this);
ditem = ItemTable.getInstance().createItem("Loot", item.getId(), item.getCount(), mainDamageDealer, this);
ditem.getDropProtection().protect(mainDamageDealer);
ditem.dropMe(this, newX, newY, newZ);
// Add drop to auto destroy item task
if (!Config.LIST_PROTECTED_ITEMS.contains(item.getItemId()) && ((Config.AUTODESTROY_ITEM_AFTER > 0) && (ditem.getItemType() != EtcItemType.HERB)))
if (!Config.LIST_PROTECTED_ITEMS.contains(item.getId()) && ((Config.AUTODESTROY_ITEM_AFTER > 0) && (ditem.getItemType() != EtcItemType.HERB)))
{
ItemsAutoDestroyTaskManager.getInstance().addItem(ditem);
}
@ -2008,7 +1983,7 @@ public class Attackable extends Npc
public Item dropItem(Player lastAttacker, int itemId, int itemCount)
{
return dropItem(lastAttacker, new RewardItem(itemId, itemCount));
return dropItem(lastAttacker, new ItemHolder(itemId, itemCount));
}
/**
@ -2060,9 +2035,9 @@ public class Attackable extends Npc
* Return table containing all Item that can be spoiled.<br>
* @return
*/
public synchronized List<RewardItem> takeSweep()
public synchronized List<ItemHolder> takeSweep()
{
final List<RewardItem> sweep = _sweepItems;
final List<ItemHolder> sweep = _sweepItems;
_sweepItems = null;
return sweep;
}
@ -2071,9 +2046,9 @@ public class Attackable extends Npc
* Return table containing all Item that can be harvested.<br>
* @return
*/
public synchronized List<RewardItem> takeHarvest()
public synchronized List<ItemHolder> takeHarvest()
{
final List<RewardItem> harvest = _harvestItems;
final List<ItemHolder> harvest = _harvestItems;
_harvestItems = null;
return harvest;
}
@ -2720,8 +2695,8 @@ public class Attackable extends Npc
count += diff;
}
final List<RewardItem> harvested = new ArrayList<>();
harvested.add(new RewardItem(ManorSeedData.getInstance().getCropType(_seedType), (int) (count * Config.RATE_DROP_MANOR)));
final List<ItemHolder> harvested = new ArrayList<>();
harvested.add(new ItemHolder(ManorSeedData.getInstance().getCropType(_seedType), (int) (count * Config.RATE_DROP_MANOR)));
_harvestItems = harvested;
}

View File

@ -126,6 +126,7 @@ import org.l2jmobius.gameserver.model.actor.status.PlayerStatus;
import org.l2jmobius.gameserver.model.actor.templates.PlayerTemplate;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.ClanMember;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.holders.PlayerStatsHolder;
import org.l2jmobius.gameserver.model.holders.SkillUseHolder;
import org.l2jmobius.gameserver.model.holders.SummonRequestHolder;
@ -4880,19 +4881,19 @@ public class Player extends Playable
* @param target The Item dropped
* @param item the item
*/
public void doAutoLoot(Attackable target, Attackable.RewardItem item)
public void doAutoLoot(Attackable target, ItemHolder item)
{
if (isInParty())
{
getParty().distributeItem(this, item, false, target);
}
else if (item.getItemId() == 57)
else if (item.getId() == 57)
{
addAdena("AutoLoot", item.getCount(), target, true);
}
else
{
addItem("AutoLoot", item.getItemId(), item.getCount(), target, true);
addItem("AutoLoot", item.getId(), item.getCount(), target, true);
}
}

View File

@ -23,9 +23,9 @@ package org.l2jmobius.gameserver.model.holders;
public class ItemHolder
{
private final int _id;
private final long _count;
private final int _count;
public ItemHolder(int id, long count)
public ItemHolder(int id, int count)
{
_id = id;
_count = count;
@ -42,7 +42,7 @@ public class ItemHolder
/**
* @return the count of items contained in this object
*/
public long getCount()
public int getCount()
{
return _count;
}

View File

@ -260,7 +260,7 @@ public class CharacterCreate implements IClientIncomingPacket
newChar.registerShortCut(new ShortCut(10, 0, 3, 0, -1)); // Sit
for (ItemHolder item : template.getItems())
{
final Item itemInstance = newChar.getInventory().addItem("Init", item.getId(), (int) item.getCount(), newChar, null);
final Item itemInstance = newChar.getInventory().addItem("Init", item.getId(), item.getCount(), newChar, null);
if (itemInstance.getItemId() == 5588)
{
newChar.registerShortCut(new ShortCut(11, 0, 1, itemInstance.getObjectId(), -1)); // Tutorial Book shortcut

View File

@ -38,12 +38,10 @@ ChampionSpdAtk = 1.
# Default is 0 (off).
ChampionRewardItem = 0
# Specified reward item id.
# Default: 6393 (glittering medal)
ChampionRewardItemID = 6393
# Specified reward item quantity.
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
# Custom title for champion monsters.
ChampionTitle = Champion

View File

@ -53,6 +53,7 @@ import org.l2jmobius.commons.util.IXmlReader;
import org.l2jmobius.commons.util.PropertiesParser;
import org.l2jmobius.commons.util.StringUtil;
import org.l2jmobius.gameserver.enums.GeoType;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.olympiad.OlympiadPeriod;
import org.l2jmobius.gameserver.util.FloodProtectorConfig;
import org.l2jmobius.gameserver.util.Util;
@ -469,8 +470,7 @@ public class Config
public static float CHAMPION_ATK;
public static float CHAMPION_SPD_ATK;
public static int CHAMPION_REWARD;
public static int CHAMPION_REWARD_ID;
public static int CHAMPION_REWARD_QTY;
public static List<ItemHolder> CHAMPION_REWARD_ITEMS;
public static String CHAMP_TITLE;
public static int CHAMPION_AURA;
@ -1622,8 +1622,15 @@ public class Config
CHAMPION_ATK = championConfig.getFloat("ChampionAtk", 1f);
CHAMPION_SPD_ATK = championConfig.getFloat("ChampionSpdAtk", 1f);
CHAMPION_REWARD = championConfig.getInt("ChampionRewardItem", 0);
CHAMPION_REWARD_ID = championConfig.getInt("ChampionRewardItemID", 6393);
CHAMPION_REWARD_QTY = championConfig.getInt("ChampionRewardItemQty", 1);
CHAMPION_REWARD_ITEMS = new ArrayList<>();
for (String s : championConfig.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])));
}
CHAMP_TITLE = championConfig.getString("ChampionTitle", "Champion");
CHAMPION_AURA = championConfig.getInt("ChampionAura", 0);
if ((CHAMPION_AURA < 0) || (CHAMPION_AURA > 2))

View File

@ -24,11 +24,10 @@ import org.l2jmobius.gameserver.handler.ISkillHandler;
import org.l2jmobius.gameserver.model.Skill;
import org.l2jmobius.gameserver.model.Skill.SkillType;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Attackable.RewardItem;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.actor.instance.Monster;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
@ -88,19 +87,19 @@ public class Harvest implements ISkillHandler
{
if (calcSuccess())
{
final List<RewardItem> items = _target.takeHarvest();
final List<ItemHolder> items = _target.takeHarvest();
if ((items != null) && !items.isEmpty())
{
for (Attackable.RewardItem ritem : items)
for (ItemHolder ritem : items)
{
cropId = ritem.getItemId(); // Always got 1 type of crop as reward.
cropId = ritem.getId(); // Always got 1 type of crop as reward.
if (_player.isInParty())
{
_player.getParty().distributeItem(_player, ritem, true, _target);
}
else
{
final Item item = _player.getInventory().addItem("Manor", ritem.getItemId(), ritem.getCount(), _player, _target);
final Item item = _player.getInventory().addItem("Manor", ritem.getId(), ritem.getCount(), _player, _target);
if (iu != null)
{
iu.addItem(item);

View File

@ -24,10 +24,10 @@ import org.l2jmobius.gameserver.model.Skill;
import org.l2jmobius.gameserver.model.Skill.SkillType;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Attackable;
import org.l2jmobius.gameserver.model.actor.Attackable.RewardItem;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.network.SystemMessageId;
import org.l2jmobius.gameserver.network.serverpackets.InventoryUpdate;
import org.l2jmobius.gameserver.network.serverpackets.ItemList;
@ -62,7 +62,7 @@ public class Sweep implements ISkillHandler
}
final Attackable target = (Attackable) target1;
List<RewardItem> items = null;
List<ItemHolder> items = null;
boolean isSweeping = false;
synchronized (target)
{
@ -79,7 +79,7 @@ public class Sweep implements ISkillHandler
{
continue;
}
for (Attackable.RewardItem ritem : items)
for (ItemHolder ritem : items)
{
if (player.isInParty())
{
@ -87,7 +87,7 @@ public class Sweep implements ISkillHandler
}
else
{
final Item item = player.getInventory().addItem("Sweep", ritem.getItemId(), ritem.getCount(), player, target);
final Item item = player.getInventory().addItem("Sweep", ritem.getId(), ritem.getCount(), player, target);
if (iu != null)
{
iu.addItem(item);
@ -97,13 +97,13 @@ public class Sweep implements ISkillHandler
if (ritem.getCount() > 1)
{
smsg = new SystemMessage(SystemMessageId.YOU_HAVE_EARNED_S2_S1_S);
smsg.addItemName(ritem.getItemId());
smsg.addItemName(ritem.getId());
smsg.addNumber(ritem.getCount());
}
else
{
smsg = new SystemMessage(SystemMessageId.YOU_HAVE_EARNED_S1);
smsg.addItemName(ritem.getItemId());
smsg.addItemName(ritem.getId());
}
player.sendPacket(smsg);
}

View File

@ -73,7 +73,7 @@ public class CustomMailManager
final String itemCount = str.split(" ")[1];
if (Util.isDigit(itemId) && Util.isDigit(itemCount))
{
itemHolders.add(new ItemHolder(Integer.parseInt(itemId), Long.parseLong(itemCount)));
itemHolders.add(new ItemHolder(Integer.parseInt(itemId), Integer.parseInt(itemCount)));
}
}
else if (Util.isDigit(str))
@ -85,7 +85,7 @@ public class CustomMailManager
{
for (ItemHolder itemHolder : itemHolders)
{
player.addItem("Custom-Mail", itemHolder.getId(), (int) itemHolder.getCount(), null, true);
player.addItem("Custom-Mail", itemHolder.getId(), itemHolder.getCount(), null, true);
}
}

View File

@ -32,6 +32,7 @@ import org.l2jmobius.gameserver.model.actor.Playable;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.actor.instance.Pet;
import org.l2jmobius.gameserver.model.actor.instance.Servitor;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.partymatching.PartyMatchRoom;
import org.l2jmobius.gameserver.model.partymatching.PartyMatchRoomList;
@ -616,28 +617,28 @@ public class Party
* @param spoil
* @param target
*/
public void distributeItem(Player player, Attackable.RewardItem item, boolean spoil, Attackable target)
public void distributeItem(Player player, ItemHolder item, boolean spoil, Attackable target)
{
if (item == null)
{
return;
}
if (item.getItemId() == 57)
if (item.getId() == 57)
{
distributeAdena(player, item.getCount(), target);
return;
}
final Player looter = getActualLooter(player, item.getItemId(), spoil, target);
looter.addItem(spoil ? "Sweep" : "Party", item.getItemId(), item.getCount(), player, true);
final Player looter = getActualLooter(player, item.getId(), spoil, target);
looter.addItem(spoil ? "Sweep" : "Party", item.getId(), item.getCount(), player, true);
// Send messages to other aprty members about reward
if (item.getCount() > 1)
{
final SystemMessage msg = spoil ? new SystemMessage(SystemMessageId.S1_HAS_OBTAINED_S3_S2_BY_USING_SWEEPER) : new SystemMessage(SystemMessageId.S1_HAS_OBTAINED_S3_S2);
msg.addString(looter.getName());
msg.addItemName(item.getItemId());
msg.addItemName(item.getId());
msg.addNumber(item.getCount());
broadcastToPartyMembers(looter, msg);
}
@ -645,7 +646,7 @@ public class Party
{
final SystemMessage msg = spoil ? new SystemMessage(SystemMessageId.S1_HAS_OBTAINED_S2_BY_USING_SWEEPER) : new SystemMessage(SystemMessageId.S1_HAS_OBTAINED_S2);
msg.addString(looter.getName());
msg.addItemName(item.getItemId());
msg.addItemName(item.getId());
broadcastToPartyMembers(looter, msg);
}
}

View File

@ -48,10 +48,11 @@ import org.l2jmobius.gameserver.model.actor.instance.Minion;
import org.l2jmobius.gameserver.model.actor.instance.Monster;
import org.l2jmobius.gameserver.model.actor.instance.Pet;
import org.l2jmobius.gameserver.model.actor.instance.RaidBoss;
import org.l2jmobius.gameserver.model.actor.instance.SiegeGuard;
import org.l2jmobius.gameserver.model.actor.instance.Servitor;
import org.l2jmobius.gameserver.model.actor.instance.SiegeGuard;
import org.l2jmobius.gameserver.model.actor.knownlist.AttackableKnownList;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.item.ItemTemplate;
import org.l2jmobius.gameserver.model.item.instance.Item;
import org.l2jmobius.gameserver.model.item.type.EtcItemType;
@ -237,31 +238,6 @@ public class Attackable extends Npc
}
}
/**
* This class is used to create item reward lists instead of creating item instances.
*/
public class RewardItem
{
protected int _itemId;
protected int _count;
public RewardItem(int itemId, int count)
{
_itemId = itemId;
_count = count;
}
public int getItemId()
{
return _itemId;
}
public int getCount()
{
return _count;
}
}
/**
* The table containing all autoAttackable Creature in its Aggro Range and Creature that attacked the Attackable This Map is Thread Safe, but Removing Object While Interating Over It Will Result NPE
*/
@ -301,10 +277,10 @@ public class Attackable extends Npc
}
/** Table containing all Items that a Dwarf can Sweep on this Attackable */
private List<RewardItem> _sweepItems;
private List<ItemHolder> _sweepItems;
/** crops */
private List<RewardItem> _harvestItems;
private List<ItemHolder> _harvestItems;
private boolean _seeded;
private int _seedType = 0;
private Player _seeder = null;
@ -1194,7 +1170,7 @@ public class Attackable extends Npc
* @param isSweep
* @return
*/
private RewardItem calculateRewardItem(Player lastAttacker, DropData drop, int levelModifier, boolean isSweep)
private ItemHolder calculateRewardItem(Player lastAttacker, DropData drop, int levelModifier, boolean isSweep)
{
// Get default drop chance
if ((Config.HIGH_RATE_SERVER_DROPS && !drop.isQuestDrop() && (drop.getItemId() != 57)))
@ -1420,7 +1396,7 @@ public class Attackable extends Npc
if (itemCount > 0)
{
return new RewardItem(drop.getItemId(), itemCount);
return new ItemHolder(drop.getItemId(), itemCount);
}
return null;
@ -1434,7 +1410,7 @@ public class Attackable extends Npc
* @param levelModifier level modifier in %'s (will be subtracted from drop chance)
* @return
*/
private RewardItem calculateCategorizedRewardItem(Player lastAttacker, DropCategory categoryDrops, int levelModifier)
private ItemHolder calculateCategorizedRewardItem(Player lastAttacker, DropCategory categoryDrops, int levelModifier)
{
if (categoryDrops == null)
{
@ -1707,7 +1683,7 @@ public class Attackable extends Npc
if (itemCount > 0)
{
return new RewardItem(drop.getItemId(), itemCount);
return new ItemHolder(drop.getItemId(), itemCount);
}
}
return null;
@ -1798,13 +1774,13 @@ public class Attackable extends Npc
// now throw all categorized drops and handle spoil.
for (DropCategory cat : npcTemplate.getDropData())
{
RewardItem item = null;
ItemHolder item = null;
if (cat.isSweep())
{
// according to sh1ny, seeded mobs CAN be spoiled and swept.
if (isSpoil() /* && !_seeded */)
{
final List<RewardItem> sweepList = new ArrayList<>();
final List<ItemHolder> sweepList = new ArrayList<>();
for (DropData drop : cat.getAllDrops())
{
item = calculateRewardItem(player, drop, levelModifier, true);
@ -1845,10 +1821,10 @@ public class Attackable extends Npc
// Check if the autoLoot mode is active
if (Config.AUTO_LOOT)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (itemTemplate == null)
{
LOGGER.info("ERROR: Item id to autoloot " + item.getItemId() + " has not template into items/armor/weapon tables.. It cannot be dropped..");
LOGGER.info("ERROR: Item id to autoloot " + item.getId() + " has not template into items/armor/weapon tables.. It cannot be dropped..");
}
else if (!player.getInventory().validateCapacity(itemTemplate) || (!Config.AUTO_LOOT_BOSS && (this instanceof RaidBoss)) || (!Config.AUTO_LOOT_BOSS && (this instanceof GrandBoss)))
{
@ -1870,7 +1846,7 @@ public class Attackable extends Npc
SystemMessage sm;
sm = new SystemMessage(SystemMessageId.S1_DIED_AND_DROPPED_S3_S2);
sm.addString(getName());
sm.addItemName(item.getItemId());
sm.addItemName(item.getId());
sm.addNumber(item.getCount());
broadcastPacket(sm);
}
@ -1881,27 +1857,26 @@ public class Attackable extends Npc
// Apply Special Item drop with rnd qty for champions
if (Config.CHAMPION_ENABLE && isChampion() && (player.getLevel() <= (getLevel() + 3)) && (Config.CHAMPION_REWARD > 0) && (Rnd.get(100) < Config.CHAMPION_REWARD))
{
int champqty = Rnd.get(Config.CHAMPION_REWARD_QTY);
champqty++; // quantity should actually vary between 1 and whatever admin specified as max, inclusive.
// Give this or these Item(s) to the Player that has killed the Attackable
final RewardItem item = new RewardItem(Config.CHAMPION_REWARD_ID, champqty);
if (Config.AUTO_LOOT)
for (ItemHolder itemHolder : Config.CHAMPION_REWARD_ITEMS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
if (!player.getInventory().validateCapacity(itemTemplate))
if (Config.AUTO_LOOT)
{
dropItem(player, item);
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(itemHolder.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, itemHolder);
}
else
{
player.addItem("ChampionLoot", itemHolder.getId(), itemHolder.getCount(), this, true);
}
}
else
{
player.addItem("ChampionLoot", item.getItemId(), item.getCount(), this, true);
dropItem(player, itemHolder);
}
}
else
{
dropItem(player, item);
}
}
// Instant Item Drop :>
@ -1916,17 +1891,17 @@ public class Attackable extends Npc
int random = Rnd.get(1000); // note *10
if ((random < Config.RATE_DROP_SPECIAL_HERBS) && !spec) // && !_spec useless yet
{
final RewardItem item = new RewardItem(8612, 1); // Herb of Warrior
final ItemHolder item = new ItemHolder(8612, 1); // Herb of Warrior
if (Config.AUTO_LOOT && Config.AUTO_LOOT_HERBS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
}
else
{
player.addItem("AutoLoot", item.getItemId(), item.getCount(), this, true);
player.addItem("AutoLoot", item.getId(), item.getCount(), this, true);
}
}
else
@ -1942,18 +1917,18 @@ public class Attackable extends Npc
random = Rnd.get(100);
if (random < Config.RATE_DROP_COMMON_HERBS)
{
RewardItem item = null;
ItemHolder item = null;
if (i == 0)
{
item = new RewardItem(8606, 1); // Herb of Power
item = new ItemHolder(8606, 1); // Herb of Power
}
if (i == 1)
{
item = new RewardItem(8608, 1); // Herb of Atk. Spd.
item = new ItemHolder(8608, 1); // Herb of Atk. Spd.
}
if (i == 2)
{
item = new RewardItem(8610, 1); // Herb of Critical Attack
item = new ItemHolder(8610, 1); // Herb of Critical Attack
}
if (item == null)
@ -1963,14 +1938,14 @@ public class Attackable extends Npc
if (Config.AUTO_LOOT && Config.AUTO_LOOT_HERBS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
}
else
{
player.addItem("AutoLoot", item.getItemId(), item.getCount(), this, true);
player.addItem("AutoLoot", item.getId(), item.getCount(), this, true);
}
}
else
@ -1986,17 +1961,17 @@ public class Attackable extends Npc
random = Rnd.get(1000); // note *10
if ((random < Config.RATE_DROP_SPECIAL_HERBS) && !spec)
{
final RewardItem item = new RewardItem(8613, 1); // Herb of Mystic
final ItemHolder item = new ItemHolder(8613, 1); // Herb of Mystic
if (Config.AUTO_LOOT && Config.AUTO_LOOT_HERBS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
}
else
{
player.addItem("AutoLoot", item.getItemId(), item.getCount(), this, true);
player.addItem("AutoLoot", item.getId(), item.getCount(), this, true);
}
}
else
@ -2012,14 +1987,14 @@ public class Attackable extends Npc
random = Rnd.get(100);
if (random < Config.RATE_DROP_COMMON_HERBS)
{
RewardItem item = null;
ItemHolder item = null;
if (i == 0)
{
item = new RewardItem(8607, 1); // Herb of Magic
item = new ItemHolder(8607, 1); // Herb of Magic
}
if (i == 1)
{
item = new RewardItem(8609, 1); // Herb of Casting Speed
item = new ItemHolder(8609, 1); // Herb of Casting Speed
}
if (item == null)
{
@ -2027,14 +2002,14 @@ public class Attackable extends Npc
}
if (Config.AUTO_LOOT && Config.AUTO_LOOT_HERBS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
}
else
{
player.addItem("AutoLoot", item.getItemId(), item.getCount(), this, true);
player.addItem("AutoLoot", item.getId(), item.getCount(), this, true);
}
}
else
@ -2050,17 +2025,17 @@ public class Attackable extends Npc
random = Rnd.get(1000); // note *10
if ((random < Config.RATE_DROP_SPECIAL_HERBS) && !spec)
{
final RewardItem item = new RewardItem(8614, 1); // Herb of Recovery
final ItemHolder item = new ItemHolder(8614, 1); // Herb of Recovery
if (Config.AUTO_LOOT && Config.AUTO_LOOT_HERBS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
}
else
{
player.addItem("AutoLoot", item.getItemId(), item.getCount(), this, true);
player.addItem("AutoLoot", item.getId(), item.getCount(), this, true);
}
}
else
@ -2079,17 +2054,17 @@ public class Attackable extends Npc
random = Rnd.get(100);
if (random < Config.RATE_DROP_MP_HP_HERBS)
{
final RewardItem item = new RewardItem(8600, 1); // Herb of Life
final ItemHolder item = new ItemHolder(8600, 1); // Herb of Life
if (Config.AUTO_LOOT && Config.AUTO_LOOT_HERBS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
}
else
{
player.addItem("AutoLoot", item.getItemId(), item.getCount(), this, true);
player.addItem("AutoLoot", item.getId(), item.getCount(), this, true);
}
}
else
@ -2104,17 +2079,17 @@ public class Attackable extends Npc
random = Rnd.get(100);
if (random < Config.RATE_DROP_GREATER_HERBS)
{
final RewardItem item = new RewardItem(8601, 1); // Greater Herb of Life
final ItemHolder item = new ItemHolder(8601, 1); // Greater Herb of Life
if (Config.AUTO_LOOT && Config.AUTO_LOOT_HERBS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
}
else
{
player.addItem("AutoLoot", item.getItemId(), item.getCount(), this, true);
player.addItem("AutoLoot", item.getId(), item.getCount(), this, true);
}
}
else
@ -2129,17 +2104,17 @@ public class Attackable extends Npc
random = Rnd.get(1000); // note *10
if (random < Config.RATE_DROP_SUPERIOR_HERBS)
{
final RewardItem item = new RewardItem(8602, 1); // Superior Herb of Life
final ItemHolder item = new ItemHolder(8602, 1); // Superior Herb of Life
if (Config.AUTO_LOOT && Config.AUTO_LOOT_HERBS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
}
else
{
player.addItem("AutoLoot", item.getItemId(), item.getCount(), this, true);
player.addItem("AutoLoot", item.getId(), item.getCount(), this, true);
}
}
else
@ -2155,17 +2130,17 @@ public class Attackable extends Npc
random = Rnd.get(100);
if (random < Config.RATE_DROP_MP_HP_HERBS)
{
final RewardItem item = new RewardItem(8603, 1); // Herb of Mana
final ItemHolder item = new ItemHolder(8603, 1); // Herb of Mana
if (Config.AUTO_LOOT && Config.AUTO_LOOT_HERBS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
}
else
{
player.addItem("AutoLoot", item.getItemId(), item.getCount(), this, true);
player.addItem("AutoLoot", item.getId(), item.getCount(), this, true);
}
}
else
@ -2180,17 +2155,17 @@ public class Attackable extends Npc
random = Rnd.get(100);
if (random < Config.RATE_DROP_GREATER_HERBS)
{
final RewardItem item = new RewardItem(8604, 1); // Greater Herb of Mana
final ItemHolder item = new ItemHolder(8604, 1); // Greater Herb of Mana
if (Config.AUTO_LOOT && Config.AUTO_LOOT_HERBS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
}
else
{
player.addItem("AutoLoot", item.getItemId(), item.getCount(), this, true);
player.addItem("AutoLoot", item.getId(), item.getCount(), this, true);
}
}
else
@ -2205,17 +2180,17 @@ public class Attackable extends Npc
random = Rnd.get(1000); // note *10
if (random < Config.RATE_DROP_SUPERIOR_HERBS)
{
final RewardItem item = new RewardItem(8605, 1); // Superior Herb of Mana
final ItemHolder item = new ItemHolder(8605, 1); // Superior Herb of Mana
if (Config.AUTO_LOOT && Config.AUTO_LOOT_HERBS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
}
else
{
player.addItem("AutoLoot", item.getItemId(), item.getCount(), this, true);
player.addItem("AutoLoot", item.getId(), item.getCount(), this, true);
}
}
else
@ -2229,17 +2204,17 @@ public class Attackable extends Npc
random = Rnd.get(100);
if (random < Config.RATE_DROP_COMMON_HERBS)
{
final RewardItem item = new RewardItem(8611, 1); // Herb of Speed
final ItemHolder item = new ItemHolder(8611, 1); // Herb of Speed
if (Config.AUTO_LOOT && Config.AUTO_LOOT_HERBS)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
}
else
{
player.addItem("AutoLoot", item.getItemId(), item.getCount(), this, true);
player.addItem("AutoLoot", item.getId(), item.getCount(), this, true);
}
}
else
@ -2292,10 +2267,10 @@ public class Attackable extends Npc
{
if (Rnd.get(DropData.MAX_CHANCE) < drop.chance)
{
final RewardItem item = new RewardItem(drop.items[Rnd.get(drop.items.length)], Rnd.get(drop.min, drop.max));
final ItemHolder item = new ItemHolder(drop.items[Rnd.get(drop.items.length)], Rnd.get(drop.min, drop.max));
if (Config.AUTO_LOOT)
{
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getItemId());
final ItemTemplate itemTemplate = ItemTable.getInstance().getTemplate(item.getId());
if (!player.getInventory().validateCapacity(itemTemplate))
{
dropItem(player, item);
@ -2319,10 +2294,10 @@ public class Attackable extends Npc
* @param item
* @return
*/
public Item dropItem(Player mainDamageDealer, RewardItem item)
public Item dropItem(Player mainDamageDealer, ItemHolder item)
{
// Make sure item template exists.
if (ItemTable.getInstance().getTemplate(item.getItemId()) == null)
if (ItemTable.getInstance().getTemplate(item.getId()) == null)
{
return null;
}
@ -2337,12 +2312,12 @@ public class Attackable extends Npc
final int newZ = Math.max(getZ(), mainDamageDealer.getZ()) + 20; // TODO: temp hack, do something nicer when we have geodata
// Init the dropped Item and add it in the world as a visible object at the position where mob was last
ditem = ItemTable.getInstance().createItem("Loot", item.getItemId(), item.getCount(), mainDamageDealer, this);
ditem = ItemTable.getInstance().createItem("Loot", item.getId(), item.getCount(), mainDamageDealer, this);
ditem.getDropProtection().protect(mainDamageDealer);
ditem.dropMe(this, newX, newY, newZ);
// Add drop to auto destroy item task
if (!Config.LIST_PROTECTED_ITEMS.contains(item.getItemId()) && (((Config.AUTODESTROY_ITEM_AFTER > 0) && (ditem.getItemType() != EtcItemType.HERB)) || ((Config.HERB_AUTO_DESTROY_TIME > 0) && (ditem.getItemType() == EtcItemType.HERB))))
if (!Config.LIST_PROTECTED_ITEMS.contains(item.getId()) && (((Config.AUTODESTROY_ITEM_AFTER > 0) && (ditem.getItemType() != EtcItemType.HERB)) || ((Config.HERB_AUTO_DESTROY_TIME > 0) && (ditem.getItemType() == EtcItemType.HERB))))
{
ItemsAutoDestroyTaskManager.getInstance().addItem(ditem);
}
@ -2360,7 +2335,7 @@ public class Attackable extends Npc
public Item dropItem(Player lastAttacker, int itemId, int itemCount)
{
return dropItem(lastAttacker, new RewardItem(itemId, itemCount));
return dropItem(lastAttacker, new ItemHolder(itemId, itemCount));
}
/**
@ -2412,9 +2387,9 @@ public class Attackable extends Npc
* Return table containing all Item that can be spoiled.<br>
* @return
*/
public synchronized List<RewardItem> takeSweep()
public synchronized List<ItemHolder> takeSweep()
{
final List<RewardItem> sweep = _sweepItems;
final List<ItemHolder> sweep = _sweepItems;
_sweepItems = null;
return sweep;
}
@ -2423,9 +2398,9 @@ public class Attackable extends Npc
* Return table containing all Item that can be harvested.<br>
* @return
*/
public synchronized List<RewardItem> takeHarvest()
public synchronized List<ItemHolder> takeHarvest()
{
final List<RewardItem> harvest = _harvestItems;
final List<ItemHolder> harvest = _harvestItems;
_harvestItems = null;
return harvest;
}
@ -3072,8 +3047,8 @@ public class Attackable extends Npc
count += diff;
}
final List<RewardItem> harvested = new ArrayList<>();
harvested.add(new RewardItem(ManorSeedData.getInstance().getCropType(_seedType), (int) (count * Config.RATE_DROP_MANOR)));
final List<ItemHolder> harvested = new ArrayList<>();
harvested.add(new ItemHolder(ManorSeedData.getInstance().getCropType(_seedType), (int) (count * Config.RATE_DROP_MANOR)));
_harvestItems = harvested;
}

View File

@ -129,6 +129,7 @@ import org.l2jmobius.gameserver.model.actor.status.PlayerStatus;
import org.l2jmobius.gameserver.model.actor.templates.PlayerTemplate;
import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.clan.ClanMember;
import org.l2jmobius.gameserver.model.holders.ItemHolder;
import org.l2jmobius.gameserver.model.holders.PlayerStatsHolder;
import org.l2jmobius.gameserver.model.holders.SkillUseHolder;
import org.l2jmobius.gameserver.model.holders.SummonRequestHolder;
@ -4973,19 +4974,19 @@ public class Player extends Playable
* @param target The Item dropped
* @param item the item
*/
public void doAutoLoot(Attackable target, Attackable.RewardItem item)
public void doAutoLoot(Attackable target, ItemHolder item)
{
if (isInParty())
{
getParty().distributeItem(this, item, false, target);
}
else if (item.getItemId() == 57)
else if (item.getId() == 57)
{
addAdena("AutoLoot", item.getCount(), target, true);
}
else
{
addItem("AutoLoot", item.getItemId(), item.getCount(), target, true);
addItem("AutoLoot", item.getId(), item.getCount(), target, true);
}
}

View File

@ -23,9 +23,9 @@ package org.l2jmobius.gameserver.model.holders;
public class ItemHolder
{
private final int _id;
private final long _count;
private final int _count;
public ItemHolder(int id, long count)
public ItemHolder(int id, int count)
{
_id = id;
_count = count;
@ -42,7 +42,7 @@ public class ItemHolder
/**
* @return the count of items contained in this object
*/
public long getCount()
public int getCount()
{
return _count;
}

View File

@ -260,7 +260,7 @@ public class CharacterCreate implements IClientIncomingPacket
newChar.registerShortCut(new ShortCut(10, 0, 3, 0, -1)); // Sit
for (ItemHolder item : template.getItems())
{
final Item itemInstance = newChar.getInventory().addItem("Init", item.getId(), (int) item.getCount(), newChar, null);
final Item itemInstance = newChar.getInventory().addItem("Init", item.getId(), item.getCount(), newChar, null);
if (itemInstance.getItemId() == 5588)
{
newChar.registerShortCut(new ShortCut(11, 0, 1, itemInstance.getObjectId(), -1)); // Tutorial Book shortcut

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;
@ -2702,8 +2701,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)

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)

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

@ -1001,8 +1001,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;
@ -2538,8 +2537,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

@ -771,7 +771,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);
}
if (dropType == DropType.DROP)
@ -929,7 +929,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)
@ -971,7 +971,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

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

@ -1005,8 +1005,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;
@ -2544,8 +2543,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

@ -771,7 +771,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);
}
if (dropType == DropType.DROP)
@ -929,7 +929,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)
@ -971,7 +971,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

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

@ -1005,8 +1005,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;
@ -2544,8 +2543,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

@ -771,7 +771,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);
}
if (dropType == DropType.DROP)
@ -929,7 +929,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)
@ -971,7 +971,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

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

@ -1005,8 +1005,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;
@ -2544,8 +2543,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

@ -786,7 +786,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);
}
if (dropType == DropType.DROP)
@ -944,7 +944,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)
@ -986,7 +986,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

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

@ -1010,8 +1010,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;
@ -2553,8 +2552,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

@ -786,7 +786,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);
}
if (dropType == DropType.DROP)
@ -944,7 +944,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)
@ -986,7 +986,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

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

@ -1016,8 +1016,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;
@ -2598,8 +2597,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

@ -786,7 +786,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);
}
if (dropType == DropType.DROP)
@ -944,7 +944,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)
@ -986,7 +986,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

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

@ -1017,8 +1017,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;
@ -2558,8 +2557,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;
@ -867,7 +867,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)
@ -909,7 +909,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

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

@ -1040,8 +1040,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;
@ -2647,8 +2646,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

@ -785,7 +785,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;
@ -886,7 +886,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)
@ -928,7 +928,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

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

@ -1040,8 +1040,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;
@ -2653,8 +2652,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

@ -785,7 +785,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;
@ -886,7 +886,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)
@ -928,7 +928,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

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

@ -1040,8 +1040,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;
@ -2653,8 +2652,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

@ -785,7 +785,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;
@ -886,7 +886,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)
@ -928,7 +928,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