神王2.0
parent
3b288bce05
commit
abbd8e67df
|
@ -1544,8 +1544,7 @@ public class HeroLogic {
|
|||
if (consumeMaterialInfoByPosition == null) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder();
|
||||
checkAndUpdateConsumeHero(user, heroId, consumeMaterialInfoByPosition, consumeMaterialsList, drop);
|
||||
CommonProto.Drop.Builder drop = checkAndUpdateConsumeHero(user, heroId, consumeMaterialInfoByPosition, consumeMaterialsList);
|
||||
ItemUtil.itemCost(user, consumeMaterial, BIReason.UP_HEROSTAR_CONSUME, targetHero.getTemplateId());
|
||||
rankUpHeroExecute(user, targetHero);
|
||||
user.getHeroManager().addHeroStar(targetHero.getTemplateId(), targetHero.getStar());
|
||||
|
@ -7571,7 +7570,7 @@ public class HeroLogic {
|
|||
Map<Integer, SCHero.ConsumeMaterialInfo> map = shenWang.getConsumeMaterialInfoOfPositionByLv().get(targetLv);
|
||||
CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder();
|
||||
if (map != null){
|
||||
checkAndUpdateConsumeHero(user, heroId, map, request.getConsumeMaterialsList(), drop);
|
||||
drop = checkAndUpdateConsumeHero(user, heroId, map, request.getConsumeMaterialsList());
|
||||
}
|
||||
ItemUtil.itemCost(user, shenWang.getNeedItem(), BIReason.SHENWANG_UP_LV_COST, 0);
|
||||
hero.setShenwangLv(targetLv);
|
||||
|
@ -7588,7 +7587,7 @@ public class HeroLogic {
|
|||
* @param consumeMaterialsList
|
||||
* @throws Exception
|
||||
*/
|
||||
public void checkAndUpdateConsumeHero(User user, String heroId, Map<Integer, SCHero.ConsumeMaterialInfo> consumeMaterialInfoByPosition, List<HeroInfoProto.ConsumeMaterial> consumeMaterialsList, CommonProto.Drop.Builder drop) throws Exception {
|
||||
public CommonProto.Drop.Builder checkAndUpdateConsumeHero(User user, String heroId, Map<Integer, SCHero.ConsumeMaterialInfo> consumeMaterialInfoByPosition, List<HeroInfoProto.ConsumeMaterial> consumeMaterialsList) throws Exception {
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
Hero targetHero = heroManager.getHero(heroId);
|
||||
SCHero scHero = SCHero.getSCHero(targetHero.getTemplateId());
|
||||
|
@ -7680,10 +7679,10 @@ public class HeroLogic {
|
|||
LOGGER.error("hero num not enough");
|
||||
throw new ErrorCodeException(ErrorCode.HERO_UN_MATCH);
|
||||
}
|
||||
//改成归元获得,同时返还法宝获得
|
||||
drop = consumeBackDrop(user, removeHeroIds);
|
||||
// 消耗道具
|
||||
ItemUtil.itemCost(user, removeItemMap, BIReason.COMPLEX_EQUIP_CONSUME, 0);
|
||||
//改成归元获得,同时返还法宝获得
|
||||
return consumeBackDrop(user, removeHeroIds);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -434,6 +434,7 @@ public class CBean2Proto {
|
|||
.addAllGiftEquipIds(hero.getHeroGiftEquipList())
|
||||
.addAllPotential(toBeanPotential(hero))
|
||||
.setTraining(getTrainingProto(hero))
|
||||
.setShenwangLv(hero.getShenwangLv())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue