Jump to content

Question

Posted

Hello guys, i'm looking for a code for Enchant Configs for aCis.

I searched and i couldn't find something working.

 

I'm not asking for crazy things like to set rate for every enchant level or not brake or w/e.

I just want config files for enchants.

 

Here is an example of what i want:

WeaponNormalEnchantRate = 50
ArmorNormalEnchantRate = 50
JewelsNormalEnchantRate = 50
WeaponBlessedEnchantRate = 50
ArmorBlessedEnchantRate = 50
JewelsNormalEnchantRate = 50
WeaponCrystalEnchantRate = 50
ArmorCrystalEnchantRate = 50
JewelsCrystalEnchantRate = 50

As a reward i can create a banner,logo or cover for him and give him a rep for his help.

 

Thanks in advance.

10 answers to this question

Recommended Posts

  • 0
Posted

Lock it.

I "fixed" an old code and it's working.

 

If someone need the code here you are

Go to: gameserver/network/clientpacket/AbstractEnchantPacket.java  find this

if (enchantItem.isArmor())
                chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR, (enchantItem.getEnchantLevel() - 2));
            // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
            else if (enchantItem.isWeapon())
            {
                if (((L2Weapon) enchantItem.getItem()).isMagical())
                    chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_MAGIC;
                else
                    chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC;
            }

And replace it with this

if (isBlessed())
            {
                if (enchantItem.isArmor())
                    chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR_BLESSED, (enchantItem.getEnchantLevel() - 2));
                // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
                else if (enchantItem.isWeapon())
                {
                    if (((Weapon) enchantItem.getItem()).isMagical())
                        chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS_BLESSED : Config.ENCHANT_CHANCE_WEAPON_MAGIC_BLESSED;
                    else
                        chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS_BLESSED : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_BLESSED;
                }
            }
            else if (isCrystal())
            {
                if (enchantItem.isArmor())
                    chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR_CRYSTAL, (enchantItem.getEnchantLevel() - 2));
                // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
                else if (enchantItem.isWeapon())
                {
                    if (((Weapon) enchantItem.getItem()).isMagical())
                        chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS_CRYSTAL : Config.ENCHANT_CHANCE_WEAPON_MAGIC_CRYSTAL;
                    else
                        chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS_CRYSTAL : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_CRYSTAL;
                }
            }
            else
            {
                if (enchantItem.isArmor())
                    chance = Math.pow(Config.ENCHANT_CHANCE_ARMOR, (enchantItem.getEnchantLevel() - 2));
                // Weapon formula is 70% for fighter weapon, 40% for mage weapon. Special rates after +14.
                else if (enchantItem.isWeapon())
                {
                    if (((Weapon) enchantItem.getItem()).isMagical())
                        chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_MAGIC;
                    else
                        chance = (enchantItem.getEnchantLevel() > 14) ? Config.ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS : Config.ENCHANT_CHANCE_WEAPON_NONMAGIC;
                }
            }

The Configs @ net.sf.l2j.Config.java

public static double ENCHANT_CHANCE_WEAPON_MAGIC;
public static double ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS;
public static double ENCHANT_CHANCE_WEAPON_NONMAGIC;
public static double ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS;
+public static double ENCHANT_CHANCE_WEAPON_MAGIC_BLESSED;
+public static double ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS_BLESSED;
+public static double ENCHANT_CHANCE_WEAPON_NONMAGIC_BLESSED;
+public static double ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS_BLESSED;
+public static double ENCHANT_CHANCE_WEAPON_NONMAGIC_CRYSTAL;
+public static double ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS_CRYSTAL;
+public static double ENCHANT_CHANCE_WEAPON_MAGIC_CRYSTAL;
+public static double ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS_CRYSTAL;
public static double ENCHANT_CHANCE_ARMOR;
+public static double ENCHANT_CHANCE_ARMOR_BLESSED;
+public static double ENCHANT_CHANCE_ARMOR_CRYSTAL;
ENCHANT_CHANCE_WEAPON_MAGIC = players.getProperty("EnchantChanceMagicWeapon", 0.4);
ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS = players.getProperty("EnchantChanceMagicWeapon15Plus", 0.2);
ENCHANT_CHANCE_WEAPON_NONMAGIC = players.getProperty("EnchantChanceNonMagicWeapon", 0.7);
ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS = players.getProperty("EnchantChanceNonMagicWeapon15Plus", 0.35);
+ENCHANT_CHANCE_WEAPON_MAGIC_BLESSED = players.getProperty("EnchantChangeWeaponMagicBlessed", 0.35);
+ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS_BLESSED = players.getProperty("EnchantChangeWeaponMagic15PlusBlessed", 0.35);
+ENCHANT_CHANCE_WEAPON_NONMAGIC_BLESSED = players.getProperty("EnchantChangeWeaponNonMagicBlessed", 0.35);
+ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS_BLESSED = players.getProperty("EnchantChangeWeaponNonMagic15PlusBlessed", 0.35);
+ENCHANT_CHANCE_WEAPON_NONMAGIC_CRYSTAL = players.getProperty("EnchantChanceWeaponNonMagicCrystal", 0.35);
+ENCHANT_CHANCE_WEAPON_NONMAGIC_15PLUS_CRYSTAL = players.getProperty("EnchantChanceWeaponNonMagic15PlusCrystal", 0.35);
+ENCHANT_CHANCE_WEAPON_MAGIC_CRYSTAL = players.getProperty("EnchantChanceWeaponMagicCrystal", 0.35);
+ENCHANT_CHANCE_WEAPON_MAGIC_15PLUS_CRYSTAL = players.getProperty("EnchantChanceWeaponMagic15PlusCrystal", 0.35);
ENCHANT_CHANCE_ARMOR = players.getProperty("EnchantChanceArmor", 0.66);
+ENCHANT_CHANCE_ARMOR_BLESSED = players.getProperty("EnchantChanceArmorBlessed", 0.66); 
+ENCHANT_CHANCE_ARMOR_CRYSTAL = players.getProperty("EnchantChanceArmorCrystal", 0.66);

And the properties

# % chance of success to enchant a non magic weapon with normal scroll
EnchantChanceNonMagicWeapon = 0.55
EnchantChanceNonMagicWeapon15Plus = 0.55
+
+# % chance of success to enchant a magic weapon with blessed scroll
+EnchantChangeWeaponMagicBlessed = 0.75
+EnchantChangeWeaponMagic15PlusBlessed = 0.75
+
+# % chance of success to enchant a non magic weapon with blessed scroll
+EnchantChangeWeaponNonMagicBlessed = 0.75
+EnchantChangeWeaponNonMagic15PlusBlessed = 0.75
+
+# % chance of success to enchant a magic weapon with crystal scroll
+EnchantChanceWeaponMagicCrystal = 0.95
+EnchantChanceWeaponMagic15PlusCrystal = 0.95
+
+# % chance of success to enchant a non magic weapon with crystal scroll
+EnchantChanceWeaponNonMagicCrystal = 0.95
+EnchantChanceWeaponNonMagic15PlusCrystal = 0.95
+
# % chance of success for normal scrolls to enchant an armor part (both jewelry or armor)
EnchantChanceArmor = 0.66
+
+# % chance of success for blessed scrolls to enchant an armor part (both jewelry or armor)
+EnchantChanceArmorBlessed = 0.75
+
+# % chance of success for crystal scrolls to enchant an armor part (both jewelry or armor)
+EnchantChanceArmorCrystal = 0.95

# Enchant limit [default = 0]
EnchantMaxWeapon = 0
EnchantMaxArmor = 0
  • 0
Posted (edited)

well, i found a lot of codes, the one of Hasha with the xml and the simple one for blessed and crystal but i got tons of errors which i can't fix xd

i'll give one more try, i'll fix it or i'll fck the whole enchant system ;D

Edited by Psyancy
  • 0
Posted

well, i found a lot of codes, the one of Hasha with the xml and the simple one for blessed and crystal but i got tons of errors which i can't fix xd

i'll give one more try, i'll fix it or i'll fck the whole enchant system ;D

Pm me psyancy i will give you this code..is for normal scrolls blessed and crystal...max enchant and change with config.
  • 0
Posted

Because Hasha code was updated sometime ago by the new aCis model. Now we have equip grade variable as ENUM. It's one of some problems in code.

yup, i know. i had this code on my previous sources with an older revision and i didn't had any problem with both codes

 

Pm me psyancy i will give you this code..is for normal scrolls blessed and crystal...max enchant and change with config.

alright mate, i'll pm you now, thanks :)

  • 0
Posted

Pm me psyancy i will give you this code..is for normal scrolls blessed and crystal...max enchant and change with config.

 

 

Why you giving it with pm? Maybe someone looking for it too? Cant you just share in topic? ..

Guest
This topic is now closed to further replies.
×
×
  • Create New...