- 0
[HELP]DeathMatch
-
Posts
-
@Darafamboos let him know that this is already shared
-
Selling for 35 us umodel that opens any ukx , utx and static meshes from samurai updat 542 protocol . Leave me a pm if needed.
-
By sellerking · Posted
TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server! Create your free account here -
By D2RHiddenStash · Posted
NEW HIDDENSTASH KEY SYSTEM INTRODUCED TO THE SITE **Earn While You Spend - Introducing HS Cashback!** Every purchase on our site now rewards you with **HS Keys cashback** EVERY ONE WHO REGISTERS IN SITE UNTILL 15TH OF MAY GETS 2000 HS KEYS IN HES BALANE Here's how it works: **1 USD = 1000 HS Keys** **Get 3% cashback** on every purchase **Use your HS Keys to **save on your next order** --- ### ⚡ Why this is awesome * Every order gives you value back * Stack it with promos & HS usage * Turn your spending into future discounts --- ### Example Spend **$10** → Get **300 HS Keys** back Spend **$50** → Get **1500 HS Keys** back --- ### Smart system (built for fairness) * Cashback is rounded to keep things balanced * Prevents abuse from tiny orders * Rewards real buyers --- ### Start earning now Every purchase = progress toward your next discount Shop now and build your HS balance! #cashback #gamingdeals #d2r #rewards #loyalty Stay safe out there, heroes - and happy hunting! www.d2rhiddenstash.com We just launched our new Affiliate Program — and it’s the easiest way to earn HS Keys. Invite your friends using your personal link. Example: If your friend spends $10 → you get 300 HS Keys No limits. No effort. Just share your link. Get your referral link here: www.d2rhiddenstash.com/profile Start earning today -
It’s time for something new to rise. In a world filled with short-lived projects and empty promises, Emerge was created with a different vision — a vision built on experience, precision, and long-term commitment. This is not just another server launch. This is the beginning of something that is meant to last. 🌑 Eclipse x10 – A New Beginning Eclipse x10 is designed for players who seek more than just fast progression. It is built for those who value competition, balance, and a real Lineage II experience. From the very first day, every system has been carefully adjusted to provide a smooth and fair journey — where both solo players and clans can thrive. No shortcuts. No chaos. Only a structured and competitive world. ⚔️ What Awaits You • A balanced mid-rate environment (x10 core progression) • Stable and optimized gameplay • Fair systems with focus on long-term play • Competitive PvP and rewarding PvE • Active and dedicated administration • A project built with vision, not temporary hype 📊 Server Rates Basic: EXP/SP: x10 Adena: x5 Drop: x5 Spoil: x5 Secondary: Quests: x1 Seal Stones: x5 Life Stone Drop: x1 Enchant Scroll Drop: x1 Bosses: Raid Boss EXP/SP: x1 Raid Boss Drop: x1 Epic Boss EXP/SP: x1 Epic Boss Drop: x1 Enchant: Safe: +3 Max: +16 📅 Launch Information Grand Opening: 5 June 2026 The countdown has already begun. Clans are forming. Strategies are being prepared. The question is — will you be ready? 🔗 Join the Community Every strong server begins with a strong community. Be part of it from the very start. 💬 Discord: https://discord.gg/l2emerge 🌐 Website: https://www.l2emerge.com
-
-
Topics

Question
Kantik
Hi could someone help me please.
DM I have works flawlessly but I need to edit it but will not do it alone. I need to neportovaly players but gave up to me apart. He did not get to reward only one player but the first 10 and that has always shown that html tech players and their 10 points. That's it.
Thank you all.
/* * This program is free software: you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation, either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/>. */ package com.l2jserver.gameserver.model.entity; /** * * @author SqueezeD Edited By KantikSGC * */ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Vector; import javolution.text.TextBuilder; import java.util.logging.Logger; import com.l2jserver.Config; import com.l2jserver.L2DatabaseFactory; import com.l2jserver.gameserver.Announcements; import com.l2jserver.gameserver.ThreadPoolManager; import com.l2jserver.gameserver.datatables.NpcTable; import com.l2jserver.gameserver.datatables.SpawnTable; import com.l2jserver.gameserver.model.L2Effect; import com.l2jserver.gameserver.model.L2Party; import com.l2jserver.gameserver.model.L2Spawn; import com.l2jserver.gameserver.model.actor.L2Summon; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PetInstance; import com.l2jserver.gameserver.network.serverpackets.ActionFailed; import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jserver.gameserver.network.serverpackets.StatusUpdate; import com.l2jserver.gameserver.templates.chars.L2NpcTemplate; public class DM { private final static Logger _log = Logger.getLogger(DM.class.getName()); public static String _eventName = new String(), _eventDesc = new String(), _joiningLocationName = new String(); public static Vector<String> _savePlayers = new Vector<String>(); public static Vector<L2PcInstance> _players = new Vector<L2PcInstance>(); public static boolean _joining = false, _teleport = false, _started = false, _sitForced = false; public static L2Spawn _npcSpawn; public static L2PcInstance _topPlayer; public static int _npcId = 0, _npcX = 0, _npcY = 0, _npcZ = 0, _rewardId = 0, _rewardAmount = 0, _topKills = 0, _minlvl = 0, _maxlvl = 0, _playerColors = 0, _playerX = 0, _playerY = 0, _playerZ = 0; public static void setNpcPos(L2PcInstance activeChar) { _npcX = activeChar.getX(); _npcY = activeChar.getY(); _npcZ = activeChar.getZ(); } public static boolean checkMaxLevel(int maxlvl) { if (_minlvl >= maxlvl) return false; return true; } public static boolean checkMinLevel(int minlvl) { if (_maxlvl <= minlvl) return false; return true; } public static void setPlayersPos(L2PcInstance activeChar) { _playerX = activeChar.getX(); _playerY = activeChar.getY(); _playerZ = activeChar.getZ(); } public static boolean checkPlayerOk() { if (_started || _teleport || _joining) return false; return true; } public static void startJoin(L2PcInstance activeChar) { if (!startJoinOk()) { if (!Config.DEBUG) _log.fine("DM Engine[startJoin(" + activeChar.getName() + ")]: startJoinOk() = false"); return; } _joining = true; spawnEventNpc(activeChar); Announcements.getInstance().announceToAll(_eventName + "(DM): Joinable in " + _joiningLocationName + "!"); } private static boolean startJoinOk() { if (_started || _teleport || _joining || _eventName.equals("") || _joiningLocationName.equals("") || _eventDesc.equals("") || _npcId == 0 || _npcX == 0 || _npcY == 0 || _npcZ == 0 || _rewardId == 0 || _rewardAmount == 0 || _playerX == 0 || _playerY == 0 || _playerZ == 0) return false; return true; } private static void spawnEventNpc(L2PcInstance activeChar) { L2NpcTemplate tmpl = NpcTable.getInstance().getTemplate(_npcId); try { _npcSpawn = new L2Spawn(tmpl); _npcSpawn.setLocx(_npcX); _npcSpawn.setLocy(_npcY); _npcSpawn.setLocz(_npcZ); _npcSpawn.setAmount(1); _npcSpawn.setHeading(activeChar.getHeading()); _npcSpawn.setRespawnDelay(1); SpawnTable.getInstance().addNewSpawn(_npcSpawn, false); _npcSpawn.init(); _npcSpawn.getLastSpawn().getStatus().setCurrentHp(999999999); _npcSpawn.getLastSpawn().setTitle(_eventName); _npcSpawn.getLastSpawn()._isEventMobDM = true; _npcSpawn.getLastSpawn().isAggressive(); _npcSpawn.getLastSpawn().decayMe(); _npcSpawn.getLastSpawn().spawnMe(_npcSpawn.getLastSpawn().getX(), _npcSpawn.getLastSpawn().getY(), _npcSpawn.getLastSpawn().getZ()); _npcSpawn.getLastSpawn().broadcastPacket(new MagicSkillUse(_npcSpawn.getLastSpawn(), _npcSpawn.getLastSpawn(), 1034, 1, 1, 1)); } catch (Exception e) { _log.warning("DM Engine[spawnEventNpc(" + activeChar.getName() + ")]: exception: " + e.getMessage()); } } public static void teleportStart() { if (!_joining || _started || _teleport) return; _joining = false; Announcements.getInstance().announceToAll(_eventName + "(DM): Teleport to team spot in 20 seconds!"); setUserData(); ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() { public void run() { DM.sit(); for (L2PcInstance player : DM._players) { if (player != null) { if (Config.DM_ON_START_UNSUMMON_PET) { //Remove Summon's buffs if (player.getPet() != null) { L2Summon summon = player.getPet(); for (L2Effect e : summon.getAllEffects()) e.exit(); if (summon instanceof L2PetInstance) summon.unSummon(player); } } if (Config.DM_ON_START_REMOVE_ALL_EFFECTS) { for (L2Effect e : player.getAllEffects()) { if (e != null) e.exit(); } } // Remove player from his party if (player.getParty() != null) { L2Party party = player.getParty(); party.removePartyMember(player); } player.teleToLocation(_playerX, _playerY, _playerZ, false); } } } }, 20000); _teleport = true; } public static void startEvent(L2PcInstance activeChar) { if (!startEventOk()) { if (Config.DEBUG) _log.fine("DM Engine[startEvent(" + activeChar.getName() + ")]: startEventOk() = false"); return; } _teleport = false; sit(); Announcements.getInstance().announceToAll(_eventName + "(DM): Started. Go to kill your enemies!"); _started = true; } private static boolean startEventOk() { if (_joining || !_teleport || _started) return false; return true; } public static void setUserData() { for (L2PcInstance player : _players) { player._originalNameColorDM = player.getAppearance().getNameColor(); player._originalKarmaDM = player.getKarma(); player._inEventDM = true; player._countDMkills = 0; player.getAppearance().setNameColor(_playerColors); player.setKarma(0); player.broadcastUserInfo(); } } public static void removeUserData() { for (L2PcInstance player : _players) { player.getAppearance().setNameColor(player._originalNameColorDM); player.setKarma(player._originalKarmaDM); player._inEventDM = false; player._countDMkills = 0; player.broadcastUserInfo(); } } public static void finishEvent(L2PcInstance activeChar) { if (!finishEventOk()) { if (Config.DEBUG) _log.fine("DM Engine[finishEvent(" + activeChar.getName() + ")]: finishEventOk() = false"); return; } _started = false; unspawnEventNpc(); processTopPlayer(); if (_topKills == 0) Announcements.getInstance().announceToAll(_eventName + "(DM): No players win the match(nobody killed)."); else { Announcements.getInstance().announceToAll(_eventName + "(DM): " + _topPlayer.getName() + " wins the match! " + _topKills + " kills."); rewardPlayer(activeChar); } teleportFinish(); } private static boolean finishEventOk() { if (!_started) return false; return true; } public static void processTopPlayer() { for (L2PcInstance player : _players) { if (player._countDMkills > _topKills) { _topPlayer = player; _topKills = player._countDMkills; } } } /** * @param activeChar */ public static void rewardPlayer(L2PcInstance activeChar) { if (_topPlayer != null) { _topPlayer.addItem("DM Event: " + _eventName, _rewardId, _rewardAmount, _topPlayer, true); StatusUpdate su = new StatusUpdate(_topPlayer.getObjectId()); su.addAttribute(StatusUpdate.CUR_LOAD, _topPlayer.getCurrentLoad()); _topPlayer.sendPacket(su); NpcHtmlMessage nhm = new NpcHtmlMessage(5); TextBuilder replyMSG = new TextBuilder(""); replyMSG.append("<html><body>You won the event. Look in your inventory for the reward.</body></html>"); nhm.setHtml(replyMSG.toString()); _topPlayer.sendPacket(nhm); // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet _topPlayer.sendPacket(ActionFailed.STATIC_PACKET); } } public static void abortEvent() { if (!_joining && !_teleport && !_started) return; _joining = false; _teleport = false; _started = false; unspawnEventNpc(); Announcements.getInstance().announceToAll(_eventName + "(DM): Match aborted!"); teleportFinish(); } public static void sit() { if (_sitForced) _sitForced = false; else _sitForced = true; for (L2PcInstance player : _players) { if (player != null) { if (_sitForced) { player.stopMove(null, false); player.abortAttack(); player.abortCast(); if (!player.isSitting()) player.sitDown(); } else { if (player.isSitting()) player.standUp(); } } } } public static void dumpData() { _log.info(""); _log.info(""); if (!_joining && !_teleport && !_started) { _log.info("<<---------------------------------->>"); _log.info(">> DM Engine infos dump (INACTIVE) <<"); _log.info("<<--^----^^-----^----^^------^^----->>"); } else if (_joining && !_teleport && !_started) { _log.info("<<--------------------------------->>"); _log.info(">> DM Engine infos dump (JOINING) <<"); _log.info("<<--^----^^-----^----^^------^----->>"); } else if (!_joining && _teleport && !_started) { _log.info("<<---------------------------------->>"); _log.info(">> DM Engine infos dump (TELEPORT) <<"); _log.info("<<--^----^^-----^----^^------^^----->>"); } else if (!_joining && !_teleport && _started) { _log.info("<<--------------------------------->>"); _log.info(">> DM Engine infos dump (STARTED) <<"); _log.info("<<--^----^^-----^----^^------^----->>"); } _log.info("Name: " + _eventName); _log.info("Desc: " + _eventDesc); _log.info("Join location: " + _joiningLocationName); _log.info("Min lvl: " + _minlvl); _log.info("Max lvl: " + _maxlvl); _log.info(""); _log.info("##################################"); _log.info("# _players(Vector<L2PcInstance>) #"); _log.info("##################################"); _log.info("Total Players : " + _players.size()); for (L2PcInstance player : _players) { if (player != null) _log.info("Name: " + player.getName()+ " kills :" + player._countDMkills); } _log.info(""); _log.info("################################"); _log.info("# _savePlayers(Vector<String>) #"); _log.info("################################"); for (String player : _savePlayers) _log.info("Name: " + player ); _log.info(""); _log.info(""); } public static void loadData() { _eventName = new String(); _eventDesc = new String(); _joiningLocationName = new String(); _savePlayers = new Vector<String>(); _players = new Vector<L2PcInstance>(); _topPlayer = null; _npcSpawn = null; _joining = false; _teleport = false; _started = false; _sitForced = false; _npcId = 0; _npcX = 0; _npcY = 0; _npcZ = 0; _rewardId = 0; _rewardAmount = 0; _topKills = 0; _minlvl = 0; _maxlvl = 0; _playerColors = 0; _playerX = 0; _playerY = 0; _playerZ = 0; Connection con = null; try { PreparedStatement statement; ResultSet rs; con = L2DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement("Select * from dm"); rs = statement.executeQuery(); while (rs.next()) { _eventName = rs.getString("eventName"); _eventDesc = rs.getString("eventDesc"); _joiningLocationName = rs.getString("joiningLocation"); _minlvl = rs.getInt("minlvl"); _maxlvl = rs.getInt("maxlvl"); _npcId = rs.getInt("npcId"); _npcX = rs.getInt("npcX"); _npcY = rs.getInt("npcY"); _npcZ = rs.getInt("npcZ"); _rewardId = rs.getInt("rewardId"); _rewardAmount = rs.getInt("rewardAmount"); _playerColors = rs.getInt("color"); _playerX = rs.getInt("playerX"); _playerY = rs.getInt("playerY"); _playerZ = rs.getInt("playerZ"); } statement.close(); } catch (Exception e) { _log.warning("Exception: DM.loadData(): " + e.getMessage()); } finally { try { if (con != null) con.close(); } catch (SQLException e) { e.printStackTrace(); } } } public static void saveData() { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement; statement = con.prepareStatement("Delete from dm"); statement.execute(); statement.close(); statement = con.prepareStatement("INSERT INTO dm (eventName, eventDesc, joiningLocation, minlvl, maxlvl, npcId, npcX, npcY, npcZ, rewardId, rewardAmount, color, playerX, playerY, playerZ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); statement.setString(1, _eventName); statement.setString(2, _eventDesc); statement.setString(3, _joiningLocationName); statement.setInt(4, _minlvl); statement.setInt(5, _maxlvl); statement.setInt(6, _npcId); statement.setInt(7, _npcX); statement.setInt(8, _npcY); statement.setInt(9, _npcZ); statement.setInt(10, _rewardId); statement.setInt(11, _rewardAmount); statement.setInt(12, _playerColors); statement.setInt(13, _playerX); statement.setInt(14, _playerY); statement.setInt(15, _playerZ); statement.execute(); statement.close(); } catch (Exception e) { _log.warning("Exception: DM.saveData(): " + e.getMessage()); } finally { try { if (con != null) con.close(); } catch (SQLException e) { e.printStackTrace(); } } } public static void showEventHtml(L2PcInstance eventPlayer, String objectId) { try { NpcHtmlMessage adminReply = new NpcHtmlMessage(0); TextBuilder replyMSG = new TextBuilder("<html><head><title>" + _eventName + "</title></head><body>"); replyMSG.append("<center>"); replyMSG.append("<table>"); replyMSG.append("<tr>"); replyMSG.append("<td>Name</td><td><font color=\"00FF00\">" + _eventName + "</font></td>"); replyMSG.append("</tr>"); replyMSG.append("<tr>"); replyMSG.append("<td>Description</td><td><font color=\"00FF00\">" + _eventDesc + "</font></td>"); replyMSG.append("</tr>"); replyMSG.append("<tr>"); replyMSG.append("<td></td><td><button value=\"Join\" action=\"bypass -h npc_" + objectId + "_dmevent_player_join\" width=50 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"); if (!_started && !_joining) { replyMSG.append("<tr>"); replyMSG.append("<td></td><td>Wait till the admin/gm start the participation.</td>"); replyMSG.append("</tr>"); } else if (!_started && _joining && eventPlayer.getLevel() >= _minlvl && eventPlayer.getLevel() <= _maxlvl) { if (_players.contains(eventPlayer)) { replyMSG.append("<tr>"); replyMSG.append("<td></td><td>You are already participating!</td>"); replyMSG.append("</tr>"); replyMSG.append("<tr>"); replyMSG.append("<td>Wait till event start or</td>"); replyMSG.append("<td><button value=\"remove\" action=\"bypass -h npc_" + objectId + "_dmevent_player_leave\" width=50 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"> your participation!</td>"); replyMSG.append("</tr>"); } else { replyMSG.append("<tr>"); replyMSG.append("<td></td><td>You want to participate in the event?</td>"); replyMSG.append("</tr>"); replyMSG.append("<tr>"); replyMSG.append("<td>Admin set min lvl : <font color=\"00FF00\">" + _minlvl + "</font></td>"); replyMSG.append("</tr>"); replyMSG.append("<tr>"); replyMSG.append("<td>Admin set max lvl : <font color=\"00FF00\">" + _maxlvl + "</font></td>"); replyMSG.append("</tr>"); replyMSG.append("<tr>"); replyMSG.append("<td></td><td><button value=\"Join\" action=\"bypass -h npc_" + objectId + "_dmevent_player_join\" width=50 height=15 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>"); } } else if (_started && !_joining) { replyMSG.append("<tr>"); replyMSG.append("<td></td><td>DM match is in progress.</td>"); replyMSG.append("</tr>"); } else if (eventPlayer.getLevel() >= _minlvl || eventPlayer.getLevel() <= _maxlvl ) { replyMSG.append("<tr>"); replyMSG.append("<td>Your lvl</td><td><font color=\"00FF00\">" + eventPlayer.getLevel() +"</font></td>"); replyMSG.append("</tr>"); replyMSG.append("<tr>"); replyMSG.append("<td>Admin set min lvl</td><td><font color=\"00FF00\">" + _minlvl + "</font></td>"); replyMSG.append("</tr>"); replyMSG.append("<tr>"); replyMSG.append("<td>Admin set max lvl</td><td><font color=\"00FF00\">" + _maxlvl + "</font></td>"); replyMSG.append("</tr>"); replyMSG.append("<tr>"); replyMSG.append("<td></td><td><font color=\"FFFF00\">You can't participate to this event.</font></td>"); replyMSG.append("</tr>"); } replyMSG.append("</table>"); replyMSG.append("</center>"); replyMSG.append("</body></html>"); adminReply.setHtml(replyMSG.toString()); eventPlayer.sendPacket(adminReply); // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet eventPlayer.sendPacket(ActionFailed.STATIC_PACKET); } catch (Exception e) { _log.warning("DM Engine[showEventHtlm(" + eventPlayer.getName() + ", " + objectId + ")]: exception" + e.getMessage()); } } public static void addPlayer(L2PcInstance player) { if (!addPlayerOk(player)) return; _players.add(player); player._originalNameColorDM = player.getAppearance().getNameColor(); player._originalKarmaDM = player.getKarma(); player._inEventDM = true; player._countDMkills = 0; _savePlayers.add(player.getName()); } public static boolean addPlayerOk(L2PcInstance eventPlayer) { if (eventPlayer._inEventDM) { eventPlayer.sendMessage("You are already participating in the event!"); return false; } return true; } public static synchronized void addDisconnectedPlayer(L2PcInstance player) { if ((_teleport || _started) || _savePlayers.contains(player.getName())) { if (Config.DM_ON_START_REMOVE_ALL_EFFECTS) { for (L2Effect e : player.getAllEffects()) { if (e != null) e.exit(); } } for (L2PcInstance p : _players) { if (p==null) { continue; } //check by name incase player got new objectId else if (p.getName().equals(player.getName())) { player._originalNameColorDM = player.getAppearance().getNameColor(); player._originalKarmaDM = player.getKarma(); player._inEventDM = true; player._countDMkills =p._countDMkills; _players.remove(p); //removing old object id from vector _players.add(player); //adding new objectId to vector break; } } player.getAppearance().setNameColor(_playerColors); player.setKarma(0); player.broadcastUserInfo(); player.teleToLocation(_playerX, _playerY , _playerZ, false); } } public static void removePlayer(L2PcInstance player) { if (player != null) { _players.remove(player); } } public static void cleanDM() { for (L2PcInstance player : _players) { removePlayer(player); } _savePlayers = new Vector<String>(); _topPlayer = null; _npcSpawn = null; _joining = false; _teleport = false; _started = false; _sitForced = false; _topKills = 0; _players = new Vector<L2PcInstance>(); } public static void unspawnEventNpc() { if (_npcSpawn == null) return; _npcSpawn.getLastSpawn().deleteMe(); _npcSpawn.stopRespawn(); SpawnTable.getInstance().deleteSpawn(_npcSpawn, true); } public static void teleportFinish() { Announcements.getInstance().announceToAll(_eventName + "(DM): Teleport back to participation NPC in 20 seconds!"); removeUserData(); ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() { public void run() { for (L2PcInstance player : _players) { if (player != null && player.isOnline()) player.teleToLocation(_npcX, _npcY, _npcZ, false); } cleanDM(); } }, 20000); } }2 answers to this question
Recommended Posts