Lower-bracket equip levelup & Channel/World capacity patch

Rebalanced the low level section of the equipment level up system.
Fixed EQUIP_EXP_RATE not acting as expected to be.
Changed chscroll system, now using a new flag instead of the SCROLL_CHANCE_RATE.
Optimized PlayerStorage, now using a proper name map when searching for a character name.
Tweaked some aspects of the BalrogPQ.
Improved the channel capacity bar and world server capacity checks throughout the source.
This commit is contained in:
ronancpl
2018-04-25 12:01:24 -03:00
parent b7a259e2c4
commit 7d448cce4f
31 changed files with 446 additions and 90 deletions

View File

@@ -23,6 +23,7 @@ package scripting;
import java.awt.Point;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -89,11 +90,15 @@ public class AbstractPlayerInteraction {
return c.getPlayer().getMap();
}
public static int getHourOfDay() {
return Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
}
public int getMarketPortalId(int mapId) {
return getMarketPortalId(getWarpMap(mapId));
}
private int getMarketPortalId(MapleMap map) {
private static int getMarketPortalId(MapleMap map) {
return (map.findMarketPortal() != null) ? map.findMarketPortal().getId() : map.getRandomPlayerSpawnpoint().getId();
}
@@ -221,7 +226,7 @@ public class AbstractPlayerInteraction {
return getPlayer().canHold(itemid, quantity);
}
private List<Integer> convertToIntegerArray(List<Double> list) {
private static List<Integer> convertToIntegerArray(List<Double> list) {
List<Integer> intList = new LinkedList<>();
for(Double d: list) intList.add(d.intValue());
@@ -507,8 +512,8 @@ public class AbstractPlayerInteraction {
}
public void gainFame(int delta) {
c.getPlayer().addFame(delta);
c.announce(MaplePacketCreator.getShowFameGain(delta));
c.getPlayer().addFame(delta);
c.announce(MaplePacketCreator.getShowFameGain(delta));
}
public void changeMusic(String songName) {
@@ -783,7 +788,7 @@ public class AbstractPlayerInteraction {
c.announce(MaplePacketCreator.modifyInventory(false, Collections.singletonList(new ModifyInventory(0, newItem))));
}
public void spawnNpc(int npcId, Point pos, MapleMap map) {
public static void spawnNpc(int npcId, Point pos, MapleMap map) {
MapleNPC npc = MapleLifeFactory.getNPC(npcId);
if (npc != null) {
npc.setPosition(pos);
@@ -802,9 +807,13 @@ public class AbstractPlayerInteraction {
getPlayer().getMap().spawnMonster(monster);
}
public MapleMonster getMonsterLifeFactory(int mid) {
public static MapleMonster getMonsterLifeFactory(int mid) {
return MapleLifeFactory.getMonster(mid);
}
public static MobSkill getMobSkill(int skill, int level) {
return MobSkillFactory.getMobSkill(skill, level);
}
public void spawnGuide() {
c.announce(MaplePacketCreator.spawnGuide(true));
@@ -861,10 +870,6 @@ public class AbstractPlayerInteraction {
return c.getPlayer().containsAreaInfo(area, info);
}
public MobSkill getMobSkill(int skill, int level) {
return MobSkillFactory.getMobSkill(skill, level);
}
public void earnTitle(String msg) {
c.announce(MaplePacketCreator.earnTitleMessage(msg));
}

View File

@@ -913,6 +913,21 @@ public class EventInstanceManager {
}
}
public void dispatchUpdateQuestMobCount(int mobid, int mapid) {
Map<Integer, MapleCharacter> mapChars = getInstanceMap(mapid).getMapPlayers();
if(!mapChars.isEmpty()) {
List<MapleCharacter> eventMembers = getPlayers();
for (MapleCharacter evChr : eventMembers) {
MapleCharacter chr = mapChars.get(evChr.getId());
if(chr != null && chr.isLoggedin() && !chr.isAwayFromWorld()) {
chr.updateQuestMobCount(mobid);
}
}
}
}
public MapleMonster getMonster(int mid) {
return(MapleLifeFactory.getMonster(mid));
}