Autoassigner patch

Fixed autoassigner handler not reading the client's packet properly when using USE_SERVER_AUTOASSIGNER = false.
Updated questid for some drops on the DB.
Added scripts for some quests on the Aran's Full Swing skill questline.
This commit is contained in:
ronancpl
2018-04-18 13:35:42 -03:00
parent 6a63f9d95e
commit 134c34fa58
15 changed files with 256 additions and 70 deletions

View File

@@ -594,9 +594,9 @@ public class Commands {
// stat autoassigning command credited to HeliosMS dev team
case "str":
case "dex":
case "int":
case "luk":
case "dex":
int amount = (sub.length > 1) ? Integer.parseInt(sub[1]) : player.getRemainingAp();
boolean str = sub[0].equalsIgnoreCase("str");
boolean Int = sub[0].equalsIgnoreCase("int");
@@ -764,7 +764,7 @@ public class Commands {
case "goto":
if (sub.length < 2){
player.yellowMessage("Syntax: !goto <map name>");
player.yellowMessage("Syntax: @goto <map name>");
break;
}

View File

@@ -57,7 +57,7 @@ public class ServerConstants {
public static final boolean USE_PARTY_FOR_STARTERS = true; //Players level 10 or below can create/invite other players on the given level range.
public static final boolean USE_AUTOBAN = false; //Commands the server to detect infractors automatically.
public static final boolean USE_AUTOSAVE = true; //Enables server autosaving feature (saves characters to DB each 1 hour).
public static final boolean USE_SERVER_AUTOASSIGNER = true; //Server-builtin autoassigner, uses algorithm based on distributing AP accordingly with required secondary stat on equipments.
public static final boolean USE_SERVER_AUTOASSIGNER = true; //HeavenMS-builtin autoassigner, uses algorithm based on distributing AP accordingly with required secondary stat on equipments.
public static final boolean USE_REFRESH_RANK_MOVE = true;
public static final boolean USE_ENFORCE_HPMP_SWAP = false; //Forces players to reuse stats (via AP Resetting) located on HP/MP pool only inside the HP/MP stats.
public static final boolean USE_ENFORCE_MOB_LEVEL_RANGE = true; //Players N levels below the killed mob will gain no experience from defeating it.

View File

@@ -52,19 +52,18 @@ public class AutoAssignHandler extends AbstractMaplePacketHandler {
@Override
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
MapleCharacter chr = c.getPlayer();
if (chr.getRemainingAp() < 1) return;
int[] statGain = new int[4];
int[] statEqpd = new int[4];
statGain[0] = 0; statGain[1] = 0; statGain[2] = 0; statGain[3] = 0;
slea.skip(8);
byte opt = slea.readByte(); // useful for pirate autoassigning
if (chr.getRemainingAp() < 1) return;
if(ServerConstants.USE_SERVER_AUTOASSIGNER) {
// --------- Ronan Lana's AUTOASSIGNER ---------
// This method excels for assigning APs in such a way to cover all equipments AP requirements.
byte opt = slea.readByte(); // useful for pirate autoassigning
int str = 0, dex = 0, luk = 0, int_ = 0;
List<Short> eqpStrList = new ArrayList<>();
@@ -324,16 +323,13 @@ public class AutoAssignHandler extends AbstractMaplePacketHandler {
//----------------------------------------------------------------------------------------
c.announce(MaplePacketCreator.serverNotice(1, "Better AP applications detected:\r\nSTR: +" + statGain[0] + "\r\nDEX: +" + statGain[1] + "\r\nINT: +" + statGain[3] + "\r\nLUK: +" + statGain[2]));
}
else {
int total = 0;
int extras = 0;
} else {
if(slea.available() < 16) {
AutobanFactory.PACKET_EDIT.alert(chr, "Didn't send full packet for Auto Assign.");
c.disconnect(false, false);
return;
}
MapleInventory iv = chr.getInventory(MapleInventoryType.EQUIPPED);
Collection<Item> equippedC = iv.list();
for (Item item : equippedC) { //selecting the biggest AP value of each stat from each equipped item.
@@ -345,6 +341,8 @@ public class AutoAssignHandler extends AbstractMaplePacketHandler {
statEqpd[3] += nEquip.getInt();
}
int total = 0;
int extras = 0;
for (int i = 0; i < 2; i++) {
int type = slea.readInt();
int tempVal = slea.readInt();