Ir para conteúdo
  • Cadastre-se
  • 0

[L2jFrozen] Universal Enchants


weynemoreira

Pergunta

Galera, eu vi um tópico que ensinava esse mod pro l2jfrozen, que seria um scroll universao para todas as grades. Porém eu adicionei tudo certinho e compilei sem nenhum erro, quando entrei no jogo e sumonei o item ele nao usa, simplesmente fica estatico com utilidade nehuma.

Alguem poderia me dizer se funciona mesmo ou se mudou algo no codigo??

 

 

 

Index: config/head/enchant.properties
===================================================================
--- config/head/enchant.properties (revision 923)
+++ config/head/enchant.properties (working copy)
@@ -46,6 +46,19 @@
# Jewel
CrystalJewelryEnchantLevel = 1,100;2,100;3,100;4,97;5,94;6,91;7,88;8,85;9,82;10,79;11,76;12,73;13,70;14,67;15,64;16,61;
+# ---------------------------------------------
+# Chance For Donator Scrolls -
+# ---------------------------------------------
+# Weapon
+DonatorWeaponEnchantLevel = 1,100;2,100;3,100;4,100;5,100;6,100;7,100;8,100;9,100;10,100;11,100;12,100;13,100;14,100;15,100;16,10;17,10;18,10;19,10;20,10;
+# Armor
+DonatorArmorEnchantLevel = 1,100;2,100;3,100;4,100;5,100;6,100;7,100;8,100;9,100;10,100;11,100;12,100;13,100;14,100;15,100;16,100;17,100;18,100;19,100;20,100;
+# Jewel
+DonatorJewelryEnchantLevel = 1,100;2,100;3,100;4,100;5,100;6,100;7,100;8,100;9,100;10,100;11,100;12,100;13,100;14,100;15,100;16,100;17,100;18,100;19,100;20,100;
+
+# Enchant after break with donator scroll.
+DonatorEnchantAfterBreak = 3
+
# Safe enchant
EnchantSafeMax = 3
EnchantSafeMaxFull = 4
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (revision 923)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (working copy)
@@ -40,6 +40,10 @@
public final class RequestEnchantItem extends L2GameClientPacket
{
protected static final Logger _log = Logger.getLogger(Inventory.class.getName());
+
+ private static final int[] DONATOR_WEAPON_SCROLL= { 10000 };
+ private static final int[] DONATOR_ARMOR_SCROLL = { 10001 };
+
private static final int[] CRYSTAL_SCROLLS =
{
731, 732, 949, 950, 953, 954, 957, 958, 961, 962
@@ -154,6 +158,7 @@
int itemType2 = item.getItem().getType2();
boolean enchantItem = false;
boolean blessedScroll = false;
+ boolean donatorScroll = false;
boolean crystalScroll = false;
int crystalId = 0;
@@ -167,6 +172,7 @@
case 729:
case 731:
case 6569:
+ case 10000:
if(itemType2 == L2Item.TYPE2_WEAPON)
{
enchantItem = true;
@@ -175,6 +181,7 @@
case 730:
case 732:
case 6570:
+ case 10001:
if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
{
enchantItem = true;
@@ -189,6 +196,7 @@
case 947:
case 949:
case 6571:
+ case 10000:
if(itemType2 == L2Item.TYPE2_WEAPON)
{
enchantItem = true;
@@ -197,6 +205,7 @@
case 948:
case 950:
case 6572:
+ case 10001:
if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
{
enchantItem = true;
@@ -211,6 +220,7 @@
case 951:
case 953:
case 6573:
+ case 10000:
if(itemType2 == L2Item.TYPE2_WEAPON)
{
enchantItem = true;
@@ -219,6 +229,7 @@
case 952:
case 954:
case 6574:
+ case 10001:
if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
{
enchantItem = true;
@@ -233,6 +244,7 @@
case 955:
case 957:
case 6575:
+ case 10000:
if(itemType2 == L2Item.TYPE2_WEAPON)
{
enchantItem = true;
@@ -241,6 +253,7 @@
case 956:
case 958:
case 6576:
+ case 10001:
if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
{
enchantItem = true;
@@ -255,6 +268,7 @@
case 959:
case 961:
case 6577:
+ case 10000:
if(itemType2 == L2Item.TYPE2_WEAPON)
{
enchantItem = true;
@@ -263,6 +277,7 @@
case 960:
case 962:
case 6578:
+ case 10001:
if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
{
enchantItem = true;
@@ -283,6 +298,10 @@
{
blessedScroll = true;
}
+ else if(scroll.getItemId() == 10000 || scroll.getItemId() == 10001)
+ {
+ donatorScroll = true;
+ }
else
{
for(int crystalscroll : CRYSTAL_SCROLLS)
@@ -350,6 +369,24 @@
}
}
+ }else if(donatorScroll){
+
+ for (int scrollId : DONATOR_WEAPON_SCROLL)
+ {
+ if (scroll.getItemId() == scrollId)
+ {
+ if(item.getEnchantLevel() >= Config.DONATOR_WEAPON_ENCHANT_LEVEL.size())
+ {
+ chance = Config.DONATOR_WEAPON_ENCHANT_LEVEL.get(Config.DONATOR_WEAPON_ENCHANT_LEVEL.size());
+ }
+ else
+ {
+ chance = Config.DONATOR_WEAPON_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1);
+ }
+ maxEnchantLevel = Config.ENCHANT_WEAPON_MAX;
+ break;
+ }
+ }
}else{ //normal scrolls
for(int normalweaponscroll : NORMAL_WEAPON_SCROLLS)
@@ -416,6 +453,25 @@
}
}
+ }else if(donatorScroll){
+
+ for (int scrollId : DONATOR_ARMOR_SCROLL)
+ {
+ if (scroll.getItemId() == scrollId)
+ {
+ if(item.getEnchantLevel() >= Config.DONATOR_ARMOR_ENCHANT_LEVEL.size())
+ {
+ chance = Config.DONATOR_ARMOR_ENCHANT_LEVEL.get(Config.DONATOR_ARMOR_ENCHANT_LEVEL.size());
+ }
+ else
+ {
+ chance = Config.DONATOR_ARMOR_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1);
+ }
+ maxEnchantLevel = Config.ENCHANT_ARMOR_MAX;
+
+ break;
+ }
+ }
}else{ //normal scrolls
for(int normalarmorscroll : NORMAL_ARMOR_SCROLLS)
@@ -482,6 +538,25 @@
}
}
+ }else if(donatorScroll){
+
+ for (int scrollId : DONATOR_ARMOR_SCROLL)
+ {
+ if (scroll.getItemId() == scrollId)
+ {
+ if(item.getEnchantLevel() >= Config.DONATOR_JEWELRY_ENCHANT_LEVEL.size())
+ {
+ chance = Config.DONATOR_JEWELRY_ENCHANT_LEVEL.get(Config.DONATOR_JEWELRY_ENCHANT_LEVEL.size());
+ }
+ else
+ {
+ chance = Config.DONATOR_JEWELRY_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1);
+ }
+ maxEnchantLevel = Config.ENCHANT_JEWELRY_MAX;
+
+ break;
+ }
+ }
}else{
for(int normaljewelscroll : NORMAL_ARMOR_SCROLLS)
@@ -585,6 +660,9 @@
}else if(blessedScroll){
sm = new SystemMessage(SystemMessageId.BLESSED_ENCHANT_FAILED);
activeChar.sendPacket(sm);
+ }else if(donatorScroll){
+ sm = SystemMessage.sendString("Failed in Donator Enchant. The enchant value of the item become " + Config.DONATOR_ENCHANT_AFTER_BREAK + ".");
+ activeChar.sendPacket(sm);
}else{
if(item.getEnchantLevel() > 0)
{
@@ -601,7 +679,7 @@
}
}
- if(!blessedScroll && !crystalScroll)
+ if(!blessedScroll && !crystalScroll && !donatorScroll)
{
if(item.getEnchantLevel() > 0)
{
@@ -693,9 +771,10 @@
}else if(crystalScroll){
item.setEnchantLevel(Config.CRYSTAL_ENCHANT_MIN);
item.updateDatabase();
+ }else if(donatorScroll){
+ item.setEnchantLevel(Config.DONATOR_ENCHANT_AFTER_BREAK);
+ item.updateDatabase();
}
-
-
}
}
}
Index: head-src/com/l2jfrozen/gameserver/handler/itemhandlers/EnchantScrolls.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/itemhandlers/EnchantScrolls.java (revision 923)
+++ head-src/com/l2jfrozen/gameserver/handler/itemhandlers/EnchantScrolls.java (working copy)
@@ -54,8 +54,9 @@
961,
962,
6577,
- 6578
- // s grade
+ 6578, // s grade
+ 10000,
+ 10001 // Donator Scroll
};
@Override
Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java (revision 923)
+++ head-src/com/l2jfrozen/Config.java (working copy)
@@ -2772,15 +2776,20 @@
public static FastMap<Integer, Integer> NORMAL_WEAPON_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> BLESS_WEAPON_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> CRYSTAL_WEAPON_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
+ public static FastMap<Integer, Integer> DONATOR_WEAPON_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> NORMAL_ARMOR_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> BLESS_ARMOR_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> CRYSTAL_ARMOR_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
+ public static FastMap<Integer, Integer> DONATOR_ARMOR_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> NORMAL_JEWELRY_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> BLESS_JEWELRY_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> CRYSTAL_JEWELRY_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
+ public static FastMap<Integer, Integer> DONATOR_JEWELRY_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
+ public static int DONATOR_ENCHANT_AFTER_BREAK;
+
public static int ENCHANT_SAFE_MAX;
public static int ENCHANT_SAFE_MAX_FULL;
public static int ENCHANT_WEAPON_MAX;
@@ -2915,6 +2924,32 @@
}
}
+ propertySplit = ENCHANTSetting.getProperty("DonatorWeaponEnchantLevel", "").split(";");
+ for(String readData : propertySplit)
+ {
+ String[] writeData = readData.split(",");
+ if(writeData.length != 2)
+ {
+ System.out.println("invalid config property");
+ }
+ else
+ {
+ try
+ {
+ DONATOR_WEAPON_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
+ }
+ catch(NumberFormatException nfe)
+ {
+ if(Config.ENABLE_ALL_EXCEPTIONS)
+ nfe.printStackTrace();
+ if(!readData.equals(""))
+ {
+ System.out.println("invalid config property");
+ }
+ }
+ }
+ }
+
propertySplit = ENCHANTSetting.getProperty("NormalArmorEnchantLevel", "").split(";");
for(String readData : propertySplit)
{
@@ -2993,6 +3028,32 @@
}
}
+ propertySplit = ENCHANTSetting.getProperty("DonatorArmorEnchantLevel", "").split(";");
+ for(String readData : propertySplit)
+ {
+ String[] writeData = readData.split(",");
+ if(writeData.length != 2)
+ {
+ System.out.println("invalid config property");
+ }
+ else
+ {
+ try
+ {
+ DONATOR_ARMOR_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
+ }
+ catch(NumberFormatException nfe)
+ {
+ if(Config.ENABLE_ALL_EXCEPTIONS)
+ nfe.printStackTrace();
+ if(!readData.equals(""))
+ {
+ System.out.println("invalid config property");
+ }
+ }
+ }
+ }
+
propertySplit = ENCHANTSetting.getProperty("NormalJewelryEnchantLevel", "").split(";");
for(String readData : propertySplit)
{
@@ -3075,6 +3136,35 @@
}
}
+ propertySplit = ENCHANTSetting.getProperty("DonatorJewelryEnchantLevel", "").split(";");
+ for(String readData : propertySplit)
+ {
+ String[] writeData = readData.split(",");
+ if(writeData.length != 2)
+ {
+ System.out.println("invalid config property");
+ }
+ else
+ {
+ try
+ {
+ DONATOR_JEWELRY_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
+ }
+ catch(NumberFormatException nfe)
+ {
+ if(Config.ENABLE_ALL_EXCEPTIONS)
+ nfe.printStackTrace();
+
+ if(!readData.equals(""))
+ {
+ System.out.println("invalid config property");
+ }
+ }
+ }
+ }
+
+ DONATOR_ENCHANT_AFTER_BREAK = Integer.parseInt(ENCHANTSetting.getProperty("DonatorEnchantAfterBreak", "3"));
+
/** limit of safe enchant normal **/
ENCHANT_SAFE_MAX = Integer.parseInt(ENCHANTSetting.getProperty("EnchantSafeMax", "3"));
Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts recomendados

  • 0

mano funciona sim eu fiz o teste 100% porém me deparei com o mesmo erro também pois eu tinha editado uma parte do codigo e ficou com mesmo problema. só acho que você fez algo errado tipo mudou algo sem querer ou esqueceu uma parte colocou no lugar errado :v tenta fazer com calma e presta a tenção que pega

Vou fazer... Se funcionar eu digo aqui vlw

mano funciona sim eu fiz o teste 100% porém me deparei com o mesmo erro também pois eu tinha editado uma parte do codigo e ficou com mesmo problema. só acho que você fez algo errado tipo mudou algo sem querer ou esqueceu uma parte colocou no lugar errado :v tenta fazer com calma e presta a tenção que pega

VERDADE ! TINHA QUE FAZER UMAS ALTERAÇÕES PRA FICAR CONFORME O CODIGO FALA... EU FUI NO COPIAR E COLAR E NAO VI ISSO!!

 

VALEUU

Link para o comentário
Compartilhar em outros sites


  • 0

mano funciona sim eu fiz o teste 100% porém me deparei com o mesmo erro também pois eu tinha editado uma parte do codigo e ficou com mesmo problema. só acho que você fez algo errado tipo mudou algo sem querer ou esqueceu uma parte colocou no lugar errado :v tenta fazer com calma e presta a tenção que pega

Link para o comentário
Compartilhar em outros sites

  • 0
Em 31/05/2017 at 02:20, weynemoreira disse:

Galera, eu vi um tópico que ensinava esse mod pro l2jfrozen, que seria um scroll universao para todas as grades. Porém eu adicionei tudo certinho e compilei sem nenhum erro, quando entrei no jogo e sumonei o item ele nao usa, simplesmente fica estatico com utilidade nehuma.

Alguem poderia me dizer se funciona mesmo ou se mudou algo no codigo??

 

 

 

Index: config/head/enchant.properties
===================================================================
--- config/head/enchant.properties (revision 923)
+++ config/head/enchant.properties (working copy)
@@ -46,6 +46,19 @@
# Jewel
CrystalJewelryEnchantLevel = 1,100;2,100;3,100;4,97;5,94;6,91;7,88;8,85;9,82;10,79;11,76;12,73;13,70;14,67;15,64;16,61;
 
+# ---------------------------------------------
+# Chance For Donator Scrolls -
+# ---------------------------------------------
+# Weapon
+DonatorWeaponEnchantLevel = 1,100;2,100;3,100;4,100;5,100;6,100;7,100;8,100;9,100;10,100;11,100;12,100;13,100;14,100;15,100;16,10;17,10;18,10;19,10;20,10;
+# Armor
+DonatorArmorEnchantLevel = 1,100;2,100;3,100;4,100;5,100;6,100;7,100;8,100;9,100;10,100;11,100;12,100;13,100;14,100;15,100;16,100;17,100;18,100;19,100;20,100;
+# Jewel
+DonatorJewelryEnchantLevel = 1,100;2,100;3,100;4,100;5,100;6,100;7,100;8,100;9,100;10,100;11,100;12,100;13,100;14,100;15,100;16,100;17,100;18,100;19,100;20,100;
+
+# Enchant after break with donator scroll.
+DonatorEnchantAfterBreak = 3
+
# Safe enchant
EnchantSafeMax = 3
EnchantSafeMaxFull = 4
Index: head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (revision 923)
+++ head-src/com/l2jfrozen/gameserver/network/clientpackets/RequestEnchantItem.java (working copy)
@@ -40,6 +40,10 @@
public final class RequestEnchantItem extends L2GameClientPacket
{
protected static final Logger _log = Logger.getLogger(Inventory.class.getName());
+
+ private static final int[] DONATOR_WEAPON_SCROLL= { 10000 };
+ private static final int[] DONATOR_ARMOR_SCROLL = { 10001 };
+
private static final int[] CRYSTAL_SCROLLS =
{
731, 732, 949, 950, 953, 954, 957, 958, 961, 962
@@ -154,6 +158,7 @@
int itemType2 = item.getItem().getType2();
boolean enchantItem = false;
boolean blessedScroll = false;
+ boolean donatorScroll = false;
boolean crystalScroll = false;
int crystalId = 0;
 
@@ -167,6 +172,7 @@
case 729:
case 731:
case 6569:
+ case 10000:
if(itemType2 == L2Item.TYPE2_WEAPON)
{
enchantItem = true;
@@ -175,6 +181,7 @@
case 730:
case 732:
case 6570:
+ case 10001:
if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
{
enchantItem = true;
@@ -189,6 +196,7 @@
case 947:
case 949:
case 6571:
+ case 10000:
if(itemType2 == L2Item.TYPE2_WEAPON)
{
enchantItem = true;
@@ -197,6 +205,7 @@
case 948:
case 950:
case 6572:
+ case 10001:
if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
{
enchantItem = true;
@@ -211,6 +220,7 @@
case 951:
case 953:
case 6573:
+ case 10000:
if(itemType2 == L2Item.TYPE2_WEAPON)
{
enchantItem = true;
@@ -219,6 +229,7 @@
case 952:
case 954:
case 6574:
+ case 10001:
if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
{
enchantItem = true;
@@ -233,6 +244,7 @@
case 955:
case 957:
case 6575:
+ case 10000:
if(itemType2 == L2Item.TYPE2_WEAPON)
{
enchantItem = true;
@@ -241,6 +253,7 @@
case 956:
case 958:
case 6576:
+ case 10001:
if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
{
enchantItem = true;
@@ -255,6 +268,7 @@
case 959:
case 961:
case 6577:
+ case 10000:
if(itemType2 == L2Item.TYPE2_WEAPON)
{
enchantItem = true;
@@ -263,6 +277,7 @@
case 960:
case 962:
case 6578:
+ case 10001:
if(itemType2 == L2Item.TYPE2_SHIELD_ARMOR || itemType2 == L2Item.TYPE2_ACCESSORY)
{
enchantItem = true;
@@ -283,6 +298,10 @@
{
blessedScroll = true;
}
+ else if(scroll.getItemId() == 10000 || scroll.getItemId() == 10001)
+ {
+ donatorScroll = true;
+ }
else
{
for(int crystalscroll : CRYSTAL_SCROLLS)
@@ -350,6 +369,24 @@
}
}
 
+ }else if(donatorScroll){
+
+ for (int scrollId : DONATOR_WEAPON_SCROLL)
+ {
+ if (scroll.getItemId() == scrollId)
+ {
+ if(item.getEnchantLevel() >= Config.DONATOR_WEAPON_ENCHANT_LEVEL.size())
+ {
+ chance = Config.DONATOR_WEAPON_ENCHANT_LEVEL.get(Config.DONATOR_WEAPON_ENCHANT_LEVEL.size());
+ }
+ else
+ {
+ chance = Config.DONATOR_WEAPON_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1);
+ }
+ maxEnchantLevel = Config.ENCHANT_WEAPON_MAX;
+ break;
+ }
+ }
}else{ //normal scrolls
 
for(int normalweaponscroll : NORMAL_WEAPON_SCROLLS)
@@ -416,6 +453,25 @@
}
}
 
+ }else if(donatorScroll){
+
+ for (int scrollId : DONATOR_ARMOR_SCROLL)
+ {
+ if (scroll.getItemId() == scrollId)
+ {
+ if(item.getEnchantLevel() >= Config.DONATOR_ARMOR_ENCHANT_LEVEL.size())
+ {
+ chance = Config.DONATOR_ARMOR_ENCHANT_LEVEL.get(Config.DONATOR_ARMOR_ENCHANT_LEVEL.size());
+ }
+ else
+ {
+ chance = Config.DONATOR_ARMOR_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1);
+ }
+ maxEnchantLevel = Config.ENCHANT_ARMOR_MAX;
+
+ break;
+ }
+ }
}else{ //normal scrolls
 
for(int normalarmorscroll : NORMAL_ARMOR_SCROLLS)
@@ -482,6 +538,25 @@
}
}
 
+ }else if(donatorScroll){
+
+ for (int scrollId : DONATOR_ARMOR_SCROLL)
+ {
+ if (scroll.getItemId() == scrollId)
+ {
+ if(item.getEnchantLevel() >= Config.DONATOR_JEWELRY_ENCHANT_LEVEL.size())
+ {
+ chance = Config.DONATOR_JEWELRY_ENCHANT_LEVEL.get(Config.DONATOR_JEWELRY_ENCHANT_LEVEL.size());
+ }
+ else
+ {
+ chance = Config.DONATOR_JEWELRY_ENCHANT_LEVEL.get(item.getEnchantLevel() + 1);
+ }
+ maxEnchantLevel = Config.ENCHANT_JEWELRY_MAX;
+
+ break;
+ }
+ }
}else{
 
for(int normaljewelscroll : NORMAL_ARMOR_SCROLLS)
@@ -585,6 +660,9 @@
}else if(blessedScroll){
sm = new SystemMessage(SystemMessageId.BLESSED_ENCHANT_FAILED);
activeChar.sendPacket(sm);
+ }else if(donatorScroll){
+ sm = SystemMessage.sendString("Failed in Donator Enchant. The enchant value of the item become " + Config.DONATOR_ENCHANT_AFTER_BREAK + ".");
+ activeChar.sendPacket(sm);
}else{
if(item.getEnchantLevel() > 0)
{
@@ -601,7 +679,7 @@
}
}
 
- if(!blessedScroll && !crystalScroll)
+ if(!blessedScroll && !crystalScroll && !donatorScroll)
{
if(item.getEnchantLevel() > 0)
{
@@ -693,9 +771,10 @@
}else if(crystalScroll){
item.setEnchantLevel(Config.CRYSTAL_ENCHANT_MIN);
item.updateDatabase();
+ }else if(donatorScroll){
+ item.setEnchantLevel(Config.DONATOR_ENCHANT_AFTER_BREAK);
+ item.updateDatabase();
}
-
-
}
}
}
Index: head-src/com/l2jfrozen/gameserver/handler/itemhandlers/EnchantScrolls.java
===================================================================
--- head-src/com/l2jfrozen/gameserver/handler/itemhandlers/EnchantScrolls.java (revision 923)
+++ head-src/com/l2jfrozen/gameserver/handler/itemhandlers/EnchantScrolls.java (working copy)
@@ -54,8 +54,9 @@
961,
962,
6577,
- 6578
- // s grade
+ 6578, // s grade
+ 10000,
+ 10001 // Donator Scroll
};
 
@Override
Index: head-src/com/l2jfrozen/Config.java
===================================================================
--- head-src/com/l2jfrozen/Config.java (revision 923)
+++ head-src/com/l2jfrozen/Config.java (working copy)
@@ -2772,15 +2776,20 @@
public static FastMap<Integer, Integer> NORMAL_WEAPON_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> BLESS_WEAPON_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> CRYSTAL_WEAPON_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
+ public static FastMap<Integer, Integer> DONATOR_WEAPON_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
 
public static FastMap<Integer, Integer> NORMAL_ARMOR_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> BLESS_ARMOR_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> CRYSTAL_ARMOR_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
+ public static FastMap<Integer, Integer> DONATOR_ARMOR_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
 
public static FastMap<Integer, Integer> NORMAL_JEWELRY_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> BLESS_JEWELRY_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
public static FastMap<Integer, Integer> CRYSTAL_JEWELRY_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
+ public static FastMap<Integer, Integer> DONATOR_JEWELRY_ENCHANT_LEVEL = new FastMap<Integer, Integer>();
 
+ public static int DONATOR_ENCHANT_AFTER_BREAK;
+
public static int ENCHANT_SAFE_MAX;
public static int ENCHANT_SAFE_MAX_FULL;
public static int ENCHANT_WEAPON_MAX;
@@ -2915,6 +2924,32 @@
}
}
 
+ propertySplit = ENCHANTSetting.getProperty("DonatorWeaponEnchantLevel", "").split(";");
+ for(String readData : propertySplit)
+ {
+ String[] writeData = readData.split(",");
+ if(writeData.length != 2)
+ {
+ System.out.println("invalid config property");
+ }
+ else
+ {
+ try
+ {
+ DONATOR_WEAPON_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
+ }
+ catch(NumberFormatException nfe)
+ {
+ if(Config.ENABLE_ALL_EXCEPTIONS)
+ nfe.printStackTrace();
+ if(!readData.equals(""))
+ {
+ System.out.println("invalid config property");
+ }
+ }
+ }
+ }
+
propertySplit = ENCHANTSetting.getProperty("NormalArmorEnchantLevel", "").split(";");
for(String readData : propertySplit)
{
@@ -2993,6 +3028,32 @@
}
}
 
+ propertySplit = ENCHANTSetting.getProperty("DonatorArmorEnchantLevel", "").split(";");
+ for(String readData : propertySplit)
+ {
+ String[] writeData = readData.split(",");
+ if(writeData.length != 2)
+ {
+ System.out.println("invalid config property");
+ }
+ else
+ {
+ try
+ {
+ DONATOR_ARMOR_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
+ }
+ catch(NumberFormatException nfe)
+ {
+ if(Config.ENABLE_ALL_EXCEPTIONS)
+ nfe.printStackTrace();
+ if(!readData.equals(""))
+ {
+ System.out.println("invalid config property");
+ }
+ }
+ }
+ }
+
propertySplit = ENCHANTSetting.getProperty("NormalJewelryEnchantLevel", "").split(";");
for(String readData : propertySplit)
{
@@ -3075,6 +3136,35 @@
}
}
 
+ propertySplit = ENCHANTSetting.getProperty("DonatorJewelryEnchantLevel", "").split(";");
+ for(String readData : propertySplit)
+ {
+ String[] writeData = readData.split(",");
+ if(writeData.length != 2)
+ {
+ System.out.println("invalid config property");
+ }
+ else
+ {
+ try
+ {
+ DONATOR_JEWELRY_ENCHANT_LEVEL.put(Integer.parseInt(writeData[0]), Integer.parseInt(writeData[1]));
+ }
+ catch(NumberFormatException nfe)
+ {
+ if(Config.ENABLE_ALL_EXCEPTIONS)
+ nfe.printStackTrace();
+
+ if(!readData.equals(""))
+ {
+ System.out.println("invalid config property");
+ }
+ }
+ }
+ }
+
+ DONATOR_ENCHANT_AFTER_BREAK = Integer.parseInt(ENCHANTSetting.getProperty("DonatorEnchantAfterBreak", "3"));
+
/** limit of safe enchant normal **/
ENCHANT_SAFE_MAX = Integer.parseInt(ENCHANTSetting.getProperty("EnchantSafeMax", "3"));

Onde conseguiu esse codigo ?

 

Link para o comentário
Compartilhar em outros sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Processando...




×
×
  • Criar Novo...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.