te0x Posted March 26, 2015 Posted March 26, 2015 (edited) The title says everything ;D Contains announces for Clan Leader, Top Pvp player, Top Pk player, Heroes, Raid/Grand bosses deaths-respawns, bans, chat bans, jails. network/clientpackets/EnterWorld.java find this part private void loadTutorial(final L2PcInstance player) { final QuestState qs = player.getQuestState("255_Tutorial"); if (qs != null) qs.getQuest().notifyEvent("UC", null, player); } after this add private void notifyCastleOwner(final L2PcInstance activeChar) { final L2Clan clan = activeChar.getClan(); if (clan != null) { if (clan.getHasCastle() > 0) { final Castle castle = CastleManager.getInstance().getCastleById(clan.getHasCastle()); if ((castle != null) && (activeChar.getObjectId() == clan.getLeaderId())) Announcements.getInstance().announceToAll("Lord " + activeChar.getName() + " Ruler Of " + castle.getName() + " Castle is now Online!"); } } } private void announceTopPvp(L2PcInstance activeChar) { String name = null; Connection con = null; PreparedStatement statement = null; try { con = L2DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement("SELECT char_name,pvpkills FROM characters WHERE accesslevel=0 ORDER BY pvpkills DESC LIMIT 1"); ResultSet rset = statement.executeQuery(); while (rset.next()) { name = rset.getString("char_name"); if (activeChar.getName().equals(name) && !activeChar.isGM() && activeChar.getPvpKills() != 0) Announcements.getInstance().announceToAll("Top PVP Player " + name +" Is Now Online !"); } rset.close(); statement.close(); } catch (Exception e) {} finally { L2DatabaseFactory.close(con); } } private void announceTopPk(L2PcInstance activeChar) { String name = null; Connection con = null; PreparedStatement statement = null; try { con = L2DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement("SELECT char_name,pkkills FROM characters WHERE accesslevel=0 ORDER BY pkkills DESC LIMIT 1"); ResultSet rset = statement.executeQuery(); while (rset.next()) { name = rset.getString("char_name"); if (activeChar.getName().equals(name) && !activeChar.isGM() && activeChar.getPkKills() != 0) Announcements.getInstance().announceToAll("Top PK Player " + name +" Is Now Online !"); } rset.close(); statement.close(); } catch (Exception e) {} finally { L2DatabaseFactory.close(con); } } private void announceHeroes(L2PcInstance activeChar) { if (activeChar.getBaseClass() == 88 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Duelist Class is now online!"); } if (activeChar.getBaseClass() == 89 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Dreadnought Class is now online!"); } if (activeChar.getBaseClass() == 90 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Phoenix Knight Class is now online!"); } if (activeChar.getBaseClass() == 91 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Hell Knight Class is now online!"); } if (activeChar.getBaseClass() == 92 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Sagittarius Class is now online!"); } if (activeChar.getBaseClass() == 93 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Adventurer Class is now online!"); } if (activeChar.getBaseClass() == 94 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Archmage Class is now online!"); } if (activeChar.getBaseClass() == 95 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Soultaker Class is now online!"); } if (activeChar.getBaseClass() == 96 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Arcana Lord Class is now online!"); } if (activeChar.getBaseClass() == 97 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Cardinal Class is now online!"); } if (activeChar.getBaseClass() == 98 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Hierophant Class is now online!"); } if (activeChar.getBaseClass() == 99 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Eva Templar Class is now online!"); } if (activeChar.getBaseClass() == 100 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Sword Muse Class is now online!"); } if (activeChar.getBaseClass() == 101 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Wind Rider Class is now online!"); } if (activeChar.getBaseClass() == 102 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Moonlight Sentinel Class is now online!"); } if (activeChar.getBaseClass() == 103 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Mystic Muse Class is now online!"); } if (activeChar.getBaseClass() == 104 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Elemental Master Class is now online!"); } if (activeChar.getBaseClass() == 105 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Eva Saint Class is now online!"); } if (activeChar.getBaseClass() == 106 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Shillien Templar Class is now online!"); } if (activeChar.getBaseClass() == 107 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Spectral Dancer Class is now online!"); } if (activeChar.getBaseClass() == 108 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Ghost Hunter Class is now online!"); } if (activeChar.getBaseClass() == 109 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Ghost Sentinel Class is now online!"); } if (activeChar.getBaseClass() == 110 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Storm Screamer Class is now online!"); } if (activeChar.getBaseClass() == 111 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Spectral Master Class is now online!"); } if (activeChar.getBaseClass() == 112 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Shillen Saint Class is now online!"); } if (activeChar.getBaseClass() == 113 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Titan Class is now online!"); } if (activeChar.getBaseClass() == 114 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Grand Khauatari Class is now online!"); } if (activeChar.getBaseClass() == 115 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Dominator Class is now online!"); } if (activeChar.getBaseClass() == 116 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Doomcryer Class is now online!"); } if (activeChar.getBaseClass() == 117 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Fortune Seeker Class is now online!"); } if (activeChar.getBaseClass() == 118 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Maestro Class is now online!"); } } now find this part if (Config.WELCOME_HTM && isValidName(activeChar.getName())) { final String Welcome_Path = "data/html/welcome.htm"; final File mainText = new File(Config.DATAPACK_ROOT, Welcome_Path); if (mainText.exists()) { final NpcHtmlMessage html = new NpcHtmlMessage(1); html.setFile(Welcome_Path); html.replace("%name%", activeChar.getName()); sendPacket(html); } } below add announceTopPvp(activeChar); announceTopPk(activeChar); announceHeroes(activeChar); notifyCastleOwner(activeChar); now in instances. model/actor/instance/L2RaidBossInstance.java if (player != null) { + if (player.getClan() != null) + Announcements.getInstance().announceToAll(getName() +" was defeated by " + player.getClan().getLeaderName() + "'s clan ("+player.getClan().getName()+")"); + else + Announcements.getInstance().announceToAll(getName() +" was defeated by " + player.getName()); SystemMessage msg = new SystemMessage(SystemMessageId.RAID_WAS_SUCCESSFUL); model/actor/instance/L2GrandBossInstance.java if (player != null) { + if (player.getClan() != null) + Announcements.getInstance().announceToAll(getName() +" was defeated by " + player.getClan().getLeaderName() + "'s clan ("+player.getClan().getName()+")"); + else + Announcements.getInstance().announceToAll(getName() +" was defeated by " + player.getName()); SystemMessage msg = new SystemMessage(SystemMessageId.RAID_WAS_SUCCESSFUL); gameserver/managers/RaidBossSpawnManager.java GmListTable.broadcastMessageToGMs("Spawning Raid Boss " + raidboss.getName()); + Announcements.getInstance().announceToAll("Raid boss " + raidboss.getName() + " spawned in world."); _bosses.put(bossId, raidboss); handler/admincommandhandlers/AdminBan.java auditAction(command, activeChar, (targetPlayer == null ? player : targetPlayer.getName())); + Announcements.getInstance().announceToAll(targetPlayer.getName() + " is banned."); return changeCharAccessLevel(targetPlayer, player, activeChar, -100); activeChar.sendMessage(targetPlayer.getName() + " is now chat banned" + banLengthStr + "."); + Announcements.getInstance().announceToAll(targetPlayer.getName() + " is now chat banned" + banLengthStr + "."); auditAction(command, activeChar, targetPlayer.getName()); activeChar.sendMessage("Character " + targetPlayer.getName() + " jailed for " + (duration > 0 ? duration + " minutes." : "ever!")); + Announcements.getInstance().announceToAll(targetPlayer.getName() + " is now in jail for " + (duration > 0 ? duration + " minutes." : "ever!")); auditAction(command, activeChar, targetPlayer.getName()); Edited March 26, 2015 by te0x Quote
Nightw0lf Posted March 26, 2015 Posted March 26, 2015 more spam for your server :D and as sweety said switch will be more useful instead of if if if if... if Quote
Elfosass Posted March 26, 2015 Posted March 26, 2015 (edited) God you are terrible. This: private void announceHeroes(L2PcInstance activeChar) { if (activeChar.getBaseClass() == 88 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Duelist Class is now online!"); } if (activeChar.getBaseClass() == 89 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Dreadnought Class is now online!"); } if (activeChar.getBaseClass() == 90 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Phoenix Knight Class is now online!"); } if (activeChar.getBaseClass() == 91 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Hell Knight Class is now online!"); } if (activeChar.getBaseClass() == 92 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Sagittarius Class is now online!"); } if (activeChar.getBaseClass() == 93 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Adventurer Class is now online!"); } if (activeChar.getBaseClass() == 94 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Archmage Class is now online!"); } if (activeChar.getBaseClass() == 95 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Soultaker Class is now online!"); } if (activeChar.getBaseClass() == 96 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Arcana Lord Class is now online!"); } if (activeChar.getBaseClass() == 97 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Cardinal Class is now online!"); } if (activeChar.getBaseClass() == 98 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Hierophant Class is now online!"); } if (activeChar.getBaseClass() == 99 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Eva Templar Class is now online!"); } if (activeChar.getBaseClass() == 100 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Sword Muse Class is now online!"); } if (activeChar.getBaseClass() == 101 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Wind Rider Class is now online!"); } if (activeChar.getBaseClass() == 102 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Moonlight Sentinel Class is now online!"); } if (activeChar.getBaseClass() == 103 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Mystic Muse Class is now online!"); } if (activeChar.getBaseClass() == 104 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Elemental Master Class is now online!"); } if (activeChar.getBaseClass() == 105 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Eva Saint Class is now online!"); } if (activeChar.getBaseClass() == 106 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Shillien Templar Class is now online!"); } if (activeChar.getBaseClass() == 107 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Spectral Dancer Class is now online!"); } if (activeChar.getBaseClass() == 108 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Ghost Hunter Class is now online!"); } if (activeChar.getBaseClass() == 109 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Ghost Sentinel Class is now online!"); } if (activeChar.getBaseClass() == 110 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Storm Screamer Class is now online!"); } if (activeChar.getBaseClass() == 111 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Spectral Master Class is now online!"); } if (activeChar.getBaseClass() == 112 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Shillen Saint Class is now online!"); } if (activeChar.getBaseClass() == 113 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Titan Class is now online!"); } if (activeChar.getBaseClass() == 114 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Grand Khauatari Class is now online!"); } if (activeChar.getBaseClass() == 115 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Dominator Class is now online!"); } if (activeChar.getBaseClass() == 116 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Doomcryer Class is now online!"); } if (activeChar.getBaseClass() == 117 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Fortune Seeker Class is now online!"); } if (activeChar.getBaseClass() == 118 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Maestro Class is now online!"); } } is actually this private void announceHeroes(L2PcInstance activeChar) { if(activeChar.isHero()) Announcements.announceToAll(activeChar.getName() + " Hero of "+ activeChar.getTemplate().getClassName() + " Class is now online!"); } Get your shit together and study some programming logic damnit. Edited March 26, 2015 by Elfosass Quote
te0x Posted March 26, 2015 Author Posted March 26, 2015 God you are terrible. This: private void announceHeroes(L2PcInstance activeChar) { if (activeChar.getBaseClass() == 88 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Duelist Class is now online!"); } if (activeChar.getBaseClass() == 89 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Dreadnought Class is now online!"); } if (activeChar.getBaseClass() == 90 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Phoenix Knight Class is now online!"); } if (activeChar.getBaseClass() == 91 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Hell Knight Class is now online!"); } if (activeChar.getBaseClass() == 92 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Sagittarius Class is now online!"); } if (activeChar.getBaseClass() == 93 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Adventurer Class is now online!"); } if (activeChar.getBaseClass() == 94 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Archmage Class is now online!"); } if (activeChar.getBaseClass() == 95 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Soultaker Class is now online!"); } if (activeChar.getBaseClass() == 96 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Arcana Lord Class is now online!"); } if (activeChar.getBaseClass() == 97 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Cardinal Class is now online!"); } if (activeChar.getBaseClass() == 98 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Hierophant Class is now online!"); } if (activeChar.getBaseClass() == 99 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Eva Templar Class is now online!"); } if (activeChar.getBaseClass() == 100 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Sword Muse Class is now online!"); } if (activeChar.getBaseClass() == 101 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Wind Rider Class is now online!"); } if (activeChar.getBaseClass() == 102 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Moonlight Sentinel Class is now online!"); } if (activeChar.getBaseClass() == 103 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Mystic Muse Class is now online!"); } if (activeChar.getBaseClass() == 104 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Elemental Master Class is now online!"); } if (activeChar.getBaseClass() == 105 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Eva Saint Class is now online!"); } if (activeChar.getBaseClass() == 106 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Shillien Templar Class is now online!"); } if (activeChar.getBaseClass() == 107 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Spectral Dancer Class is now online!"); } if (activeChar.getBaseClass() == 108 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Ghost Hunter Class is now online!"); } if (activeChar.getBaseClass() == 109 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Ghost Sentinel Class is now online!"); } if (activeChar.getBaseClass() == 110 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Storm Screamer Class is now online!"); } if (activeChar.getBaseClass() == 111 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Spectral Master Class is now online!"); } if (activeChar.getBaseClass() == 112 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Shillen Saint Class is now online!"); } if (activeChar.getBaseClass() == 113 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Titan Class is now online!"); } if (activeChar.getBaseClass() == 114 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Grand Khauatari Class is now online!"); } if (activeChar.getBaseClass() == 115 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Dominator Class is now online!"); } if (activeChar.getBaseClass() == 116 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Doomcryer Class is now online!"); } if (activeChar.getBaseClass() == 117 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Fortune Seeker Class is now online!"); } if (activeChar.getBaseClass() == 118 && activeChar.isHero()) { Announcements.getInstance().announceToAll(activeChar.getName() + " Hero of Maestro Class is now online!"); } } is actually this private void announceHeroes(L2PcInstance activeChar) { if(activeChar.isHero()) Announcements.announceToAll(activeChar.getName() + " Hero of "+ activeChar.getTemplate().getClassName() + " Class is now online!"); } Get your shit together and study some programming logic damnit. This will announce u as a hero if u are on a subclass aswell. "Hero of Duelist class is now online" and actually his base class is Soultaker :O this is made like 1-2 years ago i didn't even knew what are the switch cases ;D Quote
Elfosass Posted March 26, 2015 Posted March 26, 2015 So what? use the getBaseClass() method. And you still don't know what switches are. Quote
te0x Posted March 26, 2015 Author Posted March 26, 2015 So what? use the getBaseClass() method. And you still don't know what switches are. hehe maybe :) still who said that i am a programmer? or i wanna be a programmer so my codes have to be clean or anything else? Does it works? Quote
Elfosass Posted March 26, 2015 Posted March 26, 2015 hehe maybe :) still who said that i am a programmer? or i wanna be a programmer so my codes have to be clean or anything else? Does it works? You cant be a programmer if your codes just work. A program shitty coded will under perform compared to a program clean coded. Learn from the start to code properly or else you will end up with shitty knowledge. Quote
te0x Posted March 26, 2015 Author Posted March 26, 2015 You cant be a programmer if your codes just work. A program shitty coded will under perform compared to a program clean coded. Learn from the start to code properly or else you will end up with shitty knowledge. You are right but you are talking with the wrong guy ;D Quote
Kounto Posted October 7, 2015 Posted October 7, 2015 To top pvp / top pk den leitourgei... to hero kai ta lipa kanonika. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.