修行技能升级限制修改
parent
df41a517f9
commit
266fd9526b
|
|
@ -13,6 +13,8 @@ import com.ljsd.jieling.util.ItemUtil;
|
||||||
import com.ljsd.jieling.util.MessageUtil;
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
import config.SFourQuadrantConfig;
|
import config.SFourQuadrantConfig;
|
||||||
import config.SPlayerSkill;
|
import config.SPlayerSkill;
|
||||||
|
import config.SXiuXian;
|
||||||
|
import manager.STableManager;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import rpc.protocols.CommonProto;
|
import rpc.protocols.CommonProto;
|
||||||
import rpc.protocols.HeroInfoProto;
|
import rpc.protocols.HeroInfoProto;
|
||||||
|
|
@ -39,10 +41,9 @@ public class PracticeSkillUpRequestHandler extends BaseHandler<HeroInfoProto.Pra
|
||||||
if (heroManager.getPracticeSkillMap().containsKey(skillId)){
|
if (heroManager.getPracticeSkillMap().containsKey(skillId)){
|
||||||
skillLv=heroManager.getPracticeSkillMap().get(skillId);
|
skillLv=heroManager.getPracticeSkillMap().get(skillId);
|
||||||
}
|
}
|
||||||
int nextSkillLv=skillLv+1;
|
SXiuXian xiuxianConfig= STableManager.getConfig(SXiuXian.class).get(practiceLv);
|
||||||
SPlayerSkill nextPlayerSkill=SPlayerSkill.GetSPlayerSkill(skillId,nextSkillLv);
|
if (skillLv>=xiuxianConfig.getPlayerSkillLvMax()) {
|
||||||
if (nextPlayerSkill==null||practiceLv<nextPlayerSkill.getXiuxianId()){
|
LOGGER.error("修行技能等级已达上限");
|
||||||
LOGGER.error("修行等级不足");
|
|
||||||
throw new ErrorCodeException(ErrorCode.PRACTICE_LEVE_DOWN);
|
throw new ErrorCodeException(ErrorCode.PRACTICE_LEVE_DOWN);
|
||||||
}
|
}
|
||||||
SPlayerSkill curPlayerSkill=SPlayerSkill.GetSPlayerSkill(skillId,skillLv);
|
SPlayerSkill curPlayerSkill=SPlayerSkill.GetSPlayerSkill(skillId,skillLv);
|
||||||
|
|
@ -52,7 +53,7 @@ public class PracticeSkillUpRequestHandler extends BaseHandler<HeroInfoProto.Pra
|
||||||
LOGGER.error("修行技能升级材料不足");
|
LOGGER.error("修行技能升级材料不足");
|
||||||
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
|
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
|
||||||
}
|
}
|
||||||
heroManager.setPracticeSkillMap(skillId,nextSkillLv);
|
heroManager.setPracticeSkillMap(skillId,skillLv+1);
|
||||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.PRACTICE_SKILL_UP_RESPONSE_VALUE,null,true);
|
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.PRACTICE_SKILL_UP_RESPONSE_VALUE,null,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ public class SXiuXian implements BaseConfig {
|
||||||
|
|
||||||
private float[][] proLevel;
|
private float[][] proLevel;
|
||||||
|
|
||||||
|
private int playerSkillLvMax;
|
||||||
|
|
||||||
// 目前只为主角修行等级属性使用
|
// 目前只为主角修行等级属性使用
|
||||||
public static Map<Integer, Map<Integer, SXiuXian>> sXiuXianMap;
|
public static Map<Integer, Map<Integer, SXiuXian>> sXiuXianMap;
|
||||||
|
|
||||||
|
|
@ -94,4 +96,8 @@ public class SXiuXian implements BaseConfig {
|
||||||
public float[][] getProLevel() {
|
public float[][] getProLevel() {
|
||||||
return proLevel;
|
return proLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getPlayerSkillLvMax() {
|
||||||
|
return playerSkillLvMax;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue