法宝gm,无尽地图小怪刷新
parent
aaf700ca6c
commit
ea6a775a3b
|
@ -20,4 +20,5 @@ public interface GlobalGm {
|
|||
int MONSTER_JUMP = 16;//跳到兽潮层
|
||||
int OUT_BLOODY_BATTLE = 17;//退出血战
|
||||
int MISSION_LEAD = 18;//任务指引
|
||||
int ESPECIAL_EQUIP = 19;//增加法宝,星级
|
||||
}
|
||||
|
|
|
@ -233,8 +233,15 @@ public class GMRequestHandler extends BaseHandler{
|
|||
}
|
||||
|
||||
break;
|
||||
case GlobalGm.MISSION_LEAD:
|
||||
|
||||
case GlobalGm.MISSION_LEAD:
|
||||
break;
|
||||
case GlobalGm.ESPECIAL_EQUIP:
|
||||
int itemType = SItem.getsItemMap().get(prarm1).getItemType();
|
||||
if(itemType==GlobalItemType.ESPECIAL_EQUIP){
|
||||
EspecialEquip especialEquip = new EspecialEquip(cUser.getId(),prarm1);
|
||||
especialEquip.setStar(prarm2);
|
||||
cUser.getEquipManager().addEspecialEquip(cUser,especialEquip);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -1508,9 +1508,35 @@ public class MapLogic {
|
|||
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4){
|
||||
Cell cell = mapManager.getMapInfo().get(triggerXY);
|
||||
MapPointConfig mapPointConfig = MapPointConfig.getScMapEventMap().get(cell.getPointId());
|
||||
Map<Integer, SCMap> map= SCMap.sCMap.get(mapManager.getCurMapId());
|
||||
|
||||
if(mapPointConfig.getStyle()==1){
|
||||
Map<Integer, SCMap> map= SCMap.sCMap.get(mapManager.getCurMapId());
|
||||
List<Integer> points = new ArrayList<>();
|
||||
for(Map.Entry<Integer, SCMap> entry:map.entrySet()){
|
||||
if(entry.getValue().getEvent()!=cell.getPointId()){
|
||||
continue;
|
||||
}
|
||||
boolean flagToAddMonster = true;
|
||||
int[][] groups = entry.getValue().getGroups();
|
||||
for(int i = 0;i<groups.length;i++){
|
||||
if(mapManager.getMapInfo().get(CellUtil.xy2Pos(groups[i][0],groups[i][1])).getPointId()!=0){
|
||||
flagToAddMonster = false;
|
||||
}
|
||||
}
|
||||
if(flagToAddMonster){
|
||||
for(int i = 0;i<groups.length;i++){
|
||||
points.add(CellUtil.xy2Pos(groups[i][0], groups[i][1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (points.size()>0){
|
||||
//无尽副本随机空地刷新小怪
|
||||
int cellPos = points.get(MathUtils.randomInt(points.size()));
|
||||
Cell addCell = new Cell(cellPos,mapPointConfig.getInitialEventId(),mapPointConfig.getId());
|
||||
LOGGER.info("刷新位置为{},{}",CellUtil.pos2XY(cellPos)[0],CellUtil.pos2XY(cellPos)[1]);
|
||||
mapManager.addOrUpdateCell(cellPos,addCell);
|
||||
MapInfoProto.RefreshMonsterResponse monsterResponse = MapInfoProto.RefreshMonsterResponse.newBuilder().addCell(CBean2Proto.getCell(addCell)).build();
|
||||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.ENDLESS_MONSTER_REFRESH_INDICATION_VALUE,monsterResponse,true);
|
||||
}
|
||||
BehaviorUtil.destoryApointXY(user, triggerXY);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue