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

@ -0,0 +1,107 @@
##+-------+----------------+----------------+----------------+----------------+----------------+
##| Grade | Stone | Crystal | Stone-Super | Crystal-Super | Jewel |
##+-------+----------------+----------------+----------------+----------------+----------------+
##| | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S | 50% | 60% | 30% | 50% | 100% | 100% | 80% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S80 | 50% | 80% | 40% | 70% | 100% | 100% | 90% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S84 | 50% | 80% | 50% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R | 50% | 100% | 60% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R95 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R99 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
# ---------------------------------------------------------------------------
# Stone Chance
# ---------------------------------------------------------------------------
SWeaponStone = 50
S80WeaponStone = 50
S84WeaponStone = 50
RWeaponStone = 50
R95WeaponStone = 50
R99WeaponStone = 50
SArmorStone = 60
S80ArmorStone = 80
S84ArmorStone = 80
RArmorStone = 100
R95ArmorStone = 100
R99ArmorStone = 100
# ---------------------------------------------------------------------------
# Crystal Chance
# ---------------------------------------------------------------------------
SWeaponCrystal = 30
S80WeaponCrystal = 40
S84WeaponCrystal = 50
RWeaponCrystal = 60
R95WeaponCrystal = 60
R99WeaponCrystal = 60
SArmorCrystal = 50
S80ArmorCrystal = 70
S84ArmorCrystal = 80
RArmorCrystal = 80
R95ArmorCrystal = 100
R99ArmorCrystal = 100
# ---------------------------------------------------------------------------
# Stone-Super Chance
# ---------------------------------------------------------------------------
SWeaponStoneSuper = 100
S80WeaponStoneSuper = 100
S84WeaponStoneSuper = 100
RWeaponStoneSuper = 100
R95WeaponStoneSuper = 100
R99WeaponStoneSuper = 100
SArmorStoneSuper = 100
S80ArmorStoneSuper = 100
S84ArmorStoneSuper = 100
RArmorStoneSuper = 100
R95ArmorStoneSuper = 100
R99ArmorStoneSuper = 100
# ---------------------------------------------------------------------------
# Crystal-Super Chance
# ---------------------------------------------------------------------------
SWeaponCrystalSuper = 80
S80WeaponCrystalSuper = 90
S84WeaponCrystalSuper = 100
RWeaponCrystalSuper = 100
R95WeaponCrystalSuper = 100
R99WeaponCrystalSuper = 100
SArmorCrystalSuper = 100
S80ArmorCrystalSuper = 100
S84ArmorCrystalSuper = 100
RArmorCrystalSuper = 100
R95ArmorCrystalSuper = 100
R99ArmorCrystalSuper = 100
# ---------------------------------------------------------------------------
# Jewels Chance
# ---------------------------------------------------------------------------
SWeaponJewel = 100
S80WeaponJewel = 100
S84WeaponJewel = 100
RWeaponJewel = 100
R95WeaponJewel = 100
R99WeaponJewel = 100
SArmorJewel = 100
S80ArmorJewel = 100
S84ArmorJewel = 100
RArmorJewel = 100
R95ArmorJewel = 100
R99ArmorJewel = 100

View File

@ -428,14 +428,6 @@ MentorPenaltyForMenteeLeave = 2
# ---------------------------------------------------------------------------
# Enchanting
# ---------------------------------------------------------------------------
# This controls the chance an item has to break if it is enchanted.
# This chance is in %, so if you set this to 100%, enchants will always succeed.
# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT
EnchantChanceElementStone = 50
EnchantChanceElementCrystal = 30
EnchantChanceElementJewel = 20
EnchantChanceElementEnergy = 10
# List of non-enchantable items.
# Currently apprentice, travelers weapons and Pailaka items
# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296

View File

@ -269,26 +269,6 @@ public class AdminAdmin implements IAdminCommandHandler
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementStone":
{
Config.ENCHANT_CHANCE_ELEMENT_STONE = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementCrystal":
{
Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementJewel":
{
Config.ENCHANT_CHANCE_ELEMENT_JEWEL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementEnergy":
{
Config.ENCHANT_CHANCE_ELEMENT_ENERGY = Float.valueOf(pValue);
break;
}
}
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
@ -465,11 +445,6 @@ public class AdminAdmin implements IAdminCommandHandler
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate SP</font> = " + Config.RATE_SP + "</td><td><edit var=\"param2\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateSp $param2\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate Drop Spoil</font> = " + Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER + "</td><td><edit var=\"param4\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateDropSpoil $param4\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td width=140></td><td width=40></td><td width=40></td></tr>");
replyMSG.append("<tr><td><font color=\"00AA00\">Enchant:</font></td><td></td><td></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Stone</font> = " + Config.ENCHANT_CHANCE_ELEMENT_STONE + "</td><td><edit var=\"param8\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementStone $param8\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Crystal</font> = " + Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL + "</td><td><edit var=\"param9\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementCrystal $param9\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Jewel</font> = " + Config.ENCHANT_CHANCE_ELEMENT_JEWEL + "</td><td><edit var=\"param10\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementJewel $param10\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Energy</font> = " + Config.ENCHANT_CHANCE_ELEMENT_ENERGY + "</td><td><edit var=\"param11\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementEnergy $param11\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("</table></body></html>");
adminReply.setHtml(replyMSG.toString());

View File

@ -797,10 +797,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;
@ -932,6 +928,77 @@ 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 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 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 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 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 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 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 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 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 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;
// --------------------------------------------------
// Custom Settings
// --------------------------------------------------
@ -1582,10 +1649,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;
@ -84,6 +85,18 @@ 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},
};
/* @formatter:on */
public enum ElementalItemType
{
Stone(3),
@ -289,128 +302,111 @@ public final class Elementals
return -1;
}
public static boolean isElementableWithStone(ItemInstance targetItem, int stoneId)
{
return targetItem.isElementable();
}
/* @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% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
/* @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;
}
}
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())
column = 2;
}
else // isArmor = true
{
case S:
column = 3;
}
break;
}
case StoneSuper:
{
return Rnd.get(100) < 30;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 40;
column = 4;
}
case S84:
else // isArmor = true
{
return Rnd.get(100) < 50;
}
default:
{
return Rnd.get(100) < 60;
}
}
}
switch (item.getItem().getCrystalType())
{
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 = 5;
}
break;
}
case CrystalSuper:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
column = 6;
}
else // isArmor = true
{
case S:
column = 7;
}
break;
}
case Jewel:
{
return Rnd.get(100) < 80;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 90;
column = 8;
}
default:
else // isArmor = true
{
return true;
column = 9;
}
break;
}
}
if ((row != -1) && (column != -1))
{
return Rnd.get(100) < CHANCE_TABLE[row][column];
}
return true;
}
}
// 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.
return true;
}
}

View File

@ -103,7 +103,7 @@ public class RequestExEnchantItemAttribute implements IClientIncomingPacket
return;
}
if (!Elementals.isElementableWithStone(item, stone.getItem().getId()))
if (!item.isElementable())
{
client.sendPacket(SystemMessageId.ELEMENTAL_POWER_ENHANCER_USAGE_REQUIREMENT_IS_NOT_SUFFICIENT);
player.removeRequest(request.getClass());

View File

@ -51,7 +51,7 @@ public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
// Register only items that can be put an attribute stone/crystal
for (ItemInstance item : player.getInventory().getItems())
{
if (Elementals.isElementableWithStone(item, stone.getId()))
if (item.isElementable())
{
_items.add(item.getObjectId());
}

View File

@ -0,0 +1,107 @@
##+-------+----------------+----------------+----------------+----------------+----------------+
##| Grade | Stone | Crystal | Stone-Super | Crystal-Super | Jewel |
##+-------+----------------+----------------+----------------+----------------+----------------+
##| | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S | 50% | 60% | 30% | 50% | 100% | 100% | 80% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S80 | 50% | 80% | 40% | 70% | 100% | 100% | 90% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S84 | 50% | 80% | 50% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R | 50% | 100% | 60% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R95 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R99 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
# ---------------------------------------------------------------------------
# Stone Chance
# ---------------------------------------------------------------------------
SWeaponStone = 50
S80WeaponStone = 50
S84WeaponStone = 50
RWeaponStone = 50
R95WeaponStone = 50
R99WeaponStone = 50
SArmorStone = 60
S80ArmorStone = 80
S84ArmorStone = 80
RArmorStone = 100
R95ArmorStone = 100
R99ArmorStone = 100
# ---------------------------------------------------------------------------
# Crystal Chance
# ---------------------------------------------------------------------------
SWeaponCrystal = 30
S80WeaponCrystal = 40
S84WeaponCrystal = 50
RWeaponCrystal = 60
R95WeaponCrystal = 60
R99WeaponCrystal = 60
SArmorCrystal = 50
S80ArmorCrystal = 70
S84ArmorCrystal = 80
RArmorCrystal = 80
R95ArmorCrystal = 100
R99ArmorCrystal = 100
# ---------------------------------------------------------------------------
# Stone-Super Chance
# ---------------------------------------------------------------------------
SWeaponStoneSuper = 100
S80WeaponStoneSuper = 100
S84WeaponStoneSuper = 100
RWeaponStoneSuper = 100
R95WeaponStoneSuper = 100
R99WeaponStoneSuper = 100
SArmorStoneSuper = 100
S80ArmorStoneSuper = 100
S84ArmorStoneSuper = 100
RArmorStoneSuper = 100
R95ArmorStoneSuper = 100
R99ArmorStoneSuper = 100
# ---------------------------------------------------------------------------
# Crystal-Super Chance
# ---------------------------------------------------------------------------
SWeaponCrystalSuper = 80
S80WeaponCrystalSuper = 90
S84WeaponCrystalSuper = 100
RWeaponCrystalSuper = 100
R95WeaponCrystalSuper = 100
R99WeaponCrystalSuper = 100
SArmorCrystalSuper = 100
S80ArmorCrystalSuper = 100
S84ArmorCrystalSuper = 100
RArmorCrystalSuper = 100
R95ArmorCrystalSuper = 100
R99ArmorCrystalSuper = 100
# ---------------------------------------------------------------------------
# Jewels Chance
# ---------------------------------------------------------------------------
SWeaponJewel = 100
S80WeaponJewel = 100
S84WeaponJewel = 100
RWeaponJewel = 100
R95WeaponJewel = 100
R99WeaponJewel = 100
SArmorJewel = 100
S80ArmorJewel = 100
S84ArmorJewel = 100
RArmorJewel = 100
R95ArmorJewel = 100
R99ArmorJewel = 100

View File

@ -428,14 +428,6 @@ MentorPenaltyForMenteeLeave = 2
# ---------------------------------------------------------------------------
# Enchanting
# ---------------------------------------------------------------------------
# This controls the chance an item has to break if it is enchanted.
# This chance is in %, so if you set this to 100%, enchants will always succeed.
# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT
EnchantChanceElementStone = 50
EnchantChanceElementCrystal = 30
EnchantChanceElementJewel = 20
EnchantChanceElementEnergy = 10
# List of non-enchantable items.
# Currently apprentice, travelers weapons and Pailaka items
# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296

View File

@ -269,26 +269,6 @@ public class AdminAdmin implements IAdminCommandHandler
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementStone":
{
Config.ENCHANT_CHANCE_ELEMENT_STONE = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementCrystal":
{
Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementJewel":
{
Config.ENCHANT_CHANCE_ELEMENT_JEWEL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementEnergy":
{
Config.ENCHANT_CHANCE_ELEMENT_ENERGY = Float.valueOf(pValue);
break;
}
}
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
@ -465,11 +445,6 @@ public class AdminAdmin implements IAdminCommandHandler
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate SP</font> = " + Config.RATE_SP + "</td><td><edit var=\"param2\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateSp $param2\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate Drop Spoil</font> = " + Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER + "</td><td><edit var=\"param4\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateDropSpoil $param4\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td width=140></td><td width=40></td><td width=40></td></tr>");
replyMSG.append("<tr><td><font color=\"00AA00\">Enchant:</font></td><td></td><td></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Stone</font> = " + Config.ENCHANT_CHANCE_ELEMENT_STONE + "</td><td><edit var=\"param8\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementStone $param8\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Crystal</font> = " + Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL + "</td><td><edit var=\"param9\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementCrystal $param9\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Jewel</font> = " + Config.ENCHANT_CHANCE_ELEMENT_JEWEL + "</td><td><edit var=\"param10\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementJewel $param10\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Energy</font> = " + Config.ENCHANT_CHANCE_ELEMENT_ENERGY + "</td><td><edit var=\"param11\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementEnergy $param11\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("</table></body></html>");
adminReply.setHtml(replyMSG.toString());

View File

@ -804,10 +804,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;
@ -939,6 +935,77 @@ 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 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 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 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 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 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 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 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 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 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;
// --------------------------------------------------
// Custom Settings
// --------------------------------------------------
@ -1422,8 +1489,9 @@ 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);
PREMIUM_ONLY_ATTENDANCE_REWARDS = Attandance.getBoolean("PremiumOnlyAttendanceRewards", false);
ATTENDANCE_REWARDS_SHARE_ACCOUNT = Attandance.getBoolean("AttendanceRewardsShareAccount", false);
@ -1597,10 +1665,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;
@ -84,6 +85,18 @@ 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},
};
/* @formatter:on */
public enum ElementalItemType
{
Stone(3),
@ -289,128 +302,111 @@ public final class Elementals
return -1;
}
public static boolean isElementableWithStone(ItemInstance targetItem, int stoneId)
{
return targetItem.isElementable();
}
/* @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% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
/* @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;
}
}
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())
column = 2;
}
else // isArmor = true
{
case S:
column = 3;
}
break;
}
case StoneSuper:
{
return Rnd.get(100) < 30;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 40;
column = 4;
}
case S84:
else // isArmor = true
{
return Rnd.get(100) < 50;
}
default:
{
return Rnd.get(100) < 60;
}
}
}
switch (item.getItem().getCrystalType())
{
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 = 5;
}
break;
}
case CrystalSuper:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
column = 6;
}
else // isArmor = true
{
case S:
column = 7;
}
break;
}
case Jewel:
{
return Rnd.get(100) < 80;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 90;
column = 8;
}
default:
else // isArmor = true
{
return true;
column = 9;
}
break;
}
}
if ((row != -1) && (column != -1))
{
return Rnd.get(100) < CHANCE_TABLE[row][column];
}
return true;
}
}
// 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.
return true;
}
}

View File

@ -103,7 +103,7 @@ public class RequestExEnchantItemAttribute implements IClientIncomingPacket
return;
}
if (!Elementals.isElementableWithStone(item, stone.getItem().getId()))
if (!item.isElementable())
{
client.sendPacket(SystemMessageId.ELEMENTAL_POWER_ENHANCER_USAGE_REQUIREMENT_IS_NOT_SUFFICIENT);
player.removeRequest(request.getClass());

View File

@ -51,7 +51,7 @@ public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
// Register only items that can be put an attribute stone/crystal
for (ItemInstance item : player.getInventory().getItems())
{
if (Elementals.isElementableWithStone(item, stone.getId()))
if (item.isElementable())
{
_items.add(item.getObjectId());
}

View File

@ -0,0 +1,107 @@
##+-------+----------------+----------------+----------------+----------------+----------------+
##| Grade | Stone | Crystal | Stone-Super | Crystal-Super | Jewel |
##+-------+----------------+----------------+----------------+----------------+----------------+
##| | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S | 50% | 60% | 30% | 50% | 100% | 100% | 80% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S80 | 50% | 80% | 40% | 70% | 100% | 100% | 90% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S84 | 50% | 80% | 50% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R | 50% | 100% | 60% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R95 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R99 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
# ---------------------------------------------------------------------------
# Stone Chance
# ---------------------------------------------------------------------------
SWeaponStone = 50
S80WeaponStone = 50
S84WeaponStone = 50
RWeaponStone = 50
R95WeaponStone = 50
R99WeaponStone = 50
SArmorStone = 60
S80ArmorStone = 80
S84ArmorStone = 80
RArmorStone = 100
R95ArmorStone = 100
R99ArmorStone = 100
# ---------------------------------------------------------------------------
# Crystal Chance
# ---------------------------------------------------------------------------
SWeaponCrystal = 30
S80WeaponCrystal = 40
S84WeaponCrystal = 50
RWeaponCrystal = 60
R95WeaponCrystal = 60
R99WeaponCrystal = 60
SArmorCrystal = 50
S80ArmorCrystal = 70
S84ArmorCrystal = 80
RArmorCrystal = 80
R95ArmorCrystal = 100
R99ArmorCrystal = 100
# ---------------------------------------------------------------------------
# Stone-Super Chance
# ---------------------------------------------------------------------------
SWeaponStoneSuper = 100
S80WeaponStoneSuper = 100
S84WeaponStoneSuper = 100
RWeaponStoneSuper = 100
R95WeaponStoneSuper = 100
R99WeaponStoneSuper = 100
SArmorStoneSuper = 100
S80ArmorStoneSuper = 100
S84ArmorStoneSuper = 100
RArmorStoneSuper = 100
R95ArmorStoneSuper = 100
R99ArmorStoneSuper = 100
# ---------------------------------------------------------------------------
# Crystal-Super Chance
# ---------------------------------------------------------------------------
SWeaponCrystalSuper = 80
S80WeaponCrystalSuper = 90
S84WeaponCrystalSuper = 100
RWeaponCrystalSuper = 100
R95WeaponCrystalSuper = 100
R99WeaponCrystalSuper = 100
SArmorCrystalSuper = 100
S80ArmorCrystalSuper = 100
S84ArmorCrystalSuper = 100
RArmorCrystalSuper = 100
R95ArmorCrystalSuper = 100
R99ArmorCrystalSuper = 100
# ---------------------------------------------------------------------------
# Jewels Chance
# ---------------------------------------------------------------------------
SWeaponJewel = 100
S80WeaponJewel = 100
S84WeaponJewel = 100
RWeaponJewel = 100
R95WeaponJewel = 100
R99WeaponJewel = 100
SArmorJewel = 100
S80ArmorJewel = 100
S84ArmorJewel = 100
RArmorJewel = 100
R95ArmorJewel = 100
R99ArmorJewel = 100

View File

@ -428,14 +428,6 @@ MentorPenaltyForMenteeLeave = 2
# ---------------------------------------------------------------------------
# Enchanting
# ---------------------------------------------------------------------------
# This controls the chance an item has to break if it is enchanted.
# This chance is in %, so if you set this to 100%, enchants will always succeed.
# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT
EnchantChanceElementStone = 50
EnchantChanceElementCrystal = 30
EnchantChanceElementJewel = 20
EnchantChanceElementEnergy = 10
# List of non-enchantable items.
# Currently apprentice, travelers weapons and Pailaka items
# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296

View File

@ -269,26 +269,6 @@ public class AdminAdmin implements IAdminCommandHandler
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementStone":
{
Config.ENCHANT_CHANCE_ELEMENT_STONE = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementCrystal":
{
Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementJewel":
{
Config.ENCHANT_CHANCE_ELEMENT_JEWEL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementEnergy":
{
Config.ENCHANT_CHANCE_ELEMENT_ENERGY = Float.valueOf(pValue);
break;
}
}
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
@ -465,11 +445,6 @@ public class AdminAdmin implements IAdminCommandHandler
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate SP</font> = " + Config.RATE_SP + "</td><td><edit var=\"param2\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateSp $param2\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate Drop Spoil</font> = " + Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER + "</td><td><edit var=\"param4\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateDropSpoil $param4\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td width=140></td><td width=40></td><td width=40></td></tr>");
replyMSG.append("<tr><td><font color=\"00AA00\">Enchant:</font></td><td></td><td></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Stone</font> = " + Config.ENCHANT_CHANCE_ELEMENT_STONE + "</td><td><edit var=\"param8\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementStone $param8\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Crystal</font> = " + Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL + "</td><td><edit var=\"param9\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementCrystal $param9\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Jewel</font> = " + Config.ENCHANT_CHANCE_ELEMENT_JEWEL + "</td><td><edit var=\"param10\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementJewel $param10\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Energy</font> = " + Config.ENCHANT_CHANCE_ELEMENT_ENERGY + "</td><td><edit var=\"param11\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementEnergy $param11\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("</table></body></html>");
adminReply.setHtml(replyMSG.toString());

View File

@ -805,10 +805,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;
@ -947,6 +943,77 @@ 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 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 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 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 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 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 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 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 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 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;
// --------------------------------------------------
// Custom Settings
// --------------------------------------------------
@ -1430,8 +1497,9 @@ 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);
PREMIUM_ONLY_ATTENDANCE_REWARDS = Attandance.getBoolean("PremiumOnlyAttendanceRewards", false);
ATTENDANCE_REWARDS_SHARE_ACCOUNT = Attandance.getBoolean("AttendanceRewardsShareAccount", false);
@ -1605,10 +1673,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;
@ -84,6 +85,18 @@ 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},
};
/* @formatter:on */
public enum ElementalItemType
{
Stone(3),
@ -289,128 +302,111 @@ public final class Elementals
return -1;
}
public static boolean isElementableWithStone(ItemInstance targetItem, int stoneId)
{
return targetItem.isElementable();
}
/* @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% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
/* @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;
}
}
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())
column = 2;
}
else // isArmor = true
{
case S:
column = 3;
}
break;
}
case StoneSuper:
{
return Rnd.get(100) < 30;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 40;
column = 4;
}
case S84:
else // isArmor = true
{
return Rnd.get(100) < 50;
}
default:
{
return Rnd.get(100) < 60;
}
}
}
switch (item.getItem().getCrystalType())
{
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 = 5;
}
break;
}
case CrystalSuper:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
column = 6;
}
else // isArmor = true
{
case S:
column = 7;
}
break;
}
case Jewel:
{
return Rnd.get(100) < 80;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 90;
column = 8;
}
default:
else // isArmor = true
{
return true;
column = 9;
}
break;
}
}
if ((row != -1) && (column != -1))
{
return Rnd.get(100) < CHANCE_TABLE[row][column];
}
return true;
}
}
// 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.
return true;
}
}

View File

@ -103,7 +103,7 @@ public class RequestExEnchantItemAttribute implements IClientIncomingPacket
return;
}
if (!Elementals.isElementableWithStone(item, stone.getItem().getId()))
if (!item.isElementable())
{
client.sendPacket(SystemMessageId.ELEMENTAL_POWER_ENHANCER_USAGE_REQUIREMENT_IS_NOT_SUFFICIENT);
player.removeRequest(request.getClass());

View File

@ -51,7 +51,7 @@ public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
// Register only items that can be put an attribute stone/crystal
for (ItemInstance item : player.getInventory().getItems())
{
if (Elementals.isElementableWithStone(item, stone.getId()))
if (item.isElementable())
{
_items.add(item.getObjectId());
}

View File

@ -0,0 +1,107 @@
##+-------+----------------+----------------+----------------+----------------+----------------+
##| Grade | Stone | Crystal | Stone-Super | Crystal-Super | Jewel |
##+-------+----------------+----------------+----------------+----------------+----------------+
##| | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S | 50% | 60% | 30% | 50% | 100% | 100% | 80% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S80 | 50% | 80% | 40% | 70% | 100% | 100% | 90% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S84 | 50% | 80% | 50% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R | 50% | 100% | 60% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R95 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R99 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
# ---------------------------------------------------------------------------
# Stone Chance
# ---------------------------------------------------------------------------
SWeaponStone = 50
S80WeaponStone = 50
S84WeaponStone = 50
RWeaponStone = 50
R95WeaponStone = 50
R99WeaponStone = 50
SArmorStone = 60
S80ArmorStone = 80
S84ArmorStone = 80
RArmorStone = 100
R95ArmorStone = 100
R99ArmorStone = 100
# ---------------------------------------------------------------------------
# Crystal Chance
# ---------------------------------------------------------------------------
SWeaponCrystal = 30
S80WeaponCrystal = 40
S84WeaponCrystal = 50
RWeaponCrystal = 60
R95WeaponCrystal = 60
R99WeaponCrystal = 60
SArmorCrystal = 50
S80ArmorCrystal = 70
S84ArmorCrystal = 80
RArmorCrystal = 80
R95ArmorCrystal = 100
R99ArmorCrystal = 100
# ---------------------------------------------------------------------------
# Stone-Super Chance
# ---------------------------------------------------------------------------
SWeaponStoneSuper = 100
S80WeaponStoneSuper = 100
S84WeaponStoneSuper = 100
RWeaponStoneSuper = 100
R95WeaponStoneSuper = 100
R99WeaponStoneSuper = 100
SArmorStoneSuper = 100
S80ArmorStoneSuper = 100
S84ArmorStoneSuper = 100
RArmorStoneSuper = 100
R95ArmorStoneSuper = 100
R99ArmorStoneSuper = 100
# ---------------------------------------------------------------------------
# Crystal-Super Chance
# ---------------------------------------------------------------------------
SWeaponCrystalSuper = 80
S80WeaponCrystalSuper = 90
S84WeaponCrystalSuper = 100
RWeaponCrystalSuper = 100
R95WeaponCrystalSuper = 100
R99WeaponCrystalSuper = 100
SArmorCrystalSuper = 100
S80ArmorCrystalSuper = 100
S84ArmorCrystalSuper = 100
RArmorCrystalSuper = 100
R95ArmorCrystalSuper = 100
R99ArmorCrystalSuper = 100
# ---------------------------------------------------------------------------
# Jewels Chance
# ---------------------------------------------------------------------------
SWeaponJewel = 100
S80WeaponJewel = 100
S84WeaponJewel = 100
RWeaponJewel = 100
R95WeaponJewel = 100
R99WeaponJewel = 100
SArmorJewel = 100
S80ArmorJewel = 100
S84ArmorJewel = 100
RArmorJewel = 100
R95ArmorJewel = 100
R99ArmorJewel = 100

View File

@ -428,14 +428,6 @@ MentorPenaltyForMenteeLeave = 2
# ---------------------------------------------------------------------------
# Enchanting
# ---------------------------------------------------------------------------
# This controls the chance an item has to break if it is enchanted.
# This chance is in %, so if you set this to 100%, enchants will always succeed.
# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT
EnchantChanceElementStone = 50
EnchantChanceElementCrystal = 30
EnchantChanceElementJewel = 20
EnchantChanceElementEnergy = 10
# List of non-enchantable items.
# Currently apprentice, travelers weapons and Pailaka items
# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296

View File

@ -269,26 +269,6 @@ public class AdminAdmin implements IAdminCommandHandler
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementStone":
{
Config.ENCHANT_CHANCE_ELEMENT_STONE = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementCrystal":
{
Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementJewel":
{
Config.ENCHANT_CHANCE_ELEMENT_JEWEL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementEnergy":
{
Config.ENCHANT_CHANCE_ELEMENT_ENERGY = Float.valueOf(pValue);
break;
}
}
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
@ -465,11 +445,6 @@ public class AdminAdmin implements IAdminCommandHandler
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate SP</font> = " + Config.RATE_SP + "</td><td><edit var=\"param2\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateSp $param2\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate Drop Spoil</font> = " + Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER + "</td><td><edit var=\"param4\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateDropSpoil $param4\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td width=140></td><td width=40></td><td width=40></td></tr>");
replyMSG.append("<tr><td><font color=\"00AA00\">Enchant:</font></td><td></td><td></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Stone</font> = " + Config.ENCHANT_CHANCE_ELEMENT_STONE + "</td><td><edit var=\"param8\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementStone $param8\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Crystal</font> = " + Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL + "</td><td><edit var=\"param9\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementCrystal $param9\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Jewel</font> = " + Config.ENCHANT_CHANCE_ELEMENT_JEWEL + "</td><td><edit var=\"param10\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementJewel $param10\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Energy</font> = " + Config.ENCHANT_CHANCE_ELEMENT_ENERGY + "</td><td><edit var=\"param11\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementEnergy $param11\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("</table></body></html>");
adminReply.setHtml(replyMSG.toString());

View File

@ -798,10 +798,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;
@ -940,6 +936,77 @@ 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 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 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 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 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 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 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 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 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 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;
// --------------------------------------------------
// Custom Settings
// --------------------------------------------------
@ -1423,8 +1490,9 @@ 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);
PREMIUM_ONLY_ATTENDANCE_REWARDS = Attandance.getBoolean("PremiumOnlyAttendanceRewards", false);
ATTENDANCE_REWARDS_SHARE_ACCOUNT = Attandance.getBoolean("AttendanceRewardsShareAccount", false);
@ -1598,10 +1666,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;
@ -84,6 +85,18 @@ 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},
};
/* @formatter:on */
public enum ElementalItemType
{
Stone(3),
@ -289,128 +302,111 @@ public final class Elementals
return -1;
}
public static boolean isElementableWithStone(ItemInstance targetItem, int stoneId)
{
return targetItem.isElementable();
}
/* @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% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
/* @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;
}
}
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())
column = 2;
}
else // isArmor = true
{
case S:
column = 3;
}
break;
}
case StoneSuper:
{
return Rnd.get(100) < 30;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 40;
column = 4;
}
case S84:
else // isArmor = true
{
return Rnd.get(100) < 50;
}
default:
{
return Rnd.get(100) < 60;
}
}
}
switch (item.getItem().getCrystalType())
{
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 = 5;
}
break;
}
case CrystalSuper:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
column = 6;
}
else // isArmor = true
{
case S:
column = 7;
}
break;
}
case Jewel:
{
return Rnd.get(100) < 80;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 90;
column = 8;
}
default:
else // isArmor = true
{
return true;
column = 9;
}
break;
}
}
if ((row != -1) && (column != -1))
{
return Rnd.get(100) < CHANCE_TABLE[row][column];
}
return true;
}
}
// 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.
return true;
}
}

View File

@ -103,7 +103,7 @@ public class RequestExEnchantItemAttribute implements IClientIncomingPacket
return;
}
if (!Elementals.isElementableWithStone(item, stone.getItem().getId()))
if (!item.isElementable())
{
client.sendPacket(SystemMessageId.ELEMENTAL_POWER_ENHANCER_USAGE_REQUIREMENT_IS_NOT_SUFFICIENT);
player.removeRequest(request.getClass());

View File

@ -51,7 +51,7 @@ public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
// Register only items that can be put an attribute stone/crystal
for (ItemInstance item : player.getInventory().getItems())
{
if (Elementals.isElementableWithStone(item, stone.getId()))
if (item.isElementable())
{
_items.add(item.getObjectId());
}

View File

@ -0,0 +1,107 @@
##+-------+----------------+----------------+----------------+----------------+----------------+
##| Grade | Stone | Crystal | Stone-Super | Crystal-Super | Jewel |
##+-------+----------------+----------------+----------------+----------------+----------------+
##| | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S | 50% | 60% | 30% | 50% | 100% | 100% | 80% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S80 | 50% | 80% | 40% | 70% | 100% | 100% | 90% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S84 | 50% | 80% | 50% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R | 50% | 100% | 60% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R95 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R99 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
# ---------------------------------------------------------------------------
# Stone Chance
# ---------------------------------------------------------------------------
SWeaponStone = 50
S80WeaponStone = 50
S84WeaponStone = 50
RWeaponStone = 50
R95WeaponStone = 50
R99WeaponStone = 50
SArmorStone = 60
S80ArmorStone = 80
S84ArmorStone = 80
RArmorStone = 100
R95ArmorStone = 100
R99ArmorStone = 100
# ---------------------------------------------------------------------------
# Crystal Chance
# ---------------------------------------------------------------------------
SWeaponCrystal = 30
S80WeaponCrystal = 40
S84WeaponCrystal = 50
RWeaponCrystal = 60
R95WeaponCrystal = 60
R99WeaponCrystal = 60
SArmorCrystal = 50
S80ArmorCrystal = 70
S84ArmorCrystal = 80
RArmorCrystal = 80
R95ArmorCrystal = 100
R99ArmorCrystal = 100
# ---------------------------------------------------------------------------
# Stone-Super Chance
# ---------------------------------------------------------------------------
SWeaponStoneSuper = 100
S80WeaponStoneSuper = 100
S84WeaponStoneSuper = 100
RWeaponStoneSuper = 100
R95WeaponStoneSuper = 100
R99WeaponStoneSuper = 100
SArmorStoneSuper = 100
S80ArmorStoneSuper = 100
S84ArmorStoneSuper = 100
RArmorStoneSuper = 100
R95ArmorStoneSuper = 100
R99ArmorStoneSuper = 100
# ---------------------------------------------------------------------------
# Crystal-Super Chance
# ---------------------------------------------------------------------------
SWeaponCrystalSuper = 80
S80WeaponCrystalSuper = 90
S84WeaponCrystalSuper = 100
RWeaponCrystalSuper = 100
R95WeaponCrystalSuper = 100
R99WeaponCrystalSuper = 100
SArmorCrystalSuper = 100
S80ArmorCrystalSuper = 100
S84ArmorCrystalSuper = 100
RArmorCrystalSuper = 100
R95ArmorCrystalSuper = 100
R99ArmorCrystalSuper = 100
# ---------------------------------------------------------------------------
# Jewels Chance
# ---------------------------------------------------------------------------
SWeaponJewel = 100
S80WeaponJewel = 100
S84WeaponJewel = 100
RWeaponJewel = 100
R95WeaponJewel = 100
R99WeaponJewel = 100
SArmorJewel = 100
S80ArmorJewel = 100
S84ArmorJewel = 100
RArmorJewel = 100
R95ArmorJewel = 100
R99ArmorJewel = 100

View File

@ -428,14 +428,6 @@ MentorPenaltyForMenteeLeave = 2
# ---------------------------------------------------------------------------
# Enchanting
# ---------------------------------------------------------------------------
# This controls the chance an item has to break if it is enchanted.
# This chance is in %, so if you set this to 100%, enchants will always succeed.
# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT
EnchantChanceElementStone = 50
EnchantChanceElementCrystal = 30
EnchantChanceElementJewel = 20
EnchantChanceElementEnergy = 10
# List of non-enchantable items.
# Currently apprentice, travelers weapons and Pailaka items
# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296

View File

@ -269,26 +269,6 @@ public class AdminAdmin implements IAdminCommandHandler
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementStone":
{
Config.ENCHANT_CHANCE_ELEMENT_STONE = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementCrystal":
{
Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementJewel":
{
Config.ENCHANT_CHANCE_ELEMENT_JEWEL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementEnergy":
{
Config.ENCHANT_CHANCE_ELEMENT_ENERGY = Float.valueOf(pValue);
break;
}
}
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
@ -465,11 +445,6 @@ public class AdminAdmin implements IAdminCommandHandler
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate SP</font> = " + Config.RATE_SP + "</td><td><edit var=\"param2\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateSp $param2\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate Drop Spoil</font> = " + Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER + "</td><td><edit var=\"param4\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateDropSpoil $param4\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td width=140></td><td width=40></td><td width=40></td></tr>");
replyMSG.append("<tr><td><font color=\"00AA00\">Enchant:</font></td><td></td><td></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Stone</font> = " + Config.ENCHANT_CHANCE_ELEMENT_STONE + "</td><td><edit var=\"param8\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementStone $param8\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Crystal</font> = " + Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL + "</td><td><edit var=\"param9\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementCrystal $param9\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Jewel</font> = " + Config.ENCHANT_CHANCE_ELEMENT_JEWEL + "</td><td><edit var=\"param10\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementJewel $param10\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Energy</font> = " + Config.ENCHANT_CHANCE_ELEMENT_ENERGY + "</td><td><edit var=\"param11\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementEnergy $param11\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("</table></body></html>");
adminReply.setHtml(replyMSG.toString());

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";
@ -793,10 +794,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;
@ -935,6 +932,77 @@ 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 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 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 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 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 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 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 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 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 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;
// --------------------------------------------------
// Custom Settings
// --------------------------------------------------
@ -1406,7 +1474,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);
@ -1415,6 +1483,79 @@ 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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
// Load BalthusKnights config file (if exists)
final PropertiesParser BalthusKnights = new PropertiesParser(BALTHUS_KNIGHTS_CONFIG_FILE);
@ -1601,10 +1742,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;
@ -84,6 +85,18 @@ 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},
};
/* @formatter:on */
public enum ElementalItemType
{
Stone(3),
@ -291,128 +304,111 @@ public final class Elementals
return -1;
}
public static boolean isElementableWithStone(ItemInstance targetItem, int stoneId)
{
return targetItem.isElementable();
}
/* @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% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
/* @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;
}
}
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())
column = 2;
}
else // isArmor = true
{
case S:
column = 3;
}
break;
}
case StoneSuper:
{
return Rnd.get(100) < 30;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 40;
column = 4;
}
case S84:
else // isArmor = true
{
return Rnd.get(100) < 50;
}
default:
{
return Rnd.get(100) < 60;
}
}
}
switch (item.getItem().getCrystalType())
{
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 = 5;
}
break;
}
case CrystalSuper:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
column = 6;
}
else // isArmor = true
{
case S:
column = 7;
}
break;
}
case Jewel:
{
return Rnd.get(100) < 80;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 90;
column = 8;
}
default:
else // isArmor = true
{
return true;
column = 9;
}
break;
}
}
if ((row != -1) && (column != -1))
{
return Rnd.get(100) < CHANCE_TABLE[row][column];
}
return true;
}
}
// 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.
return true;
}
}

View File

@ -111,7 +111,7 @@ public class RequestExEnchantItemAttribute implements IClientIncomingPacket
return;
}
if (!Elementals.isElementableWithStone(item, stone.getItem().getId()))
if (!item.isElementable())
{
client.sendPacket(SystemMessageId.ELEMENTAL_POWER_ENHANCER_USAGE_REQUIREMENT_IS_NOT_SUFFICIENT);
player.removeRequest(request.getClass());

View File

@ -51,7 +51,7 @@ public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
// Register only items that can be put an attribute stone/crystal
for (ItemInstance item : player.getInventory().getItems())
{
if (Elementals.isElementableWithStone(item, stone.getId()))
if (item.isElementable())
{
_items.add(item.getObjectId());
}

View File

@ -0,0 +1,107 @@
##+-------+----------------+----------------+----------------+----------------+----------------+
##| Grade | Stone | Crystal | Stone-Super | Crystal-Super | Jewel |
##+-------+----------------+----------------+----------------+----------------+----------------+
##| | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S | 50% | 60% | 30% | 50% | 100% | 100% | 80% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S80 | 50% | 80% | 40% | 70% | 100% | 100% | 90% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S84 | 50% | 80% | 50% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R | 50% | 100% | 60% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R95 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R99 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
# ---------------------------------------------------------------------------
# Stone Chance
# ---------------------------------------------------------------------------
SWeaponStone = 50
S80WeaponStone = 50
S84WeaponStone = 50
RWeaponStone = 50
R95WeaponStone = 50
R99WeaponStone = 50
SArmorStone = 60
S80ArmorStone = 80
S84ArmorStone = 80
RArmorStone = 100
R95ArmorStone = 100
R99ArmorStone = 100
# ---------------------------------------------------------------------------
# Crystal Chance
# ---------------------------------------------------------------------------
SWeaponCrystal = 30
S80WeaponCrystal = 40
S84WeaponCrystal = 50
RWeaponCrystal = 60
R95WeaponCrystal = 60
R99WeaponCrystal = 60
SArmorCrystal = 50
S80ArmorCrystal = 70
S84ArmorCrystal = 80
RArmorCrystal = 80
R95ArmorCrystal = 100
R99ArmorCrystal = 100
# ---------------------------------------------------------------------------
# Stone-Super Chance
# ---------------------------------------------------------------------------
SWeaponStoneSuper = 100
S80WeaponStoneSuper = 100
S84WeaponStoneSuper = 100
RWeaponStoneSuper = 100
R95WeaponStoneSuper = 100
R99WeaponStoneSuper = 100
SArmorStoneSuper = 100
S80ArmorStoneSuper = 100
S84ArmorStoneSuper = 100
RArmorStoneSuper = 100
R95ArmorStoneSuper = 100
R99ArmorStoneSuper = 100
# ---------------------------------------------------------------------------
# Crystal-Super Chance
# ---------------------------------------------------------------------------
SWeaponCrystalSuper = 80
S80WeaponCrystalSuper = 90
S84WeaponCrystalSuper = 100
RWeaponCrystalSuper = 100
R95WeaponCrystalSuper = 100
R99WeaponCrystalSuper = 100
SArmorCrystalSuper = 100
S80ArmorCrystalSuper = 100
S84ArmorCrystalSuper = 100
RArmorCrystalSuper = 100
R95ArmorCrystalSuper = 100
R99ArmorCrystalSuper = 100
# ---------------------------------------------------------------------------
# Jewels Chance
# ---------------------------------------------------------------------------
SWeaponJewel = 100
S80WeaponJewel = 100
S84WeaponJewel = 100
RWeaponJewel = 100
R95WeaponJewel = 100
R99WeaponJewel = 100
SArmorJewel = 100
S80ArmorJewel = 100
S84ArmorJewel = 100
RArmorJewel = 100
R95ArmorJewel = 100
R99ArmorJewel = 100

View File

@ -428,14 +428,6 @@ MentorPenaltyForMenteeLeave = 2
# ---------------------------------------------------------------------------
# Enchanting
# ---------------------------------------------------------------------------
# This controls the chance an item has to break if it is enchanted.
# This chance is in %, so if you set this to 100%, enchants will always succeed.
# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT
EnchantChanceElementStone = 50
EnchantChanceElementCrystal = 30
EnchantChanceElementJewel = 20
EnchantChanceElementEnergy = 10
# List of non-enchantable items.
# Currently apprentice, travelers weapons and Pailaka items
# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296

View File

@ -269,26 +269,6 @@ public class AdminAdmin implements IAdminCommandHandler
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementStone":
{
Config.ENCHANT_CHANCE_ELEMENT_STONE = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementCrystal":
{
Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementJewel":
{
Config.ENCHANT_CHANCE_ELEMENT_JEWEL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementEnergy":
{
Config.ENCHANT_CHANCE_ELEMENT_ENERGY = Float.valueOf(pValue);
break;
}
}
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
@ -465,11 +445,6 @@ public class AdminAdmin implements IAdminCommandHandler
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate SP</font> = " + Config.RATE_SP + "</td><td><edit var=\"param2\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateSp $param2\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate Drop Spoil</font> = " + Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER + "</td><td><edit var=\"param4\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateDropSpoil $param4\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td width=140></td><td width=40></td><td width=40></td></tr>");
replyMSG.append("<tr><td><font color=\"00AA00\">Enchant:</font></td><td></td><td></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Stone</font> = " + Config.ENCHANT_CHANCE_ELEMENT_STONE + "</td><td><edit var=\"param8\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementStone $param8\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Crystal</font> = " + Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL + "</td><td><edit var=\"param9\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementCrystal $param9\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Jewel</font> = " + Config.ENCHANT_CHANCE_ELEMENT_JEWEL + "</td><td><edit var=\"param10\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementJewel $param10\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Energy</font> = " + Config.ENCHANT_CHANCE_ELEMENT_ENERGY + "</td><td><edit var=\"param11\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementEnergy $param11\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("</table></body></html>");
adminReply.setHtml(replyMSG.toString());

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";
@ -793,10 +794,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;
@ -935,6 +932,77 @@ 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 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 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 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 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 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 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 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 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 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;
// --------------------------------------------------
// Custom Settings
// --------------------------------------------------
@ -1406,7 +1474,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);
@ -1415,6 +1483,79 @@ 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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
// Load BalthusKnights config file (if exists)
final PropertiesParser BalthusKnights = new PropertiesParser(BALTHUS_KNIGHTS_CONFIG_FILE);
@ -1601,10 +1742,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;
@ -84,6 +85,18 @@ 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},
};
/* @formatter:on */
public enum ElementalItemType
{
Stone(3),
@ -291,128 +304,111 @@ public final class Elementals
return -1;
}
public static boolean isElementableWithStone(ItemInstance targetItem, int stoneId)
{
return targetItem.isElementable();
}
/* @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% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
/* @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;
}
}
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())
column = 2;
}
else // isArmor = true
{
case S:
column = 3;
}
break;
}
case StoneSuper:
{
return Rnd.get(100) < 30;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 40;
column = 4;
}
case S84:
else // isArmor = true
{
return Rnd.get(100) < 50;
}
default:
{
return Rnd.get(100) < 60;
}
}
}
switch (item.getItem().getCrystalType())
{
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 = 5;
}
break;
}
case CrystalSuper:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
column = 6;
}
else // isArmor = true
{
case S:
column = 7;
}
break;
}
case Jewel:
{
return Rnd.get(100) < 80;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 90;
column = 8;
}
default:
else // isArmor = true
{
return true;
column = 9;
}
break;
}
}
if ((row != -1) && (column != -1))
{
return Rnd.get(100) < CHANCE_TABLE[row][column];
}
return true;
}
}
// 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.
return true;
}
}

View File

@ -111,7 +111,7 @@ public class RequestExEnchantItemAttribute implements IClientIncomingPacket
return;
}
if (!Elementals.isElementableWithStone(item, stone.getItem().getId()))
if (!item.isElementable())
{
client.sendPacket(SystemMessageId.ELEMENTAL_POWER_ENHANCER_USAGE_REQUIREMENT_IS_NOT_SUFFICIENT);
player.removeRequest(request.getClass());

View File

@ -51,7 +51,7 @@ public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
// Register only items that can be put an attribute stone/crystal
for (ItemInstance item : player.getInventory().getItems())
{
if (Elementals.isElementableWithStone(item, stone.getId()))
if (item.isElementable())
{
_items.add(item.getObjectId());
}

View File

@ -0,0 +1,119 @@
##+-------+----------------+----------------+----------------+----------------+----------------+
##| Grade | Stone | Crystal | Stone-Super | Crystal-Super | Jewel |
##+-------+----------------+----------------+----------------+----------------+----------------+
##| | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S | 50% | 60% | 30% | 50% | 100% | 100% | 80% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S80 | 50% | 80% | 40% | 70% | 100% | 100% | 90% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S84 | 50% | 80% | 50% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R | 50% | 100% | 60% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R95 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R99 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+ Jewels don't have info about chance
##| R110 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% | Jewels can be used only for R110
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
# ---------------------------------------------------------------------------
# Stone Chance
# ---------------------------------------------------------------------------
SWeaponStone = 50
S80WeaponStone = 50
S84WeaponStone = 50
RWeaponStone = 50
R95WeaponStone = 50
R99WeaponStone = 50
R110WeaponStone = 50
SArmorStone = 60
S80ArmorStone = 80
S84ArmorStone = 80
RArmorStone = 100
R95ArmorStone = 100
R99ArmorStone = 100
R110ArmorStone = 100
# ---------------------------------------------------------------------------
# Crystal Chance
# ---------------------------------------------------------------------------
SWeaponCrystal = 30
S80WeaponCrystal = 40
S84WeaponCrystal = 50
RWeaponCrystal = 60
R95WeaponCrystal = 60
R99WeaponCrystal = 60
R110WeaponCrystal = 60
SArmorCrystal = 50
S80ArmorCrystal = 70
S84ArmorCrystal = 80
RArmorCrystal = 80
R95ArmorCrystal = 100
R99ArmorCrystal = 100
R110ArmorCrystal = 100
# ---------------------------------------------------------------------------
# Stone-Super Chance
# ---------------------------------------------------------------------------
SWeaponStoneSuper = 100
S80WeaponStoneSuper = 100
S84WeaponStoneSuper = 100
RWeaponStoneSuper = 100
R95WeaponStoneSuper = 100
R99WeaponStoneSuper = 100
R110WeaponStoneSuper = 100
SArmorStoneSuper = 100
S80ArmorStoneSuper = 100
S84ArmorStoneSuper = 100
RArmorStoneSuper = 100
R95ArmorStoneSuper = 100
R99ArmorStoneSuper = 100
R110ArmorStoneSuper = 100
# ---------------------------------------------------------------------------
# Crystal-Super Chance
# ---------------------------------------------------------------------------
SWeaponCrystalSuper = 80
S80WeaponCrystalSuper = 90
S84WeaponCrystalSuper = 100
RWeaponCrystalSuper = 100
R95WeaponCrystalSuper = 100
R99WeaponCrystalSuper = 100
R110WeaponCrystalSuper = 100
SArmorCrystalSuper = 100
S80ArmorCrystalSuper = 100
S84ArmorCrystalSuper = 100
RArmorCrystalSuper = 100
R95ArmorCrystalSuper = 100
R99ArmorCrystalSuper = 100
R110ArmorCrystalSuper = 100
# ---------------------------------------------------------------------------
# Jewels Chance
# ---------------------------------------------------------------------------
SWeaponJewel = 100
S80WeaponJewel = 100
S84WeaponJewel = 100
RWeaponJewel = 100
R95WeaponJewel = 100
R99WeaponJewel = 100
R110WeaponJewel = 100
SArmorJewel = 100
S80ArmorJewel = 100
S84ArmorJewel = 100
RArmorJewel = 100
R95ArmorJewel = 100
R99ArmorJewel = 100
R110ArmorJewel = 100

View File

@ -432,14 +432,6 @@ MentorPenaltyForMenteeLeave = 2
# ---------------------------------------------------------------------------
# Enchanting
# ---------------------------------------------------------------------------
# This controls the chance an item has to break if it is enchanted.
# This chance is in %, so if you set this to 100%, enchants will always succeed.
# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT
EnchantChanceElementStone = 50
EnchantChanceElementCrystal = 30
EnchantChanceElementJewel = 20
EnchantChanceElementEnergy = 10
# List of non-enchantable items.
# Currently apprentice, travelers weapons and Pailaka items
# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296

View File

@ -269,26 +269,6 @@ public class AdminAdmin implements IAdminCommandHandler
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementStone":
{
Config.ENCHANT_CHANCE_ELEMENT_STONE = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementCrystal":
{
Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementJewel":
{
Config.ENCHANT_CHANCE_ELEMENT_JEWEL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementEnergy":
{
Config.ENCHANT_CHANCE_ELEMENT_ENERGY = Float.valueOf(pValue);
break;
}
}
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
@ -465,11 +445,6 @@ public class AdminAdmin implements IAdminCommandHandler
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate SP</font> = " + Config.RATE_SP + "</td><td><edit var=\"param2\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateSp $param2\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate Drop Spoil</font> = " + Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER + "</td><td><edit var=\"param4\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateDropSpoil $param4\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td width=140></td><td width=40></td><td width=40></td></tr>");
replyMSG.append("<tr><td><font color=\"00AA00\">Enchant:</font></td><td></td><td></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Stone</font> = " + Config.ENCHANT_CHANCE_ELEMENT_STONE + "</td><td><edit var=\"param8\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementStone $param8\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Crystal</font> = " + Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL + "</td><td><edit var=\"param9\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementCrystal $param9\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Jewel</font> = " + Config.ENCHANT_CHANCE_ELEMENT_JEWEL + "</td><td><edit var=\"param10\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementJewel $param10\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Energy</font> = " + Config.ENCHANT_CHANCE_ELEMENT_ENERGY + "</td><td><edit var=\"param11\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementEnergy $param11\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("</table></body></html>");
adminReply.setHtml(replyMSG.toString());

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())
column = 2;
}
else // isArmor = true
{
case S:
column = 3;
}
break;
}
case StoneSuper:
{
return Rnd.get(100) < 30;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 40;
column = 4;
}
case S84:
else // isArmor = true
{
return Rnd.get(100) < 50;
}
default:
{
return Rnd.get(100) < 60;
}
}
}
switch (item.getItem().getCrystalType())
{
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 = 5;
}
break;
}
case CrystalSuper:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
column = 6;
}
else // isArmor = true
{
case S:
column = 7;
}
break;
}
case Jewel:
{
return Rnd.get(100) < 80;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 90;
column = 8;
}
default:
else // isArmor = true
{
return true;
column = 9;
}
break;
}
}
if ((row != -1) && (column != -1))
{
return Rnd.get(100) < CHANCE_TABLE[row][column];
}
return true;
}
}
// 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.
return true;
}
}

View File

@ -0,0 +1,107 @@
##+-------+----------------+----------------+----------------+----------------+----------------+
##| Grade | Stone | Crystal | Stone-Super | Crystal-Super | Jewel |
##+-------+----------------+----------------+----------------+----------------+----------------+
##| | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S | 50% | 60% | 30% | 50% | 100% | 100% | 80% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S80 | 50% | 80% | 40% | 70% | 100% | 100% | 90% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S84 | 50% | 80% | 50% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R | 50% | 100% | 60% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R95 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R99 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
# ---------------------------------------------------------------------------
# Stone Chance
# ---------------------------------------------------------------------------
SWeaponStone = 50
S80WeaponStone = 50
S84WeaponStone = 50
RWeaponStone = 50
R95WeaponStone = 50
R99WeaponStone = 50
SArmorStone = 60
S80ArmorStone = 80
S84ArmorStone = 80
RArmorStone = 100
R95ArmorStone = 100
R99ArmorStone = 100
# ---------------------------------------------------------------------------
# Crystal Chance
# ---------------------------------------------------------------------------
SWeaponCrystal = 30
S80WeaponCrystal = 40
S84WeaponCrystal = 50
RWeaponCrystal = 60
R95WeaponCrystal = 60
R99WeaponCrystal = 60
SArmorCrystal = 50
S80ArmorCrystal = 70
S84ArmorCrystal = 80
RArmorCrystal = 80
R95ArmorCrystal = 100
R99ArmorCrystal = 100
# ---------------------------------------------------------------------------
# Stone-Super Chance
# ---------------------------------------------------------------------------
SWeaponStoneSuper = 100
S80WeaponStoneSuper = 100
S84WeaponStoneSuper = 100
RWeaponStoneSuper = 100
R95WeaponStoneSuper = 100
R99WeaponStoneSuper = 100
SArmorStoneSuper = 100
S80ArmorStoneSuper = 100
S84ArmorStoneSuper = 100
RArmorStoneSuper = 100
R95ArmorStoneSuper = 100
R99ArmorStoneSuper = 100
# ---------------------------------------------------------------------------
# Crystal-Super Chance
# ---------------------------------------------------------------------------
SWeaponCrystalSuper = 80
S80WeaponCrystalSuper = 90
S84WeaponCrystalSuper = 100
RWeaponCrystalSuper = 100
R95WeaponCrystalSuper = 100
R99WeaponCrystalSuper = 100
SArmorCrystalSuper = 100
S80ArmorCrystalSuper = 100
S84ArmorCrystalSuper = 100
RArmorCrystalSuper = 100
R95ArmorCrystalSuper = 100
R99ArmorCrystalSuper = 100
# ---------------------------------------------------------------------------
# Jewels Chance
# ---------------------------------------------------------------------------
SWeaponJewel = 100
S80WeaponJewel = 100
S84WeaponJewel = 100
RWeaponJewel = 100
R95WeaponJewel = 100
R99WeaponJewel = 100
SArmorJewel = 100
S80ArmorJewel = 100
S84ArmorJewel = 100
RArmorJewel = 100
R95ArmorJewel = 100
R99ArmorJewel = 100

View File

@ -346,14 +346,6 @@ MentorPenaltyForMenteeLeave = 2
# ---------------------------------------------------------------------------
# Enchanting
# ---------------------------------------------------------------------------
# This controls the chance an item has to break if it is enchanted.
# This chance is in %, so if you set this to 100%, enchants will always succeed.
# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT
EnchantChanceElementStone = 50
EnchantChanceElementCrystal = 30
EnchantChanceElementJewel = 20
EnchantChanceElementEnergy = 10
# List of non-enchantable items.
# Currently apprentice, travelers weapons and Pailaka items
# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296

View File

@ -269,26 +269,6 @@ public class AdminAdmin implements IAdminCommandHandler
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementStone":
{
Config.ENCHANT_CHANCE_ELEMENT_STONE = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementCrystal":
{
Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementJewel":
{
Config.ENCHANT_CHANCE_ELEMENT_JEWEL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementEnergy":
{
Config.ENCHANT_CHANCE_ELEMENT_ENERGY = Float.valueOf(pValue);
break;
}
}
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
@ -465,11 +445,6 @@ public class AdminAdmin implements IAdminCommandHandler
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate SP</font> = " + Config.RATE_SP + "</td><td><edit var=\"param2\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateSp $param2\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate Drop Spoil</font> = " + Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER + "</td><td><edit var=\"param4\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateDropSpoil $param4\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td width=140></td><td width=40></td><td width=40></td></tr>");
replyMSG.append("<tr><td><font color=\"00AA00\">Enchant:</font></td><td></td><td></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Stone</font> = " + Config.ENCHANT_CHANCE_ELEMENT_STONE + "</td><td><edit var=\"param8\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementStone $param8\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Crystal</font> = " + Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL + "</td><td><edit var=\"param9\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementCrystal $param9\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Jewel</font> = " + Config.ENCHANT_CHANCE_ELEMENT_JEWEL + "</td><td><edit var=\"param10\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementJewel $param10\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Energy</font> = " + Config.ENCHANT_CHANCE_ELEMENT_ENERGY + "</td><td><edit var=\"param11\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementEnergy $param11\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("</table></body></html>");
adminReply.setHtml(replyMSG.toString());

View File

@ -791,10 +791,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;
@ -880,6 +876,77 @@ 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 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 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 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 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 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 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 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 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 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;
// --------------------------------------------------
// Custom Settings
// --------------------------------------------------
@ -1362,8 +1429,9 @@ 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);
PREMIUM_ONLY_ATTENDANCE_REWARDS = Attandance.getBoolean("PremiumOnlyAttendanceRewards", false);
ATTENDANCE_REWARDS_SHARE_ACCOUNT = Attandance.getBoolean("AttendanceRewardsShareAccount", false);
@ -1511,10 +1579,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;
@ -84,6 +85,18 @@ 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},
};
/* @formatter:on */
public enum ElementalItemType
{
Stone(3),
@ -177,128 +190,111 @@ public final class Elementals
return -1;
}
public static boolean isElementableWithStone(ItemInstance targetItem, int stoneId)
{
return targetItem.isElementable();
}
/* @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% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
/* @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;
}
}
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())
column = 2;
}
else // isArmor = true
{
case S:
column = 3;
}
break;
}
case StoneSuper:
{
return Rnd.get(100) < 30;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 40;
column = 4;
}
case S84:
else // isArmor = true
{
return Rnd.get(100) < 50;
}
default:
{
return Rnd.get(100) < 60;
}
}
}
switch (item.getItem().getCrystalType())
{
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 = 5;
}
break;
}
case CrystalSuper:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
column = 6;
}
else // isArmor = true
{
case S:
column = 7;
}
break;
}
case Jewel:
{
return Rnd.get(100) < 80;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 90;
column = 8;
}
default:
else // isArmor = true
{
return true;
column = 9;
}
break;
}
}
if ((row != -1) && (column != -1))
{
return Rnd.get(100) < CHANCE_TABLE[row][column];
}
return true;
}
}
// 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.
return true;
}
}

View File

@ -103,7 +103,7 @@ public class RequestExEnchantItemAttribute implements IClientIncomingPacket
return;
}
if (!Elementals.isElementableWithStone(item, stone.getItem().getId()))
if (!item.isElementable())
{
client.sendPacket(SystemMessageId.ELEMENTAL_POWER_ENHANCER_USAGE_REQUIREMENT_IS_NOT_SUFFICIENT);
player.removeRequest(request.getClass());

View File

@ -51,7 +51,7 @@ public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
// Register only items that can be put an attribute stone/crystal
for (ItemInstance item : player.getInventory().getItems())
{
if (Elementals.isElementableWithStone(item, stone.getId()))
if (item.isElementable())
{
_items.add(item.getObjectId());
}

View File

@ -0,0 +1,107 @@
##+-------+----------------+----------------+----------------+----------------+----------------+
##| Grade | Stone | Crystal | Stone-Super | Crystal-Super | Jewel |
##+-------+----------------+----------------+----------------+----------------+----------------+
##| | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S | 50% | 60% | 30% | 50% | 100% | 100% | 80% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S80 | 50% | 80% | 40% | 70% | 100% | 100% | 90% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S84 | 50% | 80% | 50% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R | 50% | 100% | 60% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R95 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R99 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
# ---------------------------------------------------------------------------
# Stone Chance
# ---------------------------------------------------------------------------
SWeaponStone = 50
S80WeaponStone = 50
S84WeaponStone = 50
RWeaponStone = 50
R95WeaponStone = 50
R99WeaponStone = 50
SArmorStone = 60
S80ArmorStone = 80
S84ArmorStone = 80
RArmorStone = 100
R95ArmorStone = 100
R99ArmorStone = 100
# ---------------------------------------------------------------------------
# Crystal Chance
# ---------------------------------------------------------------------------
SWeaponCrystal = 30
S80WeaponCrystal = 40
S84WeaponCrystal = 50
RWeaponCrystal = 60
R95WeaponCrystal = 60
R99WeaponCrystal = 60
SArmorCrystal = 50
S80ArmorCrystal = 70
S84ArmorCrystal = 80
RArmorCrystal = 80
R95ArmorCrystal = 100
R99ArmorCrystal = 100
# ---------------------------------------------------------------------------
# Stone-Super Chance
# ---------------------------------------------------------------------------
SWeaponStoneSuper = 100
S80WeaponStoneSuper = 100
S84WeaponStoneSuper = 100
RWeaponStoneSuper = 100
R95WeaponStoneSuper = 100
R99WeaponStoneSuper = 100
SArmorStoneSuper = 100
S80ArmorStoneSuper = 100
S84ArmorStoneSuper = 100
RArmorStoneSuper = 100
R95ArmorStoneSuper = 100
R99ArmorStoneSuper = 100
# ---------------------------------------------------------------------------
# Crystal-Super Chance
# ---------------------------------------------------------------------------
SWeaponCrystalSuper = 80
S80WeaponCrystalSuper = 90
S84WeaponCrystalSuper = 100
RWeaponCrystalSuper = 100
R95WeaponCrystalSuper = 100
R99WeaponCrystalSuper = 100
SArmorCrystalSuper = 100
S80ArmorCrystalSuper = 100
S84ArmorCrystalSuper = 100
RArmorCrystalSuper = 100
R95ArmorCrystalSuper = 100
R99ArmorCrystalSuper = 100
# ---------------------------------------------------------------------------
# Jewels Chance
# ---------------------------------------------------------------------------
SWeaponJewel = 100
S80WeaponJewel = 100
S84WeaponJewel = 100
RWeaponJewel = 100
R95WeaponJewel = 100
R99WeaponJewel = 100
SArmorJewel = 100
S80ArmorJewel = 100
S84ArmorJewel = 100
RArmorJewel = 100
R95ArmorJewel = 100
R99ArmorJewel = 100

View File

@ -346,14 +346,6 @@ MentorPenaltyForMenteeLeave = 2
# ---------------------------------------------------------------------------
# Enchanting
# ---------------------------------------------------------------------------
# This controls the chance an item has to break if it is enchanted.
# This chance is in %, so if you set this to 100%, enchants will always succeed.
# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT
EnchantChanceElementStone = 50
EnchantChanceElementCrystal = 30
EnchantChanceElementJewel = 20
EnchantChanceElementEnergy = 10
# List of non-enchantable items.
# Currently apprentice, travelers weapons and Pailaka items
# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296

View File

@ -269,26 +269,6 @@ public class AdminAdmin implements IAdminCommandHandler
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementStone":
{
Config.ENCHANT_CHANCE_ELEMENT_STONE = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementCrystal":
{
Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementJewel":
{
Config.ENCHANT_CHANCE_ELEMENT_JEWEL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementEnergy":
{
Config.ENCHANT_CHANCE_ELEMENT_ENERGY = Float.valueOf(pValue);
break;
}
}
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
@ -465,11 +445,6 @@ public class AdminAdmin implements IAdminCommandHandler
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate SP</font> = " + Config.RATE_SP + "</td><td><edit var=\"param2\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateSp $param2\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate Drop Spoil</font> = " + Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER + "</td><td><edit var=\"param4\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateDropSpoil $param4\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td width=140></td><td width=40></td><td width=40></td></tr>");
replyMSG.append("<tr><td><font color=\"00AA00\">Enchant:</font></td><td></td><td></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Stone</font> = " + Config.ENCHANT_CHANCE_ELEMENT_STONE + "</td><td><edit var=\"param8\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementStone $param8\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Crystal</font> = " + Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL + "</td><td><edit var=\"param9\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementCrystal $param9\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Jewel</font> = " + Config.ENCHANT_CHANCE_ELEMENT_JEWEL + "</td><td><edit var=\"param10\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementJewel $param10\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Energy</font> = " + Config.ENCHANT_CHANCE_ELEMENT_ENERGY + "</td><td><edit var=\"param11\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementEnergy $param11\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("</table></body></html>");
adminReply.setHtml(replyMSG.toString());

View File

@ -791,10 +791,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;
@ -884,6 +880,77 @@ 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 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 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 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 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 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 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 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 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 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;
// --------------------------------------------------
// Custom Settings
// --------------------------------------------------
@ -1366,8 +1433,9 @@ 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);
PREMIUM_ONLY_ATTENDANCE_REWARDS = Attandance.getBoolean("PremiumOnlyAttendanceRewards", false);
ATTENDANCE_REWARDS_SHARE_ACCOUNT = Attandance.getBoolean("AttendanceRewardsShareAccount", false);
@ -1515,10 +1583,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;
@ -84,6 +85,18 @@ 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},
};
/* @formatter:on */
public enum ElementalItemType
{
Stone(3),
@ -177,128 +190,111 @@ public final class Elementals
return -1;
}
public static boolean isElementableWithStone(ItemInstance targetItem, int stoneId)
{
return targetItem.isElementable();
}
/* @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% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
/* @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;
}
}
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())
column = 2;
}
else // isArmor = true
{
case S:
column = 3;
}
break;
}
case StoneSuper:
{
return Rnd.get(100) < 30;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 40;
column = 4;
}
case S84:
else // isArmor = true
{
return Rnd.get(100) < 50;
}
default:
{
return Rnd.get(100) < 60;
}
}
}
switch (item.getItem().getCrystalType())
{
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 = 5;
}
break;
}
case CrystalSuper:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
column = 6;
}
else // isArmor = true
{
case S:
column = 7;
}
break;
}
case Jewel:
{
return Rnd.get(100) < 80;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 90;
column = 8;
}
default:
else // isArmor = true
{
return true;
column = 9;
}
break;
}
}
if ((row != -1) && (column != -1))
{
return Rnd.get(100) < CHANCE_TABLE[row][column];
}
return true;
}
}
// 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.
return true;
}
}

View File

@ -103,7 +103,7 @@ public class RequestExEnchantItemAttribute implements IClientIncomingPacket
return;
}
if (!Elementals.isElementableWithStone(item, stone.getItem().getId()))
if (!item.isElementable())
{
client.sendPacket(SystemMessageId.ELEMENTAL_POWER_ENHANCER_USAGE_REQUIREMENT_IS_NOT_SUFFICIENT);
player.removeRequest(request.getClass());

View File

@ -51,7 +51,7 @@ public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
// Register only items that can be put an attribute stone/crystal
for (ItemInstance item : player.getInventory().getItems())
{
if (Elementals.isElementableWithStone(item, stone.getId()))
if (item.isElementable())
{
_items.add(item.getObjectId());
}

View File

@ -0,0 +1,107 @@
##+-------+----------------+----------------+----------------+----------------+----------------+
##| Grade | Stone | Crystal | Stone-Super | Crystal-Super | Jewel |
##+-------+----------------+----------------+----------------+----------------+----------------+
##| | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S | 50% | 60% | 30% | 50% | 100% | 100% | 80% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S80 | 50% | 80% | 40% | 70% | 100% | 100% | 90% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S84 | 50% | 80% | 50% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R | 50% | 100% | 60% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R95 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R99 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
# ---------------------------------------------------------------------------
# Stone Chance
# ---------------------------------------------------------------------------
SWeaponStone = 50
S80WeaponStone = 50
S84WeaponStone = 50
RWeaponStone = 50
R95WeaponStone = 50
R99WeaponStone = 50
SArmorStone = 60
S80ArmorStone = 80
S84ArmorStone = 80
RArmorStone = 100
R95ArmorStone = 100
R99ArmorStone = 100
# ---------------------------------------------------------------------------
# Crystal Chance
# ---------------------------------------------------------------------------
SWeaponCrystal = 30
S80WeaponCrystal = 40
S84WeaponCrystal = 50
RWeaponCrystal = 60
R95WeaponCrystal = 60
R99WeaponCrystal = 60
SArmorCrystal = 50
S80ArmorCrystal = 70
S84ArmorCrystal = 80
RArmorCrystal = 80
R95ArmorCrystal = 100
R99ArmorCrystal = 100
# ---------------------------------------------------------------------------
# Stone-Super Chance
# ---------------------------------------------------------------------------
SWeaponStoneSuper = 100
S80WeaponStoneSuper = 100
S84WeaponStoneSuper = 100
RWeaponStoneSuper = 100
R95WeaponStoneSuper = 100
R99WeaponStoneSuper = 100
SArmorStoneSuper = 100
S80ArmorStoneSuper = 100
S84ArmorStoneSuper = 100
RArmorStoneSuper = 100
R95ArmorStoneSuper = 100
R99ArmorStoneSuper = 100
# ---------------------------------------------------------------------------
# Crystal-Super Chance
# ---------------------------------------------------------------------------
SWeaponCrystalSuper = 80
S80WeaponCrystalSuper = 90
S84WeaponCrystalSuper = 100
RWeaponCrystalSuper = 100
R95WeaponCrystalSuper = 100
R99WeaponCrystalSuper = 100
SArmorCrystalSuper = 100
S80ArmorCrystalSuper = 100
S84ArmorCrystalSuper = 100
RArmorCrystalSuper = 100
R95ArmorCrystalSuper = 100
R99ArmorCrystalSuper = 100
# ---------------------------------------------------------------------------
# Jewels Chance
# ---------------------------------------------------------------------------
SWeaponJewel = 100
S80WeaponJewel = 100
S84WeaponJewel = 100
RWeaponJewel = 100
R95WeaponJewel = 100
R99WeaponJewel = 100
SArmorJewel = 100
S80ArmorJewel = 100
S84ArmorJewel = 100
RArmorJewel = 100
R95ArmorJewel = 100
R99ArmorJewel = 100

View File

@ -346,14 +346,6 @@ MentorPenaltyForMenteeLeave = 2
# ---------------------------------------------------------------------------
# Enchanting
# ---------------------------------------------------------------------------
# This controls the chance an item has to break if it is enchanted.
# This chance is in %, so if you set this to 100%, enchants will always succeed.
# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT
EnchantChanceElementStone = 50
EnchantChanceElementCrystal = 30
EnchantChanceElementJewel = 20
EnchantChanceElementEnergy = 10
# List of non-enchantable items.
# Currently apprentice, travelers weapons and Pailaka items
# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296

View File

@ -269,26 +269,6 @@ public class AdminAdmin implements IAdminCommandHandler
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementStone":
{
Config.ENCHANT_CHANCE_ELEMENT_STONE = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementCrystal":
{
Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementJewel":
{
Config.ENCHANT_CHANCE_ELEMENT_JEWEL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementEnergy":
{
Config.ENCHANT_CHANCE_ELEMENT_ENERGY = Float.valueOf(pValue);
break;
}
}
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
@ -465,11 +445,6 @@ public class AdminAdmin implements IAdminCommandHandler
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate SP</font> = " + Config.RATE_SP + "</td><td><edit var=\"param2\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateSp $param2\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate Drop Spoil</font> = " + Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER + "</td><td><edit var=\"param4\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateDropSpoil $param4\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td width=140></td><td width=40></td><td width=40></td></tr>");
replyMSG.append("<tr><td><font color=\"00AA00\">Enchant:</font></td><td></td><td></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Stone</font> = " + Config.ENCHANT_CHANCE_ELEMENT_STONE + "</td><td><edit var=\"param8\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementStone $param8\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Crystal</font> = " + Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL + "</td><td><edit var=\"param9\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementCrystal $param9\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Jewel</font> = " + Config.ENCHANT_CHANCE_ELEMENT_JEWEL + "</td><td><edit var=\"param10\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementJewel $param10\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Energy</font> = " + Config.ENCHANT_CHANCE_ELEMENT_ENERGY + "</td><td><edit var=\"param11\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementEnergy $param11\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("</table></body></html>");
adminReply.setHtml(replyMSG.toString());

View File

@ -791,10 +791,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;
@ -884,6 +880,77 @@ 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 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 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 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 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 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 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 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 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 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;
// --------------------------------------------------
// Custom Settings
// --------------------------------------------------
@ -1366,8 +1433,9 @@ 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);
PREMIUM_ONLY_ATTENDANCE_REWARDS = Attandance.getBoolean("PremiumOnlyAttendanceRewards", false);
ATTENDANCE_REWARDS_SHARE_ACCOUNT = Attandance.getBoolean("AttendanceRewardsShareAccount", false);
@ -1515,10 +1583,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;
@ -84,6 +85,18 @@ 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},
};
/* @formatter:on */
public enum ElementalItemType
{
Stone(3),
@ -177,128 +190,111 @@ public final class Elementals
return -1;
}
public static boolean isElementableWithStone(ItemInstance targetItem, int stoneId)
{
return targetItem.isElementable();
}
/* @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% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
/* @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;
}
}
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())
column = 2;
}
else // isArmor = true
{
case S:
column = 3;
}
break;
}
case StoneSuper:
{
return Rnd.get(100) < 30;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 40;
column = 4;
}
case S84:
else // isArmor = true
{
return Rnd.get(100) < 50;
}
default:
{
return Rnd.get(100) < 60;
}
}
}
switch (item.getItem().getCrystalType())
{
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 = 5;
}
break;
}
case CrystalSuper:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
column = 6;
}
else // isArmor = true
{
case S:
column = 7;
}
break;
}
case Jewel:
{
return Rnd.get(100) < 80;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 90;
column = 8;
}
default:
else // isArmor = true
{
return true;
column = 9;
}
break;
}
}
if ((row != -1) && (column != -1))
{
return Rnd.get(100) < CHANCE_TABLE[row][column];
}
return true;
}
}
// 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.
return true;
}
}

View File

@ -103,7 +103,7 @@ public class RequestExEnchantItemAttribute implements IClientIncomingPacket
return;
}
if (!Elementals.isElementableWithStone(item, stone.getItem().getId()))
if (!item.isElementable())
{
client.sendPacket(SystemMessageId.ELEMENTAL_POWER_ENHANCER_USAGE_REQUIREMENT_IS_NOT_SUFFICIENT);
player.removeRequest(request.getClass());

View File

@ -51,7 +51,7 @@ public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
// Register only items that can be put an attribute stone/crystal
for (ItemInstance item : player.getInventory().getItems())
{
if (Elementals.isElementableWithStone(item, stone.getId()))
if (item.isElementable())
{
_items.add(item.getObjectId());
}

View File

@ -0,0 +1,107 @@
##+-------+----------------+----------------+----------------+----------------+----------------+
##| Grade | Stone | Crystal | Stone-Super | Crystal-Super | Jewel |
##+-------+----------------+----------------+----------------+----------------+----------------+
##| | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S | 50% | 60% | 30% | 50% | 100% | 100% | 80% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S80 | 50% | 80% | 40% | 70% | 100% | 100% | 90% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S84 | 50% | 80% | 50% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R | 50% | 100% | 60% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R95 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R99 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
# ---------------------------------------------------------------------------
# Stone Chance
# ---------------------------------------------------------------------------
SWeaponStone = 50
S80WeaponStone = 50
S84WeaponStone = 50
RWeaponStone = 50
R95WeaponStone = 50
R99WeaponStone = 50
SArmorStone = 60
S80ArmorStone = 80
S84ArmorStone = 80
RArmorStone = 100
R95ArmorStone = 100
R99ArmorStone = 100
# ---------------------------------------------------------------------------
# Crystal Chance
# ---------------------------------------------------------------------------
SWeaponCrystal = 30
S80WeaponCrystal = 40
S84WeaponCrystal = 50
RWeaponCrystal = 60
R95WeaponCrystal = 60
R99WeaponCrystal = 60
SArmorCrystal = 50
S80ArmorCrystal = 70
S84ArmorCrystal = 80
RArmorCrystal = 80
R95ArmorCrystal = 100
R99ArmorCrystal = 100
# ---------------------------------------------------------------------------
# Stone-Super Chance
# ---------------------------------------------------------------------------
SWeaponStoneSuper = 100
S80WeaponStoneSuper = 100
S84WeaponStoneSuper = 100
RWeaponStoneSuper = 100
R95WeaponStoneSuper = 100
R99WeaponStoneSuper = 100
SArmorStoneSuper = 100
S80ArmorStoneSuper = 100
S84ArmorStoneSuper = 100
RArmorStoneSuper = 100
R95ArmorStoneSuper = 100
R99ArmorStoneSuper = 100
# ---------------------------------------------------------------------------
# Crystal-Super Chance
# ---------------------------------------------------------------------------
SWeaponCrystalSuper = 80
S80WeaponCrystalSuper = 90
S84WeaponCrystalSuper = 100
RWeaponCrystalSuper = 100
R95WeaponCrystalSuper = 100
R99WeaponCrystalSuper = 100
SArmorCrystalSuper = 100
S80ArmorCrystalSuper = 100
S84ArmorCrystalSuper = 100
RArmorCrystalSuper = 100
R95ArmorCrystalSuper = 100
R99ArmorCrystalSuper = 100
# ---------------------------------------------------------------------------
# Jewels Chance
# ---------------------------------------------------------------------------
SWeaponJewel = 100
S80WeaponJewel = 100
S84WeaponJewel = 100
RWeaponJewel = 100
R95WeaponJewel = 100
R99WeaponJewel = 100
SArmorJewel = 100
S80ArmorJewel = 100
S84ArmorJewel = 100
RArmorJewel = 100
R95ArmorJewel = 100
R99ArmorJewel = 100

View File

@ -346,14 +346,6 @@ MentorPenaltyForMenteeLeave = 2
# ---------------------------------------------------------------------------
# Enchanting
# ---------------------------------------------------------------------------
# This controls the chance an item has to break if it is enchanted.
# This chance is in %, so if you set this to 100%, enchants will always succeed.
# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT
EnchantChanceElementStone = 50
EnchantChanceElementCrystal = 30
EnchantChanceElementJewel = 20
EnchantChanceElementEnergy = 10
# List of non-enchantable items.
# Currently apprentice, travelers weapons and Pailaka items
# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296

View File

@ -269,26 +269,6 @@ public class AdminAdmin implements IAdminCommandHandler
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementStone":
{
Config.ENCHANT_CHANCE_ELEMENT_STONE = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementCrystal":
{
Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementJewel":
{
Config.ENCHANT_CHANCE_ELEMENT_JEWEL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementEnergy":
{
Config.ENCHANT_CHANCE_ELEMENT_ENERGY = Float.valueOf(pValue);
break;
}
}
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
@ -465,11 +445,6 @@ public class AdminAdmin implements IAdminCommandHandler
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate SP</font> = " + Config.RATE_SP + "</td><td><edit var=\"param2\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateSp $param2\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate Drop Spoil</font> = " + Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER + "</td><td><edit var=\"param4\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateDropSpoil $param4\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td width=140></td><td width=40></td><td width=40></td></tr>");
replyMSG.append("<tr><td><font color=\"00AA00\">Enchant:</font></td><td></td><td></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Stone</font> = " + Config.ENCHANT_CHANCE_ELEMENT_STONE + "</td><td><edit var=\"param8\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementStone $param8\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Crystal</font> = " + Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL + "</td><td><edit var=\"param9\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementCrystal $param9\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Jewel</font> = " + Config.ENCHANT_CHANCE_ELEMENT_JEWEL + "</td><td><edit var=\"param10\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementJewel $param10\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Energy</font> = " + Config.ENCHANT_CHANCE_ELEMENT_ENERGY + "</td><td><edit var=\"param11\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementEnergy $param11\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("</table></body></html>");
adminReply.setHtml(replyMSG.toString());

View File

@ -791,10 +791,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;
@ -884,6 +880,77 @@ 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 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 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 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 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 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 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 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 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 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;
// --------------------------------------------------
// Custom Settings
// --------------------------------------------------
@ -1366,8 +1433,9 @@ 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);
PREMIUM_ONLY_ATTENDANCE_REWARDS = Attandance.getBoolean("PremiumOnlyAttendanceRewards", false);
ATTENDANCE_REWARDS_SHARE_ACCOUNT = Attandance.getBoolean("AttendanceRewardsShareAccount", false);
@ -1515,10 +1583,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;
@ -84,6 +85,18 @@ 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},
};
/* @formatter:on */
public enum ElementalItemType
{
Stone(3),
@ -177,128 +190,111 @@ public final class Elementals
return -1;
}
public static boolean isElementableWithStone(ItemInstance targetItem, int stoneId)
{
return targetItem.isElementable();
}
/* @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% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
/* @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;
}
}
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())
column = 2;
}
else // isArmor = true
{
case S:
column = 3;
}
break;
}
case StoneSuper:
{
return Rnd.get(100) < 30;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 40;
column = 4;
}
case S84:
else // isArmor = true
{
return Rnd.get(100) < 50;
}
default:
{
return Rnd.get(100) < 60;
}
}
}
switch (item.getItem().getCrystalType())
{
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 = 5;
}
break;
}
case CrystalSuper:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
column = 6;
}
else // isArmor = true
{
case S:
column = 7;
}
break;
}
case Jewel:
{
return Rnd.get(100) < 80;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 90;
column = 8;
}
default:
else // isArmor = true
{
return true;
column = 9;
}
break;
}
}
if ((row != -1) && (column != -1))
{
return Rnd.get(100) < CHANCE_TABLE[row][column];
}
return true;
}
}
// 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.
return true;
}
}

View File

@ -103,7 +103,7 @@ public class RequestExEnchantItemAttribute implements IClientIncomingPacket
return;
}
if (!Elementals.isElementableWithStone(item, stone.getItem().getId()))
if (!item.isElementable())
{
client.sendPacket(SystemMessageId.ELEMENTAL_POWER_ENHANCER_USAGE_REQUIREMENT_IS_NOT_SUFFICIENT);
player.removeRequest(request.getClass());

View File

@ -51,7 +51,7 @@ public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
// Register only items that can be put an attribute stone/crystal
for (ItemInstance item : player.getInventory().getItems())
{
if (Elementals.isElementableWithStone(item, stone.getId()))
if (item.isElementable())
{
_items.add(item.getObjectId());
}

View File

@ -0,0 +1,107 @@
##+-------+----------------+----------------+----------------+----------------+----------------+
##| Grade | Stone | Crystal | Stone-Super | Crystal-Super | Jewel |
##+-------+----------------+----------------+----------------+----------------+----------------+
##| | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor | Weapon | Armor |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S | 50% | 60% | 30% | 50% | 100% | 100% | 80% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S80 | 50% | 80% | 40% | 70% | 100% | 100% | 90% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| S84 | 50% | 80% | 50% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R | 50% | 100% | 60% | 80% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R95 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
##| R99 | 50% | 100% | 60% | 100% | 100% | 100% | 100% | 100% | 100% | 100% |
##+-------+--------+-------+--------+-------+--------+-------+--------+-------+--------+-------+
# ---------------------------------------------------------------------------
# Stone Chance
# ---------------------------------------------------------------------------
SWeaponStone = 50
S80WeaponStone = 50
S84WeaponStone = 50
RWeaponStone = 50
R95WeaponStone = 50
R99WeaponStone = 50
SArmorStone = 60
S80ArmorStone = 80
S84ArmorStone = 80
RArmorStone = 100
R95ArmorStone = 100
R99ArmorStone = 100
# ---------------------------------------------------------------------------
# Crystal Chance
# ---------------------------------------------------------------------------
SWeaponCrystal = 30
S80WeaponCrystal = 40
S84WeaponCrystal = 50
RWeaponCrystal = 60
R95WeaponCrystal = 60
R99WeaponCrystal = 60
SArmorCrystal = 50
S80ArmorCrystal = 70
S84ArmorCrystal = 80
RArmorCrystal = 80
R95ArmorCrystal = 100
R99ArmorCrystal = 100
# ---------------------------------------------------------------------------
# Stone-Super Chance
# ---------------------------------------------------------------------------
SWeaponStoneSuper = 100
S80WeaponStoneSuper = 100
S84WeaponStoneSuper = 100
RWeaponStoneSuper = 100
R95WeaponStoneSuper = 100
R99WeaponStoneSuper = 100
SArmorStoneSuper = 100
S80ArmorStoneSuper = 100
S84ArmorStoneSuper = 100
RArmorStoneSuper = 100
R95ArmorStoneSuper = 100
R99ArmorStoneSuper = 100
# ---------------------------------------------------------------------------
# Crystal-Super Chance
# ---------------------------------------------------------------------------
SWeaponCrystalSuper = 80
S80WeaponCrystalSuper = 90
S84WeaponCrystalSuper = 100
RWeaponCrystalSuper = 100
R95WeaponCrystalSuper = 100
R99WeaponCrystalSuper = 100
SArmorCrystalSuper = 100
S80ArmorCrystalSuper = 100
S84ArmorCrystalSuper = 100
RArmorCrystalSuper = 100
R95ArmorCrystalSuper = 100
R99ArmorCrystalSuper = 100
# ---------------------------------------------------------------------------
# Jewels Chance
# ---------------------------------------------------------------------------
SWeaponJewel = 100
S80WeaponJewel = 100
S84WeaponJewel = 100
RWeaponJewel = 100
R95WeaponJewel = 100
R99WeaponJewel = 100
SArmorJewel = 100
S80ArmorJewel = 100
S84ArmorJewel = 100
RArmorJewel = 100
R95ArmorJewel = 100
R99ArmorJewel = 100

View File

@ -346,14 +346,6 @@ MentorPenaltyForMenteeLeave = 2
# ---------------------------------------------------------------------------
# Enchanting
# ---------------------------------------------------------------------------
# This controls the chance an item has to break if it is enchanted.
# This chance is in %, so if you set this to 100%, enchants will always succeed.
# DEFAULT NEEDS TO BE VERIFIED, MUST BE CHANGED HERE AND IN CONFIG.JAVA IF NOT CORRECT
EnchantChanceElementStone = 50
EnchantChanceElementCrystal = 30
EnchantChanceElementJewel = 20
EnchantChanceElementEnergy = 10
# List of non-enchantable items.
# Currently apprentice, travelers weapons and Pailaka items
# Default: 7816,7817,7818,7819,7820,7821,7822,7823,7824,7825,7826,7827,7828,7829,7830,7831,13293,13294,13296

View File

@ -269,26 +269,6 @@ public class AdminAdmin implements IAdminCommandHandler
Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementStone":
{
Config.ENCHANT_CHANCE_ELEMENT_STONE = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementCrystal":
{
Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementJewel":
{
Config.ENCHANT_CHANCE_ELEMENT_JEWEL = Float.valueOf(pValue);
break;
}
case "EnchantChanceElementEnergy":
{
Config.ENCHANT_CHANCE_ELEMENT_ENERGY = Float.valueOf(pValue);
break;
}
}
BuilderUtil.sendSysMessage(activeChar, "Config parameter " + pName + " set to " + pValue);
}
@ -465,11 +445,6 @@ public class AdminAdmin implements IAdminCommandHandler
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate SP</font> = " + Config.RATE_SP + "</td><td><edit var=\"param2\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateSp $param2\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Rate Drop Spoil</font> = " + Config.RATE_SPOIL_DROP_CHANCE_MULTIPLIER + "</td><td><edit var=\"param4\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig RateDropSpoil $param4\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td width=140></td><td width=40></td><td width=40></td></tr>");
replyMSG.append("<tr><td><font color=\"00AA00\">Enchant:</font></td><td></td><td></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Stone</font> = " + Config.ENCHANT_CHANCE_ELEMENT_STONE + "</td><td><edit var=\"param8\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementStone $param8\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Crystal</font> = " + Config.ENCHANT_CHANCE_ELEMENT_CRYSTAL + "</td><td><edit var=\"param9\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementCrystal $param9\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Jewel</font> = " + Config.ENCHANT_CHANCE_ELEMENT_JEWEL + "</td><td><edit var=\"param10\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementJewel $param10\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("<tr><td><font color=\"LEVEL\">Enchant Element Energy</font> = " + Config.ENCHANT_CHANCE_ELEMENT_ENERGY + "</td><td><edit var=\"param11\" width=40 height=15></td><td><button value=\"Set\" action=\"bypass -h admin_setconfig EnchantChanceElementEnergy $param11\" width=40 height=25 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr>");
replyMSG.append("</table></body></html>");
adminReply.setHtml(replyMSG.toString());

View File

@ -791,10 +791,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;
@ -884,6 +880,77 @@ 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 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 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 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 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 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 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 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 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 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;
// --------------------------------------------------
// Custom Settings
// --------------------------------------------------
@ -1366,8 +1433,9 @@ 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);
PREMIUM_ONLY_ATTENDANCE_REWARDS = Attandance.getBoolean("PremiumOnlyAttendanceRewards", false);
ATTENDANCE_REWARDS_SHARE_ACCOUNT = Attandance.getBoolean("AttendanceRewardsShareAccount", false);
@ -1515,10 +1583,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;
@ -84,6 +85,18 @@ 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},
};
/* @formatter:on */
public enum ElementalItemType
{
Stone(3),
@ -177,128 +190,111 @@ public final class Elementals
return -1;
}
public static boolean isElementableWithStone(ItemInstance targetItem, int stoneId)
{
return targetItem.isElementable();
}
/* @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% |
// +-------+--------+-------+--------+-------+--------+-------+--------+-------+
/* @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;
}
}
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())
column = 2;
}
else // isArmor = true
{
case S:
column = 3;
}
break;
}
case StoneSuper:
{
return Rnd.get(100) < 30;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 40;
column = 4;
}
case S84:
else // isArmor = true
{
return Rnd.get(100) < 50;
}
default:
{
return Rnd.get(100) < 60;
}
}
}
switch (item.getItem().getCrystalType())
{
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 = 5;
}
break;
}
case CrystalSuper:
{
if (item.isWeapon())
{
switch (item.getItem().getCrystalType())
column = 6;
}
else // isArmor = true
{
case S:
column = 7;
}
break;
}
case Jewel:
{
return Rnd.get(100) < 80;
}
case S80:
if (item.isWeapon())
{
return Rnd.get(100) < 90;
column = 8;
}
default:
else // isArmor = true
{
return true;
column = 9;
}
break;
}
}
if ((row != -1) && (column != -1))
{
return Rnd.get(100) < CHANCE_TABLE[row][column];
}
return true;
}
}
// 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.
return true;
}
}

View File

@ -103,7 +103,7 @@ public class RequestExEnchantItemAttribute implements IClientIncomingPacket
return;
}
if (!Elementals.isElementableWithStone(item, stone.getItem().getId()))
if (!item.isElementable())
{
client.sendPacket(SystemMessageId.ELEMENTAL_POWER_ENHANCER_USAGE_REQUIREMENT_IS_NOT_SUFFICIENT);
player.removeRequest(request.getClass());

View File

@ -51,7 +51,7 @@ public class ExChooseInventoryAttributeItem implements IClientOutgoingPacket
// Register only items that can be put an attribute stone/crystal
for (ItemInstance item : player.getInventory().getItems())
{
if (Elementals.isElementableWithStone(item, stone.getId()))
if (item.isElementable())
{
_items.add(item.getObjectId());
}