七界秘宝积分问题
parent
14f6e735bc
commit
027fc3eec2
|
|
@ -46,28 +46,18 @@ public class SevenWorldActivity extends AbstractActivity {
|
||||||
SevenWorldActivity(int id) {
|
SevenWorldActivity(int id) {
|
||||||
super(id);
|
super(id);
|
||||||
Poster.getPoster().listenEvent(this, SuperBoxEvent.class);
|
Poster.getPoster().listenEvent(this, SuperBoxEvent.class);
|
||||||
Poster.getPoster().listenEvent(this, SevenWorldIntegralEvent.class);
|
// Poster.getPoster().listenEvent(this, SevenWorldIntegralEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEvent(IEvent event) throws Exception {
|
public void onEvent(IEvent event) throws Exception {
|
||||||
int uid = 0;
|
|
||||||
int param1 = 0;
|
|
||||||
int param2 = 0;
|
|
||||||
// 购买礼包
|
// 购买礼包
|
||||||
if (event instanceof SuperBoxEvent) {
|
if (!(event instanceof SuperBoxEvent)) {
|
||||||
SuperBoxEvent event1 = (SuperBoxEvent) event;
|
|
||||||
uid = event1.getUserId();
|
|
||||||
param1 = event1.getGiftId();
|
|
||||||
}
|
|
||||||
if (event instanceof SevenWorldIntegralEvent) {
|
|
||||||
SevenWorldIntegralEvent event1 = (SevenWorldIntegralEvent) event;
|
|
||||||
uid = event1.getUid();
|
|
||||||
param2 = event1.getIntegral();
|
|
||||||
}
|
|
||||||
if (uid == 0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
SuperBoxEvent event1 = (SuperBoxEvent) event;
|
||||||
|
int uid = event1.getUserId();
|
||||||
|
int param1 = event1.getGiftId();
|
||||||
// 验证玩家信息和活动信息
|
// 验证玩家信息和活动信息
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||||
|
|
@ -76,19 +66,10 @@ public class SevenWorldActivity extends AbstractActivity {
|
||||||
}
|
}
|
||||||
// 已购买礼包
|
// 已购买礼包
|
||||||
if (param1 == GIFT) {
|
if (param1 == GIFT) {
|
||||||
ActivityProgressInfo info = Optional.ofNullable(mission.getActivityMissionMap()).map(v -> v.get(-1)).orElse(null);
|
ActivityProgressInfo info = new ActivityProgressInfo();
|
||||||
if (info != null) {
|
info.setState(1);
|
||||||
info.setState(1);
|
mission.getActivityMissionMap().put(-1, info);
|
||||||
mission.getActivityMissionMap().put(-1, info);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// 七界秘宝积分
|
|
||||||
if (param2 > 0){
|
|
||||||
int integralId = STableManager.getConfig(SQijieStage.class).get(FIRST_CHECKPOINT).getTreasureIntegral()[0];
|
|
||||||
ItemUtil.drop(user,new int[][]{{integralId,param2}},BIReason.SEVEN_WORLD_CHALLENGE);
|
|
||||||
}
|
|
||||||
// 状态推送
|
|
||||||
sendActivityProgress(user, mission, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -360,8 +360,6 @@ public class SevenWorldLogic {
|
||||||
ItemUtil.drop(user,rewardMap,drop,BIReason.SEVEN_WORLD_CHALLENGE);
|
ItemUtil.drop(user,rewardMap,drop,BIReason.SEVEN_WORLD_CHALLENGE);
|
||||||
// 七界秘宝积分,没有加成
|
// 七界秘宝积分,没有加成
|
||||||
ItemUtil.drop(user,new int[][]{stage.getTreasureIntegral()},drop,BIReason.SEVEN_WORLD_CHALLENGE);
|
ItemUtil.drop(user,new int[][]{stage.getTreasureIntegral()},drop,BIReason.SEVEN_WORLD_CHALLENGE);
|
||||||
// 事件监听
|
|
||||||
Poster.getPoster().dispatchEvent(new SevenWorldIntegralEvent(user.getId(),stage.getTreasureIntegral()[1]));
|
|
||||||
|
|
||||||
response.setDrop(drop);
|
response.setDrop(drop);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue