Explorar el Código

BETA: Simplifying inventory writing within CharInfo, UserInfo packets.
* Also minor cleanup

Rumen Nikiforov hace 11 años
padre
commit
628cb29a5b

+ 1 - 8
L2J_Server_BETA/java/com/l2jserver/gameserver/model/entity/Hero.java

@@ -932,10 +932,7 @@ public class Hero
 		}
 		catch (SQLException e)
 		{
-			if (_log.isLoggable(Level.SEVERE))
-			{
-				_log.log(Level.SEVERE, "SQL exception while saving DiaryData.", e);
-			}
+			_log.log(Level.SEVERE, "SQL exception while saving DiaryData.", e);
 		}
 	}
 	
@@ -947,10 +944,6 @@ public class Hero
 	public void setHeroMessage(L2PcInstance player, String message)
 	{
 		_heroMessage.put(player.getObjectId(), message);
-		if (player.isDebug())
-		{
-			_log.info("Hero message for player: " + player.getName() + ":[" + player.getObjectId() + "] set to: [" + message + "]");
-		}
 	}
 	
 	/**

+ 0 - 7
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestMagicSkillUse.java

@@ -84,13 +84,6 @@ public final class RequestMagicSkillUse extends L2GameClientPacket
 			return;
 		}
 		
-		if (activeChar.isDebug())
-		{
-			_log.fine("Skill:" + skill.getName() + " level:" + skill.getLevel() + " passive:" + skill.isPassive());
-			_log.fine("Range:" + skill.getCastRange() + " targettype:" + skill.getTargetType() + " power:" + skill.getPower());
-			_log.fine("Reusedelay:" + skill.getReuseDelay() + " hittime:" + skill.getHitTime());
-		}
-		
 		// If Alternate rule Karma punishment is set to true, forbid skill Return to player with Karma
 		if (!Config.ALT_GAME_KARMA_PLAYER_CAN_TELEPORT && (activeChar.getKarma() > 0) && skill.hasEffectType(L2EffectType.TELEPORT))
 		{

+ 0 - 5
L2J_Server_BETA/java/com/l2jserver/gameserver/network/clientpackets/RequestPetUseItem.java

@@ -89,11 +89,6 @@ public final class RequestPetUseItem extends L2GameClientPacket
 			}
 		}
 		
-		if (activeChar.isDebug())
-		{
-			activeChar.sendDebugMessage("Pet tries to use item: " + item);
-		}
-		
 		if (!item.isEquipped() && !item.getItem().checkCondition(pet, pet, true))
 		{
 			return;

+ 112 - 150
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/CharInfo.java

@@ -32,7 +32,6 @@ import com.l2jserver.gameserver.model.itemcontainer.Inventory;
 public class CharInfo extends L2GameServerPacket
 {
 	private final L2PcInstance _activeChar;
-	private final Inventory _inv;
 	private int _objId;
 	private int _x, _y, _z, _heading;
 	private final int _mAtkSpd, _pAtkSpd;
@@ -47,38 +46,49 @@ public class CharInfo extends L2GameServerPacket
 	private final float _moveMultiplier;
 	private final float _attackSpeedMultiplier;
 	
-	private int _vehicleId, _airShipHelm;
+	private int _vehicleId = 0;
+	
+	private static final int[] PAPERDOLL_ORDER = new int[]
+	{
+		Inventory.PAPERDOLL_UNDER,
+		Inventory.PAPERDOLL_HEAD,
+		Inventory.PAPERDOLL_RHAND,
+		Inventory.PAPERDOLL_LHAND,
+		Inventory.PAPERDOLL_GLOVES,
+		Inventory.PAPERDOLL_CHEST,
+		Inventory.PAPERDOLL_LEGS,
+		Inventory.PAPERDOLL_FEET,
+		Inventory.PAPERDOLL_CLOAK,
+		Inventory.PAPERDOLL_RHAND,
+		Inventory.PAPERDOLL_HAIR,
+		Inventory.PAPERDOLL_HAIR2,
+		Inventory.PAPERDOLL_RBRACELET,
+		Inventory.PAPERDOLL_LBRACELET,
+		Inventory.PAPERDOLL_DECO1,
+		Inventory.PAPERDOLL_DECO2,
+		Inventory.PAPERDOLL_DECO3,
+		Inventory.PAPERDOLL_DECO4,
+		Inventory.PAPERDOLL_DECO5,
+		Inventory.PAPERDOLL_DECO6,
+		Inventory.PAPERDOLL_BELT
+	};
 	
-	/**
-	 * @param cha
-	 */
 	public CharInfo(L2PcInstance cha)
 	{
 		_activeChar = cha;
 		_objId = cha.getObjectId();
-		_inv = cha.getInventory();
 		if ((_activeChar.getVehicle() != null) && (_activeChar.getInVehiclePosition() != null))
 		{
 			_x = _activeChar.getInVehiclePosition().getX();
 			_y = _activeChar.getInVehiclePosition().getY();
 			_z = _activeChar.getInVehiclePosition().getZ();
 			_vehicleId = _activeChar.getVehicle().getObjectId();
-			if (_activeChar.isInAirShip() && _activeChar.getAirShip().isCaptain(_activeChar))
-			{
-				_airShipHelm = _activeChar.getAirShip().getHelmItemId();
-			}
-			else
-			{
-				_airShipHelm = 0;
-			}
 		}
 		else
 		{
 			_x = _activeChar.getX();
 			_y = _activeChar.getY();
 			_z = _activeChar.getZ();
-			_vehicleId = 0;
-			_airShipHelm = 0;
 		}
 		_heading = _activeChar.getHeading();
 		_mAtkSpd = _activeChar.getMAtkSpd();
@@ -98,8 +108,6 @@ public class CharInfo extends L2GameServerPacket
 	public CharInfo(L2Decoy decoy)
 	{
 		this(decoy.getActingPlayer()); // init
-		_vehicleId = 0;
-		_airShipHelm = 0;
 		_objId = decoy.getObjectId();
 		_x = decoy.getX();
 		_y = decoy.getY();
@@ -114,88 +122,80 @@ public class CharInfo extends L2GameServerPacket
 		
 		if (_invisible)
 		{
-			L2PcInstance tmp = getClient().getActiveChar();
-			if ((tmp != null) && tmp.canOverrideCond(PcCondOverride.SEE_ALL_PLAYERS))
+			final L2PcInstance player = getClient().getActiveChar();
+			if ((player != null) && player.canOverrideCond(PcCondOverride.SEE_ALL_PLAYERS))
 			{
 				gmSeeInvis = true;
 			}
 		}
 		
-		if (_activeChar.getPoly().isMorphed())
+		final L2NpcTemplate template = _activeChar.getPoly().isMorphed() ? NpcTable.getInstance().getTemplate(_activeChar.getPoly().getPolyId()) : null;
+		if (template != null)
 		{
-			L2NpcTemplate template = NpcTable.getInstance().getTemplate(_activeChar.getPoly().getPolyId());
+			writeC(0x0C);
+			writeD(_objId);
+			writeD(template.getNpcId() + 1000000); // npctype id
+			writeD(_activeChar.getKarma() > 0 ? 1 : 0);
+			writeD(_x);
+			writeD(_y);
+			writeD(_z);
+			writeD(_heading);
+			writeD(0x00);
+			writeD(_mAtkSpd);
+			writeD(_pAtkSpd);
+			writeD(_runSpd);
+			writeD(_walkSpd);
+			writeD(_swimRunSpd);
+			writeD(_swimWalkSpd);
+			writeD(_flRunSpd);
+			writeD(_flWalkSpd);
+			writeD(_flyRunSpd);
+			writeD(_flyWalkSpd);
+			writeF(_moveMultiplier);
+			writeF(_attackSpeedMultiplier);
+			writeF(template.getfCollisionRadius());
+			writeF(template.getfCollisionHeight());
+			writeD(template.getRightHand()); // right hand weapon
+			writeD(0x00); // chest
+			writeD(template.getLeftHand()); // left hand weapon
+			writeC(1); // name above char 1=true ... ??
+			writeC(_activeChar.isRunning() ? 1 : 0);
+			writeC(_activeChar.isInCombat() ? 1 : 0);
+			writeC(_activeChar.isAlikeDead() ? 1 : 0);
+			writeC(!gmSeeInvis && _invisible ? 1 : 0); // invisible ?? 0=false 1=true 2=summoned (only works if model has a summon animation)
 			
-			if (template != null)
-			{
-				writeC(0x0c);
-				writeD(_objId);
-				writeD(template.getNpcId() + 1000000); // npctype id
-				writeD(_activeChar.getKarma() > 0 ? 1 : 0);
-				writeD(_x);
-				writeD(_y);
-				writeD(_z);
-				writeD(_heading);
-				writeD(0x00);
-				writeD(_mAtkSpd);
-				writeD(_pAtkSpd);
-				writeD(_runSpd);
-				writeD(_walkSpd);
-				writeD(_swimRunSpd);
-				writeD(_swimWalkSpd);
-				writeD(_flRunSpd);
-				writeD(_flWalkSpd);
-				writeD(_flyRunSpd);
-				writeD(_flyWalkSpd);
-				writeF(_moveMultiplier);
-				writeF(_attackSpeedMultiplier);
-				writeF(template.getfCollisionRadius());
-				writeF(template.getfCollisionHeight());
-				writeD(template.getRightHand()); // right hand weapon
-				writeD(0x00); // chest
-				writeD(template.getLeftHand()); // left hand weapon
-				writeC(1); // name above char 1=true ... ??
-				writeC(_activeChar.isRunning() ? 1 : 0);
-				writeC(_activeChar.isInCombat() ? 1 : 0);
-				writeC(_activeChar.isAlikeDead() ? 1 : 0);
-				writeC(!gmSeeInvis && _invisible ? 1 : 0); // invisible ?? 0=false 1=true 2=summoned (only works if model has a summon animation)
-				
-				writeD(-1); // High Five NPCString ID
-				writeS(_activeChar.getAppearance().getVisibleName());
-				writeD(-1); // High Five NPCString ID
-				writeS(gmSeeInvis ? "Invisible" : _activeChar.getAppearance().getVisibleTitle());
-				
-				writeD(_activeChar.getAppearance().getTitleColor()); // Title color 0=client default
-				writeD(_activeChar.getPvpFlag()); // pvp flag
-				writeD(_activeChar.getKarma()); // karma ??
-				
-				writeD(gmSeeInvis ? (_activeChar.getAbnormalEffect() | AbnormalEffect.STEALTH.getMask()) : _activeChar.getAbnormalEffect()); // C2
-				
-				writeD(_activeChar.getClanId()); // clan id
-				writeD(_activeChar.getClanCrestId()); // crest id
-				writeD(_activeChar.getAllyId()); // ally id
-				writeD(_activeChar.getAllyCrestId()); // all crest
-				
-				writeC(_activeChar.isFlying() ? 2 : 0); // is Flying
-				writeC(_activeChar.getTeam()); // C3 team circle 1-blue, 2-red
-				
-				writeF(template.getfCollisionRadius());
-				writeF(template.getfCollisionHeight());
-				
-				writeD(0x00); // enchant effect
-				writeD(_activeChar.isFlying() ? 2 : 0); // is Flying again?
-				
-				writeD(0x00);
-				
-				writeD(0x00); // CT1.5 Pet form and skills, Color effect
-				writeC(template.getAIDataStatic().isTargetable() ? 0x01 : 0x00); // targetable
-				writeC(template.getAIDataStatic().showName() ? 0x01 : 0x00); // show name
-				writeC(_activeChar.getSpecialEffect());
-				writeD(0x00);
-			}
-			else
-			{
-				_log.warning("Character " + _activeChar.getName() + " (" + _activeChar.getObjectId() + ") morphed in a Npc (" + _activeChar.getPoly().getPolyId() + ") w/o template.");
-			}
+			writeD(-1); // High Five NPCString ID
+			writeS(_activeChar.getAppearance().getVisibleName());
+			writeD(-1); // High Five NPCString ID
+			writeS(gmSeeInvis ? "Invisible" : _activeChar.getAppearance().getVisibleTitle());
+			
+			writeD(_activeChar.getAppearance().getTitleColor()); // Title color 0=client default
+			writeD(_activeChar.getPvpFlag()); // pvp flag
+			writeD(_activeChar.getKarma()); // karma ??
+			
+			writeD(gmSeeInvis ? (_activeChar.getAbnormalEffect() | AbnormalEffect.STEALTH.getMask()) : _activeChar.getAbnormalEffect()); // C2
+			
+			writeD(_activeChar.getClanId()); // clan id
+			writeD(_activeChar.getClanCrestId()); // crest id
+			writeD(_activeChar.getAllyId()); // ally id
+			writeD(_activeChar.getAllyCrestId()); // all crest
+			
+			writeC(_activeChar.isFlying() ? 2 : 0); // is Flying
+			writeC(_activeChar.getTeam()); // C3 team circle 1-blue, 2-red
+			
+			writeF(template.getfCollisionRadius());
+			writeF(template.getfCollisionHeight());
+			
+			writeD(0x00); // enchant effect
+			writeD(_activeChar.isFlying() ? 2 : 0); // is Flying again?
+			
+			writeD(0x00);
+			
+			writeD(0x00); // CT1.5 Pet form and skills, Color effect
+			writeC(template.getAIDataStatic().isTargetable() ? 0x01 : 0x00); // targetable
+			writeC(template.getAIDataStatic().showName() ? 0x01 : 0x00); // show name
+			writeC(_activeChar.getSpecialEffect());
+			writeD(0x00);
 		}
 		else
 		{
@@ -208,64 +208,20 @@ public class CharInfo extends L2GameServerPacket
 			writeS(_activeChar.getAppearance().getVisibleName());
 			writeD(_activeChar.getRace().ordinal());
 			writeD(_activeChar.getAppearance().getSex() ? 1 : 0);
-			
 			writeD(_activeChar.getBaseClass());
 			
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_UNDER));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_HEAD));
-			
-			writeD(_airShipHelm == 0 ? _inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_RHAND) : _airShipHelm);
-			writeD(_airShipHelm == 0 ? _inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_LHAND) : 0);
-			
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_GLOVES));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_CHEST));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_LEGS));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_FEET));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_CLOAK));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_RHAND));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_HAIR));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_HAIR2));
-			// T1 new d's
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_RBRACELET));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_LBRACELET));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO1));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO2));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO3));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO4));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO5));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO6));
-			writeD(_inv.getPaperdollItemDisplayId(Inventory.PAPERDOLL_BELT));
-			// end of t1 new d's
-			
-			// c6 new h's
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_UNDER));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_HEAD));
-			
-			writeD(_airShipHelm == 0 ? _inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_RHAND) : _airShipHelm);
-			writeD(_airShipHelm == 0 ? _inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_LHAND) : 0);
-			
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_GLOVES));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_CHEST));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_LEGS));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_FEET));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_CLOAK));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_RHAND));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_HAIR));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_HAIR2));
-			// T1 new h's
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_RBRACELET));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_LBRACELET));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO1));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO2));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO3));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO4));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO5));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO6));
-			writeD(_inv.getPaperdollAugmentationId(Inventory.PAPERDOLL_BELT));
+			for (int slot : getPaperdollOrder())
+			{
+				writeD(_activeChar.getInventory().getPaperdollItemDisplayId(slot));
+			}
 			
-			writeD(0x00); // ?
-			writeD(0x01); // ?
-			// end of t1 new h's
+			for (int slot : getPaperdollOrder())
+			{
+				writeD(_activeChar.getInventory().getPaperdollAugmentationId(slot));
+			}
+			
+			writeD(_activeChar.getInventory().getMaxTalismanCount());
+			writeD(_activeChar.getInventory().getCloakStatus());
 			
 			writeD(_activeChar.getPvpFlag());
 			writeD(_activeChar.getKarma());
@@ -284,7 +240,7 @@ public class CharInfo extends L2GameServerPacket
 			writeD(_flyRunSpd);
 			writeD(_flyWalkSpd);
 			writeF(_moveMultiplier);
-			writeF(_activeChar.getAttackSpeedMultiplier()); // _activeChar.getAttackSpeedMultiplier()
+			writeF(_activeChar.getAttackSpeedMultiplier());
 			
 			writeF(_activeChar.getCollisionRadius());
 			writeF(_activeChar.getCollisionHeight());
@@ -337,7 +293,7 @@ public class CharInfo extends L2GameServerPacket
 			writeD(_activeChar.getMountNpcId() + 1000000);
 			writeD(_activeChar.getClassId().getId());
 			writeD(0x00); // ?
-			writeC(_activeChar.isMounted() || (_airShipHelm != 0) ? 0 : _activeChar.getEnchantEffect());
+			writeC(_activeChar.isMounted() ? 0 : _activeChar.getEnchantEffect());
 			
 			writeC(_activeChar.getTeam()); // team circle around feet 1= Blue, 2 = red
 			
@@ -374,4 +330,10 @@ public class CharInfo extends L2GameServerPacket
 			writeD(_activeChar.getSpecialEffect());
 		}
 	}
+	
+	@Override
+	protected int[] getPaperdollOrder()
+	{
+		return PAPERDOLL_ORDER;
+	}
 }

+ 4 - 26
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/CharSelectionInfo.java

@@ -145,32 +145,10 @@ public class CharSelectionInfo extends L2GameServerPacket
 			writeD(0x00);
 			writeD(0x00);
 			
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_REAR));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_LEAR));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_NECK));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_RFINGER));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_LFINGER));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_HEAD));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_LHAND));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_GLOVES));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_CHEST));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_LEGS));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_FEET));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_CLOAK));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_RHAND));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_HAIR));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_HAIR2));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_RBRACELET));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_LBRACELET));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_DECO1));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_DECO2));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_DECO3));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_DECO4));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_DECO5));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_DECO6));
-			writeD(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_BELT));
+			for (int slot : getPaperdollOrder())
+			{
+				writeD(charInfoPackage.getPaperdollItemId(slot));
+			}
 			
 			writeD(charInfoPackage.getHairStyle());
 			writeD(charInfoPackage.getHairColor());

+ 18 - 122
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/GMViewCharacterInfo.java

@@ -19,9 +19,7 @@
 package com.l2jserver.gameserver.network.serverpackets;
 
 import com.l2jserver.gameserver.datatables.ExperienceTable;
-import com.l2jserver.gameserver.model.Elementals;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.itemcontainer.Inventory;
 
 public class GMViewCharacterInfo extends L2GameServerPacket
 {
@@ -79,123 +77,23 @@ public class GMViewCharacterInfo extends L2GameServerPacket
 		writeD(_activeChar.getMaxLoad());
 		writeD(_activeChar.getPkKills());
 		
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_REAR));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEAR));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_NECK));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RFINGER));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LFINGER));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HEAD));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LHAND));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_GLOVES));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_CHEST));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEGS));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FEET));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_CLOAK));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR2));
-		// T1 new D's
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RBRACELET));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LBRACELET));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO1));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO2));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO3));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO4));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO5));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO6));
-		writeD(0); // T3 Unknown
-		// end of T1 new D's
+		for (int slot : getPaperdollOrder())
+		{
+			writeD(_activeChar.getInventory().getPaperdollObjectId(slot));
+		}
 		
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_HAIR));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_REAR));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_LEAR));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_NECK));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_RFINGER));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_LFINGER));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_HEAD));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_RHAND));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_LHAND));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_GLOVES));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_CHEST));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_LEGS));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_FEET));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_CLOAK));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_RHAND));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_HAIR));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_HAIR2));
-		// T1 new D's
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_RBRACELET));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_LBRACELET));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO1));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO2));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO3));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO4));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO5));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO6));
-		writeD(0); // T3 Unknown
-		writeD(0); // T3 Unknown
-		writeD(0); // T3 Unknown
-		// end of T1 new D's
+		for (int slot : getPaperdollOrder())
+		{
+			writeD(_activeChar.getInventory().getPaperdollItemDisplayId(slot));
+		}
 		
-		// c6 new h's
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_RHAND));
-		writeH(0x00);
-		
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_RHAND));
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		// end of c6 new h's
-		
-		// start of T1 new h's
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		writeH(0x00);
-		// end of T1 new h's
-		writeH(0x00);
-		writeH(0x00);
+		for (int slot : getPaperdollOrder())
+		{
+			writeD(_activeChar.getInventory().getPaperdollAugmentationId(slot));
+		}
 		
+		writeD(_activeChar.getInventory().getMaxTalismanCount()); // CT2.3
+		writeD(_activeChar.getInventory().getCloakStatus()); // CT2.3
 		writeD(_activeChar.getPAtk(null));
 		writeD(_activeChar.getPAtkSpd());
 		writeD(_activeChar.getPDef(null));
@@ -261,12 +159,10 @@ public class GMViewCharacterInfo extends L2GameServerPacket
 		byte attackAttribute = _activeChar.getAttackElement();
 		writeH(attackAttribute);
 		writeH(_activeChar.getAttackElementValue(attackAttribute));
-		writeH(_activeChar.getDefenseElementValue(Elementals.FIRE));
-		writeH(_activeChar.getDefenseElementValue(Elementals.WATER));
-		writeH(_activeChar.getDefenseElementValue(Elementals.WIND));
-		writeH(_activeChar.getDefenseElementValue(Elementals.EARTH));
-		writeH(_activeChar.getDefenseElementValue(Elementals.HOLY));
-		writeH(_activeChar.getDefenseElementValue(Elementals.DARK));
+		for (byte i = 0; i < 6; i++)
+		{
+			writeH(_activeChar.getDefenseElementValue(i));
+		}
 		writeD(_activeChar.getFame());
 		writeD(_activeChar.getVitalityPoints());
 	}

+ 36 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/L2GameServerPacket.java

@@ -25,6 +25,7 @@ import org.mmocore.network.SendablePacket;
 
 import com.l2jserver.Config;
 import com.l2jserver.gameserver.model.Location;
+import com.l2jserver.gameserver.model.itemcontainer.Inventory;
 import com.l2jserver.gameserver.network.L2GameClient;
 
 /**
@@ -36,6 +37,36 @@ public abstract class L2GameServerPacket extends SendablePacket<L2GameClient>
 	
 	protected boolean _invisible = false;
 	
+	private static final int[] PAPERDOLL_ORDER = new int[]
+	{
+		Inventory.PAPERDOLL_UNDER,
+		Inventory.PAPERDOLL_REAR,
+		Inventory.PAPERDOLL_LEAR,
+		Inventory.PAPERDOLL_NECK,
+		Inventory.PAPERDOLL_RFINGER,
+		Inventory.PAPERDOLL_LFINGER,
+		Inventory.PAPERDOLL_HEAD,
+		Inventory.PAPERDOLL_RHAND,
+		Inventory.PAPERDOLL_LHAND,
+		Inventory.PAPERDOLL_GLOVES,
+		Inventory.PAPERDOLL_CHEST,
+		Inventory.PAPERDOLL_LEGS,
+		Inventory.PAPERDOLL_FEET,
+		Inventory.PAPERDOLL_CLOAK,
+		Inventory.PAPERDOLL_RHAND,
+		Inventory.PAPERDOLL_HAIR,
+		Inventory.PAPERDOLL_HAIR2,
+		Inventory.PAPERDOLL_RBRACELET,
+		Inventory.PAPERDOLL_LBRACELET,
+		Inventory.PAPERDOLL_DECO1,
+		Inventory.PAPERDOLL_DECO2,
+		Inventory.PAPERDOLL_DECO3,
+		Inventory.PAPERDOLL_DECO4,
+		Inventory.PAPERDOLL_DECO5,
+		Inventory.PAPERDOLL_DECO6,
+		Inventory.PAPERDOLL_BELT
+	};
+	
 	/**
 	 * @return True if packet originated from invisible character.
 	 */
@@ -65,6 +96,11 @@ public abstract class L2GameServerPacket extends SendablePacket<L2GameClient>
 		writeD(loc.getZ());
 	}
 	
+	protected int[] getPaperdollOrder()
+	{
+		return PAPERDOLL_ORDER;
+	}
+	
 	@Override
 	protected void write()
 	{

+ 21 - 91
L2J_Server_BETA/java/com/l2jserver/gameserver/network/serverpackets/UserInfo.java

@@ -29,7 +29,6 @@ import com.l2jserver.gameserver.model.actor.instance.L2CubicInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
 import com.l2jserver.gameserver.model.effects.AbnormalEffect;
-import com.l2jserver.gameserver.model.itemcontainer.Inventory;
 
 public final class UserInfo extends L2GameServerPacket
 {
@@ -113,101 +112,32 @@ public final class UserInfo extends L2GameServerPacket
 		writeD(_activeChar.getWIT());
 		writeD(_activeChar.getMEN());
 		writeD(_activeChar.getMaxHp());
-		writeD((int) _activeChar.getCurrentHp());
+		writeD((int) Math.round(_activeChar.getCurrentHp()));
 		writeD(_activeChar.getMaxMp());
-		writeD((int) _activeChar.getCurrentMp());
+		writeD((int) Math.round(_activeChar.getCurrentMp()));
 		writeD(_activeChar.getSp());
 		writeD(_activeChar.getCurrentLoad());
 		writeD(_activeChar.getMaxLoad());
 		
 		writeD(_activeChar.getActiveWeaponItem() != null ? 40 : 20); // 20 no weapon, 40 weapon equipped
 		
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_UNDER));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_REAR));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEAR));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_NECK));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RFINGER));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LFINGER));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HEAD));
-		
-		writeD(_airShipHelm == 0 ? _activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND) : _airShipHelm);
-		writeD(_airShipHelm == 0 ? _activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LHAND) : 0);
-		
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_GLOVES));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_CHEST));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LEGS));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_FEET));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_CLOAK));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RHAND));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_HAIR2));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_RBRACELET));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_LBRACELET));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO1));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO2));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO3));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO4));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO5));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_DECO6));
-		writeD(_activeChar.getInventory().getPaperdollObjectId(Inventory.PAPERDOLL_BELT)); // CT2.3
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_UNDER));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_REAR));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_LEAR));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_NECK));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_RFINGER));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_LFINGER));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_HEAD));
-		
-		writeD(_airShipHelm == 0 ? _activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_RHAND) : _airShipHelm);
-		writeD(_airShipHelm == 0 ? _activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_LHAND) : 0);
-		
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_GLOVES));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_CHEST));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_LEGS));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_FEET));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_CLOAK));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_RHAND));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_HAIR));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_HAIR2));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_RBRACELET));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_LBRACELET));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO1));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO2));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO3));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO4));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO5));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_DECO6));
-		writeD(_activeChar.getInventory().getPaperdollItemDisplayId(Inventory.PAPERDOLL_BELT)); // CT2.3
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_UNDER));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_REAR));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_LEAR));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_NECK));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_RFINGER));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_LFINGER));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_HEAD));
-		
-		writeD(_airShipHelm == 0 ? _activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_RHAND) : _airShipHelm);
-		writeD(_airShipHelm == 0 ? _activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_LHAND) : 0);
-		
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_GLOVES));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_CHEST));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_LEGS));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_FEET));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_CLOAK));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_RHAND));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_HAIR));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_HAIR2));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_RBRACELET));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_LBRACELET));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO1));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO2));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO3));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO4));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO5));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_DECO6));
-		writeD(_activeChar.getInventory().getPaperdollAugmentationId(Inventory.PAPERDOLL_BELT)); // CT2.3
-		writeD(_activeChar.getInventory().getMaxTalismanCount()); // CT2.3
-		writeD(_activeChar.getInventory().getCloakStatus()); // CT2.3
+		for (int slot : getPaperdollOrder())
+		{
+			writeD(_activeChar.getInventory().getPaperdollObjectId(slot));
+		}
+		
+		for (int slot : getPaperdollOrder())
+		{
+			writeD(_activeChar.getInventory().getPaperdollItemDisplayId(slot));
+		}
+		
+		for (int slot : getPaperdollOrder())
+		{
+			writeD(_activeChar.getInventory().getPaperdollAugmentationId(slot));
+		}
+		
+		writeD(_activeChar.getInventory().getMaxTalismanCount());
+		writeD(_activeChar.getInventory().getCloakStatus());
 		writeD(_activeChar.getPAtk(null));
 		writeD(_activeChar.getPAtkSpd());
 		writeD(_activeChar.getPDef(null));
@@ -221,7 +151,7 @@ public final class UserInfo extends L2GameServerPacket
 		
 		writeD(_activeChar.getMDef(null, null));
 		
-		writeD(_activeChar.getPvpFlag()); // 0-non-pvp 1-pvp = violet name
+		writeD(_activeChar.getPvpFlag());
 		writeD(_activeChar.getKarma());
 		
 		writeD(_runSpd);
@@ -250,7 +180,7 @@ public final class UserInfo extends L2GameServerPacket
 		}
 		if (_activeChar.getPoly().isMorphed())
 		{
-			L2NpcTemplate polyObj = NpcTable.getInstance().getTemplate(_activeChar.getPoly().getPolyId());
+			final L2NpcTemplate polyObj = NpcTable.getInstance().getTemplate(_activeChar.getPoly().getPolyId());
 			if (polyObj != null)
 			{
 				title += " - " + polyObj.getName();