Jump to content

ZaunProject

Members
  • Posts

    26
  • Credits

  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    0%

Everything posted by ZaunProject

  1. Zone: because OutOfZoneTask New Memo: because i like this one more.
  2. Hey guys, some time ago I developed this mod from scratch, I present to you the Tournament 2.0. A fighting system with modes 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9. Currently the code is for aCis, but with minimal knowledge in java you can adapt to any rev or chronicle. I can lend a hand to anyone who needs this discord: Discord Server Link Remembering that the system has been successfully tested on small servers, I believe that it will not be long before it gets 100% and be used on large servers, so I kindly ask you to report any bugs you find. What’s new? The code has been completely reworked for low memory and disk usage. The system is through listeners and triggers, considerably reducing the number of scheduled tasks and threads and, consequently, the use of system RAM. So let’s go to the list of news: All fights are instantiated: what gives the freedom to have several fights happen in the same place without the players of different fights interfering in their respective fights. Unlimited Arenas: arenas are created through a simple XML where only the spawn coordinates of a player in the world are configured, this means that you can create as many arenas as you want, ANYWHERE ON THE MAP. Fairer fights: fights were given a different way of picking a winner. They received a duration parameter – countdown – (that’s right, you can set the maximum time for each fight), with that, now there are 3 ways to win a fight: 1. Having the most live members on your team. 2. Having dealt more damage than the opposing team at the end of the fight countdown. 3. If one or more members of the enemy team is out of the combat zone for more than 10 seconds (for that a task – OutOfTheZoneTask – was created). If none of the above options are met, the fight will be considered a draw (meaning no damage was dealt or action taken during the fight – that’s right AFK players – and players will not receive rewards. Monitoring of fights: you can now monitor all fights that are currently taking place. Using an admin command you can enter the same instance of the fight and the players involved and thus check for any suspicious activity. Registration in fights: in order for a player to register he must choose the mode he wants to play, if it is a group mode (ie any one other than 1 vs 1), he must create a “TournamentTeam”, ie , he will no longer have the need to form a Party, he will have to invite to his team the members he wants to play with and the code itself will decide if all players are able to battle in the chosen mode. Choice of fights (WIP): fights will no longer be chosen randomly. Each player will have some parameters that determine their “fighting power”. 1. WDT (Win/Defeat/Ties) – This parameter determines the average wins per tie loss. 2. DPF (Damage per Fight) – this parameter determines the average damage the player deals per fight. These parameters are fully tied to defining the amount of points each player will earn on each win and draw and how much they will lose on each defeat, as well as sorting them into Elos (but this is still a work in progress). Defined the amount of points from the DPF and WDT teams will be allocated to play against teams that have a similar “fighting power”, so there will be a greater balance in the Tournament. – Automatic Rankings: last but not least, our specialty. HTMLs being dynamically and automatically generated. At the end of each fight, the data of the players involved are stored in the database. Every player can access these data using the command “.mytour” where you will see your own statistics on the tournament and other players. The statistics implemented (for all modes) so far are: 1. WDT Rate (Win/Defeat/Ties) 2. DPF (Damage per Fight) – Modes: 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9. 3. Total Damage Caused 4. Damage Caused – Modes: 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9. 5. Total Kills 6. Total Kills – Modes: 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9. 7. Total Wins – Modes: 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9. 8. Total Losses – Modes: 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9. 9. Total draws – Modes: 1 vs 1 / 2 vs 2 / 3 vs 3 / 4 vs 4 / 5 vs 5 / 9 vs 9. Important Settings: – Restriction of Skills in the arena. – Restriction of items in the arena. – Class restriction in all modes. – Auto Teleport when starting Tournament 2.0 (Confirm Dialog) – All other settings described above have the option to be disabled/enabled. Download: https://mega.nz/file/NdhCgaiZ#n_zgBmXNlgLheVRQQ6XeGpT0klD-4Zwl0NneS1u6NNQ Rar pass is https://discord.gg/2C37UszZ Enjoy
  3. Intro I'm really lazy about the interlude servers out there. Always same settings, same events, same gameplay. Thinking about it, some friends and I have been developing our server which, in addition to many new features, has a great differential in its main gameplay. Everything on the server will be revolving around FAME, which is the main parameter that classifies how strong a player is. When you get fame, you can go up from Elo Ranking (ranging from Iron III to Challanger - In total there are 22 rankings) and as with any ranking system the difficulty grows ~=Exponentially. Practically everything in L2Scary gives you FAME Points, and some things drastically reduce such points (losing events, failing instances, losing a pvp, olympics... etc) By climbing to the High Elos (Master, GrandMaster and Challenger) you will be able to unlock new instances and be lucky enough to get rewards by killing players. Some stats may also go up (but this is still an idea) Fame Zones The FAME system is fully integrated with the battle between clans. In L2 Scary there will be Fame Zones, and these have spot battles, that is, if your clan dominates an area for more than 10 minutes, the clan players within this area will get 100-200 fame every 10 minutes. Oly, TvT, Tournament, CTF, Party Farm Event, Kill The Boss Event In all these events it is possible to win FAME, however it is easy to lose in the same measure. Raid/Grand Boss Each raid boss will have a fame bonus for the pt that did the most damage, just like the LastAttacker. That said, let's go to some of the most common settings and features: Common Features - Exclusive daily instances - Clan Ranking Killing (Boss/Siege) every 15 days - AutoFarm for VIP and FREE players (purchase) - Daily missions with awards (and guess what? FAME) - Daily login rewards - Skin System +25 Skins - Achievement System - Weekly Olympics - Siege every 15 days Q: What about rates? R: who cares? It's a PvP server (just kidding) How will the Elo system at www.l2scary.com work: (OPEN 10/10/2021 19:00 UTC-3) > There will be 22 Elos (low elos: Iron III for Diamond I and High elos: Master for Challanger) > Killing players, Raid / Grand Boss, completing daily instances and winning some server events will earn you FAME! > To go up the Elo it is necessary to obtain FAME on the server (NOTE: Fame will not be available for purchase / donations. It is only possible to obtain fame by PLAYING !!) > When ascending, you will have the chance to receive rewards and also unlock new instances with different rewards. > By dying you will LOSE FAME, as well as losing failed events and instances (couldn't be that easy, right?!) > FAME is not a game item, but you can buy items in multisell so to speak. (When buying items, you may end up falling off the Elo, but the items are very special and you'll have to put them on the scale!) > Other ways to get fame: - Dominate the FameZone location with your clan (every 10 minutes generates an average of 100 Fame points for each clan player in the zone) NOTE: Fame Zone will not launch within the first week of the server. - Winning the tournament and the Olympics - Be the MainDamageDealer (player who dealt the most damage) or the Last Attacker (player who took the last hit) in kill the event boss - Winning Siege (if you lose a siege, you will lose fame too) > All Elos have a fame ranking that shows the most famous players. I believe they already have a lot of information about our system, but not only that, a lot of ideas are already under development. for server post-launch, who's coming with me?! Opening: 10/09/2021 (Friday) 19:00 UTC-3 (Brasilia) LINKS: website: WebSite facebook : Facebook
  4. l2jserver or something similar? I in your case would try to take some cb from one of the various projects out there and adapt it to your own way
  5. I think maybe your database connection settings aren't properly configured, idk. It's pretty hard to tell without seeing the code.
  6. You need to make your Command to be parsed in other class of your cb. Maybe TopBBSManager.java not only in BoardsManager
  7. What you mean by getSex method? I think your idea wont work that way
  8. Show only erros like that IS Impossible to say smth.
  9. Add me on discord: ZProject#6889 i can give u a hand
  10. Hello everyone, I would like to share this simple event. A registration npc spawns at a specific time and announces the registration as any event, after that everyone will have a time to register and those that are registered will be taken to a configured location where they will have time to kill the boss that will spawn. Each must achieve a minimum damage to the boss to receive the rewards. There are also two active functions: Last Attacker Reward and Main Damage Dealer reward. Both announced on the boss's death. Enjoy. Code
  11. far as I know, I think it’s not possible. My idea would be to parse the decrypted item descriptions. After that create a table with all the information in your code and generate an xml parser to obtain the description of each item. Finally just create a method in your L2Item to get the description of your table.
  12. I can write a code smth like this. Just send me a PM.
  13. As said, you have to change The info sent to yourself and other players in the UserInfo and CharInfo classes. After that, just create some method In your Pc instance class that updates the title as the amount of PvPs of this player when he kills someone
  14. Check your attackable Java class. Find the responsible method for Monsters dropping itens and insert your validation for each level rate. If you need any help send me a PM
  15. Hey MxC I'd like to share a simple, but util java modification. It's written for aCis, but you can simple adapt to any chronicle and project by changing the XML parser. This mod will allow you to set specific drops to specific monsters with determined level range, or determined class (RB, GB, Normal Mobs...) with chances. Why i made this mode? Normally L2J set monster drops like > Monster "X" have Items "Y" as drops. Then, to facilitate servers configuration i did the opposite. Like: Item "X" will be dropped by a specific range of mobs. There are 2 types of Universal Drops: 1. UniversalDropData.xml <?xml version="1.0" encoding="utf-8"?> <list> <UniversalDrop itemId="8762" minAmount="1" maxAmount="1" chance="1" premiumApplied="False" monstersIDs="200;201;202"/> </list> This mean: Top-Grade Life Stone (8762) will be dropped by monsters with ids (200, 201 and 202) regardless of their levels and class with 1% of chance. 2. CategorizedUniversalDropData.xml <?xml version="1.0" encoding="utf-8"?> <list> <CategorizedUniversalDrop itemId="8742" minAmount="1" maxAmount="1" minLevel="40" maxLevel="99" chance="5" premiumApplied="False" dropType="MONSTER"/> <CategorizedUniversalDrop itemId="8752" minAmount="1" maxAmount="1" minLevel="40" maxLevel="99" chance="10" premiumApplied="False" dropType="RAIDBOSS"/> <CategorizedUniversalDrop itemId="8762" minAmount="1" maxAmount="1" minLevel="40" maxLevel="99" chance="15" premiumApplied="False" dropType="GRANDBOSS"/> <CategorizedUniversalDrop itemId="3470" minAmount="1" maxAmount="10" minLevel="40" maxLevel="99" chance="40" premiumApplied="False" dropType="ALL"/> </list> This mean almost same of uncatecorized universal drops, except by the fact you decide class and level of monsters will drops the specified item. I think this mod will cover all sorts of monsters in lineage 2 if you know how to use. About Adaptation: First create a class UniversalDrop.java package dev.universalDrop; import java.util.ArrayList; import java.util.List; /** * @author Zaun */ public class UniversalDrop { private List<Integer> monsters = new ArrayList<>(); private int itemId; private int chance; private int[] amount = new int[2]; private int[] level = new int[2]; private boolean premiumApplied; private UniversalDropType dropType = UniversalDropType.ALL; /** * @return the monsters */ public List<Integer> getMonsters() { return monsters; } /** * @param monsters the monsters to set */ public void setMonsters(List<Integer> monsters) { this.monsters = monsters; } /** * @return the id */ public int getItemId() { return itemId; } /** * @param id the id to set */ public void setItemId(int id) { this.itemId = id; } /** * @return the amount */ public int[] getAmount() { return amount; } /** * @param amount the amount to set */ public void setAmount(int[] amount) { this.amount = amount; } /** * @return the chance */ public int getChance() { return chance; } /** * @param chance the chance to set */ public void setChance(int chance) { this.chance = chance; } /** * @return the premiumApplied */ public boolean isPremiumApplied() { return premiumApplied; } /** * @param premiumApplied the premiumApplied to set */ public void setPremiumApplied(boolean premiumApplied) { this.premiumApplied = premiumApplied; } /** * @return the dropType */ public UniversalDropType getDropType() { return dropType; } /** * @param dropType the dropType to set */ public void setDropType(UniversalDropType dropType) { this.dropType = dropType; } /** * @return the level */ public int[] getLevel() { return level; } /** * @param level the level to set */ public void setLevel(int[] level) { this.level = level; } } Then create UniversalDropData.java package dev.universalDrop.data.xml; import java.io.File; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import net.sf.l2j.commons.data.xml.XMLDocument; import net.sf.l2j.gameserver.data.ItemTable; import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; import dev.universalDrop.UniversalDrop; import dev.universalDrop.UniversalDropType; /** * @author Zaun */ public class UniversalDropData extends XMLDocument { private Map<Integer, UniversalDrop> universalDrops = new HashMap<>(); private Map<Integer, UniversalDrop> categorizedUniversalDrops = new HashMap<>(); public UniversalDropData() { load(); } public static UniversalDropData getInstance() { return SingleTonHolder._instance; } private static class SingleTonHolder { protected static final UniversalDropData _instance = new UniversalDropData(); } public void reload() { universalDrops.clear(); categorizedUniversalDrops.clear(); load(); } @Override protected void load() { loadDocument("./data/xml/UniversalDrop/UniversalDropData.xml"); LOG.info("UniversalDropData: Loaded " + universalDrops.size() + " Universal drops."); loadDocument("./data/xml/UniversalDrop/CategorizedUniversalDropData.xml"); LOG.info("UniversalDropData: Loaded " + categorizedUniversalDrops.size() + " Universal drops."); } @Override protected void parseDocument(Document doc, File f) { try { // First element is never read. final Node n = doc.getFirstChild(); for (Node o = n.getFirstChild(); o != null; o = o.getNextSibling()) { if (!"UniversalDrop".equalsIgnoreCase(o.getNodeName())) continue; NamedNodeMap attrs = o.getAttributes(); UniversalDrop universalDrop = null; int itemId = Integer.parseInt(attrs.getNamedItem("itemId").getNodeValue()); int minAmount = Integer.parseInt(attrs.getNamedItem("minAmount").getNodeValue()); int maxAmount = Integer.parseInt(attrs.getNamedItem("maxAmount").getNodeValue()); int chance = Integer.parseInt(attrs.getNamedItem("chance").getNodeValue()); String monstersIDs = attrs.getNamedItem("monstersIDs").getNodeValue(); boolean premiumApplied = Boolean.parseBoolean(attrs.getNamedItem("premiumApplied").getNodeValue()); if (ItemTable.getInstance().getTemplate(itemId) != null) { universalDrop = new UniversalDrop(); universalDrop.setItemId(itemId); universalDrop.setChance(chance); int[] amount = new int[2]; amount[0] = minAmount; amount[1] = maxAmount; universalDrop.setAmount(amount); int[] level = new int[2]; level[0] = -1; level[1] = 0; universalDrop.setLevel(level); universalDrop.setDropType(UniversalDropType.ALL); List<Integer> monsters = new ArrayList<>(); for (String monsterId : monstersIDs.split(";")) { monsters.add(Integer.parseInt(monsterId)); } universalDrop.setMonsters(monsters); universalDrop.setPremiumApplied(premiumApplied); universalDrops.put(itemId, universalDrop); } else { LOG.warning("Item Id: " + itemId + " is an invalid item for Universal drop ID: " + itemId + "(uncategorized)."); } } for (Node o = n.getFirstChild(); o != null; o = o.getNextSibling()) { if (!"CategorizedUniversalDrop".equalsIgnoreCase(o.getNodeName())) continue; NamedNodeMap attrs = o.getAttributes(); UniversalDrop universalDrop = null; int itemId = Integer.parseInt(attrs.getNamedItem("itemId").getNodeValue()); int minAmount = Integer.parseInt(attrs.getNamedItem("minAmount").getNodeValue()); int maxAmount = Integer.parseInt(attrs.getNamedItem("maxAmount").getNodeValue()); int minLevel = Integer.parseInt(attrs.getNamedItem("minLevel").getNodeValue()); int maxLevel = Integer.parseInt(attrs.getNamedItem("maxLevel").getNodeValue()); int chance = Integer.parseInt(attrs.getNamedItem("chance").getNodeValue()); UniversalDropType dropType = UniversalDropType.valueOf(attrs.getNamedItem("dropType").getNodeValue()); boolean premiumApplied = Boolean.parseBoolean(attrs.getNamedItem("premiumApplied").getNodeValue()); if (ItemTable.getInstance().getTemplate(itemId) != null) { universalDrop = new UniversalDrop(); universalDrop.setItemId(itemId); universalDrop.setChance(chance); int[] amount = new int[2]; amount[0] = minAmount; amount[1] = maxAmount; universalDrop.setAmount(amount); int[] level = new int[2]; level[0] = minLevel; level[1] = maxLevel; universalDrop.setDropType(dropType); universalDrop.setLevel(level); List<Integer> monsters = new ArrayList<>(); universalDrop.setMonsters(monsters); universalDrop.setPremiumApplied(premiumApplied); categorizedUniversalDrops.put(itemId, universalDrop); } else { LOG.warning("Item Id: " + itemId + " is an invalid item for Universal drop ID: " + itemId + "(categorized)."); } } } catch (Exception e) { LOG.warning("Universal Drop Data: Error while creating table: " + e); e.printStackTrace(); } } public List<Integer> getUncategorizedUniversalDropItemsIds() { List<Integer> items = new ArrayList<>(); for (Map.Entry<Integer, UniversalDrop> entry : universalDrops.entrySet()) { items.add(entry.getKey()); } return items; } public List<Integer> monstersWithDropId(int itemId) { for (Map.Entry<Integer, UniversalDrop> entry : universalDrops.entrySet()) { if (entry.getValue().getItemId() == itemId) { return entry.getValue().getMonsters(); } } return new ArrayList<>(); } public UniversalDrop getUncategorizedUniversalDropById(int itemId) { return universalDrops.get(itemId); } public UniversalDrop getCategorizedUniversalDropById(int itemId) { return categorizedUniversalDrops.get(itemId); } public Collection<UniversalDrop> getAllCategorizedUniversalDrops() { return categorizedUniversalDrops.values(); } } Then create this enum package dev.universalDrop; /** * @author Zaun */ public enum UniversalDropType { ALL, RAIDBOSS, GRANDBOSS, MONSTER } Then you need to modify your core. If you using aCis find class "Attackable.java" in "...model.actor" package. add this method: public void universalDropItem(UniversalDrop universalDrop, Player player) { int chance = universalDrop.getChance(); int amount = 0; IntIntHolder item = null; int premiumBonus = 0; Premium premium = player.getPremium(); if (Rnd.get(100) <= chance) { amount = Rnd.get(universalDrop.getAmount()[0], universalDrop.getAmount()[1]); item = new IntIntHolder(universalDrop.getItemId(), amount); if (universalDrop.isPremiumApplied() && player.getPremium().getLevel() > 0) { premiumBonus = (int) (amount * premium.getItemDropRate()) - amount; amount *= premium.getItemDropRate(); item.setPremiumBonus(premiumBonus); } // Check if the autoLoot mode is active if ((isRaid() && Config.AUTO_LOOT_RAID) || (!isRaid() && Config.AUTO_LOOT)) player.doAutoLoot(this, item); // Give this or these Item(s) to the Player that has killed the L2Attackable else dropItem(player, item); // drop the item on the ground } } Finde method: public void doItemDrop(NpcTemplate npcTemplate, Creature mainDamageDealer) add this code: // Custom universal drop (uncategorized) for (int dropId : UniversalDropData.getInstance().getUncategorizedUniversalDropItemsIds()) { if (UniversalDropData.getInstance().monstersWithDropId(dropId).contains(getNpcId())) { UniversalDrop universalDrop = UniversalDropData.getInstance().getUncategorizedUniversalDropById(dropId); universalDropItem(universalDrop, player); } } // Custom universal drop (categorized) for (UniversalDrop universalDrop : UniversalDropData.getInstance().getAllCategorizedUniversalDrops()) { UniversalDropType dropType = universalDrop.getDropType(); // if monster level doesn't correspond to drop level limit, stop execution if (!(getLevel() >= universalDrop.getLevel()[0] && getLevel() <= universalDrop.getLevel()[1])) { continue; } if (dropType.equals(UniversalDropType.ALL)) { universalDropItem(universalDrop, player); } else if (dropType.equals(UniversalDropType.RAIDBOSS)) { if (!(this instanceof RaidBoss)) { continue; } universalDropItem(universalDrop, player); } else if (dropType.equals(UniversalDropType.GRANDBOSS)) { if (!(this instanceof GrandBoss)) { continue; } universalDropItem(universalDrop, player); } else if (dropType.equals(UniversalDropType.MONSTER)) { if (!(this instanceof Monster)) { continue; } universalDropItem(universalDrop, player); } } Then add this line into your GameServer.java UniversalDropData.getInstance(); This will call the parser of drops. Now you need to go into your data pack and create a folder inside ./data/ and then create these XML files: "./data/xml/UniversalDrop/UniversalDropData.xml" ./data/xml/UniversalDrop/CategorizedUniversalDropData.xml You can use the post start xml code to create XML files. If you need any help to adapt this code in your source just send me a PM. Enjoy
×
×
  • Create New...