-
Posts
20 -
Credits
0 -
Joined
-
Last visited
-
Feedback
0%
About ledion22
Profile Information
-
Gender
Not Telling
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
ledion22's Achievements
Newbie (1/16)
0
Reputation
-
that put to change the type not flag zone, pvp zone does not manage to do Opium man will help. thex
-
package com.l2jfrozen.gameserver.model.actor.instance; import java.sql.Connection; import java.sql.PreparedStatement; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; import javolution.text.TextBuilder; import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.ai.CtrlIntention; import com.l2jfrozen.gameserver.communitybbs.Manager.RegionBBSManager; import com.l2jfrozen.gameserver.datatables.sql.CharNameTable; import com.l2jfrozen.gameserver.datatables.sql.ClanTable; import com.l2jfrozen.gameserver.model.Inventory; import com.l2jfrozen.gameserver.model.L2World; import com.l2jfrozen.gameserver.network.SystemMessageId; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.LeaveWorld; import com.l2jfrozen.gameserver.network.serverpackets.MagicSkillUser; import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jfrozen.gameserver.network.serverpackets.PartySmallWindowAll; import com.l2jfrozen.gameserver.network.serverpackets.PartySmallWindowDeleteAll; import com.l2jfrozen.gameserver.network.serverpackets.PledgeShowMemberListAll; import com.l2jfrozen.gameserver.network.serverpackets.PledgeShowMemberListUpdate; import com.l2jfrozen.gameserver.network.serverpackets.SocialAction; import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage; import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation; import com.l2jfrozen.gameserver.templates.L2NpcTemplate; import com.l2jfrozen.gameserver.util.Util; import com.l2jfrozen.util.CloseUtil; import com.l2jfrozen.util.database.L2DatabaseFactory; public class L2te0xServiceNpcInstance extends L2NpcInstance { private final static int ITEM_ID = 8871; String INSERT_DATA = "REPLACE INTO characters_custom_data (obj_Id, char_name, hero, noble, donator, hero_end_date) VALUES (?,?,?,?,?,?)"; String INSERT_DATAA = "REPLACE INTO characters_custom_data (obj_Id, char_name, hero, noble, donator) VALUES (?,?,?,?,?)"; public L2te0xServiceNpcInstance(int objectId, L2NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(L2PcInstance player, String command) { if (player == null) { return; } else if (command.startsWith("active")) { showActiveWindow(player, 0); } else if (command.startsWith("passive")) { showPassiveWindow(player, 0); } else if (command.startsWith("back")) { showChatWindow(player, 0); } else if (command.startsWith("Refresh")) { addAugment(player, 16287, 3202, 3); } else if (command.startsWith("Refresh")) { addAugment(player, 16287, 3132, 10); } else if (command.startsWith("Ritual")) { addAugment(player, 16183, 3130, 10); } else if (command.startsWith("Heal")) { addAugment(player, 16195, 3123, 10); } else if (command.startsWith("Recharge")) { addAugment(player, 16204, 3127, 10); } else if (command.startsWith("Cheer")) { addAugment(player, 16197, 3131, 10); } else if (command.startsWith("Celestial")) { addAugment(player, 15047, 3158, 1); } else if (command.startsWith("BlessedSoul")) { addAugment(player, 16200, 3128, 10); } else if (command.startsWith("BlessedBody")) { addAugment(player, 16199, 3124, 10); } else if (command.startsWith("Empower")) { addAugment(player, 16281, 3241, 10); } else if (command.startsWith("MagicBarrier")) { addAugment(player, 16282, 3245, 10); } else if (command.startsWith("Might")) { addAugment(player, 16283, 3240, 10); } else if (command.startsWith("Shield")) { addAugment(player, 16284, 3244, 10); } else if (command.startsWith("DuelMight")) { addAugment(player, 16285, 3243, 10); } else if (command.startsWith("Focus")) { addAugment(player, 16333, 3249, 10); } else if (command.startsWith("WildMagic")) { addAugment(player, 16336, 3250, 10); } else if (command.startsWith("Agility")) { addAugment(player, 16332, 3247, 10); } else if (command.startsWith("Guidance")) { addAugment(player, 16335, 3248, 10); } else if (command.startsWith("changeName2")) { showNameWindow(player, 0); } else if (command.startsWith("changeClanName2")) { showClanNameWindow(player, 0); } else if (command.startsWith("changeName")) { String _name = command.substring(11); String errorMsg = null; boolean proceed = true; if (_name.length() < 3) { errorMsg = "Names have to be at least 3 characters"; proceed = false; showNameWindow(player, 0); } if (_name.length() > 16) { errorMsg = "Names cannot be longer than 16 characters"; proceed = false; showNameWindow(player, 0); } if ((!Util.isAlphaNumeric(_name)) || (!isValidName(_name))) { errorMsg = "Invalid name"; proceed = false; showNameWindow(player, 0); } if (CharNameTable.getInstance().doesCharNameExist(_name)) { if ((!player.getName().equalsIgnoreCase(_name)) || (player.getName().equals(_name))) { errorMsg = "Name already exists"; proceed = false; showNameWindow(player, 0); } } if (!proceed) { player.sendMessage(errorMsg); showNameWindow(player, 0); return; } if (player.destroyItemByItemId("Consume", ITEM_ID, 10, player, true)) { try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("UPDATE characters SET char_name=? WHERE obj_Id=?")) { statement.setString(1, _name); statement.setInt(2, player.getObjectId()); statement.execute(); statement.close(); } catch (Exception e) { LOGGER.info("Error updating name for player " + player.getName() + ". Error: " + e); } L2World.getInstance().removeFromAllPlayers(player); player.setName(_name); player.store(); L2World.getInstance().addToAllPlayers(player); player.sendMessage("Your new character name is " + _name); player.broadcastUserInfo(); player.sendMessage("Thank you for helping our server!"); if (player.isInParty()) { // Delete party window for other party members player.getParty().broadcastToPartyMembers(player, new PartySmallWindowDeleteAll()); for (final L2PcInstance member : player.getParty().getPartyMembers()) { // And re-add if (member != player) { member.sendPacket(new PartySmallWindowAll(player, player.getParty())); } } } if (player.getClan() != null) { player.getClan().updateClanMember(player); player.getClan().broadcastToOnlineMembers(new PledgeShowMemberListUpdate(player)); player.sendPacket(new PledgeShowMemberListAll(player.getClan(), player)); } RegionBBSManager.getInstance().changeCommunityBoard(); } } else if (command.startsWith("changeClanName")) { String _name = command.substring(15); String errorMsg = null; boolean proceed = true; if (_name.length() < 2) { errorMsg = "Clan Names have to be at least 2 characters"; proceed = false; showClanNameWindow(player, 0); } if (_name.length() > 16) { errorMsg = "Clan Names cannot be longer than 16 characters"; proceed = false; showClanNameWindow(player, 0); } if ((!Util.isAlphaNumeric(_name)) || (!isValidClanName(_name))) { errorMsg = "Invalid name"; proceed = false; showClanNameWindow(player, 0); } if (ClanTable.getInstance().getClanByName(_name) != null) { errorMsg = "Name already exists"; proceed = false; showClanNameWindow(player, 0); } if (!proceed) { player.sendMessage(errorMsg); showClanNameWindow(player, 0); return; } if (player.destroyItemByItemId("Consume", ITEM_ID, 10, player, true)) { try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("UPDATE clan_data SET clan_name=? WHERE clan_id=?")) { statement.setString(1, _name); statement.setInt(2, player.getClan().getClanId()); statement.execute(); statement.close(); } catch (Exception e) { LOGGER.info("Error updating clan name for player " + player.getName() + ". Error: " + e); } player.getClan().setName(_name); player.sendMessage("Your new clan name is " + _name); player.sendMessage("Thank you for helping our server!"); player.getClan().broadcastClanStatus(); } } else if (command.startsWith("setNoble")) { if (!player.isNoble()) { if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) >= 10) { player.destroyItemByItemId("Consume", ITEM_ID, 10, player, true); player.getInventory().addItem("Tiara", 7694, 1, player, null); player.setNoble(true); player.setTarget(player); player.broadcastPacket(new MagicSkillUser(player, 5103, 1, 1000, 0)); player.broadcastUserInfo(); player.broadcastPacket(new SocialAction(player.getObjectId(), 16)); player.sendMessage("The greatest soul of the Flame of Splendor Barakiel is now following your spirit by gifting you the Noblesse status. Status that only a few true Semi-Gods can have."); } else { player.sendMessage("You don't have enough items."); } } else { player.sendMessage("The greatest soul of the Flame of Splendor Barakiel is already following your spirit and gifting it with the Noblesse status."); } } else if (command.startsWith("setDonator")) { if (!player.isDonator()) { if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) >= 7) { player.destroyItemByItemId("Consume", ITEM_ID, 1, player, true); player.setDonator(true); player.setTarget(player); updateDatabasex(player, true); player.broadcastPacket(new MagicSkillUser(player, 5103, 1, 1000, 0)); player.broadcastUserInfo(); player.sendMessage("You are gifted with the Donator status. Thank you for being a helpful player on our server!"); } else { player.sendMessage("You don't have enough items."); } } else { player.sendMessage("You already own Donator status."); } } else if (command.startsWith("reducePks2")) { showPksWindow(player, 0); } else if (command.startsWith("reducePks")) { try { String pkReduceString = command.substring(10); int pkReduceCount = Integer.parseInt(pkReduceString); if (player.getPkKills() != 0) { if (pkReduceCount == 0) { player.sendMessage("Please, put a higher value."); showPksWindow(player, 0); } else { if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) >= 1) { player.destroyItemByItemId("Consume", ITEM_ID, 1 * pkReduceCount, player, true); player.setPkKills(player.getPkKills() - pkReduceCount); player.sendMessage("You have successfuly cleaned " + pkReduceCount + " PKs."); player.broadcastUserInfo(); } else { player.sendMessage("Not enough items."); } } } else { player.sendMessage("Not enough PKs."); } } catch (Exception e) { player.sendMessage("Incorrect value. Please try again."); showPksWindow(player, 0); } } else if (command.startsWith("levelUpClan")) { if (!player.isClanLeader()) { player.sendMessage("You must be a clan leader in order to use this service."); } else { if (player.getClan().getLevel() == 8) { player.sendMessage("Your clan is already level 8."); } else { if (((player.getClan().getLevel() <= 1) || (player.getClan().getLevel() == 2) || (player.getClan().getLevel() == 3) || (player.getClan().getLevel() == 4))) { player.getClan().setLevel(player.getClan().getLevel() + 1); player.getClan().broadcastClanStatus(); player.sendMessage("Your clan is now level " + player.getClan().getLevel() + "."); player.setTarget(player); player.broadcastPacket(new MagicSkillUser(player, 5103, 1, 1000, 0)); int newCLanLevel = player.getClan().getLevel() +1; LOGGER.info("Updating clan ID " + player.getClan().getClanId() +" to level " + newCLanLevel + " for player " + player.getName() + "."); try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("UPDATE clan_data SET clan_level=? WHERE clan_id=?")) { statement.setInt(1, player.getClan().getLevel()); statement.setInt(2, player.getClan().getClanId()); statement.execute(); statement.close(); } catch (Exception e) { LOGGER.info("Error updating clan level for player " + player.getName() + ". Error: " + e); } player.sendMessage("Your clan level have been increased successfully."); } else if (player.getClan().getLevel() == 5) { if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) >= 10) { player.destroyItemByItemId("Consume", ITEM_ID, 10, player, true); player.getClan().setLevel(player.getClan().getLevel() + 1); player.getClan().broadcastClanStatus(); player.sendMessage("Your clan is now level " + player.getClan().getLevel() + "."); player.setTarget(player); player.broadcastPacket(new MagicSkillUser(player, 5103, 1, 1000, 0)); int newCLanLevel = player.getClan().getLevel() +1; LOGGER.info("Updating clan ID " + player.getClan().getClanId() +" to level " + newCLanLevel + " for player " + player.getName() + "."); try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("UPDATE clan_data SET clan_level=? WHERE clan_id=?")) { statement.setInt(1, player.getClan().getLevel()); statement.setInt(2, player.getClan().getClanId()); statement.execute(); statement.close(); } catch (Exception e) { LOGGER.info("Error updating clan level for player " + player.getName() + ". Error: " + e); } player.sendMessage("Your clan level have been increased successfully."); } else { player.sendMessage("Not enough items."); } } else if (player.getClan().getLevel() == 6) { if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) >= 10) { player.destroyItemByItemId("Consume", ITEM_ID, 10, player, true); player.getClan().setLevel(player.getClan().getLevel() + 1); player.getClan().broadcastClanStatus(); player.sendMessage("Your clan is now level " + player.getClan().getLevel() + "."); player.setTarget(player); player.broadcastPacket(new MagicSkillUser(player, 5103, 1, 1000, 0)); int newCLanLevel = player.getClan().getLevel() +1; LOGGER.info("Updating clan ID " + player.getClan().getClanId() +" to level " + newCLanLevel + " for player " + player.getName() + "."); try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("UPDATE clan_data SET clan_level=? WHERE clan_id=?")) { statement.setInt(1, player.getClan().getLevel()); statement.setInt(2, player.getClan().getClanId()); statement.execute(); statement.close(); } catch (Exception e) { LOGGER.info("Error updating clan level for player " + player.getName() + ". Error: " + e); } player.sendMessage("Your clan level have been increased successfully."); } else { player.sendMessage("Not enough items."); } } else if (player.getClan().getLevel() == 7) { if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) >= 10) { player.destroyItemByItemId("Consume", ITEM_ID, 10, player, true); player.getClan().setLevel(player.getClan().getLevel() + 1); player.getClan().broadcastClanStatus(); player.sendMessage("Your clan is now level " + player.getClan().getLevel() + "."); player.setTarget(player); player.broadcastPacket(new MagicSkillUser(player, 5103, 1, 1000, 0)); int newCLanLevel = player.getClan().getLevel() +1; LOGGER.info("Updating clan ID " + player.getClan().getClanId() +" to level " + newCLanLevel + " for player " + player.getName() + "."); try (Connection con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("UPDATE clan_data SET clan_level=? WHERE clan_id=?")) { statement.setInt(1, player.getClan().getLevel()); statement.setInt(2, player.getClan().getClanId()); statement.execute(); statement.close(); } catch (Exception e) { LOGGER.info("Error updating clan level for player " + player.getName() + ". Error: " + e); } player.sendMessage("Your clan level have been increased successfully."); } else { player.sendMessage("Not enough items."); } } player.getClan().broadcastClanStatus(); } } } else if (command.startsWith("changeGender")) { if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) >= 5) { player.getAppearance().setSex(player.getAppearance().getSex() ? false : true); player.setTarget(player); player.broadcastPacket(new MagicSkillUser(player, 5103, 1, 1000, 0)); player.destroyItemByItemId("Consume", ITEM_ID, 10, player, true); L2PcInstance.setSexDB(player, 1); player.sendMessage("You have successfully changed your sex."); player.decayMe(); player.spawnMe(player.getX(), player.getY(), player.getZ()); player.broadcastUserInfo(); } else { player.sendMessage("You don't have enough items."); } } else if (command.startsWith("hero")) { if (!player.isHero()) { if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) >= 10) { player.broadcastPacket(new SocialAction(player.getObjectId(), 16)); player.setHero(true); updateDatabase(player, 1 * 24L * 60L * 60L * 1000L); player.sendMessage("You have been hero for 1 day. Have a nice time!"); player.broadcastUserInfo(); player.destroyItemByItemId("Consume", ITEM_ID, 10, player, true); } else { player.sendMessage("You don't have enough items."); } } else { player.sendMessage("You already are a hero."); } } } @Override public void onAction(L2PcInstance player) { if (this != player.getTarget()) { player.setTarget(this); player.sendPacket(new MyTargetSelected(getObjectId(), 0)); player.sendPacket(new ValidateLocation(this)); } else if (!canInteract(player)) { player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this); } else { showChatWindow(player, 0); } // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet player.sendPacket(ActionFailed.STATIC_PACKET); } @Override public void showChatWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><head><title>Lineage II Addicted - Donate Panel</title></head><body>"); tb.append("<center><img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<table bgcolor=000000 width=300 height=40>"); tb.append("<tr>"); tb.append("<td width=\"300\" align=\"center\"><font color=\"666666\">Welcome " + player.getName() +" in Lineage II</font><font color=\"FF9900\"> -Addicted-</font></td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<br>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("</center>"); tb.append("<center>"); tb.append("<table bgcolor=000000 width=300 height=12>"); tb.append("<tr>"); tb.append("<td width=\"300\" align=\"center\"><font color=\"FF0000\">{Donate Panel}</font></td>"); tb.append("</tr>"); tb.append("<tr>"); tb.append("<td width=\"300\" align=\"center\"><font color=\"666666\">Help us to improve our server by donating!</font></td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<br>"); tb.append("<center>"); tb.append("<table>"); tb.append("<tr><td align=center><font color=\"FF9900\"><a action=\"bypass -h npc_%objectId%_active\">Active Augment (20 Donate coins)</a></font></td></tr>"); tb.append("<tr><td align=center><font color=\"FF9900\"><a action=\"bypass -h npc_%objectId%_passive\">Passive Augment (20 Donate coins)</a></font></td></tr>"); tb.append("<tr><td align=center><font color=\"FF9900\"><a action=\"bypass -h npc_%objectId%_hero\">Become Hero 24h (20 Donate coins)</a></font></td></tr>"); tb.append("<tr><td align=center><font color=\"FF9900\"><a action=\"bypass -h npc_%objectId%_setNoble\">Become Noblesse (10 Donate coins)</a></font></td></tr>"); tb.append("<tr><td align=center><font color=\"FF9900\"><a action=\"bypass -h npc_%objectId%_setDonator\">Become Donator (50 Donate coins)</a></font></td></tr>"); tb.append("<tr><td align=center><font color=\"FF9900\"><a action=\"bypass -h npc_%objectId%_changeName2\">Change Name (10 Donate coins)</a></font></td></tr>"); tb.append("<tr><td align=center><font color=\"FF9900\"><a action=\"bypass -h npc_%objectId%_changeGender\">Change Sex (10 Donate coins)</a></font></td></tr>"); tb.append("<tr><td align=center><font color=\"FF9900\"><a action=\"bypass -h npc_%objectId%_reducePks2\">Remove Pks (1 pk = 1 Donate coin)</a></font></td></tr>"); tb.append("<tr><td align=center><font color=\"FF9900\"><a action=\"bypass -h npc_%objectId%_changeClanName2\">Change Clan Name (10 Donate coins)</a></font></td></tr>"); tb.append("<tr><td align=center><font color=\"FF9900\"><a action=\"bypass -h npc_%objectId%_levelUpClan\">Clan level up (10 Donate coins per lvl)</a></font></td></tr>"); tb.append("</table>"); tb.append("<br>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<table border=0 bgcolor=000000 width=300 height=20>"); tb.append("<tr>"); tb.append("<td align=\"center\" width=\"300\"><font color=\"666666\">Vote for us :</font><font color=\"FF5555\"> www.l2addicted.eu</font></td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("</center>"); tb.append("</body></html>"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } public void showActiveWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><head><title>Lineage II Addicted - Active Augment</title></head><body>"); tb.append("<center><img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("</center>"); tb.append("<center>"); tb.append("<table bgcolor=000000 width=300 height=12>"); tb.append("<tr>"); tb.append("<td width=\"300\" align=\"center\"><font color=\"FF0000\">{Remove Pks}</font></td>"); tb.append("</tr>"); tb.append("<tr>"); tb.append("<td width=\"300\" align=\"center\"><font color=\"666666\">Add a passive skill for 10 donate coins.</font></td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<br>"); tb.append("<center>"); tb.append("<button value=\"Celestial\" action=\"bypass -h npc_%objectId%_Celestial\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Refresh\" action=\"bypass -h npc_%objectId%_Refresh\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Migth\" action=\"bypass -h npc_%objectId%_Migth\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Ritual\" action=\"bypass -h npc_%objectId%_Ritual\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Heal\" action=\"bypass -h npc_%objectId%_Heal\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Recharge\" action=\"bypass -h npc_%objectId%_Recharge\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Cheer\" action=\"bypass -h npc_%objectId%_Cheer\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Blessed Soul\" action=\"bypass -h npc_%objectId%_BlessedSoul\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Blessed Body\" action=\"bypass -h npc_%objectId%_BlessedBody\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>"); tb.append("<br>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<table border=0 bgcolor=000000 width=300 height=20>"); tb.append("<tr>"); tb.append("<td align=\"center\" width=\"300\"><font color=\"666666\">Vote for us :</font><font color=\"FF5555\"> www.l2addicted.eu</font></td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("</center>"); tb.append("</body></html>"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } public void showPassiveWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><head><title>Lineage II Addicted - Passive Augment</title></head><body>"); tb.append("<center><img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("</center>"); tb.append("<center>"); tb.append("<table bgcolor=000000 width=300 height=12>"); tb.append("<tr>"); tb.append("<td width=\"300\" align=\"center\"><font color=\"FF0000\">{Remove Pks}</font></td>"); tb.append("</tr>"); tb.append("<tr>"); tb.append("<td width=\"300\" align=\"center\"><font color=\"666666\">Add a passive skill for 10 donate coins.</font></td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<br>"); tb.append("<center>"); tb.append("<button value=\"Empower\" action=\"bypass -h npc_%objectId%_Empower\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"M.Barrier\" action=\"bypass -h npc_%objectId%_MagicBarrier\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Might\" action=\"bypass -h npc_%objectId%_Might\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Shield\" action=\"bypass -h npc_%objectId%_Shield\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Duel Might\" action=\"bypass -h npc_%objectId%_DuelMight\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Focus\" action=\"bypass -h npc_%objectId%_Focus\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Wild Magic\" action=\"bypass -h npc_%objectId%_WildMagic\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Agility\" action=\"bypass -h npc_%objectId%_Agility\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<button value=\"Guidance\" action=\"bypass -h npc_%objectId%_Guidance\" width=75 height=21 back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\">"); tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>"); tb.append("<br>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<table border=0 bgcolor=000000 width=300 height=20>"); tb.append("<tr>"); tb.append("<td align=\"center\" width=\"300\"><font color=\"666666\">Vote for us :</font><font color=\"FF5555\"> www.l2addicted.eu</font></td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("</center>"); tb.append("</body></html>"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } public void showPksWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><head><title>Lineage II Addicted - Remove PKs</title></head><body>"); tb.append("<center><img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("</center>"); tb.append("<center>"); tb.append("<table bgcolor=000000 width=300 height=12>"); tb.append("<tr>"); tb.append("<td width=\"300\" align=\"center\"><font color=\"FF0000\">{Remove Pks}</font></td>"); tb.append("</tr>"); tb.append("<tr>"); tb.append("<td width=\"300\" align=\"center\"><font color=\"666666\">Clean Pks. 1 pk = 1 Donate coin.</font></td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<br>"); tb.append("<center>"); tb.append("<edit var=\"pkReduceCount\" width=80 height=15>"); tb.append("<button value=\"Clean Pks\" action=\"bypass -h npc_%objectId%_reducePks $pkReduceCount\" back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\" width=75 height=21>"); tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>"); tb.append("<br>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<table border=0 bgcolor=000000 width=300 height=20>"); tb.append("<tr>"); tb.append("<td align=\"center\" width=\"300\"><font color=\"666666\">Vote for us :</font><font color=\"FF5555\"> www.l2addicted.eu</font></td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("</center>"); tb.append("</body></html>"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } public void showNameWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><head><title>Lineage II Addicted - Rename</title></head><body>"); tb.append("<center><img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("</center>"); tb.append("<center>"); tb.append("<table bgcolor=000000 width=300 height=12>"); tb.append("<tr>"); tb.append("<td width=\"300\" align=\"center\"><font color=\"FF0000\">{Rename}</font></td>"); tb.append("</tr>"); tb.append("<tr>"); tb.append("<td width=\"300\" align=\"center\"><font color=\"666666\">Change your name for 10 donate coins.</font></td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<br>"); tb.append("<center>"); tb.append("<edit var=\"newName\" width=80 height=15>"); tb.append("<button value=\"Rename\" action=\"bypass -h npc_%objectId%_changeName $newName\" back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\" width=75 height=21>"); tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>"); tb.append("<br>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<table border=0 bgcolor=000000 width=300 height=20>"); tb.append("<tr>"); tb.append("<td align=\"center\" width=\"300\"><font color=\"666666\">Vote for us :</font><font color=\"FF5555\"> www.l2addicted.eu</font></td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("</center>"); tb.append("</body></html>"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } public void showClanNameWindow(L2PcInstance player, int val) { TextBuilder tb = new TextBuilder(); tb.append("<html><head><title>Lineage II Addicted - Rename</title></head><body>"); tb.append("<center><img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("</center>"); tb.append("<center>"); tb.append("<table bgcolor=000000 width=300 height=12>"); tb.append("<tr>"); tb.append("<td width=\"300\" align=\"center\"><font color=\"FF0000\">{Rename}</font></td>"); tb.append("</tr>"); tb.append("<tr>"); tb.append("<td width=\"300\" align=\"center\"><font color=\"666666\">Change your clan name for 10 donate coins.</font></td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<br>"); tb.append("<center>"); tb.append("<edit var=\"newClanName\" width=80 height=15>"); tb.append("<button value=\"Rename\" action=\"bypass -h npc_%objectId%_changeClanName $newClanName\" back=\"L2UI_ch3.Btn1_normalDisable\" fore=\"L2UI_ch3.Btn1_normalDisable\" width=75 height=21>"); tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32>"); tb.append("<br>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("<table border=0 bgcolor=000000 width=300 height=20>"); tb.append("<tr>"); tb.append("<td align=\"center\" width=\"300\"><font color=\"666666\">Vote for us :</font><font color=\"FF5555\"> www.l2addicted.eu</font></td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("<img src=\"L2UI.SquareGray\" width=300 height=1>"); tb.append("</center>"); tb.append("</body></html>"); NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId()); msg.setHtml(tb.toString()); msg.replace("%objectId%", String.valueOf(this.getObjectId())); player.sendPacket(msg); } private static void addAugment(L2PcInstance player, int attribute, int skill, int level) { L2ItemInstance item = player.getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND); if (item == null) { player.sendMessage("You have to equip a weapon."); return; } if (player.getInventory().getInventoryItemCount(ITEM_ID, -1) < 20) { player.sendMessage("You dont have enough item."); return; } if (item.isAugmented()) { player.sendMessage("Remove the augment first."); return; } Connection con = null; try { player.destroyItemByItemId("Consume", ITEM_ID, 20, player, true); con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("REPLACE INTO augmentations VALUES(?,?,?,?)"); statement.setInt(1, item.getObjectId()); statement.setInt(2, attribute*65536+1); statement.setInt(3, skill); statement.setInt(4, level); statement.executeUpdate(); player.sendPacket(new SystemMessage(SystemMessageId.THE_ITEM_WAS_SUCCESSFULLY_AUGMENTED)); statement.close(); player.sendMessage("You will be disconnected in 3 seconds to enable the security"); try { Thread.sleep(3000L); } catch (Exception e) { } player.deleteMe(); player.sendPacket(new LeaveWorld()); } catch (Exception e) { } finally { L2DatabaseFactory.close(con); } } private void updateDatabasex(L2PcInstance player, boolean newDonator) { Connection con = null; try { if(player == null) return; con = L2DatabaseFactory.getInstance().getConnection(false); PreparedStatement stmt = con.prepareStatement(INSERT_DATAA); stmt.setInt(1, player.getObjectId()); stmt.setString(2, player.getName()); stmt.setInt(3, player.isHero() ? 1 : 0); stmt.setInt(4, player.isNoble() ? 1 : 0); stmt.setInt(5, 1); stmt.execute(); stmt.close(); stmt = null; } catch(Exception e) { if(Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); LOGGER.error("Error: could not update database: ", e); } finally { CloseUtil.close(con); con = null; } } private void updateDatabase(L2PcInstance player, long heroTime) { Connection con = null; try { if(player == null) return; con = L2DatabaseFactory.getInstance().getConnection(false); PreparedStatement stmt = con.prepareStatement(INSERT_DATA); stmt.setInt(1, player.getObjectId()); stmt.setString(2, player.getName()); stmt.setInt(3, 1); stmt.setInt(4, player.isNoble() ? 1 : 0); stmt.setInt(5, player.isDonator() ? 1 : 0); stmt.setLong(6, heroTime == 0 ? 0 : System.currentTimeMillis() + heroTime); stmt.execute(); stmt.close(); stmt = null; } catch(Exception e) { if(Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); LOGGER.error("Error: could not update database: ", e); } finally { CloseUtil.close(con); con = null; } } private boolean isValidName(final String text) { boolean result = true; final String test = text; Pattern pattern; try { pattern = Pattern.compile(Config.CNAME_TEMPLATE); } catch (final PatternSyntaxException e) // case of illegal pattern { if (Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); pattern = Pattern.compile(".*"); } final Matcher regexp = pattern.matcher(test); if (!regexp.matches()) result = false; return result; } private boolean isValidClanName(final String text) { boolean result = true; final String test = text; Pattern pattern; try { pattern = Pattern.compile(Config.CLAN_NAME_TEMPLATE); } catch (final PatternSyntaxException e) // case of illegal pattern { if (Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); pattern = Pattern.compile(".*"); } final Matcher regexp = pattern.matcher(test); if (!regexp.matches()) result = false; return result; } } me working properly thank the fields for assistance
-
close topic :(
-
package com.l2jfrozen.gameserver.handler; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; import org.apache.log4j.Level; import org.apache.log4j.Logger; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.model.L2World; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.entity.Announcements; import com.l2jfrozen.gameserver.powerpak.PowerPakConfig; import com.l2jfrozen.gameserver.thread.ThreadPoolManager; public class AutoVoteRewardHandler { protected static final Logger LOGGER = Logger.getLogger(AutoVoteRewardHandler.class); private int _l2networkVotesCount = 0; private int hopzoneVotesCount = 0; private int topzoneVotesCount = 0; protected List<String> already_rewarded; protected static boolean l2network = false; protected static boolean topzone = false; protected static boolean hopzone = false; private WebClient webClient; private AutoVoteRewardHandler() { LOGGER.info("Vote Reward System Initiated."); if (hopzone) { webClient = new WebClient(BrowserVersion.CHROME); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setPrintContentOnFailingStatusCode(false); int hopzone_votes = getHopZoneVotes(); if (hopzone_votes == -1) { hopzone_votes = 0; } setHopZoneVoteCount(hopzone_votes); } if (l2network) { int l2network_votes = getL2NetworkVotes(); if (l2network_votes == -1) { l2network_votes = 0; } setL2NetworkVoteCount(l2network_votes); } if (topzone) { int topzone_votes = getTopZoneVotes(); if (topzone_votes == -1) { topzone_votes = 0; } setTopZoneVoteCount(topzone_votes); } ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), PowerPakConfig.VOTES_SYSYEM_INITIAL_DELAY, PowerPakConfig.VOTES_SYSYEM_STEP_DELAY); } protected class AutoReward implements Runnable { @Override public void run() { final int minutes = (PowerPakConfig.VOTES_SYSYEM_STEP_DELAY / 1000) / 60; if (hopzone) { final int hopzone_votes = getHopZoneVotes(); if (hopzone_votes != -1) { LOGGER.info("Server Has on HopZone: " + hopzone_votes + " Votes!"); Announcements.getInstance().gameAnnounceToAll("[VOTE] Votes on Hopzone " + hopzone_votes); if (hopzone_votes != 0 && hopzone_votes >= getHopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) { already_rewarded = new ArrayList<>(); final Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers(); Announcements.getInstance().gameAnnounceToAll("[VOTE] Great Work! Check your inventory for Reward!!"); // L2ItemInstance item; for (final L2PcInstance player : pls) { if (player != null && !player.isInOfflineMode() && player.isOnline() == 1) { if (player._active_boxes <= 1 || (player._active_boxes > 1 && checkSingleBox(player))) { final Set<Integer> items = PowerPakConfig.VOTES_REWARDS_LIST.keySet(); for (final Integer i : items) { // item = player.getInventory().getItemByItemId(i); // TODO: check on maxstack for item player.addItem("reward", i, PowerPakConfig.VOTES_REWARDS_LIST.get(i), player, true); } } } } setHopZoneVoteCount(hopzone_votes); } Announcements.getInstance().gameAnnounceToAll("[VOTE] Next Reward in " + minutes + " minutes at " + (getHopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) + " votes"); Announcements.getInstance().gameAnnounceToAll("[VOTE] " + PowerPakConfig.SERVER_WEB_SITE); } } if (topzone && hopzone && PowerPakConfig.VOTES_SYSYEM_STEP_DELAY > 0) try { Thread.sleep(PowerPakConfig.VOTES_SYSYEM_STEP_DELAY / 2); } catch (final InterruptedException e) { if (Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); } if (topzone) { final int topzone_votes = getTopZoneVotes(); if (topzone_votes != -1) { LOGGER.info("Server on TopZone have: " + topzone_votes); Announcements.getInstance().gameAnnounceToAll("[VOTE] Votes on Topzone " + topzone_votes); if (topzone_votes != 0 && topzone_votes >= getTopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) { already_rewarded = new ArrayList<>(); final Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers(); Announcements.getInstance().gameAnnounceToAll("[VOTE] Great Work! Check your inventory for Reward!!"); // L2ItemInstance item; for (final L2PcInstance player : pls) { if (player != null && !player.isInOfflineMode() && player.isOnline() == 1) { if (player._active_boxes <= 1 || (player._active_boxes > 1 && checkSingleBox(player))) { final Set<Integer> items = PowerPakConfig.VOTES_REWARDS_LIST.keySet(); for (final Integer i : items) { // item = player.getInventory().getItemByItemId(i); // TODO: check on maxstack for item player.addItem("reward", i, PowerPakConfig.VOTES_REWARDS_LIST.get(i), player, true); } } } } setTopZoneVoteCount(topzone_votes); } Announcements.getInstance().gameAnnounceToAll("[VOTE] Next Reward in " + minutes + " minutes at " + (getTopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) + " votes"); Announcements.getInstance().gameAnnounceToAll("[VOTE] " + PowerPakConfig.SERVER_WEB_SITE); } } if (topzone && hopzone && l2network && PowerPakConfig.VOTES_SYSYEM_STEP_DELAY > 0) { try { Thread.sleep(PowerPakConfig.VOTES_SYSYEM_STEP_DELAY / 2); } catch (final InterruptedException e) { if (Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); } } if (l2network) { final int l2network_votes = getL2NetworkVotes(); if (l2network_votes != -1) { LOGGER.info("Server L2NETWORK Votes: " + l2network_votes); Announcements.getInstance().gameAnnounceToAll("[VOTE] Votes on L2Network " + l2network_votes); if (l2network_votes != 0 && l2network_votes >= getL2NetworkVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) { already_rewarded = new ArrayList<>(); final Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers(); Announcements.getInstance().gameAnnounceToAll("[VOTE] Great Work! Check your inventory for Reward!!"); // L2ItemInstance item; for (final L2PcInstance player : pls) { if (player != null && !player.isInOfflineMode() && player.isOnline() == 1) { if (player._active_boxes <= 1 || (player._active_boxes > 1 && checkSingleBox(player))) { final Set<Integer> items = PowerPakConfig.VOTES_REWARDS_LIST.keySet(); for (final Integer i : items) { // item = player.getInventory().getItemByItemId(i); // TODO: check on maxstack for item player.addItem("reward", i, PowerPakConfig.VOTES_REWARDS_LIST.get(i), player, true); } } } } setL2NetworkVoteCount(l2network_votes); } Announcements.getInstance().gameAnnounceToAll("[VOTE] Next Reward in " + minutes + " minutes at " + (getL2NetworkVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) + " votes"); Announcements.getInstance().gameAnnounceToAll("[VOTE] " + PowerPakConfig.SERVER_WEB_SITE); } } } } protected boolean checkSingleBox(final L2PcInstance player) { if (player.getClient() != null && player.getClient().getConnection() != null && !player.getClient().getConnection().isClosed() && !player.isInOfflineMode()) { final String playerip = player.getClient().getConnection().getInetAddress().getHostAddress(); if (already_rewarded.contains(playerip)) return false; already_rewarded.add(playerip); return true; } // if no connection (maybe offline shop) dnt reward return false; } protected int getHopZoneVotes() { int votes = -1; try { final HtmlPage page = webClient.getPage(PowerPakConfig.VOTES_SITE_HOPZONE_URL); String fullPage = page.asXml(); int constrainA = fullPage.indexOf("rank anonymous tooltip") + 24; String voteSection = fullPage.substring(constrainA); int constrainB = voteSection.indexOf("span") - 2; voteSection = voteSection.substring(0, constrainB).trim(); votes = Integer.parseInt(voteSection); } catch (final Exception e) { LOGGER.warn("[AutoVoteReward] Server HOPZONE is offline or something is wrong in link", e); //Announcements.getInstance().gameAnnounceToAll("[AutoVoteReward] HOPZONE is offline. We will check reward as it will be online again"); } finally { webClient.closeAllWindows(); } return votes; } protected int getTopZoneVotes() { int votes = -1; URL url = null; URLConnection con = null; InputStream is = null; InputStreamReader isr = null; BufferedReader in = null; try { url = new URL(PowerPakConfig.VOTES_SITE_TOPZONE_URL); con = url.openConnection(); con.addRequestProperty("User-Agent", "L2TopZone"); is = con.getInputStream(); isr = new InputStreamReader(is); in = new BufferedReader(isr); String inputLine; while ((inputLine = in.readLine()) != null) { votes = Integer.valueOf(inputLine); break; } } catch (final Exception e) { LOGGER.warn("[AutoVoteReward] Server TOPZONE is offline or something is wrong in link"); //Announcements.getInstance().gameAnnounceToAll("[AutoVoteReward] TOPZONE is offline. We will check reward as it will be online again"); // e.printStackTrace(); } finally { if (in != null) try { in.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (isr != null) try { isr.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (is != null) try { is.close(); } catch (final IOException e1) { e1.printStackTrace(); } } return votes; } protected int getL2NetworkVotes() { int votes = -1; URL url = null; URLConnection con = null; InputStream is = null; InputStreamReader isr = null; BufferedReader in = null; try { url = new URL(PowerPakConfig.VOTES_SITE_L2NETWORK_URL); con = url.openConnection(); con.addRequestProperty("User-Agent", "L2Network"); is = con.getInputStream(); isr = new InputStreamReader(is); in = new BufferedReader(isr); String inputLine; while ((inputLine = in.readLine()) != null) { if (inputLine.contains("color:#e7ebf2")) { votes = Integer.valueOf(inputLine.split(">")[2].replace("</b", "")); break; } } } catch (final Exception e) { LOGGER.warn("[AutoVoteReward] Server L2NETWORK is offline or something is wrong in link"); // e.printStackTrace(); } finally { if (in != null) try { in.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (isr != null) try { isr.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (is != null) try { is.close(); } catch (final IOException e1) { e1.printStackTrace(); } } return votes; } protected void setHopZoneVoteCount(final int voteCount) { hopzoneVotesCount = voteCount; } protected int getHopZoneVoteCount() { return hopzoneVotesCount; } protected void setTopZoneVoteCount(final int voteCount) { topzoneVotesCount = voteCount; } protected int getTopZoneVoteCount() { return topzoneVotesCount; } protected void setL2NetworkVoteCount(final int voteCount) { _l2networkVotesCount = voteCount; } protected int getL2NetworkVoteCount() { return _l2networkVotesCount; } public static AutoVoteRewardHandler getInstance() { Logger.getLogger("com.gargoylesoftware").setLevel(Level.OFF); if (PowerPakConfig.VOTES_SITE_HOPZONE_URL != null && !PowerPakConfig.VOTES_SITE_HOPZONE_URL.equals("")) { hopzone = true; } if (PowerPakConfig.VOTES_SITE_TOPZONE_URL != null && !PowerPakConfig.VOTES_SITE_TOPZONE_URL.equals("")) { topzone = true; } if (PowerPakConfig.VOTES_SITE_L2NETWORK_URL != null && !PowerPakConfig.VOTES_SITE_L2NETWORK_URL.equals("")) { l2network = true; } if (topzone || hopzone || l2network) return SingletonHolder._instance; return null; } @SuppressWarnings("synthetic-access") private static class SingletonHolder { protected static final AutoVoteRewardHandler _instance = new AutoVoteRewardHandler(); } } package com.l2jfrozen.gameserver.model.actor.instance; import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.ai.CtrlIntention; import com.l2jfrozen.gameserver.datatables.sql.ItemTable; import com.l2jfrozen.gameserver.model.votereward.VoteMain; import com.l2jfrozen.gameserver.network.serverpackets.ActionFailed; import com.l2jfrozen.gameserver.network.serverpackets.ItemList; import com.l2jfrozen.gameserver.network.serverpackets.MyTargetSelected; import com.l2jfrozen.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jfrozen.gameserver.network.serverpackets.ValidateLocation; import com.l2jfrozen.gameserver.templates.L2NpcTemplate; import javolution.text.TextBuilder; public class L2VoteManagerInstance extends L2FolkInstance { public L2VoteManagerInstance(int objectId, L2NpcTemplate template) { super(objectId, template); } @Override public void onBypassFeedback(L2PcInstance player, String command) { if (player == null) { return; } if (command.startsWith("votehopzone")) { VoteMain.hopvote(player); } if (command.startsWith("votetopzone")) { VoteMain.topvote(player); } if ((command.startsWith("rewards")) && VoteMain.hasVotedHop() && VoteMain.hasVotedTop()) { showRewardsHtml(player); } if ((command.startsWith("reward1")) && VoteMain.hasVotedHop() && VoteMain.hasVotedTop()) { player.getInventory().addItem("reward", Config.VOTE_REWARD_ID1, Config.VOTE_REWARD_AMOUNT1, player, null); player.sendMessage("Thanks you for votes. Take your reward."); player.sendPacket(new ItemList(player, true)); VoteMain.setHasNotVotedHop(player); VoteMain.setHasNotVotedTop(player); VoteMain.setTries(player, VoteMain.getTries(player) + 1); } if ((command.startsWith("reward2")) && VoteMain.hasVotedHop() && VoteMain.hasVotedTop()) { player.getInventory().addItem("reward", Config.VOTE_REWARD_ID2, Config.VOTE_REWARD_AMOUNT2, player, null); player.sendMessage("Thanks you for votes. Take your reward."); player.sendPacket(new ItemList(player, true)); VoteMain.setHasNotVotedHop(player); VoteMain.setHasNotVotedTop(player); VoteMain.setTries(player, VoteMain.getTries(player) + 1); } if ((command.startsWith("reward3")) && VoteMain.hasVotedHop() && VoteMain.hasVotedTop()) { player.getInventory().addItem("reward", Config.VOTE_REWARD_ID3, Config.VOTE_REWARD_AMOUNT3, player, null); player.sendMessage("Thanks you for votes. Take your reward."); player.sendPacket(new ItemList(player, true)); VoteMain.setHasNotVotedHop(player); VoteMain.setHasNotVotedTop(player); VoteMain.setTries(player, VoteMain.getTries(player) + 1); } if ((command.startsWith("reward4")) && VoteMain.hasVotedHop() && VoteMain.hasVotedTop()) { player.getInventory().addItem("reward", Config.VOTE_REWARD_ID4, Config.VOTE_REWARD_AMOUNT4, player, null); player.sendMessage("Thanks you for votes. Take your reward."); player.sendPacket(new ItemList(player, true)); VoteMain.setHasNotVotedHop(player); VoteMain.setHasNotVotedTop(player); VoteMain.setTries(player, VoteMain.getTries(player) + 1); } } @Override public void onAction(L2PcInstance player) { if (this != player.getTarget()) { player.setTarget(this); player.sendPacket(new MyTargetSelected(getObjectId(), 0)); player.sendPacket(new ValidateLocation(this)); } else if (!canInteract(player)) { player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this); } else { showHtmlWindow(player); } player.sendPacket(ActionFailed.STATIC_PACKET); } public void showHtmlWindow(L2PcInstance activeChar) { VoteMain.hasVotedHop(activeChar); VoteMain.hasVotedTop(activeChar); TextBuilder tb = new TextBuilder(); NpcHtmlMessage html = new NpcHtmlMessage(1); tb.append("<html><head><title>Vote reward Panel</title></head><body><center><br><br>"); tb.append("<table bgcolor=\"FFFFFF\"><tr><td align=\"center\"><font color=\"00ff99\">Who's voting now: </font>" + VoteMain.whosVoting() + "</td></tr>"); tb.append("<tr><td align=\"center\"><font color=\"00ffff\">Tries left: </font>" + VoteMain.getTries(activeChar) + "</td></tr>"); tb.append("<tr><td align=\"center\"><font color=\"00ffff\">Max seconds until vote: </font>" + Config.SECS_TO_VOTE + "(s)</td></tr>"); if (Config.VOTE_REWARD_ID1 > 0) { tb.append("<tr><td align=\"center\"><font color=\"00ffff\">1) " + ItemTable.getInstance().getTemplate(Config.VOTE_REWARD_ID1).getName() + ":</font> " + Config.VOTE_REWARD_AMOUNT1 + "</td></tr>"); } if (Config.VOTE_REWARD_ID2 > 0) { tb.append("<tr><td align=\"center\"><font color=\"00ffff\">2) " + ItemTable.getInstance().getTemplate(Config.VOTE_REWARD_ID2).getName() + ":</font> " + Config.VOTE_REWARD_AMOUNT2 + "</td></tr>"); } if (Config.VOTE_REWARD_ID3 > 0) { tb.append("<tr><td align=\"center\"><font color=\"00ffff\">2) " + ItemTable.getInstance().getTemplate(Config.VOTE_REWARD_ID3).getName() + ":</font> " + Config.VOTE_REWARD_AMOUNT3 + "</td></tr>"); } if (Config.VOTE_REWARD_ID4 > 0) { tb.append("<tr><td align=\"center\"><font color=\"00ffff\">2) " + ItemTable.getInstance().getTemplate(Config.VOTE_REWARD_ID4).getName() + ":</font> " + Config.VOTE_REWARD_AMOUNT4 + "</td></tr>"); } tb.append("<tr><td align=\"center\"><font color=\"FF6600\">You can vote in Hopzone at " + VoteMain.hopCd(activeChar) + "</font></td></tr>"); tb.append("<tr><td align=\"center\"><font color=\"FF6600\">You can vote in Topzone at " + VoteMain.topCd(activeChar) + "</font></td></tr>"); tb.append("</table>"); tb.append("</center><br><br>"); tb.append("<center>"); if ((VoteMain.hasVotedHop()) && (!VoteMain.hasVotedTop())) { tb.append("<td><font color = \"00FF00\">For reward you must vote on TOPZONE TOO!</font></td>"); tb.append("<td><button value=\"Vote Topzone\" action=\"bypass -h npc_" + getObjectId() + "_votetopzone\" width=\"94\" height=\"21\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\"></td>"); } else if ((!VoteMain.hasVotedHop()) && (VoteMain.hasVotedTop())) { tb.append("<td><font color = \"00FF00\">For reward you must vote on HOPZONE TOO!</font></td>"); tb.append("<td><button value=\"Vote Hopzone\" action=\"bypass -h npc_" + getObjectId() + "_votehopzone\" width=\"94\" height=\"21\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\"></td>"); } else if ((!VoteMain.hasVotedHop()) && (!VoteMain.hasVotedTop())) { tb.append("<td><button value=\"Vote Hopzone\" action=\"bypass -h npc_" + getObjectId() + "_votehopzone\" width=\"94\" height=\"21\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\"></td>"); tb.append("<td><button value=\"Vote Topzone\" action=\"bypass -h npc_" + getObjectId() + "_votetopzone\" width=\"94\" height=\"21\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\"></td>"); } else { tb.append("<td><button value=\"Take The REWARD\" action=\"bypass -h npc_" + getObjectId() + "_rewards\" width=\"94\" height=\"21\" back=\"L2UI_ch3.bigbutton_over\" fore=\"L2UI_ch3.bigbutton\"></td>"); } tb.append("<table width=200>"); if (!VoteMain.hasVotedHop()) { tb.append("<tr>"); tb.append("<td align=\"center\"><font color=\"FF6600\">Hopzone Status: </font><font color=\"00FFFF\">NOT VOTED.</font></td>"); tb.append("</tr>"); } else { tb.append("<tr>"); tb.append("<td align=\"center\"><font color=\"FF6600\">Hopzone Status: </font><font color=\"FF00FF\">VOTED.</font></td>"); tb.append("</tr>"); } if (!VoteMain.hasVotedTop()) { tb.append("<tr>"); tb.append("<td align=\"center\"><font color=\"FF6600\">Topzone Status: </font><font color=\"00FFFF\">NOT VOTED.</font></td>"); tb.append("</tr>"); } else { tb.append("<tr>"); tb.append("<td align=\"center\"><font color=\"FF6600\">Topzone Status: </font><font color=\"FF00FF\">VOTED.</font></td>"); tb.append("</tr>"); } tb.append("</table>"); tb.append("<br><br>"); tb.append("<table width=200>"); tb.append("<tr><td align=\"center\"><font color=\"FF6600\">Your total votes in general: </font>" + VoteMain.getTotalVotes(activeChar) + "</td></tr>"); tb.append("<tr><td align=\"center\"><font color=\"FF6600\">Players voted in general: </font>" + VoteMain.getBigTotalVotes(activeChar) + "</td></tr>"); tb.append("</table>"); tb.append("</center>"); tb.append("</body></html>"); html.setHtml(tb.toString()); activeChar.sendPacket(html); } public void showRewardsHtml(L2PcInstance player) { TextBuilder tb = new TextBuilder(); NpcHtmlMessage html = new NpcHtmlMessage(1); tb.append("<html><head><title>Vote Reward Panel</title></head><body>"); tb.append("<center>"); tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">"); tb.append("<tr>"); tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>"); tb.append("<td valign=\"top\"><font color=\"FF6600\">Vote Panel</font>"); tb.append("<br1><font color=\"00FF00\">" + player.getName() + "</font>, get your reward here.</td>"); tb.append("</tr>"); tb.append("</table>"); tb.append("</center>"); tb.append("<center>"); tb.append("<td valign=\"top\"><font color=\"FF6600\">Choose your reward " + player.getName() + ".</font>"); if (Config.VOTE_REWARD_ID1 > 0) { tb.append("<button value=\"Item:" + ItemTable.getInstance().getTemplate(Config.VOTE_REWARD_ID1).getName() + " Amount:" + Config.VOTE_REWARD_AMOUNT1 + "\" action=\"bypass -h npc_" + getObjectId() + "_reward1\" width=204 height=20>"); } if (Config.VOTE_REWARD_ID2 > 0) { tb.append("<button value=\"Item:" + ItemTable.getInstance().getTemplate(Config.VOTE_REWARD_ID2).getName() + " Amount:" + Config.VOTE_REWARD_AMOUNT2 + "\" action=\"bypass -h npc_" + getObjectId() + "_reward2\" width=204 height=20>"); } if (Config.VOTE_REWARD_ID3 > 0) { tb.append("<button value=\"Item:" + ItemTable.getInstance().getTemplate(Config.VOTE_REWARD_ID3).getName() + " Amount:" + Config.VOTE_REWARD_AMOUNT3 + "\" action=\"bypass -h npc_" + getObjectId() + "_reward3\" width=204 height=20>"); } if (Config.VOTE_REWARD_ID4 > 0) { tb.append("<button value=\"Item:" + ItemTable.getInstance().getTemplate(Config.VOTE_REWARD_ID4).getName() + " Amount:" + Config.VOTE_REWARD_AMOUNT4 + "\" action=\"bypass -h npc_" + getObjectId() + "_reward4\" width=204 height=20>"); } tb.append("</center>"); tb.append("</body></html>"); html.setHtml(tb.toString()); player.sendPacket(html); } } package com.l2jfrozen.gameserver.model.votereward; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.SocketTimeoutException; import java.net.URL; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.text.SimpleDateFormat; import java.util.Date; import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.model.L2World; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.network.serverpackets.CreatureSay; import com.l2jfrozen.gameserver.thread.ThreadPoolManager; import com.l2jfrozen.util.database.L2DatabaseFactory; /** * @Rework Katara */ public class VoteMain { private static boolean hasVotedHop; private static boolean hasVotedTop; static boolean Problemontop = false; static boolean Problemonhop = false; public VoteMain() { } public static void load() { System.out.println("Vote Reward Per Person Started Successfully."); TriesResetTask.getInstance(); } protected static int getHopZoneVotes() { URL url = null; InputStreamReader isr = null; BufferedReader in = null; try { url = new URL(Config.VOTE_LINK_HOPZONE); HttpURLConnection con = (HttpURLConnection) url.openConnection(); HttpURLConnection.setFollowRedirects(false); con.setConnectTimeout(10 * 1000); con.addRequestProperty("user-agent", "fake googlebot"); con.connect(); isr = new InputStreamReader(con.getInputStream()); in = new BufferedReader(isr); String inputLine; while ((inputLine = in.readLine()) != null) { if (inputLine.contains("rank anonymous tooltip")) { return Integer.valueOf(inputLine.split(">")[2].replace("</span", "")); } } } catch (IOException e) { System.out.println("[Hopzone-Vote Manager] I can't connect on Hopzone site..."); Problemonhop = true; } return 0; } protected static int getTopZoneVotes() { URL url = null; InputStreamReader isr = null; BufferedReader in = null; try { try { url = new URL(Config.VOTE_LINK_TOPZONE); HttpURLConnection con = (HttpURLConnection) url.openConnection(); HttpURLConnection.setFollowRedirects(false); con.setConnectTimeout(5 * 1000); con.addRequestProperty("User-Agent", "L2TopZone"); con.connect(); isr = new InputStreamReader(con.getInputStream()); in = new BufferedReader(isr); } catch (SocketTimeoutException e) { System.out.println("[Topzone-Vote Manager] I can't connect on TOPZONE site..."); Problemontop = true; return 0; } String inputLine; while ((inputLine = in.readLine()) != null) { if (inputLine.contains("Votes:")) { for (int i=-1; i>2; i++) inputLine = in.readLine(); Problemontop = false; return Integer.valueOf(inputLine.split(">")[3].replace("</div", "")); } } } catch (IOException e) { e.printStackTrace(); System.out.println("[Topzone-Vote Manager] I can't connect on Topzone site..."); Problemontop = true; } return 0; } public static String hopCd(L2PcInstance player) { long hopCdMs = 0; long voteDelay = 43200000L; PreparedStatement statement = null; try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { statement = con.prepareStatement("SELECT lastVoteHopzone FROM characters WHERE obj_Id=?"); statement.setInt(1, player.getObjectId()); ResultSet rset = statement.executeQuery(); while (rset.next()) { hopCdMs = rset.getLong("lastVoteHopzone"); } } catch (Exception e) { e.printStackTrace(); } SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy HH:mm"); Date resultdate = new Date(hopCdMs + voteDelay); return sdf.format(resultdate); } public static String topCd(L2PcInstance player) { long topCdMs = 0; long voteDelay = 43200000L; PreparedStatement statement = null; try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { statement = con.prepareStatement("SELECT lastVoteTopzone FROM characters WHERE obj_Id=?"); statement.setInt(1, player.getObjectId()); ResultSet rset = statement.executeQuery(); while (rset.next()) { topCdMs = rset.getLong("lastVoteTopzone"); } } catch (Exception e) { e.printStackTrace(); } SimpleDateFormat sdf = new SimpleDateFormat("MMM dd,yyyy HH:mm"); Date resultdate = new Date(topCdMs + voteDelay); return sdf.format(resultdate); } public static String whosVoting() { for (L2PcInstance voter : L2World.getInstance().getAllPlayers()) { if (voter.isVoting()) { return voter.getName(); } } return "None"; } public static void hopvote(final L2PcInstance player) { long lastVoteHopzone = 0L; long voteDelay = 43200000L; final int firstvoteshop; int votesmessage = 0; firstvoteshop = getHopZoneVotes(); votesmessage = getHopZoneVotes(); class hopvotetask implements Runnable { private final L2PcInstance p; public hopvotetask(L2PcInstance player) { p = player; } @Override public void run() { if(Problemonhop == true) { p.setIsVoting(false); VoteMain.setHasVotedHop(p); p.sendMessage("Thank you for voting for us!"); //Announcements.getInstance().gameAnnounceToAll("[Vote Manager] Vote 4 Us on HOPZONE."); VoteMain.updateLastVoteHopzone(p); Problemonhop = false; System.out.println("I have error on topzone but i will give the reward... Please check me katara."); } else { if (firstvoteshop < getHopZoneVotes()) { p.setIsVoting(false); VoteMain.setHasVotedHop(player); p.sendMessage("Thank you for voting for us!"); //Announcements.getInstance().gameAnnounceToAll("[Vote Manager] Vote 4 Us on HOPZONE."); VoteMain.updateLastVoteHopzone(p); VoteMain.updateVotes(p); } else { p.setIsVoting(false); p.sendMessage("You did not vote on hopzone. Please try again later..."); VoteMain.setTries(player, VoteMain.getTries(p) - 1); } } } } PreparedStatement statement = null; try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { statement = con.prepareStatement("SELECT lastVoteHopzone FROM characters WHERE obj_Id=?"); statement.setInt(1, player.getObjectId()); ResultSet rset = statement.executeQuery(); while (rset.next()) { lastVoteHopzone = rset.getLong("lastVoteHopzone"); } } catch (Exception e) { e.printStackTrace(); } if (getTries(player) <= 0) { player.sendMessage("Due to your multiple failures in voting you lost your chance to vote today"); } else if (((lastVoteHopzone + voteDelay) < System.currentTimeMillis()) && (getTries(player) > 0)) { for (L2PcInstance j : L2World.getInstance().getAllPlayers()) { if (j.isVoting()) { player.sendMessage("Someone is already voting.Wait for your turn please!"); return; } } player.setIsVoting(true); //ExShowScreenMessageOnBroad screen = new ExShowScreenMessageOnBroad("GO at Website and vote on HOPZONE, " + player.getName(), 20000, SMPOS.TOP_CENTER, true); //player.sendPacket(screen); CreatureSay cs = new CreatureSay(player.getObjectId(), 3, "Hopzone system","Current votes are "+votesmessage+", careful with your vote!"); player.sendPacket(cs); player.sendMessage("You have " + Config.SECS_TO_VOTE + " seconds.Hurry!"); ThreadPoolManager.getInstance().scheduleGeneral(new hopvotetask(player), Config.SECS_TO_VOTE * 1000); } else if ((getTries(player) <= 0) && ((lastVoteHopzone + voteDelay) < System.currentTimeMillis())) { for (L2PcInstance j : L2World.getInstance().getAllPlayers()) { if (j.isVoting()) { player.sendMessage("Someone is already voting.Wait for your turn please!"); return; } } player.setIsVoting(true); //ExShowScreenMessageOnBroad screen = new ExShowScreenMessageOnBroad("GO at Website and vote on HOPZONE, " + player.getName(), 20000, SMPOS.TOP_CENTER, true); //player.sendPacket(screen); CreatureSay cs = new CreatureSay(player.getObjectId(), 3, "Hopzone system","Current votes are "+votesmessage+", careful with your vote!"); player.sendPacket(cs); player.sendMessage("You have " + Config.SECS_TO_VOTE + " seconds.Hurry!"); ThreadPoolManager.getInstance().scheduleGeneral(new hopvotetask(player), Config.SECS_TO_VOTE * 1000); } else { player.sendMessage("12 hours have to pass till you are able to vote again."); } } public static void topvote(final L2PcInstance player) { long lastVoteTopzone = 0L; long voteDelay = 43200000L; final int firstvotestop; int votesmessage = 0; firstvotestop = getTopZoneVotes(); votesmessage = getTopZoneVotes(); class topvotetask implements Runnable { private final L2PcInstance p; public topvotetask(L2PcInstance player) { p = player; } @Override public void run() { if(Problemontop == true) { p.setIsVoting(false); VoteMain.setHasVotedTop(p); p.sendMessage("Thank you for voting for us!"); //Announcements.getInstance().gameAnnounceToAll("[Vote Manager] Vote 4 Us on TOPZONE."); VoteMain.updateLastVoteTopzone(p); Problemontop = false; System.out.println("I have error on topzone but i will give the reward... Please check me katara."); } else { if (firstvotestop < getTopZoneVotes()) { p.setIsVoting(false); VoteMain.setHasVotedTop(p); p.sendMessage("Thank you for voting for us!"); //Announcements.getInstance().gameAnnounceToAll("[Vote Manager] Vote 4 Us on TOPZONE."); VoteMain.updateLastVoteTopzone(p); VoteMain.updateVotes(p); } else { p.setIsVoting(false); p.sendMessage("You did not vote on topzone. Please try again later..."); VoteMain.setTries(p, VoteMain.getTries(p) - 1); } } } } PreparedStatement statement = null; try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { statement = con.prepareStatement("SELECT lastVoteTopzone FROM characters WHERE obj_Id=?"); statement.setInt(1, player.getObjectId()); ResultSet rset = statement.executeQuery(); while (rset.next()) { lastVoteTopzone = rset.getLong("lastVoteTopzone"); } } catch (Exception e) { e.printStackTrace(); } if (getTries(player) <= 0) { player.sendMessage("Due to your multiple failures in voting you lost your chance to vote today"); } else if ((getTries(player) <= 0) && ((lastVoteTopzone + voteDelay) < System.currentTimeMillis())) { for (L2PcInstance j : L2World.getInstance().getAllPlayers()) { if (j.isVoting()) { player.sendMessage("Someone is already voting.Wait for your turn please!"); return; } } player.setIsVoting(true); //ExShowScreenMessageOnBroad screen = new ExShowScreenMessageOnBroad("GO at Website and vote on TOPZONE, " + player.getName(), 20000, SMPOS.TOP_CENTER, true); //player.sendPacket(screen); CreatureSay cs = new CreatureSay(player.getObjectId(), 3, "Topzone system","Current votes are "+votesmessage+", careful with your vote!"); player.sendPacket(cs); player.sendMessage("You have " + Config.SECS_TO_VOTE + " seconds.Hurry!"); ThreadPoolManager.getInstance().scheduleGeneral(new topvotetask(player), Config.SECS_TO_VOTE * 1000); } else if (((lastVoteTopzone + voteDelay) < System.currentTimeMillis()) && (getTries(player) > 0)) { for (L2PcInstance j : L2World.getInstance().getAllPlayers()) { if (j.isVoting()) { player.sendMessage("Someone is already voting.Wait for your turn please!"); return; } } player.setIsVoting(true); //ExShowScreenMessageOnBroad screen = new ExShowScreenMessageOnBroad("GO at Website and vote on TOPZONE, " + player.getName(), 20000, SMPOS.TOP_CENTER, true); //player.sendPacket(screen); CreatureSay cs = new CreatureSay(player.getObjectId(), 3, "Topzone system","Current votes are "+votesmessage+", careful with your vote!"); player.sendPacket(cs); player.sendMessage("You have " + Config.SECS_TO_VOTE + " seconds.Hurry!"); ThreadPoolManager.getInstance().scheduleGeneral(new topvotetask(player), Config.SECS_TO_VOTE * 1000); } else { player.sendMessage("12 hours have to pass till you are able to vote again."); } } public static void hasVotedHop(L2PcInstance player) { int hasVotedHop = -1; try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("SELECT hasVotedHop FROM characters WHERE obj_Id=?"); statement.setInt(1, player.getObjectId()); ResultSet rset = statement.executeQuery(); while (rset.next()) { hasVotedHop = rset.getInt("hasVotedHop"); } if (hasVotedHop == 1) { setHasVotedHop(true); } else if (hasVotedHop == 0) { setHasVotedHop(false); } } catch (Exception e) { e.printStackTrace(); } } public static void hasVotedTop(L2PcInstance player) { int hasVotedTop = -1; try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("SELECT hasVotedTop FROM characters WHERE obj_Id=?"); statement.setInt(1, player.getObjectId()); ResultSet rset = statement.executeQuery(); while (rset.next()) { hasVotedTop = rset.getInt("hasVotedTop"); } if (hasVotedTop == 1) { setHasVotedTop(true); } else if (hasVotedTop == 0) { setHasVotedTop(false); } } catch (Exception e) { e.printStackTrace(); } } public static void updateVotes(L2PcInstance activeChar) { try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("UPDATE characters SET totalVotes=? WHERE obj_Id=?"); statement.setInt(1, getTotalVotes(activeChar) + 1); statement.setInt(2, activeChar.getObjectId()); statement.execute(); statement.close(); } catch (Exception e) { e.printStackTrace(); } } public static void setHasVotedHop(L2PcInstance activeChar) { try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("UPDATE characters SET hasVotedHop=? WHERE obj_Id=?"); statement.setInt(1, 1); statement.setInt(2, activeChar.getObjectId()); statement.execute(); statement.close(); } catch (Exception e) { e.printStackTrace(); } } public static void setHasVotedTop(L2PcInstance activeChar) { try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("UPDATE characters SET hasVotedTop=? WHERE obj_Id=?"); statement.setInt(1, 1); statement.setInt(2, activeChar.getObjectId()); statement.execute(); statement.close(); } catch (Exception e) { e.printStackTrace(); } } public static void setHasNotVotedHop(L2PcInstance activeChar) { try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("UPDATE characters SET hasVotedHop=? WHERE obj_Id=?"); statement.setInt(1, 0); statement.setInt(2, activeChar.getObjectId()); statement.execute(); statement.close(); } catch (Exception e) { e.printStackTrace(); } } public static void setHasNotVotedTop(L2PcInstance activeChar) { try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("UPDATE characters SET hasVotedTop=? WHERE obj_Id=?"); statement.setInt(1, 0); statement.setInt(2, activeChar.getObjectId()); statement.execute(); statement.close(); } catch (Exception e) { e.printStackTrace(); } } public static int getTries(L2PcInstance player) { int tries = -1; try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("SELECT tries FROM characters WHERE obj_Id=?"); statement.setInt(1, player.getObjectId()); for (ResultSet rset = statement.executeQuery(); rset.next();) { tries = rset.getInt("tries"); } } catch (Exception e) { e.printStackTrace(); } return tries; } public static void setTries(L2PcInstance player, int tries) { try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("UPDATE characters SET tries=? WHERE obj_Id=?"); statement.setInt(1, tries); statement.setInt(2, player.getObjectId()); statement.execute(); statement.close(); } catch (Exception e) { e.printStackTrace(); } } public static int getTotalVotes(L2PcInstance player) { int totalVotes = 0; try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("SELECT totalVotes FROM characters WHERE obj_Id=?"); statement.setInt(1, player.getObjectId()); ResultSet rset = statement.executeQuery(); while (rset.next()) { totalVotes = rset.getInt("totalVotes"); } rset.close(); statement.close(); } catch (Exception e) { e.printStackTrace(); } return totalVotes; } public static int getBigTotalVotes(L2PcInstance player) { int bigTotalVotes = -1; try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("SELECT SUM(totalVotes) FROM characters"); for (ResultSet rset = statement.executeQuery(); rset.next();) { bigTotalVotes = rset.getInt("SUM(totalVotes)"); } } catch (Exception e) { e.printStackTrace(); } return bigTotalVotes; } public static void updateLastVoteHopzone(L2PcInstance player) { try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("UPDATE characters SET lastVoteHopzone=? WHERE obj_Id=?"); statement.setLong(1, System.currentTimeMillis()); statement.setInt(2, player.getObjectId()); statement.execute(); } catch (Exception e) { e.printStackTrace(); } } public static void updateLastVoteTopzone(L2PcInstance player) { try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("UPDATE characters SET lastVoteTopzone=? WHERE obj_Id=?"); statement.setLong(1, System.currentTimeMillis()); statement.setInt(2, player.getObjectId()); statement.execute(); } catch (Exception e) { e.printStackTrace(); } } // Getters and Setters public static boolean hasVotedHop() { return hasVotedHop; } public static void setHasVotedHop(boolean hasVotedHop) { VoteMain.hasVotedHop = hasVotedHop; } public static boolean hasVotedTop() { return hasVotedTop; } public static void setHasVotedTop(boolean hasVotedTop) { VoteMain.hasVotedTop = hasVotedTop; } } package com.l2jfrozen.gameserver.model.votereward; import java.sql.Connection; import java.sql.PreparedStatement; import java.util.Calendar; import com.l2jfrozen.gameserver.thread.ThreadPoolManager; import com.l2jfrozen.util.database.L2DatabaseFactory; public class TriesResetTask { public TriesResetTask() { } public static void getInstance() { ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() { @Override public void run() { try (Connection con = L2DatabaseFactory.getInstance().getConnection()) { PreparedStatement statement = con.prepareStatement("UPDATE characters SET tries=?"); statement.setInt(1, 3); statement.execute(); statement.close(); } catch (Exception e) { e.printStackTrace(); } } }, getValidationTime()); } private static long getValidationTime() { Calendar cld = Calendar.getInstance(); cld.set(11, 12); cld.set(12, 1); long time = cld.getTimeInMillis(); if ((System.currentTimeMillis() - time) <= 0L) { long delay = cld.getTimeInMillis() - System.currentTimeMillis(); return delay; } return 0L; } } that's all I have to clip than vote opium anyone desires to help thex
-
when I put I have many errors I put reborn12 and did again
-
to put it this because I do not know well
-
package com.l2jfrozen.gameserver.handler; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Set; import org.apache.log4j.Level; import org.apache.log4j.Logger; import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.l2jfrozen.Config; import com.l2jfrozen.gameserver.model.L2World; import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance; import com.l2jfrozen.gameserver.model.entity.Announcements; import com.l2jfrozen.gameserver.powerpak.PowerPakConfig; import com.l2jfrozen.gameserver.thread.ThreadPoolManager; public class AutoVoteRewardHandler { protected static final Logger LOGGER = Logger.getLogger(AutoVoteRewardHandler.class); private int _l2networkVotesCount = 0; private int hopzoneVotesCount = 0; private int topzoneVotesCount = 0; protected List<String> already_rewarded; protected static boolean l2network = false; protected static boolean topzone = false; protected static boolean hopzone = false; private WebClient webClient; private AutoVoteRewardHandler() { LOGGER.info("Vote Reward System Initiated."); if (hopzone) { webClient = new WebClient(BrowserVersion.CHROME); webClient.getOptions().setThrowExceptionOnFailingStatusCode(false); webClient.getOptions().setThrowExceptionOnScriptError(false); webClient.getOptions().setPrintContentOnFailingStatusCode(false); int hopzone_votes = getHopZoneVotes(); if (hopzone_votes == -1) { hopzone_votes = 0; } setHopZoneVoteCount(hopzone_votes); } if (l2network) { int l2network_votes = getL2NetworkVotes(); if (l2network_votes == -1) { l2network_votes = 0; } setL2NetworkVoteCount(l2network_votes); } if (topzone) { int topzone_votes = getTopZoneVotes(); if (topzone_votes == -1) { topzone_votes = 0; } setTopZoneVoteCount(topzone_votes); } ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new AutoReward(), PowerPakConfig.VOTES_SYSYEM_INITIAL_DELAY, PowerPakConfig.VOTES_SYSYEM_STEP_DELAY); } protected class AutoReward implements Runnable { @Override public void run() { final int minutes = (PowerPakConfig.VOTES_SYSYEM_STEP_DELAY / 1000) / 60; if (hopzone) { final int hopzone_votes = getHopZoneVotes(); if (hopzone_votes != -1) { LOGGER.info("Server Has on HopZone: " + hopzone_votes + " Votes!"); Announcements.getInstance().gameAnnounceToAll("[VOTE] Votes on Hopzone " + hopzone_votes); if (hopzone_votes != 0 && hopzone_votes >= getHopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) { already_rewarded = new ArrayList<>(); final Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers(); Announcements.getInstance().gameAnnounceToAll("[VOTE] Great Work! Check your inventory for Reward!!"); // L2ItemInstance item; for (final L2PcInstance player : pls) { if (player != null && !player.isInOfflineMode() && player.isOnline() == 1) { if (player._active_boxes <= 1 || (player._active_boxes > 1 && checkSingleBox(player))) { final Set<Integer> items = PowerPakConfig.VOTES_REWARDS_LIST.keySet(); for (final Integer i : items) { // item = player.getInventory().getItemByItemId(i); // TODO: check on maxstack for item player.addItem("reward", i, PowerPakConfig.VOTES_REWARDS_LIST.get(i), player, true); } } } } setHopZoneVoteCount(hopzone_votes); } Announcements.getInstance().gameAnnounceToAll("[VOTE] Next Reward in " + minutes + " minutes at " + (getHopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) + " votes"); Announcements.getInstance().gameAnnounceToAll("[VOTE] " + PowerPakConfig.SERVER_WEB_SITE); } } if (topzone && hopzone && PowerPakConfig.VOTES_SYSYEM_STEP_DELAY > 0) try { Thread.sleep(PowerPakConfig.VOTES_SYSYEM_STEP_DELAY / 2); } catch (final InterruptedException e) { if (Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); } if (topzone) { final int topzone_votes = getTopZoneVotes(); if (topzone_votes != -1) { LOGGER.info("Server on TopZone have: " + topzone_votes); Announcements.getInstance().gameAnnounceToAll("[VOTE] Votes on Topzone " + topzone_votes); if (topzone_votes != 0 && topzone_votes >= getTopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) { already_rewarded = new ArrayList<>(); final Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers(); Announcements.getInstance().gameAnnounceToAll("[VOTE] Great Work! Check your inventory for Reward!!"); // L2ItemInstance item; for (final L2PcInstance player : pls) { if (player != null && !player.isInOfflineMode() && player.isOnline() == 1) { if (player._active_boxes <= 1 || (player._active_boxes > 1 && checkSingleBox(player))) { final Set<Integer> items = PowerPakConfig.VOTES_REWARDS_LIST.keySet(); for (final Integer i : items) { // item = player.getInventory().getItemByItemId(i); // TODO: check on maxstack for item player.addItem("reward", i, PowerPakConfig.VOTES_REWARDS_LIST.get(i), player, true); } } } } setTopZoneVoteCount(topzone_votes); } Announcements.getInstance().gameAnnounceToAll("[VOTE] Next Reward in " + minutes + " minutes at " + (getTopZoneVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) + " votes"); Announcements.getInstance().gameAnnounceToAll("[VOTE] " + PowerPakConfig.SERVER_WEB_SITE); } } if (topzone && hopzone && l2network && PowerPakConfig.VOTES_SYSYEM_STEP_DELAY > 0) { try { Thread.sleep(PowerPakConfig.VOTES_SYSYEM_STEP_DELAY / 2); } catch (final InterruptedException e) { if (Config.ENABLE_ALL_EXCEPTIONS) e.printStackTrace(); } } if (l2network) { final int l2network_votes = getL2NetworkVotes(); if (l2network_votes != -1) { LOGGER.info("Server L2NETWORK Votes: " + l2network_votes); Announcements.getInstance().gameAnnounceToAll("[VOTE] Votes on L2Network " + l2network_votes); if (l2network_votes != 0 && l2network_votes >= getL2NetworkVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) { already_rewarded = new ArrayList<>(); final Collection<L2PcInstance> pls = L2World.getInstance().getAllPlayers(); Announcements.getInstance().gameAnnounceToAll("[VOTE] Great Work! Check your inventory for Reward!!"); // L2ItemInstance item; for (final L2PcInstance player : pls) { if (player != null && !player.isInOfflineMode() && player.isOnline() == 1) { if (player._active_boxes <= 1 || (player._active_boxes > 1 && checkSingleBox(player))) { final Set<Integer> items = PowerPakConfig.VOTES_REWARDS_LIST.keySet(); for (final Integer i : items) { // item = player.getInventory().getItemByItemId(i); // TODO: check on maxstack for item player.addItem("reward", i, PowerPakConfig.VOTES_REWARDS_LIST.get(i), player, true); } } } } setL2NetworkVoteCount(l2network_votes); } Announcements.getInstance().gameAnnounceToAll("[VOTE] Next Reward in " + minutes + " minutes at " + (getL2NetworkVoteCount() + PowerPakConfig.VOTES_FOR_REWARD) + " votes"); Announcements.getInstance().gameAnnounceToAll("[VOTE] " + PowerPakConfig.SERVER_WEB_SITE); } } } } protected boolean checkSingleBox(final L2PcInstance player) { if (player.getClient() != null && player.getClient().getConnection() != null && !player.getClient().getConnection().isClosed() && !player.isInOfflineMode()) { final String playerip = player.getClient().getConnection().getInetAddress().getHostAddress(); if (already_rewarded.contains(playerip)) return false; already_rewarded.add(playerip); return true; } // if no connection (maybe offline shop) dnt reward return false; } protected int getHopZoneVotes() { int votes = -1; try { final HtmlPage page = webClient.getPage(PowerPakConfig.VOTES_SITE_HOPZONE_URL); String fullPage = page.asXml(); int constrainA = fullPage.indexOf("rank anonymous tooltip") + 24; String voteSection = fullPage.substring(constrainA); int constrainB = voteSection.indexOf("span") - 2; voteSection = voteSection.substring(0, constrainB).trim(); votes = Integer.parseInt(voteSection); } catch (final Exception e) { LOGGER.warn("[AutoVoteReward] Server HOPZONE is offline or something is wrong in link", e); //Announcements.getInstance().gameAnnounceToAll("[AutoVoteReward] HOPZONE is offline. We will check reward as it will be online again"); } finally { webClient.closeAllWindows(); } return votes; } protected int getTopZoneVotes() { int votes = -1; URL url = null; URLConnection con = null; InputStream is = null; InputStreamReader isr = null; BufferedReader in = null; try { url = new URL(PowerPakConfig.VOTES_SITE_TOPZONE_URL); con = url.openConnection(); con.addRequestProperty("User-Agent", "L2TopZone"); is = con.getInputStream(); isr = new InputStreamReader(is); in = new BufferedReader(isr); String inputLine; while ((inputLine = in.readLine()) != null) { if (inputLine.contains("Votes")) { votes = Integer.valueOf(inputLine.split(">")[3].replace("</div", "")); break; } } } catch (final Exception e) { LOGGER.warn("[AutoVoteReward] Server TOPZONE is offline or something is wrong in link"); //Announcements.getInstance().gameAnnounceToAll("[AutoVoteReward] TOPZONE is offline. We will check reward as it will be online again"); // e.printStackTrace(); } finally { if (in != null) try { in.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (isr != null) try { isr.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (is != null) try { is.close(); } catch (final IOException e1) { e1.printStackTrace(); } } return votes; } protected int getL2NetworkVotes() { int votes = -1; URL url = null; URLConnection con = null; InputStream is = null; InputStreamReader isr = null; BufferedReader in = null; try { url = new URL(PowerPakConfig.VOTES_SITE_L2NETWORK_URL); con = url.openConnection(); con.addRequestProperty("User-Agent", "L2Network"); is = con.getInputStream(); isr = new InputStreamReader(is); in = new BufferedReader(isr); String inputLine; while ((inputLine = in.readLine()) != null) { if (inputLine.contains("color:#e7ebf2")) { votes = Integer.valueOf(inputLine.split(">")[2].replace("</b", "")); break; } } } catch (final Exception e) { LOGGER.warn("[AutoVoteReward] Server L2NETWORK is offline or something is wrong in link"); // e.printStackTrace(); } finally { if (in != null) try { in.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (isr != null) try { isr.close(); } catch (final IOException e1) { e1.printStackTrace(); } if (is != null) try { is.close(); } catch (final IOException e1) { e1.printStackTrace(); } } return votes; } protected void setHopZoneVoteCount(final int voteCount) { hopzoneVotesCount = voteCount; } protected int getHopZoneVoteCount() { return hopzoneVotesCount; } protected void setTopZoneVoteCount(final int voteCount) { topzoneVotesCount = voteCount; } protected int getTopZoneVoteCount() { return topzoneVotesCount; } protected void setL2NetworkVoteCount(final int voteCount) { _l2networkVotesCount = voteCount; } protected int getL2NetworkVoteCount() { return _l2networkVotesCount; } public static AutoVoteRewardHandler getInstance() { Logger.getLogger("com.gargoylesoftware").setLevel(Level.OFF); if (PowerPakConfig.VOTES_SITE_HOPZONE_URL != null && !PowerPakConfig.VOTES_SITE_HOPZONE_URL.equals("")) { hopzone = true; } if (PowerPakConfig.VOTES_SITE_TOPZONE_URL != null && !PowerPakConfig.VOTES_SITE_TOPZONE_URL.equals("")) { topzone = true; } if (PowerPakConfig.VOTES_SITE_L2NETWORK_URL != null && !PowerPakConfig.VOTES_SITE_L2NETWORK_URL.equals("")) { l2network = true; } if (topzone || hopzone || l2network) return SingletonHolder._instance; return null; } @SuppressWarnings("synthetic-access") private static class SingletonHolder { protected static final AutoVoteRewardHandler _instance = new AutoVoteRewardHandler(); } }
-
all this gave me votte general and for the first time it sees
-
change gave nothing but error was not
-
without doing click anywhere waiting time to completion and give my vote
-
man config http://l2topzone.com/tv.php?id=12467
-
γεια σας παίδες έχω πρόβλημα το vot manager vazo link apo server mia fora to topzone doulepse menta den exei ksanadoulepsi to hopzone oute kapios na me help ti na kanw thex L2jFrozen
-
L2Dev never hacked my server, i know him from another friend, he is very good developer for Lineage2 and World of warcraft, i saw all his works and his live servers, he helped me for free because of my friend, i recommend him to everyone, and about Xander, we will meet again my friend and you will see what will happen!
-
this is fot spirakos einai gia sena