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

@@ -21,7 +21,6 @@
*/
package scripting.event;
import java.io.File;
import tools.Pair;
import java.util.ArrayList;
import java.util.LinkedList;
@@ -40,14 +39,13 @@ import net.server.audit.locks.MonitoredReentrantReadWriteLock;
import net.server.audit.locks.factory.MonitoredReentrantLockFactory;
import net.server.world.MapleParty;
import net.server.world.MaplePartyCharacter;
import provider.MapleDataProviderFactory;
import server.MaplePortal;
import server.TimerManager;
import server.MapleStatEffect;
import server.expeditions.MapleExpedition;
import server.life.MapleMonster;
import server.maps.MapleMap;
import server.maps.MapleMapFactory;
import server.maps.MapleMapManager;
import server.maps.MapleReactor;
import client.MapleCharacter;
import client.SkillFactory;
@@ -82,7 +80,7 @@ public class EventInstanceManager {
private Map<MapleCharacter, Integer> killCount = new HashMap<>();
private EventManager em;
private EventScriptScheduler ess;
private MapleMapFactory mapFactory;
private MapleMapManager mapManager;
private String name;
private Properties props = new Properties();
private Map<String, Object> objectProps = new HashMap<>();
@@ -125,8 +123,7 @@ public class EventInstanceManager {
this.em = em;
this.name = name;
this.ess = new EventScriptScheduler();
mapFactory = new MapleMapFactory(this, MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Map.wz")), MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/String.wz")), (byte) 0, (byte) 1);//Fk this
mapFactory.setChannel(em.getChannelServer().getId());
this.mapManager = new MapleMapManager(this, em.getWorldServer().getId(), em.getChannelServer().getId());
}
public void setName(String name) {
@@ -647,10 +644,10 @@ public class EventInstanceManager {
TimerManager.getInstance().schedule(new Runnable() {
@Override
public void run() {
mapFactory.dispose(); // issues from instantly disposing some event objects found thanks to MedicOP
mapManager.dispose(); // issues from instantly disposing some event objects found thanks to MedicOP
wL.lock();
try {
mapFactory = null;
mapManager = null;
em = null;
} finally {
wL.unlock();
@@ -675,8 +672,8 @@ public class EventInstanceManager {
sL = sL.dispose();
}
public MapleMapFactory getMapFactory() {
return mapFactory;
public MapleMapManager getMapFactory() {
return mapManager;
}
public void schedule(final String methodName, long delay) {
@@ -706,10 +703,10 @@ public class EventInstanceManager {
}
public MapleMap getMapInstance(int mapId) {
MapleMap map = mapFactory.getMap(mapId);
MapleMap map = mapManager.getMap(mapId);
map.setEventInstance(this);
if (!mapFactory.isMapLoaded(mapId)) {
if (!mapManager.isMapLoaded(mapId)) {
sL.lock();
try {
if (em.getProperty("shuffleReactors") != null && em.getProperty("shuffleReactors").equals("true")) {

View File

@@ -41,10 +41,9 @@ import server.gachapon.MapleGachapon;
import server.gachapon.MapleGachapon.MapleGachaponItem;
import server.life.MaplePlayerNPC;
import server.maps.MapleMap;
import server.maps.MapleMapFactory;
import server.maps.MapleMapManager;
import server.partyquest.Pyramid;
import server.partyquest.Pyramid.PyramidMode;
import server.quest.MapleQuest;
import tools.LogHelper;
import tools.MaplePacketCreator;
import client.MapleCharacter;
@@ -215,7 +214,12 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
}
public void sendStyle(String text, int styles[]) {
getClient().announce(MaplePacketCreator.getNPCTalkStyle(npc, text, styles));
if (styles.length > 0) {
getClient().announce(MaplePacketCreator.getNPCTalkStyle(npc, text, styles));
} else { // thanks Conrad for noticing empty styles crashing players
sendOk("Sorry, there are no options of cosmetics available for you here at the moment.");
dispose();
}
}
public void sendGetNumber(String text, int def, int min, int max) {
@@ -515,7 +519,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
PyramidMode mod = PyramidMode.valueOf(mode);
MapleParty partyz = getPlayer().getParty();
MapleMapFactory mf = c.getChannelServer().getMapFactory();
MapleMapManager mapManager = c.getChannelServer().getMapFactory();
MapleMap map = null;
int mapid = 926010100;
@@ -525,7 +529,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
mapid += (mod.getMode() * 1000);
for (byte b = 0; b < 5; b++) {//They cannot warp to the next map before the timer ends (:
map = mf.getMap(mapid + b);
map = mapManager.getMap(mapid + b);
if (map.getCharacters().size() > 0) {
continue;
} else {