More PQ-esque script modules + HP Bar on some bosses
Completed (hopefully, now!) implementation of automated modules for PQ scripting. Added HP bar for some bosses that wouldn't display it before (like King Slime, Alishar and CRog).
This commit is contained in:
@@ -76,6 +76,7 @@ import server.life.SpawnPoint;
|
||||
import server.partyquest.MonsterCarnival;
|
||||
import server.partyquest.MonsterCarnivalParty;
|
||||
import server.partyquest.Pyramid;
|
||||
import scripting.event.EventInstanceManager;
|
||||
import tools.FilePrinter;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.Pair;
|
||||
@@ -100,6 +101,7 @@ public class MapleMap {
|
||||
private boolean clock;
|
||||
private boolean boat;
|
||||
private boolean docked = false;
|
||||
private EventInstanceManager event = null;
|
||||
private String mapName;
|
||||
private String streetName;
|
||||
private MapleMapEffect mapEffect = null;
|
||||
@@ -153,6 +155,14 @@ public class MapleMap {
|
||||
objectWLock = objectLock.writeLock();
|
||||
}
|
||||
|
||||
public void setEventInstance(EventInstanceManager eim) {
|
||||
event = eim;
|
||||
}
|
||||
|
||||
public EventInstanceManager getEventInstance() {
|
||||
return event;
|
||||
}
|
||||
|
||||
public void broadcastMessage(MapleCharacter source, final byte[] packet) {
|
||||
chrRLock.lock();
|
||||
try {
|
||||
@@ -1114,12 +1124,7 @@ public class MapleMap {
|
||||
monster.changeDifficulty(difficulty, isPq);
|
||||
|
||||
monster.setMap(this);
|
||||
if (!monster.getMap().getAllPlayer().isEmpty()) {
|
||||
MapleCharacter chr = (MapleCharacter) getAllPlayer().get(0);
|
||||
if (monster.getEventInstance() == null && chr.getEventInstance() != null) {
|
||||
chr.getEventInstance().registerMonster(monster);
|
||||
}
|
||||
}
|
||||
if(getEventInstance() != null) getEventInstance().registerMonster(monster);
|
||||
|
||||
spawnAndAddRangedMapObject(monster, new DelayedPacketCreation() {
|
||||
@Override
|
||||
@@ -1701,6 +1706,10 @@ public class MapleMap {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastStringMessage(int type, String message) {
|
||||
broadcastMessage(MaplePacketCreator.serverNotice(type, message));
|
||||
}
|
||||
|
||||
public void broadcastMessage(final byte[] packet) {
|
||||
broadcastMessage(null, packet, Double.POSITIVE_INFINITY, null);
|
||||
|
||||
@@ -36,6 +36,7 @@ import server.PortalFactory;
|
||||
import server.life.AbstractLoadedMapleLife;
|
||||
import server.life.MapleLifeFactory;
|
||||
import server.life.MapleMonster;
|
||||
import scripting.event.EventInstanceManager;
|
||||
import tools.DatabaseConnection;
|
||||
import tools.StringUtil;
|
||||
|
||||
@@ -43,14 +44,16 @@ public class MapleMapFactory {
|
||||
|
||||
private MapleDataProvider source;
|
||||
private MapleData nameData;
|
||||
private EventInstanceManager event;
|
||||
private Map<Integer, MapleMap> maps = new HashMap<>();
|
||||
private int channel, world;
|
||||
|
||||
public MapleMapFactory(MapleDataProvider source, MapleDataProvider stringSource, int world, int channel) {
|
||||
public MapleMapFactory(EventInstanceManager eim, MapleDataProvider source, MapleDataProvider stringSource, int world, int channel) {
|
||||
this.source = source;
|
||||
this.nameData = stringSource.getData("Map.img");
|
||||
this.world = world;
|
||||
this.channel = channel;
|
||||
this.event = eim;
|
||||
}
|
||||
|
||||
public MapleMap getMap(int mapid) {
|
||||
@@ -75,6 +78,7 @@ public class MapleMapFactory {
|
||||
monsterRate = ((Float) mobRate.getData()).floatValue();
|
||||
}
|
||||
map = new MapleMap(mapid, world, channel, MapleDataTool.getInt("info/returnMap", mapData), monsterRate);
|
||||
map.setEventInstance(event);
|
||||
|
||||
String onFirstEnter = MapleDataTool.getString(mapData.getChildByPath("info/onFirstUserEnter"), String.valueOf(mapid));
|
||||
map.setOnFirstUserEnter(onFirstEnter.equals("") ? String.valueOf(mapid) : onFirstEnter);
|
||||
@@ -314,4 +318,9 @@ public class MapleMapFactory {
|
||||
public Map<Integer, MapleMap> getMaps() {
|
||||
return maps;
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
for(MapleMap map: maps.values()) map.setEventInstance(null);
|
||||
this.event = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public enum SavedLocationType {
|
||||
INTRO,
|
||||
SUNDAY_MARKET,
|
||||
MIRROR,
|
||||
DOJO,
|
||||
BOSSPQ,
|
||||
HAPPYVILLE;
|
||||
|
||||
public static SavedLocationType fromString(String Str) {
|
||||
|
||||
Reference in New Issue
Block a user