Level/exp on all equips + Player stats overhaul + Chair handler patch
Implemented a massive overhaul on Character.wz, adding in equipment level-related nodes in order to make equipments level/EXP info available for anyone to check. Implemented a major overhaul on the player stat management throughout the source, properly encapsulating and concurrency protecting it's mechanics. Reviewed several MoveLifeHandler aspects, some of them trying to prevent mobs from falling from footholds in certain circumstances. Fixed MP Recovery instant killing players when they run out of HP to use. Fixed some chairs arbitrarily disconnecting players upon HP/MP recovery. Fixed Puppets sticking to maps in certain scenarios. Cached data and added concurrency protection for EXP gain on equipments. Reworked Chair Mastery skill, now with recovering amounts based on a player's base HP/MP pool. Fixed several deadlock issues revolving rate coupons and character inventory. Improved overall autopot handler performance. Reworked door bosses (such as Crocell), now spawning each 3 hours instead of upon player's demand. Fixed alliances not saving rank names on DB at creation time. Fixed alliances retaining disbanded guild info on DB. Added Mystic Door support for the Mushroom Castle area.
This commit is contained in:
@@ -44,7 +44,6 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import tools.MaplePacketCreator;
|
||||
import tools.Pair;
|
||||
import tools.Randomizer;
|
||||
import tools.data.input.SeekableLittleEndianAccessor;
|
||||
|
||||
@@ -63,9 +62,10 @@ public class AssignAPProcessor {
|
||||
c.lockClient();
|
||||
try {
|
||||
int[] statGain = new int[4];
|
||||
int[] statEqpd = new int[4];
|
||||
int[] statUpdate = new int[4];
|
||||
statGain[0] = 0; statGain[1] = 0; statGain[2] = 0; statGain[3] = 0;
|
||||
|
||||
int remainingAp = chr.getRemainingAp();
|
||||
slea.skip(8);
|
||||
|
||||
if(ServerConstants.USE_SERVER_AUTOASSIGNER) {
|
||||
@@ -94,11 +94,11 @@ public class AssignAPProcessor {
|
||||
//if(nEquip.getInt() > 0) eqpIntList.add(nEquip.getInt()); //not needed...
|
||||
int_ += nEquip.getInt();
|
||||
}
|
||||
|
||||
statEqpd[0] = str;
|
||||
statEqpd[1] = dex;
|
||||
statEqpd[2] = luk;
|
||||
statEqpd[3] = int_;
|
||||
|
||||
statUpdate[0] = chr.getStr();
|
||||
statUpdate[1] = chr.getDex();
|
||||
statUpdate[2] = chr.getLuk();
|
||||
statUpdate[3] = chr.getInt();
|
||||
|
||||
Collections.sort(eqpStrList, Collections.reverseOrder());
|
||||
Collections.sort(eqpDexList, Collections.reverseOrder());
|
||||
@@ -114,7 +114,7 @@ public class AssignAPProcessor {
|
||||
//c.getPlayer().message("SUM EQUIP STATS -> STR: " + str + " DEX: " + dex + " LUK: " + luk + " INT: " + int_);
|
||||
|
||||
MapleJob stance = c.getPlayer().getJobStyle(opt);
|
||||
int prStat = 0, scStat = 0, trStat = 0, temp, tempAp = chr.getRemainingAp(), CAP;
|
||||
int prStat = 0, scStat = 0, trStat = 0, temp, tempAp = remainingAp, CAP;
|
||||
if (tempAp < 1) return;
|
||||
|
||||
MapleStat primary, secondary, tertiary = MapleStat.LUK;
|
||||
@@ -311,20 +311,18 @@ public class AssignAPProcessor {
|
||||
|
||||
int extras = 0;
|
||||
|
||||
extras = gainStatByType(chr, primary, statGain, prStat + extras);
|
||||
extras = gainStatByType(chr, secondary, statGain, scStat + extras);
|
||||
extras = gainStatByType(chr, tertiary, statGain, trStat + extras);
|
||||
extras = gainStatByType(primary, statGain, prStat + extras, statUpdate);
|
||||
extras = gainStatByType(secondary, statGain, scStat + extras, statUpdate);
|
||||
extras = gainStatByType(tertiary, statGain, trStat + extras, statUpdate);
|
||||
|
||||
if(extras > 0) { //redistribute surplus in priority order
|
||||
extras = gainStatByType(chr, primary, statGain, extras);
|
||||
extras = gainStatByType(chr, secondary, statGain, extras);
|
||||
extras = gainStatByType(chr, tertiary, statGain, extras);
|
||||
gainStatByType(chr, getQuaternaryStat(stance), statGain, extras);
|
||||
extras = gainStatByType(primary, statGain, extras, statUpdate);
|
||||
extras = gainStatByType(secondary, statGain, extras, statUpdate);
|
||||
extras = gainStatByType(tertiary, statGain, extras, statUpdate);
|
||||
gainStatByType(getQuaternaryStat(stance), statGain, extras, statUpdate);
|
||||
}
|
||||
|
||||
int remainingAp = (chr.getRemainingAp() - getAccumulatedStatGain(statGain));
|
||||
chr.setRemainingAp(remainingAp);
|
||||
chr.updateSingleStat(MapleStat.AVAILABLEAP, remainingAp);
|
||||
chr.assignStrDexIntLuk(statGain[0], statGain[1], statGain[3], statGain[2]);
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
@@ -345,30 +343,18 @@ public class AssignAPProcessor {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
for (Item item : equippedC) { //selecting the biggest AP value of each stat from each equipped item.
|
||||
Equip nEquip = (Equip)item;
|
||||
|
||||
statEqpd[0] += nEquip.getStr();
|
||||
statEqpd[1] += nEquip.getDex();
|
||||
statEqpd[2] += nEquip.getLuk();
|
||||
statEqpd[3] += nEquip.getInt();
|
||||
}
|
||||
|
||||
int total = 0;
|
||||
int extras = 0;
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
int type = slea.readInt();
|
||||
int tempVal = slea.readInt();
|
||||
if (tempVal < 0 || tempVal > chr.getRemainingAp()) {
|
||||
if (tempVal < 0 || tempVal > remainingAp) {
|
||||
return;
|
||||
}
|
||||
total += tempVal;
|
||||
extras += gainStatByType(chr, MapleStat.getBy5ByteEncoding(type), statGain, tempVal);
|
||||
|
||||
gainStatByType(MapleStat.getBy5ByteEncoding(type), statGain, tempVal, statUpdate);
|
||||
}
|
||||
int remainingAp = (chr.getRemainingAp() - total) + extras;
|
||||
chr.setRemainingAp(remainingAp);
|
||||
chr.updateSingleStat(MapleStat.AVAILABLEAP, remainingAp);
|
||||
|
||||
chr.assignStrDexIntLuk(statGain[0], statGain[1], statGain[3], statGain[2]);
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
}
|
||||
} finally {
|
||||
@@ -380,53 +366,51 @@ public class AssignAPProcessor {
|
||||
return(statList.size() <= rank ? 0 : statList.get(rank));
|
||||
}
|
||||
|
||||
private static int gainStatByType(MapleCharacter chr, MapleStat type, int[] statGain, int gain) {
|
||||
private static int gainStatByType(MapleStat type, int[] statGain, int gain, int statUpdate[]) {
|
||||
if(gain <= 0) return 0;
|
||||
|
||||
int newVal = 0;
|
||||
if (type.equals(MapleStat.STR)) {
|
||||
newVal = chr.getStr() + gain;
|
||||
newVal = statUpdate[0] + gain;
|
||||
if (newVal > ServerConstants.MAX_AP) {
|
||||
statGain[0] += (gain - (newVal - ServerConstants.MAX_AP));
|
||||
chr.setStr(ServerConstants.MAX_AP);
|
||||
statUpdate[0] = ServerConstants.MAX_AP;
|
||||
} else {
|
||||
statGain[0] += gain;
|
||||
chr.setStr(newVal);
|
||||
statUpdate[0] = newVal;
|
||||
}
|
||||
} else if (type.equals(MapleStat.INT)) {
|
||||
newVal = chr.getInt() + gain;
|
||||
newVal = statUpdate[3] + gain;
|
||||
if (newVal > ServerConstants.MAX_AP) {
|
||||
statGain[3] += (gain - (newVal - ServerConstants.MAX_AP));
|
||||
chr.setInt(ServerConstants.MAX_AP);
|
||||
statUpdate[3] = ServerConstants.MAX_AP;
|
||||
} else {
|
||||
statGain[3] += gain;
|
||||
chr.setInt(newVal);
|
||||
statUpdate[3] = newVal;
|
||||
}
|
||||
} else if (type.equals(MapleStat.LUK)) {
|
||||
newVal = chr.getLuk() + gain;
|
||||
newVal = statUpdate[2] + gain;
|
||||
if (newVal > ServerConstants.MAX_AP) {
|
||||
statGain[2] += (gain - (newVal - ServerConstants.MAX_AP));
|
||||
chr.setLuk(ServerConstants.MAX_AP);
|
||||
statUpdate[2] = ServerConstants.MAX_AP;
|
||||
} else {
|
||||
statGain[2] += gain;
|
||||
chr.setLuk(newVal);
|
||||
statUpdate[2] = newVal;
|
||||
}
|
||||
} else if (type.equals(MapleStat.DEX)) {
|
||||
newVal = chr.getDex() + gain;
|
||||
newVal = statUpdate[1] + gain;
|
||||
if (newVal > ServerConstants.MAX_AP) {
|
||||
statGain[1] += (gain - (newVal - ServerConstants.MAX_AP));
|
||||
chr.setDex(ServerConstants.MAX_AP);
|
||||
statUpdate[1] = ServerConstants.MAX_AP;
|
||||
} else {
|
||||
statGain[1] += gain;
|
||||
chr.setDex(newVal);
|
||||
statUpdate[1] = newVal;
|
||||
}
|
||||
}
|
||||
|
||||
if (newVal > ServerConstants.MAX_AP) {
|
||||
chr.updateSingleStat(type, ServerConstants.MAX_AP);
|
||||
return newVal - ServerConstants.MAX_AP;
|
||||
}
|
||||
chr.updateSingleStat(type, newVal);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -435,20 +419,9 @@ public class AssignAPProcessor {
|
||||
return MapleStat.STR;
|
||||
}
|
||||
|
||||
private static int getAccumulatedStatGain(int[] statGain) {
|
||||
int acc = 0;
|
||||
|
||||
for(byte i = 0; i < statGain.length; i++) {
|
||||
acc += statGain[i];
|
||||
}
|
||||
|
||||
return acc;
|
||||
}
|
||||
|
||||
public static boolean APResetAction(MapleClient c, int APFrom, int APTo) {
|
||||
c.lockClient();
|
||||
try {
|
||||
List<Pair<MapleStat, Integer>> statupdate = new ArrayList<>(2);
|
||||
MapleCharacter player = c.getPlayer();
|
||||
|
||||
switch (APFrom) {
|
||||
@@ -458,7 +431,11 @@ public class AssignAPProcessor {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
player.addStat(1, -1);
|
||||
if (!player.assignStr(-1)) {
|
||||
player.message("Couldn't execute AP reset operation.");
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 128: // dex
|
||||
if (player.getDex() < 5) {
|
||||
@@ -466,7 +443,11 @@ public class AssignAPProcessor {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
player.addStat(2, -1);
|
||||
if (!player.assignDex(-1)) {
|
||||
player.message("Couldn't execute AP reset operation.");
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 256: // int
|
||||
if (player.getInt() < 5) {
|
||||
@@ -474,7 +455,11 @@ public class AssignAPProcessor {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
player.addStat(3, -1);
|
||||
if (!player.assignInt(-1)) {
|
||||
player.message("Couldn't execute AP reset operation.");
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 512: // luk
|
||||
if (player.getLuk() < 5) {
|
||||
@@ -482,7 +467,11 @@ public class AssignAPProcessor {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
player.addStat(4, -1);
|
||||
if (!player.assignLuk(-1)) {
|
||||
player.message("Couldn't execute AP reset operation.");
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 2048: // HP
|
||||
if(ServerConstants.USE_ENFORCE_HPMP_SWAP) {
|
||||
@@ -492,6 +481,7 @@ public class AssignAPProcessor {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (player.getHpMpApUsed() < 1) {
|
||||
player.message("You don't have enough HPMP stat points to spend on AP Reset.");
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
@@ -500,27 +490,19 @@ public class AssignAPProcessor {
|
||||
|
||||
int hp = player.getMaxHp();
|
||||
int level_ = player.getLevel();
|
||||
|
||||
boolean canWash_ = true;
|
||||
if (hp < level_ * 14 + 148) {
|
||||
canWash_ = false;
|
||||
}
|
||||
|
||||
if (!canWash_) {
|
||||
player.message("You don't have the minimum HP pool required to swap.");
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
|
||||
player.setHpMpApUsed(player.getHpMpApUsed() - 1);
|
||||
|
||||
int curHp = player.getHp();
|
||||
int hplose = -takeHp(player.getJob());
|
||||
int nextHp = Math.max(1, player.getHp() + hplose), nextMaxHp = Math.max(50, player.getMaxHp() + hplose);
|
||||
|
||||
player.setHp(nextHp);
|
||||
player.setMaxHp(nextMaxHp);
|
||||
statupdate.add(new Pair<>(MapleStat.HP, nextHp));
|
||||
statupdate.add(new Pair<>(MapleStat.MAXHP, nextMaxHp));
|
||||
|
||||
player.assignHP(hplose, -1);
|
||||
if (!ServerConstants.USE_FIXED_RATIO_HPMP_UPDATE) {
|
||||
player.updateHp(Math.max(1, curHp + hplose));
|
||||
}
|
||||
|
||||
break;
|
||||
case 8192: // MP
|
||||
if(ServerConstants.USE_ENFORCE_HPMP_SWAP) {
|
||||
@@ -530,6 +512,7 @@ public class AssignAPProcessor {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (player.getHpMpApUsed() < 1) {
|
||||
player.message("You don't have enough HPMP stat points to spend on AP Reset.");
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
@@ -556,24 +539,20 @@ public class AssignAPProcessor {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
|
||||
player.setHpMpApUsed(player.getHpMpApUsed() - 1);
|
||||
|
||||
int curMp = player.getMp();
|
||||
int mplose = -takeMp(job);
|
||||
int nextMp = Math.max(0, player.getMp() + mplose), nextMaxMp = Math.max(5, player.getMaxMp() + mplose);
|
||||
|
||||
player.setMp(nextMp);
|
||||
player.setMaxMp(nextMaxMp);
|
||||
statupdate.add(new Pair<>(MapleStat.MP, nextMp));
|
||||
statupdate.add(new Pair<>(MapleStat.MAXMP, nextMaxMp));
|
||||
|
||||
player.assignMP(mplose, -1);
|
||||
if (!ServerConstants.USE_FIXED_RATIO_HPMP_UPDATE) {
|
||||
player.updateMp(Math.max(0, curMp + mplose));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
c.announce(MaplePacketCreator.updatePlayerStats(MaplePacketCreator.EMPTY_STATUPDATE, true, player));
|
||||
return false;
|
||||
}
|
||||
|
||||
addStat(c, APTo, true);
|
||||
c.announce(MaplePacketCreator.updatePlayerStats(statupdate, true, player));
|
||||
addStat(player, APTo, true);
|
||||
return true;
|
||||
} finally {
|
||||
c.unlockClient();
|
||||
@@ -583,69 +562,65 @@ public class AssignAPProcessor {
|
||||
public static void APAssignAction(MapleClient c, int num) {
|
||||
c.lockClient();
|
||||
try {
|
||||
if (c.getPlayer().getRemainingAp() > 0) {
|
||||
if (addStat(c, num, false)) {
|
||||
c.getPlayer().setRemainingAp(c.getPlayer().getRemainingAp() - 1);
|
||||
c.getPlayer().updateSingleStat(MapleStat.AVAILABLEAP, c.getPlayer().getRemainingAp());
|
||||
}
|
||||
}
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
addStat(c.getPlayer(), num, false);
|
||||
} finally {
|
||||
c.unlockClient();
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean addStat(MapleClient c, int apTo, boolean usedAPReset) {
|
||||
private static boolean addStat(MapleCharacter chr, int apTo, boolean usedAPReset) {
|
||||
switch (apTo) {
|
||||
case 64: // Str
|
||||
if (c.getPlayer().getStr() >= 32767) {
|
||||
case 64:
|
||||
if (!chr.assignStr(1)) {
|
||||
chr.message("Couldn't execute AP assign operation.");
|
||||
chr.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
c.getPlayer().addStat(1, 1);
|
||||
break;
|
||||
case 128: // Dex
|
||||
if (c.getPlayer().getDex() >= 32767) {
|
||||
if (!chr.assignDex(1)) {
|
||||
chr.message("Couldn't execute AP assign operation.");
|
||||
chr.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
c.getPlayer().addStat(2, 1);
|
||||
break;
|
||||
case 256: // Int
|
||||
if (c.getPlayer().getInt() >= 32767) {
|
||||
if (!chr.assignInt(1)) {
|
||||
chr.message("Couldn't execute AP assign operation.");
|
||||
chr.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
c.getPlayer().addStat(3, 1);
|
||||
break;
|
||||
case 512: // Luk
|
||||
if (c.getPlayer().getLuk() >= 32767) {
|
||||
if (!chr.assignLuk(1)) {
|
||||
chr.message("Couldn't execute AP assign operation.");
|
||||
chr.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
c.getPlayer().addStat(4, 1);
|
||||
break;
|
||||
case 2048: // HP
|
||||
addHP(c.getPlayer(), addHP(c, usedAPReset));
|
||||
case 2048:
|
||||
if (!chr.assignHP(calcHpChange(chr, usedAPReset), 1)) {
|
||||
chr.message("Couldn't execute AP assign operation.");
|
||||
chr.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 8192: // MP
|
||||
addMP(c.getPlayer(), addMP(c, usedAPReset));
|
||||
case 8192:
|
||||
if (!chr.assignMP(calcMpChange(chr, usedAPReset), 1)) {
|
||||
chr.message("Couldn't execute AP assign operation.");
|
||||
chr.announce(MaplePacketCreator.enableActions());
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
c.announce(MaplePacketCreator.updatePlayerStats(MaplePacketCreator.EMPTY_STATUPDATE, true, c.getPlayer()));
|
||||
chr.announce(MaplePacketCreator.updatePlayerStats(MaplePacketCreator.EMPTY_STATUPDATE, true, chr));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static int addHP(MapleClient c, boolean usedAPReset) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
private static int calcHpChange(MapleCharacter player, boolean usedAPReset) {
|
||||
MapleJob job = player.getJob();
|
||||
int MaxHP = player.getMaxHp();
|
||||
if (player.getHpMpApUsed() > 9999 || MaxHP >= 30000) {
|
||||
return MaxHP;
|
||||
}
|
||||
|
||||
return MaxHP + calcHpChange(player, job, usedAPReset);
|
||||
}
|
||||
|
||||
private static int calcHpChange(MapleCharacter player, MapleJob job, boolean usedAPReset) {
|
||||
int MaxHP = 0;
|
||||
|
||||
if (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.DAWNWARRIOR1)) {
|
||||
@@ -737,18 +712,8 @@ public class AssignAPProcessor {
|
||||
return MaxHP;
|
||||
}
|
||||
|
||||
private static int addMP(MapleClient c, boolean usedAPReset) {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
int MaxMP = player.getMaxMp();
|
||||
private static int calcMpChange(MapleCharacter player, boolean usedAPReset) {
|
||||
MapleJob job = player.getJob();
|
||||
if (player.getHpMpApUsed() > 9999 || player.getMaxMp() >= 30000) {
|
||||
return MaxMP;
|
||||
}
|
||||
|
||||
return MaxMP + calcMpChange(player, job, usedAPReset);
|
||||
}
|
||||
|
||||
private static int calcMpChange(MapleCharacter player, MapleJob job, boolean usedAPReset) {
|
||||
int MaxMP = 0;
|
||||
|
||||
if (job.isA(MapleJob.WARRIOR) || job.isA(MapleJob.DAWNWARRIOR1) || job.isA(MapleJob.ARAN1)) {
|
||||
@@ -823,20 +788,6 @@ public class AssignAPProcessor {
|
||||
|
||||
return MaxMP;
|
||||
}
|
||||
|
||||
private static void addHP(MapleCharacter player, int MaxHP) {
|
||||
MaxHP = Math.min(30000, MaxHP);
|
||||
player.setHpMpApUsed(player.getHpMpApUsed() + 1);
|
||||
player.setMaxHp(MaxHP);
|
||||
player.updateSingleStat(MapleStat.MAXHP, MaxHP);
|
||||
}
|
||||
|
||||
private static void addMP(MapleCharacter player, int MaxMP) {
|
||||
MaxMP = Math.min(30000, MaxMP);
|
||||
player.setHpMpApUsed(player.getHpMpApUsed() + 1);
|
||||
player.setMaxMp(MaxMP);
|
||||
player.updateSingleStat(MapleStat.MAXMP, MaxMP);
|
||||
}
|
||||
|
||||
private static int takeHp(MapleJob job) {
|
||||
int MaxHP = 0;
|
||||
|
||||
@@ -25,7 +25,6 @@ package client.processor;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.MapleClient;
|
||||
import client.MapleStat;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
import client.autoban.AutobanFactory;
|
||||
@@ -49,7 +48,7 @@ public class AssignSPProcessor {
|
||||
}
|
||||
|
||||
MapleCharacter player = c.getPlayer();
|
||||
int remainingSp = player.getRemainingSpBySkill(GameConstants.getSkillBook(skillid/10000));
|
||||
int remainingSp = player.getRemainingSps()[GameConstants.getSkillBook(skillid/10000)];
|
||||
boolean isBeginnerSkill = false;
|
||||
if ((!GameConstants.isPqSkillMap(player.getMapId()) && GameConstants.isPqSkill(skillid)) || (!player.isGM() && GameConstants.isGMSkills(skillid)) || (!GameConstants.isInJobTree(skillid, player.getJob().getId()) && !player.isGM())) {
|
||||
AutobanFactory.PACKET_EDIT.alert(player, "tried to packet edit in distributing sp.");
|
||||
@@ -78,9 +77,10 @@ public class AssignSPProcessor {
|
||||
int curLevel = player.getSkillLevel(skill);
|
||||
if ((remainingSp > 0 && curLevel + 1 <= (skill.isFourthJob() ? player.getMasterLevel(skill) : skill.getMaxLevel()))) {
|
||||
if (!isBeginnerSkill) {
|
||||
player.setRemainingSp(player.getRemainingSpBySkill(GameConstants.getSkillBook(skillid/10000)) - 1, GameConstants.getSkillBook(skillid/10000));
|
||||
}
|
||||
player.updateSingleStat(MapleStat.AVAILABLESP, player.getRemainingSpBySkill(GameConstants.getSkillBook(skillid/10000)));
|
||||
player.gainSp(-1, GameConstants.getSkillBook(skillid/10000), false);
|
||||
} else {
|
||||
player.announce(MaplePacketCreator.enableActions());
|
||||
}
|
||||
if (skill.getId() == Aran.FULL_SWING) {
|
||||
player.changeSkillLevel(skill, (byte) (curLevel + 1), player.getMasterLevel(skill), player.getSkillExpiration(skill));
|
||||
player.changeSkillLevel(SkillFactory.getSkill(Aran.HIDDEN_FULL_DOUBLE), (byte) player.getSkillLevel(skill), player.getMasterLevel(skill), player.getSkillExpiration(skill));
|
||||
|
||||
@@ -49,7 +49,7 @@ public class BuybackProcessor {
|
||||
c.unlockClient();
|
||||
}
|
||||
|
||||
if(buyback) {
|
||||
if (buyback) {
|
||||
String jobString;
|
||||
switch(chr.getJobStyle()) {
|
||||
case WARRIOR:
|
||||
@@ -78,15 +78,8 @@ public class BuybackProcessor {
|
||||
}
|
||||
|
||||
chr.setStance(0);
|
||||
|
||||
chr.setHp(chr.getMaxHp());
|
||||
chr.setMp(chr.getMaxMp());
|
||||
|
||||
List<Pair<MapleStat, Integer>> hpmpupdate = new ArrayList<>(2);
|
||||
hpmpupdate.add(new Pair<>(MapleStat.HP, Integer.valueOf(chr.getHp())));
|
||||
hpmpupdate.add(new Pair<>(MapleStat.MP, Integer.valueOf(chr.getMp())));
|
||||
c.announce(MaplePacketCreator.updatePlayerStats(hpmpupdate, true, chr));
|
||||
|
||||
chr.healHpMp();
|
||||
|
||||
AbsoluteLifeMovement alm = new AbsoluteLifeMovement(0, chr.getPosition(), 0, 0);
|
||||
alm.setPixelsPerSecond(new Point(0, 0));
|
||||
List<LifeMovementFragment> moveUpdate = Collections.singletonList((LifeMovementFragment) alm);
|
||||
|
||||
@@ -256,7 +256,7 @@ public class MakerProcessor {
|
||||
|
||||
private static int getMakerReagentSlots(int itemId) {
|
||||
try {
|
||||
int eqpLevel = ii.getEquipStats(itemId).get("reqLevel");
|
||||
int eqpLevel = ii.getEquipLevelReq(itemId);
|
||||
|
||||
if(eqpLevel < 78) {
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user