GuildPQ fix
Fixed some issues with GPQ startup crashing the leader when doing the map transition.
This commit is contained in:
@@ -1063,6 +1063,10 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
if (getEventInstance() != null) getEventInstance().changedMap(this, map);
|
||||
}
|
||||
|
||||
private void eventAfterChangedMap(int map) {
|
||||
if (getEventInstance() != null) getEventInstance().afterChangedMap(this, map);
|
||||
}
|
||||
|
||||
public boolean canRecoverLastBanish() {
|
||||
return System.currentTimeMillis() - this.banishTime < 5 * 60 * 1000;
|
||||
}
|
||||
@@ -1159,6 +1163,8 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
|
||||
canWarpCounter--;
|
||||
if(canWarpCounter == 0) canWarpMap = true;
|
||||
|
||||
eventAfterChangedMap(this.getMapId());
|
||||
}
|
||||
|
||||
public void changeMap(final MapleMap target, final Point pos) {
|
||||
@@ -1171,6 +1177,8 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
|
||||
canWarpCounter--;
|
||||
if(canWarpCounter == 0) canWarpMap = true;
|
||||
|
||||
eventAfterChangedMap(this.getMapId());
|
||||
}
|
||||
|
||||
private boolean buffMapProtection() {
|
||||
@@ -2966,9 +2974,12 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
|
||||
try {
|
||||
Map<MapleBuffStat, MapleBuffStatValueHolder> stats = new LinkedHashMap<>();
|
||||
Map<MapleBuffStat, MapleBuffStatValueHolder> buffList = buffEffects.remove(effect.getBuffSourceId());
|
||||
for (Entry<MapleBuffStat, MapleBuffStatValueHolder> stateffect : buffList.entrySet()) {
|
||||
stats.put(stateffect.getKey(), stateffect.getValue());
|
||||
buffEffectsCount.put(stateffect.getKey(), (byte)(buffEffectsCount.get(stateffect.getKey()) - 1));
|
||||
|
||||
if(buffList != null) {
|
||||
for (Entry<MapleBuffStat, MapleBuffStatValueHolder> stateffect : buffList.entrySet()) {
|
||||
stats.put(stateffect.getKey(), stateffect.getValue());
|
||||
buffEffectsCount.put(stateffect.getKey(), (byte)(buffEffectsCount.get(stateffect.getKey()) - 1));
|
||||
}
|
||||
}
|
||||
|
||||
return stats;
|
||||
|
||||
@@ -421,6 +421,12 @@ public class EventInstanceManager {
|
||||
} catch (ScriptException | NoSuchMethodException ex) {}
|
||||
}
|
||||
|
||||
public void afterChangedMap(MapleCharacter chr, int mapId) { // optional
|
||||
try {
|
||||
em.getIv().invokeFunction("afterChangedMap", this, chr, mapId);
|
||||
} catch (ScriptException | NoSuchMethodException ex) {}
|
||||
}
|
||||
|
||||
public void changedLeader(MapleCharacter ldr) {
|
||||
try {
|
||||
em.getIv().invokeFunction("changedLeader", this, ldr);
|
||||
|
||||
@@ -526,7 +526,7 @@ public class EventManager {
|
||||
+ " and HAS JUST STARTED THE STRATEGY PHASE. After 3 minutes, no more guild members will be allowed to join the effort."
|
||||
+ " Check out Shuang at the excavation site in Perion for more info.";
|
||||
|
||||
mg.dropMessage(0, callout);
|
||||
mg.dropMessage(6, callout);
|
||||
}
|
||||
|
||||
private void exportMovedQueueToGuild(Integer guildId, int place) {
|
||||
@@ -534,7 +534,7 @@ public class EventManager {
|
||||
String callout = "[Guild Quest] Your guild has been registered to attend to the Sharenian Guild Quest at channel " + this.getChannelServer().getId()
|
||||
+ " and is currently on the " + ordinal(place) + " place on the waiting queue.";
|
||||
|
||||
mg.dropMessage(0, callout);
|
||||
mg.dropMessage(6, callout);
|
||||
}
|
||||
|
||||
private List<Integer> getNextGuildQueue() {
|
||||
|
||||
Reference in New Issue
Block a user