Conditional Buffs & M. Magnet & Loot Patch + Exp Split + Duey Rework

Fixed Monster Magnet skill when used on bosses disconnecting the caster.
Improved conditional buff system, no longer updating buffs that are not supposed to toggle.
Added party hunting in the conditional buffs system.
Refactored usage of DB by Duey. Registered Duey items now make use of the same table as the other inventory items.
Fixed non-encapsulated unlocking in reactor class.
Fixed stylish NPCs disconnecting players when trying to display empty styles list.
Fixed a deadlock case within recently implemented update buff effects (conditional buffs mechanic).
Fixed AOE mobskills not behaving well for fixed mobs (those shouldn't take into account attribute "facingLeft").
Fixed non-flipping mobs having attribute "facingLeft" updated according to controller position.
Revised aggro system no longer having bosses expire player chase.
Fixed chalkboard being depleted upon use.
Refactored MapleMapFactory, looking for normalization of the Factory design pattern the class was intended to make use at its conception.
Added MP replenishing system for mobs, gains based on its level.
Fixed indisponibility of one-of-a-kind loots due to the killer's team already having one sample each.
Reworked the EXP split system within the source. New behavior is expected to be GMS-like.
Adjusted interaction within the NPC Nein Spirit's Baby Dragon area. Only players who interacts with quests within can access the area now. One player at a time, with a timeout timer.
Fixed check of level requisites for expeditions.
This commit is contained in:
ronancpl
2019-06-15 15:10:56 -03:00
parent 04b11e2518
commit a39a210c1f
54 changed files with 1217 additions and 866 deletions

View File

@@ -46,13 +46,16 @@ public enum ItemFactory {
CASH_ARAN(5, true),
MERCHANT(6, false),
CASH_OVERALL(7, true),
MARRIAGE_GIFTS(8, false);
MARRIAGE_GIFTS(8, false),
DUEY(9, false);
private final int value;
private final boolean account;
private static final Lock locks[] = new Lock[200]; // thanks Masterrulax for pointing out a bottleneck issue here
private static final int lockCount = 400;
private static final Lock locks[] = new Lock[lockCount]; // thanks Masterrulax for pointing out a bottleneck issue here
static {
for (int i = 0; i < 200; i++) {
for (int i = 0; i < lockCount; i++) {
locks[i] = MonitoredReentrantLockFactory.createLock(MonitoredLockType.ITEM, true);
}
}
@@ -75,7 +78,9 @@ public enum ItemFactory {
saveItems(items, null, id, con);
}
public synchronized void saveItems(List<Pair<Item, MapleInventoryType>> items, List<Short> bundlesList, int id, Connection con) throws SQLException {
public void saveItems(List<Pair<Item, MapleInventoryType>> items, List<Short> bundlesList, int id, Connection con) throws SQLException {
// thanks Arufonsu, MedicOP, BHB for pointing a "synchronized" bottleneck here
if(value != 6) saveItemsCommon(items, id, con);
else saveItemsMerchant(items, bundlesList, id, con);
}
@@ -199,7 +204,7 @@ public enum ItemFactory {
PreparedStatement pse = null;
ResultSet rs = null;
Lock lock = locks[id % 200];
Lock lock = locks[id % lockCount];
lock.lock();
try {
StringBuilder query = new StringBuilder();
@@ -365,7 +370,7 @@ public enum ItemFactory {
PreparedStatement pse = null;
ResultSet rs = null;
Lock lock = locks[id % 200];
Lock lock = locks[id % lockCount];
lock.lock();
try {
ps = con.prepareStatement("DELETE FROM `inventorymerchant` WHERE `characterid` = ?");