The great MCPQ Merge offensive

Fulfilled the lovely pull request #427 from @dragoso, which added in backing code content to HeavenMS.
Implemented structural changes for the Marriage wishlist, in order to receive, maintain and distribute gifts to spouses.
Added untradeable check on wishlist gift handler.
Adjusted CPQ drops to actually load from DB rathe than hard-coded.
Fixed CPQ "random disease to player/party" functionality not applying properly.
Adjusted how CPQ maps are generated. It directly loads a new area from WZ (this process should at least removes the player's spawned mobs) rather than reset the cache at every MCPQ creation.
This commit is contained in:
ronancpl
2019-03-15 12:08:21 -03:00
parent 1383efd6c3
commit 3bdf8cb2be
52 changed files with 2258 additions and 678 deletions

View File

@@ -4213,7 +4213,7 @@ public class MaplePacketCreator {
mplew.write(reactor.getState());
mplew.writePos(pos);
mplew.writeShort(0);
mplew.write(reactor.getFacingDirection()); // stance, thanks to Drago/Dragohe4rt
mplew.write(0);
return mplew.getPacket();
}

View File

@@ -33,7 +33,7 @@ import constants.CharsetConstants.MapleLanguageType;
* @since Revision 323
*/
public class GenericLittleEndianWriter implements LittleEndianWriter {
private static Charset ASCII = Charset.forName(MapleLanguageType.LANGUAGE_PT_BR.getAscii());
private static Charset ASCII = Charset.forName(MapleLanguageType.LANGUAGE_US.getAscii());
private ByteOutputStream bos;
/**

View File

@@ -7,7 +7,6 @@
package tools.packets;
import client.inventory.Item;
import client.inventory.MapleInventoryType;
import client.MapleCharacter;
import java.util.ArrayList;
import java.util.List;
@@ -383,59 +382,32 @@ public class Wedding extends MaplePacketCreator {
* @return mplew
*/
public static byte[] OnWeddingGiftResult(byte mode, List<String> itemnames, List<Item> items) {
// if (itemnames == null || itemnames.size() < 1) { // for now lol
// itemnames = new ArrayList<>();
// itemnames.add("mesos");
// itemnames.add("rare items");
// itemnames.add("more mesos");
// }
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(WEDDING_GIFT_RESULT);
mplew.write(mode);
switch (mode) {
case 0xC: // 12 : You cannot give more than one present for each wishlist
case 0xE: // 14 : Failed to send the gift.
break;
case 0x09: { // Load Wedding Registry
mplew.write(itemnames.size());
for (String names : itemnames) {
mplew.writeMapleAsciiString(names);
}
mplew.write(items.size());
for (Item item : items) {
addItemInfo(mplew, item, true);
}
break;
}
case 0xA: // Load Bride's Wishlist
case 0xF: // 10, 15, 16 = CWishListRecvDlg::OnPacket
case 0xB: { // Add Item to Wedding Registry
// 11 : You have sent a gift | 12 : You cannot give more than one present for each wishlist | 13 : Failed to send the gift. | 14 : Failed to send the gift.
// 11 : You have sent a gift | | 13 : Failed to send the gift. |
if (mode == 0xB) {
mplew.write(itemnames.size());
for (String names : itemnames) {
mplew.writeMapleAsciiString(names);
}
}
if (items.size() >= 1) {
switch (items.get((items.size() - 1)).getInventoryType()) {
case EQUIP:
mplew.writeLong(4);
break;
case USE:
mplew.writeLong(8);
break;
case SETUP:
mplew.writeLong(16);
break;
case ETC:
mplew.writeLong(32);
break;
default: // impossible flag, cash item can't be sent
if (items.get((items.size() - 1)).getInventoryType() != MapleInventoryType.CASH) {
mplew.writeLong(0);
}
}
} else {
mplew.writeLong(0);
}
mplew.writeLong(32);
mplew.write(items.size());
for (Item item : items) {
addItemInfo(mplew, item, true);