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:
@@ -651,7 +651,7 @@ public class MapleItemInformationProvider {
|
||||
}
|
||||
|
||||
private void scrollEquipWithChaos(Equip nEquip, int range) {
|
||||
if(ServerConstants.SCROLL_CHANCE_RATE > 0) {
|
||||
if(ServerConstants.CHSCROLL_STAT_RATE > 0) {
|
||||
int temp;
|
||||
short curStr, curDex, curInt, curLuk, curWatk, curWdef, curMatk, curMdef, curAcc, curAvoid, curSpeed, curJump, curHp, curMp;
|
||||
|
||||
@@ -687,7 +687,7 @@ public class MapleItemInformationProvider {
|
||||
curMp = Short.MIN_VALUE;
|
||||
}
|
||||
|
||||
for(int i = 0; i < ServerConstants.SCROLL_CHANCE_RATE; i++) {
|
||||
for(int i = 0; i < ServerConstants.CHSCROLL_STAT_RATE; i++) {
|
||||
if (nEquip.getStr() > 0) {
|
||||
if(ServerConstants.USE_ENHANCED_CHSCROLL) temp = curStr + chscrollRandomizedStat(range);
|
||||
else temp = nEquip.getStr() + chscrollRandomizedStat(range);
|
||||
|
||||
@@ -35,7 +35,6 @@ import constants.skills.ILMage;
|
||||
import constants.skills.NightLord;
|
||||
import constants.skills.NightWalker;
|
||||
import constants.skills.Shadower;
|
||||
import constants.skills.SuperGM;
|
||||
import java.awt.Point;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.ArrayList;
|
||||
@@ -47,7 +46,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
@@ -384,7 +383,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
}
|
||||
|
||||
Collection<MapleCharacter> chrs = map.getCharacters();
|
||||
Set<MapleCharacter> underleveled = new LinkedHashSet<>();
|
||||
Set<MapleCharacter> underleveled = new HashSet<>();
|
||||
for (MapleCharacter mc : chrs) {
|
||||
if (expDist.containsKey(mc.getId())) {
|
||||
boolean isKiller = (mc.getId() == killerId);
|
||||
@@ -452,7 +451,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
|
||||
attacker.gainExp(personalExp, partyExp, true, false, isKiller);
|
||||
attacker.increaseEquipExp(personalExp);
|
||||
attacker.mobKilled(getId());
|
||||
attacker.updateQuestMobCount(getId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -543,7 +542,29 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
return looter != null ? looter : killer;
|
||||
}
|
||||
|
||||
private void dispatchUpdateQuestMobCount() {
|
||||
Set<Integer> attackerChrids = takenDamage.keySet();
|
||||
if(!attackerChrids.isEmpty()) {
|
||||
Map<Integer, MapleCharacter> mapChars = map.getMapPlayers();
|
||||
if(!mapChars.isEmpty()) {
|
||||
int mobid = getId();
|
||||
|
||||
for (Integer chrid : attackerChrids) {
|
||||
MapleCharacter chr = mapChars.get(chrid);
|
||||
|
||||
if(chr != null && chr.isLoggedin() && !chr.isAwayFromWorld()) {
|
||||
chr.updateQuestMobCount(mobid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void dispatchMonsterKilled(boolean hasKiller) {
|
||||
if(!hasKiller) {
|
||||
dispatchUpdateQuestMobCount();
|
||||
}
|
||||
|
||||
if (getMap().getEventInstance() != null) {
|
||||
if (!this.getStats().isFriendly()) {
|
||||
getMap().getEventInstance().monsterKilled(this, hasKiller);
|
||||
@@ -569,8 +590,7 @@ public class MapleMonster extends AbstractLoadedMapleLife {
|
||||
}
|
||||
}
|
||||
|
||||
// should only really be used to determine drop owner
|
||||
private int getHighestDamagerId() {
|
||||
public int getHighestDamagerId() {
|
||||
int curId = 0;
|
||||
int curDmg = 0;
|
||||
|
||||
|
||||
@@ -1077,7 +1077,7 @@ public class MapleMap {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void killMonster(final MapleMonster monster, final MapleCharacter chr, final boolean withDrops) {
|
||||
killMonster(monster, chr, withDrops, 1);
|
||||
}
|
||||
@@ -1180,17 +1180,34 @@ public class MapleMap {
|
||||
}
|
||||
|
||||
public void killMonster(int mobId) {
|
||||
List<MapleMapObject> mmoL = new LinkedList(getMapObjects());
|
||||
MapleCharacter chr = (MapleCharacter) getPlayers().get(0);
|
||||
List<MapleMonster> mobList = getMonsters();
|
||||
|
||||
for (MapleMapObject mmo : mmoL) {
|
||||
if (mmo instanceof MapleMonster) {
|
||||
if (((MapleMonster) mmo).getId() == mobId) {
|
||||
this.killMonster((MapleMonster) mmo, (MapleCharacter) getPlayers().get(0), false);
|
||||
for (MapleMonster mob : mobList) {
|
||||
if (mob.getId() == mobId) {
|
||||
this.killMonster(mob, chr, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void killMonsterWithDrops(int mobId) {
|
||||
Map<Integer, MapleCharacter> mapChars = this.getMapPlayers();
|
||||
|
||||
if(!mapChars.isEmpty()) {
|
||||
MapleCharacter defaultChr = mapChars.entrySet().iterator().next().getValue();
|
||||
List<MapleMonster> mobList = getMonsters();
|
||||
|
||||
for (MapleMonster mob : mobList) {
|
||||
if (mob.getId() == mobId) {
|
||||
MapleCharacter chr = mapChars.get(mob.getHighestDamagerId());
|
||||
if(chr == null) chr = defaultChr;
|
||||
|
||||
this.killMonster(mob, chr, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void monsterCloakingDevice() {
|
||||
for (MapleMapObject monstermo : getMapObjectsInRange(new Point(0, 0), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER))) {
|
||||
MapleMonster monster = (MapleMonster) monstermo;
|
||||
@@ -2678,6 +2695,22 @@ public class MapleMap {
|
||||
}
|
||||
}
|
||||
|
||||
public Map<Integer, MapleCharacter> getMapPlayers() {
|
||||
chrRLock.lock();
|
||||
try {
|
||||
Map<Integer, MapleCharacter> mapChars = new HashMap<>(characters.size());
|
||||
|
||||
for(MapleCharacter chr : characters) {
|
||||
mapChars.put(chr.getId(), chr);
|
||||
}
|
||||
|
||||
return mapChars;
|
||||
}
|
||||
finally {
|
||||
chrRLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
public Collection<MapleCharacter> getCharacters() {
|
||||
chrRLock.lock();
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user