Jump to content

l2jkain

Members
  • Posts

    207
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by l2jkain

  1. could this remove? I'm adapting a frozen code for now and would like to know if removing this would give some error finally { try { con.close(); } catch (SQLException e) { e.printStackTrace(); } con = null; }
  2. that would look like? Triskell removed doesCharNameExist if (CharNameTable.doesCharNameExist(name))
  3. the mistake is that it does not save registered players in event class there is an add player method it is to register the players and has a variable called _playersShuffle that is to add the registered player but is not registering :(
  4. Bem, eu estou adaptando tudo de novo o que parece agora? porque neste caso ITEMSOUND_QUEST_FINISH = SOUND_FINISH no QuestState
  5. Are they going to help or keep fighting like children?
  6. I come to share a package that I can not finish so I do not have much information I ask for your help to finish. All events start normally TvT does not want to register for the event then the event is canceled CTF when clicking on npc the char hangs DM did not test It's not phoenix engine https://pastebin.com/v30gpeLW
  7. Hello, I'm trying to create a custom drop system, does anyone give me an idea? That's how it looks! Even registering in Gameserve.java is not running the drops /* * 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 net.sf.l2j.gameserver.datatables; import java.io.File; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Level; import java.util.logging.Logger; import net.sf.l2j.gameserver.model.actor.template.NpcTemplate; import net.sf.l2j.gameserver.model.item.DropCategory; import net.sf.l2j.gameserver.model.item.DropData; import net.sf.l2j.gameserver.templates.StatsSet; import net.sf.l2j.gameserver.xmlfactory.XMLDocumentFactory; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; /** * @author Williams * */ public class FeanorTable { private static Logger _log = Logger.getLogger(FeanorTable.class.getName()); private final Map<Integer, NpcTemplate> _feanor = new HashMap<>(); protected FeanorTable() { loadFeanorTable(); } public void reloadAllNpc() { _feanor.clear(); loadFeanorTable(); } private void loadFeanorTable() { try { final File dir = new File("./data/xml/feanorTable"); final StatsSet set = new StatsSet(); for (File file : dir.listFiles()) { final Document doc = XMLDocumentFactory.getInstance().loadDocument(file); Node list = doc.getFirstChild(); for (Node npc = list.getFirstChild(); npc != null; npc = npc.getNextSibling()) { NamedNodeMap attrs = npc.getAttributes(); for (Node cat = npc.getFirstChild(); cat != null; cat = cat.getNextSibling()) if ("drops".equalsIgnoreCase(cat.getNodeName())) { final List<DropCategory> drops = new ArrayList<>(); for (Node dropCat = cat.getFirstChild(); dropCat != null; dropCat = dropCat.getNextSibling()) { if ("category".equalsIgnoreCase(dropCat.getNodeName())) { attrs = dropCat.getAttributes(); final DropCategory category = new DropCategory(Integer.parseInt(attrs.getNamedItem("id").getNodeValue())); for (Node item = dropCat.getFirstChild(); item != null; item = item.getNextSibling()) { if ("drop".equalsIgnoreCase(item.getNodeName())) { attrs = item.getAttributes(); final DropData data = new DropData(); data.setItemId(Integer.parseInt(attrs.getNamedItem("itemid").getNodeValue())); data.setMinDrop(Integer.parseInt(attrs.getNamedItem("min").getNodeValue())); data.setMaxDrop(Integer.parseInt(attrs.getNamedItem("max").getNodeValue())); data.setChance(Integer.parseInt(attrs.getNamedItem("chance").getNodeValue())); if (ItemTable.getInstance().getTemplate(data.getItemId()) == null) { _log.warning("Droplist data for undefined itemId: " + data.getItemId()); continue; } category.addDropData(data, true); } } drops.add(category); } } set.set("drops", drops); } else if ("set".equalsIgnoreCase(cat.getNodeName())) { attrs = cat.getAttributes(); set.set(attrs.getNamedItem("name").getNodeValue(), attrs.getNamedItem("val").getNodeValue()); } else if ("teachTo".equalsIgnoreCase(cat.getNodeName())) set.set("teachTo", cat.getAttributes().getNamedItem("classes").getNodeValue()); } } set.clear(); } catch (Exception e) { _log.log(Level.SEVERE, "NpcTable: Error parsing NPC templates : ", e); } _log.info("NpcTable: Loaded " + _feanor.size() + " NPC templates."); } public NpcTemplate getTemplate(int id) { return _feanor.get(id); } /** * @param name to search. * @return the template list of NPCs for a given name. */ public NpcTemplate getTemplateByName(String name) { for (NpcTemplate npcTemplate : _feanor.values()) { if (npcTemplate.getName().equalsIgnoreCase(name)) return npcTemplate; } return null; } public static FeanorTable getInstance() { return SingletonHolder._instance; } private static class SingletonHolder { protected static final FeanorTable _instance = new FeanorTable(); } }
  8. :huh: :D :D :D :D :D A poor implementation of catguard kk
  9. I'm trying to turn on the server and it's popping it can anyone help me?,
  10. ReduceEnchant = true Would not it be up to him to bring down the label?
  11. I could not make the image appear :(
  12. Hello good night I'm trying to create a new buff page not buffer npc but I do not show the buff image what do I do?
  13. Hello somebody help me to create this good code it is loading more not to getting to aggregate in all the game monsters does anyone help? ### Eclipse Workspace Patch 1.0 #P aCis_gameserver Index: java/net/sf/l2j/gameserver/GameServer.java =================================================================== --- java/net/sf/l2j/gameserver/GameServer.java (revision 121) +++ java/net/sf/l2j/gameserver/GameServer.java (working copy) @@ -49,6 +49,7 @@ import net.sf.l2j.gameserver.datatables.ClanTable; import net.sf.l2j.gameserver.datatables.DoorTable; import net.sf.l2j.gameserver.datatables.EnchantTable; +import net.sf.l2j.gameserver.datatables.FeanorTable; import net.sf.l2j.gameserver.datatables.FishTable; import net.sf.l2j.gameserver.datatables.GmListTable; import net.sf.l2j.gameserver.datatables.HelperBuffTable; @@ -193,6 +194,7 @@ + + StringUtil.printSection("Feanor Drop All Mobs"); + FeanorTable.getInstance(); + StringUtil.printSection("System"); Index: java/net/sf/l2j/gameserver/datatables/FeanorTable.java =================================================================== @@ -0,0 +1,138 @@ --- java/net/sf/l2j/gameserver/datatables/FeanorTable.java (revision 01) +++ java/net/sf/l2j/gameserver/datatables/FeanorTable.java (working copy) +/* + * 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 net.sf.l2j.gameserver.datatables; + +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.logging.Logger; + +import net.sf.l2j.gameserver.model.item.DropCategory; +import net.sf.l2j.gameserver.model.item.DropData; +import net.sf.l2j.gameserver.xmlfactory.XMLDocumentFactory; + +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; + +/** + * @author williams + * + */ +public class FeanorTable +{ + private static Logger _log = Logger.getLogger(FeanorTable.class.getName()); + + private final Map<Integer, List<DropCategory>> _feanor = new HashMap<>(); + + protected FeanorTable() + { + try + { + File file = new File("./data/xml/feanor.xml"); + Document doc = XMLDocumentFactory.getInstance().loadDocument(file); + + Node n = doc.getFirstChild(); + for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling()) + { + if ("feanor".equalsIgnoreCase(d.getNodeName())) + { + NamedNodeMap attrs = d.getAttributes(); + int feanorId = Integer.parseInt(attrs.getNamedItem("id").getNodeValue()); + + List<DropCategory> category; + if (_feanor.containsKey(feanorId)) + category = _feanor.get(feanorId); + else + { + category = new ArrayList<>(); + _feanor.put(feanorId, category); + } + + for (Node cd = d.getFirstChild(); cd != null; cd = cd.getNextSibling()) + { + DropData dropDat = new DropData(); + if ("item".equalsIgnoreCase(cd.getNodeName())) + { + attrs = cd.getAttributes(); + int id = Integer.parseInt(attrs.getNamedItem("id").getNodeValue()); + int categoryType = Integer.parseInt(attrs.getNamedItem("category").getNodeValue()); + int minDrop = Integer.parseInt(attrs.getNamedItem("minDrop").getNodeValue()); + int maxDrop = Integer.parseInt(attrs.getNamedItem("maxDrop").getNodeValue()); + int chance = Integer.parseInt(attrs.getNamedItem("chance").getNodeValue()); + + dropDat.setItemId(id); + dropDat.setMinDrop(minDrop); + dropDat.setMaxDrop(maxDrop); + dropDat.setChance(chance); + + if (ItemTable.getInstance().getTemplate(dropDat.getItemId()) == null) + { + _log.warning("FeanorTable: FeanorTable data for undefined item template! feanorId: " + feanorId + ", itemId: " + dropDat.getItemId()); + continue; + } + + boolean catExists = false; + for (DropCategory cat : category) + { + // if the category exists, add the drop to this category. + if (cat.getCategoryType() == categoryType) + { + cat.addDropData(dropDat, false); + catExists = true; + break; + } + } + + // if the category doesn't exit, create it and add the drop + if (!catExists) + { + DropCategory cat = new DropCategory(categoryType); + cat.addDropData(dropDat, false); + category.add(cat); + } + } + } + } + } + } + catch (Exception e) + { + _log.warning("FeanorTable: Error while creating table: " + e); + } + _log.info("FeanorTable: Loaded " + _feanor.size() + " drops feanor."); + } + + public List<DropCategory> getTemplate(int feanorId) + { + return _feanor.get(feanorId); + } + + public static FeanorTable getInstance() + { + return SingletonHolder._instance; + } + + private static class SingletonHolder + { + protected static final FeanorTable _instance = new FeanorTable(); + } +} ### Eclipse Workspace Patch 1.0 #P aCis_datapack Index: data/xml/feanor.xml =================================================================== --- data/xml/feanor.xml (révision 1) +++ data/xml/feanor.xml (révision 2) @@ -0,564 +1,8 @@ <?xml version='1.0' encoding='utf-8'?> <list> <group id="1"><!-- Autor Williams --> <item id="3470" category="7" chance="30000" />> </group> </list>
  14. Well I would like a simple help I modified some things in my soucer, I would like to know if there is any option to create a path .diff with the things that I changed, if it has how I do? Does the project need to be upada in svn? I would like a tutorial talking about this if possible or a simple explanation talking about the subject thank you right away.
  15. Well the error continues already I formatted my pc tried with other projects and ta anyway giving it
  16. Anyone know why htmls are like this? And how do I do it?
  17. I would like to know which class that shows the hp of the doors of acis because in the free acis before the siege it shows the hp of the doors and walls but when it starts their hp does not show is null, I would like to know where it starts for me to try to fix.
  18. How would you look in the parts of the connection to the database? These parts here, UPDATE characters SET x=17867, y=170259, z=-3503 WHERE charId=?" and SELECT charId FROM characters WHERE char_name=?" Because that way nothing happens, I already changed that charId for that obj_id And it's still happening, he does not even notice the other player.
  19. net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.java private L2DoorInstance _requestedGate; + +/** The _active_boxes. */ +public int _active_boxes = -1; + +/** The active_boxes_characters. */ +public List<String> active_boxes_characters = new ArrayList<>(); + +/** +* check if local player can make multibox and also refresh local boxes instances number. +* @return true, if successful +*/ +public boolean checkMultiBox() +{ + +boolean output = false; + +int boxes_number = 0; // this one +final List<String> active_boxes = new ArrayList<>(); + +if (getClient() != null && getClient().getConnection() != null && !getClient().getConnection().isClosed() && getClient().getConnection().getInetAddress() != null) +{ +final String thisip = getClient().getConnection().getInetAddress().getHostAddress(); +final Collection<L2PcInstance> allPlayers = World.getInstance().getPlayers(); +for (final L2PcInstance player : allPlayers) +{ +if (player != null) +{ +if (player.isOnline() && player.getClient() != null && player.getClient().getConnection() != null && !player.getClient().getConnection().isClosed() && player.getClient().getConnection().getInetAddress() != null && !player.getName().equals(this.getName())) +{ +final String ip = player.getClient().getConnection().getInetAddress().getHostAddress(); +if (thisip.equals(ip) && this != player) +{ +if (!Config.ALLOW_DUALBOX) +{ +output = false; +break; +} +if (boxes_number + 1 > Config.ALLOWED_BOXES) +{ +// actual count+actual player one +output = true; +break; +} +boxes_number++; ++active_boxes.add(player.getName()); +} +} +} +} +} + +if (output) +{ +_active_boxes = boxes_number + 1; // current number of boxes+this one +if (!active_boxes.contains(this.getName())) +{ +active_boxes.add(this.getName()); + +this.active_boxes_characters = active_boxes; +} +refreshOtherBoxes(); +} +/** +_log.info("Player "+getName()+" has this boxes"); for(String name:active_boxes_characters){ _log.info("*** "+name+" ***"); } +*/ +return output; +} + +/** +* increase active boxes number for local player and other boxer for same ip. +*/ +public void refreshOtherBoxes() +{ +if (getClient() != null && getClient().getConnection() != null && !getClient().getConnection().isClosed() && getClient().getConnection().getInetAddress() != null) +{ +final String thisip = getClient().getConnection().getInetAddress().getHostAddress(); +final Collection<L2PcInstance> allPlayers = World.getInstance().getPlayers(); ++final L2PcInstance[] players = allPlayers.toArray(new L2PcInstance[allPlayers.size()]); +for (final L2PcInstance player : players) +{ +if (player != null && player.isOnline()) +{ +if (player.getClient() != null && player.getClient().getConnection() != null && !player.getClient().getConnection().isClosed() && +!player.getName().equals(this.getName())) +{ + +final String ip = player.getClient().getConnection().getInetAddress().getHostAddress(); +if (thisip.equals(ip) && this != player) +{ +player._active_boxes = _active_boxes; +player.active_boxes_characters = active_boxes_characters; +/** +_log.info("Player "+player.getName()+" has this boxes"); for(String name:player.active_boxes_characters){ _log.info("*** "+name+" ***"); } +*/ +} +} +} +} +} +} + +/** +* descrease active boxes number for local player and other boxer for same ip. +*/ +public void decreaseBoxes() +{ +_active_boxes = _active_boxes - 1; +active_boxes_characters.remove(this.getName()); + +refreshOtherBoxes(); +} + /** * Constructor of L2PcInstance (use L2Character constructor). net.sf.l2j.gameserver.model.olympiad.OlympiadManager.java noble.sendPacket(SystemMessageId.NOBLESSE_ONLY); return false; } +// Olympiad dualbox protection +if (noble._active_boxes > 1 && !Config.ALLOW_DUALBOX_OLY) +{ +final List<String> players_in_boxes = noble.active_boxes_characters; + i+f (players_in_boxes != null && players_in_boxes.size() > 1) +for (final String character_name : players_in_boxes) +{ +final L2PcInstance player = World.getInstance().getPlayer(character_name); + +if (player != null && (player.getOlympiadGameId() > 0 || player.isInOlympiadMode() || +OlympiadManager.getInstance().isRegistered(player))) +{ +noble.sendMessage("You are already participating in Olympiad with another char!"); +return false; +} +} +} + net.sf.l2j.gameserver.network.L2GameClient.java fast = !getActiveChar().isInCombat() && !getActiveChar().isLocked(); } + +// Decrease boxes number +if (getActiveChar()._active_boxes != -1) +getActiveChar().decreaseBoxes(); + ------------------ cleanMe(fast); + +// Decrease boxes number +if (getActiveChar()._active_boxes != -1) +getActiveChar().decreaseBoxes(); + // prevent closing again getActiveChar().setClient(null); config/events.properties AltOlyDividerNonClassed = 5 + +# Allow players to run multiple windows with a single IP address. +# In the game you can use the command // find_dualbox +AllowDualBox = True +AllowedBoxes = 99 +AllowDualBoxInOly = False + net.sf.l2j.Config.java public static boolean ALT_OLY_ANNOUNCE_GAMES; + +/**Dual Box*/ +public static boolean ALLOW_DUALBOX; +public static int ALLOWED_BOXES; +public static boolean ALLOW_DUALBOX_OLY; ----------------------------------- +ALLOW_DUALBOX_OLY = events.getProperty("AllowDualBoxInOly", true); +ALLOWED_BOXES = Integer.parseInt(events.getProperty("AllowedBoxes", "99")); +ALLOW_DUALBOX = events.getProperty("AllowDualBox", true); + ALT_GAME_CASTLE_DAWN = events.getProperty("AltCastleForDawn", true); Credits : Williams per Adapt from frozen
  20. Hello I'm putting a custom coin to drop all mobes but I realized something in there and I put a custom coin in all mobes. I level 81 killing a mobe lvl 1 to get the prize because this is happening? Free acis 350 use <category id="2"> <drop itemid="9210" min="2" max="9" chance="750000"/> //75% Medal Token <drop itemid="9211" min="3" max="7" chance="680000"/> //68% Skull Token <drop itemid="9212" min="1" max="12" chance="625000"/> //62,5% Red Eye Token <drop itemid="9213" min="1" max="9" chance="650000"/> //65% Pumpking Token <drop itemid="9214" min="1" max="8" chance="620000"/> //62% Blue Sphere Token <drop itemid="9215" min="1" max="10" chance="600000"/> //60% Red Scroll Token <drop itemid="9216" min="1" max="8" chance="500000"/> //50% Mochi Token </category>
×
×
  • Create New...