[help] заточка на La2base
16 ответов238 просмотровСейчас просматривают: 1
· 01.08.2009, 14:13
Сборка: la2base
Здравствуйте ! Хочу сделать чтобы заточка не збрасывалась на 0, какой файл в ядре отвечает за это ?
0
· 01.08.2009, 19:58
Раскрывающийся текст
package net.sf.l2j.gameserver.clientpackets;
import java.util.logging.Logger;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.model.Inventory;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.clientpackets.TradeDone;
import net.sf.l2j.gameserver.serverpackets.EnchantResult;
import net.sf.l2j.gameserver.serverpackets.InventoryUpdate;
import net.sf.l2j.gameserver.serverpackets.ItemList;
import net.sf.l2j.gameserver.serverpackets.StatusUpdate;
import net.sf.l2j.gameserver.serverpackets.SystemMessage;
import net.sf.l2j.gameserver.templates.L2Item;
import net.sf.l2j.gameserver.templates.L2WeaponType;
import net.sf.l2j.gameserver.util.IllegalPlayerAction;
import net.sf.l2j.gameserver.util.Util;
import net.sf.l2j.gameserver.util.FloodProtector;
import net.sf.l2j.util.Rnd;
public final class RequestEnchantItem extends L2GameClientPacket
{
protected static final Logger _log = Logger.getLogger(Inventory.class.getName());
private static final String _C__58_REQUESTENCHANTITEM = "[C] 58 RequestEnchantItem";
private static final int[] CRYSTAL_SCROLLS = { 731, 732, 949, 950, 953, 954, 957, 958, 961, 962 };
private int _objectId;
@Override
protected void readImpl()
{
_objectId = readD();
}
@Override
protected void runImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null || _objectId == 0) return;
if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_ENCHANT))
{
Util.handleIllegalPlayerAction(activeChar,"Player "+activeChar.getName()+" discovered attempt flood clientpacket EnchantItem", IllegalPlayerAction.PUNISH_KICK);
return;
}
activeChar.cancelActiveTrade();
L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);
L2ItemInstance scroll = activeChar.getActiveEnchantItem();
activeChar.setActiveEnchantItem(null);
if (item == null || scroll == null) return;
// can't enchant rods, hero weapons and shadow items
if(item.getItem().getItemType() == L2WeaponType.ROD
|| item.getItemId() >= 6611 && item.getItemId() <= 6621
|| item.isShadowItem())
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}
if(item.isWear())
{
Util.handleIllegalPlayerAction(activeChar,"Player "+activeChar.getName()+" tried to enchant a weared Item", IllegalPlayerAction.PUNISH_KICK);
return;
}
int itemType2 = item.getItem().getType2();
boolean enchantItem = false;
boolean blessedScroll = false;
boolean blesseddScroll = false;
boolean crystallScroll = false;
int crystalId = 0;
/** pretty code ;D */
switch (item.getItem().getCrystalType())
{
case L2Item.CRYSTAL_A:
crystalId = 1461;
switch(scroll.getItemId())
{
case 729: case 731: case 6569:
if(itemType2 == L2Item.TYPE2_WEAPON)
enchantItem = true;
break;
case 730: case 732: case 6570:
if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
enchantItem = true;
break;
}
break;
case L2Item.CRYSTAL_B:
crystalId = 1460;
switch(scroll.getItemId())
{
case 947: case 949: case 6571:
if(itemType2 == L2Item.TYPE2_WEAPON)
enchantItem = true;
break;
case 948: case 950: case 6572:
if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
enchantItem = true;
break;
import java.util.logging.Logger;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.model.Inventory;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.clientpackets.TradeDone;
import net.sf.l2j.gameserver.serverpackets.EnchantResult;
import net.sf.l2j.gameserver.serverpackets.InventoryUpdate;
import net.sf.l2j.gameserver.serverpackets.ItemList;
import net.sf.l2j.gameserver.serverpackets.StatusUpdate;
import net.sf.l2j.gameserver.serverpackets.SystemMessage;
import net.sf.l2j.gameserver.templates.L2Item;
import net.sf.l2j.gameserver.templates.L2WeaponType;
import net.sf.l2j.gameserver.util.IllegalPlayerAction;
import net.sf.l2j.gameserver.util.Util;
import net.sf.l2j.gameserver.util.FloodProtector;
import net.sf.l2j.util.Rnd;
public final class RequestEnchantItem extends L2GameClientPacket
{
protected static final Logger _log = Logger.getLogger(Inventory.class.getName());
private static final String _C__58_REQUESTENCHANTITEM = "[C] 58 RequestEnchantItem";
private static final int[] CRYSTAL_SCROLLS = { 731, 732, 949, 950, 953, 954, 957, 958, 961, 962 };
private int _objectId;
@Override
protected void readImpl()
{
_objectId = readD();
}
@Override
protected void runImpl()
{
L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null || _objectId == 0) return;
if (!FloodProtector.getInstance().tryPerformAction(activeChar.getObjectId(), FloodProtector.PROTECTED_ENCHANT))
{
Util.handleIllegalPlayerAction(activeChar,"Player "+activeChar.getName()+" discovered attempt flood clientpacket EnchantItem", IllegalPlayerAction.PUNISH_KICK);
return;
}
activeChar.cancelActiveTrade();
L2ItemInstance item = activeChar.getInventory().getItemByObjectId(_objectId);
L2ItemInstance scroll = activeChar.getActiveEnchantItem();
activeChar.setActiveEnchantItem(null);
if (item == null || scroll == null) return;
// can't enchant rods, hero weapons and shadow items
if(item.getItem().getItemType() == L2WeaponType.ROD
|| item.getItemId() >= 6611 && item.getItemId() <= 6621
|| item.isShadowItem())
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}
if(item.isWear())
{
Util.handleIllegalPlayerAction(activeChar,"Player "+activeChar.getName()+" tried to enchant a weared Item", IllegalPlayerAction.PUNISH_KICK);
return;
}
int itemType2 = item.getItem().getType2();
boolean enchantItem = false;
boolean blessedScroll = false;
boolean blesseddScroll = false;
boolean crystallScroll = false;
int crystalId = 0;
/** pretty code ;D */
switch (item.getItem().getCrystalType())
{
case L2Item.CRYSTAL_A:
crystalId = 1461;
switch(scroll.getItemId())
{
case 729: case 731: case 6569:
if(itemType2 == L2Item.TYPE2_WEAPON)
enchantItem = true;
break;
case 730: case 732: case 6570:
if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
enchantItem = true;
break;
}
break;
case L2Item.CRYSTAL_B:
crystalId = 1460;
switch(scroll.getItemId())
{
case 947: case 949: case 6571:
if(itemType2 == L2Item.TYPE2_WEAPON)
enchantItem = true;
break;
case 948: case 950: case 6572:
if((itemType2 == L2Item.TYPE2_SHIELD_ARMOR) || (itemType2 == L2Item.TYPE2_ACCESSORY))
enchantItem = true;
break;
где тут менять?
— есть вопросы?!?!?!?!
0
· 02.08.2009, 09:34
Huk99
Немного не понятно. Если у тебя есть исходники то у тебя должна быть платная сборка. Если у тебя платная сборка то тебя не должен интересовать этот вопрос, потому что там выведен конфиг...
0
· 03.08.2009, 16:21
-=[BloodKill]=-: gameserver.clientpackets.RequestEnchantItem.java
а чем этот файл открывать?
— есть вопросы?!?!?!?!
0
· 03.08.2009, 16:40
вот мне надо чтобы точка спадала на +10, и не могу найти где прописать...
Раскрывающийся текст
package net.sf.l2j.gameserver.clientpackets;
import java.util.Map;
import java.util.logging.Logger;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.model.*;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.L2GameClient;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.serverpackets.*;
import net.sf.l2j.gameserver.templates.L2Item;
import net.sf.l2j.gameserver.templates.L2WeaponType;
import net.sf.l2j.gameserver.util.Util;
import net.sf.l2j.util.Rnd;
// Referenced classes of package net.sf.l2j.gameserver.clientpackets:
// L2GameClientPacket
public final class RequestEnchantItem extends L2GameClientPacket
{
public RequestEnchantItem()
{
}
protected void readImpl()
{
_objectId = readD();
}
protected void runImpl()
{
L2PcInstance activeChar;
L2ItemInstance item;
boolean blessedScroll;
int crystalId;
label0:
{
activeChar = ((L2GameClient)getClient()).getActiveChar();
if(activeChar == null || _objectId == 0)
return;
activeChar.cancelActiveTrade();
item = activeChar.getInventory().getItemByObjectId(_objectId);
L2ItemInstance scroll = activeChar.getActiveEnchantItem();
activeChar.setActiveEnchantItem(null);
if(item == null || scroll == null)
return;
if(item.getItem().getItemType() == L2WeaponType.ROD || item.getItemId() >= 6611 && item.getItemId() <= 6621 || item.isShadowItem())
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}
if(item.isWear())
{
Util.handleIllegalPlayerAction(activeChar, (new StringBuilder()).append("Player ").append(activeChar.getName()).append(" tried to enchant a weared Item").toString(), 2);
return;
}
int itemType2 = item.getItem().getType2();
boolean enchantItem = false;
blessedScroll = false;
boolean blesseddScroll = false;
boolean crystallScroll = false;
crystalId = 0;
switch(item.getItem().getCrystalType())
{
case 4: // '\004'
crystalId = 1461;
switch(scroll.getItemId())
{
case 729:
case 731:
case 6569:
if(itemType2 == 0)
enchantItem = true;
break;
case 730:
case 732:
case 6570:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
case 3: // '\003'
crystalId = 1460;
switch(scroll.getItemId())
{
case 947:
case 949:
case 6571:
if(itemType2 == 0)
enchantItem = true;
break;
case 948:
case 950:
case 6572:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
case 2: // '\002'
crystalId = 1459;
switch(scroll.getItemId())
{
case 951:
case 953:
case 6573:
if(itemType2 == 0)
enchantItem = true;
break;
case 952:
case 954:
case 6574:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
case 1: // '\001'
crystalId = 1458;
switch(scroll.getItemId())
{
case 955:
case 957:
case 6575:
if(itemType2 == 0)
enchantItem = true;
break;
case 956:
case 958:
case 6576:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
case 5: // '\005'
crystalId = 1462;
switch(scroll.getItemId())
{
default:
break;
case 959:
case 961:
case 6577:
if(itemType2 == 0)
enchantItem = true;
break;
case 960:
case 962:
case 6578:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
}
if(!enchantItem)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}
if(scroll.getItemId() >= 6569 && scroll.getItemId() <= 6578)
{
blesseddScroll = true;
blessedScroll = true;
} else
{
int arr$[] = CRYSTAL_SCROLLS;
int len$ = arr$.length;
int i$ = 0;
do
{
if(i$ >= len$)
break;
int crystalscroll = arr$[i$];
if(scroll.getItemId() == crystalscroll)
{
crystallScroll = true;
blessedScroll = true;
break;
}
i$++;
} while(true);
}
scroll = activeChar.getInventory().destroyItem("Enchant", scroll, activeChar, item);
if(scroll == null)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));
Util.handleIllegalPlayerAction(activeChar, (new StringBuilder()).append("Player ").append(activeChar.getName()).append(" tried to enchant with a scroll he doesnt have").toString(), Config.DEFAULT_PUNISH);
return;
}
int chance = 0;
int maxEnchantLevel = 0;
if(item.getItem().getType2() == 0)
{
if(item.getEnchantLevel() < 10 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_WEAPON;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_WEAPON_1015;
else
if(item.getEnchantLevel() > 15 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_WEAPON_16;
else
if(item.getEnchantLevel() < 10 && blesseddScroll)
chance = Config.BLESSED_CHANCE_WEAPON;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && blesseddScroll)
chance = Config.BLESSED_CHANCE_WEAPON_1015;
else
if(item.getEnchantLevel() > 15 && blesseddScroll)
chance = Config.BLESSED_CHANCE_WEAPON_16;
else
if(item.getEnchantLevel() < 10 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_WEAPON;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_WEAPON_1015;
else
if(item.getEnchantLevel() > 15 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_WEAPON_16;
maxEnchantLevel = Config.ENCHANT_MAX_WEAPON;
if(Config.ENABLE_MODIFY_ENCHANT_CHANCE_WEAPON && !blesseddScroll && !crystallScroll && Config.ENCHANT_CHANCE_LIST_WEAPON.containsKey(Integer.valueOf(item.getEnchantLev
el())))
chance = ((Integer)Config.ENCHANT_CHANCE_LIST_WEAPON.get(Integer.valueOf(item.getEnchantL
evel()))).intValue();
} else
if(item.getItem().getType2() == 1)
{
if(item.getEnchantLevel() < 10 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_ARMOR;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_ARMOR_1015;
else
if(item.getEnchantLevel() > 15 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_ARMOR_16;
else
if(item.getEnchantLevel() < 10 && blesseddScroll)
chance = Config.BLESSED_CHANCE_ARMOR;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && blesseddScroll)
chance = Config.BLESSED_CHANCE_ARMOR_1015;
else
if(item.getEnchantLevel() > 15 && blesseddScroll)
chance = Config.BLESSED_CHANCE_ARMOR_16;
else
if(item.getEnchantLevel() < 10 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_ARMOR;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_ARMOR_1015;
else
if(item.getEnchantLevel() > 15 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_ARMOR_16;
maxEnchantLevel = Config.ENCHANT_MAX_ARMOR;
if(Config.ENABLE_MODIFY_ENCHANT_CHANCE_ARMOR && !blesseddScroll && !crystallScroll && Config.ENCHANT_CHANCE_LIST_ARMOR.containsKey(Integer.valueOf(item.getEnchantLeve
l())))
chance = ((Integer)Config.ENCHANT_CHANCE_LIST_ARMOR.get(Integer.valueOf(item.getEnchantLe
vel()))).intValue();
} else
if(item.getItem().getType2() == 2)
{
if(item.getEnchantLevel() < 10 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_JEWELRY;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_JEWELRY_1015;
else
if(item.getEnchantLevel() > 15 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_JEWELRY_16;
else
if(item.getEnchantLevel() < 10 && blesseddScroll)
chance = Config.BLESSED_CHANCE_JEWELRY;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && blesseddScroll)
chance = Config.BLESSED_CHANCE_JEWELRY_1015;
else
if(item.getEnchantLevel() > 15 && blesseddScroll)
chance = Config.BLESSED_CHANCE_JEWELRY_16;
else
if(item.getEnchantLevel() < 10 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_JEWELRY;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_JEWELRY_1015;
else
if(item.getEnchantLevel() > 15 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_JEWELRY_16;
maxEnchantLevel = Config.ENCHANT_MAX_JEWELRY;
if(Config.ENABLE_MODIFY_ENCHANT_CHANCE_JEWELRY && !blesseddScroll && !crystallScroll && Config.ENCHANT_CHANCE_LIST_JEWELRY.containsKey(Integer.valueOf(item.getEnchantLe
vel())))
chance = ((Integer)Config.ENCHANT_CHANCE_LIST_JEWELRY.get(Integer.valueOf(item.getEnchant
Level()))).intValue();
}
if(item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX || item.getItem().getBodyPart() == 32768 && item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX_FULL)
chance = 100;
if(item.getOwnerId() != activeChar.getObjectId() || item.getEnchantLevel() >= maxEnchantLevel && maxEnchantLevel != 0)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}
if(Rnd.get(100) >= chance)
break MISSING_BLOCK_LABEL_2041;
synchronized(item)
{
if(item.getLocation() == net.sf.l2j.gameserver.model.L2ItemInstance.ItemLocation.INVENTORY || item.getLocation() == net.sf.l2j.gameserver.model.L2ItemInstance.ItemLocation.PAPERDOLL)
break label0;
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
}
return;
}
if(item.getEnchantLevel() == 0)
{
SystemMessage sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED);
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
} else
{
SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED);
sm.addNumber(item.getEnchantLevel());
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
}
item.setEnchantLevel(item.getEnchantLevel() + 1);
item.updateDatabase();
l2iteminstance;
JVM INSTR monitorexit ;
break MISSING_BLOCK_LABEL_2536;
exception;
throw exception;
if(!blessedScroll)
{
if(item.getEnchantLevel() > 0)
{
SystemMessage sm = new SystemMessage(SystemMessageId.ENCHANTMENT_FAILED_S1_S2_EVAPORATED);
sm.addNumber(item.getEnchantLevel());
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
} else
{
SystemMessage sm = new SystemMessage(SystemMessageId.ENCHANTMENT_FAILED_S1_EVAPORATED);
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
}
} else
{
SystemMessage sm = new SystemMessage(SystemMessageId.BLESSED_ENCHANT_FAILED);
activeChar.sendPacket(sm);
}
if(!blessedScroll)
{
SystemMessage sm;
if(item.getEnchantLevel() > 0)
{
sm = new SystemMessage(SystemMessageId.EQUIPMENT_S1_S2_REMOVED);
sm.addNumber(item.getEnchantLevel());
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
} else
{
sm = new SystemMessage(SystemMessageId.S1_DISARMED);
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
}
if(item.getAugmentation() != null)
item.getAugmentation().removeBoni(activeChar);
L2ItemInstance unequiped[] = activeChar.getInventory().unEquipItemInSlotAndRecord(item.getEquipSlot());
if(item.isEquipped())
{
InventoryUpdate iu = new InventoryUpdate();
for(int i = 0; i < unequiped.length; i++)
iu.addModifiedItem(unequiped[i]);
activeChar.sendPacket(iu);
activeChar.broadcastUserInfo();
}
int count = item.getCrystalCount() - (item.getItem().getCrystalCount() + 1) / 2;
if(count < 1)
count = 1;
L2ItemInstance destroyItem = activeChar.getInventory().destroyItem("Enchant", item, activeChar, null);
if(destroyItem == null)
return;
L2ItemInstance crystals = activeChar.getInventory().addItem("Enchant", crystalId, count, activeChar, destroyItem);
sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
sm.addItemName(crystals.getItemId());
sm.addNumber(count);
activeChar.sendPacket(sm);
if(!Config.FORCE_INVENTORY_UPDATE)
{
InventoryUpdate iu = new InventoryUpdate();
if(destroyItem.getCount() == 0)
iu.addRemovedItem(destroyItem);
else
iu.addModifiedItem(destroyItem);
iu.addItem(crystals);
activeChar.sendPacket(iu);
} else
{
activeChar.sendPacket(new ItemList(activeChar, true));
}
StatusUpdate su = new StatusUpdate(activeChar.getObjectId());
su.addAttribute(14, activeChar.getCurrentLoad());
activeChar.sendPacket(su);
activeChar.broadcastUserInfo();
L2World world = L2World.getInstance();
world.removeObject(destroyItem);
} else
{
item.setEnchantLevel(Config.EnchantStartingPoint);
item.updateDatabase();
}
SystemMessage sm = null;
StatusUpdate su = new StatusUpdate(activeChar.getObjectId());
su.addAttribute(14, activeChar.getCurrentLoad());
activeChar.sendPacket(su);
su = null;
activeChar.sendPacket(new EnchantResult(item.getEnchantLevel()));
activeChar.sendPacket(new ItemList(activeChar, false));
activeChar.broadcastUserInfo();
return;
}
public String getType()
{
return "[C] 58 RequestEnchantItem";
}
protected static final Logger _log = Logger.getLogger(net/sf/l2j/gameserver/model/Inventory.getName());
private static final String _C__58_REQUESTENCHANTITEM = "[C] 58 RequestEnchantItem";
private static final int CRYSTAL_SCROLLS[] = {
731, 732, 949, 950, 953, 954, 957, 958, 961, 962
};
private int _objectId;
}
import java.util.Map;
import java.util.logging.Logger;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.model.*;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.L2GameClient;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.serverpackets.*;
import net.sf.l2j.gameserver.templates.L2Item;
import net.sf.l2j.gameserver.templates.L2WeaponType;
import net.sf.l2j.gameserver.util.Util;
import net.sf.l2j.util.Rnd;
// Referenced classes of package net.sf.l2j.gameserver.clientpackets:
// L2GameClientPacket
public final class RequestEnchantItem extends L2GameClientPacket
{
public RequestEnchantItem()
{
}
protected void readImpl()
{
_objectId = readD();
}
protected void runImpl()
{
L2PcInstance activeChar;
L2ItemInstance item;
boolean blessedScroll;
int crystalId;
label0:
{
activeChar = ((L2GameClient)getClient()).getActiveChar();
if(activeChar == null || _objectId == 0)
return;
activeChar.cancelActiveTrade();
item = activeChar.getInventory().getItemByObjectId(_objectId);
L2ItemInstance scroll = activeChar.getActiveEnchantItem();
activeChar.setActiveEnchantItem(null);
if(item == null || scroll == null)
return;
if(item.getItem().getItemType() == L2WeaponType.ROD || item.getItemId() >= 6611 && item.getItemId() <= 6621 || item.isShadowItem())
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}
if(item.isWear())
{
Util.handleIllegalPlayerAction(activeChar, (new StringBuilder()).append("Player ").append(activeChar.getName()).append(" tried to enchant a weared Item").toString(), 2);
return;
}
int itemType2 = item.getItem().getType2();
boolean enchantItem = false;
blessedScroll = false;
boolean blesseddScroll = false;
boolean crystallScroll = false;
crystalId = 0;
switch(item.getItem().getCrystalType())
{
case 4: // '\004'
crystalId = 1461;
switch(scroll.getItemId())
{
case 729:
case 731:
case 6569:
if(itemType2 == 0)
enchantItem = true;
break;
case 730:
case 732:
case 6570:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
case 3: // '\003'
crystalId = 1460;
switch(scroll.getItemId())
{
case 947:
case 949:
case 6571:
if(itemType2 == 0)
enchantItem = true;
break;
case 948:
case 950:
case 6572:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
case 2: // '\002'
crystalId = 1459;
switch(scroll.getItemId())
{
case 951:
case 953:
case 6573:
if(itemType2 == 0)
enchantItem = true;
break;
case 952:
case 954:
case 6574:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
case 1: // '\001'
crystalId = 1458;
switch(scroll.getItemId())
{
case 955:
case 957:
case 6575:
if(itemType2 == 0)
enchantItem = true;
break;
case 956:
case 958:
case 6576:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
case 5: // '\005'
crystalId = 1462;
switch(scroll.getItemId())
{
default:
break;
case 959:
case 961:
case 6577:
if(itemType2 == 0)
enchantItem = true;
break;
case 960:
case 962:
case 6578:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
}
if(!enchantItem)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}
if(scroll.getItemId() >= 6569 && scroll.getItemId() <= 6578)
{
blesseddScroll = true;
blessedScroll = true;
} else
{
int arr$[] = CRYSTAL_SCROLLS;
int len$ = arr$.length;
int i$ = 0;
do
{
if(i$ >= len$)
break;
int crystalscroll = arr$[i$];
if(scroll.getItemId() == crystalscroll)
{
crystallScroll = true;
blessedScroll = true;
break;
}
i$++;
} while(true);
}
scroll = activeChar.getInventory().destroyItem("Enchant", scroll, activeChar, item);
if(scroll == null)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));
Util.handleIllegalPlayerAction(activeChar, (new StringBuilder()).append("Player ").append(activeChar.getName()).append(" tried to enchant with a scroll he doesnt have").toString(), Config.DEFAULT_PUNISH);
return;
}
int chance = 0;
int maxEnchantLevel = 0;
if(item.getItem().getType2() == 0)
{
if(item.getEnchantLevel() < 10 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_WEAPON;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_WEAPON_1015;
else
if(item.getEnchantLevel() > 15 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_WEAPON_16;
else
if(item.getEnchantLevel() < 10 && blesseddScroll)
chance = Config.BLESSED_CHANCE_WEAPON;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && blesseddScroll)
chance = Config.BLESSED_CHANCE_WEAPON_1015;
else
if(item.getEnchantLevel() > 15 && blesseddScroll)
chance = Config.BLESSED_CHANCE_WEAPON_16;
else
if(item.getEnchantLevel() < 10 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_WEAPON;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_WEAPON_1015;
else
if(item.getEnchantLevel() > 15 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_WEAPON_16;
maxEnchantLevel = Config.ENCHANT_MAX_WEAPON;
if(Config.ENABLE_MODIFY_ENCHANT_CHANCE_WEAPON && !blesseddScroll && !crystallScroll && Config.ENCHANT_CHANCE_LIST_WEAPON.containsKey(Integer.valueOf(item.getEnchantLev
el())))
chance = ((Integer)Config.ENCHANT_CHANCE_LIST_WEAPON.get(Integer.valueOf(item.getEnchantL
evel()))).intValue();
} else
if(item.getItem().getType2() == 1)
{
if(item.getEnchantLevel() < 10 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_ARMOR;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_ARMOR_1015;
else
if(item.getEnchantLevel() > 15 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_ARMOR_16;
else
if(item.getEnchantLevel() < 10 && blesseddScroll)
chance = Config.BLESSED_CHANCE_ARMOR;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && blesseddScroll)
chance = Config.BLESSED_CHANCE_ARMOR_1015;
else
if(item.getEnchantLevel() > 15 && blesseddScroll)
chance = Config.BLESSED_CHANCE_ARMOR_16;
else
if(item.getEnchantLevel() < 10 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_ARMOR;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_ARMOR_1015;
else
if(item.getEnchantLevel() > 15 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_ARMOR_16;
maxEnchantLevel = Config.ENCHANT_MAX_ARMOR;
if(Config.ENABLE_MODIFY_ENCHANT_CHANCE_ARMOR && !blesseddScroll && !crystallScroll && Config.ENCHANT_CHANCE_LIST_ARMOR.containsKey(Integer.valueOf(item.getEnchantLeve
l())))
chance = ((Integer)Config.ENCHANT_CHANCE_LIST_ARMOR.get(Integer.valueOf(item.getEnchantLe
vel()))).intValue();
} else
if(item.getItem().getType2() == 2)
{
if(item.getEnchantLevel() < 10 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_JEWELRY;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_JEWELRY_1015;
else
if(item.getEnchantLevel() > 15 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_JEWELRY_16;
else
if(item.getEnchantLevel() < 10 && blesseddScroll)
chance = Config.BLESSED_CHANCE_JEWELRY;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && blesseddScroll)
chance = Config.BLESSED_CHANCE_JEWELRY_1015;
else
if(item.getEnchantLevel() > 15 && blesseddScroll)
chance = Config.BLESSED_CHANCE_JEWELRY_16;
else
if(item.getEnchantLevel() < 10 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_JEWELRY;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_JEWELRY_1015;
else
if(item.getEnchantLevel() > 15 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_JEWELRY_16;
maxEnchantLevel = Config.ENCHANT_MAX_JEWELRY;
if(Config.ENABLE_MODIFY_ENCHANT_CHANCE_JEWELRY && !blesseddScroll && !crystallScroll && Config.ENCHANT_CHANCE_LIST_JEWELRY.containsKey(Integer.valueOf(item.getEnchantLe
vel())))
chance = ((Integer)Config.ENCHANT_CHANCE_LIST_JEWELRY.get(Integer.valueOf(item.getEnchant
Level()))).intValue();
}
if(item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX || item.getItem().getBodyPart() == 32768 && item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX_FULL)
chance = 100;
if(item.getOwnerId() != activeChar.getObjectId() || item.getEnchantLevel() >= maxEnchantLevel && maxEnchantLevel != 0)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}
if(Rnd.get(100) >= chance)
break MISSING_BLOCK_LABEL_2041;
synchronized(item)
{
if(item.getLocation() == net.sf.l2j.gameserver.model.L2ItemInstance.ItemLocation.INVENTORY || item.getLocation() == net.sf.l2j.gameserver.model.L2ItemInstance.ItemLocation.PAPERDOLL)
break label0;
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
}
return;
}
if(item.getEnchantLevel() == 0)
{
SystemMessage sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED);
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
} else
{
SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED);
sm.addNumber(item.getEnchantLevel());
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
}
item.setEnchantLevel(item.getEnchantLevel() + 1);
item.updateDatabase();
l2iteminstance;
JVM INSTR monitorexit ;
break MISSING_BLOCK_LABEL_2536;
exception;
throw exception;
if(!blessedScroll)
{
if(item.getEnchantLevel() > 0)
{
SystemMessage sm = new SystemMessage(SystemMessageId.ENCHANTMENT_FAILED_S1_S2_EVAPORATED);
sm.addNumber(item.getEnchantLevel());
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
} else
{
SystemMessage sm = new SystemMessage(SystemMessageId.ENCHANTMENT_FAILED_S1_EVAPORATED);
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
}
} else
{
SystemMessage sm = new SystemMessage(SystemMessageId.BLESSED_ENCHANT_FAILED);
activeChar.sendPacket(sm);
}
if(!blessedScroll)
{
SystemMessage sm;
if(item.getEnchantLevel() > 0)
{
sm = new SystemMessage(SystemMessageId.EQUIPMENT_S1_S2_REMOVED);
sm.addNumber(item.getEnchantLevel());
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
} else
{
sm = new SystemMessage(SystemMessageId.S1_DISARMED);
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
}
if(item.getAugmentation() != null)
item.getAugmentation().removeBoni(activeChar);
L2ItemInstance unequiped[] = activeChar.getInventory().unEquipItemInSlotAndRecord(item.getEquipSlot());
if(item.isEquipped())
{
InventoryUpdate iu = new InventoryUpdate();
for(int i = 0; i < unequiped.length; i++)
iu.addModifiedItem(unequiped[i]);
activeChar.sendPacket(iu);
activeChar.broadcastUserInfo();
}
int count = item.getCrystalCount() - (item.getItem().getCrystalCount() + 1) / 2;
if(count < 1)
count = 1;
L2ItemInstance destroyItem = activeChar.getInventory().destroyItem("Enchant", item, activeChar, null);
if(destroyItem == null)
return;
L2ItemInstance crystals = activeChar.getInventory().addItem("Enchant", crystalId, count, activeChar, destroyItem);
sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
sm.addItemName(crystals.getItemId());
sm.addNumber(count);
activeChar.sendPacket(sm);
if(!Config.FORCE_INVENTORY_UPDATE)
{
InventoryUpdate iu = new InventoryUpdate();
if(destroyItem.getCount() == 0)
iu.addRemovedItem(destroyItem);
else
iu.addModifiedItem(destroyItem);
iu.addItem(crystals);
activeChar.sendPacket(iu);
} else
{
activeChar.sendPacket(new ItemList(activeChar, true));
}
StatusUpdate su = new StatusUpdate(activeChar.getObjectId());
su.addAttribute(14, activeChar.getCurrentLoad());
activeChar.sendPacket(su);
activeChar.broadcastUserInfo();
L2World world = L2World.getInstance();
world.removeObject(destroyItem);
} else
{
item.setEnchantLevel(Config.EnchantStartingPoint);
item.updateDatabase();
}
SystemMessage sm = null;
StatusUpdate su = new StatusUpdate(activeChar.getObjectId());
su.addAttribute(14, activeChar.getCurrentLoad());
activeChar.sendPacket(su);
su = null;
activeChar.sendPacket(new EnchantResult(item.getEnchantLevel()));
activeChar.sendPacket(new ItemList(activeChar, false));
activeChar.broadcastUserInfo();
return;
}
public String getType()
{
return "[C] 58 RequestEnchantItem";
}
protected static final Logger _log = Logger.getLogger(net/sf/l2j/gameserver/model/Inventory.getName());
private static final String _C__58_REQUESTENCHANTITEM = "[C] 58 RequestEnchantItem";
private static final int CRYSTAL_SCROLLS[] = {
731, 732, 949, 950, 953, 954, 957, 958, 961, 962
};
private int _objectId;
}
— есть вопросы?!?!?!?!
0
· 03.08.2009, 16:43
Trosha: вот мне надо чтобы точка спадала на +10, и не могу найти где прописать...Раскрывающийся текстpackage net.sf.l2j.gameserver.clientpackets;
import java.util.Map;
import java.util.logging.Logger;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.model.*;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.L2GameClient;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.serverpackets.*;
import net.sf.l2j.gameserver.templates.L2Item;
import net.sf.l2j.gameserver.templates.L2WeaponType;
import net.sf.l2j.gameserver.util.Util;
import net.sf.l2j.util.Rnd;
// Referenced classes of package net.sf.l2j.gameserver.clientpackets:
// L2GameClientPacket
public final class RequestEnchantItem extends L2GameClientPacket
{
public RequestEnchantItem()
{
}
protected void readImpl()
{
_objectId = readD();
}
protected void runImpl()
{
L2PcInstance activeChar;
L2ItemInstance item;
boolean blessedScroll;
int crystalId;
label0:
{
activeChar = ((L2GameClient)getClient()).getActiveChar();
if(activeChar == null || _objectId == 0)
return;
activeChar.cancelActiveTrade();
item = activeChar.getInventory().getItemByObjectId(_objectId);
L2ItemInstance scroll = activeChar.getActiveEnchantItem();
activeChar.setActiveEnchantItem(null);
if(item == null || scroll == null)
return;
if(item.getItem().getItemType() == L2WeaponType.ROD || item.getItemId() >= 6611 && item.getItemId() <= 6621 || item.isShadowItem())
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}
if(item.isWear())
{
Util.handleIllegalPlayerAction(activeChar, (new StringBuilder()).append("Player ").append(activeChar.getName()).append(" tried to enchant a weared Item").toString(), 2);
return;
}
int itemType2 = item.getItem().getType2();
boolean enchantItem = false;
blessedScroll = false;
boolean blesseddScroll = false;
boolean crystallScroll = false;
crystalId = 0;
switch(item.getItem().getCrystalType())
{
case 4: // '\004'
crystalId = 1461;
switch(scroll.getItemId())
{
case 729:
case 731:
case 6569:
if(itemType2 == 0)
enchantItem = true;
break;
case 730:
case 732:
case 6570:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
case 3: // '\003'
crystalId = 1460;
switch(scroll.getItemId())
{
case 947:
case 949:
case 6571:
if(itemType2 == 0)
enchantItem = true;
break;
case 948:
case 950:
case 6572:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
case 2: // '\002'
crystalId = 1459;
switch(scroll.getItemId())
{
case 951:
case 953:
case 6573:
if(itemType2 == 0)
enchantItem = true;
break;
case 952:
case 954:
case 6574:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
case 1: // '\001'
crystalId = 1458;
switch(scroll.getItemId())
{
case 955:
case 957:
case 6575:
if(itemType2 == 0)
enchantItem = true;
break;
case 956:
case 958:
case 6576:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
case 5: // '\005'
crystalId = 1462;
switch(scroll.getItemId())
{
default:
break;
case 959:
case 961:
case 6577:
if(itemType2 == 0)
enchantItem = true;
break;
case 960:
case 962:
case 6578:
if(itemType2 == 1 || itemType2 == 2)
enchantItem = true;
break;
}
break;
}
if(!enchantItem)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}
if(scroll.getItemId() >= 6569 && scroll.getItemId() <= 6578)
{
blesseddScroll = true;
blessedScroll = true;
} else
{
int arr$[] = CRYSTAL_SCROLLS;
int len$ = arr$.length;
int i$ = 0;
do
{
if(i$ >= len$)
break;
int crystalscroll = arr$[i$];
if(scroll.getItemId() == crystalscroll)
{
crystallScroll = true;
blessedScroll = true;
break;
}
i$++;
} while(true);
}
scroll = activeChar.getInventory().destroyItem("Enchant", scroll, activeChar, item);
if(scroll == null)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_ITEMS));
Util.handleIllegalPlayerAction(activeChar, (new StringBuilder()).append("Player ").append(activeChar.getName()).append(" tried to enchant with a scroll he doesnt have").toString(), Config.DEFAULT_PUNISH);
return;
}
int chance = 0;
int maxEnchantLevel = 0;
if(item.getItem().getType2() == 0)
{
if(item.getEnchantLevel() < 10 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_WEAPON;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_WEAPON_1015;
else
if(item.getEnchantLevel() > 15 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_WEAPON_16;
else
if(item.getEnchantLevel() < 10 && blesseddScroll)
chance = Config.BLESSED_CHANCE_WEAPON;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && blesseddScroll)
chance = Config.BLESSED_CHANCE_WEAPON_1015;
else
if(item.getEnchantLevel() > 15 && blesseddScroll)
chance = Config.BLESSED_CHANCE_WEAPON_16;
else
if(item.getEnchantLevel() < 10 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_WEAPON;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_WEAPON_1015;
else
if(item.getEnchantLevel() > 15 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_WEAPON_16;
maxEnchantLevel = Config.ENCHANT_MAX_WEAPON;
if(Config.ENABLE_MODIFY_ENCHANT_CHANCE_WEAPON && !blesseddScroll && !crystallScroll && Config.ENCHANT_CHANCE_LIST_WEAPON.containsKey(Integer.valueOf(item.getEnchantLev
el())))
chance = ((Integer)Config.ENCHANT_CHANCE_LIST_WEAPON.get(Integer.valueOf(item.getEnchantL
evel()))).intValue();
} else
if(item.getItem().getType2() == 1)
{
if(item.getEnchantLevel() < 10 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_ARMOR;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_ARMOR_1015;
else
if(item.getEnchantLevel() > 15 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_ARMOR_16;
else
if(item.getEnchantLevel() < 10 && blesseddScroll)
chance = Config.BLESSED_CHANCE_ARMOR;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && blesseddScroll)
chance = Config.BLESSED_CHANCE_ARMOR_1015;
else
if(item.getEnchantLevel() > 15 && blesseddScroll)
chance = Config.BLESSED_CHANCE_ARMOR_16;
else
if(item.getEnchantLevel() < 10 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_ARMOR;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_ARMOR_1015;
else
if(item.getEnchantLevel() > 15 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_ARMOR_16;
maxEnchantLevel = Config.ENCHANT_MAX_ARMOR;
if(Config.ENABLE_MODIFY_ENCHANT_CHANCE_ARMOR && !blesseddScroll && !crystallScroll && Config.ENCHANT_CHANCE_LIST_ARMOR.containsKey(Integer.valueOf(item.getEnchantLeve
l())))
chance = ((Integer)Config.ENCHANT_CHANCE_LIST_ARMOR.get(Integer.valueOf(item.getEnchantLe
vel()))).intValue();
} else
if(item.getItem().getType2() == 2)
{
if(item.getEnchantLevel() < 10 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_JEWELRY;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_JEWELRY_1015;
else
if(item.getEnchantLevel() > 15 && !blesseddScroll && !crystallScroll)
chance = Config.ENCHANT_CHANCE_JEWELRY_16;
else
if(item.getEnchantLevel() < 10 && blesseddScroll)
chance = Config.BLESSED_CHANCE_JEWELRY;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && blesseddScroll)
chance = Config.BLESSED_CHANCE_JEWELRY_1015;
else
if(item.getEnchantLevel() > 15 && blesseddScroll)
chance = Config.BLESSED_CHANCE_JEWELRY_16;
else
if(item.getEnchantLevel() < 10 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_JEWELRY;
else
if(item.getEnchantLevel() < 16 && item.getEnchantLevel() > 9 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_JEWELRY_1015;
else
if(item.getEnchantLevel() > 15 && crystallScroll)
chance = Config.CRYSTAL_CHANCE_JEWELRY_16;
maxEnchantLevel = Config.ENCHANT_MAX_JEWELRY;
if(Config.ENABLE_MODIFY_ENCHANT_CHANCE_JEWELRY && !blesseddScroll && !crystallScroll && Config.ENCHANT_CHANCE_LIST_JEWELRY.containsKey(Integer.valueOf(item.getEnchantLe
vel())))
chance = ((Integer)Config.ENCHANT_CHANCE_LIST_JEWELRY.get(Integer.valueOf(item.getEnchant
Level()))).intValue();
}
if(item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX || item.getItem().getBodyPart() == 32768 && item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX_FULL)
chance = 100;
if(item.getOwnerId() != activeChar.getObjectId() || item.getEnchantLevel() >= maxEnchantLevel && maxEnchantLevel != 0)
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
return;
}
if(Rnd.get(100) >= chance)
break MISSING_BLOCK_LABEL_2041;
synchronized(item)
{
if(item.getLocation() == net.sf.l2j.gameserver.model.L2ItemInstance.ItemLocation.INVENTORY || item.getLocation() == net.sf.l2j.gameserver.model.L2ItemInstance.ItemLocation.PAPERDOLL)
break label0;
activeChar.sendPacket(new SystemMessage(SystemMessageId.INAPPROPRIATE_ENCHANT_CONDITION));
}
return;
}
if(item.getEnchantLevel() == 0)
{
SystemMessage sm = new SystemMessage(SystemMessageId.S1_SUCCESSFULLY_ENCHANTED);
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
} else
{
SystemMessage sm = new SystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED);
sm.addNumber(item.getEnchantLevel());
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
}
item.setEnchantLevel(item.getEnchantLevel() + 1);
item.updateDatabase();
l2iteminstance;
JVM INSTR monitorexit ;
break MISSING_BLOCK_LABEL_2536;
exception;
throw exception;
if(!blessedScroll)
{
if(item.getEnchantLevel() > 0)
{
SystemMessage sm = new SystemMessage(SystemMessageId.ENCHANTMENT_FAILED_S1_S2_EVAPORATED);
sm.addNumber(item.getEnchantLevel());
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
} else
{
SystemMessage sm = new SystemMessage(SystemMessageId.ENCHANTMENT_FAILED_S1_EVAPORATED);
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
}
} else
{
SystemMessage sm = new SystemMessage(SystemMessageId.BLESSED_ENCHANT_FAILED);
activeChar.sendPacket(sm);
}
if(!blessedScroll)
{
SystemMessage sm;
if(item.getEnchantLevel() > 0)
{
sm = new SystemMessage(SystemMessageId.EQUIPMENT_S1_S2_REMOVED);
sm.addNumber(item.getEnchantLevel());
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
} else
{
sm = new SystemMessage(SystemMessageId.S1_DISARMED);
sm.addItemName(item.getItemId());
activeChar.sendPacket(sm);
}
if(item.getAugmentation() != null)
item.getAugmentation().removeBoni(activeChar);
L2ItemInstance unequiped[] = activeChar.getInventory().unEquipItemInSlotAndRecord(item.getEquipSlot());
if(item.isEquipped())
{
InventoryUpdate iu = new InventoryUpdate();
for(int i = 0; i < unequiped.length; i++)
iu.addModifiedItem(unequiped[i]);
activeChar.sendPacket(iu);
activeChar.broadcastUserInfo();
}
int count = item.getCrystalCount() - (item.getItem().getCrystalCount() + 1) / 2;
if(count < 1)
count = 1;
L2ItemInstance destroyItem = activeChar.getInventory().destroyItem("Enchant", item, activeChar, null);
if(destroyItem == null)
return;
L2ItemInstance crystals = activeChar.getInventory().addItem("Enchant", crystalId, count, activeChar, destroyItem);
sm = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
sm.addItemName(crystals.getItemId());
sm.addNumber(count);
activeChar.sendPacket(sm);
if(!Config.FORCE_INVENTORY_UPDATE)
{
InventoryUpdate iu = new InventoryUpdate();
if(destroyItem.getCount() == 0)
iu.addRemovedItem(destroyItem);
else
iu.addModifiedItem(destroyItem);
iu.addItem(crystals);
activeChar.sendPacket(iu);
} else
{
activeChar.sendPacket(new ItemList(activeChar, true));
}
StatusUpdate su = new StatusUpdate(activeChar.getObjectId());
su.addAttribute(14, activeChar.getCurrentLoad());
activeChar.sendPacket(su);
activeChar.broadcastUserInfo();
L2World world = L2World.getInstance();
world.removeObject(destroyItem);
} else
{
item.setEnchantLevel(Config.EnchantStartingPoint);
item.updateDatabase();
}
SystemMessage sm = null;
StatusUpdate su = new StatusUpdate(activeChar.getObjectId());
su.addAttribute(14, activeChar.getCurrentLoad());
activeChar.sendPacket(su);
su = null;
activeChar.sendPacket(new EnchantResult(item.getEnchantLevel()));
activeChar.sendPacket(new ItemList(activeChar, false));
activeChar.broadcastUserInfo();
return;
}
public String getType()
{
return "[C] 58 RequestEnchantItem";
}
protected static final Logger _log = Logger.getLogger(net/sf/l2j/gameserver/model/Inventory.getName());
private static final String _C__58_REQUESTENCHANTITEM = "[C] 58 RequestEnchantItem";
private static final int CRYSTAL_SCROLLS[] = {
731, 732, 949, 950, 953, 954, 957, 958, 961, 962
};
private int _objectId;
}
ты файл открыть сможешь, но отредактировать без исходников ты не-сможеш .
0
· 03.08.2009, 16:55
Trosha: вот мне надо чтобы точка спадала на +10, и не могу найти где прописать...
Ты должен найти кусок кода такого вида:
Код
если (блес скролл) {
неудачная заточка;
установить значение заточки на 0;
}
неудачная заточка;
установить значение заточки на 0;
}
В L2jOfficial, например, так:
Цитата
if (scrollTemplate.isBlessed())
{
// blessed enchant - clear enchant value
SystemMessage sm = new SystemMessage(SystemMessageId.BLESSED_ENCHANT_FAILED);
activeChar.sendPacket(sm);
item.setEnchantLevel(0);
item.updateDatabase();
activeChar.sendPacket(new EnchantResult(3, 0, 0));
}
{
// blessed enchant - clear enchant value
SystemMessage sm = new SystemMessage(SystemMessageId.BLESSED_ENCHANT_FAILED);
activeChar.sendPacket(sm);
item.setEnchantLevel(0);
item.updateDatabase();
activeChar.sendPacket(new EnchantResult(3, 0, 0));
}
То есть, ищи setEnchantLevel в исходнике.
You can't feeling! No you can't feeling! And you can't feeling!
— People = Shit
0
Тема закрыта для ответов


![-=[BloodKill]=-](/uploads/fotos/av-39301.jpg)





