diff --git a/build/built-jar.properties b/build/built-jar.properties index d3af0b8646..86bc43705f 100644 --- a/build/built-jar.properties +++ b/build/built-jar.properties @@ -1,4 +1,4 @@ -#Sat, 03 Jun 2017 19:45:04 -0300 +#Sun, 04 Jun 2017 22:54:17 -0300 C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2= diff --git a/build/classes/client/command/Commands$1.class b/build/classes/client/command/Commands$1.class index d48a6db498..c487a6b1b3 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 aea16cfa9f..ff2234012a 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 d74d98a0c0..2bcd400266 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.class b/build/classes/client/inventory/Equip.class index 41496acdde..c2596cc156 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/GameConstants.class b/build/classes/constants/GameConstants.class index 58d5af2e0e..627f9a2b43 100644 Binary files a/build/classes/constants/GameConstants.class and b/build/classes/constants/GameConstants.class differ diff --git a/build/classes/constants/ServerConstants.class b/build/classes/constants/ServerConstants.class index 315365e9b5..ee4af3ed8e 100644 Binary files a/build/classes/constants/ServerConstants.class and b/build/classes/constants/ServerConstants.class differ diff --git a/build/classes/server/MapleInventoryManipulator.class b/build/classes/server/MapleInventoryManipulator.class index da33036fae..384e991589 100644 Binary files a/build/classes/server/MapleInventoryManipulator.class and b/build/classes/server/MapleInventoryManipulator.class differ diff --git a/build/classes/server/MapleStatEffect$CancelEffectAction.class b/build/classes/server/MapleStatEffect$CancelEffectAction.class index dfa68103ce..1768534406 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 42a7243786..2b064a77aa 100644 Binary files a/build/classes/server/MapleStatEffect.class and b/build/classes/server/MapleStatEffect.class differ diff --git a/build/classes/server/life/MobSkill.class b/build/classes/server/life/MobSkill.class index a5236c1fea..bde36d2429 100644 Binary files a/build/classes/server/life/MobSkill.class and b/build/classes/server/life/MobSkill.class differ diff --git a/dist/MapleSolaxia.jar b/dist/MapleSolaxia.jar index e683c8df24..a2e20fde2e 100644 Binary files a/dist/MapleSolaxia.jar and b/dist/MapleSolaxia.jar differ diff --git a/mychanges_ptbr.txt b/mychanges_ptbr.txt index e7af5d528a..28041b43ff 100644 --- a/mychanges_ptbr.txt +++ b/mychanges_ptbr.txt @@ -284,4 +284,10 @@ Adicionado funcionalidade USE_ULTRA_THREE_SNAILS. Valor mostrado n 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 +Equips apenas cosméticos (sem stats e/ou possibilidade de melhorar) não mais ganham EXP e, consequentemente, nivelam. + +04 Junho 2017, +Otimizados o método de ganho de stats de equips ao nivelar. +Diversos ajustes finos nos comandos existentes. +Adicionados novos comandos: proitem, seteqstats, buffme, buffmap. +Vários ajustes finos \ No newline at end of file diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml index 0fba7312d9..b701fc2280 100644 --- a/nbproject/private/private.xml +++ b/nbproject/private/private.xml @@ -17,8 +17,10 @@ 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/server/MapleStatEffect.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/server/life/MobSkill.java file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMap.java file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleItemInformationProvider.java diff --git a/src/client/SkillFactory.java b/src/client/SkillFactory.java index 098aef3a00..fa3a2b9675 100644 --- a/src/client/SkillFactory.java +++ b/src/client/SkillFactory.java @@ -91,9 +91,9 @@ public class SkillFactory { private static MapleDataProvider datasource = MapleDataProviderFactory.getDataProvider(MapleDataProviderFactory.fileInWZPath("Skill.wz")); public static Skill getSkill(int id) { - if (!skills.isEmpty()) { - return skills.get(Integer.valueOf(id)); - } + if (!skills.isEmpty()) { + return skills.get(Integer.valueOf(id)); + } return null; } diff --git a/src/client/command/Commands.java b/src/client/command/Commands.java index f3643f4b92..d02fc02e50 100644 --- a/src/client/command/Commands.java +++ b/src/client/command/Commands.java @@ -92,6 +92,8 @@ import client.MapleStat; import client.Skill; import client.SkillFactory; import client.inventory.Item; +import client.inventory.Equip; +import client.inventory.MapleInventory; import client.inventory.MapleInventoryType; import client.inventory.MaplePet; import constants.GameConstants; @@ -306,6 +308,23 @@ public class Commands { gotomaps.put("ht", 240050400); gotomaps.put("fm", 910000000); } + + private static void hardsetItemStats(Equip equip, short stat) { + equip.setStr(stat); + equip.setDex(stat); + equip.setInt(stat); + equip.setLuk(stat); + equip.setMatk(stat); + equip.setWatk(stat); + equip.setAcc(stat); + equip.setAvoid(stat); + equip.setJump(stat); + equip.setSpeed(stat); + equip.setWdef(stat); + equip.setMdef(stat); + equip.setHp(stat); + equip.setMp(stat); + } public static boolean executePlayerCommand(MapleClient c, String[] sub, char heading) { MapleCharacter player = c.getPlayer(); @@ -748,11 +767,129 @@ public class Commands { victim.setRemainingAp(Integer.parseInt(sub[2])); victim.updateSingleStat(MapleStat.AVAILABLEAP, victim.getRemainingAp()); } - } else if (sub[0].equals("buffme")) { - final int[] array = {9001000, 9101002, 9101003, 9101008, 2001002, 1101007, 1005, 2301003, 5121009, 1111002, 4111001, 4111002, 4211003, 4211005, 1321000, 2321004, 3121002}; + } else if (sub[0].equals("empowerme")) { + final int[] array = {9001000, 9001001, 9101002, 9101003, 9101008, 2001002, 1101007, 1005, 2301003, 5121009, 1111002, 4111001, 4111002, 4211003, 4211005, 1321000, 2321004, 3121002}; for (int i : array) { SkillFactory.getSkill(i).getEffect(SkillFactory.getSkill(i).getMaxLevel()).applyTo(player); } + + } else if (sub[0].equals("buffme")) { + //GM Skills : Haste(Super) - Holy Symbol - Bless - Hyper Body - Echo of Hero + SkillFactory.getSkill(9101001).getEffect(SkillFactory.getSkill(9101001).getMaxLevel()).applyTo(player); + SkillFactory.getSkill(9101002).getEffect(SkillFactory.getSkill(9101002).getMaxLevel()).applyTo(player); + SkillFactory.getSkill(9101003).getEffect(SkillFactory.getSkill(9101003).getMaxLevel()).applyTo(player); + SkillFactory.getSkill(9101008).getEffect(SkillFactory.getSkill(9101008).getMaxLevel()).applyTo(player); + SkillFactory.getSkill(1005).getEffect(SkillFactory.getSkill(1005).getMaxLevel()).applyTo(player); + player.setHp(player.getMaxHp()); + player.updateSingleStat(MapleStat.HP, player.getMaxHp()); + player.setMp(player.getMaxMp()); + player.updateSingleStat(MapleStat.MP, player.getMaxMp()); + } else if (sub[0].equals("buffmap")) { + for (MapleCharacter chr : player.getMap().getCharacters()){ + //GM Skills : Haste(Super) - Holy Symbol - Bless - Hyper Body - Echo of Hero + SkillFactory.getSkill(9101001).getEffect(SkillFactory.getSkill(9101001).getMaxLevel()).applyTo(chr); + SkillFactory.getSkill(9101002).getEffect(SkillFactory.getSkill(9101002).getMaxLevel()).applyTo(chr); + SkillFactory.getSkill(9101003).getEffect(SkillFactory.getSkill(9101003).getMaxLevel()).applyTo(chr); + SkillFactory.getSkill(9101008).getEffect(SkillFactory.getSkill(9101008).getMaxLevel()).applyTo(chr); + SkillFactory.getSkill(1005).getEffect(SkillFactory.getSkill(1005).getMaxLevel()).applyTo(chr); + chr.setHp(chr.getMaxHp()); + chr.updateSingleStat(MapleStat.HP, chr.getMaxHp()); + chr.setMp(chr.getMaxMp()); + chr.updateSingleStat(MapleStat.MP, chr.getMaxMp()); + } + } else if (sub[0].equals("buff")) { + if (sub.length < 2){ + player.yellowMessage("Syntax: !buff "); + return true; + } + int skillid=Integer.parseInt(sub[1]); + + Skill skill = SkillFactory.getSkill(skillid); + if(skill != null) skill.getEffect(skill.getMaxLevel()).applyTo(player); + } else if (sub[0].equals("proitem")) { + if (sub.length < 3) { + player.dropMessage("Syntax: !proitem "); + return true; + } + + int itemid = 0; + short multiply = 0; + + itemid = Integer.parseInt(sub[1]); + multiply = Short.parseShort(sub[2]); + + MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance(); + Item item = ii.getEquipById(itemid); + MapleInventoryType type = ii.getInventoryType(itemid); + if (type.equals(MapleInventoryType.EQUIP)) { + hardsetItemStats((Equip) item, multiply); + MapleInventoryManipulator.addFromDrop(c, item); + + } else { + player.dropMessage("Make sure it's an equippable item."); + } + + } else if (sub[0].equals("seteqstat")) { + if (sub.length < 2) { + player.dropMessage("Syntax: !seteqstat "); + return true; + } + + int val = Integer.parseInt(sub[1]); + + MapleInventory equip = player.getInventory(MapleInventoryType.EQUIP); + for (byte i = 0; i < 101; i++) { + try { + Equip eu = (Equip) equip.getItem(i); + int item = equip.getItem(i).getItemId(); + short hand = eu.getHands(); + byte level = eu.getLevel(); + Equip nItem = new Equip(item, i); + nItem.setStr(eu.getStr()); // STR + nItem.setDex(eu.getDex()); // DEX + nItem.setInt(eu.getInt()); // INT + nItem.setLuk(eu.getLuk()); //LUK + nItem.setWatk(eu.getWatk()); //WA + + //All Previous stats excluding the top 5 + nItem.setWdef(eu.getWdef()); + nItem.setAcc(eu.getHands()); + nItem.setAvoid(eu.getAvoid()); + nItem.setExpiration(eu.getExpiration()); + nItem.setJump(eu.getJump()); + nItem.setLevel(eu.getLevel()); + nItem.setMatk(eu.getMatk()); + nItem.setMdef(eu.getMdef()); + nItem.setMp(eu.getMp()); + nItem.setOwner(eu.getOwner()); + nItem.setSpeed(eu.getSpeed()); + nItem.setUpgradeSlots((byte) eu.getUpgradeSlots()); + nItem.setHands(eu.getHands()); + nItem.setLevel(eu.getLevel()); + short incval= (short)val; + nItem.setWdef(incval); + nItem.setAcc(incval); + nItem.setAvoid(incval); + nItem.setJump(incval); + nItem.setMatk(incval); + nItem.setMdef(incval); + nItem.setMp(incval); + nItem.setSpeed(incval); + nItem.setUpgradeSlots((byte) eu.getUpgradeSlots()); + nItem.setHands(incval); + nItem.setWatk(incval); + nItem.setDex(incval); + nItem.setInt(incval); + nItem.setStr(incval); + nItem.setLuk(incval); + Item tempItem = c.getPlayer().getInventory(MapleInventoryType.EQUIP).getItem((byte) i); + MapleInventoryManipulator.removeFromSlot(c, MapleInventoryType.EQUIP, (byte)i, tempItem.getQuantity(), false, true); + player.getInventory(MapleInventoryType.EQUIP).addFromDB(nItem); + } catch(Exception e){} + } + c.getSession().write(MaplePacketCreator.getCharInfo(player)); + //player.getMap().removePlayer(player); + //player.getMap().addPlayer(player); } else if (sub[0].equals("spawn")) { if (sub.length < 2) { player.yellowMessage("Syntax: !spawn "); diff --git a/src/client/inventory/Equip.java b/src/client/inventory/Equip.java index 4118a2bce5..158e5d7e73 100644 --- a/src/client/inventory/Equip.java +++ b/src/client/inventory/Equip.java @@ -288,30 +288,19 @@ public class Equip extends Item { } } - private int randomizeStatUpgrade(int limit) { - Map pool = new HashMap<>(); - - int top = Math.min(limit, ServerConstants.MAX_EQUIPMNT_LVLUP_STAT_GAIN); - pool.put(0, top); - for(int i = 1; i <= top; i++) { - pool.put(i, top - i + 1); - } - - int poolCount = 0; - for(Integer i: pool.values()) { - poolCount += i; - } + private int randomizeStatUpgrade(int top) { + int limit = Math.min(top, ServerConstants.MAX_EQUIPMNT_LVLUP_STAT_GAIN); + int poolCount = (limit * (limit + 1) / 2) + limit; int rnd = Randomizer.rand(0, poolCount); + int stat = 0; - for(Integer i: pool.values()) { - if(rnd < i) break; - - stat++; - rnd -= i; + if(rnd >= limit) { + rnd -= limit; + stat = 1 + (int)Math.floor((-1 + Math.sqrt((8 * rnd) + 1)) / 2); } - return(stat); + return stat; } private void getUnitStatUpgrade(List> stats, StatUpgrade name, int curStat, boolean isAttribute) { diff --git a/src/constants/GameConstants.java b/src/constants/GameConstants.java index 788a8bf061..28455552c5 100644 --- a/src/constants/GameConstants.java +++ b/src/constants/GameConstants.java @@ -8,9 +8,9 @@ import constants.skills.Aran; */ public class GameConstants { // Ronan's rates upgrade system - private static final int[] DROP_RATE_GAIN = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; - private static final int[] MESO_RATE_GAIN = {1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66}; - private static final int[] EXP_RATE_GAIN = {1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144}; //fibonacci :3 + private static final int[] DROP_RATE_GAIN = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}; + private static final int[] MESO_RATE_GAIN = {1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105}; + private static final int[] EXP_RATE_GAIN = {1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610}; //fibonacci :3 public static int getPlayerBonusMesoRate(int slot) { return(MESO_RATE_GAIN[slot]); diff --git a/src/constants/ServerConstants.java b/src/constants/ServerConstants.java index 617b15c8cc..3bbae2c2d2 100644 --- a/src/constants/ServerConstants.java +++ b/src/constants/ServerConstants.java @@ -32,6 +32,7 @@ public class ServerConstants { //Gameplay Configuration public static final boolean USE_CUSTOM_KEYSET = true; + public static final boolean USE_MAXRANGE_ECHO_OF_HERO = 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_PACKET = false; //Prints on the cmd all received packet ids. diff --git a/src/server/MapleInventoryManipulator.java b/src/server/MapleInventoryManipulator.java index 48441020c7..c5bd5f342a 100644 --- a/src/server/MapleInventoryManipulator.java +++ b/src/server/MapleInventoryManipulator.java @@ -143,6 +143,10 @@ public class MapleInventoryManipulator { return true; } + public static boolean addFromDrop(MapleClient c, Item item) { + return addFromDrop(c, item, true); + } + public static boolean addFromDrop(MapleClient c, Item item, boolean show) { return addFromDrop(c, item, show, -1); } diff --git a/src/server/MapleStatEffect.java b/src/server/MapleStatEffect.java index 529a0c5254..7c9e07c3ff 100644 --- a/src/server/MapleStatEffect.java +++ b/src/server/MapleStatEffect.java @@ -228,6 +228,11 @@ public class MapleStatEffect { if (ltd != null) { ret.lt = (Point) ltd.getData(); ret.rb = (Point) source.getChildByPath("rb").getData(); + + if(ServerConstants.USE_MAXRANGE_ECHO_OF_HERO && (sourceid == Beginner.ECHO_OF_HERO || sourceid == Noblesse.ECHO_OF_HERO || sourceid == Legend.ECHO_OF_HERO || sourceid == Evan.ECHO_OF_HERO)) { + ret.lt = new Point(Integer.MIN_VALUE, Integer.MIN_VALUE); + ret.rb = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); + } } int x = MapleDataTool.getInt("x", source, 0); @@ -703,7 +708,7 @@ public class MapleStatEffect { AutobanFactory.MPCON.addPoint(applyfrom.getAutobanManager(), "mpCon hack for skill:" + sourceid + "; Player MP: " + applyto.getMp() + " MP Needed: " + getMpCon()); } */ if (hpchange != 0) { - if (hpchange < 0 && (-hpchange) > applyto.getHp() && !applyto.hasDisease(MapleDisease.ZOMBIFY)) { + if (hpchange < 0 && (-hpchange) >= applyto.getHp() && (!applyto.hasDisease(MapleDisease.ZOMBIFY) || hpCon == 0)) { applyto.getClient().announce(MaplePacketCreator.enableActions()); return false; } @@ -1053,6 +1058,7 @@ public class MapleStatEffect { hpchange += makeHealHP(hp / 100.0, applyfrom.getTotalMagic(), 3, 5); if (applyfrom.hasDisease(MapleDisease.ZOMBIFY)) { hpchange = -hpchange; + hpCon = 0; } } } diff --git a/src/server/life/MobSkill.java b/src/server/life/MobSkill.java index 80b7ae37c3..5fce7da70d 100644 --- a/src/server/life/MobSkill.java +++ b/src/server/life/MobSkill.java @@ -187,6 +187,7 @@ public class MobSkill { disease = MapleDisease.CONFUSE; break; case 133: // zombify + disease = MapleDisease.ZOMBIFY; break; case 140: if (makeChanceResult() && !monster.isBuffed(MonsterStatus.MAGIC_IMMUNITY)) { @@ -199,21 +200,21 @@ public class MobSkill { } break; case 143: // Weapon Reflect - stats.put(MonsterStatus.WEAPON_REFLECT, Integer.valueOf(x)); - stats.put(MonsterStatus.WEAPON_IMMUNITY, Integer.valueOf(x)); - reflection.add(x); + stats.put(MonsterStatus.WEAPON_REFLECT, Integer.valueOf(x)); + stats.put(MonsterStatus.WEAPON_IMMUNITY, Integer.valueOf(x)); + reflection.add(x); break; case 144: // Magic Reflect - stats.put(MonsterStatus.MAGIC_REFLECT, Integer.valueOf(x)); - stats.put(MonsterStatus.MAGIC_IMMUNITY, Integer.valueOf(x)); - reflection.add(x); + stats.put(MonsterStatus.MAGIC_REFLECT, Integer.valueOf(x)); + stats.put(MonsterStatus.MAGIC_IMMUNITY, Integer.valueOf(x)); + reflection.add(x); break; case 145: // Weapon / Magic reflect - stats.put(MonsterStatus.WEAPON_REFLECT, Integer.valueOf(x)); - stats.put(MonsterStatus.WEAPON_IMMUNITY, Integer.valueOf(x)); - stats.put(MonsterStatus.MAGIC_REFLECT, Integer.valueOf(x)); - stats.put(MonsterStatus.MAGIC_IMMUNITY, Integer.valueOf(x)); - reflection.add(x); + stats.put(MonsterStatus.WEAPON_REFLECT, Integer.valueOf(x)); + stats.put(MonsterStatus.WEAPON_IMMUNITY, Integer.valueOf(x)); + stats.put(MonsterStatus.MAGIC_REFLECT, Integer.valueOf(x)); + stats.put(MonsterStatus.MAGIC_IMMUNITY, Integer.valueOf(x)); + reflection.add(x); break; case 154: // accuracy up case 155: // avoid up