Prechádzať zdrojové kódy

Updating welcome message

Zoey76 6 rokov pred
rodič
commit
4961a390db

+ 129 - 235
src/main/java/com/l2jserver/gameserver/network/clientpackets/EnterWorld.java

@@ -18,6 +18,23 @@
  */
 package com.l2jserver.gameserver.network.clientpackets;
 
+import static com.l2jserver.gameserver.SevenSigns.CABAL_NULL;
+import static com.l2jserver.gameserver.SevenSigns.SEAL_STRIFE;
+import static com.l2jserver.gameserver.model.PcCondOverride.ZONE_CONDITIONS;
+import static com.l2jserver.gameserver.model.TeleportWhereType.TOWN;
+import static com.l2jserver.gameserver.model.skills.CommonSkill.THE_VANQUISHED_OF_WAR;
+import static com.l2jserver.gameserver.model.skills.CommonSkill.THE_VICTOR_OF_WAR;
+import static com.l2jserver.gameserver.model.zone.ZoneId.SIEGE;
+import static com.l2jserver.gameserver.network.SystemMessageId.CLAN_MEMBERSHIP_TERMINATED;
+import static com.l2jserver.gameserver.network.SystemMessageId.CLAN_MEMBER_S1_LOGGED_IN;
+import static com.l2jserver.gameserver.network.SystemMessageId.FRIEND_S1_HAS_LOGGED_IN;
+import static com.l2jserver.gameserver.network.SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW;
+import static com.l2jserver.gameserver.network.SystemMessageId.THERE_ARE_S1_DAYS_UNTIL_YOUR_CHARACTERS_BIRTHDAY;
+import static com.l2jserver.gameserver.network.SystemMessageId.WELCOME_TO_LINEAGE;
+import static com.l2jserver.gameserver.network.SystemMessageId.YOUR_APPRENTICE_S1_HAS_LOGGED_IN;
+import static com.l2jserver.gameserver.network.SystemMessageId.YOUR_BIRTHDAY_GIFT_HAS_ARRIVED;
+import static com.l2jserver.gameserver.network.SystemMessageId.YOUR_SPONSOR_C1_HAS_LOGGED_IN;
+
 import java.util.Base64;
 
 import com.l2jserver.Config;
@@ -43,8 +60,6 @@ import com.l2jserver.gameserver.instancemanager.TerritoryWarManager;
 import com.l2jserver.gameserver.model.L2Clan;
 import com.l2jserver.gameserver.model.L2Object;
 import com.l2jserver.gameserver.model.L2World;
-import com.l2jserver.gameserver.model.PcCondOverride;
-import com.l2jserver.gameserver.model.TeleportWhereType;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.entity.Couple;
 import com.l2jserver.gameserver.model.entity.Fort;
@@ -56,9 +71,6 @@ import com.l2jserver.gameserver.model.entity.clanhall.AuctionableHall;
 import com.l2jserver.gameserver.model.entity.clanhall.SiegableHall;
 import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
 import com.l2jserver.gameserver.model.quest.Quest;
-import com.l2jserver.gameserver.model.skills.CommonSkill;
-import com.l2jserver.gameserver.model.zone.ZoneId;
-import com.l2jserver.gameserver.network.SystemMessageId;
 import com.l2jserver.gameserver.network.serverpackets.ActionFailed;
 import com.l2jserver.gameserver.network.serverpackets.Die;
 import com.l2jserver.gameserver.network.serverpackets.EtcStatusUpdate;
@@ -94,8 +106,7 @@ import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
  * packet format rev87 bddddbdcccccccccccccccccccc
  * <p>
  */
-public class EnterWorld extends L2GameClientPacket
-{
+public class EnterWorld extends L2GameClientPacket {
 	private static final String _C__11_ENTERWORLD = "[C] 11 EnterWorld";
 	
 	private static final double MIN_HP = 0.5;
@@ -105,8 +116,7 @@ public class EnterWorld extends L2GameClientPacket
 	private final int[][] tracert = new int[5][4];
 	
 	@Override
-	protected void readImpl()
-	{
+	protected void readImpl() {
 		readB(new byte[32]); // Unknown Byte Array
 		readD(); // Unknown Value
 		readD(); // Unknown Value
@@ -114,29 +124,24 @@ public class EnterWorld extends L2GameClientPacket
 		readD(); // Unknown Value
 		readB(new byte[32]); // Unknown Byte Array
 		readD(); // Unknown Value
-		for (int i = 0; i < 5; i++)
-		{
-			for (int o = 0; o < 4; o++)
-			{
+		for (int i = 0; i < 5; i++) {
+			for (int o = 0; o < 4; o++) {
 				tracert[i][o] = readC();
 			}
 		}
 	}
 	
 	@Override
-	protected void runImpl()
-	{
+	protected void runImpl() {
 		final L2PcInstance activeChar = getActiveChar();
-		if (activeChar == null)
-		{
+		if (activeChar == null) {
 			_log.warning("EnterWorld failed! activeChar returned 'null'.");
 			getClient().closeNow();
 			return;
 		}
 		
 		final String[] address = new String[5];
-		for (int i = 0; i < 5; i++)
-		{
+		for (int i = 0; i < 5; i++) {
 			address[i] = tracert[i][0] + "." + tracert[i][1] + "." + tracert[i][2] + "." + tracert[i][3];
 		}
 		
@@ -145,74 +150,57 @@ public class EnterWorld extends L2GameClientPacket
 		getClient().setClientTracert(tracert);
 		
 		// Restore to instanced area if enabled
-		if (Config.RESTORE_PLAYER_INSTANCE)
-		{
+		if (Config.RESTORE_PLAYER_INSTANCE) {
 			activeChar.setInstanceId(InstanceManager.getInstance().getPlayerInstance(activeChar.getObjectId()));
-		}
-		else
-		{
+		} else {
 			int instanceId = InstanceManager.getInstance().getPlayerInstance(activeChar.getObjectId());
-			if (instanceId > 0)
-			{
+			if (instanceId > 0) {
 				InstanceManager.getInstance().getInstance(instanceId).removePlayer(activeChar.getObjectId());
 			}
 		}
 		
-		if (Config.DEBUG)
-		{
-			if (L2World.getInstance().findObject(activeChar.getObjectId()) != null)
-			{
+		if (Config.DEBUG) {
+			if (L2World.getInstance().findObject(activeChar.getObjectId()) != null) {
 				_log.warning("User already exists in Object ID map! User " + activeChar.getName() + " is a character clone.");
 			}
 		}
 		
 		// Apply special GM properties to the GM when entering
-		if (activeChar.isGM())
-		{
-			if (Config.GM_STARTUP_INVULNERABLE && AdminData.getInstance().hasAccess("admin_invul", activeChar.getAccessLevel()))
-			{
+		if (activeChar.isGM()) {
+			if (Config.GM_STARTUP_INVULNERABLE && AdminData.getInstance().hasAccess("admin_invul", activeChar.getAccessLevel())) {
 				activeChar.setIsInvul(true);
 			}
 			
-			if (Config.GM_STARTUP_INVISIBLE && AdminData.getInstance().hasAccess("admin_invisible", activeChar.getAccessLevel()))
-			{
+			if (Config.GM_STARTUP_INVISIBLE && AdminData.getInstance().hasAccess("admin_invisible", activeChar.getAccessLevel())) {
 				activeChar.setInvisible(true);
 			}
 			
-			if (Config.GM_STARTUP_SILENCE && AdminData.getInstance().hasAccess("admin_silence", activeChar.getAccessLevel()))
-			{
+			if (Config.GM_STARTUP_SILENCE && AdminData.getInstance().hasAccess("admin_silence", activeChar.getAccessLevel())) {
 				activeChar.setSilenceMode(true);
 			}
 			
-			if (Config.GM_STARTUP_DIET_MODE && AdminData.getInstance().hasAccess("admin_diet", activeChar.getAccessLevel()))
-			{
+			if (Config.GM_STARTUP_DIET_MODE && AdminData.getInstance().hasAccess("admin_diet", activeChar.getAccessLevel())) {
 				activeChar.setDietMode(true);
 				activeChar.refreshOverloaded();
 			}
 			
-			if (Config.GM_STARTUP_AUTO_LIST && AdminData.getInstance().hasAccess("admin_gmliston", activeChar.getAccessLevel()))
-			{
+			if (Config.GM_STARTUP_AUTO_LIST && AdminData.getInstance().hasAccess("admin_gmliston", activeChar.getAccessLevel())) {
 				AdminData.getInstance().addGm(activeChar, false);
-			}
-			else
-			{
+			} else {
 				AdminData.getInstance().addGm(activeChar, true);
 			}
 			
-			if (Config.GM_GIVE_SPECIAL_SKILLS)
-			{
+			if (Config.GM_GIVE_SPECIAL_SKILLS) {
 				SkillTreesData.getInstance().addSkills(activeChar, false);
 			}
 			
-			if (Config.GM_GIVE_SPECIAL_AURA_SKILLS)
-			{
+			if (Config.GM_GIVE_SPECIAL_AURA_SKILLS) {
 				SkillTreesData.getInstance().addSkills(activeChar, true);
 			}
 		}
 		
 		// Set dead status if applies
-		if (activeChar.getCurrentHp() < MIN_HP)
-		{
+		if (activeChar.getCurrentHp() < MIN_HP) {
 			activeChar.setIsDead(true);
 		}
 		
@@ -220,8 +208,7 @@ public class EnterWorld extends L2GameClientPacket
 		
 		// Clan related checks are here
 		final L2Clan clan = activeChar.getClan();
-		if (clan != null)
-		{
+		if (clan != null) {
 			activeChar.sendPacket(new PledgeSkillList(clan));
 			
 			notifyClanMembers(activeChar);
@@ -229,61 +216,46 @@ public class EnterWorld extends L2GameClientPacket
 			notifySponsorOrApprentice(activeChar);
 			
 			final AuctionableHall clanHall = ClanHallManager.getInstance().getClanHallByOwner(clan);
-			if (clanHall != null)
-			{
-				if (!clanHall.getPaid())
-				{
-					activeChar.sendPacket(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW);
+			if (clanHall != null) {
+				if (!clanHall.getPaid()) {
+					activeChar.sendPacket(PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW);
 				}
 			}
 			
-			for (Siege siege : SiegeManager.getInstance().getSieges())
-			{
-				if (!siege.isInProgress())
-				{
+			for (Siege siege : SiegeManager.getInstance().getSieges()) {
+				if (!siege.isInProgress()) {
 					continue;
 				}
 				
-				if (siege.checkIsAttacker(clan))
-				{
+				if (siege.checkIsAttacker(clan)) {
 					activeChar.setSiegeState((byte) 1);
 					activeChar.setSiegeSide(siege.getCastle().getResidenceId());
-				}
-				else if (siege.checkIsDefender(clan))
-				{
+				} else if (siege.checkIsDefender(clan)) {
 					activeChar.setSiegeState((byte) 2);
 					activeChar.setSiegeSide(siege.getCastle().getResidenceId());
 				}
 			}
 			
-			for (FortSiege siege : FortSiegeManager.getInstance().getSieges())
-			{
-				if (!siege.isInProgress())
-				{
+			for (FortSiege siege : FortSiegeManager.getInstance().getSieges()) {
+				if (!siege.isInProgress()) {
 					continue;
 				}
 				
-				if (siege.checkIsAttacker(clan))
-				{
+				if (siege.checkIsAttacker(clan)) {
 					activeChar.setSiegeState((byte) 1);
 					activeChar.setSiegeSide(siege.getFort().getResidenceId());
-				}
-				else if (siege.checkIsDefender(clan))
-				{
+				} else if (siege.checkIsDefender(clan)) {
 					activeChar.setSiegeState((byte) 2);
 					activeChar.setSiegeSide(siege.getFort().getResidenceId());
 				}
 			}
 			
-			for (SiegableHall hall : CHSiegeManager.getInstance().getConquerableHalls().values())
-			{
-				if (!hall.isInSiege())
-				{
+			for (SiegableHall hall : CHSiegeManager.getInstance().getConquerableHalls().values()) {
+				if (!hall.isInSiege()) {
 					continue;
 				}
 				
-				if (hall.isRegistered(clan))
-				{
+				if (hall.isRegistered(clan)) {
 					activeChar.setSiegeState((byte) 1);
 					activeChar.setSiegeSide(hall.getId());
 					activeChar.setIsInHideoutSiege(true);
@@ -294,55 +266,42 @@ public class EnterWorld extends L2GameClientPacket
 			sendPacket(new PledgeStatusChanged(clan));
 			
 			// Residential skills support
-			if (clan.getCastleId() > 0)
-			{
+			if (clan.getCastleId() > 0) {
 				CastleManager.getInstance().getCastleByOwner(clan).giveResidentialSkills(activeChar);
 			}
 			
-			if (clan.getFortId() > 0)
-			{
+			if (clan.getFortId() > 0) {
 				FortManager.getInstance().getFortByOwner(clan).giveResidentialSkills(activeChar);
 			}
 			
 			showClanNotice = clan.isNoticeEnabled();
 		}
 		
-		if (TerritoryWarManager.getInstance().getRegisteredTerritoryId(activeChar) > 0)
-		{
-			if (TerritoryWarManager.getInstance().isTWInProgress())
-			{
+		if (TerritoryWarManager.getInstance().getRegisteredTerritoryId(activeChar) > 0) {
+			if (TerritoryWarManager.getInstance().isTWInProgress()) {
 				activeChar.setSiegeState((byte) 1);
 			}
 			activeChar.setSiegeSide(TerritoryWarManager.getInstance().getRegisteredTerritoryId(activeChar));
 		}
 		
 		// Updating Seal of Strife Buff/Debuff
-		if (SevenSigns.getInstance().isSealValidationPeriod() && (SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE) != SevenSigns.CABAL_NULL))
-		{
-			int cabal = SevenSigns.getInstance().getPlayerCabal(activeChar.getObjectId());
-			if (cabal != SevenSigns.CABAL_NULL)
-			{
-				if (cabal == SevenSigns.getInstance().getSealOwner(SevenSigns.SEAL_STRIFE))
-				{
-					activeChar.addSkill(CommonSkill.THE_VICTOR_OF_WAR.getSkill());
-				}
-				else
-				{
-					activeChar.addSkill(CommonSkill.THE_VANQUISHED_OF_WAR.getSkill());
+		if (SevenSigns.getInstance().isSealValidationPeriod() && (SevenSigns.getInstance().getSealOwner(SEAL_STRIFE) != CABAL_NULL)) {
+			final int cabal = SevenSigns.getInstance().getPlayerCabal(activeChar.getObjectId());
+			if (cabal != CABAL_NULL) {
+				if (cabal == SevenSigns.getInstance().getSealOwner(SEAL_STRIFE)) {
+					activeChar.addSkill(THE_VICTOR_OF_WAR.getSkill());
+				} else {
+					activeChar.addSkill(THE_VANQUISHED_OF_WAR.getSkill());
 				}
 			}
-		}
-		else
-		{
-			activeChar.removeSkill(CommonSkill.THE_VICTOR_OF_WAR.getSkill());
-			activeChar.removeSkill(CommonSkill.THE_VANQUISHED_OF_WAR.getSkill());
+		} else {
+			activeChar.removeSkill(THE_VICTOR_OF_WAR.getSkill());
+			activeChar.removeSkill(THE_VANQUISHED_OF_WAR.getSkill());
 		}
 		
-		if (Config.ENABLE_VITALITY && Config.RECOVER_VITALITY_ON_RECONNECT)
-		{
+		if (Config.ENABLE_VITALITY && Config.RECOVER_VITALITY_ON_RECONNECT) {
 			float points = (Config.RATE_RECOVERY_ON_RECONNECT * (System.currentTimeMillis() - activeChar.getLastAccess())) / 60000;
-			if (points > 0)
-			{
+			if (points > 0) {
 				activeChar.updateVitalityPoints(points, false, true);
 			}
 		}
@@ -382,8 +341,7 @@ public class EnterWorld extends L2GameClientPacket
 		
 		activeChar.sendPacket(new QuestList());
 		
-		if (Config.PLAYER_SPAWN_PROTECTION > 0)
-		{
+		if (Config.PLAYER_SPAWN_PROTECTION > 0) {
 			activeChar.setProtection(true);
 		}
 		
@@ -391,20 +349,17 @@ public class EnterWorld extends L2GameClientPacket
 		
 		activeChar.getInventory().applyItemSkills();
 		
-		if (L2Event.isParticipant(activeChar))
-		{
+		if (L2Event.isParticipant(activeChar)) {
 			L2Event.restorePlayerEventStatus(activeChar);
 		}
 		
 		// Wedding Checks
-		if (Config.L2JMOD_ALLOW_WEDDING)
-		{
+		if (Config.L2JMOD_ALLOW_WEDDING) {
 			engage(activeChar);
 			notifyPartner(activeChar, activeChar.getPartnerId());
 		}
 		
-		if (activeChar.isCursedWeaponEquipped())
-		{
+		if (activeChar.isCursedWeaponEquipped()) {
 			CursedWeaponsManager.getInstance().getCursedWeapon(activeChar.getCursedWeaponEquippedId()).cursedOnLogin();
 		}
 		
@@ -417,51 +372,43 @@ public class EnterWorld extends L2GameClientPacket
 		
 		sendPacket(new FriendList(activeChar));
 		
-		final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.FRIEND_S1_HAS_LOGGED_IN);
+		final SystemMessage sm = SystemMessage.getSystemMessage(FRIEND_S1_HAS_LOGGED_IN);
 		sm.addCharName(activeChar);
 		
-		if (activeChar.hasFriends())
-		{
-			for (int id : activeChar.getFriends())
-			{
+		if (activeChar.hasFriends()) {
+			for (int id : activeChar.getFriends()) {
 				final L2Object obj = L2World.getInstance().findObject(id);
-				if (obj != null)
-				{
+				if (obj != null) {
 					obj.sendPacket(sm);
 				}
 			}
 		}
 		
-		activeChar.sendPacket(SystemMessageId.WELCOME_TO_LINEAGE);
+		activeChar.sendPacket(WELCOME_TO_LINEAGE);
 		
-		activeChar.sendMessage(getText("VGhpcyBTZXJ2ZXIgdXNlcyBMMkosIGEgUHJvamVjdCBmb3VuZGVkIGJ5IEwyQ2hlZg=="));
+		activeChar.sendMessage(getText("VGhpcyBzZXJ2ZXIgdXNlcyBMMkosIGEgcHJvamVjdCBmb3VuZGVkIGJ5IEwyQ2hlZg=="));
 		activeChar.sendMessage(getText("YW5kIGRldmVsb3BlZCBieSBMMkogVGVhbSBhdCB3d3cubDJqc2VydmVyLmNvbQ=="));
-		activeChar.sendMessage(getText("Q29weXJpZ2h0IDIwMDQtMjAxNQ=="));
-		activeChar.sendMessage(getText("VGhhbmsgeW91IGZvciAxMSB5ZWFycyE="));
+		activeChar.sendMessage(getText("Q29weXJpZ2h0IDIwMDQtMjAxOQ=="));
+		activeChar.sendMessage(getText("VGhhbmsgeW91IGZvciAxNSB5ZWFycyE="));
 		
 		SevenSigns.getInstance().sendCurrentPeriodMsg(activeChar);
 		AnnouncementsTable.getInstance().showAnnouncements(activeChar);
 		
-		if (showClanNotice)
-		{
+		if (showClanNotice) {
 			final NpcHtmlMessage notice = new NpcHtmlMessage();
 			notice.setFile(activeChar.getHtmlPrefix(), "data/html/clanNotice.htm");
 			notice.replace("%clan_name%", activeChar.getClan().getName());
 			notice.replace("%notice_text%", activeChar.getClan().getNotice());
 			notice.disableValidation();
 			sendPacket(notice);
-		}
-		else if (Config.SERVER_NEWS)
-		{
+		} else if (Config.SERVER_NEWS) {
 			String serverNews = HtmCache.getInstance().getHtm(activeChar.getHtmlPrefix(), "data/html/servnews.htm");
-			if (serverNews != null)
-			{
+			if (serverNews != null) {
 				sendPacket(new NpcHtmlMessage(serverNews));
 			}
 		}
 		
-		if (Config.PETITIONING_ALLOWED)
-		{
+		if (Config.PETITIONING_ALLOWED) {
 			PetitionManager.getInstance().checkPetitionMessages(activeChar);
 		}
 		
@@ -479,47 +426,36 @@ public class EnterWorld extends L2GameClientPacket
 		sendPacket(new ExNevitAdventTimeChange(-1)); // only set pause state...
 		sendPacket(new ExShowContactList(activeChar));
 		
-		for (L2ItemInstance item : activeChar.getInventory().getItems())
-		{
-			if (item.isTimeLimitedItem())
-			{
+		for (L2ItemInstance item : activeChar.getInventory().getItems()) {
+			if (item.isTimeLimitedItem()) {
 				item.scheduleLifeTimeTask();
 			}
-			if (item.isShadowItem() && item.isEquipped())
-			{
+			if (item.isShadowItem() && item.isEquipped()) {
 				item.decreaseMana(false);
 			}
 		}
 		
-		for (L2ItemInstance whItem : activeChar.getWarehouse().getItems())
-		{
-			if (whItem.isTimeLimitedItem())
-			{
+		for (L2ItemInstance whItem : activeChar.getWarehouse().getItems()) {
+			if (whItem.isTimeLimitedItem()) {
 				whItem.scheduleLifeTimeTask();
 			}
 		}
 		
-		if (DimensionalRiftManager.getInstance().checkIfInRiftZone(activeChar.getX(), activeChar.getY(), activeChar.getZ(), false))
-		{
+		if (DimensionalRiftManager.getInstance().checkIfInRiftZone(activeChar.getX(), activeChar.getY(), activeChar.getZ(), false)) {
 			DimensionalRiftManager.getInstance().teleportToWaitingRoom(activeChar);
 		}
 		
-		if (activeChar.getClanJoinExpiryTime() > System.currentTimeMillis())
-		{
-			activeChar.sendPacket(SystemMessageId.CLAN_MEMBERSHIP_TERMINATED);
+		if (activeChar.getClanJoinExpiryTime() > System.currentTimeMillis()) {
+			activeChar.sendPacket(CLAN_MEMBERSHIP_TERMINATED);
 		}
 		
 		// remove combat flag before teleporting
 		final L2ItemInstance combatFlag = activeChar.getInventory().getItemByItemId(COMBAT_FLAG);
-		if (combatFlag != null)
-		{
+		if (combatFlag != null) {
 			final Fort fort = FortManager.getInstance().getFort(activeChar);
-			if (fort != null)
-			{
+			if (fort != null) {
 				FortSiegeManager.getInstance().dropCombatFlag(activeChar, fort.getResidenceId());
-			}
-			else
-			{
+			} else {
 				final int slot = activeChar.getInventory().getSlotFromItem(combatFlag);
 				activeChar.getInventory().unEquipItemInBodySlot(slot);
 				activeChar.destroyItem("CombatFlag", combatFlag, null, true);
@@ -528,41 +464,33 @@ public class EnterWorld extends L2GameClientPacket
 		
 		// Attacker or spectator logging in to a siege zone.
 		// Actually should be checked for inside castle only?
-		if (!activeChar.canOverrideCond(PcCondOverride.ZONE_CONDITIONS) && activeChar.isInsideZone(ZoneId.SIEGE) && (!activeChar.isInSiege() || (activeChar.getSiegeState() < 2)))
-		{
-			activeChar.teleToLocation(TeleportWhereType.TOWN);
+		if (!activeChar.canOverrideCond(ZONE_CONDITIONS) && activeChar.isInsideZone(SIEGE) && (!activeChar.isInSiege() || (activeChar.getSiegeState() < 2))) {
+			activeChar.teleToLocation(TOWN);
 		}
 		
-		if (Config.ALLOW_MAIL)
-		{
-			if (MailManager.getInstance().hasUnreadPost(activeChar))
-			{
+		if (Config.ALLOW_MAIL) {
+			if (MailManager.getInstance().hasUnreadPost(activeChar)) {
 				sendPacket(ExNoticePostArrived.valueOf(false));
 			}
 		}
 		
 		TvTEvent.onLogin(activeChar);
 		
-		if (Config.WELCOME_MESSAGE_ENABLED)
-		{
+		if (Config.WELCOME_MESSAGE_ENABLED) {
 			activeChar.sendPacket(new ExShowScreenMessage(Config.WELCOME_MESSAGE_TEXT, Config.WELCOME_MESSAGE_TIME));
 		}
 		
 		final int birthday = activeChar.checkBirthDay();
-		if (birthday == 0)
-		{
-			activeChar.sendPacket(SystemMessageId.YOUR_BIRTHDAY_GIFT_HAS_ARRIVED);
+		if (birthday == 0) {
+			activeChar.sendPacket(YOUR_BIRTHDAY_GIFT_HAS_ARRIVED);
 			// activeChar.sendPacket(new ExBirthdayPopup()); Removed in H5?
-		}
-		else if (birthday != -1)
-		{
-			final SystemMessage sm1 = SystemMessage.getSystemMessage(SystemMessageId.THERE_ARE_S1_DAYS_UNTIL_YOUR_CHARACTERS_BIRTHDAY);
+		} else if (birthday != -1) {
+			final SystemMessage sm1 = SystemMessage.getSystemMessage(THERE_ARE_S1_DAYS_UNTIL_YOUR_CHARACTERS_BIRTHDAY);
 			sm1.addInt(birthday);
 			activeChar.sendPacket(sm1);
 		}
 		
-		if (!activeChar.getPremiumItemList().isEmpty())
-		{
+		if (!activeChar.getPremiumItemList().isEmpty()) {
 			activeChar.sendPacket(ExNotifyPremiumItem.STATIC_PACKET);
 		}
 		
@@ -570,107 +498,73 @@ public class EnterWorld extends L2GameClientPacket
 		activeChar.sendPacket(ActionFailed.STATIC_PACKET);
 	}
 	
-	private void engage(L2PcInstance cha)
-	{
+	private static void engage(L2PcInstance cha) {
 		final int chaId = cha.getObjectId();
-		for (Couple cl : CoupleManager.getInstance().getCouples())
-		{
-			if ((cl.getPlayer1Id() == chaId) || (cl.getPlayer2Id() == chaId))
-			{
-				if (cl.getMaried())
-				{
+		for (Couple cl : CoupleManager.getInstance().getCouples()) {
+			if ((cl.getPlayer1Id() == chaId) || (cl.getPlayer2Id() == chaId)) {
+				if (cl.getMaried()) {
 					cha.setMarried(true);
 				}
 				
 				cha.setCoupleId(cl.getId());
 				
-				if (cl.getPlayer1Id() == chaId)
-				{
+				if (cl.getPlayer1Id() == chaId) {
 					cha.setPartnerId(cl.getPlayer2Id());
-				}
-				else
-				{
+				} else {
 					cha.setPartnerId(cl.getPlayer1Id());
 				}
 			}
 		}
 	}
 	
-	/**
-	 * @param cha
-	 * @param partnerId
-	 */
-	private void notifyPartner(L2PcInstance cha, int partnerId)
-	{
+	private static void notifyPartner(L2PcInstance cha, int partnerId) {
 		final L2PcInstance partner = L2World.getInstance().getPlayer(cha.getPartnerId());
-		if (partner != null)
-		{
-			partner.sendMessage("Your Partner has logged in.");
+		if (partner != null) {
+			partner.sendMessage("Your partner has logged in.");
 		}
 	}
 	
-	/**
-	 * @param activeChar
-	 */
-	private void notifyClanMembers(L2PcInstance activeChar)
-	{
+	private static void notifyClanMembers(L2PcInstance activeChar) {
 		final L2Clan clan = activeChar.getClan();
-		if (clan != null)
-		{
+		if (clan != null) {
 			clan.getClanMember(activeChar.getObjectId()).setPlayerInstance(activeChar);
 			
-			final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.CLAN_MEMBER_S1_LOGGED_IN);
+			final SystemMessage msg = SystemMessage.getSystemMessage(CLAN_MEMBER_S1_LOGGED_IN);
 			msg.addString(activeChar.getName());
 			clan.broadcastToOtherOnlineMembers(msg, activeChar);
 			clan.broadcastToOtherOnlineMembers(new PledgeShowMemberListUpdate(activeChar), activeChar);
 		}
 	}
 	
-	/**
-	 * @param activeChar
-	 */
-	private void notifySponsorOrApprentice(L2PcInstance activeChar)
-	{
-		if (activeChar.getSponsor() != 0)
-		{
+	private static void notifySponsorOrApprentice(L2PcInstance activeChar) {
+		if (activeChar.getSponsor() != 0) {
 			final L2PcInstance sponsor = L2World.getInstance().getPlayer(activeChar.getSponsor());
-			if (sponsor != null)
-			{
-				final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.YOUR_APPRENTICE_S1_HAS_LOGGED_IN);
+			if (sponsor != null) {
+				final SystemMessage msg = SystemMessage.getSystemMessage(YOUR_APPRENTICE_S1_HAS_LOGGED_IN);
 				msg.addString(activeChar.getName());
 				sponsor.sendPacket(msg);
 			}
-		}
-		else if (activeChar.getApprentice() != 0)
-		{
+		} else if (activeChar.getApprentice() != 0) {
 			final L2PcInstance apprentice = L2World.getInstance().getPlayer(activeChar.getApprentice());
-			if (apprentice != null)
-			{
-				final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.YOUR_SPONSOR_C1_HAS_LOGGED_IN);
+			if (apprentice != null) {
+				final SystemMessage msg = SystemMessage.getSystemMessage(YOUR_SPONSOR_C1_HAS_LOGGED_IN);
 				msg.addString(activeChar.getName());
 				apprentice.sendPacket(msg);
 			}
 		}
 	}
 	
-	/**
-	 * @param string
-	 * @return
-	 */
-	private String getText(String string)
-	{
+	private String getText(String string) {
 		return new String(Base64.getDecoder().decode(string));
 	}
 	
 	@Override
-	public String getType()
-	{
+	public String getType() {
 		return _C__11_ENTERWORLD;
 	}
 	
 	@Override
-	protected boolean triggersOnActionRequest()
-	{
+	protected boolean triggersOnActionRequest() {
 		return false;
 	}
 }