Esempio n. 1
0
        /// <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);
            mainWindow.UpdatePointRecoveryTime();
            return(E_SUCCESS);
        }
Esempio n. 2
0
 /// <summary>
 /// 处理召唤BOSS战完成信息封包
 /// </summary>
 /// <param name="pack">封包数据结构体</param>
 /// <returns>处理结果标志</returns>
 private static int ProcessSummonBossFinish(PacketInfo pack)
 {
     MiscHelper.AddLog("召唤BOSS战完成", MiscHelper.LogType.Boss);
     return(E_SUCCESS);
 }