Several PQ platform patches + Quest complete count + Fast meso drop
Implemented CPQ challenges using the matching system. Fixed LanguageConstants statically acting for all players. Fixed OPQ's <On the Way Up> stage sometimes leading players to unexpected platforms. Fixed EllinPQ fountain not giving Altaire Fragment to players. Fixed "Lab - Unit" stage on RnJPQ, now using correlated sequences between the units. Fixed Fredrick handing out negative values of mesos to players. Improved "goto" command info. Implemented quest complete count. Fixed mobs still being "controlled" by players even though it's already dead. Concurrently protected adding items into inventory. Concurrently protected EXP gain through Writs of Solomon. Adjusted smoothly respawn rate of mobs in map (solo players in a map now experiences 75% of mobs spawned). Fixed mesos not being able to drop so frequently (prior 200ms threshold between drops). Tweaked matchchecking so that match checking doesn't outright dispose matching members on dismissal (match still sticks to the player until they answer or timeout). Fixed a dupe case within storage's item store. Added any-NPC scriptable to the source.
This commit is contained in:
@@ -141,7 +141,7 @@ public class MapleSkillbookInformationProvider {
|
||||
if(token.contains("/imgdir")) {
|
||||
status -= 1;
|
||||
}
|
||||
else if(token.contains("imgdir")) {
|
||||
else if(token.contains("imgdir") && !token.endsWith("/>")) { // '\>' XML node description not being accounted, issue found thanks to Robin Schulz, CanIGetaPR
|
||||
status += 1;
|
||||
}
|
||||
}
|
||||
@@ -182,7 +182,7 @@ public class MapleSkillbookInformationProvider {
|
||||
currentItemid = 0;
|
||||
currentCount = 0;
|
||||
}
|
||||
else if(token.contains("imgdir")) {
|
||||
else if(token.contains("imgdir") && !token.endsWith("/>")) {
|
||||
status += 1;
|
||||
}
|
||||
else {
|
||||
@@ -203,7 +203,7 @@ public class MapleSkillbookInformationProvider {
|
||||
if(token.contains("/imgdir")) {
|
||||
status -= 1;
|
||||
}
|
||||
else if(token.contains("imgdir")) {
|
||||
else if(token.contains("imgdir") && !token.endsWith("/>")) {
|
||||
if(status == 1) { //getting QuestId
|
||||
d = getName(token);
|
||||
questId = Integer.parseInt(d);
|
||||
@@ -228,19 +228,22 @@ public class MapleSkillbookInformationProvider {
|
||||
}
|
||||
|
||||
private static void fetchSkillbooksFromQuests() {
|
||||
String line;
|
||||
String line = "";
|
||||
int lineNumber = 0; // add line number, thanks to Alex (CanIGetaPR)
|
||||
|
||||
try {
|
||||
fileReader = new InputStreamReader(new FileInputStream(wzPath + "/Quest.wz/Act.img.xml"), "UTF-8");
|
||||
bufferedReader = new BufferedReader(fileReader);
|
||||
|
||||
while((line = bufferedReader.readLine()) != null) {
|
||||
lineNumber++;
|
||||
translateActToken(line);
|
||||
}
|
||||
|
||||
bufferedReader.close();
|
||||
fileReader.close();
|
||||
} catch(IOException ioe) {
|
||||
System.out.println("Failed to read Quest.wz file.");
|
||||
System.out.println("Failed to read Quest.wz file. Line " + lineNumber + ": " + line);
|
||||
ioe.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -805,7 +805,7 @@ public class MapleStatEffect {
|
||||
int mpchange = calcMPChange(applyfrom, primary);
|
||||
if (primary) {
|
||||
if (itemConNo != 0) {
|
||||
if (!applyto.getClient().getAbstractPlayerInteraction().hasItem(itemCon, itemConNo)) {
|
||||
if (!applyto.getAbstractPlayerInteraction().hasItem(itemCon, itemConNo)) {
|
||||
applyto.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1750,6 +1750,8 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
changeLevelByDifficulty(difficulty, pqMob);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
private boolean isPuppetInVicinity(MapleSummon summon) {
|
||||
return summon.getPosition().distanceSq(this.getPosition()) < 177777;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.mysql.jdbc.Statement;
|
||||
import constants.ServerConstants;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -297,8 +298,20 @@ public class MapleHiredMerchant extends AbstractMapleMapObject {
|
||||
try {
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
|
||||
try (PreparedStatement ps = con.prepareStatement("UPDATE characters SET MerchantMesos = MerchantMesos + " + price + " WHERE id = ?", Statement.RETURN_GENERATED_KEYS)) {
|
||||
long merchantMesos = 0;
|
||||
try (PreparedStatement ps = con.prepareStatement("SELECT MerchantMesos FROM characters WHERE id = ?")) {
|
||||
ps.setInt(1, ownerId);
|
||||
try (ResultSet rs = ps.executeQuery()) {
|
||||
if (rs.next()) {
|
||||
merchantMesos = rs.getInt(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
merchantMesos += price;
|
||||
|
||||
try (PreparedStatement ps = con.prepareStatement("UPDATE characters SET MerchantMesos = ? WHERE id = ?", Statement.RETURN_GENERATED_KEYS)) {
|
||||
ps.setInt(1, (int) Math.min(merchantMesos, Integer.MAX_VALUE));
|
||||
ps.setInt(2, ownerId);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
|
||||
|
||||
@@ -1380,12 +1380,13 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
if (chr == null) {
|
||||
if(removeKilledMonsterObject(monster)) {
|
||||
if (removeKilledMonsterObject(monster)) {
|
||||
monster.dispatchMonsterKilled(false);
|
||||
broadcastMessage(MaplePacketCreator.killMonster(monster.getObjectId(), animation), monster.getPosition());
|
||||
monster.aggroSwitchController(null, false);
|
||||
}
|
||||
} else {
|
||||
if(removeKilledMonsterObject(monster)) {
|
||||
if (removeKilledMonsterObject(monster)) {
|
||||
if (monster.getStats().getLevel() >= chr.getLevel() + 30 && !chr.isGM()) {
|
||||
AutobanFactory.GENERAL.alert(chr, " for killing a " + monster.getName() + " which is over 30 levels higher.");
|
||||
}
|
||||
@@ -3676,7 +3677,7 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
private static double getCurrentSpawnRate(int numPlayers) {
|
||||
return 0.550 + (0.075 * Math.min(6, numPlayers));
|
||||
return 0.70 + (0.05 * Math.min(6, numPlayers));
|
||||
}
|
||||
|
||||
private int getNumShouldSpawn(int numPlayers) {
|
||||
|
||||
@@ -110,7 +110,7 @@ public class MapleMapFactory {
|
||||
int y = MapleDataTool.getInt(life.getChildByPath("y"));
|
||||
int hide = MapleDataTool.getInt("hide", life, 0);
|
||||
int mobTime = MapleDataTool.getInt("mobTime", life, 0);
|
||||
|
||||
|
||||
loadLifeRaw(map, Integer.parseInt(id), type, cy, f, fh, rx0, rx1, x, y, hide, mobTime, team);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ public class AriantColiseum {
|
||||
chr.setAriantColiseum(null);
|
||||
|
||||
int shards = chr.countItem(4031868);
|
||||
chr.getClient().getAbstractPlayerInteraction().removeAll(4031868);
|
||||
chr.getAbstractPlayerInteraction().removeAll(4031868);
|
||||
chr.updateAriantScore(shards);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class MonsterCarnival {
|
||||
mc.setTeam(0);
|
||||
mc.setFestivalPoints(0);
|
||||
mc.forceChangeMap(map, map.getPortal(redPortal));
|
||||
mc.dropMessage(6, LanguageConstants.Languages(mc).CPQEntry);
|
||||
mc.dropMessage(6, LanguageConstants.getMessage(mc, LanguageConstants.CPQEntry));
|
||||
if (p1.getLeader().getId() == mc.getId()) {
|
||||
leader1 = mc;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class MonsterCarnival {
|
||||
mc.setTeam(1);
|
||||
mc.setFestivalPoints(0);
|
||||
mc.forceChangeMap(map, map.getPortal(bluePortal));
|
||||
mc.dropMessage(6, LanguageConstants.Languages(mc).CPQEntry);
|
||||
mc.dropMessage(6, LanguageConstants.getMessage(mc, LanguageConstants.CPQEntry));
|
||||
if (p2.getLeader().getId() == mc.getId()) {
|
||||
leader2 = mc;
|
||||
}
|
||||
@@ -82,10 +82,10 @@ public class MonsterCarnival {
|
||||
}
|
||||
if (Grupo1 == null || Grupo2 == null) {
|
||||
for (MaplePartyCharacter mpc : p2.getMembers()) {
|
||||
mpc.getPlayer().dropMessage(5, LanguageConstants.Languages(mpc.getPlayer()).CPQError);
|
||||
mpc.getPlayer().dropMessage(5, LanguageConstants.getMessage(mpc.getPlayer(), LanguageConstants.CPQError));
|
||||
}
|
||||
for (MaplePartyCharacter mpc : p2.getMembers()) {
|
||||
mpc.getPlayer().dropMessage(5, LanguageConstants.Languages(mpc.getPlayer()).CPQError);
|
||||
mpc.getPlayer().dropMessage(5, LanguageConstants.getMessage(mpc.getPlayer(), LanguageConstants.CPQError));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -140,13 +140,13 @@ public class MonsterCarnival {
|
||||
String teamS = "";
|
||||
switch (team) {
|
||||
case 0:
|
||||
teamS = LanguageConstants.Languages(chrMap).CPQRed;
|
||||
teamS = LanguageConstants.getMessage(chrMap, LanguageConstants.CPQRed);
|
||||
break;
|
||||
case 1:
|
||||
teamS = LanguageConstants.Languages(chrMap).CPQBlue;
|
||||
teamS = LanguageConstants.getMessage(chrMap, LanguageConstants.CPQBlue);
|
||||
break;
|
||||
}
|
||||
chrMap.dropMessage(5, teamS + LanguageConstants.Languages(chrMap).CPQPlayerExit);
|
||||
chrMap.dropMessage(5, teamS + LanguageConstants.getMessage(chrMap, LanguageConstants.CPQPlayerExit));
|
||||
}
|
||||
earlyFinish();
|
||||
}
|
||||
@@ -353,7 +353,7 @@ public class MonsterCarnival {
|
||||
|
||||
private void extendTime() {
|
||||
for (MapleCharacter chrMap : map.getAllPlayers()) {
|
||||
chrMap.dropMessage(5, LanguageConstants.Languages(chrMap).CPQExtendTime);
|
||||
chrMap.dropMessage(5, LanguageConstants.getMessage(chrMap, LanguageConstants.CPQExtendTime));
|
||||
}
|
||||
startTime = System.currentTimeMillis() + 3 * 60 * 1000;
|
||||
|
||||
|
||||
@@ -321,6 +321,7 @@ public class MapleQuest {
|
||||
public boolean forceStart(MapleCharacter c, int npc) {
|
||||
MapleQuestStatus newStatus = new MapleQuestStatus(this, MapleQuestStatus.Status.STARTED, npc);
|
||||
newStatus.setForfeited(c.getQuest(this).getForfeited());
|
||||
newStatus.setCompleted(c.getQuest(this).getCompleted());
|
||||
|
||||
if (timeLimit > 0) {
|
||||
newStatus.setExpirationTime(System.currentTimeMillis() + (timeLimit * 1000));
|
||||
@@ -355,6 +356,7 @@ public class MapleQuest {
|
||||
|
||||
MapleQuestStatus newStatus = new MapleQuestStatus(this, MapleQuestStatus.Status.COMPLETED, npc);
|
||||
newStatus.setForfeited(c.getQuest(this).getForfeited());
|
||||
newStatus.setCompleted(c.getQuest(this).getCompleted());
|
||||
newStatus.setCompletionTime(System.currentTimeMillis());
|
||||
c.updateQuest(newStatus);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user