Using Java ThreadPool + Mob Skills & Event Instance patch + Eqp Merge

Server source now uses Java ThreadPool, recycling used thread resources for next uses.
Added Grenade visual effect for other players.
Implemented an attempt towards unsynced mob behavior, where reportedly players were able to pin same mob in different sections of the map.
Solved several deadlock issues, mostly regarding character synchronized methods, event instance scripts and player/item vision-unvision.
Solved an issue where mobs would not cast some skills of it's skillset. Frequent behavior on low-leveled mobs.
Fixed a bug on 2nd Maker quest where players could complete it by merely disassembling an equipment.
New custom mechanic: equipment merge. Similarly to the Bazaar NPC, every equipment after the selected one is used up, and a fraction of their stat amounts are used as stat gains on the currently equipped items. If restrictions are enabled, players must be high-leveled and Maker lv3 to use it.
Skill Storm Break no longer uses up arrows.
Added a server flag to allow access for all Aran job skills from the beginning.
Implemented Battleship and Super Transformation questline scripts.
Fixed a desynchronization within pet position and cash inventory position, that could potentially lead to some inventory issues until relogin.
Improved timestamp handling in some handler classes. Spam detection is entirely a server-side matter, hence removed usage of client-sided timestamp content.
Refactored some pet response packets, improving some of their behaviors.
Fixed some quest issues: Maker lv1 and Omega Sector meteorite one.
This commit is contained in:
ronancpl
2018-11-10 17:48:35 -02:00
parent 00675ab95d
commit 5ee0cd1c98
120 changed files with 7424 additions and 6387 deletions

View File

@@ -877,12 +877,28 @@ public class MaplePacketCreator {
*
* @param c The MapleClient to load characters of.
* @param serverId The ID of the server requested.
* @param status The charlist request result.
* @return The character list packet.
*
* Possible values for <code>status</code>:
* <br> 2: ID deleted or blocked<br>
* <br> 3: ID deleted or blocked<br>
* <br> 4: Incorrect password<br>
* <br> 5: Not an registered ID<br>
* <br> 6: Trouble logging in?<br>
* <br> 10: Server handling too many connections<br>
* <br> 11: Only 20 years or older<br>
* <br> 13: Unable to log as master at IP<br>
* <br> 14: Wrong gateway or personal info<br>
* <br> 15: Still processing request<br>
* <br> 16: Verify account via email<br>
* <br> 17: Wrong gateway or personal info<br>
* <br> 21: Verify account via email<br>
*/
public static byte[] getCharList(MapleClient c, int serverId) {
public static byte[] getCharList(MapleClient c, int serverId, int status) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.CHARLIST.getValue());
mplew.write(0);
mplew.write(status);
List<MapleCharacter> chars = c.loadCharacters(serverId);
mplew.write((byte) chars.size());
for (MapleCharacter chr : chars) {
@@ -1425,7 +1441,6 @@ public class MaplePacketCreator {
mplew.write(1);
mplew.writeInt(life.getObjectId());
return mplew.getPacket();
//return spawnMonsterInternal(life, true, false, false, 0, false);
}
/**
@@ -2140,11 +2155,11 @@ public class MaplePacketCreator {
MapleCharacter targetChr = target.getPlayer();
if (targetChr != null && targetChr.getPartnerId() == chr.getId()) {
mplew.writeInt(0); // 1a pessoa: ser 0 0 implica match...
mplew.writeInt(0); // 3a pessoa: 1 2 2 1 funciona!
mplew.writeInt(0);
mplew.writeInt(0);
} else {
mplew.writeInt(chr.getId()); // 1a pessoa: ser 0 0 implica match...
mplew.writeInt(ring.getPartnerChrId()); // 3a pessoa: 1 2 2 1 funciona!
mplew.writeInt(chr.getId());
mplew.writeInt(ring.getPartnerChrId());
}
mplew.writeInt(ring.getItemId());
@@ -2386,6 +2401,18 @@ public class MaplePacketCreator {
}
}
}
public static byte[] throwGrenade(int cid, Point p, int keyDown, int skillId, int skillLevel) { // packets found thanks to GabrielSin
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.THROW_GRENADE.getValue());
mplew.writeInt(cid);
mplew.writeInt(p.x);
mplew.writeInt(p.y);
mplew.writeInt(keyDown);
mplew.writeInt(skillId);
mplew.writeInt(skillLevel);
return mplew.getPacket();
}
// someone thought it was a good idea to handle floating point representation through packets ROFL
private static int doubleToShortBits(double d) {
@@ -4765,19 +4792,26 @@ public class MaplePacketCreator {
return mplew.getPacket();
}
public static byte[] commandResponse(int cid, byte index, int animation, boolean success) {
//AE 00 01 00 00 00 00 01 00 00
public static byte[] petFoodResponse(int cid, byte index, boolean success, boolean balloonType) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.PET_COMMAND.getValue());
mplew.writeInt(cid);
mplew.write(index);
mplew.write((animation == 1 || !success) ? 1 : 0);
mplew.write(1);
mplew.writeBool(success);
mplew.writeBool(balloonType);
return mplew.getPacket();
}
public static byte[] commandResponse(int cid, byte index, boolean talk, int animation, boolean balloonType) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.PET_COMMAND.getValue());
mplew.writeInt(cid);
mplew.write(index);
mplew.write(0);
mplew.write(animation);
if (animation == 1) {
mplew.write(0);
} else {
mplew.writeShort(success ? 1 : 0);
}
mplew.writeBool(!talk);
mplew.writeBool(balloonType);
return mplew.getPacket();
}