Hello i have this abstractEnchantPacket & configs working without errors but i think are messed up..
With 60% enchant ratios in blessed and they take the ratio of crystal scrolls (90%) somehow.. (tested)
What is messed up here?
/*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.l2j.gameserver.network.clientpackets;import java.util.HashMap;import java.util.Map;import net.sf.l2j.Config;import net.sf.l2j.gameserver.model.item.instance.ItemInstance;import net.sf.l2j.gameserver.model.item.kind.Item;import net.sf.l2j.gameserver.model.item.kind.Weapon;import net.sf.l2j.gameserver.model.item.type.CrystalType;import net.sf.l2j.gameserver.model.item.type.WeaponType;public abstract classAbstractEnchantPacket extends L2GameClientPacket
{publicstatic final Map<Integer,EnchantScroll> _scrolls =newHashMap<>();publicstatic final classEnchantScroll{protected final boolean _isWeapon;protected final CrystalType _grade;private final boolean _isBlessed;private final boolean _isCrystal;publicEnchantScroll(boolean wep, boolean bless, boolean crystal,CrystalType type){
_isWeapon = wep;
_grade = type;
_isBlessed = bless;
_isCrystal = crystal;}/**
* @param enchantItem : The item to enchant.
* @return true if support item can be used for this item
*/public final boolean isValid(ItemInstance enchantItem){if(enchantItem == null)returnfalse;// checking scroll type and configured maximum enchant levelswitch(enchantItem.getItem().getType2()){caseItem.TYPE2_WEAPON:if(!_isWeapon ||(Config.ENCHANT_MAX_WEAPON >0&& enchantItem.getEnchantLevel()>=Config.ENCHANT_MAX_WEAPON))returnfalse;break;caseItem.TYPE2_SHIELD_ARMOR:caseItem.TYPE2_ACCESSORY:if(_isWeapon ||(Config.ENCHANT_MAX_ARMOR >0&& enchantItem.getEnchantLevel()>=Config.ENCHANT_MAX_ARMOR))returnfalse;break;default:returnfalse;}// check for crystal typeif(_grade != enchantItem.getItem().getCrystalType())returnfalse;returntrue;}/**
* @return true if item is a blessed scroll.
*/public final boolean isBlessed(){return _isBlessed;}/**
* @return true if item is a crystal scroll.
*/public final boolean isCrystal(){return _isCrystal;}/**
* Regarding enchant system :<br>
* <br>
* <u>Weapons</u>
* <ul>
* <li>magic weapons has chance of 40% until +15 and 20% from +15 and higher. There is no upper limit, there is no dependance on current enchant level.</li>
* <li>non magic weapons has chance of 70% until +15 and 35% from +15 and higher. There is no upper limit, there is no dependance on current enchant level.</li>
* </ul>
* <u>Armors</u>
* <ul>
* <li>non fullbody armors (jewelry, upper armor, lower armor, boots, gloves, helmets and shirts) has chance of 2/3 for +4, 1/3 for +5, 1/4 for +6, ...., 1/18 +20. If you've made a +20 armor, chance to make it +21 will be equal to zero (0%).</li>
* <li>full body armors has a chance of 1/1 for +4, 2/3 for +5, 1/3 for +6, ..., 1/17 for +20. If you've made a +20 armor, chance to make it +21 will be equal to zero (0%).</li>
* </ul>
* @param enchantItem : The item to enchant.
* @return the enchant chance under double format (0.7 / 0.35 / 0.44324...).
*/public final double getChance(ItemInstance enchantItem){if(!isValid(enchantItem))return-1;
boolean fullBody = enchantItem.getItem().getBodyPart()==Item.SLOT_FULL_ARMOR;if(enchantItem.getEnchantLevel()<Config.ENCHANT_SAFE_MAX ||(fullBody && enchantItem.getEnchantLevel()<Config.ENCHANT_SAFE_MAX_FULL))return1;double chance =0;// Armor formula : 0.66^(current-2), chance is lower and lower for each enchant.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.elseif(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;}}elseif(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.elseif(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.elseif(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;}}return chance;}}/**
* Format : itemId, (isWeapon, isBlessed, isCrystal, grade)<br>
* Allowed items IDs must be sorted by ascending order.
*/static{// Scrolls: Enchant Weapon
_scrolls.put(729,newEnchantScroll(true,false,false,CrystalType.A));
_scrolls.put(947,newEnchantScroll(true,false,false,CrystalType.B));
_scrolls.put(951,newEnchantScroll(true,false,false,CrystalType.C));
_scrolls.put(955,newEnchantScroll(true,false,false,CrystalType.D));
_scrolls.put(959,newEnchantScroll(true,false,false,CrystalType.S));// Scrolls: Enchant Armor
_scrolls.put(730,newEnchantScroll(false,false,false,CrystalType.A));
_scrolls.put(948,newEnchantScroll(false,false,false,CrystalType.B));
_scrolls.put(952,newEnchantScroll(false,false,false,CrystalType.C));
_scrolls.put(956,newEnchantScroll(false,false,false,CrystalType.D));
_scrolls.put(960,newEnchantScroll(false,false,false,CrystalType.S));// Blessed Scrolls: Enchant Weapon
_scrolls.put(6569,newEnchantScroll(true,true,false,CrystalType.A));
_scrolls.put(6571,newEnchantScroll(true,true,false,CrystalType.B));
_scrolls.put(6573,newEnchantScroll(true,true,false,CrystalType.C));
_scrolls.put(6575,newEnchantScroll(true,true,false,CrystalType.D));
_scrolls.put(6577,newEnchantScroll(true,true,false,CrystalType.S));// Blessed Scrolls: Enchant Armor
_scrolls.put(6570,newEnchantScroll(false,true,false,CrystalType.A));
_scrolls.put(6572,newEnchantScroll(false,true,false,CrystalType.B));
_scrolls.put(6574,newEnchantScroll(false,true,false,CrystalType.C));
_scrolls.put(6576,newEnchantScroll(false,true,false,CrystalType.D));
_scrolls.put(6578,newEnchantScroll(false,true,false,CrystalType.S));// Crystal Scrolls: Enchant Weapon
_scrolls.put(731,newEnchantScroll(true,false,true,CrystalType.A));
_scrolls.put(949,newEnchantScroll(true,false,true,CrystalType.B));
_scrolls.put(953,newEnchantScroll(true,false,true,CrystalType.C));
_scrolls.put(957,newEnchantScroll(true,false,true,CrystalType.D));
_scrolls.put(961,newEnchantScroll(true,false,true,CrystalType.S));// Crystal Scrolls: Enchant Armor
_scrolls.put(732,newEnchantScroll(false,false,true,CrystalType.A));
_scrolls.put(950,newEnchantScroll(false,false,true,CrystalType.B));
_scrolls.put(954,newEnchantScroll(false,false,true,CrystalType.C));
_scrolls.put(958,newEnchantScroll(false,false,true,CrystalType.D));
_scrolls.put(962,newEnchantScroll(false,false,true,CrystalType.S));}/**
* @param scroll The instance of item to make checks on.
* @return enchant template for scroll.
*/protectedstatic final EnchantScroll getEnchantScroll(ItemInstance scroll){return _scrolls.get(scroll.getItemId());}/**
* @param item The instance of item to make checks on.
* @return true if item can be enchanted.
*/protectedstatic final boolean isEnchantable(ItemInstance item){if(item.isHeroItem()|| item.isShadowItem()|| item.isEtcItem()|| item.getItem().getItemType()==WeaponType.FISHINGROD)returnfalse;// only equipped items or in inventory can be enchantedif(item.getLocation()!=ItemInstance.ItemLocation.INVENTORY && item.getLocation()!=ItemInstance.ItemLocation.PAPERDOLL)returnfalse;returntrue;}}
Rosyk or rusik or whatever u blaim me tha my mouth stinks but I assume you the one who stinks and your perfect pack will be now shared and you can suck a DICK )
https://eu2.contabostorage.com/d4b39866f6bb4084b6c969ec8fe20063:kita/Lucera_Classic_Remaster/Lucera Classic Remaster Server and Datapack files.rar
https://eu2.contabostorage.com/d4b39866f6bb4084b6c969ec8fe20063:kita/Lucera_Classic_Remaster/Lucera Classic Remaster Eng Client.rar
Drama link
@Huggo Thank you for asking!
When you join our Discord, on the Nexus Marketing section there is a #work-showcase channel.
There you can see a little bit of what we are able to produce as a final ready-to-post product.
There is also this link in my new personal montage YouTube channel, in which I will be uploading every recent work:
https://youtube.com/playlist?list=PLkzBKexKw8Wj8dC2diYndd5yOWOXUQCJW&si=-HGxlovqzvD4qqy2
Two more videos are coming up this week, and a #reviews channel has opened for our clients to let other people know about their experience working with us.
Feel free to join our Hub in Discord, and for any inquries you might have don't hesitate to contact me or post your suggestion at #suggestions channel.
Следи за своим вонючим языком, мудак.
Your mouth stinks, go wash your mouth, it's a dump)
I don't know who you are or what you are, and I don't recommend buying anything from people outside of my network, as they may sell garbage under the guise of my work. There have been cases where my sales have been compromised.
Additionally, reselling below the purchase price has been prohibited.
I wish you all the best and peace.
I kindly request that the moderators close this topic, as it is no longer relevant and the contact information is outdated.
Question
killer666
Hello i have this abstractEnchantPacket & configs working without errors but i think are messed up..
With 60% enchant ratios in blessed and they take the ratio of crystal scrolls (90%) somehow.. (tested)
What is messed up here?
2 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now