Exemple #1
0
 /// <summary>
 /// 处理主页BOSS列表封包
 /// </summary>
 /// <param name="pack">封包数据结构体</param>
 /// <returns>处理结果标志</returns>
 private static int ProcessRaidBossList(PacketInfo pack)
 {
     DataUtil.Game.canAuto = false;
     MiscHelper.ShowMapInfoButton(false);
     MiscHelper.SetAutoGo(false);
     return(E_SUCCESS);
 }
Exemple #2
0
        /// <summary>
        /// 处理进副本封包
        /// </summary>
        /// <param name="pack">封包数据结构体</param>
        /// <returns>处理结果标志</returns>
        private static int ProcessDungeonStageStart(PacketInfo pack)
        {
            JObject json = pack.data;

            DataUtil.Game.CalcPlayerGamePoint(GameInfo.PlayerPointType.AP, json["stamina"], json["staminaTime"]);
            string dungeonType = "普通";

            switch (pack.funcApi)
            {
            case "/dungeon/saveEventStageStart":
                dungeonType = "活动";
                break;

            case "/dungeon/saveEncounterStageStart":
                dungeonType = "隐藏";
                break;

            case "/dungeon/saveWhaleStageStart":
                dungeonType = "鲸鱼";
                break;
            }
            if (json["bossList"] != null && json["bossList"].ToString() != "")
            {
                DataUtil.Game.bossList = new ObservableCollection <GameInfo.BossInfo>();
                try
                {
                    JArray bossList = (JArray)json["bossList"];
                    foreach (JObject boss in bossList)
                    {
                        GameInfo.BossInfo bossInfo = new GameInfo.BossInfo();
                        bossInfo.group = int.Parse(boss["bossGroupId"].ToString());
                        bossInfo.name  = boss["name"].ToString();
                        bossInfo.hp    = int.Parse(boss["hitPoint"].ToString());
                        bossInfo.atk   = int.Parse(boss["attack"].ToString());
                        bossInfo.def   = int.Parse(boss["defense"].ToString());
                        bossInfo.skill = boss["bossSkillName"].ToString();
                        bossInfo.money = int.Parse(boss["dropGameMoney"].ToString());
                        bossInfo.gp    = int.Parse(boss["dropGachaPoint"].ToString());
                        DataUtil.Game.bossList.Add(bossInfo);
                    }
                }
                catch { }
            }
            UpdateTimeLeft();
            MiscHelper.AddLog("成功进入" + dungeonType + "副本,剩余体力:" + DataUtil.Game.player.AP.ToString(), MiscHelper.LogType.Stage);
            DataUtil.Game.canAuto = true;
            MiscHelper.ShowMapInfoButton();
            if (DataUtil.Config.sysConfig.autoGoInMaps)
            {
                mainWindow.btnAuto_Click(mainWindow, new System.Windows.RoutedEventArgs());
            }
            return(E_SUCCESS);
        }
Exemple #3
0
        /// <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);
        }
Exemple #4
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);
            UpdateTimeLeft();
            return(E_SUCCESS);
        }