PIN system + player ranking fix + rebalanced equip EXP calculations

Added the PIN feature. Fixed ranking now calculating ranks now
world-based instead of overall. Rebalanced equip exp gain and made
cosmetic equipments no more leveling up (cosmetics leveling up are
useless).
This commit is contained in:
ronancpl
2017-06-03 20:02:19 -03:00
parent 02cc9efb00
commit 809d90564c
43 changed files with 193 additions and 78 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
#Fri, 02 Jun 2017 18:46:19 -0300 #Sat, 03 Jun 2017 19:45:04 -0300
C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2= C\:\\Nexon\\MapleSolaxia\\MapleSolaxiaV2=
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.
+42
View File
@@ -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)
---------------------------
+7 -1
View File
@@ -278,4 +278,10 @@ Consertadas mec
02 Junho 2017, 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. 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). 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.
+9 -7
View File
@@ -5,21 +5,23 @@
<url>src/tools/MaplePacketCreator.java</url> <url>src/tools/MaplePacketCreator.java</url>
<bookmark id="1"> <bookmark id="1">
<name/> <name/>
<line>5941</line> <line>5939</line>
<key/> <key/>
</bookmark> </bookmark>
</file> </file>
</editor-bookmarks> </editor-bookmarks>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group> <group>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/scripts/npc/2010007.js</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/ItemIdSortHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/GuildOperationHandler.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/Equip.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleGuild.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleStat.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleAlliance.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/MapleServerHandler.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/command/Commands.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/inventory/Item.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/constants/ServerConstants.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleClient.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/maps/MapleMap.java</file>
<file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java</file> <file>file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/server/MapleItemInformationProvider.java</file>
</group> </group>
</open-files> </open-files>
</project-private> </project-private>
+10 -19
View File
@@ -9,31 +9,22 @@ function start(){
function action(mode, type, selection){ function action(mode, type, selection){
if(mode <= 0){ 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(); cm.dispose();
} else { return;
cm.getPlayer().getMap().killAllMonsters();
BalrogPQ.partyLeader = "undefined";
BalrogPQ.balrogSpawned = false;
BalrogPQ.close();
cm.warp(105100100);
cm.dispose();
}
} else if(status == 0){ } else if(status == 0){
if(cm.getPlayer().getMap().getCharacters().size() > 1){ if(cm.getPlayer().getMap().getMonsters().size() == 0){
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){
cm.sendOk("Wow! You defeated the balrog."); cm.sendOk("Wow! You defeated the balrog.");
dispose = true; 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.")); 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++; 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 { } else {
cm.sendYesNo("So you are really going to leave?"); cm.sendYesNo("So you are really going to leave?");
status++; status++;
+5 -1
View File
@@ -19022,7 +19022,11 @@
(9300206, 2388032, 1, 1, 0, 8000), (9300206, 2388032, 1, 1, 0, 8000),
(9300207, 2388054, 1, 1, 0, 8000), (9300207, 2388054, 1, 1, 0, 8000),
(9300209, 2388053, 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) # (dropperid, itemid, minqty, maxqty, questid, chance)
+15 -1
View File
@@ -3454,7 +3454,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
if (this.guildid > 0) { if (this.guildid > 0) {
getGuild().broadcast(MaplePacketCreator.levelUpMessage(2, level, name), this.getId()); getGuild().broadcast(MaplePacketCreator.levelUpMessage(2, level, name), this.getId());
} }
if (ServerConstants.PERFECT_PITCH && level >= 30) { if (ServerConstants.USE_PERFECT_PITCH && level >= 30) {
//milestones? //milestones?
if (MapleInventoryManipulator.checkSpace(client, 4310000, (short) 1, "")) { if (MapleInventoryManipulator.checkSpace(client, 4310000, (short) 1, "")) {
MapleInventoryManipulator.addById(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<String, MapleEvents> getEvents() { public Map<String, MapleEvents> getEvents() {
return events; return events;
+7 -3
View File
@@ -310,14 +310,12 @@ public class Commands {
public static boolean executePlayerCommand(MapleClient c, String[] sub, char heading) { public static boolean executePlayerCommand(MapleClient c, String[] sub, char heading) {
MapleCharacter player = c.getPlayer(); MapleCharacter player = c.getPlayer();
if (heading == '!' && player.gmLevel() == 0) { 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; return false;
} }
switch (sub[0]) { switch (sub[0]) {
case "help": case "help":
case "commands": case "commands":
case "playercommands": case "playercommands":
player.message("============================================================"); player.message("============================================================");
player.message("MapleSolaxiaV2 Player Commands"); player.message("MapleSolaxiaV2 Player Commands");
@@ -337,6 +335,7 @@ public class Commands {
player.message("@whodrops <item name>: Displays monsters that drop an item given an item name."); player.message("@whodrops <item name>: Displays monsters that drop an item given an item name.");
player.message("@uptime: Shows how long Solaxia has been online."); 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("@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) { if(ServerConstants.USE_DEBUG) {
player.message("@debugpos: Displays the coordinates on the map the player is currently located."); 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."); player.message("@debugmap: Displays info about the current map the player is located.");
@@ -478,6 +477,11 @@ public class Commands {
c.removeClickedNPC(); c.removeClickedNPC();
player.message("You've been disposed."); player.message("You've been disposed.");
break; break;
case "equiplv":
player.showAllEquipFeatures();
break;
case "rates": case "rates":
//c.resetVoteTime(); //c.resetVoteTime();
player.yellowMessage("BOSSDROP RATE"); player.yellowMessage("BOSSDROP RATE");
+29 -9
View File
@@ -60,10 +60,6 @@ public class Equip extends Item {
private StatUpgrade(int value) { private StatUpgrade(int value) {
this.value = value; this.value = value;
} }
private int getValue() {
return value;
}
} }
private byte upgradeSlots; private byte upgradeSlots;
@@ -475,13 +471,14 @@ public class Equip extends Item {
} }
private double normalizedMasteryExp(int reqLevel) { 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 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 masteryModifier = (float)ExpTable.getExpNeededForLevel(1) / (float)normalizedMasteryExp(reqLevel);
float elementModifier = (isElemental) ? 0.85f : 0.6f; float elementModifier = (isElemental) ? 0.85f : 0.6f;
@@ -491,7 +488,7 @@ public class Equip extends Item {
itemExp += baseExpGain; itemExp += baseExpGain;
int expNeeded = ExpTable.getEquipExpNeededForLevel(itemLevel); 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) { if (itemExp >= expNeeded) {
while(itemExp >= expNeeded) { while(itemExp >= expNeeded) {
@@ -507,9 +504,32 @@ public class Equip extends Item {
} }
} else { } else {
c.getPlayer().forceUpdateItem(this); 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) { public void setItemExp(int exp) {
this.itemExp = exp; this.itemExp = exp;
+7 -5
View File
@@ -15,7 +15,8 @@ public class ServerConstants {
public static final long PURGING_INTERVAL = 5 * 60 * 1000; 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 RANKING_INTERVAL = 60 * 60 * 1000; //60 minutes, 3600000.
public static final long COUPON_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 //Ip Configuration
public static String HOST; public static String HOST;
@@ -33,7 +34,8 @@ public class ServerConstants {
public static final boolean USE_CUSTOM_KEYSET = true; 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_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 = 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_MTS = false;
public static final boolean USE_FAMILY_SYSTEM = false; public static final boolean USE_FAMILY_SYSTEM = false;
public static final boolean USE_DUEY = true; 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 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 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 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 //Some Gameplay Enhancing Configuration
public static final boolean USE_PERFECT_SCROLLING = true; //Scrolls doesn't use slots upon failure. 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_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_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 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 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 0 to disable. 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 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. public static final int SCROLL_CHANCE_RATE = 10; //Number of tries for success on a scroll, set 0 for default.
+1 -1
View File
@@ -131,7 +131,7 @@ public class MapleServerHandler extends IoHandlerAdapter {
short packetId = slea.readShort(); short packetId = slea.readShort();
MapleClient client = (MapleClient) session.getAttribute(MapleClient.CLIENT_KEY); 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); final MaplePacketHandler packetHandler = processor.getHandler(packetId);
if (packetHandler != null && packetHandler.validateState(client)) { if (packetHandler != null && packetHandler.validateState(client)) {
try { try {
+13 -9
View File
@@ -32,6 +32,7 @@ import constants.ServerConstants;
/** /**
* @author Matze * @author Matze
* @author Quit * @author Quit
* @author Ronan
*/ */
public class RankingWorker implements Runnable { public class RankingWorker implements Runnable {
private Connection con; private Connection con;
@@ -43,16 +44,17 @@ public class RankingWorker implements Runnable {
reset.executeUpdate(); reset.executeUpdate();
} }
private void updateRanking(int job) throws SQLException { 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 "; 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) { 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"; 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) { if (job != -1) {
charSelect.setInt(1, job); charSelect.setInt(2, job);
} }
ResultSet rs = charSelect.executeQuery(); ResultSet rs = charSelect.executeQuery();
PreparedStatement ps = con.prepareStatement("UPDATE characters SET " + (job != -1 ? "jobRank = ?, jobRankMove = ? " : "rank = ?, rankMove = ? ") + "WHERE id = ?"); 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); resetMoveRank(false);
} }
updateRanking(-1); //overall ranking for(int j = 0; j < Server.getInstance().getWorlds().size(); j++) {
for (int i = 0; i <= MapleJob.getMax(); i++) { updateRanking(-1, j); //overall ranking
updateRanking(i); for (int i = 0; i <= MapleJob.getMax(); i++) {
updateRanking(i, j);
}
con.commit();
} }
con.commit();
con.setAutoCommit(true); con.setAutoCommit(true);
lastUpdate = System.currentTimeMillis(); lastUpdate = System.currentTimeMillis();
} catch (SQLException ex) { } catch (SQLException ex) {
@@ -601,7 +601,7 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl
MapleStatEffect effect = skill.getEffect(ret.skilllevel); MapleStatEffect effect = skill.getEffect(ret.skilllevel);
if (magic) { 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) { if(chr.getJob() == MapleJob.IL_ARCHMAGE || chr.getJob() == MapleJob.IL_MAGE) {
int skillLvl = chr.getSkillLevel(ILMage.ELEMENT_AMPLIFICATION); int skillLvl = chr.getSkillLevel(ILMage.ELEMENT_AMPLIFICATION);
if(skillLvl > 0) if(skillLvl > 0)
@@ -611,7 +611,7 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl
if(skillLvl > 0) if(skillLvl > 0)
calcDmgMax = calcDmgMax * SkillFactory.getSkill(FPMage.ELEMENT_AMPLIFICATION).getEffect(skillLvl).getY() / 100; calcDmgMax = calcDmgMax * SkillFactory.getSkill(FPMage.ELEMENT_AMPLIFICATION).getEffect(skillLvl).getY() / 100;
} else if(chr.getJob() == MapleJob.BLAZEWIZARD3 || chr.getJob() == MapleJob.BLAZEWIZARD4) { } 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) if(skillLvl > 0)
calcDmgMax = calcDmgMax * SkillFactory.getSkill(BlazeWizard.ELEMENT_AMPLIFICATION).getEffect(skillLvl).getY() / 100; 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) { } 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(); calcDmgMax *= effect.getMatk();
if(ret.skill == Cleric.HEAL) { 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 = (int) Math.round((chr.getTotalInt() * 4.8 + chr.getTotalLuk() * 4) * chr.getTotalMagic() / 1000);
calcDmgMax = calcDmgMax * effect.getHp() / 100; calcDmgMax = calcDmgMax * effect.getHp() / 100;
} }
} else if(ret.skill == Hermit.SHADOW_MESO) { } else if(ret.skill == Hermit.SHADOW_MESO) {
// Shadow Meso also has its own formula // Shadow Meso also has its own formula
calcDmgMax = effect.getMoneyCon() * 10; calcDmgMax = effect.getMoneyCon() * 10;
calcDmgMax = (int) Math.floor(calcDmgMax * 1.5); calcDmgMax = (int) Math.floor(calcDmgMax * 1.5);
} else { } else {
// Normal damage formula for skills // Normal damage formula for skills
calcDmgMax = calcDmgMax * effect.getDamage() / 100; calcDmgMax = calcDmgMax * effect.getDamage() / 100;
} }
} }
@@ -646,9 +646,12 @@ public abstract class AbstractDealDamageHandler extends AbstractMaplePacketHandl
MapleStatEffect ceffect = SkillFactory.getSkill(advcomboid).getEffect(chr.getSkillLevel(advcomboid)); MapleStatEffect ceffect = SkillFactory.getSkill(advcomboid).getEffect(chr.getSkillLevel(advcomboid));
calcDmgMax = (int) Math.floor(calcDmgMax * (ceffect.getDamage() + 50) / 100 + 0.20 + (comboBuff - 5) * 0.04); calcDmgMax = (int) Math.floor(calcDmgMax * (ceffect.getDamage() + 50) / 100 + 0.20 + (comboBuff - 5) * 0.04);
} else { } else {
// Normal Combo // Normal Combo
MapleStatEffect ceffect = SkillFactory.getSkill(oid).getEffect(chr.getSkillLevel(oid)); int skillLv = chr.getSkillLevel(oid);
calcDmgMax = (int) Math.floor(calcDmgMax * (ceffect.getDamage() + 50) / 100 + Math.floor((comboBuff - 1) * (chr.getSkillLevel(oid) / 6)) / 100); 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)) { if(GameConstants.isFinisherSkill(ret.skill)) {
@@ -87,7 +87,9 @@ public final class CloseRangeDamageHandler extends AbstractDealDamageHandler {
if (advComboSkillLevel > 0) { if (advComboSkillLevel > 0) {
ceffect = advcombo.getEffect(advComboSkillLevel); ceffect = advcombo.getEffect(advComboSkillLevel);
} else { } 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) { if (orbcount < ceffect.getX() + 1) {
int neworbcount = orbcount + 1; int neworbcount = orbcount + 1;
@@ -96,7 +98,10 @@ public final class CloseRangeDamageHandler extends AbstractDealDamageHandler {
neworbcount++; 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<Pair<MapleBuffStat, Integer>> stat = Collections.singletonList(new Pair<>(MapleBuffStat.COMBO, neworbcount)); List<Pair<MapleBuffStat, Integer>> stat = Collections.singletonList(new Pair<>(MapleBuffStat.COMBO, neworbcount));
player.setBuffedValue(MapleBuffStat.COMBO, neworbcount); player.setBuffedValue(MapleBuffStat.COMBO, neworbcount);
duration -= (int) (System.currentTimeMillis() - player.getBuffedStarttime(MapleBuffStat.COMBO)); duration -= (int) (System.currentTimeMillis() - player.getBuffedStarttime(MapleBuffStat.COMBO));
@@ -30,7 +30,6 @@ public final class AfterLoginHandler extends AbstractMaplePacketHandler {
@Override @Override
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) { public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
System.out.println("after login");
byte c2 = slea.readByte(); byte c2 = slea.readByte();
byte c3 = 5; byte c3 = 5;
@@ -65,7 +65,7 @@ public final class LoginPasswordHandler implements MaplePacketHandler {
return; return;
} }
if (c.finishLogin() == 0) { if (c.finishLogin() == 0) {
login(c); login(c);
} else { } else {
c.announce(MaplePacketCreator.getLoginFailed(7)); c.announce(MaplePacketCreator.getLoginFailed(7));
} }
@@ -1295,6 +1295,16 @@ public class MapleItemInformationProvider {
return itemId / 1000000 == 5 || getEquipStats(itemId).get("cash") == 1; 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) { public boolean isRateCoupon(int itemId) {
int itemType = itemId / 1000; int itemType = itemId / 1000;
return itemType == 5211 || itemType == 5360; return itemType == 5211 || itemType == 5360;
+4
View File
@@ -677,6 +677,10 @@ public class MapleStatEffect {
if (primary) { if (primary) {
if (itemConNo != 0) { 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); MapleInventoryManipulator.removeById(applyto.getClient(), MapleItemInformationProvider.getInstance().getInventoryType(itemCon), itemCon, itemConNo, false, true);
} }
} }
+4 -4
View File
@@ -62,10 +62,10 @@ public class BalrogPQ {
public void run(){ public void run(){
if(fmap.getCharacters().size() <= 3){ if(fmap.getCharacters().size() <= 3){
if(fmap.getCharacters().size() > 0){ if(fmap.getCharacters().size() > 0){
for(MapleCharacter chrs : fmap.getCharacters()){ 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.message("[The Order]: What? You're down to that many mercenaries? I need to get you out of there.");
chrs.changeMap(105100100); chrs.changeMap(105100100);
} }
} }
fmap.killAllMonsters(); fmap.killAllMonsters();
close(); close();
+4 -2
View File
@@ -694,8 +694,10 @@ public class MaplePacketCreator {
mplew.writeLong(0);//isquietban time mplew.writeLong(0);//isquietban time
mplew.writeLong(c.getSessionId()); //creation time mplew.writeLong(c.getSessionId()); //creation time
mplew.writeInt(0); mplew.writeInt(0);
mplew.writeShort(2);//PIN
if (ServerConstants.ENABLE_PIN) mplew.writeShort(0);
else mplew.writeShort(2);
return mplew.getPacket(); return mplew.getPacket();
} }
+3
View File
@@ -48,6 +48,9 @@
<imgdir name="speak"> <imgdir name="speak">
<int name="chatBalloon" value="1"/> <int name="chatBalloon" value="1"/>
</imgdir> </imgdir>
<int name="hpTagColor" value="1"/>
<int name="hpTagBgcolor" value="5"/>
<int name="HPgaugeHide" value="1"/>
</imgdir> </imgdir>
<imgdir name="stand"> <imgdir name="stand">
<canvas name="0" width="827" height="561"> <canvas name="0" width="827" height="561">