/// <summary> /// 处理礼品箱物品取出全部物品信息封包 /// </summary> /// <param name="pack">封包数据结构体</param> /// <returns>处理结果标志</returns> private static int ProcessPresentReceivedAll(PacketInfo pack) { JObject json = pack.data; DataUtil.Game.player.money += json["givingGameMoney"] != null?int.Parse(json["givingGameMoney"].ToString()) : 0; DataUtil.Game.player.stone += json["givingChargeMoney"] != null?int.Parse(json["givingChargeMoney"].ToString()) : 0; string log = "取出礼品箱内物品,获得"; log += json["givingGameMoney"] != null && json["givingGameMoney"].ToString() != "0" ? "金币" + json["givingGameMoney"].ToString() + "," : ""; log += json["givingChargeMoney"] != null && json["givingChargeMoney"].ToString() != "0" ? "华灵石" + json["givingChargeMoney"].ToString() + "," : ""; log += json["givingGachaPoint"] != null && json["givingGachaPoint"].ToString() != "0" ? "种子" + json["givingGachaPoint"].ToString() + "," : ""; log += json["givingRaidBossGachaPoint"] != null && json["givingRaidBossGachaPoint"].ToString() != "0" ? "初级装备种子" + json["givingRaidBossGachaPoint"].ToString() + "," : ""; log += (json["givingUserCharacterList"] as JArray).Count > 0 ? "角色" + (json["givingUserCharacterList"] as JArray).Count.ToString() + "," : ""; log += (json["givingUserCharacterEquipmentList"] as JArray).Count > 0 ? "装备" + (json["givingUserCharacterEquipmentList"] as JArray).Count.ToString() + "," : ""; log += (json["givingUserGiftList"] as JArray).Count > 0 ? "赠物" + (json["givingUserGiftList"] as JArray).Count.ToString() + "," : ""; JArray items = (JArray)json["givingUserPointItemList"]; foreach (JObject item in items) { log += MiscHelper.ProcessUserPointItem(item); } log += (json["givingUserEventItemList"] as JArray).Count > 0 ? "活动物品" + (json["givingUserEventItemList"] as JArray).Count.ToString() + "," : ""; log += (json["givingUserGachaTicketList"] as JArray).Count > 0 ? "扭蛋券" + (json["givingUserGachaTicketList"] as JArray).Count.ToString() + "," : ""; log += (json["givingUserGardenMakeoverItemList"] as JArray).Count > 0 ? "庭院物品" + (json["givingUserGardenMakeoverItemList"] as JArray).Count.ToString() + "," : ""; MiscHelper.AddLog(log.Substring(0, log.Length - 1), MiscHelper.LogType.Mailbox); return(E_SUCCESS); }
/// <summary> /// 处理副本放弃封包 /// </summary> /// <param name="pack">封包数据结构体</param> /// <returns>处理结果标志</returns> private static int ProcessDungeonStageFailed(PacketInfo pack) { JObject json = pack.data; DataUtil.Game.player.money += json["givingGameMoney"] != null?int.Parse(json["givingGameMoney"].ToString()) : 0; DataUtil.Game.player.stone += json["givingChargeMoney"] != null?int.Parse(json["givingChargeMoney"].ToString()) : 0; DataUtil.Game.IncreasePlayerExp(json["givingExperience"]); string dungeonType = "普通"; switch (pack.funcApi) { case "/dungeon/saveEventStageFailed": dungeonType = "活动"; break; case "/dungeon/saveEncounterStageFailed": dungeonType = "隐藏"; break; case "/dungeon/saveWhaleStageFailed": dungeonType = "鲸鱼"; break; } string log = "你已退出" + dungeonType + "副本,获得"; log += json["givingGameMoney"] != null && json["givingGameMoney"].ToString() != "0" ? "金币" + json["givingGameMoney"].ToString() + "," : ""; log += json["givingGachaPoint"] != null && json["givingGachaPoint"].ToString() != "0" ? "种子" + json["givingGachaPoint"].ToString() + "," : ""; log += json["givingExperience"] != null && json["givingExperience"].ToString() != "0" ? "经验值" + json["givingExperience"].ToString() + "," : ""; log += json["givingChargeMoney"] != null && json["givingChargeMoney"].ToString() != "0" ? "华灵石" + json["givingChargeMoney"].ToString() + "," : ""; log += json["givingEventItemPoint"] != null && json["givingEventItemPoint"].ToString() != "0" ? "活动点数" + json["givingEventItemPoint"].ToString() + "," : ""; log += (json["givingUserCharacterList"] as JArray).Count > 0 ? "角色" + (json["givingUserCharacterList"] as JArray).Count.ToString() + "," : ""; log += (json["givingUserCharacterEquipmentList"] as JArray).Count > 0 ? "装备" + (json["givingUserCharacterEquipmentList"] as JArray).Count.ToString() + "," : ""; JArray items = (JArray)json["givingUserPointItemList"]; foreach (JObject item in items) { log += MiscHelper.ProcessUserPointItem(item); } items = (JArray)json["givingUserEventItemList"]; foreach (JObject item in items) { log += "活动物品" + item["amount"].ToString() + ","; } MiscHelper.AddLog(log.Substring(0, log.Length - 1), MiscHelper.LogType.Stage); DataUtil.Game.canAuto = false; MiscHelper.ShowMapInfoButton(false); MiscHelper.SetAutoGo(false); UpdateTimeLeft(); return(E_SUCCESS); }
/// <summary> /// 处理副本成功完成封包 /// </summary> /// <param name="pack">封包数据结构体</param> /// <returns>处理结果标志</returns> private static int ProcessDungeonStageSuccess(PacketInfo pack) { JObject json = pack.data; DataUtil.Game.player.money += json["givingGameMoney"] != null?int.Parse(json["givingGameMoney"].ToString()) : 0; DataUtil.Game.player.stone += json["givingChargeMoney"] != null?int.Parse(json["givingChargeMoney"].ToString()) : 0; DataUtil.Game.IncreasePlayerExp(json["givingExperience"]); string dungeonType = "普通"; switch (pack.funcApi) { case "/dungeon/saveEventStageSuccess": dungeonType = "活动"; break; case "/dungeon/saveEncounterStageSuccess": dungeonType = "隐藏"; break; case "/dungeon/saveWhaleStageSuccess": dungeonType = "鲸鱼"; break; } string log = "成功通关" + dungeonType + "副本,获得"; log += json["givingGameMoney"] != null && json["givingGameMoney"].ToString() != "0" ? "金币" + json["givingGameMoney"].ToString() + "," : ""; log += json["givingGachaPoint"] != null && json["givingGachaPoint"].ToString() != "0" ? "种子" + json["givingGachaPoint"].ToString() + "," : ""; log += json["givingExperience"] != null && json["givingExperience"].ToString() != "0" ? "经验值" + json["givingExperience"].ToString() + "," : ""; log += json["givingChargeMoney"] != null && json["givingChargeMoney"].ToString() != "0" ? "华灵石" + json["givingChargeMoney"].ToString() + "," : ""; log += json["givingEventItemPoint"] != null && json["givingEventItemPoint"].ToString() != "0" ? "活动点数" + json["givingEventItemPoint"].ToString() + "," : ""; log += (json["givingUserCharacterList"] as JArray).Count > 0 ? "角色" + (json["givingUserCharacterList"] as JArray).Count.ToString() + "," : ""; log += (json["givingUserCharacterEquipmentList"] as JArray).Count > 0 ? "装备" + (json["givingUserCharacterEquipmentList"] as JArray).Count.ToString() + "," : ""; JArray items = (JArray)json["givingUserPointItemList"]; foreach (JObject item in items) { log += MiscHelper.ProcessUserPointItem(item); } items = (JArray)json["givingUserEventItemList"]; int itemAmount = 0; foreach (JObject item in items) { itemAmount += int.Parse(item["amount"].ToString()); } if (itemAmount > 0) { log += "活动物品" + itemAmount.ToString() + ","; } if (json["encounterStageName"] != null && json["encounterStageName"].ToString() != "") { log += "出现隐藏副本:" + json["encounterStageName"].ToString() + "(需要体力:" + json["encounterStageUseStamina"].ToString() + "),"; if (DataUtil.Config.sysConfig.foundStageNotify) { MiscHelper.ShowRemind(10, DataUtil.Game.player.name + " - 隐藏副本出现通知", "出现隐藏副本:" + json["encounterStageName"].ToString() + ",需要体力:" + json["encounterStageUseStamina"].ToString(), System.Windows.Forms.ToolTipIcon.Info); } } if (json["masterRaidBoss"] != null && json["masterRaidBoss"].ToString() != "") { log += "出现主页BOSS:" + json["masterRaidBoss"]["name"].ToString() + "(Lv:" + json["masterRaidBoss"]["raidBossLevelNum"].ToString() + "),"; if (DataUtil.Config.sysConfig.foundBossNotify) { MiscHelper.ShowRemind(10, DataUtil.Game.player.name + " - 主页BOSS出现通知", "出现主页BOSS:" + json["masterRaidBoss"]["name"].ToString() + ",Lv:" + json["masterRaidBoss"]["raidBossLevelNum"].ToString(), System.Windows.Forms.ToolTipIcon.Info); } } MiscHelper.AddLog(log.Substring(0, log.Length - 1), MiscHelper.LogType.Stage); DataUtil.Game.canAuto = false; MiscHelper.ShowMapInfoButton(false); MiscHelper.SetAutoGo(false); UpdateTimeLeft(); return(E_SUCCESS); }