Quellcode durchsuchen

BETA: Update for [5083] :
* Some Javadocs added/fixed.
* Minor typo fixed in Combat Flag, thanks jurchiks for report.
* Format and cleanup for some files.
* Deleted empty folder.

Zoey76 vor 13 Jahren
Ursprung
Commit
53a9c2f447

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/instancemanager/FortSiegeManager.java

@@ -391,7 +391,7 @@ public class FortSiegeManager
 		
 		for (CombatFlag cf : fcf)
 		{
-			if (cf.getPlayerOnjectId() == player.getObjectId())
+			if (cf.getPlayerObjectId() == player.getObjectId())
 			{
 				cf.dropIt();
 				if (fort.getSiege().getIsInProgress())

+ 14 - 16
L2J_Server_BETA/java/com/l2jserver/gameserver/model/CombatFlag.java

@@ -23,28 +23,24 @@ import com.l2jserver.gameserver.network.serverpackets.InventoryUpdate;
 import com.l2jserver.gameserver.network.serverpackets.ItemList;
 import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
 
+@SuppressWarnings("unused")
 public class CombatFlag
 {
-	//private static final Logger _log = Logger.getLogger(CombatFlag.class.getName());
+	// private static final Logger _log = Logger.getLogger(CombatFlag.class.getName());
 	
-	protected L2PcInstance _player = null;
+	private L2PcInstance _player = null;
 	private int _playerId = 0;
 	private L2ItemInstance _item = null;
-	private Location _location;
 	private L2ItemInstance _itemInstance;
-	private int _itemId;
+	private final Location _location;
+	private final int _itemId;
+	private final int _heading;
+	private final int _fortId;
 	
-	@SuppressWarnings("unused")
-	private int _heading;
-	@SuppressWarnings("unused")
-	private int _fortId;
-	
-	// =========================================================
-	// Constructor
 	public CombatFlag(int fort_id, int x, int y, int z, int heading, int item_id)
 	{
 		_fortId = fort_id;
-		_location = new Location(x,y,z,heading);
+		_location = new Location(x, y, z, heading);
 		_heading = heading;
 		_itemId = item_id;
 	}
@@ -53,7 +49,7 @@ public class CombatFlag
 	{
 		// Init the dropped L2ItemInstance and add it in the world as a visible object at the position where mob was last
 		_itemInstance = ItemTable.getInstance().createItem("Combat", _itemId, 1, null, null);
-		_itemInstance.dropMe(null, _location.getX(), _location.getY(),  _location.getZ());
+		_itemInstance.dropMe(null, _location.getX(), _location.getY(), _location.getZ());
 	}
 	
 	public synchronized void unSpawnMe()
@@ -95,8 +91,10 @@ public class CombatFlag
 			iu.addItem(_item);
 			_player.sendPacket(iu);
 		}
-		else _player.sendPacket(new ItemList(_player, false));
-		
+		else
+		{
+			_player.sendPacket(new ItemList(_player, false));
+		}
 		// Refresh player stats
 		_player.broadcastUserInfo();
 		_player.setCombatFlagEquipped(true);
@@ -116,7 +114,7 @@ public class CombatFlag
 		_playerId = 0;
 	}
 	
-	public int getPlayerOnjectId()
+	public int getPlayerObjectId()
 	{
 		return _playerId;
 	}

+ 30 - 30
L2J_Server_BETA/java/com/l2jserver/gameserver/model/item/L2Armor.java

@@ -29,23 +29,18 @@ import com.l2jserver.util.StringUtil;
 
 /**
  * This class is dedicated to the management of armors.
- *
- * @version $Revision: 1.2.2.1.2.6 $ $Date: 2005/03/27 15:30:10 $
  */
 public final class L2Armor extends L2Item
 {
-	private SkillHolder _enchant4Skill = null; // skill that activates when armor is enchanted +4
-	// private final String[] _skill;
+	/**
+	 * Skill that activates when armor is enchanted +4.
+	 */
+	private SkillHolder _enchant4Skill = null;
 	private L2ArmorType _type;
 	
 	/**
-	 * Constructor for Armor.<BR><BR>
-	 * <U><I>Variables filled :</I></U><BR>
-	 * <LI>_avoidModifier</LI>
-	 * <LI>_pDef & _mDef</LI>
-	 * <LI>_mpBonus & _hpBonus</LI>
-	 * <LI>enchant4Skill</LI>
-	 * @param set : StatsSet designating the set of couples (key,value) caracterizing the armor
+	 * Constructor for Armor.
+	 * @param set the StatsSet designating the set of couples (key,value) characterizing the armor.
 	 * @see L2Item constructor
 	 */
 	public L2Armor(StatsSet set)
@@ -54,18 +49,17 @@ public final class L2Armor extends L2Item
 		_type = L2ArmorType.valueOf(set.getString("armor_type", "none").toUpperCase());
 		
 		int _bodyPart = getBodyPart();
-		if (_bodyPart == L2Item.SLOT_NECK || _bodyPart == L2Item.SLOT_HAIR || _bodyPart == L2Item.SLOT_HAIR2
-				|| _bodyPart == L2Item.SLOT_HAIRALL || (_bodyPart & L2Item.SLOT_L_EAR) != 0 || (_bodyPart & L2Item.SLOT_L_FINGER) != 0
-				|| (_bodyPart & L2Item.SLOT_R_BRACELET) != 0 || (_bodyPart & L2Item.SLOT_L_BRACELET) != 0
-				|| (_bodyPart & L2Item.SLOT_BACK) != 0 )
+		if ((_bodyPart == L2Item.SLOT_NECK) || (_bodyPart == L2Item.SLOT_HAIR) || (_bodyPart == L2Item.SLOT_HAIR2) || (_bodyPart == L2Item.SLOT_HAIRALL) || ((_bodyPart & L2Item.SLOT_L_EAR) != 0) || ((_bodyPart & L2Item.SLOT_L_FINGER) != 0) || ((_bodyPart & L2Item.SLOT_R_BRACELET) != 0) || ((_bodyPart & L2Item.SLOT_L_BRACELET) != 0) || ((_bodyPart & L2Item.SLOT_BACK) != 0))
 		{
 			_type1 = L2Item.TYPE1_WEAPON_RING_EARRING_NECKLACE;
 			_type2 = L2Item.TYPE2_ACCESSORY;
 		}
 		else
 		{
-			if (_type == L2ArmorType.NONE && getBodyPart() == L2Item.SLOT_L_HAND) // retail define shield as NONE
+			if ((_type == L2ArmorType.NONE) && (getBodyPart() == L2Item.SLOT_L_HAND))
+			{
 				_type = L2ArmorType.SHIELD;
+			}
 			_type1 = L2Item.TYPE1_SHIELD_ARMOR;
 			_type2 = L2Item.TYPE2_SHIELD_ARMOR;
 		}
@@ -75,7 +69,7 @@ public final class L2Armor extends L2Item
 		{
 			String[] info = skill.split("-");
 			
-			if (info != null && info.length == 2)
+			if ((info != null) && (info.length == 2))
 			{
 				int id = 0;
 				int level = 0;
@@ -86,18 +80,19 @@ public final class L2Armor extends L2Item
 				}
 				catch (Exception nfe)
 				{
-					// Incorrect syntax, dont add new skill
-					_log.info(StringUtil.concat("> Couldnt parse ", skill, " in armor enchant skills! item ",this.toString()));
+					// Incorrect syntax, don't add new skill
+					_log.info(StringUtil.concat("> Couldnt parse ", skill, " in armor enchant skills! item ", toString()));
 				}
-				if (id > 0 && level > 0)
+				if ((id > 0) && (level > 0))
+				{
 					_enchant4Skill = new SkillHolder(id, level);
+				}
 			}
-		}	
+		}
 	}
 	
 	/**
-	 * Returns the type of the armor.
-	 * @return L2ArmorType
+	 * @return the type of the armor.
 	 */
 	@Override
 	public L2ArmorType getItemType()
@@ -106,8 +101,7 @@ public final class L2Armor extends L2Item
 	}
 	
 	/**
-	 * Returns the ID of the item after applying the mask.
-	 * @return int : ID of the item
+	 * @return the ID of the item after applying the mask.
 	 */
 	@Override
 	public final int getItemMask()
@@ -116,26 +110,29 @@ public final class L2Armor extends L2Item
 	}
 	
 	/**
-	 * @return skill that player get when has equipped armor +4  or more
+	 * @return skill that player get when has equipped armor +4 or more
 	 */
 	public L2Skill getEnchant4Skill()
 	{
 		if (_enchant4Skill == null)
+		{
 			return null;
+		}
 		return _enchant4Skill.getSkill();
 	}
 	
 	/**
-	 * Returns array of Func objects containing the list of functions used by the armor
 	 * @param instance : L2ItemInstance pointing out the armor
 	 * @param player : L2Character pointing out the player
-	 * @return Func[] : array of functions
+	 * @return array of Func objects containing the list of functions used by the armor
 	 */
 	@Override
 	public Func[] getStatFuncs(L2ItemInstance instance, L2Character player)
 	{
-		if (_funcTemplates == null || _funcTemplates.length == 0)
+		if ((_funcTemplates == null) || (_funcTemplates.length == 0))
+		{
 			return _emptyFunctionSet;
+		}
 		
 		ArrayList<Func> funcs = new ArrayList<Func>(_funcTemplates.length);
 		
@@ -145,11 +142,14 @@ public final class L2Armor extends L2Item
 		
 		Func f;
 		
-		for (FuncTemplate t : _funcTemplates) {
+		for (FuncTemplate t : _funcTemplates)
+		{
 			
 			f = t.getFunc(env, instance);
 			if (f != null)
+			{
 				funcs.add(f);
+			}
 		}
 		
 		return funcs.toArray(new Func[funcs.size()]);

+ 32 - 29
L2J_Server_BETA/java/com/l2jserver/gameserver/model/item/L2EtcItem.java

@@ -25,12 +25,9 @@ import com.l2jserver.util.StringUtil;
 
 /**
  * This class is dedicated to the management of EtcItem.
- *
- * @version $Revision: 1.2.2.1.2.3 $ $Date: 2005/03/27 15:30:10 $
  */
-public final class L2EtcItem  extends L2Item
+public final class L2EtcItem extends L2Item
 {
-	// private final String[] _skill;
 	private String _handler;
 	private final int _sharedReuseGroup;
 	private L2EtcItemType _type;
@@ -39,8 +36,8 @@ public final class L2EtcItem  extends L2Item
 	
 	/**
 	 * Constructor for EtcItem.
-	 * @see L2Item constructor
 	 * @param set : StatsSet designating the set of couples (key,value) for description of the Etc
+	 * @see L2Item constructor
 	 */
 	public L2EtcItem(StatsSet set)
 	{
@@ -61,21 +58,27 @@ public final class L2EtcItem  extends L2Item
 		}
 		
 		if (is_ex_immediate_effect())
+		{
 			_type = L2EtcItemType.HERB;
+		}
 		
 		_type1 = L2Item.TYPE1_ITEM_QUESTITEM_ADENA;
 		_type2 = L2Item.TYPE2_OTHER; // default is other
 		
 		if (isQuestItem())
+		{
 			_type2 = L2Item.TYPE2_QUEST;
-		else if (getItemId() == PcInventory.ADENA_ID || getItemId() == PcInventory.ANCIENT_ADENA_ID)
+		}
+		else if ((getItemId() == PcInventory.ADENA_ID) || (getItemId() == PcInventory.ANCIENT_ADENA_ID))
+		{
 			_type2 = L2Item.TYPE2_MONEY;
+		}
 		
-		_handler = set.getString("handler", null);  // ! null !
+		_handler = set.getString("handler", null); // ! null !
 		_sharedReuseGroup = set.getInteger("shared_reuse_group", -1);
 		_isBlessed = set.getBool("blessed", false);
 		
-		//extractable
+		// Extractable
 		String capsuled_items = set.getString("capsuled_items", null);
 		if (capsuled_items != null)
 		{
@@ -84,11 +87,13 @@ public final class L2EtcItem  extends L2Item
 			for (String part : split)
 			{
 				if (part.trim().isEmpty())
+				{
 					continue;
-				String[] data =  part.split(",");
+				}
+				String[] data = part.split(",");
 				if (data.length != 4)
 				{
-					_log.info(StringUtil.concat("> Couldnt parse ", part, " in capsuled_items! item ", this.toString()));
+					_log.info(StringUtil.concat("> Couldnt parse ", part, " in capsuled_items! item ", toString()));
 					continue;
 				}
 				int itemId = Integer.parseInt(data[0]);
@@ -97,7 +102,7 @@ public final class L2EtcItem  extends L2Item
 				double chance = Double.parseDouble(data[3]);
 				if (max < min)
 				{
-					_log.info(StringUtil.concat("> Max amount < Min amount in ", part, ", item ",this.toString()));
+					_log.info(StringUtil.concat("> Max amount < Min amount in ", part, ", item ", toString()));
 					continue;
 				}
 				L2ExtractableProduct product = new L2ExtractableProduct(itemId, min, max, chance);
@@ -105,18 +110,21 @@ public final class L2EtcItem  extends L2Item
 			}
 			((ArrayList<?>) _extractableItems).trimToSize();
 			
-			//check for handler
+			// check for handler
 			if (_handler == null)
-				//_log.warning("Item "+this+ " define capsuled_items but missing handler.");
+			{
+				_log.warning("Item " + this + " define capsuled_items but missing handler.");
 				_handler = "ExtractableItems";
+			}
 		}
-		else 
+		else
+		{
 			_extractableItems = null;
+		}
 	}
 	
 	/**
-	 * Returns the type of Etc Item
-	 * @return L2EtcItemType
+	 * @return the type of Etc Item.
 	 */
 	@Override
 	public L2EtcItemType getItemType()
@@ -125,8 +133,7 @@ public final class L2EtcItem  extends L2Item
 	}
 	
 	/**
-	 * Returns if the item is consumable
-	 * @return boolean
+	 * @return {@code true} if the item is consumable, {@code false} otherwise.
 	 */
 	@Override
 	public final boolean isConsumable()
@@ -135,8 +142,7 @@ public final class L2EtcItem  extends L2Item
 	}
 	
 	/**
-	 * Returns the ID of the Etc item after applying the mask.
-	 * @return int : ID of the EtcItem
+	 * @return the ID of the Etc item after applying the mask.
 	 */
 	@Override
 	public int getItemMask()
@@ -145,8 +151,7 @@ public final class L2EtcItem  extends L2Item
 	}
 	
 	/**
-	 * Return handler name. null if no handler for item
-	 * @return String
+	 * @return the handler name, null if no handler for item.
 	 */
 	public String getHandlerName()
 	{
@@ -154,8 +159,7 @@ public final class L2EtcItem  extends L2Item
 	}
 	
 	/**
-	 * 
-	 * @return
+	 * @return the shared reuse time group.
 	 */
 	public int getSharedReuseGroup()
 	{
@@ -163,19 +167,18 @@ public final class L2EtcItem  extends L2Item
 	}
 	
 	/**
-	 * 
-	 * @return
+	 * @return {@code true} if the item is blessed, {@code false} otherwise.
 	 */
 	public final boolean isBlessed()
 	{
 		return _isBlessed;
 	}
-
+	
 	/**
-	 * @return the _extractable_items
+	 * @return the extractable items list.
 	 */
 	public List<L2ExtractableProduct> getExtractableItems()
 	{
 		return _extractableItems;
 	}
-}
+}

+ 43 - 52
L2J_Server_BETA/java/com/l2jserver/gameserver/model/item/L2WarehouseItem.java

@@ -19,34 +19,31 @@ import com.l2jserver.gameserver.model.item.type.L2ItemType;
 
 /**
  * This class contains L2ItemInstance<BR>
- * Use to sort L2ItemInstance of :
- * <LI>L2Armor</LI>
- * <LI>L2EtcItem</LI>
- * <LI>L2Weapon</LI>
+ * Use to sort L2ItemInstance of : <LI>L2Armor</LI> <LI>L2EtcItem</LI> <LI>L2Weapon</LI>
  * @version $Revision: 1.7.2.2.2.5 $ $Date: 2005/04/06 18:25:18 $
  */
 public class L2WarehouseItem
 {
-	private L2Item _item;
-	private int _object;
-	private long _count;
-	private int _owner;
-	private int _locationSlot;
-	private int _enchant;
-	private int _grade;
+	private final L2Item _item;
+	private final int _object;
+	private final long _count;
+	private final int _owner;
+	private final int _locationSlot;
+	private final int _enchant;
+	private final int _grade;
 	private boolean _isAugmented;
 	private int _augmentationId;
-	private int _customType1;
-	private int _customType2;
-	private int _mana;
+	private final int _customType1;
+	private final int _customType2;
+	private final int _mana;
 	
 	private int _elemAtkType = -2;
 	private int _elemAtkPower = 0;
-	private int[] _elemDefAttr =
+	private final int[] _elemDefAttr =
 	{
-			0, 0, 0, 0, 0, 0
+		0, 0, 0, 0, 0, 0
 	};
-	private int _time;
+	private final int _time;
 	
 	public L2WarehouseItem(L2ItemInstance item)
 	{
@@ -65,19 +62,22 @@ public class L2WarehouseItem
 			_augmentationId = item.getAugmentation().getAugmentationId();
 		}
 		else
+		{
 			_isAugmented = false;
+		}
 		_mana = item.getMana();
-		_time = item.isTimeLimitedItem() ? (int) (item.getRemainingTime()/1000) : -1;
+		_time = item.isTimeLimitedItem() ? (int) (item.getRemainingTime() / 1000) : -1;
 		
 		_elemAtkType = item.getAttackElementType();
 		_elemAtkPower = item.getAttackElementPower();
 		for (byte i = 0; i < 6; i++)
+		{
 			_elemDefAttr[i] = item.getElementDefAttr(i);
+		}
 	}
 	
 	/**
-	 * Returns the item.
-	 * @return L2Item
+	 * @return the item.
 	 */
 	public L2Item getItem()
 	{
@@ -85,8 +85,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns the unique objectId
-	 * @return int
+	 * @return the unique objectId.
 	 */
 	public final int getObjectId()
 	{
@@ -94,8 +93,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns the owner
-	 * @return int
+	 * @return the owner.
 	 */
 	public final int getOwnerId()
 	{
@@ -103,8 +101,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns the LocationSlot
-	 * @return int
+	 * @return the location slot.
 	 */
 	public final int getLocationSlot()
 	{
@@ -112,8 +109,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns the count
-	 * @return int
+	 * @return the count.
 	 */
 	public final long getCount()
 	{
@@ -121,8 +117,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns the first type
-	 * @return int
+	 * @return the first type.
 	 */
 	public final int getType1()
 	{
@@ -130,8 +125,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns the second type
-	 * @return int
+	 * @return the second type.
 	 */
 	public final int getType2()
 	{
@@ -139,8 +133,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns the second type
-	 * @return int
+	 * @return the second type.
 	 */
 	public final L2ItemType getItemType()
 	{
@@ -148,8 +141,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns the ItemId
-	 * @return int
+	 * @return the ItemId.
 	 */
 	public final int getItemId()
 	{
@@ -157,8 +149,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns the part of body used with this item
-	 * @return int
+	 * @return the part of body used with this item.
 	 */
 	public final int getBodyPart()
 	{
@@ -166,8 +157,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns the enchant level
-	 * @return int
+	 * @return the enchant level.
 	 */
 	public final int getEnchantLevel()
 	{
@@ -175,8 +165,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns the item grade
-	 * @return int
+	 * @return the item grade
 	 */
 	public final int getItemGrade()
 	{
@@ -184,8 +173,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns true if it is a weapon
-	 * @return boolean
+	 * @return {@code true} if the item is a weapon, {@code false} otherwise.
 	 */
 	public final boolean isWeapon()
 	{
@@ -193,8 +181,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns true if it is an armor
-	 * @return boolean
+	 * @return {@code true} if the item is an armor, {@code false} otherwise.
 	 */
 	public final boolean isArmor()
 	{
@@ -202,8 +189,7 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns true if it is an EtcItem
-	 * @return boolean
+	 * @return {@code true} if the item is an etc item, {@code false} otherwise.
 	 */
 	public final boolean isEtcItem()
 	{
@@ -211,19 +197,24 @@ public class L2WarehouseItem
 	}
 	
 	/**
-	 * Returns the name of the item
-	 * @return String
+	 * @return the name of the item
 	 */
 	public String getItemName()
 	{
 		return _item.getName();
 	}
 	
+	/**
+	 * @return {@code true} if the item is augmented, {@code false} otherwise.
+	 */
 	public boolean isAugmented()
 	{
 		return _isAugmented;
 	}
 	
+	/**
+	 * @return the augmentation If.
+	 */
 	public int getAugmentationId()
 	{
 		return _augmentationId;
@@ -273,9 +264,9 @@ public class L2WarehouseItem
 	{
 		return _time;
 	}
+	
 	/**
-	 * Returns the name of the item
-	 * @return String
+	 * @return the name of the item
 	 */
 	@Override
 	public String toString()

+ 94 - 67
L2J_Server_BETA/java/com/l2jserver/gameserver/model/item/L2Weapon.java

@@ -44,8 +44,6 @@ import com.l2jserver.util.StringUtil;
 
 /**
  * This class is dedicated to the management of weapons.
- *
- * @version $Revision: 1.4.2.3.2.5 $ $Date: 2005/04/02 15:57:51 $
  */
 public final class L2Weapon extends L2Item
 {
@@ -55,9 +53,11 @@ public final class L2Weapon extends L2Item
 	private final int _soulShotCount;
 	private final int _spiritShotCount;
 	private final int _mpConsume;
-	private SkillHolder _enchant4Skill = null; // skill that activates when item is enchanted +4 (for duals)
+	/**
+	 * Skill that activates when item is enchanted +4 (for duals).
+	 */
+	private SkillHolder _enchant4Skill = null;
 	private final int _changeWeaponId;
-	// private final String[] _skill;
 	
 	// Attached skills for Special Abilities
 	private SkillHolder _skillsOnCast;
@@ -72,17 +72,8 @@ public final class L2Weapon extends L2Item
 	private final boolean _useWeaponSkillsOnly;
 	
 	/**
-	 * Constructor for Weapon.<BR><BR>
-	 * <U><I>Variables filled :</I></U><BR>
-	 * <LI>_soulShotCount & _spiritShotCount</LI>
-	 * <LI>_pDam & _mDam & _rndDam</LI>
-	 * <LI>_critical</LI>
-	 * <LI>_hitModifier</LI>
-	 * <LI>_avoidModifier</LI>
-	 * <LI>_shieldDes & _shieldDefRate</LI>
-	 * <LI>_atkSpeed & _AtkReuse</LI>
-	 * <LI>_mpConsume</LI>
-	 * @param set : StatsSet designating the set of couples (key,value) characterizing the armor
+	 * Constructor for Weapon.
+	 * @param set the StatsSet designating the set of couples (key,value) characterizing the weapon.
 	 * @see L2Item constructor
 	 */
 	public L2Weapon(StatsSet set)
@@ -103,7 +94,7 @@ public final class L2Weapon extends L2Item
 		{
 			String[] info = skill.split("-");
 			
-			if (info != null && info.length == 2)
+			if ((info != null) && (info.length == 2))
 			{
 				int id = 0;
 				int level = 0;
@@ -115,10 +106,12 @@ public final class L2Weapon extends L2Item
 				catch (Exception nfe)
 				{
 					// Incorrect syntax, dont add new skill
-					_log.info(StringUtil.concat("> Couldnt parse ", skill, " in weapon enchant skills! item ", this.toString()));
+					_log.info(StringUtil.concat("> Couldnt parse ", skill, " in weapon enchant skills! item ", toString()));
 				}
-				if (id > 0 && level > 0)
+				if ((id > 0) && (level > 0))
+				{
 					_enchant4Skill = new SkillHolder(id, level);
+				}
 			}
 		}
 		
@@ -127,7 +120,7 @@ public final class L2Weapon extends L2Item
 		{
 			String[] info = skill.split("-");
 			String infochance = set.getString("oncast_chance", null);
-			if (info != null && info.length == 2)
+			if ((info != null) && (info.length == 2))
 			{
 				int id = 0;
 				int level = 0;
@@ -137,29 +130,32 @@ public final class L2Weapon extends L2Item
 					id = Integer.parseInt(info[0]);
 					level = Integer.parseInt(info[1]);
 					if (infochance != null)
+					{
 						chance = Integer.parseInt(infochance);
+					}
 				}
 				catch (Exception nfe)
 				{
 					// Incorrect syntax, dont add new skill
-					_log.info(StringUtil.concat("> Couldnt parse ", skill, " in weapon oncast skills! item ", this.toString()));
+					_log.info(StringUtil.concat("> Couldnt parse ", skill, " in weapon oncast skills! item ", toString()));
 				}
-				if (id > 0 && level > 0 && chance > 0)
+				if ((id > 0) && (level > 0) && (chance > 0))
 				{
 					_skillsOnCast = new SkillHolder(id, level);
 					if (infochance != null)
+					{
 						_skillsOnCastCondition = new ConditionGameChance(chance);
+					}
 				}
 			}
 		}
 		
-
 		skill = set.getString("oncrit_skill", null);
 		if (skill != null)
 		{
 			String[] info = skill.split("-");
 			String infochance = set.getString("oncrit_chance", null);
-			if (info != null && info.length == 2)
+			if ((info != null) && (info.length == 2))
 			{
 				int id = 0;
 				int level = 0;
@@ -169,32 +165,34 @@ public final class L2Weapon extends L2Item
 					id = Integer.parseInt(info[0]);
 					level = Integer.parseInt(info[1]);
 					if (infochance != null)
+					{
 						chance = Integer.parseInt(infochance);
+					}
 				}
 				catch (Exception nfe)
 				{
 					// Incorrect syntax, dont add new skill
-					_log.info(StringUtil.concat("> Couldnt parse ", skill, " in weapon oncrit skills! item ", this.toString()));
+					_log.info(StringUtil.concat("> Couldnt parse ", skill, " in weapon oncrit skills! item ", toString()));
 				}
-				if (id > 0 && level > 0 && chance > 0)
+				if ((id > 0) && (level > 0) && (chance > 0))
 				{
 					_skillsOnCrit = new SkillHolder(id, level);
 					if (infochance != null)
+					{
 						_skillsOnCritCondition = new ConditionGameChance(chance);
+					}
 				}
 			}
 		}
 		
 		_changeWeaponId = set.getInteger("change_weaponId", 0);
-		
 		_isForceEquip = set.getBool("isForceEquip", false);
 		_isAttackWeapon = set.getBool("isAttackWeapon", true);
 		_useWeaponSkillsOnly = set.getBool("useWeaponSkillsOnly", false);
 	}
 	
 	/**
-	 * Returns the type of Weapon
-	 * @return L2WeaponType
+	 * @return the type of Weapon
 	 */
 	@Override
 	public L2WeaponType getItemType()
@@ -203,8 +201,7 @@ public final class L2Weapon extends L2Item
 	}
 	
 	/**
-	 * Returns the ID of the Etc item after applying the mask.
-	 * @return int : ID of the Weapon
+	 * @return the ID of the Etc item after applying the mask.
 	 */
 	@Override
 	public int getItemMask()
@@ -213,8 +210,7 @@ public final class L2Weapon extends L2Item
 	}
 	
 	/**
-	 * Returns true if L2Weapon is magic type.
-	 * @return boolean
+	 * @return {@code true} if the weapon is magic, {@code false} otherwise.
 	 */
 	public boolean isMagicWeapon()
 	{
@@ -222,8 +218,7 @@ public final class L2Weapon extends L2Item
 	}
 	
 	/**
-	 * Returns the quantity of SoulShot used.
-	 * @return int
+	 * @return the quantity of SoulShot used.
 	 */
 	public int getSoulShotCount()
 	{
@@ -231,18 +226,15 @@ public final class L2Weapon extends L2Item
 	}
 	
 	/**
-	 * Returns the quatity of SpiritShot used.
-	 * @return int
+	 * @return the quantity of SpiritShot used.
 	 */
 	public int getSpiritShotCount()
 	{
 		return _spiritShotCount;
 	}
 	
-	
 	/**
-	 * Returns the random damage inflicted by the weapon
-	 * @return int
+	 * @return the random damage inflicted by the weapon.
 	 */
 	public int getRandomDamage()
 	{
@@ -250,17 +242,15 @@ public final class L2Weapon extends L2Item
 	}
 	
 	/**
-	 * Return the Reuse Delay of the L2Weapon.<BR><BR>
-	 * @return int
+	 * @return the Reuse Delay of the L2Weapon.
 	 */
 	public int getReuseDelay()
 	{
 		return _reuseDelay;
 	}
-
+	
 	/**
-	 * Returns the MP consumption with the weapon
-	 * @return int
+	 * @return the MP consumption with the weapon.
 	 */
 	public int getMpConsume()
 	{
@@ -268,51 +258,61 @@ public final class L2Weapon extends L2Item
 	}
 	
 	/**
-	 * Returns skill that player get when has equiped weapon +4  or more  (for duals SA)
-	 * @return
+	 * @return the skill that player get when has equipped weapon +4 or more (for duals SA).
 	 */
 	public L2Skill getEnchant4Skill()
 	{
 		if (_enchant4Skill == null)
+		{
 			return null;
+		}
 		return _enchant4Skill.getSkill();
 	}
 	
 	/**
-	 * Returns the Id in wich weapon this weapon can be changed
-	 * @return
+	 * @return the Id in which weapon this weapon can be changed.
 	 */
 	public int getChangeWeaponId()
 	{
 		return _changeWeaponId;
 	}
 	
+	/**
+	 * @return {@code true} if the weapon is force equip, {@code false} otherwise.
+	 */
 	public boolean isForceEquip()
 	{
 		return _isForceEquip;
 	}
 	
+	/**
+	 * @return {@code true} if the weapon is attack weapon, {@code false} otherwise.
+	 */
 	public boolean isAttackWeapon()
 	{
 		return _isAttackWeapon;
 	}
 	
+	/**
+	 * @return {@code true} if the weapon is skills only, {@code false} otherwise.
+	 */
 	public boolean useWeaponSkillsOnly()
 	{
 		return _useWeaponSkillsOnly;
 	}
 	
 	/**
-	 * Returns array of Func objects containing the list of functions used by the weapon
-	 * @param instance : L2ItemInstance pointing out the weapon
-	 * @param player : L2Character pointing out the player
-	 * @return Func[] : array of functions
+	 * @param instance the L2ItemInstance pointing out the weapon.
+	 * @param player the L2Character pointing out the player.
+	 * @return an array of Func objects containing the list of functions used by the weapon.
 	 */
 	@Override
 	public Func[] getStatFuncs(L2ItemInstance instance, L2Character player)
 	{
-		if (_funcTemplates == null || _funcTemplates.length == 0)
+		if ((_funcTemplates == null) || (_funcTemplates.length == 0))
+		{
 			return _emptyFunctionSet;
+		}
 		
 		ArrayList<Func> funcs = new ArrayList<Func>(_funcTemplates.length);
 		
@@ -325,23 +325,26 @@ public final class L2Weapon extends L2Item
 		{
 			f = t.getFunc(env, instance);
 			if (f != null)
+			{
 				funcs.add(f);
+			}
 		}
 		
 		return funcs.toArray(new Func[funcs.size()]);
 	}
 	
 	/**
-	 * Returns effects of skills associated with the item to be triggered onHit.
-	 * @param caster : L2Character pointing out the caster
-	 * @param target : L2Character pointing out the target
-	 * @param crit : boolean tells whether the hit was critical
-	 * @return L2Effect[] : array of effects generated by the skill
+	 * @param caster the L2Character pointing out the caster
+	 * @param target the L2Character pointing out the target
+	 * @param crit the boolean tells whether the hit was critical
+	 * @return the effects of skills associated with the item to be triggered onHit.
 	 */
 	public L2Effect[] getSkillEffects(L2Character caster, L2Character target, boolean crit)
 	{
-		if (_skillsOnCrit == null || !crit)
+		if ((_skillsOnCrit == null) || !crit)
+		{
 			return _emptyEffectSet;
+		}
 		List<L2Effect> effects = new FastList<L2Effect>();
 		
 		if (_skillsOnCritCondition != null)
@@ -351,38 +354,55 @@ public final class L2Weapon extends L2Item
 			env.target = target;
 			env.skill = _skillsOnCrit.getSkill();
 			if (!_skillsOnCritCondition.test(env))
+			{
 				return _emptyEffectSet; // Skill condition not met
+			}
 		}
 		
 		byte shld = Formulas.calcShldUse(caster, target, _skillsOnCrit.getSkill());
 		if (!Formulas.calcSkillSuccess(caster, target, _skillsOnCrit.getSkill(), shld, false, false, false))
+		{
 			return _emptyEffectSet; // These skills should not work on RaidBoss
+		}
 		if (target.getFirstEffect(_skillsOnCrit.getSkill().getId()) != null)
+		{
 			target.getFirstEffect(_skillsOnCrit.getSkill().getId()).exit();
+		}
 		for (L2Effect e : _skillsOnCrit.getSkill().getEffects(caster, target, new Env(shld, false, false, false)))
+		{
 			effects.add(e);
+		}
 		if (effects.isEmpty())
+		{
 			return _emptyEffectSet;
+		}
 		return effects.toArray(new L2Effect[effects.size()]);
 	}
 	
 	/**
-	 * Returns effects of skills associated with the item to be triggered onCast.
-	 * @param caster : L2Character pointing out the caster
-	 * @param target : L2Character pointing out the target
-	 * @param trigger : L2Skill pointing out the skill triggering this action
-	 * @return L2Effect[] : array of effects generated by the skill
+	 * @param caster the L2Character pointing out the caster
+	 * @param target the L2Character pointing out the target
+	 * @param trigger the L2Skill pointing out the skill triggering this action
+	 * @return the effects of skills associated with the item to be triggered onCast.
 	 */
 	public L2Effect[] getSkillEffects(L2Character caster, L2Character target, L2Skill trigger)
 	{
 		if (_skillsOnCast == null)
+		{
 			return _emptyEffectSet;
+		}
 		if (trigger.isOffensive() != _skillsOnCast.getSkill().isOffensive())
+		{
 			return _emptyEffectSet; // Trigger only same type of skill
-		if (trigger.isToggle() && _skillsOnCast.getSkill().getSkillType() == L2SkillType.BUFF)
+		}
+		if (trigger.isToggle() && (_skillsOnCast.getSkill().getSkillType() == L2SkillType.BUFF))
+		{
 			return _emptyEffectSet; // No buffing with toggle skills
-		if (!trigger.isMagic() && _skillsOnCast.getSkill().getSkillType() == L2SkillType.BUFF)
+		}
+		if (!trigger.isMagic() && (_skillsOnCast.getSkill().getSkillType() == L2SkillType.BUFF))
+		{
 			return _emptyEffectSet; // No buffing with not magic skills
+		}
 		
 		if (_skillsOnCastCondition != null)
 		{
@@ -391,12 +411,16 @@ public final class L2Weapon extends L2Item
 			env.target = target;
 			env.skill = _skillsOnCast.getSkill();
 			if (!_skillsOnCastCondition.test(env))
+			{
 				return _emptyEffectSet;
+			}
 		}
 		
 		byte shld = Formulas.calcShldUse(caster, target, _skillsOnCast.getSkill());
 		if (_skillsOnCast.getSkill().isOffensive() && !Formulas.calcSkillSuccess(caster, target, _skillsOnCast.getSkill(), shld, false, false, false))
+		{
 			return _emptyEffectSet;
+		}
 		
 		// Get the skill handler corresponding to the skill type
 		ISkillHandler handler = SkillHandler.getInstance().getHandler(_skillsOnCast.getSkill().getSkillType());
@@ -406,9 +430,13 @@ public final class L2Weapon extends L2Item
 		
 		// Launch the magic skill and calculate its effects
 		if (handler != null)
+		{
 			handler.useSkill(caster, _skillsOnCast.getSkill(), targets);
+		}
 		else
+		{
 			_skillsOnCast.getSkill().useSkill(caster, targets);
+		}
 		
 		// notify quests of a skill use
 		if (caster instanceof L2PcInstance)
@@ -433,5 +461,4 @@ public final class L2Weapon extends L2Item
 		}
 		return _emptyEffectSet;
 	}
-	
 }