// Reload inventory to give SA skill
activeChar.getInventory().reloadEquippedItems();
// Welcome to Lineage II
sendPacket(new SystemMessage(SystemMessageId.WELCOME_TO_LINEAGE));
SevenSigns.getInstance().sendCurrentPeriodMsg(activeChar);
Announcements.getInstance().showAnnouncements(activeChar);
loadTutorial(activeChar);
// Check for crowns
CrownManager.getInstance().checkCrowns(activeChar);
// Check player skills
if (Config.CHECK_SKILLS_ON_ENTER && !Config.ALT_GAME_SKILL_LEARN)
{
if (!activeChar.isAio())
{
activeChar.checkAllowedSkills();
}
}
PetitionManager.getInstance().checkPetitionMessages(activeChar);
// Send user info again .. just like the real client
//sendPacket(ui);
if (activeChar.getClanId() != 0 && activeChar.getClan() != null)
{
sendPacket(new PledgeShowMemberListAll(activeChar.getClan(), activeChar));
sendPacket(new PledgeStatusChanged(activeChar.getClan()));
}
if (activeChar.isAlikeDead())
sendPacket(new Die(activeChar)); // No broadcast needed since the player will already spawn dead to others
if (Config.ALLOW_WATER)
activeChar.checkWaterState();
if (Hero.getInstance().getHeroes() != null && Hero.getInstance().getHeroes().containsKey(activeChar.getObjectId()))
activeChar.setHero(true);
setPledgeClass(activeChar);
for (String name : activeChar.getFriendList())
{
L2PcInstance friend = L2World.getInstance().getPlayer(name);
if (friend != null) //friend logged in.
friend.sendPacket(new SystemMessage(SystemMessageId.FRIEND_S1_HAS_LOGGED_IN).addString(activeChar.getName()));
}
notifyClanMembers(activeChar);
notifySponsorOrApprentice(activeChar);
activeChar.setTarget(activeChar);
activeChar.onPlayerEnter();
if (Config.PCB_ENABLE)
activeChar.showPcBangWindow();
if (Config.ANNOUNCE_CASTLE_LORDS)
notifyCastleOwner(activeChar);
if (Olympiad.getInstance().playerInStadia(activeChar))
{
activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
activeChar.sendMessage("You have been teleported to the nearest town due to you being in an Olympiad Stadium");
}
if (DimensionalRiftManager.getInstance().checkIfInRiftZone(activeChar.getX(), activeChar.getY(), activeChar.getZ(), false))
DimensionalRiftManager.getInstance().teleportToWaitingRoom(activeChar);
if (activeChar.getClanJoinExpiryTime() > System.currentTimeMillis())
activeChar.sendPacket(new SystemMessage(SystemMessageId.CLAN_MEMBERSHIP_TERMINATED));
if (activeChar.getClan() != null)
{
activeChar.sendPacket(new PledgeSkillList(activeChar.getClan()));
for (Siege siege : SiegeManager.getInstance().getSieges())
{
if (!siege.getIsInProgress())
continue;
if (siege.checkIsAttacker(activeChar.getClan()))
{
activeChar.setSiegeState((byte) 1);
break;
}
else if (siege.checkIsDefender(activeChar.getClan()))
{
activeChar.setSiegeState((byte) 2);
break;
}
}
for (FortSiege fortsiege : FortSiegeManager.getInstance().getSieges())
{
if (!fortsiege.getIsInProgress())
continue;
if (fortsiege.checkIsAttacker(activeChar.getClan()))
{
activeChar.setSiegeState((byte) 1);
break;
}
else if (fortsiege.checkIsDefender(activeChar.getClan()))
{
activeChar.setSiegeState((byte) 2);
break;
}
}
// Add message at connexion if clanHall not paid. Possibly this is custom...
ClanHall clanHall = ClanHallManager.getInstance().getClanHallByOwner(activeChar.getClan());
if (clanHall != null)
if (!clanHall.getPaid())
activeChar.sendPacket(new SystemMessage(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW));
}
if (!activeChar.isGM() && activeChar.getSiegeState() < 2 && activeChar.isInsideZone(L2Character.ZONE_SIEGE))
{
// Attacker or spectator logging in to a siege zone. Actually should be checked for inside castle only?
activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
activeChar.sendMessage("You have been teleported to the nearest town due to you being in siege zone");
}
RegionBBSManager.getInstance().changeCommunityBoard();
CustomWorldHandler.getInstance().enterWorld(activeChar);
if (TvT._savePlayers.contains(activeChar.getName()))
TvT.addDisconnectedPlayer(activeChar);
if (CTF._savePlayers.contains(activeChar.getName()))
CTF.addDisconnectedPlayer(activeChar);
if (DM._savePlayers.contains(activeChar.getName()))
DM.addDisconnectedPlayer(activeChar);
if (Raid._savePlayers.contains(activeChar.getName()))
Raid.addDisconnectedPlayer(activeChar);
// Means that it's not ok multiBox situation, so logout
if (!activeChar.checkMultiBox())
{
activeChar.sendMessage("I'm sorry, but multibox is not allowed here.");
activeChar.logout();
}
Hellows(activeChar);
if (Config.ALLOW_CLASS_MASTERS && Config.ALLOW_REMOTE_CLASS_MASTERS)
{
final L2ClassMasterInstance master_instance = L2ClassMasterInstance.getInstance();
if(master_instance != null){
ClassLevel lvlnow = PlayerClass.values()[activeChar.getClassId().getId()].getLevel();
if(activeChar.getLevel() >= 20 && lvlnow == ClassLevel.First)
L2ClassMasterInstance.getInstance().onAction(activeChar);
else if(activeChar.getLevel() >= 40 && lvlnow == ClassLevel.Second)
L2ClassMasterInstance.getInstance().onAction(activeChar);
else if(activeChar.getLevel() >= 76 && lvlnow == ClassLevel.Third)
L2ClassMasterInstance.getInstance().onAction(activeChar);
}else{
_log.info("Attention: Remote ClassMaster is Enabled, but not inserted into DataBase. Remember to install 31288 Custom_Npc ..");
}
}
// Apply night/day bonus on skill Shadow Sense
if (activeChar.getRace().ordinal() == 2)
{
final L2Skill skill = SkillTable.getInstance().getInfo(294, 1);
if (skill != null && activeChar.getSkillLevel(294) == 1)
{
if (GameTimeController.getInstance().isNowNight())
{
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.NIGHT_EFFECT_APPLIES);
sm.addSkillName(294);
sendPacket(sm);
activeChar.sendSkillList();
}
else
{
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.DAY_EFFECT_DISAPPEARS);
sm.addSkillName(294);
sendPacket(sm);
activeChar.sendSkillList();
}
}
}