装备成就修改,地图炸弹添加,全服邮件红点,装备分解归元修改,打点种类添加
parent
e5ae741308
commit
c8722e9047
|
@ -271,6 +271,7 @@ public class RedisKey {
|
|||
|
||||
public static final String CHAT_INFO_CACHE = "CHAT_INFO_CACHE";//聊天信息缓存,gm后台使用
|
||||
|
||||
public static final String MAIL_RED_POINT = "MAIL_RED_POINT";//全服红点加入
|
||||
|
||||
|
||||
public static Set<String> familyKey = new HashSet<>();
|
||||
|
|
|
@ -2324,66 +2324,7 @@ public class MapLogic {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用炸弹`
|
||||
*
|
||||
* @param session
|
||||
* @param messageType
|
||||
*/
|
||||
public void useBomb(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
MapManager mapManager = user.getMapManager();
|
||||
STrialSetting setting = STrialSetting.sTrialSetting;
|
||||
int[][] bomb = setting.getBombId();
|
||||
if(mapManager.getTrialInfo().getEnergy()==-1){
|
||||
throw new ErrorCodeException(ErrorCode.USE_BOMB_BOSS);
|
||||
}
|
||||
boolean isUse = ItemUtil.itemCost(user,bomb,BIReason.BOMB_CONSUME,mapManager.getCurMapId());
|
||||
if(!isUse){
|
||||
throw new ErrorCodeException(ErrorCode.USE_BOMB_NO_BOSS);
|
||||
}
|
||||
Map<Integer,SEventPointConfig> sEventPointConfig = STableManager.getConfig(SEventPointConfig.class);
|
||||
Set<Integer> destoryCell = new HashSet<>();
|
||||
Map<Integer, MapPointConfig> configMap = MapPointConfig.scMapEventMap;
|
||||
int mosterAmount = 0;
|
||||
Map<Integer, Cell> mapInfo = mapManager.getMapInfo();
|
||||
List<Integer> rewardResult= new ArrayList<>();
|
||||
for(Map.Entry<Integer,Cell> entry:mapInfo.entrySet()){
|
||||
int monsterType = configMap.get(entry.getValue().getPointId()).getStyle();
|
||||
if(monsterType==1||monsterType==11){
|
||||
if(entry.getValue().getEventId() == -1){
|
||||
continue;
|
||||
}
|
||||
mosterAmount++;
|
||||
|
||||
int groupId = sEventPointConfig.get(entry.getValue().getEventId()).getOption()[0];
|
||||
LOGGER.info(String.valueOf(groupId));
|
||||
SMonsterGroup sMonsterGroup = SMonsterGroup.getsMonsterGroupMap().get(groupId);
|
||||
if(sMonsterGroup!=null&&sMonsterGroup.getRewardgroup()!=null){
|
||||
for(int i = 0 ; i <sMonsterGroup.getRewardgroup().length;i++){
|
||||
rewardResult.add(sMonsterGroup.getRewardgroup()[i]);
|
||||
}
|
||||
}
|
||||
destoryCell.add(entry.getValue().getPointId());
|
||||
}
|
||||
}
|
||||
|
||||
LOGGER.info("几种:{}",mapInfo.size());
|
||||
int[] x = Arrays.stream(destoryCell.toArray(new Integer[destoryCell.size()])).mapToInt(Integer::valueOf).toArray();
|
||||
BehaviorUtil.destoryPoints(user,x);
|
||||
LOGGER.info("怪物数量:{}",mosterAmount);
|
||||
int[] bombReward = rewardResult.stream().mapToInt(Integer::valueOf).toArray();
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, bombReward, 1,1,BIReason.BOMB_REWARD);
|
||||
|
||||
mapManager.updateBombUseCount(mapManager.getTrialInfo().getBombUseTimes()+1);
|
||||
|
||||
mapManager.setTrialEnergy(100);
|
||||
MapInfoProto.MapTowerUseBombResponse.Builder response = MapInfoProto.MapTowerUseBombResponse.newBuilder();
|
||||
response.setEssenceValue(100);
|
||||
response.setDrop(drop);
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
||||
}
|
||||
|
||||
public void clearNormalMonster(User user) throws Exception {
|
||||
LOGGER.info("删除当前地图小怪!!");
|
||||
|
@ -3067,13 +3008,20 @@ public class MapLogic {
|
|||
if(sDailyChallengeConfig==null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
boolean check = PlayerLogic.getInstance().check(user, sDailyChallengeConfig.getPrivilegeId()[1], 1);
|
||||
if(!check){
|
||||
throw new ErrorCodeException(ErrorCode.REFRESH_WHEL_TIME_NOT);
|
||||
}
|
||||
// boolean check = PlayerLogic.getInstance().check(user, sDailyChallengeConfig.getPrivilegeId()[1], 1);
|
||||
// if(!check){
|
||||
// throw new ErrorCodeException(ErrorCode.REFRESH_WHEL_TIME_NOT);
|
||||
// }
|
||||
boolean consumeCount = false;
|
||||
Set<Integer> dailyPass = playerInfoManager.getDailyPass();
|
||||
if(type==1){
|
||||
if(type==2){
|
||||
if(!dailyPass.contains(id)){
|
||||
throw new ErrorCodeException(ErrorCode.DAILY_ALREADY_PASS);
|
||||
}
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sDailyChallengeConfig.getReward(), 1, 0, 1);
|
||||
builder.setDrop(drop);
|
||||
consumeCount = true;
|
||||
}else if(type==1){
|
||||
if(dailyPass.contains(id)){
|
||||
throw new ErrorCodeException(ErrorCode.DAILY_ALREADY_PASS);
|
||||
}
|
||||
|
@ -3120,15 +3068,10 @@ public class MapLogic {
|
|||
playerInfoManager.addDailyPass(id);
|
||||
consumeCount = true;
|
||||
}
|
||||
}else{
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
if(type==2){
|
||||
if(!dailyPass.contains(id)){
|
||||
throw new ErrorCodeException(ErrorCode.DAILY_ALREADY_PASS);
|
||||
}
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sDailyChallengeConfig.getReward(), 1, 0, 1);
|
||||
builder.setDrop(drop);
|
||||
consumeCount = true;
|
||||
}
|
||||
|
||||
if(consumeCount){
|
||||
boolean consume = PlayerLogic.getInstance().checkAndUpdate(user, sDailyChallengeConfig.getPrivilegeId()[1], 1);
|
||||
if(!consume){
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.handler.map.mapType.AbstractMap;
|
||||
import com.ljsd.jieling.handler.map.mapType.TowerMap;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
@ -16,6 +21,12 @@ public class MapTowerUseBombHandler extends BaseHandler {
|
|||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
MapLogic.getInstance().useBomb(iSession, MessageTypeProto.MessageType.MAP_TOWER_USEBOMB_RESPONSE);
|
||||
AbstractMap map = MapLogic.getInstance().getMap(UserManager.getUser(iSession.getUid()));
|
||||
if(map instanceof TowerMap){
|
||||
TowerMap towerMap = (TowerMap)map;
|
||||
towerMap.useBomb(iSession, MessageTypeProto.MessageType.MAP_TOWER_USEBOMB_RESPONSE);
|
||||
}else{
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,9 +22,11 @@ import com.ljsd.jieling.logic.fight.result.FightResult;
|
|||
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.store.StoreLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.FightInfoProto;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.*;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
|
@ -518,4 +520,71 @@ public class TowerMap extends AbstractMap {
|
|||
Cell cell = BehaviorUtil.addBehaviorInfo(user, pointId, mapManager, mapManager.getCurMapId(), bossPosition[0], bossPosition[1], false);
|
||||
return cell;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用炸弹`
|
||||
*
|
||||
* @param session
|
||||
* @param messageType
|
||||
*/
|
||||
public void useBomb(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
MapManager mapManager = user.getMapManager();
|
||||
STrialSetting setting = STrialSetting.sTrialSetting;
|
||||
int[][] bomb = setting.getBombId();
|
||||
if(mapManager.getTrialInfo().getFloor()>10000){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
if(mapManager.getTrialInfo().getEnergy()==-1){
|
||||
throw new ErrorCodeException(ErrorCode.USE_BOMB_BOSS);
|
||||
}
|
||||
boolean isUse = ItemUtil.itemCost(user,bomb,BIReason.BOMB_CONSUME,mapManager.getCurMapId());
|
||||
if(!isUse){
|
||||
throw new ErrorCodeException(ErrorCode.USE_BOMB_NO_BOSS);
|
||||
}
|
||||
Map<Integer,SEventPointConfig> sEventPointConfig = STableManager.getConfig(SEventPointConfig.class);
|
||||
Set<Integer> destoryCell = new HashSet<>();
|
||||
Map<Integer, MapPointConfig> configMap = MapPointConfig.scMapEventMap;
|
||||
int mosterAmount = 0;
|
||||
Map<Integer, Cell> mapInfo = mapManager.getMapInfo();
|
||||
List<Integer> rewardResult= new ArrayList<>();
|
||||
for(Map.Entry<Integer,Cell> entry:mapInfo.entrySet()){
|
||||
int monsterType = configMap.get(entry.getValue().getPointId()).getStyle();
|
||||
if(monsterType==1||monsterType==11){
|
||||
if(entry.getValue().getEventId() == -1){
|
||||
continue;
|
||||
}
|
||||
mosterAmount++;
|
||||
|
||||
int groupId = sEventPointConfig.get(entry.getValue().getEventId()).getOption()[0];
|
||||
LOGGER.info(String.valueOf(groupId));
|
||||
SMonsterGroup sMonsterGroup = SMonsterGroup.getsMonsterGroupMap().get(groupId);
|
||||
if(sMonsterGroup!=null&&sMonsterGroup.getRewardgroup()!=null){
|
||||
for(int i = 0 ; i <sMonsterGroup.getRewardgroup().length;i++){
|
||||
rewardResult.add(sMonsterGroup.getRewardgroup()[i]);
|
||||
}
|
||||
}
|
||||
destoryCell.add(entry.getValue().getPointId());
|
||||
}
|
||||
}
|
||||
LOGGER.info("几种:{}",mapInfo.size());
|
||||
int[] x = Arrays.stream(destoryCell.toArray(new Integer[destoryCell.size()])).mapToInt(Integer::valueOf).toArray();
|
||||
BehaviorUtil.destoryPoints(user,x);
|
||||
mapManager.setTrialEnergy(100);
|
||||
|
||||
Cell cell = callChief(user);
|
||||
LOGGER.info("怪物数量:{}",mosterAmount);
|
||||
int[] bombReward = rewardResult.stream().mapToInt(Integer::valueOf).toArray();
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, bombReward, 1,1,BIReason.BOMB_REWARD);
|
||||
|
||||
mapManager.updateBombUseCount(mapManager.getTrialInfo().getBombUseTimes()+1);
|
||||
|
||||
mapManager.setTrialEnergy(-1);
|
||||
MapInfoProto.MapTowerUseBombResponse.Builder response = MapInfoProto.MapTowerUseBombResponse.newBuilder();
|
||||
response.setEssenceValue(-1);
|
||||
response.setCell(CBean2Proto.getCell(cell));
|
||||
response.setDrop(drop);
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,39 @@ public enum ReportEventEnum {
|
|||
ALLOW_FRIENDS_ASK(31,"allow_friends_ask", new CommonEventHandler(),new String[]{"target_id","target_name","target_level","entrance"}),
|
||||
SEND_MESSAGE(32,"send_message", new CommonEventHandler(),new String[]{"message_type","message_content"}),
|
||||
OPEN_MAIL(33,"open_mail", new CommonEventHandler(),new String[]{""}),
|
||||
START_DAILY_DUNGEON(34,"start_daily_dungeon", new CommonEventHandler(),new String[]{""}),
|
||||
COMPLETE_DAILY_DUNGEON(35,"complete_daily_dungeon", new CommonEventHandler(),new String[]{""}),
|
||||
START_XINMO(36,"start_xinmo", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
COMPLETE_XINMO(37,"complete_xinmo", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
|
||||
START_CHECHI(38,"start_chechi", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
COMPLETE_CHECHI(39,"complete_chechi", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
START_PANOPTIC_MIRROR(40,"start_panoptic_mirror", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
CHALLENGE_PANOPTIC_MIRROR_ENEMY_END(41,"challenge_panoptic_mirror_enemy_end", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
COMPLETE_PANOPTIC_MIRROR(42,"complete_panoptic_mirror", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
EQUIP_SYNTHESIS(43,"equip_synthesis", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
TREASURE_SYNTHESIS(44,"treasure_synthesis", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
FATALITY_SYNTHESIS(45,"fatality_synthesis", new CommonEventHandler(),new String[]{""}),
|
||||
NORMAL_SUMMON(46,"Normal_summon", new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||
|
||||
FRIENDSHIP_SUMMON(47,"friendship_summon", new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||
|
||||
GODS_SUMMON(48,"gods_summon", new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||
SUMMON_HERO(49,"summon_hero", new CommonEventHandler(),new String[]{""}),//四元阵
|
||||
|
||||
HERO_COMPOSITION(50,"hero_composition", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
SEND_HERO(51,"send_hero", new CommonEventHandler(),new String[]{""}),
|
||||
TREASURE_DECOMPOSITION(52,"treasure_decomposition", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
VIP_LEVEL_UP(100,"", new VipLevelUpEventHandler(),new String[]{""});
|
||||
|
||||
|
|
|
@ -258,12 +258,12 @@ public class CumulationData {
|
|||
this.consumeGem = consumeGem;
|
||||
}
|
||||
|
||||
public void updateEquipQuality(int quality ){
|
||||
public void updateEquipQuality(int quality,int num){
|
||||
if(sEquipQualityCount.length!=7){
|
||||
//新增加装备品质 兼容旧数据
|
||||
sEquipQualityCount=Arrays.copyOf(sEquipQualityCount,7);
|
||||
}
|
||||
sEquipQualityCount[quality-1]=sEquipQualityCount[quality-1]+1;
|
||||
sEquipQualityCount[quality-1]=sEquipQualityCount[quality-1]+num;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -33,10 +33,6 @@ public class EquipManager extends MongoBase {
|
|||
updateString("equipMap." + equip.getId(), equip);
|
||||
equipMap.put(equip.getId(),equip);
|
||||
// addEquipHandBook(equip.getEquipId());
|
||||
if(equip instanceof Equip){
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.GET_EQUIP,equip.getEquipId());
|
||||
Poster.getPoster().dispatchEvent(new EquipEvent(user.getId(),equip.getEquipId()));
|
||||
}
|
||||
}
|
||||
|
||||
public void remove(String equipId){
|
||||
|
|
|
@ -474,8 +474,8 @@ public class UserMissionManager extends MongoBase {
|
|||
int[] tasks= MathUtils.randomFromWeightWithTaking(randomTask,Math.max(typeMissionNum[type-1],randomTask.length));// typeMissionNum[type-1]
|
||||
List<MissionStateChangeInfo> missionStateChangeInfos = missionTypeEnumListMap.get(GameMisionType.TREASUREMISSION);
|
||||
for(Integer task:tasks){
|
||||
treasureMissionIdsType.getDoingMissionIds().add(task);
|
||||
missionStateChangeInfos.add(new MissionStateChangeInfo(task, MissionState.DOING,0));
|
||||
treasureMissionIdsType.getDoingMissionIds().add(task);
|
||||
}
|
||||
treasureCumulationData = new CumulationData();
|
||||
updateString("treasureMissionIdsType",treasureMissionIdsType);
|
||||
|
|
|
@ -1393,6 +1393,7 @@ public class GuildLogic {
|
|||
//退公会清除数据 补发奖励
|
||||
sendGuildHelpRewardEmail(user);
|
||||
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||
RedisUtil.getInstence().zsetRemoveOne(RedisKey.getKey(RedisKey.CAR_DEALY_RANK,"",false),String.valueOf(user.getId()));
|
||||
RedisUtil.getInstence().putMapEntry(RedisKey.USER_LEVEL_GUILD_INFO,"",String.valueOf(user.getId()),guildId);
|
||||
//删除战力
|
||||
Poster.getPoster().dispatchEvent(new GuildForceChangeEvent(user.getId(),user.getPlayerInfoManager().getGuildId(),3,0-user.getPlayerInfoManager().getMaxForce()));
|
||||
|
|
|
@ -524,6 +524,17 @@ public class HeroLogic{
|
|||
User user = UserManager.getUser(iSession.getUid());
|
||||
HeroManager heroManager = user.getHeroManager();
|
||||
Set<Integer> set = new HashSet<>();
|
||||
if(teamId==GlobalsDef.TRIAL_TEAM&&heroIds.size()!=1){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
|
||||
if(set.size()!=heroIds.size()){
|
||||
throw new ErrorCodeException(ErrorCode.NO_USE_SAME_HERO);
|
||||
}
|
||||
String err = checkTeamPos(user, teamId,heroIds,pokemonoIds);
|
||||
if(!"".equals(err)){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode(err));
|
||||
}
|
||||
if(teamId==GlobalsDef.EXPEDITION_TEAM){
|
||||
|
||||
heroIds.forEach(heroId->{
|
||||
|
@ -538,17 +549,7 @@ public class HeroLogic{
|
|||
}else {
|
||||
heroIds.forEach(heroId->set.add(heroManager.getHero(heroId.getHeroId()).getTemplateId()));
|
||||
}
|
||||
if(teamId==GlobalsDef.TRIAL_TEAM&&heroIds.size()!=1){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
|
||||
if(set.size()!=heroIds.size()){
|
||||
throw new ErrorCodeException(ErrorCode.NO_USE_SAME_HERO);
|
||||
}
|
||||
String err = checkTeamPos(user, teamId,heroIds,pokemonoIds);
|
||||
if(!"".equals(err)){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode(err));
|
||||
}
|
||||
user.getTeamPosManager().changeTeamInfo(teamId,heroIds,pokemonoIds);
|
||||
//401图内可以更改编队
|
||||
if(teamId == GlobalsDef.ENDLESS_TEAM){
|
||||
|
@ -864,8 +865,12 @@ public class HeroLogic{
|
|||
}
|
||||
|
||||
//删除hero
|
||||
CommonProto.Drop.Builder baseBuilder = ItemLogic.getInstance().decomposeHero(session,new LinkedList<>(removeHeroIds),Collections.singleton(26),MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE);
|
||||
// recyleHeroBySystem(user,removeHeroIds);
|
||||
// CommonProto.Drop.Builder baseBuilder = ItemLogic.getInstance().decomposeHero(session,new LinkedList<>(removeHeroIds),Collections.singleton(26),MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE);
|
||||
//改成归元获得
|
||||
CommonProto.Drop.Builder baseBuilder = heroBackDrop(user,new ArrayList<>(removeHeroIds),10000,BIReason.UPHERO_DECOMPOS_HERO_REWARD,true);
|
||||
|
||||
|
||||
// recyleHeroBySystem(user,removeHeroIds);
|
||||
rankUpHeroExecute(targetHero);
|
||||
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),targetHero.getTemplateId(),targetHero.getStar()));
|
||||
if(targetHero.getStar()>=5&&targetHero.getStar()!=15){
|
||||
|
@ -2352,38 +2357,71 @@ public class HeroLogic{
|
|||
if(!b){
|
||||
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
|
||||
}
|
||||
CommonProto.Drop.Builder drop = heroBackDrop(user, heroList, returnPercent, BIReason.HERO_BACK_REWARD,false);
|
||||
hero.setLevel(user,1);
|
||||
hero.setBreakId(0);
|
||||
HeroInfoProto.HeroReturnResponse build = HeroInfoProto.HeroReturnResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session,1,responseMsgId,build,true);
|
||||
|
||||
// heroManager.removeHero(uid,heroId);
|
||||
int[][] returnMaterials = sHeroReturn.getRankupReturn();
|
||||
SHeroLevlConfig sHeroLevlConfig = SHeroLevlConfig.getsHeroLevlConfigMap().get(hero.getLevel());
|
||||
int[][] levelReturn = ItemLogic.getInstance().itemReturnPercent(sHeroLevlConfig.getSumConsume(), returnPercent);
|
||||
// int returnHero = sHeroReturn.getHeroId();
|
||||
//进阶材料返还乘万分比
|
||||
}
|
||||
|
||||
/**
|
||||
* 归元掉落
|
||||
* @param user
|
||||
* @param heroIds
|
||||
* @param returnPercent
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public CommonProto.Drop.Builder heroBackDrop(User user,List<String> heroIds,int returnPercent,int reason,boolean isAddEspecial)throws Exception{
|
||||
Map<Integer,Integer> returnItemMap = new HashMap<>();
|
||||
for(int i = 0 ; i <returnMaterials.length;i++){
|
||||
returnItemMap.put(returnMaterials[i][0],(int)(returnMaterials[i][1]/10000d*returnPercent));
|
||||
for(String heroId:heroIds){
|
||||
Hero hero = user.getHeroManager().getHero(heroId);
|
||||
int breakId = hero.getBreakId();
|
||||
int templateId = hero.getTemplateId();
|
||||
Map<Integer, SHeroReturn> sHeroReturnMap = SHeroReturn.sheroReturnMap.get(templateId);
|
||||
int breakFloor = breakId==0?0:STableManager.getConfig(SCHeroRankUpConfig.class).get(breakId).getPhase()[1];
|
||||
|
||||
SHeroReturn sHeroReturn = sHeroReturnMap.get(breakFloor);
|
||||
int[][] returnMaterials = sHeroReturn.getRankupReturn();
|
||||
SHeroLevlConfig sHeroLevlConfig = SHeroLevlConfig.getsHeroLevlConfigMap().get(hero.getLevel());
|
||||
int[][] levelReturn = ItemLogic.getInstance().itemReturnPercent(sHeroLevlConfig.getSumConsume(), returnPercent);
|
||||
//进阶材料返还乘万分比
|
||||
for(int i = 0 ; i <returnMaterials.length;i++){
|
||||
returnItemMap.put(returnMaterials[i][0],(int)(returnMaterials[i][1]/10000d*returnPercent));
|
||||
}
|
||||
for(int i = 0 ; i <levelReturn.length;i++){
|
||||
returnItemMap.put(levelReturn[i][0],returnItemMap.getOrDefault(levelReturn[i][0],0)+levelReturn[i][1]);
|
||||
}
|
||||
if(!isAddEspecial){
|
||||
continue;
|
||||
}
|
||||
//返还法宝修炼材料
|
||||
int especialEquipLevel = hero.getEspecialEquipLevel();
|
||||
if(especialEquipLevel!=1&&especialEquipLevel!=0){
|
||||
continue;
|
||||
}
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
int[] equipTalismana = scHero.getEquipTalismana();
|
||||
if(equipTalismana!=null&&equipTalismana.length>1){
|
||||
continue;
|
||||
}
|
||||
TreeMap<Integer, SEquipTalismana> levelMap = (TreeMap<Integer, SEquipTalismana>) SEquipTalismana.equipTalismanaStarMap.get(equipTalismana[1]);
|
||||
Map<Integer, SEquipTalismana> returnMap = levelMap.subMap(1, hero.getEspecialEquipLevel());
|
||||
for(Map.Entry<Integer, SEquipTalismana> entry:returnMap.entrySet()){
|
||||
int[][] rankupBasicMaterial = entry.getValue().getRankupBasicMaterial();
|
||||
for(int[] rankUpConsume:rankupBasicMaterial){
|
||||
returnItemMap.put(rankUpConsume[0],returnItemMap.getOrDefault(rankUpConsume[0],0)+rankUpConsume[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i = 0 ; i <levelReturn.length;i++){
|
||||
returnItemMap.put(levelReturn[i][0],returnItemMap.getOrDefault(levelReturn[i][0],0)+levelReturn[i][1]);
|
||||
}
|
||||
// returnItemMap.put(returnHero,1);
|
||||
int[][] resultDrop = new int[returnItemMap.size()][];
|
||||
int index = 0;
|
||||
for(Map.Entry<Integer,Integer> entry:returnItemMap.entrySet()){
|
||||
resultDrop[index] = new int[]{entry.getKey(),entry.getValue()};
|
||||
index++;
|
||||
}
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, resultDrop, BIReason.HERO_BACK_REWARD);
|
||||
hero.setLevel(user,1);
|
||||
hero.setBreakId(0);
|
||||
// CommonProto.Hero.Builder heroProto = drop.getHero(0).toBuilder();
|
||||
// String createHeroId = heroProto.getId();
|
||||
// heroProto.setStar(star);
|
||||
// drop.setHero(0,heroProto.build());
|
||||
// Hero newHero = user.getHeroManager().getHeroMap().get(createHeroId);
|
||||
// newHero.setStar(star);
|
||||
HeroInfoProto.HeroReturnResponse build = HeroInfoProto.HeroReturnResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session,1,responseMsgId,build,true);
|
||||
return ItemUtil.drop(user, resultDrop, reason);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -395,6 +395,24 @@ public class ItemLogic {
|
|||
for(int[] item:breakSHeroSacrifice.getValue()){
|
||||
baseItemMap.put(item[0],baseItemMap.getOrDefault(item[0],0)+item[1]);
|
||||
}
|
||||
// 返还法宝修炼材料
|
||||
int especialEquipLevel = hero.getEspecialEquipLevel();
|
||||
if(especialEquipLevel==1||especialEquipLevel==0){
|
||||
continue;
|
||||
}
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
int[] equipTalismana = scHero.getEquipTalismana();
|
||||
if(equipTalismana==null||equipTalismana.length<2){
|
||||
continue;
|
||||
}
|
||||
TreeMap<Integer, SEquipTalismana> levelMap = (TreeMap<Integer, SEquipTalismana>) (SEquipTalismana.equipTalismanaStarMap.get(equipTalismana[1]));
|
||||
Map<Integer, SEquipTalismana> returnMap = levelMap.subMap(1, hero.getEspecialEquipLevel());
|
||||
for(Map.Entry<Integer, SEquipTalismana> entry:returnMap.entrySet()){
|
||||
int[][] rankupBasicMaterial = entry.getValue().getRankupBasicMaterial();
|
||||
for(int[] rankUpConsume:rankupBasicMaterial){
|
||||
baseItemMap.put(rankUpConsume[0],baseItemMap.getOrDefault(rankUpConsume[0],0)+rankUpConsume[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int[][] itemArray = ItemUtil.mapToArray(baseItemMap);
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.ljsd.jieling.globals.BIReason;
|
|||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.MailingSystem;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
@ -54,6 +55,10 @@ public class MailLogic {
|
|||
// 获取系统邮件
|
||||
List<SystemMail> systemMail = getSystemMail();
|
||||
|
||||
String redValue = RedisUtil.getInstence().get(RedisKey.MAIL_RED_POINT,"", String.class);
|
||||
if(redValue!=null){
|
||||
RedisUtil.getInstence().set(RedisKey.MAIL_RED_POINT,"",redValue+String.valueOf(userId)+",");
|
||||
}
|
||||
systemMailToUserMail(systemMail,mailMap,userId);
|
||||
if (mailMap.size() ==0){
|
||||
return mailList;
|
||||
|
@ -311,16 +316,41 @@ public class MailLogic {
|
|||
*每分钟检测是否有需要发的邮件
|
||||
*/
|
||||
public void checkReadyToMail() throws Exception {
|
||||
RedisUtil redisUtil = RedisUtil.getInstence();
|
||||
Map<String, MailCache> mails =redisUtil.getMapValues(RedisKey.READY_TO_USER_MAIL, "", String.class, MailCache.class);
|
||||
if (mails.size()<0){
|
||||
return;
|
||||
try{
|
||||
|
||||
RedisUtil redisUtil = RedisUtil.getInstence();
|
||||
//确认是否有服务器邮件 有的话发红点推送
|
||||
String redValue = redisUtil.get(RedisKey.MAIL_RED_POINT,"", String.class);
|
||||
if(redValue!=null){
|
||||
String[] split = redValue.split(",");
|
||||
Set<Integer> uidList =new HashSet<>(split.length-1);
|
||||
if(split.length>1){
|
||||
for(int i = 0 ; i < split.length;i++){
|
||||
uidList.add(Integer.parseInt(split[i]));
|
||||
}
|
||||
}
|
||||
for(ISession session:OnlineUserManager.sessionMap.values()){
|
||||
if(uidList.contains(session.getUid())){
|
||||
continue;
|
||||
}
|
||||
MessageUtil.sendRedIndication(session.getUid(),GlobalsDef.MAIL_RED_TYPE);
|
||||
}
|
||||
redisUtil.del(RedisKey.getKey(RedisKey.MAIL_RED_POINT,"",false));
|
||||
}
|
||||
//检测个人邮件
|
||||
Map<String, MailCache> mails =redisUtil.getMapValues(RedisKey.READY_TO_USER_MAIL, "", String.class, MailCache.class);
|
||||
if (mails.size()<1){
|
||||
return;
|
||||
}
|
||||
for(Map.Entry<String, MailCache> mail:mails.entrySet()){
|
||||
sendMail(Integer.parseInt(mail.getKey()),mail.getValue().getTitle(),mail.getValue().getContent(),mail.getValue().getReward(),mail.getValue().getTime(),0);
|
||||
}
|
||||
redisUtil.del(RedisKey.getKey(RedisKey.READY_TO_USER_MAIL,"",false));
|
||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||
}catch(Exception e){
|
||||
LOGGER.info("发送邮件异常{}",e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
for(Map.Entry<String, MailCache> mail:mails.entrySet()){
|
||||
sendMail(Integer.parseInt(mail.getKey()),mail.getValue().getTitle(),mail.getValue().getContent(),mail.getValue().getReward(),mail.getValue().getTime(),0);
|
||||
}
|
||||
redisUtil.del(RedisKey.getKey(RedisKey.READY_TO_USER_MAIL,"",false));
|
||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,9 +11,9 @@ public class GetEquipDataManager implements BaseDataManager{
|
|||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
CumulationData.Result result = null;
|
||||
int equipTid = (int)parm[0];
|
||||
int equipNum = (int)parm[1];
|
||||
if(missionType == MissionType.USER_GET_EQUIP_QUALITY){
|
||||
SEquipConfig sEquipConfig = STableManager.getConfig(SEquipConfig.class).get(equipTid);
|
||||
data.updateEquipQuality(STableManager.getConfig(SEquipConfig.class).get(equipTid).getQuality());
|
||||
data.updateEquipQuality(STableManager.getConfig(SEquipConfig.class).get(equipTid).getQuality(),equipNum);
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -59,11 +59,11 @@ public class AchieveMissionIdsType extends AbstractMissionType{
|
|||
|
||||
if (isfinish) {
|
||||
boolean flag = false;
|
||||
for (MissionStateChangeInfo missionStateChangeInfo : missionStateChangeInfos) {
|
||||
if (missionStateChangeInfo.getMissionId() == id) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
// for (MissionStateChangeInfo missionStateChangeInfo : missionStateChangeInfos) {
|
||||
// if (missionStateChangeInfo.getMissionId() == id) {
|
||||
// flag = true;
|
||||
// }
|
||||
// }
|
||||
if (!flag) {
|
||||
MissionStateChangeInfo doingInfo = new MissionStateChangeInfo(id, MissionState.DOING, doingProgress);
|
||||
missionStateChangeInfos.add(doingInfo);
|
||||
|
|
|
@ -614,6 +614,9 @@ public class ItemUtil {
|
|||
}
|
||||
extraDropAop(user,dropBuilder,sItem);
|
||||
sendToFront.add(CBean2Proto.getItem(item,-1));
|
||||
if(sItem.getItemType()==GlobalItemType.EQUIP){
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.GET_EQUIP,sItem.getId(),itemNum);
|
||||
}
|
||||
}
|
||||
if (dropBuilder != null) {
|
||||
dropBuilder.addAllItemlist(itemProtoList);
|
||||
|
|
|
@ -5,6 +5,7 @@ import manager.Table;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
@Table(name ="EquipTalismana")
|
||||
public class SEquipTalismana implements BaseConfig {
|
||||
|
@ -38,7 +39,7 @@ public class SEquipTalismana implements BaseConfig {
|
|||
equipTalismanaMap = STableManager.getConfig(SEquipTalismana.class);
|
||||
equipTalismanaStarMap = new HashMap<>();
|
||||
for(Map.Entry<Integer,SEquipTalismana> entry: equipTalismanaMap.entrySet()){
|
||||
equipTalismanaStarMap.computeIfAbsent(entry.getValue().getTalismanaId(),v->new HashMap<>()).put(entry.getValue().getLevel(),entry.getValue());
|
||||
equipTalismanaStarMap.computeIfAbsent(entry.getValue().getTalismanaId(),v->new TreeMap<>()).put(entry.getValue().getLevel(),entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue