Addition of attribute system configuration file.

Contributed by facab.
This commit is contained in:
MobiusDevelopment
2019-05-09 11:17:02 +00:00
parent b66e9ca517
commit 3d9011a87d
82 changed files with 3543 additions and 1677 deletions

View File

@@ -86,6 +86,7 @@ public final class Config
public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini";
public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini";
private static final String ATTENDANCE_CONFIG_FILE = "./config/AttendanceRewards.ini";
private static final String ATTRIBUTE_SYSTEM_FILE = "./config/AttributeSystem.ini";
private static final String BALTHUS_KNIGHTS_CONFIG_FILE = "./config/BalthusKnights.ini";
private static final String CHARACTER_CONFIG_FILE = "./config/Character.ini";
private static final String FEATURE_CONFIG_FILE = "./config/Feature.ini";
@@ -794,10 +795,6 @@ public final class Config
public static IdFactoryType IDFACTORY_TYPE;
public static boolean BAD_ID_CHECKING;
public static double ENCHANT_CHANCE_ELEMENT_STONE;
public static double ENCHANT_CHANCE_ELEMENT_CRYSTAL;
public static double ENCHANT_CHANCE_ELEMENT_JEWEL;
public static double ENCHANT_CHANCE_ELEMENT_ENERGY;
public static int[] ENCHANT_BLACKLIST;
public static boolean DISABLE_OVER_ENCHANTING;
public static int[] AUGMENTATION_BLACKLIST;
@@ -942,6 +939,87 @@ public final class Config
public static int OBSTACLE_MULTIPLIER;
public static int MAX_ITERATIONS;
/** Attribute System */
public static int S_WEAPON_STONE;
public static int S80_WEAPON_STONE;
public static int S84_WEAPON_STONE;
public static int R_WEAPON_STONE;
public static int R95_WEAPON_STONE;
public static int R99_WEAPON_STONE;
public static int R110_WEAPON_STONE;
public static int S_ARMOR_STONE;
public static int S80_ARMOR_STONE;
public static int S84_ARMOR_STONE;
public static int R_ARMOR_STONE;
public static int R95_ARMOR_STONE;
public static int R99_ARMOR_STONE;
public static int R110_ARMOR_STONE;
public static int S_WEAPON_CRYSTAL;
public static int S80_WEAPON_CRYSTAL;
public static int S84_WEAPON_CRYSTAL;
public static int R_WEAPON_CRYSTAL;
public static int R95_WEAPON_CRYSTAL;
public static int R99_WEAPON_CRYSTAL;
public static int R110_WEAPON_CRYSTAL;
public static int S_ARMOR_CRYSTAL;
public static int S80_ARMOR_CRYSTAL;
public static int S84_ARMOR_CRYSTAL;
public static int R_ARMOR_CRYSTAL;
public static int R95_ARMOR_CRYSTAL;
public static int R99_ARMOR_CRYSTAL;
public static int R110_ARMOR_CRYSTAL;
public static int S_WEAPON_STONE_SUPER;
public static int S80_WEAPON_STONE_SUPER;
public static int S84_WEAPON_STONE_SUPER;
public static int R_WEAPON_STONE_SUPER;
public static int R95_WEAPON_STONE_SUPER;
public static int R99_WEAPON_STONE_SUPER;
public static int R110_WEAPON_STONE_SUPER;
public static int S_ARMOR_STONE_SUPER;
public static int S80_ARMOR_STONE_SUPER;
public static int S84_ARMOR_STONE_SUPER;
public static int R_ARMOR_STONE_SUPER;
public static int R95_ARMOR_STONE_SUPER;
public static int R99_ARMOR_STONE_SUPER;
public static int R110_ARMOR_STONE_SUPER;
public static int S_WEAPON_CRYSTAL_SUPER;
public static int S80_WEAPON_CRYSTAL_SUPER;
public static int S84_WEAPON_CRYSTAL_SUPER;
public static int R_WEAPON_CRYSTAL_SUPER;
public static int R95_WEAPON_CRYSTAL_SUPER;
public static int R99_WEAPON_CRYSTAL_SUPER;
public static int R110_WEAPON_CRYSTAL_SUPER;
public static int S_ARMOR_CRYSTAL_SUPER;
public static int S80_ARMOR_CRYSTAL_SUPER;
public static int S84_ARMOR_CRYSTAL_SUPER;
public static int R_ARMOR_CRYSTAL_SUPER;
public static int R95_ARMOR_CRYSTAL_SUPER;
public static int R99_ARMOR_CRYSTAL_SUPER;
public static int R110_ARMOR_CRYSTAL_SUPER;
public static int S_WEAPON_JEWEL;
public static int S80_WEAPON_JEWEL;
public static int S84_WEAPON_JEWEL;
public static int R_WEAPON_JEWEL;
public static int R95_WEAPON_JEWEL;
public static int R99_WEAPON_JEWEL;
public static int R110_WEAPON_JEWEL;
public static int S_ARMOR_JEWEL;
public static int S80_ARMOR_JEWEL;
public static int S84_ARMOR_JEWEL;
public static int R_ARMOR_JEWEL;
public static int R95_ARMOR_JEWEL;
public static int R99_ARMOR_JEWEL;
public static int R110_ARMOR_JEWEL;
// --------------------------------------------------
// Custom Settings
// --------------------------------------------------
@@ -1413,7 +1491,7 @@ public final class Config
ALLOW_WYVERN_DURING_SIEGE = Feature.getBoolean("AllowRideWyvernDuringSiege", true);
ALLOW_MOUNTS_DURING_SIEGE = Feature.getBoolean("AllowRideMountsDuringSiege", false);
// Load Attandance config file (if exists)
// Load Attendance config file (if exists)
final PropertiesParser Attandance = new PropertiesParser(ATTENDANCE_CONFIG_FILE);
ENABLE_ATTENDANCE_REWARDS = Attandance.getBoolean("EnableAttendanceRewards", false);
@@ -1422,6 +1500,91 @@ public final class Config
ATTENDANCE_REWARD_DELAY = Attandance.getInt("AttendanceRewardDelay", 30);
ATTENDANCE_POPUP_WINDOW = Attandance.getBoolean("AttendancePopupWindow", false);
// Load AttributeSystem config file (if exists)
final PropertiesParser AttributeSystem = new PropertiesParser(ATTRIBUTE_SYSTEM_FILE);
S_WEAPON_STONE = AttributeSystem.getInt("SWeaponStone", 50);
S80_WEAPON_STONE = AttributeSystem.getInt("S80WeaponStone", 50);
S84_WEAPON_STONE = AttributeSystem.getInt("S84WeaponStone", 50);
R_WEAPON_STONE = AttributeSystem.getInt("RWeaponStone", 50);
R95_WEAPON_STONE = AttributeSystem.getInt("R95WeaponStone", 50);
R99_WEAPON_STONE = AttributeSystem.getInt("R99WeaponStone", 50);
R110_WEAPON_STONE = AttributeSystem.getInt("R110WeaponStone", 50);
S_ARMOR_STONE = AttributeSystem.getInt("SArmorStone", 60);
S80_ARMOR_STONE = AttributeSystem.getInt("S80ArmorStone", 80);
S84_ARMOR_STONE = AttributeSystem.getInt("S84ArmorStone", 80);
R_ARMOR_STONE = AttributeSystem.getInt("RArmorStone", 100);
R95_ARMOR_STONE = AttributeSystem.getInt("R95ArmorStone", 100);
R99_ARMOR_STONE = AttributeSystem.getInt("R99ArmorStone", 100);
R110_ARMOR_STONE = AttributeSystem.getInt("R110ArmorStone", 100);
S_WEAPON_CRYSTAL = AttributeSystem.getInt("SWeaponCrystal", 30);
S80_WEAPON_CRYSTAL = AttributeSystem.getInt("S80WeaponCrystal", 40);
S84_WEAPON_CRYSTAL = AttributeSystem.getInt("S84WeaponCrystal", 50);
R_WEAPON_CRYSTAL = AttributeSystem.getInt("RWeaponCrystal", 60);
R95_WEAPON_CRYSTAL = AttributeSystem.getInt("R95WeaponCrystal", 60);
R99_WEAPON_CRYSTAL = AttributeSystem.getInt("R99WeaponCrystal", 60);
R110_WEAPON_CRYSTAL = AttributeSystem.getInt("R110WeaponCrystal", 60);
S_ARMOR_CRYSTAL = AttributeSystem.getInt("SArmorCrystal", 50);
S80_ARMOR_CRYSTAL = AttributeSystem.getInt("S80ArmorCrystal", 70);
S84_ARMOR_CRYSTAL = AttributeSystem.getInt("S84ArmorCrystal", 80);
R_ARMOR_CRYSTAL = AttributeSystem.getInt("RArmorCrystal", 80);
R95_ARMOR_CRYSTAL = AttributeSystem.getInt("R95ArmorCrystal", 100);
R99_ARMOR_CRYSTAL = AttributeSystem.getInt("R99ArmorCrystal", 100);
R110_ARMOR_CRYSTAL = AttributeSystem.getInt("R110ArmorCrystal", 100);
S_WEAPON_STONE_SUPER = AttributeSystem.getInt("SWeaponStoneSuper", 100);
S80_WEAPON_STONE_SUPER = AttributeSystem.getInt("S80WeaponStoneSuper", 100);
S84_WEAPON_STONE_SUPER = AttributeSystem.getInt("S84WeaponStoneSuper", 100);
R_WEAPON_STONE_SUPER = AttributeSystem.getInt("RWeaponStoneSuper", 100);
R95_WEAPON_STONE_SUPER = AttributeSystem.getInt("R95WeaponStoneSuper", 100);
R99_WEAPON_STONE_SUPER = AttributeSystem.getInt("R99WeaponStoneSuper", 100);
R110_WEAPON_STONE_SUPER = AttributeSystem.getInt("R110WeaponStoneSuper", 100);
S_ARMOR_STONE_SUPER = AttributeSystem.getInt("SArmorStoneSuper", 100);
S80_ARMOR_STONE_SUPER = AttributeSystem.getInt("S80ArmorStoneSuper", 100);
S84_ARMOR_STONE_SUPER = AttributeSystem.getInt("S84ArmorStoneSuper", 100);
R_ARMOR_STONE_SUPER = AttributeSystem.getInt("RArmorStoneSuper", 100);
R95_ARMOR_STONE_SUPER = AttributeSystem.getInt("R95ArmorStoneSuper", 100);
R99_ARMOR_STONE_SUPER = AttributeSystem.getInt("R99ArmorStoneSuper", 100);
R110_ARMOR_STONE_SUPER = AttributeSystem.getInt("R110ArmorStoneSuper", 100);
S_WEAPON_CRYSTAL_SUPER = AttributeSystem.getInt("SWeaponCrystalSuper", 80);
S80_WEAPON_CRYSTAL_SUPER = AttributeSystem.getInt("S80WeaponCrystalSuper", 90);
S84_WEAPON_CRYSTAL_SUPER = AttributeSystem.getInt("S84WeaponCrystalSuper", 100);
R_WEAPON_CRYSTAL_SUPER = AttributeSystem.getInt("RWeaponCrystalSuper", 100);
R95_WEAPON_CRYSTAL_SUPER = AttributeSystem.getInt("R95WeaponCrystalSuper", 100);
R99_WEAPON_CRYSTAL_SUPER = AttributeSystem.getInt("R99WeaponCrystalSuper", 100);
R110_WEAPON_CRYSTAL_SUPER = AttributeSystem.getInt("R110WeaponCrystalSuper", 100);
S_ARMOR_CRYSTAL_SUPER = AttributeSystem.getInt("SArmorCrystalSuper", 100);
S80_ARMOR_CRYSTAL_SUPER = AttributeSystem.getInt("S80ArmorCrystalSuper", 100);
S84_ARMOR_CRYSTAL_SUPER = AttributeSystem.getInt("S84ArmorCrystalSuper", 100);
R_ARMOR_CRYSTAL_SUPER = AttributeSystem.getInt("RArmorCrystalSuper", 100);
R95_ARMOR_CRYSTAL_SUPER = AttributeSystem.getInt("R95ArmorCrystalSuper", 100);
R99_ARMOR_CRYSTAL_SUPER = AttributeSystem.getInt("R99ArmorCrystalSuper", 100);
R110_ARMOR_CRYSTAL_SUPER = AttributeSystem.getInt("R110ArmorCrystalSuper", 100);
S_WEAPON_JEWEL = AttributeSystem.getInt("SWeaponJewel", 100);
S80_WEAPON_JEWEL = AttributeSystem.getInt("S80WeaponJewel", 100);
S84_WEAPON_JEWEL = AttributeSystem.getInt("S84WeaponJewel", 100);
R_WEAPON_JEWEL = AttributeSystem.getInt("RWeaponJewel", 100);
R95_WEAPON_JEWEL = AttributeSystem.getInt("R95WeaponJewel", 100);
R99_WEAPON_JEWEL = AttributeSystem.getInt("R99WeaponJewel", 100);
// Only R110 is used
R110_WEAPON_JEWEL = AttributeSystem.getInt("R110WeaponJewel", 100);
S_ARMOR_JEWEL = AttributeSystem.getInt("SArmorJewel", 100);
S80_ARMOR_JEWEL = AttributeSystem.getInt("S80ArmorJewel", 100);
S84_ARMOR_JEWEL = AttributeSystem.getInt("S84ArmorJewel", 100);
R_ARMOR_JEWEL = AttributeSystem.getInt("RArmorJewel", 100);
R95_ARMOR_JEWEL = AttributeSystem.getInt("R95ArmorJewel", 100);
R99_ARMOR_JEWEL = AttributeSystem.getInt("R99ArmorJewel", 100);
// Only R110 is used
R110_ARMOR_JEWEL = AttributeSystem.getInt("R110ArmorJewel", 100);
// Load BalthusKnights config file (if exists)
final PropertiesParser BalthusKnights = new PropertiesParser(BALTHUS_KNIGHTS_CONFIG_FILE);
@@ -1609,10 +1772,6 @@ public final class Config
ALT_FREIGHT_PRICE = Character.getInt("FreightPrice", 1000);
MENTOR_PENALTY_FOR_MENTEE_COMPLETE = Character.getInt("MentorPenaltyForMenteeComplete", 1) * 24 * 60 * 60 * 1000;
MENTOR_PENALTY_FOR_MENTEE_COMPLETE = Character.getInt("MentorPenaltyForMenteeLeave", 2) * 24 * 60 * 60 * 1000;
ENCHANT_CHANCE_ELEMENT_STONE = Character.getDouble("EnchantChanceElementStone", 50);
ENCHANT_CHANCE_ELEMENT_CRYSTAL = Character.getDouble("EnchantChanceElementCrystal", 30);
ENCHANT_CHANCE_ELEMENT_JEWEL = Character.getDouble("EnchantChanceElementJewel", 20);
ENCHANT_CHANCE_ELEMENT_ENERGY = Character.getDouble("EnchantChanceElementEnergy", 10);
final String[] notenchantable = Character.getString("EnchantBlackList", "7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296").split(",");
ENCHANT_BLACKLIST = new int[notenchantable.length];
for (int i = 0; i < notenchantable.length; i++)

View File

@@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.model;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.CrystalType;
@@ -85,6 +86,19 @@ public final class Elementals
// TODO: Higher stones
};
/* @formatter:off */
private static final int[][] CHANCE_TABLE =
{
{Config.S_WEAPON_STONE, Config.S_ARMOR_STONE, Config.S_WEAPON_CRYSTAL, Config.S_ARMOR_CRYSTAL, Config.S_WEAPON_STONE_SUPER, Config.S_ARMOR_STONE_SUPER, Config.S_WEAPON_JEWEL, Config.S_ARMOR_JEWEL},
{Config.S80_WEAPON_STONE, Config.S80_ARMOR_STONE, Config.S80_WEAPON_CRYSTAL, Config.S80_ARMOR_CRYSTAL, Config.S80_WEAPON_STONE_SUPER, Config.S80_ARMOR_STONE_SUPER, Config.S80_WEAPON_JEWEL, Config.S80_ARMOR_JEWEL},
{Config.S84_WEAPON_STONE, Config.S84_ARMOR_STONE, Config.S84_WEAPON_CRYSTAL, Config.S84_ARMOR_CRYSTAL, Config.S84_WEAPON_STONE_SUPER, Config.S84_ARMOR_STONE_SUPER, Config.S84_WEAPON_JEWEL, Config.S84_ARMOR_JEWEL},
{Config.R_WEAPON_STONE, Config.R_ARMOR_STONE, Config.R_WEAPON_CRYSTAL, Config.R_ARMOR_CRYSTAL, Config.R_WEAPON_STONE_SUPER, Config.R_ARMOR_STONE_SUPER, Config.R_WEAPON_JEWEL, Config.R_ARMOR_JEWEL},
{Config.R95_WEAPON_STONE, Config.R95_ARMOR_STONE, Config.R95_WEAPON_CRYSTAL, Config.R95_ARMOR_CRYSTAL, Config.R95_WEAPON_STONE_SUPER, Config.R95_ARMOR_STONE_SUPER, Config.R95_WEAPON_JEWEL, Config.R95_ARMOR_JEWEL},
{Config.R99_WEAPON_STONE, Config.R99_ARMOR_STONE, Config.R99_WEAPON_CRYSTAL, Config.R99_ARMOR_CRYSTAL, Config.R99_WEAPON_STONE_SUPER, Config.R99_ARMOR_STONE_SUPER, Config.R99_WEAPON_JEWEL, Config.R99_ARMOR_JEWEL},
{Config.R110_WEAPON_STONE, Config.R110_ARMOR_STONE, Config.R110_WEAPON_CRYSTAL, Config.R110_ARMOR_CRYSTAL, Config.R110_WEAPON_STONE_SUPER, Config.R110_ARMOR_STONE_SUPER, Config.R110_WEAPON_JEWEL, Config.R110_ARMOR_JEWEL},
};
/* @formatter:on */
public enum ElementalItemType
{
Stone(3),
@@ -311,128 +325,116 @@ public final class Elementals
return true;
}
/* @formatter:off */
// +-------+----------------+----------------+----------------+----------------+
// | Grade | Stone | Crystal | Stone-Super | Crystal-Super |
// +-------+----------------+----------------+----------------+----------------+
// | | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
// | S | 50% | 60% | 30% | 50% | 100% | 100% | 80% | 100% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
// | S80 | 50% | 80% | 40% | 70% | 100% | 100% | 90% | 100% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
// | S84 | 50% | 80% | 50% | 80% | 100% | 100% | 100% | 100% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
// | R | 50% | 100% | 60% | 80% | 100% | 100% | 100% | 100% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
// | R95 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
// | R99 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
// | R110 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
// R110 same chance R99 not confirmed
/* @formatter:on */
public static boolean isSuccess(ItemInstance item, int stoneId)
{
switch (Elementals.getItemElemental(stoneId)._type)
int row = -1;
int column = -1;
switch (item.getItem().getCrystalType())
{
case S:
{
row = 0;
break;
}
case S80:
{
row = 1;
break;
}
case S84:
{
row = 2;
break;
}
case R:
{
row = 3;
break;
}
case R95:
{
row = 4;
break;
}
case R99:
{
row = 5;
break;
}
case R110:
{
row = 6;
break;
}
}
switch (TABLE.get(stoneId)._type)
{
case Stone:
{
if (item.isWeapon())
{
return Rnd.get(100) < 50;
column = 0;
}
switch (item.getItem().getCrystalType())
else // isArmor = true
{
case S:
{
return Rnd.get(100) < 60;
}
case S80:
case S84:
{
return Rnd.get(100) < 80;
}
default:
{
return true;
}
column = 1;
}
break;
}
case Crystal:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
{
case S:
{
return Rnd.get(100) < 30;
}
case S80:
{
return Rnd.get(100) < 40;
}
case S84:
{
return Rnd.get(100) < 50;
}
default:
{
return Rnd.get(100) < 60;
}
}
column = 2;
}
switch (item.getItem().getCrystalType())
else // isArmor = true
{
case S:
{
return Rnd.get(100) < 50;
}
case S80:
{
return Rnd.get(100) < 70;
}
case S84:
case R:
{
return Rnd.get(100) < 80;
}
default:
{
return true;
}
column = 3;
}
break;
}
case StoneSuper:
{
if (item.isWeapon())
{
column = 4;
}
else // isArmor = true
{
column = 5;
}
break;
}
case CrystalSuper:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
{
case S:
{
return Rnd.get(100) < 80;
}
case S80:
{
return Rnd.get(100) < 90;
}
default:
{
return true;
}
}
column = 6;
}
return true;
else // isArmor = true
{
column = 7;
}
break;
}
case Jewel:
{
if (item.isWeapon())
{
column = 8;
}
else // isArmor = true
{
column = 9;
}
break;
}
}
// Super stones have 100% so will end here.
// Patch notes do not have info about jewels chance so 100% for now, till l2wiki update, energy are not used.
if ((row != -1) && (column != -1))
{
return Rnd.get(100) < CHANCE_TABLE[row][column];
}
return true;
}
}