diff --git a/build/built-jar.properties b/build/built-jar.properties index 610d8a5853..d3af0b8646 100644 --- a/build/built-jar.properties +++ b/build/built-jar.properties @@ -1,4 +1,4 @@ -#Fri, 02 Jun 2017 18:46:19 -0300 +#Sat, 03 Jun 2017 19:45:04 -0300 C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2= diff --git a/build/classes/client/MapleCharacter.class b/build/classes/client/MapleCharacter.class index e1462c1d12..d50d166b50 100644 Binary files a/build/classes/client/MapleCharacter.class and b/build/classes/client/MapleCharacter.class differ diff --git a/build/classes/client/MapleClient.class b/build/classes/client/MapleClient.class index 6a6d95d875..81861f65cc 100644 Binary files a/build/classes/client/MapleClient.class and b/build/classes/client/MapleClient.class differ diff --git a/build/classes/client/command/Commands$1.class b/build/classes/client/command/Commands$1.class index 183fc6517a..d48a6db498 100644 Binary files a/build/classes/client/command/Commands$1.class and b/build/classes/client/command/Commands$1.class differ diff --git a/build/classes/client/command/Commands.class b/build/classes/client/command/Commands.class index dd392639fb..aea16cfa9f 100644 Binary files a/build/classes/client/command/Commands.class and b/build/classes/client/command/Commands.class differ diff --git a/build/classes/client/inventory/Equip$1.class b/build/classes/client/inventory/Equip$1.class index 4249923659..d74d98a0c0 100644 Binary files a/build/classes/client/inventory/Equip$1.class and b/build/classes/client/inventory/Equip$1.class differ diff --git a/build/classes/client/inventory/Equip$StatUpgrade.class b/build/classes/client/inventory/Equip$StatUpgrade.class index 73fedf82d3..4fdb1d4946 100644 Binary files a/build/classes/client/inventory/Equip$StatUpgrade.class and b/build/classes/client/inventory/Equip$StatUpgrade.class differ diff --git a/build/classes/client/inventory/Equip.class b/build/classes/client/inventory/Equip.class index 154f26ee47..41496acdde 100644 Binary files a/build/classes/client/inventory/Equip.class and b/build/classes/client/inventory/Equip.class differ diff --git a/build/classes/constants/ServerConstants.class b/build/classes/constants/ServerConstants.class index bfb0305dc1..315365e9b5 100644 Binary files a/build/classes/constants/ServerConstants.class and b/build/classes/constants/ServerConstants.class differ diff --git a/build/classes/net/server/RankingWorker.class b/build/classes/net/server/RankingWorker.class index c59bbe54d5..4f6f35c99d 100644 Binary files a/build/classes/net/server/RankingWorker.class and b/build/classes/net/server/RankingWorker.class differ diff --git a/build/classes/net/server/channel/handlers/AbstractDealDamageHandler.class b/build/classes/net/server/channel/handlers/AbstractDealDamageHandler.class index dc7d7e5259..0f85761d1c 100644 Binary files a/build/classes/net/server/channel/handlers/AbstractDealDamageHandler.class and b/build/classes/net/server/channel/handlers/AbstractDealDamageHandler.class differ diff --git a/build/classes/net/server/channel/handlers/CloseRangeDamageHandler.class b/build/classes/net/server/channel/handlers/CloseRangeDamageHandler.class index 600d376907..50d05b0ea0 100644 Binary files a/build/classes/net/server/channel/handlers/CloseRangeDamageHandler.class and b/build/classes/net/server/channel/handlers/CloseRangeDamageHandler.class differ diff --git a/build/classes/net/server/handlers/login/AfterLoginHandler.class b/build/classes/net/server/handlers/login/AfterLoginHandler.class index 60888ff864..0e82988f17 100644 Binary files a/build/classes/net/server/handlers/login/AfterLoginHandler.class and b/build/classes/net/server/handlers/login/AfterLoginHandler.class differ diff --git a/build/classes/server/MapleItemInformationProvider$RewardItem.class b/build/classes/server/MapleItemInformationProvider$RewardItem.class index 470baa8b4d..cc7d6d36de 100644 Binary files a/build/classes/server/MapleItemInformationProvider$RewardItem.class and b/build/classes/server/MapleItemInformationProvider$RewardItem.class differ diff --git a/build/classes/server/MapleItemInformationProvider$scriptedItem.class b/build/classes/server/MapleItemInformationProvider$scriptedItem.class index eb35eafd91..8215b2c515 100644 Binary files a/build/classes/server/MapleItemInformationProvider$scriptedItem.class and b/build/classes/server/MapleItemInformationProvider$scriptedItem.class differ diff --git a/build/classes/server/MapleItemInformationProvider.class b/build/classes/server/MapleItemInformationProvider.class index ea99b43de3..2f20343a9c 100644 Binary files a/build/classes/server/MapleItemInformationProvider.class and b/build/classes/server/MapleItemInformationProvider.class differ diff --git a/build/classes/server/MapleStatEffect$CancelEffectAction.class b/build/classes/server/MapleStatEffect$CancelEffectAction.class index afff570c99..dfa68103ce 100644 Binary files a/build/classes/server/MapleStatEffect$CancelEffectAction.class and b/build/classes/server/MapleStatEffect$CancelEffectAction.class differ diff --git a/build/classes/server/MapleStatEffect.class b/build/classes/server/MapleStatEffect.class index a85a9d691a..42a7243786 100644 Binary files a/build/classes/server/MapleStatEffect.class and b/build/classes/server/MapleStatEffect.class differ diff --git a/build/classes/server/events/BalrogPQ$2.class b/build/classes/server/events/BalrogPQ$2.class index d1746ea974..7e042e1514 100644 Binary files a/build/classes/server/events/BalrogPQ$2.class and b/build/classes/server/events/BalrogPQ$2.class differ diff --git a/build/classes/tools/MaplePacketCreator$1.class b/build/classes/tools/MaplePacketCreator$1.class index bc0b9cf05a..a421a4f622 100644 Binary files a/build/classes/tools/MaplePacketCreator$1.class and b/build/classes/tools/MaplePacketCreator$1.class differ diff --git a/build/classes/tools/MaplePacketCreator$2.class b/build/classes/tools/MaplePacketCreator$2.class index 249b09c5e8..eab52314d5 100644 Binary files a/build/classes/tools/MaplePacketCreator$2.class and b/build/classes/tools/MaplePacketCreator$2.class differ diff --git a/build/classes/tools/MaplePacketCreator.class b/build/classes/tools/MaplePacketCreator.class index 632ea90e1a..d66d8edeff 100644 Binary files a/build/classes/tools/MaplePacketCreator.class and b/build/classes/tools/MaplePacketCreator.class differ diff --git a/dist/MapleSolaxia.jar b/dist/MapleSolaxia.jar index 688bfba31d..e683c8df24 100644 Binary files a/dist/MapleSolaxia.jar and b/dist/MapleSolaxia.jar differ diff --git a/feature_list.txt b/feature_list.txt new file mode 100644 index 0000000000..a6dab82f79 --- /dev/null +++ b/feature_list.txt @@ -0,0 +1,42 @@ +========== MapleSolaxiaV2 ========== +Credits: +Ronan - Freelance Developer +Vcoc - Freelance Developer + +--------------------------- +Working features: +--------------------------- + +PQs/Quests: +* HPQ/KPQ/LPQ/LMPQ/EllinPQ/PiratePQ 100% +* BalrogPQ semi-functional +* Brand-new PQ: Boss Rush PQ 100% +* Doll house quest 100% +* Loads of quests have been patched. + +Player Social Network: +* Guild and Alliance system. +* Lobby system - Limited multiple PQ instances on same channel. + +Cash: +* EXP/DROP/Cosmetic Coupons 100% + +Server potentials: +* Multi-worlds 100% +* Adventurer Mount quests 100% +* All Equipment levels up. +* Player level rates. +* Gain fame by quests. +* Every monsterbook card is now droppable by overworld mobs. +* Added Boss HP Bar for dozens of bosses (needs provided custom wz) +* Custom jail system (needs provided custom wz) +* Delete Character 100% (requires ENABLE_PIC activated) + +Admin/GM commands: +* New commands +* Zakum/Horntail/Pinkbean 100% + +Project: +* Organized project code +* Highly configurable server (see server flags at ServerConstants) +--------------------------- \ No newline at end of file diff --git a/mychanges_ptbr.txt b/mychanges_ptbr.txt index 442b735d55..e7af5d528a 100644 --- a/mychanges_ptbr.txt +++ b/mychanges_ptbr.txt @@ -278,4 +278,10 @@ Consertadas mec 02 Junho 2017, Otimizado e corrigido problemas de queda de desempenho ao atribuir lvups a itens com stats muito elevados, que ocasionavam crashs no servidor. -Adicionado funcionalidade USE_ULTRA_THREE_SNAILS. Valor mostrado não é condizente com o dano contabilizado (motivo: client edit). \ No newline at end of file +Adicionado funcionalidade USE_ULTRA_THREE_SNAILS. Valor mostrado não é condizente com o dano contabilizado (motivo: client edit). + +03 Junho 2017, +Sistema de PIN agora completamente funcional. +Corrigido sistema de ranking para agora mostrar player rankings de acordo com o mundo que ele se encontra. +Adicionado barra de HP para o boss da BalrogPQ. +Equips apenas cosméticos (sem stats e/ou possibilidade de melhorar) não mais ganham EXP e, consequentemente, nivelam. \ No newline at end of file diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index a61a738718..0fba7312d9 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -5,21 +5,23 @@ src/tools/MaplePacketCreator.java - 5941 + 5939 - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2010007.js - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/GuildOperationHandler.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleGuild.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleAlliance.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/ItemIdSortHandler.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/Equip.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleStat.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/MapleServerHandler.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/Item.java file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleClient.java - file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMap.java + file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleItemInformationProvider.java diff --git a/scripts/npc/1061018.js b/scripts/npc/1061018.js index 9850b6a887..dcac42e942 100644 --- a/scripts/npc/1061018.js +++ b/scripts/npc/1061018.js @@ -9,31 +9,22 @@ function start(){ function action(mode, type, selection){ if(mode <= 0){ - if(!cm.getPlayer().getMap().getAllmonsters().size() == 2){ - cm.sendOk("Alrighty. We have high hopes for you so make us mercenaries proud!"); cm.dispose(); - } else { - cm.getPlayer().getMap().killAllMonsters(); - BalrogPQ.partyLeader = "undefined"; - BalrogPQ.balrogSpawned = false; - BalrogPQ.close(); - cm.warp(105100100); - cm.dispose(); - } + return; } else if(status == 0){ - if(cm.getPlayer().getMap().getCharacters().size() > 1){ - cm.sendYesNo("Are you really going to leave this battle and leave your fellow travelers to die?"); - dispose = false; - status++; - } else if(cm.getPlayer().getMap().getCharacters().size() <= 1 && cm.getPlayer().getMap().getAllmonsters().size() != 2){ - cm.sendYesNo("If you're a coward, you will leave."); - dispose = true; - status++; - } else if(cm.getPlayer().getMap().getAllmonsters().size() == 0){ + if(cm.getPlayer().getMap().getMonsters().size() == 0){ cm.sendOk("Wow! You defeated the balrog."); dispose = true; cm.getPlayer().getClient().getChannelServer().broadcastPacket(Packages.tools.MaplePacketCreator.serverNotice(0, BalrogPQ.partyLeader + "'s party has successfully defeated the Balrog! Praise to them, they finished with " + cm.getPlayer().getMap().getCharacters().size() + " players.")); status++; + } else if(cm.getPlayer().getMap().getCharacters().size() > 1){ + cm.sendYesNo("Are you really going to leave this battle and leave your fellow travelers to die?"); + dispose = false; + status++; + } else if(cm.getPlayer().getMap().getCharacters().size() <= 1){ + cm.sendYesNo("If you're a coward, you will leave."); + dispose = true; + status++; } else { cm.sendYesNo("So you are really going to leave?"); status++; diff --git a/sql/db_drops.sql b/sql/db_drops.sql index e71b5bc94f..f9a34a638d 100644 --- a/sql/db_drops.sql +++ b/sql/db_drops.sql @@ -19022,7 +19022,11 @@ (9300206, 2388032, 1, 1, 0, 8000), (9300207, 2388054, 1, 1, 0, 8000), (9300209, 2388053, 1, 1, 0, 8000), -(9300215, 2388046, 1, 1, 0, 8000); +(9300215, 2388046, 1, 1, 0, 8000), +(5110300, 2383016, 1, 1, 0, 8000), +(5110301, 2383028, 1, 1, 0, 8000), +(8143000, 2386010, 1, 1, 0, 8000), +(2220000, 2388000, 1, 1, 0, 8000); # (dropperid, itemid, minqty, maxqty, questid, chance) diff --git a/src/client/MapleCharacter.java b/src/client/MapleCharacter.java index bc6e4bbff7..8b124f3847 100644 --- a/src/client/MapleCharacter.java +++ b/src/client/MapleCharacter.java @@ -3454,7 +3454,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { if (this.guildid > 0) { getGuild().broadcast(MaplePacketCreator.levelUpMessage(2, level, name), this.getId()); } - if (ServerConstants.PERFECT_PITCH && level >= 30) { + if (ServerConstants.USE_PERFECT_PITCH && level >= 30) { //milestones? if (MapleInventoryManipulator.checkSpace(client, 4310000, (short) 1, "")) { MapleInventoryManipulator.addById(client, 4310000, (short) 1); @@ -6183,6 +6183,20 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject { } } } + + public void showAllEquipFeatures() { + MapleItemInformationProvider mii = MapleItemInformationProvider.getInstance(); + + for (Item item : getInventory(MapleInventoryType.EQUIPPED).list()) { + Equip nEquip = (Equip) item; + String itemName = mii.getName(nEquip.getItemId()); + if (itemName == null) { + continue; + } + + nEquip.showEquipFeatures(client); + } + } public Map getEvents() { return events; diff --git a/src/client/command/Commands.java b/src/client/command/Commands.java index 4ed80be8b3..f3643f4b92 100644 --- a/src/client/command/Commands.java +++ b/src/client/command/Commands.java @@ -310,14 +310,12 @@ public class Commands { public static boolean executePlayerCommand(MapleClient c, String[] sub, char heading) { MapleCharacter player = c.getPlayer(); if (heading == '!' && player.gmLevel() == 0) { - player.yellowMessage("You may not use !" + sub[0] + ", please try /" + sub[0]); + player.yellowMessage("You may not use !" + sub[0] + ", please try @" + sub[0] + ". For a full list of commands, try @help."); return false; } switch (sub[0]) { case "help": case "commands": - - case "playercommands": player.message("============================================================"); player.message("MapleSolaxiaV2 Player Commands"); @@ -337,6 +335,7 @@ public class Commands { player.message("@whodrops : Displays monsters that drop an item given an item name."); player.message("@uptime: Shows how long Solaxia has been online."); player.message("@bosshp: Displays the remaining HP of the bosses on your map."); + player.message("@equiplv: Displays relations of level and experience of every item you have equipped."); if(ServerConstants.USE_DEBUG) { player.message("@debugpos: Displays the coordinates on the map the player is currently located."); player.message("@debugmap: Displays info about the current map the player is located."); @@ -478,6 +477,11 @@ public class Commands { c.removeClickedNPC(); player.message("You've been disposed."); break; + + case "equiplv": + player.showAllEquipFeatures(); + break; + case "rates": //c.resetVoteTime(); player.yellowMessage("BOSSDROP RATE"); diff --git a/src/client/inventory/Equip.java b/src/client/inventory/Equip.java index df1d73d5b3..4118a2bce5 100644 --- a/src/client/inventory/Equip.java +++ b/src/client/inventory/Equip.java @@ -60,10 +60,6 @@ public class Equip extends Item { private StatUpgrade(int value) { this.value = value; } - - private int getValue() { - return value; - } } private byte upgradeSlots; @@ -475,13 +471,14 @@ public class Equip extends Item { } private double normalizedMasteryExp(int reqLevel) { - return Math.max((2622.71 * Math.exp(reqLevel * 0.0533649)) - 6000.0, 15); + return Math.max((2622.71 * Math.exp(reqLevel * 0.0733649)) - 6000.0, 15); } public void gainItemExp(MapleClient c, int gain) { // Ronan's Equip Exp gain method - if(itemLevel >= 30) return; + MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance(); + if(!ii.isUpgradeable(this.getItemId()) || itemLevel >= 30) return; - int reqLevel = MapleItemInformationProvider.getInstance().getEquipStats(this.getItemId()).get("reqLevel"); + int reqLevel = ii.getEquipStats(this.getItemId()).get("reqLevel"); float masteryModifier = (float)ExpTable.getExpNeededForLevel(1) / (float)normalizedMasteryExp(reqLevel); float elementModifier = (isElemental) ? 0.85f : 0.6f; @@ -491,7 +488,7 @@ public class Equip extends Item { itemExp += baseExpGain; int expNeeded = ExpTable.getEquipExpNeededForLevel(itemLevel); - //System.out.println("'" + MapleItemInformationProvider.getInstance().getName(this.getItemId()) + "' -> EXP Gain: " + gain + " Mastery: " + masteryModifier + "Base gain: " + baseExpGain + " exp: " + itemExp + " / " + expNeeded); + if(ServerConstants.USE_DEBUG_SHOW_INFO_EQPEXP) System.out.println("'" + ii.getName(this.getItemId()) + "' -> EXP Gain: " + gain + " Mastery: " + masteryModifier + " Base gain: " + baseExpGain + " exp: " + itemExp + " / " + expNeeded); if (itemExp >= expNeeded) { while(itemExp >= expNeeded) { @@ -507,9 +504,32 @@ public class Equip extends Item { } } else { c.getPlayer().forceUpdateItem(this); - //if(ServerConstants.USE_DEBUG) c.getPlayer().dropMessage("'" + MapleItemInformationProvider.getInstance().getName(this.getItemId()) + "': " + itemExp + " / " + expNeeded); + //if(ServerConstants.USE_DEBUG) c.getPlayer().dropMessage("'" + ii.getName(this.getItemId()) + "': " + itemExp + " / " + expNeeded); } } + + private boolean reachedMaxLevel(String eqpName) { + if(isElemental) { + if(eqpName.contains("Timeless")) { + if(itemLevel < 6) return false; + } else { + if(itemLevel < 4) return false; + } + } + + if(itemLevel < ServerConstants.USE_EQUIPMNT_LVLUP) return false; + return true; + } + + public void showEquipFeatures(MapleClient c) { + MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance(); + if(!ii.isUpgradeable(this.getItemId())) return; + + String eqpName = ii.getName(getItemId()); + String eqpInfo = reachedMaxLevel(eqpName) ? " - MAX LEVEL" : (" EXP: " + itemExp + " / " + ExpTable.getEquipExpNeededForLevel(itemLevel)); + + c.getPlayer().dropMessage(5, "'" + eqpName + "' -> Level: " + itemLevel + eqpInfo); + } public void setItemExp(int exp) { this.itemExp = exp; diff --git a/src/constants/ServerConstants.java b/src/constants/ServerConstants.java index bba8b53cf0..617b15c8cc 100644 --- a/src/constants/ServerConstants.java +++ b/src/constants/ServerConstants.java @@ -15,7 +15,8 @@ public class ServerConstants { public static final long PURGING_INTERVAL = 5 * 60 * 1000; public static final long RANKING_INTERVAL = 60 * 60 * 1000; //60 minutes, 3600000. public static final long COUPON_INTERVAL = 60 * 60 * 1000; //60 minutes, 3600000. - public static final boolean ENABLE_PIC = true; //Pick true/false to enable or disable Pic. + public static final boolean ENABLE_PIC = false; //Pick true/false to enable or disable Pic. Delete character needs this feature ENABLED. + public static final boolean ENABLE_PIN = false; //Pick true/false to enable or disable Pin. //Ip Configuration public static String HOST; @@ -33,7 +34,8 @@ public class ServerConstants { public static final boolean USE_CUSTOM_KEYSET = true; public static final boolean USE_MAXRANGE = true; //Will send and receive packets from all events of a map, rather than those of only view range. public static final boolean USE_DEBUG = true; //Will enable some text prints and new commands in the client oriented for debugging. - public static final boolean USE_DEBUG_SHOW_RCVD_PACKETS = false; + public static final boolean USE_DEBUG_SHOW_RCVD_PACKET = false; //Prints on the cmd all received packet ids. + public static final boolean USE_DEBUG_SHOW_INFO_EQPEXP = false; //Prints on the cmd all equip exp gain info. public static final boolean USE_MTS = false; public static final boolean USE_FAMILY_SYSTEM = false; public static final boolean USE_DUEY = true; @@ -47,7 +49,7 @@ public class ServerConstants { public static final int MAX_EVENT_LEVELS = 8; //Event has different levels of rewarding system. public static final long BLOCK_DUEY_RACE_COND = (long)(0.5 * 1000); public static final long PET_LOOT_UPON_ATTACK = (long)(0.7 * 1000); //Time the pet must wait before trying to pick items up. - public static final boolean PERFECT_PITCH = true; //For lvl 30 or above, each lvlup player gains 1 perfect pitch. + public static final boolean USE_PERFECT_PITCH = true; //For lvl 30 or above, each lvlup player gains 1 perfect pitch. //Some Gameplay Enhancing Configuration public static final boolean USE_PERFECT_SCROLLING = true; //Scrolls doesn't use slots upon failure. @@ -61,8 +63,8 @@ public class ServerConstants { public static final boolean USE_STACK_COUPON_RATES = true; //Multiple coupons effects builds up together. public static final boolean USE_EQUIPMNT_LVLUP_SLOTS = true;//Equips can upgrade slots at level up. public static final boolean USE_EQUIPMNT_LVLUP_POWER = true;//Enable more powerful stats upgrades at equip level up. - public static final int MAX_EQUIPMNT_LVLUP_STAT_GAIN = 120; //Max stat upgrade an equipment can have on a levelup. - public static final int USE_EQUIPMNT_LVLUP = 7; //All equips lvlup at max level of N, set 0 to disable. + public static final int MAX_EQUIPMNT_LVLUP_STAT_GAIN = 10000; //Max stat upgrade an equipment can have on a levelup. + public static final int USE_EQUIPMNT_LVLUP = 7; //All equips lvlup at max level of N, set 1 to disable. public static final int FAME_GAIN_BY_QUEST = 4; //Fame gain each N quest completes, set 0 to disable. public static final int SCROLL_CHANCE_RATE = 10; //Number of tries for success on a scroll, set 0 for default. diff --git a/src/net/MapleServerHandler.java b/src/net/MapleServerHandler.java index 114c2027bb..211792d8a7 100644 --- a/src/net/MapleServerHandler.java +++ b/src/net/MapleServerHandler.java @@ -131,7 +131,7 @@ public class MapleServerHandler extends IoHandlerAdapter { short packetId = slea.readShort(); MapleClient client = (MapleClient) session.getAttribute(MapleClient.CLIENT_KEY); - if(ServerConstants.USE_DEBUG_SHOW_RCVD_PACKETS) System.out.println("Received packet id " + packetId); + if(ServerConstants.USE_DEBUG_SHOW_RCVD_PACKET) System.out.println("Received packet id " + packetId); final MaplePacketHandler packetHandler = processor.getHandler(packetId); if (packetHandler != null && packetHandler.validateState(client)) { try { diff --git a/src/net/server/RankingWorker.java b/src/net/server/RankingWorker.java index 837468b4fe..5f01b25274 100644 --- a/src/net/server/RankingWorker.java +++ b/src/net/server/RankingWorker.java @@ -32,6 +32,7 @@ import constants.ServerConstants; /** * @author Matze * @author Quit + * @author Ronan */ public class RankingWorker implements Runnable { private Connection con; @@ -43,16 +44,17 @@ public class RankingWorker implements Runnable { reset.executeUpdate(); } - private void updateRanking(int job) throws SQLException { - String sqlCharSelect = "SELECT c.id, " + (job != -1 ? "c.jobRank, c.jobRankMove" : "c.rank, c.rankMove") + ", a.lastlogin AS lastlogin, a.loggedin FROM characters AS c LEFT JOIN accounts AS a ON c.accountid = a.id "; + private void updateRanking(int job, int world) throws SQLException { + String sqlCharSelect = "SELECT c.id, " + (job != -1 ? "c.jobRank, c.jobRankMove" : "c.rank, c.rankMove") + ", a.lastlogin AS lastlogin, a.loggedin FROM characters AS c LEFT JOIN accounts AS a ON c.accountid = a.id WHERE c.world = ? "; if (job != -1) { - sqlCharSelect += "WHERE c.job DIV 100 = ? "; + sqlCharSelect += "AND c.job DIV 100 = ? "; } sqlCharSelect += "ORDER BY c.level DESC , c.exp DESC , c.fame DESC , c.meso DESC"; - PreparedStatement charSelect = con.prepareStatement(sqlCharSelect); + PreparedStatement charSelect = con.prepareStatement(sqlCharSelect); + charSelect.setInt(1, world); if (job != -1) { - charSelect.setInt(1, job); + charSelect.setInt(2, job); } ResultSet rs = charSelect.executeQuery(); PreparedStatement ps = con.prepareStatement("UPDATE characters SET " + (job != -1 ? "jobRank = ?, jobRankMove = ? " : "rank = ?, rankMove = ? ") + "WHERE id = ?"); @@ -87,12 +89,14 @@ public class RankingWorker implements Runnable { resetMoveRank(false); } - updateRanking(-1); //overall ranking - for (int i = 0; i <= MapleJob.getMax(); i++) { - updateRanking(i); + for(int j = 0; j < Server.getInstance().getWorlds().size(); j++) { + updateRanking(-1, j); //overall ranking + for (int i = 0; i <= MapleJob.getMax(); i++) { + updateRanking(i, j); + } + con.commit(); } - con.commit(); con.setAutoCommit(true); lastUpdate = System.currentTimeMillis(); } catch (SQLException ex) { diff --git a/src/net/server/channel/handlers/AbstractDealDamageHandler.java b/src/net/server/channel/handlers/AbstractDealDamageHandler.java index 40beea7f10..c7ab44236a 100644 --- a/src/net/server/channel/handlers/AbstractDealDamageHandler.java +++ b/src/net/server/channel/handlers/AbstractDealDamageHandler.java @@ -601,7 +601,7 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl MapleStatEffect effect = skill.getEffect(ret.skilllevel); if (magic) { - // Since the skill is magic based, use the magic formula + // Since the skill is magic based, use the magic formula if(chr.getJob() == MapleJob.IL_ARCHMAGE || chr.getJob() == MapleJob.IL_MAGE) { int skillLvl = chr.getSkillLevel(ILMage.ELEMENT_AMPLIFICATION); if(skillLvl > 0) @@ -611,7 +611,7 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl if(skillLvl > 0) calcDmgMax = calcDmgMax * SkillFactory.getSkill(FPMage.ELEMENT_AMPLIFICATION).getEffect(skillLvl).getY() / 100; } else if(chr.getJob() == MapleJob.BLAZEWIZARD3 || chr.getJob() == MapleJob.BLAZEWIZARD4) { - int skillLvl = chr.getSkillLevel(BlazeWizard.ELEMENT_AMPLIFICATION); + int skillLvl = chr.getSkillLevel(BlazeWizard.ELEMENT_AMPLIFICATION); if(skillLvl > 0) calcDmgMax = calcDmgMax * SkillFactory.getSkill(BlazeWizard.ELEMENT_AMPLIFICATION).getEffect(skillLvl).getY() / 100; } else if(chr.getJob() == MapleJob.EVAN7 || chr.getJob() == MapleJob.EVAN8 || chr.getJob() == MapleJob.EVAN9 || chr.getJob() == MapleJob.EVAN10) { @@ -622,16 +622,16 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl calcDmgMax *= effect.getMatk(); if(ret.skill == Cleric.HEAL) { - // This formula is still a bit wonky, but it is fairly accurate. + // This formula is still a bit wonky, but it is fairly accurate. calcDmgMax = (int) Math.round((chr.getTotalInt() * 4.8 + chr.getTotalLuk() * 4) * chr.getTotalMagic() / 1000); calcDmgMax = calcDmgMax * effect.getHp() / 100; } - } else if(ret.skill == Hermit.SHADOW_MESO) { - // Shadow Meso also has its own formula - calcDmgMax = effect.getMoneyCon() * 10; - calcDmgMax = (int) Math.floor(calcDmgMax * 1.5); + } else if(ret.skill == Hermit.SHADOW_MESO) { + // Shadow Meso also has its own formula + calcDmgMax = effect.getMoneyCon() * 10; + calcDmgMax = (int) Math.floor(calcDmgMax * 1.5); } else { - // Normal damage formula for skills + // Normal damage formula for skills calcDmgMax = calcDmgMax * effect.getDamage() / 100; } } @@ -646,9 +646,12 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl MapleStatEffect ceffect = SkillFactory.getSkill(advcomboid).getEffect(chr.getSkillLevel(advcomboid)); calcDmgMax = (int) Math.floor(calcDmgMax * (ceffect.getDamage() + 50) / 100 + 0.20 + (comboBuff - 5) * 0.04); } else { - // Normal Combo - MapleStatEffect ceffect = SkillFactory.getSkill(oid).getEffect(chr.getSkillLevel(oid)); - calcDmgMax = (int) Math.floor(calcDmgMax * (ceffect.getDamage() + 50) / 100 + Math.floor((comboBuff - 1) * (chr.getSkillLevel(oid) / 6)) / 100); + // Normal Combo + int skillLv = chr.getSkillLevel(oid); + if(skillLv <= 0) skillLv = SkillFactory.getSkill(oid).getMaxLevel(); + + MapleStatEffect ceffect = SkillFactory.getSkill(oid).getEffect(skillLv); + calcDmgMax = (int) Math.floor(calcDmgMax * (ceffect.getDamage() + 50) / 100 + Math.floor((comboBuff - 1) * (skillLv / 6)) / 100); } if(GameConstants.isFinisherSkill(ret.skill)) { diff --git a/src/net/server/channel/handlers/CloseRangeDamageHandler.java b/src/net/server/channel/handlers/CloseRangeDamageHandler.java index 74fe99fb6f..c18c57026b 100644 --- a/src/net/server/channel/handlers/CloseRangeDamageHandler.java +++ b/src/net/server/channel/handlers/CloseRangeDamageHandler.java @@ -87,7 +87,9 @@ public final class CloseRangeDamageHandler extends AbstractDealDamageHandler { if (advComboSkillLevel > 0) { ceffect = advcombo.getEffect(advComboSkillLevel); } else { - ceffect = combo.getEffect(player.getSkillLevel(combo)); + int comboLv = player.getSkillLevel(combo); + if(comboLv <= 0) comboLv = SkillFactory.getSkill(oid).getMaxLevel(); + ceffect = combo.getEffect(comboLv); } if (orbcount < ceffect.getX() + 1) { int neworbcount = orbcount + 1; @@ -96,7 +98,10 @@ public final class CloseRangeDamageHandler extends AbstractDealDamageHandler { neworbcount++; } } - int duration = combo.getEffect(player.getSkillLevel(oid)).getDuration(); + + int olv = player.getSkillLevel(oid); + if(olv <= 0) olv = SkillFactory.getSkill(oid).getMaxLevel(); + int duration = combo.getEffect(olv).getDuration(); List> stat = Collections.singletonList(new Pair<>(MapleBuffStat.COMBO, neworbcount)); player.setBuffedValue(MapleBuffStat.COMBO, neworbcount); duration -= (int) (System.currentTimeMillis() - player.getBuffedStarttime(MapleBuffStat.COMBO)); diff --git a/src/net/server/handlers/login/AfterLoginHandler.java b/src/net/server/handlers/login/AfterLoginHandler.java index acb54d19a8..420635b485 100644 --- a/src/net/server/handlers/login/AfterLoginHandler.java +++ b/src/net/server/handlers/login/AfterLoginHandler.java @@ -30,7 +30,6 @@ public final class AfterLoginHandler extends AbstractMaplePacketHandler { @Override public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { - System.out.println("after login"); byte c2 = slea.readByte(); byte c3 = 5; diff --git a/src/net/server/handlers/login/LoginPasswordHandler.java b/src/net/server/handlers/login/LoginPasswordHandler.java index eeb86dba67..0c3011820a 100644 --- a/src/net/server/handlers/login/LoginPasswordHandler.java +++ b/src/net/server/handlers/login/LoginPasswordHandler.java @@ -65,7 +65,7 @@ public final class LoginPasswordHandler implements MaplePacketHandler { return; } if (c.finishLogin() == 0) { - login(c); + login(c); } else { c.announce(MaplePacketCreator.getLoginFailed(7)); } diff --git a/src/server/MapleItemInformationProvider.java b/src/server/MapleItemInformationProvider.java index bb68ff0120..cc940b6319 100644 --- a/src/server/MapleItemInformationProvider.java +++ b/src/server/MapleItemInformationProvider.java @@ -1295,6 +1295,16 @@ public class MapleItemInformationProvider { return itemId / 1000000 == 5 || getEquipStats(itemId).get("cash") == 1; } + public boolean isUpgradeable(int itemId) { + Item it = this.getEquipById(itemId); + Equip eq = (Equip)it; + + return (eq.getUpgradeSlots() > 0 || eq.getStr() > 0 || eq.getDex() > 0 || eq.getInt() > 0 || eq.getLuk() > 0 || + eq.getWatk() > 0 || eq.getMatk() > 0 || eq.getWdef() > 0 || eq.getMdef() > 0 || eq.getAcc() > 0 || + eq.getAvoid() > 0 || eq.getSpeed() > 0 || eq.getJump() > 0 || eq.getHp() > 0 || eq.getMp() > 0); + } + + public boolean isRateCoupon(int itemId) { int itemType = itemId / 1000; return itemType == 5211 || itemType == 5360; diff --git a/src/server/MapleStatEffect.java b/src/server/MapleStatEffect.java index 4d5a7b3bbd..529a0c5254 100644 --- a/src/server/MapleStatEffect.java +++ b/src/server/MapleStatEffect.java @@ -677,6 +677,10 @@ public class MapleStatEffect { if (primary) { if (itemConNo != 0) { + if(!applyto.getClient().getAbstractPlayerInteraction().hasItem(itemCon, itemConNo)) { + applyto.getClient().announce(MaplePacketCreator.enableActions()); + return false; + } MapleInventoryManipulator.removeById(applyto.getClient(), MapleItemInformationProvider.getInstance().getInventoryType(itemCon), itemCon, itemConNo, false, true); } } diff --git a/src/server/events/BalrogPQ.java b/src/server/events/BalrogPQ.java index 4a100b2a9b..731e3da958 100644 --- a/src/server/events/BalrogPQ.java +++ b/src/server/events/BalrogPQ.java @@ -62,10 +62,10 @@ public class BalrogPQ { public void run(){ if(fmap.getCharacters().size() <= 3){ if(fmap.getCharacters().size() > 0){ - for(MapleCharacter chrs : fmap.getCharacters()){ - chrs.message("[The Order]: What? You're down to that many mercenaries? I need you get you out of there."); - chrs.changeMap(105100100); - } + for(MapleCharacter chrs : fmap.getCharacters()){ + chrs.message("[The Order]: What? You're down to that many mercenaries? I need to get you out of there."); + chrs.changeMap(105100100); + } } fmap.killAllMonsters(); close(); diff --git a/src/tools/MaplePacketCreator.java b/src/tools/MaplePacketCreator.java index b24709bfc2..20865227d5 100644 --- a/src/tools/MaplePacketCreator.java +++ b/src/tools/MaplePacketCreator.java @@ -694,8 +694,10 @@ public class MaplePacketCreator { mplew.writeLong(0);//isquietban time mplew.writeLong(c.getSessionId()); //creation time mplew.writeInt(0); - mplew.writeShort(2);//PIN - + + if (ServerConstants.ENABLE_PIN) mplew.writeShort(0); + else mplew.writeShort(2); + return mplew.getPacket(); } diff --git a/wz/Mob.wz/8830000.img.xml b/wz/Mob.wz/8830000.img.xml index 10571582c3..99fe061d41 100644 --- a/wz/Mob.wz/8830000.img.xml +++ b/wz/Mob.wz/8830000.img.xml @@ -48,6 +48,9 @@ + + +