回退修复
parent
3b112b0dff
commit
6f38da5b27
|
@ -4030,6 +4030,16 @@ public class HeroLogic {
|
|||
if (hero == null || hero.getOriginalLevel() != 1) {
|
||||
throw new ErrorCodeException(ErrorCode.HERO_RETURN_ONLY_LEVEL_ONE);
|
||||
}
|
||||
String recallCostDiamond = SSpecialConfig.getStringValue(SSpecialConfig.RecallCostDiamond);
|
||||
Map<Integer, Integer> cost = new HashMap<>(1);
|
||||
if (recallCostDiamond != null && !recallCostDiamond.isEmpty()) {
|
||||
String[] split = recallCostDiamond.split("#");
|
||||
cost.put(Integer.parseInt(split[0]), Integer.parseInt(split[1]));
|
||||
boolean b = ItemUtil.checkCost(user, cost);
|
||||
if (!b) {
|
||||
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
|
||||
}
|
||||
}
|
||||
SCHero scHero = SCHero.sCHero.get(hero.getTemplateId());
|
||||
int[][] returnBook = scHero.getReturnBook();
|
||||
if (returnBook == null || returnBook.length == 0) {
|
||||
|
@ -4045,8 +4055,22 @@ public class HeroLogic {
|
|||
if (returnPercent.isEmpty()) {
|
||||
throw new ErrorCodeException(ErrorCode.HERO_RETURN_CAN_NOT);
|
||||
}
|
||||
int[][] returnReward = new int[returnPercent.size()][2];
|
||||
int j = -1;
|
||||
Map<Integer, Integer> dropMap = new HashMap<>();
|
||||
// 法宝归元
|
||||
if (hero.getEspecialEquipLevel() > 0) {
|
||||
Map<Integer, Integer> dropTempMap = ItemLogic.getInstance().heroEspecialEquipReturnItem(hero);
|
||||
if (dropTempMap == null) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
dropTempMap.forEach((k, v) -> dropMap.put(k, dropMap.getOrDefault(k, 0) + v));
|
||||
hero.updateEspecial(1);
|
||||
}
|
||||
// 卸下魂印
|
||||
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
||||
for (Integer value : soulEquipByPositionMap.values()) {
|
||||
dropMap.put(value, 1);
|
||||
}
|
||||
|
||||
for (int[] ints : returnPercent) {
|
||||
for (int i = 1; i < ints.length; i++) {
|
||||
SHeroRankupGroup sHeroRankupGroup=STableManager.getConfig(SHeroRankupGroup.class).get(ints[i]);
|
||||
|
@ -4059,18 +4083,15 @@ public class HeroLogic {
|
|||
// int isSameClan = sHeroRankupGroup.getIsSameClan();
|
||||
int isId = sHeroRankupGroup.getIsId();
|
||||
if (isSame == 1) {
|
||||
j++;
|
||||
returnReward[j][0] = hero.getTemplateId();
|
||||
returnReward[j][1] = ints[i];
|
||||
dropMap.put(hero.getTemplateId(), ints[i]);
|
||||
}
|
||||
if (isId != 0) {
|
||||
j++;
|
||||
returnReward[j][0] = isId;
|
||||
returnReward[j][1] = ints[i];
|
||||
dropMap.put(isId, ints[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
CommonProto.Drop.Builder drop = ItemUtil.dropPer(user, returnReward, BIReason.HERO_RETURN);
|
||||
ItemUtil.itemCost(user, cost, BIReason.HERO_RETURN, hero.getTemplateId());
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, ItemUtil.mapToArray(dropMap), BIReason.HERO_RETURN);
|
||||
List<CommonProto.Item> itemList = drop.getItemlistList();
|
||||
List<Integer> itemId = new ArrayList<>(itemList.size());
|
||||
List<Integer> itemNum = new ArrayList<>(itemList.size());
|
||||
|
@ -4078,7 +4099,6 @@ public class HeroLogic {
|
|||
itemId.add(item.getItemId());
|
||||
itemNum.add((int) item.getItemNum());
|
||||
});
|
||||
// ReportUtil.onReportEvent(user, ReportEventEnum.HERO_RETURN.getType(), String.valueOf(hero.getTemplateId()), hero.getLevel(user.getHeroManager()), hero.getStar(), itemId, itemNum);
|
||||
hero.setLevel(1);
|
||||
hero.setBreakId(0);
|
||||
hero.setStar(5);
|
||||
|
@ -4086,6 +4106,7 @@ public class HeroLogic {
|
|||
addOrUpdateHongmeng(session);
|
||||
HeroInfoProto.HeroReturnResponse build = HeroInfoProto.HeroReturnResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session, 1, responseMsgId, build, true);
|
||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(uid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1402,16 +1402,16 @@ public class ItemUtil {
|
|||
// 鸿蒙阵推送
|
||||
HeroLogic.getInstance().addOrUpdateHongmeng(OnlineUserManager.getSessionByUid(user.getId()));
|
||||
heroList.add(CBean2Proto.getHero(hero));
|
||||
if (reason == BIReason.HERO_RETURN) {
|
||||
return;
|
||||
}
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
if (reason != BIReason.HERO_RETURN && scHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) { //策划资质改成星级
|
||||
if (scHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) { //策划资质改成星级
|
||||
String message = SErrorCodeEerverConfig.getI18NMessageNeedConvert("lamp_lottery_content", new Object[]{playerInfoManager.getNameColor(), playerInfoManager.getNickName(), scHero.getStar(), scHero.getReadingName()},new int[]{0,0,0,1});
|
||||
if (!message.isEmpty()){
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,String.valueOf(hero.getTemplateId()),0,0,0,0,0);
|
||||
}
|
||||
}
|
||||
if (reason != BIReason.HERO_RETURN) {
|
||||
return;
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.GET_HERO,heroStar[0],heroStar[1]);
|
||||
// KtEventUtils.onKtEvent(user, ParamEventBean.UserItemEvent,reason,GlobalsDef.addReason,cardId,1,heroStar[1]);
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.GET_HERO.getType(),String.valueOf(cardId),String.valueOf(hero.getStar()),String.valueOf(reason));
|
||||
|
|
|
@ -86,6 +86,8 @@ public class SSpecialConfig implements BaseConfig {
|
|||
|
||||
public static final String REPLACE_ITEM_ID = "replace_item_id";//置换玉道具ID
|
||||
public static final String REPLACE_COST = "replace_cost";//置换玉消耗
|
||||
public static final String RecallCostDiamond = "RecallCostDiamond";// 回退消耗妖晶数量
|
||||
|
||||
|
||||
public static final String XUANYUAN_OPEN_TIME = "xuanyuan_open_time";//轩辕开始时间(星期)
|
||||
public static final String EXCHANGE_FORCE_TYPE = "exchange_focus_type";//货币转换类型
|
||||
|
|
Loading…
Reference in New Issue