Zipangu overhaul + Quest take-item & Boss HP bar patch + 3rd job quiz
Added drop data on missing mobs and EXP gain on several quests around World Tour (Japan). Added a bonus feature for the Showa expedition, accessible when there is no casualties at the time of completion. Added missing shop data at the NPCs in Singapore. Patched quests that should be taking some items but weren't doing that properly. Patched some bosses with boss HP bar not having the "boss" label defined on Mob.wz, rendering some inconsistencies with the bar in-game. Overhauled the 3rd job quiz mechanic, adding missed questions to the pool.
This commit is contained in:
@@ -923,6 +923,7 @@ public class Commands {
|
||||
|
||||
case "cleardrops":
|
||||
player.getMap().clearDrops(player);
|
||||
player.dropMessage(5, "Cleared dropped items");
|
||||
break;
|
||||
|
||||
case "clearslot":
|
||||
|
||||
@@ -28,6 +28,7 @@ import tools.MaplePacketCreator;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
public final class MonsterBombHandler extends AbstractMaplePacketHandler {
|
||||
@Override
|
||||
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
|
||||
int oid = slea.readInt();
|
||||
MapleMonster monster = c.getPlayer().getMap().getMonsterByOid(oid);
|
||||
|
||||
@@ -271,10 +271,8 @@ public class EventInstanceManager {
|
||||
}
|
||||
|
||||
public void dropMessage(int type, String message) {
|
||||
if(!eventCleared) {
|
||||
for (MapleCharacter chr : getPlayers()) {
|
||||
chr.dropMessage(type, message);
|
||||
}
|
||||
for (MapleCharacter chr : getPlayers()) {
|
||||
chr.dropMessage(type, message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,11 +114,11 @@ public class EventManager {
|
||||
try {
|
||||
return convertToIntegerArray((List<Double>)iv.invokeFunction("setLobbyRange", (Object) null));
|
||||
} catch (ScriptException | NoSuchMethodException ex) { // they didn't define a lobby range
|
||||
List<Integer> defaultList = new ArrayList<>();
|
||||
defaultList.add(0);
|
||||
defaultList.add(maxLobbys);
|
||||
List<Integer> defaultRange = new ArrayList<>();
|
||||
defaultRange.add(0);
|
||||
defaultRange.add(maxLobbys);
|
||||
|
||||
return defaultList;
|
||||
return defaultRange;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -502,13 +502,13 @@ public class EventManager {
|
||||
private static String ordinal(int i) {
|
||||
String[] sufixes = new String[] { "th", "st", "nd", "rd", "th", "th", "th", "th", "th", "th" };
|
||||
switch (i % 100) {
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
return i + "th";
|
||||
default:
|
||||
return i + sufixes[i % 10];
|
||||
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
return i + "th";
|
||||
|
||||
default:
|
||||
return i + sufixes[i % 10];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3364,13 +3364,31 @@ public class MaplePacketCreator {
|
||||
return mplew.getPacket();
|
||||
}
|
||||
|
||||
public static byte[] customShowBossHP(byte call, int oid, int currHP, int maxHP, byte tagColor, byte tagBgColor) {
|
||||
private static Pair<Integer, Integer> normalizedCustomMaxHP(long currHP, long maxHP) {
|
||||
int sendHP, sendMaxHP;
|
||||
|
||||
if(maxHP <= Integer.MAX_VALUE) {
|
||||
sendHP = (int) currHP;
|
||||
sendMaxHP = (int) maxHP;
|
||||
} else {
|
||||
float f = ((float) currHP) / maxHP;
|
||||
|
||||
sendHP = (int) (Integer.MAX_VALUE * f);
|
||||
sendMaxHP = Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
return new Pair<>(sendHP, sendMaxHP);
|
||||
}
|
||||
|
||||
public static byte[] customShowBossHP(byte call, int oid, long currHP, long maxHP, byte tagColor, byte tagBgColor) {
|
||||
Pair<Integer, Integer> customHP = normalizedCustomMaxHP(currHP, maxHP);
|
||||
|
||||
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
|
||||
mplew.writeShort(SendOpcode.FIELD_EFFECT.getValue());
|
||||
mplew.write(call);
|
||||
mplew.writeInt(oid);
|
||||
mplew.writeInt(currHP);
|
||||
mplew.writeInt(maxHP);
|
||||
mplew.writeInt(customHP.left);
|
||||
mplew.writeInt(customHP.right);
|
||||
mplew.write(tagColor);
|
||||
mplew.write(tagBgColor);
|
||||
return mplew.getPacket();
|
||||
|
||||
Reference in New Issue
Block a user