GMS-like Wedding + Scissors of Karma + Maple Life + Buyback

Properly developed the Marriage feature in the source.
Added TRAVEL_RATE server flag, a modifier for the travel frequency rate.
Corrected stance for players in 3rd party view when entering a map to work similarly as GMS.
Fixed mobs spamming skills incoherently.
Added code support for old GMS-like PQ NPCs, where party leaders just need to click once to start a new PQ.
Implemented podium system for the Hall of Fame PlayerNPCs.
Improved character load-out system, now using way less queries to the DB in the process.
Fixed birthday field for accounts not being read correctly.
Further implemented the incomplete yet-existing Scissors of Karma mechanic.
Fixed Duey not propagating item flags when packaging an item.
Added a custom buyback system.
Refactored the character creation system, now offering support for Maple Life.
Fixed some issues with the PlayerNPC positioning system.
Added server flag allowing AP assignment for novices (beginners under level 11).
Fixed Strategy Time (GPQ) announcement being sent twice to guilds in certain cases.
Tweaked mount EXP system now awarding it accordingly with the amount of tiredness healed.
Removed the randomness aspect of closeness gain when feeding the pet, now acting accordingly with amount of fullness gained.
Fixed an exploit with Arwen script.
Fixed travel-back from Florina forcefully sending players to Lith Harbor in certain situations.
Thoroughly reviewed job skill questlines for Explorers and Aran.
Localhost edit: removed MTS block in certain maps (useful for the buyback system).
Localhost edit: removed party blocks for novices.
Localhost edit: removed AP assigning block for novices.
Localhost edit: removed speed cap.
Localhost edit: removed Maker block popping up when inputting ATK gems on non-weapons.
This commit is contained in:
ronancpl
2018-06-05 02:40:53 -03:00
230 changed files with 11510 additions and 3591 deletions

View File

@@ -1,39 +1,93 @@
/*
* To change this template, choose Tools | Templates
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package net.server.channel.handlers;
import client.MapleCharacter;
import client.MapleClient;
import client.inventory.Item;
import client.inventory.MapleInventoryType;
import client.MapleCharacter;
import client.MapleClient;
import constants.ItemConstants;
import tools.DatabaseConnection;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import net.AbstractMaplePacketHandler;
import client.inventory.manipulator.MapleInventoryManipulator;
import tools.MaplePacketCreator;
import tools.data.input.SeekableLittleEndianAccessor;
import tools.packets.Wedding;
/**
*
* @author Kevin
* @author Eric
*/
public class WeddingHandler extends AbstractMaplePacketHandler {
@Override
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
//System.out.println("Wedding Packet: " + slea);
MapleCharacter chr = c.getPlayer();
byte operation = slea.readByte();
switch (operation) {
case 0x06://Add an item to the Wedding Registry
short slot = slea.readShort();
int itemid = slea.readInt();
short quantity = slea.readShort();
MapleInventoryType type = ItemConstants.getInventoryType(itemid);
Item item = chr.getInventory(type).getItem(slot);
if (itemid == item.getItemId() && quantity <= item.getQuantity()) {
c.announce(MaplePacketCreator.addItemToWeddingRegistry(chr, item));
public final class WeddingHandler extends AbstractMaplePacketHandler {
/*
public static final void OnWeddingProgress(byte action, MapleClient c) {
// -- Pelvis Bebop:
// 0x00: "We are gathered here today..."
// 0x01: "Very well! I pronounce you..."
// 0x02: "You two truly are a sight to..."
// 0x03: Wedding Ceremony Ended, initialize the Wedding Effect upon the two married characters
// -- High Priest John: (Unknown action bytes)
// 0x00: " "
// 0x01: " "
// 0x02: "Do you wish to bless this couple?..."
// 0x03: Wedding Ceremony Ended, initialize the Wedding Effect upon the two married characters
if (c.getPlayer().getWedding() != null) {
if (c.getPlayer().getGender() == 0 ? c.getPlayer().getWedding().isExistantGroom(c.getPlayer().getId()) : c.getPlayer().getWedding().isExistantBride(c.getPlayer().getId())) {
c.getPlayer().getMap().broadcastMessage(Wedding.OnWeddingProgress(action == 2, c.getPlayer().getId(), c.getPlayer().getPartnerId(), (byte)(action+1)));
c.getPlayer().getWedding().incrementStage();
c.getPlayer().getPartner().getWedding().incrementStage(); // pls don't b a bitch and throw npe ):<
if (action == 2) {
c.getPlayer().setMarried(true);
c.getChannelServer().getPlayerStorage().getCharacterById(c.getPlayer().getPartnerId()).setMarried(true);
}
}
}
c.announce(MaplePacketCreator.enableActions());
}
public static final void OnWeddingGiftResult(SeekableLittleEndianAccessor slea, MapleClient c) {
System.out.println("New WEDDING_GIFT_RESULT: " + slea.toString());
byte mode = slea.readByte();
switch(mode) {
case 0x06: // "SEND ITEM"
short slot = slea.readShort(); // isn't this a byte? o.O
int itemId = slea.readInt();
short quantity = slea.readShort();
if (c.getPlayer().getInventory(ItemConstants.getInventoryType(itemId)).getItem((byte)slot).getItemId() == itemId && c.getPlayer().getInventory(InventoryConstants.getInventoryType(itemId)).getItem((byte)slot).getQuantity() >= quantity) {
if (c.getPlayer().getWedding() == null) {
c.getPlayer().startWedding(); // TODO
}
List<String> itemnames = new ArrayList<>();
Item item = c.getPlayer().getInventory(ItemConstants.getInventoryType(itemId)).getItem((byte)slot);
boolean bride = false;
c.getPlayer().getWedding().registerWishlistItem(item, bride);
c.announce(Wedding.OnWeddingGiftResult((byte)11, itemnames, c.getPlayer().getWedding().getWishlistItems(bride))); // todo: remove item from inventory if success
}
case 0x08: // "EXIT"
if (slea.available() != 0) {
System.out.println("WEDDING_GIFT_RESULT: " + slea.toString());
}
c.announce(MaplePacketCreator.enableActions());
break;
default: {
System.out.println("Unknown Mode Found: " + mode + " : " + slea.toString());
}
}
}
}
*/
@Override
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
c.announce(MaplePacketCreator.enableActions());
}
}