Jump to content

lazzytr

Members
  • Posts

    27
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by lazzytr

  1. I use l2fandc files. I need a java code, I've been searching a lot and waiting for help. What I want to do is to teleport to the players doing pvp. So it's like finding the flag player. I found some files but they did not fit my system. I'm waiting for help.. EXAMPLE: package handlers.bypasshandlers; import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import com.l2jmobius.Config; import com.l2jmobius.commons.util.Rnd; import com.l2jmobius.gameserver.enums.ChatType; import com.l2jmobius.gameserver.handler.IBypassHandler; import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.zone.ZoneId; import com.l2jmobius.gameserver.network.serverpackets.CreatureSay; /** * @author Mobius (based on Tenkai pvpzone) */ public class FindPvP implements IBypassHandler { private static final String[] COMMANDS = { "FindPvP" }; @Override public boolean useBypass(String command, L2PcInstance activeChar, L2Character target) { if (!Config.ENABLE_FIND_PVP || !target.isNpc()) { return false; } L2PcInstance mostPvP = null; int max = -1; for (L2PcInstance player : L2World.getInstance().getPlayers()) { if ((player == null) // || (player.getPvpFlag() == 0) // || (player.getInstanceId() != 0) // || player.isGM() // || player.isInsideZone(ZoneId.PEACE) // || player.isInsideZone(ZoneId.SIEGE) // || player.isInsideZone(ZoneId.NO_SUMMON_FRIEND)) { continue; } int count = 0; for (L2PcInstance pl : L2World.getInstance().getVisibleObjects(player, L2PcInstance.class)) { if ((pl.getPvpFlag() > 0) && !pl.isInsideZone(ZoneId.PEACE)) { count++; } } if (count > max) { max = count; mostPvP = player; } } if (mostPvP != null) { // Check if the player's clan is already outnumbering the PvP if (activeChar.getClan() != null) { Map<Integer, Integer> clanNumbers = new HashMap<>(); int allyId = activeChar.getAllyId(); if (allyId == 0) { allyId = activeChar.getClanId(); } clanNumbers.put(allyId, 1); for (L2PcInstance known : L2World.getInstance().getVisibleObjects(mostPvP, L2PcInstance.class)) { int knownAllyId = known.getAllyId(); if (knownAllyId == 0) { knownAllyId = known.getClanId(); } if (knownAllyId != 0) { if (clanNumbers.containsKey(knownAllyId)) { clanNumbers.put(knownAllyId, clanNumbers.get(knownAllyId) + 1); } else { clanNumbers.put(knownAllyId, 1); } } } int biggestAllyId = 0; int biggestAmount = 2; for (Entry<Integer, Integer> clanNumber : clanNumbers.entrySet()) { if (clanNumber.getValue() > biggestAmount) { biggestAllyId = clanNumber.getKey(); biggestAmount = clanNumber.getValue(); } } if (biggestAllyId == allyId) { activeChar.sendPacket(new CreatureSay(0, ChatType.WHISPER, target.getName(), "Sorry, your clan/ally is outnumbering the place already so you can't move there.")); return true; } } activeChar.teleToLocation((mostPvP.getX() + Rnd.get(300)) - 150, (mostPvP.getY() + Rnd.get(300)) - 150, mostPvP.getZ()); activeChar.setSpawnProtection(true); if (!activeChar.isGM()) { activeChar.setPvpFlagLasts(System.currentTimeMillis() + Config.PVP_PVP_TIME); activeChar.startPvPFlag(); } } else { activeChar.sendPacket(new CreatureSay(0, ChatType.WHISPER, target.getName(), "Sorry, I can't find anyone in flag status right now.")); } return false; } @Override public String[] getBypassList() { return COMMANDS; } }
  2. I want to give 1 GCM per hour to online players. I am editing the java code I found for this, but it does not give an hourly reward. package services; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util.concurrent.ScheduledFuture; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import l2f.gameserver.Config; import l2f.gameserver.ThreadPoolManager; import l2f.gameserver.database.mysql; import l2f.gameserver.model.GameObjectsStorage; import l2f.gameserver.model.Player; import l2f.gameserver.scripts.ScriptFile; /** * * @author Special */ public class AutoReward implements ScriptFile, Runnable { private static final Logger _log = LoggerFactory.getLogger(Player.class); private static final int REWARD_DELAY = 3600000; // 1h. private static final int REQUIRED_ONLINE = Config.DAILY_REWARD_REQUIRED_ONLINE * 3600000; // 1h. private static final int NOT_REWARD_AFK_DELAY = Config.DAILY_REWARD_AFK_TIME * 60000; // 10 mins.(Config 10) private static final DateFormat TIME_FORMAT = new SimpleDateFormat("HH"); private boolean CLEANED = false; private ScheduledFuture<?> _task = null; @Override public void run() { if(CLEANED && time() >= Config.DAILY_REWARD_END_HOUR || time() < Config.DAILY_REWARD_START_HOUR) CLEANED = false; if(time() >= Config.DAILY_REWARD_START_HOUR && time() <= Config.DAILY_REWARD_END_HOUR) { for(Player player : GameObjectsStorage.getAllPlayersForIterate()) { if(player.isOnline() && player.getUptime() >= REQUIRED_ONLINE && (System.currentTimeMillis() - player.getLastNotAfkTime()) > NOT_REWARD_AFK_DELAY) { if(!isRewardedDB(player)) { player.sendMessage("You have been rewarded for online time!"); setRewardDB(player); } } } } if(CLEANED == false && time() <= Config.DAILY_REWARD_START_HOUR) { CLEANED = true; wipeRewardDB(); } } public static int time() { return Integer.parseInt(TIME_FORMAT.format(new Date(System.currentTimeMillis()))); } public static boolean isRewardedDB(Player player) { String value = Config.DAILY_REWARD_PROTECTION.equals("HWID") ? player.getHWID() : player.getIP(); if(player.getVar("daily_reward") != null) return true; if(mysql.get("SELECT value FROM character_variables WHERE name='daily_reward' AND value='"+value+"'") != null) return true; return false; } public static void setRewardDB(Player player) { String value = Config.DAILY_REWARD_PROTECTION.equals("HWID") ? player.getHWID() : player.getIP(); mysql.set("INSERT INTO character_variables (obj_id, type, name, value, expire_time) VALUES (?,?,?,?,?)", player.getObjectId(), "user-var", "daily_reward", value, -1); } public static void wipeRewardDB() { mysql.set("DELETE FROM `character_variables` WHERE `type`='user-var' and `name`='daily_reward'"); } @Override public void onLoad() { _log.info("Loaded Service: AutoReward"); if(_task == null) _task = ThreadPoolManager.getInstance().scheduleAtFixedDelay(this, REWARD_DELAY, REWARD_DELAY); } @Override public void onReload() { if(_task != null) { _task.cancel(true); _task = null; } _task = ThreadPoolManager.getInstance().scheduleAtFixedDelay(this, REWARD_DELAY, REWARD_DELAY); } @Override public void onShutdown() { // } }
  3. Hello, I want to set the Olympics to end in 2 weeks. On the 1st and 15th of the month. L2JFandc pack. Can you help me plz. --------------------------------------------------------------------------------------------------------------------------------- # If you change the config make a request to the database: DELETE FROM `server_variables` WHERE `name` = 'Olympiad_End'; # Example (every two weeks): # Default = 1 and AltOlyDateEndWeekly = 0 AltOlyDateEndMonthly = 1,15 # If AltOlyDateEndWeekly is not 0, then it will be used over AltOlyDateEndMonthly, and olympiad will end every week on a certain week day # Sunday=1, Monday=2, Tuesday=3, Wednesday=4, Thursday=5, Friday=6, Saturday=7, Disabled=0 will use AltOlyDateEndMonthly instead AltOlyDateEndWeekly = 0
  4. I can't use these commands for Fandc pack. do you have? or share please.
  5. package handlers.voicedcommandhandlers; import l2r.gameserver.handler.IVoicedCommandHandler; import l2r.gameserver.model.actor.instance.L2PcInstance; import l2r.gameserver.model.quest.QuestState; import l2r.gameserver.network.serverpackets.NpcHtmlMessage; /** * @author -Invoke */ public class CommandRaid implements IVoicedCommandHandler { private static final String QUEST_NAME = "Q00254_LegendaryTales"; private static final String SERVER_NAME = "7RB Quest"; private static final String[] COMMANDS = { "7rb", }; @Override public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target) { if (command.equalsIgnoreCase("7rb")) { QuestState state = activeChar.getQuestState(QUEST_NAME); NpcHtmlMessage html = new NpcHtmlMessage(); html.setHtml(buildHtml(state)); activeChar.sendPacket(html); } return true; } private static final String buildHtml(QuestState st) { StringBuilder sb = new StringBuilder(); sb.append("<html noscrollbar><head>"); sb.append("<title>" + SERVER_NAME + "</title>"); sb.append("</head>"); sb.append("<body><br>"); sb.append("<br>7 Rb Quest (Legendary Tales) status:<br>"); if (st == null) { sb.append("Quest not found. Please visit Glimore in Dragon Valley in order to begin the quest."); sb.append("<br>"); } else { if (st.isCond(1)) { for (Bosses boss : Bosses.class.getEnumConstants()) { sb.append(boss.getName() + ": "); sb.append(checkMask(st, boss) ? "<font color=\"00FF00\">Killed.</font>" : "<font color=\"FF0000\">Not killed.</font>"); sb.append("<br>"); } } else { sb.append("Legendary Tales quest is completed."); sb.append("<br>"); } } sb.append("</body></html> Make here "L2J_SunriseProject_Data\dist\game\data\scripts\handlers\voicedcommandhandlers\CommandRaid.java" Paste the code above Add it here "L2J_SunriseProject_Data\dist\game\data\scripts\handlers\MasterHandler.java" "import handlers.voicedcommandhandlers.CommandRaid;" and compile. It should work from all chars using the .7rb command
  6. You target a player and then send a captcha. this is how it works. .report , someone can tell me? Or i need find code implemented
  7. Hi. Gameserver/config/events Look at the ini files. Chance HWID working IP... # Check for windows by IP or HWid? CtF_CheckWindowMethod = IP
  8. When I issue the partymatcing command. it gives this error. [03.03.21 01:04:44] WARN: missing html page ./config/zeus/htm//eng/engine-party-matching-invitation-windows.htm
  9. I don't know the code for restriction I don't know the code for restriction. I want to prevent TRADE in a certain area. <set name="blocked_actions" val="open_private_store;open_private_workshop" /> For no trade. I can't find which command to write? sample: open_trade ?
  10. I want to close trade for a zone. Sample <set name="blocked_actions" val="open_private_store;open_private_workshop;" /> /trade _open_trade _open_exchange for a zone. Sample <zone name="[giran_pvp_battle]" type="battle_zone"> <set name="index" val="3"/> <set name="entering_message_no" val="283"/> <set name="leaving_message_no" val="284"/> <polygon> <coords loc="72493 142263 -3850 -3350"/> <coords loc="73493 142264 -3850 -3350"/> <coords loc="73493 143261 -3850 -3350"/> <coords loc="72495 143258 -3850 -3350"/> </polygon> </zone> I'm waiting for your help...
  11. Hello there. I have been dealing 1 month. Server does not auto restart. what could be the problem ? Auto restart is running once after restart from the admin panel. Does not restart in the fallowing days .. Help please thx... # Setup the server restarts # # ============================ # Daily Auto-Restart on schedule. The restart format chronology. # * * * * * command to be executed # ? ? ? ? ? # ? ? ? ? ? # ? ? ? ? ? # ? ? ? ? ?????? day of week (0 - 6) (0 or 6 are Sunday to Saturday, or use names) # ? ? ? ??????????? month (1 - 12) # ? ? ???????????????? day of month (1 - 31) # ? ????????????????????? hour (0 - 23) # ?????????????????????????? min (0 - 59) # If the field is empty, the daily Auto-Restart is disabled by default, 5:00 # Every day at hour 05:00 = AutoRestartAt = 0 5 * * * # Every day at hour 23:00 = AutoRestartAt = 0 23 * * * # Every Monday at hour 05:00 = AutoRestartAt = 0 5 * * 1 AutoRestartAt = 0 7 * * *
  12. I found the solution. I corrected the buffer.sql canuse setting in Navicat settings...
  13. I have source but I do not know the use of Eclipse :(
  14. I've scanned all files. Core which program do I edit. advice?
  15. There is nothing to edit in htm. <html> <body scroll="no"> <br> <table width=755> <tr> <td align=center valign="top"> <table border=0 width=769 height=492 cellspacing=0 cellpadding=0 background="l2ui_ct1.Windows_DF_TooltipBG"> <tr> <td align=center> <br> <table border=0 cellpadding=0 cellspacing=0> <tr> <td valign=top align=center> %buffs% </td> </tr> </table> </td> </tr> <tr> <td align=center> <button value="Back" action="bypass _bbsbufferbypass_redirect main 0 0" width=200 height=30 back="L2UI_ct1.Button_DF_Down" fore="L2UI_ct1.Button_DF"> </td> </tr> </table> </td> </tr> </table> </body> </html>
  16. Hi. I want to edit The community board buffer. I want to add Dance of siren (siren dance) I'm waiting for your help...
  17. The problem is simple. but you don't want to say it. I'm waiting for your help. (the problem is probably in tutorial) lazzytr@hotmail.com
  18. Hello there Is there a solution to the immortality (Invul) bug in the game? BUG: Open the game. In the town. Ctrl + Alt + Del and crash the game. then open the game again. You unfavorable (Invul).
×
×
  • Create New...