少年修仙传客户端代码仓库
client_Wu Xijin
2019-05-23 23021cb033aaeb597923530223eed46c7ef0dd1d
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
4 文件已复制
2个文件已删除
2 文件已重命名
6个文件已添加
55个文件已修改
3059 ■■■■■ 已修改文件
Core/GameEngine/DataToCtl/PackageRegedit.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/HazyRegionConfig.cs 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/HazyRegionConfig.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/PersonalBossConfig.cs 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/Model/Config/PersonalBossConfig.cs.meta 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0408_tagPlayerSummonNPCAppear.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0429_tagObjResetPos.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HA1_Sys/DTCA112_tagMCDBPlayer.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB216_tagMCStartCustomSceneResult.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB216_tagMCStartCustomSceneResult.cs.meta 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB40A_tagMCPYPlayerMove.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HB2_ActionMap/HB216_tagMCStartCustomSceneResult.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/NetworkPackage/ServerPack/HB2_ActionMap/HB216_tagMCStartCustomSceneResult.cs.meta 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Actor/HeroBehaviour.cs 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Actor/Skill/AttackHandler.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Actor/State/SMB/STM_BaseAttack.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GA_Hero.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/GActorPlayerBase.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/PersonalEnemy.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/Dungeon/AdventureStage.cs 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/Dungeon/ClientDungeonStageUtility.cs 242 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/Dungeon/ClientHazyPreciousDungeonStage.cs 367 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/Dungeon/ClientHazyPreciousDungeonStage.cs.meta 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/Dungeon/ClientPersonalBossDungeonStage.cs 190 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/Dungeon/ClientPersonalBossDungeonStage.cs.meta 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/Dungeon/DungeonStage.cs 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/Dungeon/HazyPreciousDungeonStage.cs 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/Stage/StageLoadProcessor.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Lua/Gen/PersonalBossConfigWrap.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Lua/Gen/SnxxzUIHazyDemonKingModelWrap.cs 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Lua/Gen/SnxxzUIHazyGrassModelWrap.cs 122 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DemonTreasureDungeonVictoryWin.cs 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonFightWin.cs 81 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonGetTreasureVictoryWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonModel.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonSuppliesLackWin.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/DungeonVictoryWin.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Dungeon/TreasureDungeonMissionHintWin.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/FindPrecious/PersonalBossModel.cs 59 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/FindPrecious/PersonalBossWin.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/GeneralConfig/GeneralDefine.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/ClientHazyDemonKingStage.cs 191 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/ClientHazyGrassStage.cs 326 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/DungeonAdventureVictoryWin.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyDemonKingDungeonWin.cs 62 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyDemonKingModel.cs 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyDemonKingVictoryWin.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyGrassDungeonWin.cs 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyGrassModel.cs 157 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyMapNpcScriptableObject.cs 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyRegionCompleteWin.cs 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyRegionCompleteWin.cs.meta 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyRegionDialogueWin.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyRegionIncidentBehaviour.cs 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyRegionIncidentPanel.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyRegionModel.cs 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/HazyRegion/HazyRegionWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Skill/ExpertSkillSelectWin.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/ClientTreasureDungeon.cs 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/ClientTreasureDungeonStage.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/DemonDungeonChallengeConfirmWin.cs 119 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/DemonDungeonChallengeConfirmWin.cs.meta 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/DemonTreasureWin.cs 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/HumanTreasureWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Treasure/TreasureDungeonVictoryWin.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/WindowJump/WindowJumpMgr.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/EnumHelper.cs 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/GlobalTimeEvent.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Core/GameEngine/DataToCtl/PackageRegedit.cs
@@ -25,6 +25,7 @@
    public static void Init()
    {
        // 登记相应的数据体及对应的数据转逻辑类
        Register(typeof(HB216_tagMCStartCustomSceneResult), typeof(DTCB216_tagMCStartCustomSceneResult));
        Register(typeof(HA905_tagGCNotifyEquipDetailInfo), typeof(DTCA905_tagGCNotifyEquipDetailInfo));
        Register(typeof(HA719_tagSCPlayerEquipCacheResult) ,typeof(DTCA719_tagSCPlayerEquipCacheResult));
        Register(typeof(HB108_tagMCYinjiStartTime) ,typeof(DTCB108_tagMCYinjiStartTime));
Core/GameEngine/Model/Config/HazyRegionConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           Fish
//    [  Date ]:           Monday, May 20, 2019
//    [  Date ]:           Thursday, May 23, 2019
//--------------------------------------------------------
using System.Collections.Generic;
@@ -24,7 +24,8 @@
    public readonly int alchemyLevel;
    public readonly int[] reward;
    public readonly int[] rewardState;
    public readonly string PortraitID;
    public readonly string PortraitID;
    public readonly int star;
    public HazyRegionConfig()
    {
@@ -68,7 +69,9 @@
                 int.TryParse(rewardStateStringArray[i],out rewardState[i]);
            }
            PortraitID = tables[11];
            PortraitID = tables[11];
            int.TryParse(tables[12],out star);
        }
        catch (Exception ex)
        {
@@ -152,6 +155,7 @@
            path = AssetVersionUtility.GetAssetFilePath("config/HazyRegion.txt");
        }
        configs.Clear();
        var tempConfig = new HazyRegionConfig();
        var preParse = tempConfig is IConfigPostProcess;
Core/GameEngine/Model/Config/HazyRegionConfig.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 3404c0f308cb2174bb7b93e12c3110bd
timeCreated: 1558343195
timeCreated: 1558577610
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Core/GameEngine/Model/Config/PersonalBossConfig.cs
@@ -1,6 +1,6 @@
//--------------------------------------------------------
//    [Author]:           Fish
//    [  Date ]:           Wednesday, May 15, 2019
//    [  Date ]:           Thursday, May 23, 2019
//--------------------------------------------------------
using System.Collections.Generic;
@@ -13,10 +13,10 @@
public partial class PersonalBossConfig
{
    public readonly int NPCID;
    public readonly int ChanllengeLv;
    public readonly int[] MustItemID;
    public readonly int[] RareItemID;
    public readonly int NPCID;
    public readonly int lineId;
    public readonly int[] MustItemID;
    public readonly int[] RareItemID;
    public readonly string PortraitID;
    public PersonalBossConfig()
@@ -29,24 +29,24 @@
        {
            var tables = input.Split('\t');
            int.TryParse(tables[0],out NPCID);
            int.TryParse(tables[1],out ChanllengeLv);
            int.TryParse(tables[0],out NPCID);
            int.TryParse(tables[1],out lineId);
            string[] MustItemIDStringArray = tables[2].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
            MustItemID = new int[MustItemIDStringArray.Length];
            for (int i=0;i<MustItemIDStringArray.Length;i++)
            {
                 int.TryParse(MustItemIDStringArray[i],out MustItemID[i]);
            }
            }
            string[] RareItemIDStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries);
            RareItemID = new int[RareItemIDStringArray.Length];
            for (int i=0;i<RareItemIDStringArray.Length;i++)
            {
                 int.TryParse(RareItemIDStringArray[i],out RareItemID[i]);
            }
            }
            PortraitID = tables[4];
        }
        catch (Exception ex)
Core/GameEngine/Model/Config/PersonalBossConfig.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: f73cc9f99bc29204fb20c8eecff4b111
timeCreated: 1557892554
timeCreated: 1558594484
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Core/NetworkPackage/DTCFile/ServerPack/H01_System/DTC0102_tagCDBPlayer.cs
@@ -44,13 +44,10 @@
            }
        }
        GA_Hero.recordServerPos = new Vector3(package.PosX, 0, package.PosY);
        PlayerDatas.Instance.InitPlayerData(package);
        PlayerDatas.Instance.RequestWorldTick();
        if (ClientDungeonStageUtility.isClientDungeon)
        {
            PlayerDatas.Instance.baseData.MapID = ClientDungeonStageUtility.clientMapId;
        }
        if (package.socketType == ServerType.Main)
        {
@@ -69,6 +66,22 @@
            }
        }
        if (ClientDungeonStageUtility.isClientDungeon)
        {
            PlayerDatas.Instance.baseData.MapID = ClientDungeonStageUtility.clientMapId;
        }
        else
        {
            var clientMapRecord = ClientDungeonStageUtility.GetClientDataMapSymbol();
            if (clientMapRecord.mapId != 0 &&
                (DateTime.Now - clientMapRecord.time).TotalMinutes < 3)
            {
                ClientDungeonStageUtility.SetClientDungeon(true, (ushort)clientMapRecord.mapId);
                ClientDungeonStageUtility.dungeonInfo = clientMapRecord.dungeon;
                PlayerDatas.Instance.baseData.MapID = (ushort)clientMapRecord.mapId;
            }
        }
        if (package.socketType == ServerType.Main)
        {
            SDKUtility.Instance.RoleLogin(package.PlayerID.ToString(),
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0408_tagPlayerSummonNPCAppear.cs
@@ -26,10 +26,13 @@
            return;
        }
        if (_npcConfig.NPCType == (int)E_NpcType.PersonalEnemy)
        if (vNetData.PlayerID == PlayerDatas.Instance.PlayerId)
        {
            PersonalEnemy.Bind(vNetData);
            return;
            if (_npcConfig.NPCType == (int)E_NpcType.PersonalEnemy)
            {
                PersonalEnemy.Bind(vNetData);
                return;
            }
        }
        if (_npcConfig.NPCType == (int)E_NpcType.Collect)
Core/NetworkPackage/DTCFile/ServerPack/H04_Scene/DTC0429_tagObjResetPos.cs
@@ -81,6 +81,8 @@
            if (ResetPlayerPosEvent != null)
                ResetPlayerPosEvent(vNetData);
            GA_Hero.recordServerPos = new Vector3(vNetData.PosX, 0, vNetData.PosY);
        }
        else
        {
Core/NetworkPackage/DTCFile/ServerPack/HA1_Sys/DTCA112_tagMCDBPlayer.cs
@@ -6,6 +6,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DTCA112_tagMCDBPlayer : DtcBasic
{
@@ -14,6 +15,8 @@
    {
        base.Done(vNetPack);
        var package = vNetPack as HA112_tagMCDBPlayer;
        GA_Hero.recordServerPos = new Vector3(package.PosX, 0, package.PosY);
        PlayerDatas.Instance.UpdatePlayerData(package);
@@ -31,9 +34,9 @@
            }
        }
        if (playerInitEvent != null)
        {
            playerInitEvent();
        if (playerInitEvent != null)
        {
            playerInitEvent();
        }
    }
Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB216_tagMCStartCustomSceneResult.cs
New file
@@ -0,0 +1,24 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, May 20, 2019
//--------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
public class DTCB216_tagMCStartCustomSceneResult : DtcBasic
{
    public override void Done(GameNetPackBasic vNetPack)
    {
        base.Done(vNetPack);
        var package = vNetPack as HB216_tagMCStartCustomSceneResult;
        ClientDungeonStageUtility.ReceiveStartCustomDungeonResult(package);
    }
}
Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB216_tagMCStartCustomSceneResult.cs.meta
copy from System/Treasure/ClientTreasureDungeon.cs.meta copy to Core/NetworkPackage/DTCFile/ServerPack/HB2_ActionMap/DTCB216_tagMCStartCustomSceneResult.cs.meta
File was copied from System/Treasure/ClientTreasureDungeon.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 189ce34976654c34da06b3239c45076d
timeCreated: 1556000158
guid: dfc6ece5f89c0914781de4b1c26967c6
timeCreated: 1558352395
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Core/NetworkPackage/DTCFile/ServerPack/HB4_Fight/DTCB40A_tagMCPYPlayerMove.cs
@@ -7,11 +7,11 @@
using System.Collections.Generic;
public class DTCB40A_tagMCPYPlayerMove : DtcBasic
{
    private static List<GameObject> _free = new List<GameObject>();
    private static List<GameObject> _list = new List<GameObject>();
    private static bool finished = false;
{
    private static List<GameObject> _free = new List<GameObject>();
    private static List<GameObject> _list = new List<GameObject>();
    private static bool finished = false;
    public override void Done(GameNetPackBasic vNetPack)
    {
        base.Done(vNetPack);
@@ -65,9 +65,11 @@
            _dest = new Vector3(package.ClientPosX * Constants.F_BETA, _player.Pos.y, package.ClientPosY * Constants.F_BETA);
        }
        GA_Hero.recordServerPos = new Vector3(package.SeverPosX, 0, package.SeverPosY);
        _player.MoveToPosition(_dest, package.Dir, package.Speed, package.MoveType == 1);
        finished = package.MoveType == 0;
    }
    }
}
Core/NetworkPackage/ServerPack/HB2_ActionMap/HB216_tagMCStartCustomSceneResult.cs
New file
@@ -0,0 +1,21 @@
using UnityEngine;
using System.Collections;
// B2 16 开始自定义场景结果 #tagMCStartCustomSceneResult
public class HB216_tagMCStartCustomSceneResult : GameNetPackBasic {
    public uint MapID;
    public ushort FuncLineID;
    public byte Result;    //是否允许
    public HB216_tagMCStartCustomSceneResult () {
        _cmd = (ushort)0xB216;
    }
    public override void ReadFromBytes (byte[] vBytes) {
        TransBytes (out MapID, vBytes, NetDataType.DWORD);
        TransBytes (out FuncLineID, vBytes, NetDataType.WORD);
        TransBytes (out Result, vBytes, NetDataType.BYTE);
    }
}
Core/NetworkPackage/ServerPack/HB2_ActionMap/HB216_tagMCStartCustomSceneResult.cs.meta
copy from System/Treasure/ClientTreasureDungeon.cs.meta copy to Core/NetworkPackage/ServerPack/HB2_ActionMap/HB216_tagMCStartCustomSceneResult.cs.meta
File was copied from System/Treasure/ClientTreasureDungeon.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 189ce34976654c34da06b3239c45076d
timeCreated: 1556000158
guid: 8eef1db0ddcd05b458ac4b0ef547f3fd
timeCreated: 1558352371
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Fight/Actor/HeroBehaviour.cs
@@ -726,8 +726,7 @@
                GActorFight _target = null;
                CB405_tagCMSuperAtk _b405 = null;
                if (!ClientDungeonStageUtility.isClientDungeon
                 && !ClientSceneManager.Instance.IsClientFightMode
                if (!ClientSceneManager.Instance.IsClientFightMode
                 && !AdventureStage.Instance.IsInAdventureStage
#if UNITY_EDITOR
                 && !RuntimeLogUtility.TEST_CLIENT_PVP
@@ -767,6 +766,11 @@
                        if (_bindID == 0)
                        {
                            continue;
                        }
                        else
                        {
                            _b405.PosX = (ushort)(GA_Hero.recordServerPos.x + GA_Hero.MapOffset.x);
                            _b405.PosY = (ushort)(GA_Hero.recordServerPos.z + GA_Hero.MapOffset.z);
                        }
                    }
@@ -894,6 +898,11 @@
            {
                _target = GAMgr.Instance.GetByCID(skill.hitClientBattleTargetList[i]) as GActorFight;
                if (PersonalEnemy.m_CBinSdDict.ContainsKey(_target.ServerInstID))
                {
                    continue;
                }
                AttackHandler.HurtObjs _hurtObject = new AttackHandler.HurtObjs
                {
                    ObjID = (uint)_target.ServerInstID,
Fight/Actor/Skill/AttackHandler.cs
@@ -188,7 +188,6 @@
            {
                // 处理封魔坛英雄伤害
                FakeDemonJarDungeonStage _dungeon = StageLoad.Instance.currentStage as FakeDemonJarDungeonStage;
                ClientHazyDemonKingStage _clientHazyDemonStage = StageLoad.Instance.currentStage as ClientHazyDemonKingStage;
                if (_dungeon != null)
                {
                    if (attacker.ServerInstID == PlayerDatas.Instance.PlayerId)
@@ -200,10 +199,6 @@
                    {
                        _cnpc.StartCantAtkedRotate();
                    }
                }
                else if (_clientHazyDemonStage != null)
                {
                }
                else
                {
@@ -242,14 +237,14 @@
                    if (_doReduceHp)
                    {
                        if (attacker is GA_NpcClientFightNorm || target is GA_NpcClientFightNorm)
                        {
                            target.ActorInfo.ReduceHp((uint)hurtValue);
                        }
                        else
                        {
                            target.ActorInfo.ReduceHp((uint)realHurtValue);
                        }
                        // if (attacker is GA_NpcClientFightNorm || target is GA_NpcClientFightNorm)
                        // {
                        //     target.ActorInfo.ReduceHp((uint)hurtValue);
                        // }
                        // else
                        // {
                        target.ActorInfo.ReduceHp((uint)realHurtValue);
                        // }
                    }
                    if (target.ServerInstID == PlayerDatas.Instance.baseData.PlayerID)
@@ -305,8 +300,7 @@
            }
        }
        if (canDie
         && target.ActorInfo.RealHp == 0
         && !(StageLoad.Instance.currentStage is ClientHazyDemonKingStage))
         && target.ActorInfo.RealHp == 0)
        {
            target.Die(attacker.ServerInstID, soConfig.deadFlyId, (byte)attackType);
        }
Fight/Actor/State/SMB/STM_BaseAttack.cs
@@ -412,7 +412,7 @@
                    continue;
                }
                if (_target.ActorInfo.serverDie && !(StageLoad.Instance.currentStage is ClientHazyDemonKingStage))
                if (_target.ActorInfo.serverDie)
                {
                    _target.Die(owner.ServerInstID, 0, m_CacheSkill.hurtClientList[i].AttackType);
                }
@@ -427,8 +427,7 @@
                    continue;
                }
                if (_target.ActorInfo.serverDie
                 && !(StageLoad.Instance.currentStage is ClientHazyDemonKingStage))
                if (_target.ActorInfo.serverDie)
                {
                    _target.Die(owner.ServerInstID, 0, m_CacheSkill.hurtClntFightNpcList[i].AttackType);
                }
@@ -1106,6 +1105,8 @@
                            WorldTick = PlayerDatas.Instance.GetWorldTick()
                        };
                        GA_Hero.recordServerPos = new Vector3(_proto.DestX, 0, _proto.DestY);
                        if (!CrossServerUtility.IsCrossServer())
                        {
                            GameNetSystem.Instance.SendInfo(_proto);
Fight/GameActor/GA_Hero.cs
@@ -6,6 +6,7 @@
public class GA_Hero : GActorPlayerBase, ICtrlGA
{
    public static Vector3 recordServerPos;
    public static Vector3 MapOffset;
    public static bool s_MapSwitching = false;
    public static bool s_Flying = false;
Fight/GameActor/GActorPlayerBase.cs
@@ -2896,24 +2896,28 @@
        {
            if (PreFightMission.Instance.IsFinished())
            {
                // 发送冲锋包
                CB404_tagCMRush _b404 = new CB404_tagCMRush();
                // 防止乱冲
                if (SelectTarget != null)
                if (!ClientDungeonStageUtility.isClientDungeon)
                {
                    _b404.ObjID = (uint)SelectTarget.ServerInstID;
                }
                _b404.PosX = (ushort)(Pos.x * 2 + GA_Hero.MapOffset.x);
                _b404.PosY = (ushort)(Pos.z * 2 + GA_Hero.MapOffset.z);
                    // 发送冲锋包
                    CB404_tagCMRush _b404 = new CB404_tagCMRush();
                    // 防止乱冲
                    if (SelectTarget != null)
                    {
                        _b404.ObjID = (uint)SelectTarget.ServerInstID;
                    }
                    _b404.PosX = (ushort)(Pos.x * 2 + GA_Hero.MapOffset.x);
                    _b404.PosY = (ushort)(Pos.z * 2 + GA_Hero.MapOffset.z);
                    GA_Hero.recordServerPos = new Vector3(_b404.PosX, 0, _b404.PosY);
                if (!CrossServerUtility.IsCrossServer())
                {
                    GameNetSystem.Instance.SendInfo(_b404);
                }
                else
                {
                    GameNetSystem.Instance.SendToCrossServer(_b404);
                    if (!CrossServerUtility.IsCrossServer())
                    {
                        GameNetSystem.Instance.SendInfo(_b404);
                    }
                    else
                    {
                        GameNetSystem.Instance.SendToCrossServer(_b404);
                    }
                }
            }
            PrevPos = Pos;
Fight/GameActor/PersonalEnemy.cs
@@ -11,9 +11,6 @@
        public E_ActorGroup g;
    }
    public H0408_tagPlayerSummonNPCAppear data;
    public uint bindClientNpcSID = 0;
    private static Dictionary<uint, PersonalEnemy> m_Map = new Dictionary<uint, PersonalEnemy>();
    public static Dictionary<uint, uint> m_CBinSdDict = new Dictionary<uint, uint>();
    public static Dictionary<uint, uint> m_SBindCDict = new Dictionary<uint, uint>();
@@ -95,6 +92,11 @@
            _npc.BornPos = _npc.Pos = _vaildPos;
            m_CBinSdDict[_npc.ServerInstID] = h0408.ObjID;
            m_SBindCDict[h0408.ObjID] = _npc.ServerInstID;
            _npc.ActorInfo.Hp = h0408.HP;
            _npc.ActorInfo.HpEx = h0408.HPEx;
            _npc.ActorInfo.MaxHp = h0408.MaxHP;
            _npc.ActorInfo.MaxHpEx = h0408.MaxHPEx;
            _npc.ActorInfo.moveSpeed = 500f / h0408.Speed;
            if (OnNpcAppear != null)
            {
                OnNpcAppear(_npc);
Fight/Stage/Dungeon/AdventureStage.cs
@@ -10,8 +10,15 @@
    private Vector3 m_CacheHeroPos;
    private GA_NpcClientFunc m_Npc;
    private GA_NpcClientCollect m_Precious;
    private bool dungeonFightWinOpenRecord = false;
    private SFXController m_SfxController;
    private bool dungeonFightWinOpenRecord = false;
    const int s_PreciousNpcId = 40208014;
    private uint preciousServerInstId = 0;
    public event Action onLoadAdventureStage;
    public event Action onExitAdventureStage;
@@ -21,7 +28,6 @@
    public void Enter()
    {
        IsInAdventureStage = true;
        ClientDungeonStageUtility.RequestStartClientDungeon(0, 0);
        m_CacheHeroPos = PlayerDatas.Instance.hero.Pos;
        SnxxzGame.Instance.StartCoroutine(_Enter());
    }
@@ -61,6 +67,8 @@
        }
        BossShowModel.Instance.bossShowCompletedEvent -= BossShowCompletedEvent;
        BossShowModel.Instance.bossShowCompletedEvent += BossShowCompletedEvent;
        HazyRegionDialogueWin.onDialogueComplete -= OnDialogueComplete;
        HazyRegionDialogueWin.onDialogueComplete += OnDialogueComplete;
        if (onLoadAdventureStage != null)
        {
@@ -91,9 +99,22 @@
    private IEnumerator _Exit()
    {
        NPCInteractProcessor.s_NpcInteractEvent -= OnNpcTalkEvent;
        BossShowModel.Instance.bossShowCompletedEvent -= BossShowCompletedEvent;
        GAMgr.Instance.ServerDie(m_Npc.ServerInstID);
        GAMgr.Instance.Release(m_Npc);
        BossShowModel.Instance.bossShowCompletedEvent -= BossShowCompletedEvent;
        HazyRegionDialogueWin.onDialogueComplete -= OnDialogueComplete;
        ClientCollectUtility.OnCollectFinished -= OnCollectFinished;
        if (!m_Npc.ActorInfo.serverDie)
        {
            GAMgr.Instance.ServerDie(m_Npc.ServerInstID);
            GAMgr.Instance.Release(m_Npc);
        }
        if (m_SfxController != null)
        {
            SFXPlayUtility.Instance.Release(m_SfxController);
            m_SfxController = null;
        }
        WindowCenter.Instance.Open<LoadingWin>();
        WindowCenter.Instance.Close<MainInterfaceWin>();
@@ -121,8 +142,40 @@
        {
            onExitAdventureStage();
        }
    }
    }
    private void OnDialogueComplete()
    {
        m_SfxController = SFXPlayUtility.Instance.Play(20039, m_Npc.Pos, Vector3.forward);
        m_Precious = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>(s_PreciousNpcId, E_ActorGroup.Collect);
        m_Precious.Pos = m_Npc.Pos;
        m_Precious.Rotation = Quaternion.Euler(0f, 165f, 0f);
        ClientSceneManager.Instance.lastDeadPos = m_Precious.Pos;
        preciousServerInstId = m_Precious.ServerInstID;
        PlayerDatas.Instance.hero.SelectTarget = m_Precious;
        if (!m_Npc.ActorInfo.serverDie)
        {
            GAMgr.Instance.ServerDie(m_Npc.ServerInstID);
            GAMgr.Instance.Release(m_Npc);
        }
        ClientCollectUtility.OnCollectFinished -= OnCollectFinished;
        ClientCollectUtility.OnCollectFinished += OnCollectFinished;
    }
    private void OnCollectFinished(uint sid)
    {
        if (preciousServerInstId == sid)
        {
            hazyRegionModel.SendSwitchAdventureState(hazyRegionModel.processingIncidentId, 3);
        }
    }
    private void OnNpcTalkEvent(E_NpcType type, int npcid, uint sid)
    {
        if (E_NpcType.Func == type)
Fight/Stage/Dungeon/ClientDungeonStageUtility.cs
@@ -1,4 +1,5 @@
using System;
using Snxxz.UI;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
@@ -7,27 +8,42 @@
{
    public static bool isClientDungeon { get; private set; }
    public static ushort clientMapId { get; private set; }
    public static ushort clientMapId { get; private set; }
    public static Dungeon dungeonInfo { get; set; }
    static bool exitClientDungeonSymbol = false;
    const string OFFLINEMAPRECORD = "OfflineMapRecord";
    public static event Action<HB214_tagMCCuntomFBPrizeInfo> onReceiveCustomDropItme;
    static Action<Dungeon, bool> clientCustomDungeonResult;
    public static void Init()
    {
        DTC0102_tagCDBPlayer.switchAccountEvent += Reset;
    }
        DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
        StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
    }
    public static void SetClientDungeon(bool value, ushort mapId)
    {
        isClientDungeon = value;
        clientMapId = mapId;
    }
    public static void RequestClientDropItem(int mapId, int lineId)//模拟的真实地图id以及线路id
    {
        var pak = new CB108_tagCMRefreshCustomFBPrize();
        pak.MapID = (uint)mapId;
        pak.FuncLineID = (ushort)lineId;
        GameNetSystem.Instance.SendInfo(pak);
        GlobalTimeEvent.Instance.fiveSecondEvent -= FiveSecondEvent;
        if (value)
        {
            if (IsRequireOfflineReconnect(mapId))
            {
                SetClientDataMapSymbol();
                GlobalTimeEvent.Instance.fiveSecondEvent += FiveSecondEvent;
            }
        }
        else
        {
            ClearClientDataMapSymbol();
        }
    }
    public static void RequestSettleClientDungeon(int mapId, int lineId)
@@ -38,8 +54,16 @@
        GameNetSystem.Instance.SendInfo(pak);
    }
    public static void RequestStartClientDungeon(int mapId,int lineId)
    public static void RequestStartClientDungeon(int mapId, int lineId, Action<Dungeon, bool> callBack)
    {
        clientCustomDungeonResult = callBack;
        dungeonInfo = new Dungeon()
        {
            mapId = mapId,
            lineId = lineId,
        };
        var pak = new CA231_tagCMClientStartCustomScene();
        pak.MapID = (uint)mapId;
        pak.FuncLineID = (ushort)lineId;
@@ -60,10 +84,204 @@
        }
    }
    public static void ReceiveStartCustomDungeonResult(HB216_tagMCStartCustomSceneResult package)
    {
        if (package.MapID == dungeonInfo.mapId
            && package.FuncLineID == dungeonInfo.lineId)
        {
            if (clientCustomDungeonResult != null)
            {
                clientCustomDungeonResult(dungeonInfo, package.Result == 1);
            }
        }
        clientCustomDungeonResult = null;
    }
    public static void GotoNormalClientDungeon(int clientMapId, int mapId, int lineId)
    {
        RequestStartClientDungeon(mapId, lineId, (dungeonInfo, isOk) =>
        {
            var hero = PlayerDatas.Instance.hero;
            if (hero != null)
            {
                hero.StopAll();
            }
            MapTransferUtility.Instance.Clear();
            SetClientDungeon(true, (ushort)clientMapId);
            StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
            {
                toMapId = clientMapId,
                toLineId = 0,
                needEmpty = true,
                needLoadResource = true,
                serverType = ServerType.Main,
                isClientLoadMap = true
            });
            PlayerDatas.Instance.baseData.mainServerMapIdRecord = PlayerDatas.Instance.baseData.MapID;
            PlayerDatas.Instance.baseData.MapID = (ushort)clientMapId;
            var attackMode = new C030A_tagCChangeAttackMode();
            attackMode.Mode = (byte)E_AttackMode.Peace;
            GameNetSystem.Instance.PushPackage(attackMode, ServerType.Main);
        });
    }
    public static void ExitNormalClientDungeon()
    {
        SetClientDungeon(false, 0);
        PlayerDatas.Instance.extersion.pkState = 0;
        ModelCenter.Instance.GetModel<DungeonModel>().ResetBufData();
        exitClientDungeonSymbol = true;
        PlayerDatas.Instance.baseData.MapID = PlayerDatas.Instance.baseData.mainServerMapIdRecord;
        StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
        {
            toMapId = PlayerDatas.Instance.baseData.MapID,
            toLineId = 0,
            needEmpty = true,
            needLoadResource = true,
            serverType = ServerType.Main,
            isClientLoadMap = true,
            refreshPlayerDatas = true
        });
    }
    private static void FiveSecondEvent()
    {
        SetClientDataMapSymbol();
    }
    public static void SetClientDataMapSymbol()
    {
        switch (clientMapId)
        {
            case HazyDemonKingModel.CLIENTDATAMAP:
                {
                    if (!(StageLoad.Instance.currentStage is ClientHazyDemonKingStage))
                    {
                        return;
                    }
                    var stage = StageLoad.Instance.currentStage as ClientHazyDemonKingStage;
                    if (stage.step > ClientHazyDemonKingStage.Step.Fight)
                    {
                        return;
                    }
                }
                break;
            case HazyGrassModel.FAIRY_CLIENTDATAMAP:
            case HazyGrassModel.REIKI_CLIENTDATAMAP:
                {
                    if (!(StageLoad.Instance.currentStage is ClientHazyGrassStage))
                    {
                        return;
                    }
                    var stage = StageLoad.Instance.currentStage as ClientHazyGrassStage;
                    if (stage.hasCompleted)
                    {
                        return;
                    }
                }
                break;
            case HazyRegionModel.PRECIOUS_CLIENTDATAMAP:
                {
                    if (!(StageLoad.Instance.currentStage is ClientHazyPreciousDungeonStage))
                    {
                        return;
                    }
                    var stage = StageLoad.Instance.currentStage as ClientHazyPreciousDungeonStage;
                    if (stage.step > ClientHazyPreciousDungeonStage.Step.Collect)
                    {
                        return;
                    }
                }
                break;
            case PersonalBossModel.PERSONALBOSS_MAPID:
                {
                    if (!(StageLoad.Instance.currentStage is ClientPersonalBossDungeonStage))
                    {
                        return;
                    }
                    var stage = StageLoad.Instance.currentStage as ClientPersonalBossDungeonStage;
                    if (stage.step > ClientPersonalBossDungeonStage.Step.Fight)
                    {
                        return;
                    }
                }
                break;
        }
        var key = StringUtility.Contact(OFFLINEMAPRECORD, "_", PlayerDatas.Instance.baseData.PlayerID);
        var clientMapRecord = new ClientDataMapSymbol()
        {
            mapId = clientMapId,
            time = DateTime.Now,
            dungeon = dungeonInfo,
        };
        LocalSave.SetString(key, LitJson.JsonMapper.ToJson(clientMapRecord));
    }
    public static void ClearClientDataMapSymbol()
    {
        var key = StringUtility.Contact(OFFLINEMAPRECORD, "_", PlayerDatas.Instance.baseData.PlayerID);
        LocalSave.DeleteKey(key);
    }
    public static ClientDataMapSymbol GetClientDataMapSymbol()
    {
        var key = StringUtility.Contact(OFFLINEMAPRECORD, "_", PlayerDatas.Instance.baseData.PlayerID);
        if (LocalSave.HasKey(key))
        {
            var clientMapRecord = LitJson.JsonMapper.ToObject<ClientDataMapSymbol>(LocalSave.GetString(key));
            return clientMapRecord;
        }
        return default(ClientDataMapSymbol);
    }
    static bool IsRequireOfflineReconnect(int mapId)
    {
        switch (mapId)
        {
            case HazyDemonKingModel.CLIENTDATAMAP:
            case HazyGrassModel.REIKI_CLIENTDATAMAP:
            case HazyGrassModel.FAIRY_CLIENTDATAMAP:
            case HazyRegionModel.PRECIOUS_CLIENTDATAMAP:
            case PersonalBossModel.PERSONALBOSS_MAPID:
                return true;
        }
        return false;
    }
    private static void OnPlayerLoginOk()
    {
        if (isClientDungeon)
        {
            RequestStartClientDungeon(dungeonInfo.mapId, dungeonInfo.lineId, null);
        }
    }
    private static void OnStageLoadFinish()
    {
        if (exitClientDungeonSymbol)
        {
            RequestExitClientDungeon();
        }
        exitClientDungeonSymbol = false;
    }
    private static void Reset()
    {
        isClientDungeon = false;
        clientMapId = 0;
    }
    public struct ClientDataMapSymbol
    {
        public int mapId;
        public DateTime time;
        public Dungeon dungeon;
    }
}
Fight/Stage/Dungeon/ClientHazyPreciousDungeonStage.cs
New file
@@ -0,0 +1,367 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Snxxz.UI
{
    public class ClientHazyPreciousDungeonStage : DungeonStage
    {
        readonly Vector3 s_PlayerPosition = new Vector3(17.609f, 5.469f, 2.233f);
        readonly Vector3 s_BossPosition = new Vector3(11.46125f, 5.810412f, 11.24522f);
        readonly Vector3 s_PreciousPosition = new Vector3(5.76f, 6.708447f, 23.48f);
        readonly Vector3 s_PreciousEffectPosition = new Vector3(5.8f, 6.708447f, 23.34f);
        readonly Vector3 s_IndicationPosition = new Vector3(12.1f, 6f, 11.95f);
        readonly Vector3 s_IndicationAngle = new Vector3(0, -30.74f, 0);
        readonly float s_BossAngle = 148.57f;
        readonly float s_PreciousAngle = -29.531f;
        readonly float s_PreciousEffectAngle = 77f;
        int m_LineId = 0;
        int[] stepTimes;
        int m_BossNpcId = 0;
        int m_PreciousNpcId = 0;
        int m_PreciousEffectNpcId = 0;
        uint m_PreciousSid = 0;
        SFXController m_Indication;
        SFXController m_PreciousEffect;
        Clock m_PrepareClock;
        Clock m_ExitClock;
        GA_NpcClientFightBoss clientBoss;
        GA_NpcClientCollect clientPrecious;
        Step m_Step = Step.None;
        public Step step
        {
            get { return m_Step; }
            set
            {
                if (m_Step != value)
                {
                    switch (m_Step)
                    {
                        case Step.Prepare:
                            break;
                        case Step.Fight:
                            OnExitFight();
                            break;
                        case Step.Collect:
                            OnExitCollect();
                            break;
                        case Step.Over:
                            break;
                    }
                    m_Step = value;
                    switch (m_Step)
                    {
                        case Step.Prepare:
                            OnEnterPrepare();
                            break;
                        case Step.Fight:
                            OnEnterFight();
                            break;
                        case Step.Collect:
                            OnEnterCollect();
                            break;
                        case Step.Over:
                            OnEnterOver();
                            break;
                    }
                }
            }
        }
        DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
        HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
        public override void Initialize()
        {
            base.Initialize();
            step = Step.None;
            var incidentConfig = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
            var dungeonId = model.GetDungeonId(incidentConfig.dungeonId, incidentConfig.lineId);
            var config = DungeonConfig.Get(dungeonId);
            stepTimes = LitJson.JsonMapper.ToObject<int[]>(config.StepTime);
            var npcArray = LitJson.JsonMapper.ToObject<int[]>(config.RefreshNPC);
            m_BossNpcId = npcArray[0];
            m_PreciousNpcId = npcArray[1];
            m_PreciousEffectNpcId = npcArray[2];
            m_LineId = incidentConfig.lineId;
            UnloadAssets();
            BossShowModel.Instance.bossShowCompletedEvent += BossShowCompletedEvent;
            ClientCollectUtility.OnCollectFinished += OnCollectFinished;
            model.onDungeonResultEvent += OnDungeonResultEvent;
            PersonalEnemy.OnNpcAppear += OnNpcAppear;
        }
        protected override void OnUpdate()
        {
            base.OnUpdate();
            switch (step)
            {
                case Step.None:
                    break;
                case Step.Prepare:
                    break;
                case Step.Fight:
                    if (clientBoss != null && clientBoss.ActorInfo.serverDie)
                    {
                        step = Step.Collect;
                    }
                    break;
                case Step.Collect:
                    break;
                case Step.Over:
                    break;
            }
        }
        protected override void OnStageLoadFinish()
        {
            base.OnStageLoadFinish();
            StartCoroutine(Co_VerityExistBossShow());
            InitializePlayer();
        }
        private IEnumerator Co_VerityExistBossShow()
        {
            yield return WaitingForSecondConst.WaitMS500;
            if (!BossShowModel.Instance.BossShowing)
            {
                BossShowCompletedEvent();
            }
        }
        public override void UnInitialize()
        {
            base.UnInitialize();
            UnloadAssets();
            StopAllCoroutines();
            BossShowModel.Instance.bossShowCompletedEvent -= BossShowCompletedEvent;
            ClientCollectUtility.OnCollectFinished -= OnCollectFinished;
            model.onDungeonResultEvent -= OnDungeonResultEvent;
            PersonalEnemy.OnNpcAppear -= OnNpcAppear;
        }
        private void OnDungeonResultEvent()
        {
            step = Step.Over;
        }
        private void InitializePlayer()
        {
            var hero = PlayerDatas.Instance.hero;
            if (hero != null)
            {
                hero.Pos = s_PlayerPosition;
            }
        }
        private void InitializeNpc()
        {
            PersonalEnemy.Create((uint)m_BossNpcId, E_ActorGroup.Enemy, s_BossPosition);
            clientPrecious = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>((uint)m_PreciousNpcId, E_ActorGroup.FuncNpc);
            clientPrecious.Pos = s_PreciousPosition;
            clientPrecious.Rotation = Quaternion.Euler(0, s_PreciousAngle, 0);
            var npcConfig = NPCConfig.Get(m_PreciousNpcId);
            if (npcConfig.ModeProportion != 1)
            {
                clientPrecious.Root.localScale = Vector3.one * npcConfig.ModeProportion;
            }
            m_PreciousSid = clientPrecious.ServerInstID;
            npcConfig = NPCConfig.Get(m_PreciousEffectNpcId);
            m_PreciousEffect = SFXPlayUtility.Instance.PlayWithEulerAngle(npcConfig.NPCEffect, s_PreciousEffectPosition
                , new Vector3(0, s_PreciousEffectAngle, 0));
            var animator = m_PreciousEffect.GetComponentInChildren<Animator>(true);
            if (animator != null)
            {
                animator.Play(GAStaticDefine.State_IdleHash);
            }
        }
        void OnEnterPrepare()
        {
            var seconds = GetStepSeconds(Step.Prepare);
            model.UpdateCoolDown(DungeonCoolDownType.WaitStart, (uint)seconds * 1000);
            m_PrepareClock = Clock.AlarmAfter(seconds, () =>
               {
                   step = Step.Fight;
               });
            UpdateMissionData();
        }
        void OnEnterFight()
        {
            InitializeNpc();
            var seconds = GetStepSeconds(Step.Fight);
            model.UpdateCoolDown(DungeonCoolDownType.FightStart, (uint)seconds * 1000);
            m_ExitClock = Clock.AlarmAfter(seconds, OnExitDungeon);
            UpdateMissionData();
        }
        void OnExitFight()
        {
            var animator = m_PreciousEffect.GetComponentInChildren<Animator>(true);
            if (animator != null)
            {
                animator.Play(GAStaticDefine.State_DeadHash);
            }
        }
        void OnEnterCollect()
        {
            m_Indication = SFXPlayUtility.Instance.PlayWithEulerAngle(1051, s_IndicationPosition, s_IndicationAngle);
            UpdateMissionData();
        }
        void OnExitCollect()
        {
            if (m_ExitClock != null)
            {
                Clock.Stop(m_ExitClock);
                m_ExitClock = null;
            }
        }
        void OnEnterOver()
        {
            var seconds = GetStepSeconds(Step.Over);
            model.UpdateCoolDown(DungeonCoolDownType.LeaveMap, (uint)seconds * 1000);
            m_ExitClock = Clock.AlarmAfter(seconds, OnExitDungeon);
            ClientDungeonStageUtility.ClearClientDataMapSymbol();
            UpdateMissionData();
        }
        int GetStepSeconds(Step step)
        {
            switch (step)
            {
                case Step.Prepare:
                    return stepTimes != null && stepTimes.Length > 0 ? stepTimes[0] : 3;
                case Step.Fight:
                    return stepTimes != null && stepTimes.Length > 1 ? stepTimes[1] : 480;
                case Step.Collect:
                    return stepTimes != null && stepTimes.Length > 3 ? stepTimes[3] : 5;
                case Step.Over:
                    return stepTimes != null && stepTimes.Length > 2 ? stepTimes[2] : 10;
            }
            return 0;
        }
        private void UpdateMissionData()
        {
            var npcTotal = 0;
            var missionData = new DungeonMissionData()
            {
                lineID = m_LineId,
                step = (int)step < (int)Step.Collect ? 1 : 2,
                npcTotal = npcTotal,
            };
            model.UpdateFakeDungeonMission(31190, missionData);
        }
        void UnloadAssets()
        {
            if (m_Indication != null)
            {
                SFXPlayUtility.Instance.Release(m_Indication);
                m_Indication = null;
            }
            if (m_PrepareClock != null)
            {
                Clock.Stop(m_PrepareClock);
                m_PrepareClock = null;
            }
            if (clientBoss != null)
            {
                clientBoss = null;
            }
            if (clientPrecious != null)
            {
                GAMgr.Instance.ServerDie(clientPrecious.ServerInstID);
                GAMgr.Instance.Release(clientPrecious);
                clientPrecious = null;
            }
            if (m_PreciousEffect != null)
            {
                SFXPlayUtility.Instance.Release(m_PreciousEffect);
                m_PreciousEffect = null;
            }
            if (m_ExitClock != null)
            {
                Clock.Stop(m_ExitClock);
                m_ExitClock = null;
            }
        }
        void OnExitDungeon()
        {
            ClientDungeonStageUtility.ExitNormalClientDungeon();
        }
        private void BossShowCompletedEvent()
        {
            step = Step.Prepare;
        }
        private void OnCollectFinished(uint sid)
        {
            if (sid == m_PreciousSid)
            {
                ClientSceneManager.Instance.lastDeadPos = s_PreciousPosition;
                var pak = new CA234_tagCMGetCustomSceneCollectAward();
                pak.NPCID = (uint)m_PreciousNpcId;
                GameNetSystem.Instance.SendInfo(pak);
            }
        }
        private void OnNpcAppear(GA_NpcClientFightNorm _npc)
        {
            if (_npc != null && _npc is GA_NpcClientFightBoss)
            {
                clientBoss = _npc as GA_NpcClientFightBoss;
            }
        }
        public enum Step
        {
            None,
            Prepare,
            Fight,
            Collect,
            Over,
        }
    }
}
Fight/Stage/Dungeon/ClientHazyPreciousDungeonStage.cs.meta
Fight/Stage/Dungeon/ClientPersonalBossDungeonStage.cs
New file
@@ -0,0 +1,190 @@
using Snxxz.UI;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ClientPersonalBossDungeonStage : DungeonStage
{
    static readonly Vector3 s_PlayerPosition = new Vector3(16.19f, 0.825f, 7.62f);
    static readonly Vector3 s_NpcPosition = new Vector3(11.9f, 0.825f, 9.64f);
    static readonly float s_PlayerAngle = -70.925f;
    static int[] s_StepTimes = null;
    static Clock s_StepClock = null;
    Step m_Step = Step.None;
    public Step step
    {
        get { return m_Step; }
        set
        {
            if (m_Step != value)
            {
                switch (m_Step)
                {
                    case Step.Prepare:
                        OnExitPrepare();
                        break;
                    case Step.Fight:
                        OnExitFight();
                        break;
                }
                m_Step = value;
                switch (m_Step)
                {
                    case Step.Prepare:
                        OnEnterPrepare();
                        break;
                    case Step.Fight:
                        OnEnterFight();
                        break;
                    case Step.Over:
                        OnEnterOver();
                        break;
                }
            }
        }
    }
    static PersonalBossModel model { get { return ModelCenter.Instance.GetModel<PersonalBossModel>(); } }
    static DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
    public override void Initialize()
    {
        base.Initialize();
        step = Step.None;
        var config = PersonalBossConfig.Get(model.clientBossNpcId);
        if (config != null)
        {
            var dungeonId = dungeonModel.GetDungeonId(PersonalBossModel.PERSONALBOSS_MAPID, config.lineId);
            var dungeonConfig = DungeonConfig.Get(dungeonId);
            if (dungeonConfig != null)
            {
                s_StepTimes = LitJson.JsonMapper.ToObject<int[]>(dungeonConfig.StepTime);
            }
        }
        dungeonModel.onDungeonResultEvent += OnDungeonResultEvent;
    }
    protected override void OnStageLoadFinish()
    {
        base.OnStageLoadFinish();
        InitializePlayer();
        step = Step.Prepare;
    }
    void InitializePlayer()
    {
        var hero = PlayerDatas.Instance.hero;
        if (hero != null)
        {
            hero.Pos = s_PlayerPosition;
            hero.Rotation = Quaternion.Euler(0, s_PlayerAngle, 0);
        }
        CameraController.Instance.Apply();
    }
    void OnEnterPrepare()
    {
        var seconds = s_StepTimes[0];
        dungeonModel.UpdateCoolDown(DungeonCoolDownType.WaitStart, (uint)seconds * 1000);
        s_StepClock = Clock.AlarmAfter(seconds, () =>
          {
              step = Step.Fight;
          });
    }
    void OnExitPrepare()
    {
        if (s_StepClock != null)
        {
            Clock.Stop(s_StepClock);
            s_StepClock = null;
        }
    }
    void OnEnterFight()
    {
        InitializeNpc();
        var seconds = s_StepTimes[1];
        dungeonModel.UpdateCoolDown(DungeonCoolDownType.FightStart, (uint)seconds * 1000);
        s_StepClock = Clock.AlarmAfter(seconds, () =>
        {
            ClientDungeonStageUtility.ExitNormalClientDungeon();
        });
    }
    private void OnExitFight()
    {
        if (s_StepClock != null)
        {
            Clock.Stop(s_StepClock);
            s_StepClock = null;
        }
    }
    private void OnEnterOver()
    {
        ClientDungeonStageUtility.ClearClientDataMapSymbol();
        var seconds = s_StepTimes[2];
        dungeonModel.UpdateCoolDown(DungeonCoolDownType.LeaveMap, (uint)seconds * 1000);
        s_StepClock = Clock.AlarmAfter(seconds, () =>
        {
            ClientDungeonStageUtility.ExitNormalClientDungeon();
        });
    }
    void InitializeNpc()
    {
        PersonalEnemy.Create((uint)model.clientBossNpcId, E_ActorGroup.Enemy, s_NpcPosition);
    }
    private void OnDungeonResultEvent()
    {
        step = Step.Over;
    }
    public override void UnInitialize()
    {
        base.UnInitialize();
        dungeonModel.onDungeonResultEvent -= OnDungeonResultEvent;
        if (s_StepClock != null)
        {
            Clock.Stop(s_StepClock);
            s_StepClock = null;
        }
    }
#if UNITY_EDITOR
    private void OnGUI()
    {
        if (GUILayout.Button("Exit"))
        {
            ClientDungeonStageUtility.ExitNormalClientDungeon();
        }
    }
#endif
    public enum Step
    {
        None,
        Prepare,
        Fight,
        Over,
    }
}
Fight/Stage/Dungeon/ClientPersonalBossDungeonStage.cs.meta
copy from System/Treasure/ClientTreasureDungeon.cs.meta copy to Fight/Stage/Dungeon/ClientPersonalBossDungeonStage.cs.meta
File was copied from System/Treasure/ClientTreasureDungeon.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 189ce34976654c34da06b3239c45076d
timeCreated: 1556000158
guid: e0fe6b75e8e6ea3439251f799ba2d591
timeCreated: 1558427783
licenseType: Pro
MonoImporter:
  serializedVersion: 2
Fight/Stage/Dungeon/DungeonStage.cs
@@ -236,14 +236,14 @@
                    WindowCenter.Instance.Open<ElderGodAngerWin>();
                }
                break;
            case ClientTreasureDungeon.Client_DataMap:
            case 4000:
            case TreasureModel.TREASURE_MAPID:
                WindowCenter.Instance.Open<TreasureDungeonMissionHintWin>();
                break;
            case DemonJarModel.DEMONJAR_MAPID:
            case 31140:
            case JadeDynastyBossModel.JADEDYNASTY_MAP:
            case HazyDemonKingModel.Client_MapID:
            case HazyDemonKingModel.CLIENTDATAMAP:
            case HazyDemonKingModel.DEMONKINGMAPID1:
            case HazyDemonKingModel.DEMONKINGMAPID2:
                WindowCenter.Instance.Open<DungeonPickUpItemCoolDownWin>();
@@ -263,7 +263,8 @@
            case RidingPetBossModel.RIDINGPETBOSS_MAP:
                WindowCenter.Instance.Open<RidingPetBossHintWin>();
                break;
            case HazyGrassModel.Client_ReikiGrassMapID:
            case HazyGrassModel.REIKI_CLIENTDATAMAP:
            case HazyGrassModel.FAIRY_CLIENTDATAMAP:
            case HazyGrassModel.FairyGrassMapId:
            case HazyGrassModel.ReikiGrassMapId:
                WindowCenter.Instance.Close<DungeonEndCoolDownWin>();
Fight/Stage/Dungeon/HazyPreciousDungeonStage.cs
File was deleted
Fight/Stage/StageLoadProcessor.cs
@@ -403,18 +403,21 @@
                    stage = stageGameObject.AddComponent<FakeDemonJarDungeonStage>();
                    break;
                case 31190:
                    stage = stageGameObject.AddComponent<HazyPreciousDungeonStage>();
                    stage = stageGameObject.AddComponent<ClientHazyPreciousDungeonStage>();
                    break;
                case HazyDemonKingModel.Client_MapID:
                case HazyDemonKingModel.CLIENTDATAMAP:
                    stage = stageGameObject.AddComponent<ClientHazyDemonKingStage>();
                    break;
                case HazyGrassModel.Client_FairyGrassMapID:
                case HazyGrassModel.Client_ReikiGrassMapID:
                case HazyGrassModel.FAIRY_CLIENTDATAMAP:
                case HazyGrassModel.REIKI_CLIENTDATAMAP:
                    stage = stageGameObject.AddComponent<ClientHazyGrassStage>();
                    break;
                case ClientTreasureDungeon.Client_DataMap:
                case 4000:
                    stage = stageGameObject.AddComponent<ClientTreasureDungeonStage>();
                    break;
                case PersonalBossModel.PERSONALBOSS_MAPID:
                    stage = stageGameObject.AddComponent<ClientPersonalBossDungeonStage>();
                    break;
                default:
                    stage = stageGameObject.AddComponent<DungeonStage>();
                    break;
Lua/Gen/PersonalBossConfigWrap.cs
@@ -26,7 +26,6 @@
            
            
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "NPCID", _g_get_NPCID);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "ChanllengeLv", _g_get_ChanllengeLv);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "MustItemID", _g_get_MustItemID);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "RareItemID", _g_get_RareItemID);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "PortraitID", _g_get_PortraitID);
@@ -285,20 +284,6 @@
            
                PersonalBossConfig gen_to_be_invoked = (PersonalBossConfig)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.NPCID);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_ChanllengeLv(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                PersonalBossConfig gen_to_be_invoked = (PersonalBossConfig)translator.FastGetCSObj(L, 1);
                LuaAPI.xlua_pushinteger(L, gen_to_be_invoked.ChanllengeLv);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
Lua/Gen/SnxxzUIHazyDemonKingModelWrap.cs
@@ -38,7 +38,6 @@
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestExitDungeon", _m_RequestExitDungeon);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "ReceivePackage", _m_ReceivePackage);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestEnterClientDungeon", _m_RequestEnterClientDungeon);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestExitClientDungeon", _m_RequestExitClientDungeon);
            
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "onPlayerInfoRefresh", _e_onPlayerInfoRefresh);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "onPlayerCountRefresh", _e_onPlayerCountRefresh);
@@ -54,7 +53,7 @@
            Utils.BeginClassRegister(type, L, __CreateInstance, 4, 0, 0);
            
            
            Utils.RegisterObject(L, translator, Utils.CLS_IDX, "Client_MapID", Snxxz.UI.HazyDemonKingModel.Client_MapID);
            Utils.RegisterObject(L, translator, Utils.CLS_IDX, "Client_MapID", Snxxz.UI.HazyDemonKingModel.CLIENTDATAMAP);
            Utils.RegisterObject(L, translator, Utils.CLS_IDX, "DEMONKINGMAPID1", Snxxz.UI.HazyDemonKingModel.DEMONKINGMAPID1);
            Utils.RegisterObject(L, translator, Utils.CLS_IDX, "DEMONKINGMAPID2", Snxxz.UI.HazyDemonKingModel.DEMONKINGMAPID2);
            
@@ -515,35 +514,6 @@
            }
            
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_RequestExitClientDungeon(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                Snxxz.UI.HazyDemonKingModel gen_to_be_invoked = (Snxxz.UI.HazyDemonKingModel)translator.FastGetCSObj(L, 1);
                {
                    gen_to_be_invoked.RequestExitClientDungeon(  );
                    return 0;
                }
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
        }
        
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
Lua/Gen/SnxxzUIHazyGrassModelWrap.cs
@@ -30,21 +30,16 @@
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "IsInGrassDungeon", _m_IsInGrassDungeon);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetClientMapId", _m_GetClientMapId);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetGrassMapId", _m_GetGrassMapId);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetGrassNpcInfos", _m_GetGrassNpcInfos);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "GetMapNpcCount", _m_GetMapNpcCount);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "CanCollectClientNpc", _m_CanCollectClientNpc);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "DisplayCollectErrorTip", _m_DisplayCollectErrorTip);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "ReceivePackage", _m_ReceivePackage);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "RefreshMapNpcCount", _m_RefreshMapNpcCount);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestEnterClientDungeon", _m_RequestEnterClientDungeon);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "RequestExitClientDungeon", _m_RequestExitClientDungeon);
            
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "onMapNpcCountRefresh", _e_onMapNpcCountRefresh);
            Utils.RegisterFunc(L, Utils.METHOD_IDX, "dugeonTargetStateRefresh", _e_dugeonTargetStateRefresh);
            
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "IsInDungeon", _g_get_IsInDungeon);
            Utils.RegisterFunc(L, Utils.GETTER_IDX, "IsDungeonTargetDone", _g_get_IsDungeonTargetDone);
            
            
            Utils.EndObjectRegister(type, L, translator, null, null,
@@ -55,8 +50,8 @@
            
            Utils.RegisterObject(L, translator, Utils.CLS_IDX, "ReikiGrassMapId", Snxxz.UI.HazyGrassModel.ReikiGrassMapId);
            Utils.RegisterObject(L, translator, Utils.CLS_IDX, "FairyGrassMapId", Snxxz.UI.HazyGrassModel.FairyGrassMapId);
            Utils.RegisterObject(L, translator, Utils.CLS_IDX, "Client_ReikiGrassMapID", Snxxz.UI.HazyGrassModel.Client_ReikiGrassMapID);
            Utils.RegisterObject(L, translator, Utils.CLS_IDX, "Client_FairyGrassMapID", Snxxz.UI.HazyGrassModel.Client_FairyGrassMapID);
            Utils.RegisterObject(L, translator, Utils.CLS_IDX, "Client_ReikiGrassMapID", Snxxz.UI.HazyGrassModel.REIKI_CLIENTDATAMAP);
            Utils.RegisterObject(L, translator, Utils.CLS_IDX, "Client_FairyGrassMapID", Snxxz.UI.HazyGrassModel.FAIRY_CLIENTDATAMAP);
            
            
            
@@ -290,35 +285,6 @@
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetGrassNpcInfos(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                Snxxz.UI.HazyGrassModel gen_to_be_invoked = (Snxxz.UI.HazyGrassModel)translator.FastGetCSObj(L, 1);
                {
                    int _mapId = LuaAPI.xlua_tointeger(L, 2);
                        System.Collections.Generic.List<Snxxz.UI.HazyGrassNpcInfo> gen_ret = gen_to_be_invoked.GetGrassNpcInfos( _mapId );
                        translator.Push(L, gen_ret);
                    return 1;
                }
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_GetMapNpcCount(RealStatePtr L)
        {
            try {
@@ -487,35 +453,6 @@
            
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _m_RequestExitClientDungeon(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                Snxxz.UI.HazyGrassModel gen_to_be_invoked = (Snxxz.UI.HazyGrassModel)translator.FastGetCSObj(L, 1);
                {
                    gen_to_be_invoked.RequestExitClientDungeon(  );
                    return 0;
                }
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_IsInDungeon(RealStatePtr L)
@@ -531,24 +468,6 @@
            return 1;
        }
        
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _g_get_IsDungeonTargetDone(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                Snxxz.UI.HazyGrassModel gen_to_be_invoked = (Snxxz.UI.HazyGrassModel)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushboolean(L, gen_to_be_invoked.IsDungeonTargetDone);
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            return 1;
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _e_onMapNpcCountRefresh(RealStatePtr L)
        {
@@ -582,42 +501,5 @@
            LuaAPI.luaL_error(L, "invalid arguments to Snxxz.UI.HazyGrassModel.onMapNpcCountRefresh!");
            return 0;
        }
        [MonoPInvokeCallbackAttribute(typeof(LuaCSFunction))]
        static int _e_dugeonTargetStateRefresh(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
                int gen_param_count = LuaAPI.lua_gettop(L);
            Snxxz.UI.HazyGrassModel gen_to_be_invoked = (Snxxz.UI.HazyGrassModel)translator.FastGetCSObj(L, 1);
                System.Action gen_delegate = translator.GetDelegate<System.Action>(L, 3);
                if (gen_delegate == null) {
                    return LuaAPI.luaL_error(L, "#3 need System.Action!");
                }
                if (gen_param_count == 3)
                {
                    if (LuaAPI.xlua_is_eq_str(L, 2, "+")) {
                        gen_to_be_invoked.dugeonTargetStateRefresh += gen_delegate;
                        return 0;
                    }
                    if (LuaAPI.xlua_is_eq_str(L, 2, "-")) {
                        gen_to_be_invoked.dugeonTargetStateRefresh -= gen_delegate;
                        return 0;
                    }
                }
            } catch(System.Exception gen_e) {
                return LuaAPI.luaL_error(L, "c# exception:" + gen_e);
            }
            LuaAPI.luaL_error(L, "invalid arguments to Snxxz.UI.HazyGrassModel.dugeonTargetStateRefresh!");
            return 0;
        }
    }
}
System/Dungeon/DemonTreasureDungeonVictoryWin.cs
@@ -18,6 +18,8 @@
        [SerializeField] Button m_ChallengeNextLevel;
        [SerializeField] Text m_ChallengeNextTimer;
        bool satisfyChallengeNext = false;
        TreasureModel model
        {
            get { return ModelCenter.Instance.GetModel<TreasureModel>(); }
@@ -31,16 +33,30 @@
        protected override void Display()
        {
            satisfyChallengeNext = SatisfyChallengeNext();
            m_ChallengeNextLevel.gameObject.SetActive(satisfyChallengeNext);
            m_ContainerPoivt.gameObject.SetActive(true);
            base.DrawPassTime();
            base.RequireDungeonExit();
            DisplayDemonTreasureProperty();
        }
        protected override void DrawExitTimer(int seconds)
        {
            m_ExitTimer.text = Language.Get("DemonDungeonExit");
            m_ChallengeNextTimer.text = Language.Get("RuneDungeonVictory_Btn_Next_1", Mathf.Clamp(seconds, 0, int.MaxValue));
            if (satisfyChallengeNext)
            {
                m_ChallengeNextTimer.text = Language.Get("RuneDungeonVictory_Btn_Next_1", Mathf.Clamp(seconds, 0, int.MaxValue));
                m_ExitTimer.text = Language.Get("DemonDungeonExit");
            }
            else
            {
                m_ExitTimer.text = Language.Get("DungeonVictoryWin_Btn_Exit_1", Mathf.Clamp(seconds, 0, int.MaxValue));
                m_ChallengeNextTimer.text = Language.Get("DemonDungeonChallengeNext");
            }
        }
        private void DisplayDemonTreasureProperty()
@@ -71,7 +87,7 @@
            }
        }
        private void ChallengeNext()
        private bool SatisfyChallengeNext()
        {
            TreasureDungeon treasureDungeon;
            var result = dungeonModel.dungeonResult;
@@ -82,28 +98,29 @@
                {
                    if (PlayerDatas.Instance.baseData.FightPoint >= dungeonInfo.fightPower)
                    {
                        model.DemonDungeonChallengeNext(result.lineID);
                        return true;
                    }
                    else
                    if (UIHelper.GetPropertyValue(PropertyType.DEF) >= dungeonInfo.defense)
                    {
                        ConfirmCancel.ShowRuneTowerPopConfirm(
                             Language.Get("DemonLackPowerTitle"),
                             Language.Get("DemonLackFightPower", dungeonInfo.fightPower),
                             (bool ok) =>
                             {
                                 if (ok)
                                 {
                                     model.DemonDungeonChallengeNext(result.lineID);
                                 }
                                 else
                                 {
                                     dungeonModel.ExitCurrentDungeon();
                                 }
                             }
                             );
                        return true;
                    }
                }
            }
            return false;
        }
        private void ChallengeNext()
        {
            TreasureDungeon treasureDungeon;
            var result = dungeonModel.dungeonResult;
            if (model.TryGetTreasureDungeon(41110, result.lineID, out treasureDungeon))
            {
                var dungeonInfo = treasureDungeon.Get(result.wheel + 1);
                if (!dungeonInfo.Equals(default(TreasureDungeonInfo)))
                {
                    model.DemonDungeonChallengeNext(result.lineID);
                }
            }
        }
    }
System/Dungeon/DungeonFightWin.cs
@@ -81,7 +81,8 @@
            var dataMapId = model.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
            m_ExitDungeon.gameObject.SetActive(dataMapId != DemonJarModel.DEMONJAR_MAPID
                && !CrossServerUtility.IsCrossServerOneVsOne()
                && !hazyDemonKingModel.IsInDungeon);
                && !hazyDemonKingModel.IsInDungeon
                && !hazyGrassModel.IsInDungeon);
            m_ContainerAncient.gameObject.SetActive(dataMapId == 31160);
            m_BossInfosContainer.gameObject.SetActive(
                dataMapId == ElderGodAreaModel.ELDERGODAREA_MAPID
@@ -270,27 +271,6 @@
                language = Language.Get(config.ExitDescription);
            }
            if (dataMapId == HazyGrassModel.FairyGrassMapId ||
                dataMapId == HazyGrassModel.ReikiGrassMapId
                || dataMapId == HazyGrassModel.Client_ReikiGrassMapID)
            {
                if (hazyGrassModel.IsDungeonTargetDone)
                {
                    switch (dataMapId)
                    {
                        case HazyGrassModel.FairyGrassMapId:
                        case HazyGrassModel.ReikiGrassMapId:
                            var crossServerBossModel = ModelCenter.Instance.GetModel<CrossServerBossModel>();
                            crossServerBossModel.RequestExit();
                            break;
                        case HazyGrassModel.Client_ReikiGrassMapID:
                            ModelCenter.Instance.GetModel<HazyGrassModel>().RequestExitClientDungeon();
                            break;
                    }
                    return;
                }
            }
            ConfirmCancel.ShowPopConfirm(
                Language.Get("Mail101"),
                language,
@@ -301,21 +281,13 @@
                        switch (dataMapId)
                        {
                            case CrossServerBossModel.DATA_MAPID:
                            case HazyGrassModel.FairyGrassMapId:
                            case HazyGrassModel.ReikiGrassMapId:
                            case HazyDemonKingModel.DEMONKINGMAPID2:
                                var crossServerBossModel = ModelCenter.Instance.GetModel<CrossServerBossModel>();
                                crossServerBossModel.RequestExit();
                                break;
                            case HazyDemonKingModel.Client_MapID:
                                ModelCenter.Instance.GetModel<HazyDemonKingModel>().RequestExitClientDungeon();
                                break;
                            case HazyGrassModel.Client_FairyGrassMapID:
                            case HazyGrassModel.Client_ReikiGrassMapID:
                                ModelCenter.Instance.GetModel<HazyGrassModel>().RequestExitClientDungeon();
                                break;
                            case ClientTreasureDungeon.Client_DataMap:
                                ClientTreasureDungeon.RequestExit();
                            case 4000:
                            case HazyRegionModel.PRECIOUS_CLIENTDATAMAP:
                            case PersonalBossModel.PERSONALBOSS_MAPID:
                                ClientDungeonStageUtility.ExitNormalClientDungeon();
                                break;
                            default:
                                model.ExitCurrentDungeon();
@@ -395,8 +367,11 @@
            {
                switch (ClientDungeonStageUtility.clientMapId)
                {
                    case ClientTreasureDungeon.Client_DataMap:
                        ClientTreasureDungeon.RequestExit();
                    case 4000:
                    case HazyGrassModel.FAIRY_CLIENTDATAMAP:
                    case HazyGrassModel.REIKI_CLIENTDATAMAP:
                    case PersonalBossModel.PERSONALBOSS_MAPID:
                        ClientDungeonStageUtility.ExitNormalClientDungeon();
                        break;
                }
                return;
@@ -413,39 +388,23 @@
                    if (treasureModel.TryGetTreasureDungeon(41110, model.dungeonResult.lineID, out treasureDungeon)
                        && model.dungeonResult.isPass == 1)
                    {
                        if (!RuneTowerConfirmWin.waitConfirm)
                        var dungeonInfo = treasureDungeon.Get(model.dungeonResult.wheel + 1);
                        if (!dungeonInfo.Equals(default(TreasureDungeonInfo)))
                        {
                            var dungeonInfo = treasureDungeon.Get(model.dungeonResult.wheel + 1);
                            if (!dungeonInfo.Equals(default(TreasureDungeonInfo)))
                            if (PlayerDatas.Instance.baseData.FightPoint >= dungeonInfo.fightPower
                                || UIHelper.GetPropertyValue(PropertyType.DEF) >= dungeonInfo.defense)
                            {
                                if (PlayerDatas.Instance.baseData.FightPoint >= dungeonInfo.fightPower)
                                {
                                    treasureModel.DemonDungeonChallengeNext(model.dungeonResult.lineID);
                                }
                                else
                                {
                                    ConfirmCancel.ShowRuneTowerPopConfirm(
                                            Language.Get("DemonLackPowerTitle"),
                                            Language.Get("DemonLackFightPower", dungeonInfo.fightPower),
                                            (bool ok) =>
                                            {
                                                if (ok)
                                                {
                                                    treasureModel.DemonDungeonChallengeNext(model.dungeonResult.lineID);
                                                }
                                                else
                                                {
                                                    model.ExitCurrentDungeon();
                                                }
                                            }
                                            );
                                }
                                treasureModel.DemonDungeonChallengeNext(model.dungeonResult.lineID);
                            }
                            else
                            {
                                model.ExitCurrentDungeon();
                            }
                        }
                        else
                        {
                            model.ExitCurrentDungeon();
                        }
                    }
                    else
                    {
System/Dungeon/DungeonGetTreasureVictoryWin.cs
@@ -15,7 +15,7 @@
        {
            if (ClientDungeonStageUtility.isClientDungeon)
            {
                ClientTreasureDungeon.RequestExit();
                ClientDungeonStageUtility.ExitNormalClientDungeon();
            }
            else
            {
System/Dungeon/DungeonModel.cs
@@ -961,6 +961,12 @@
                        WindowCenter.Instance.Open<JadeDynastyDamageRankWin>();
                    }
                    break;
                case 31190:
                    if (!WindowCenter.Instance.IsOpen<DungeonMissionDetailsWin>())
                    {
                        WindowCenter.Instance.Open<DungeonMissionDetailsWin>();
                    }
                    break;
            }
            if (updateMissionEvent != null)
@@ -1110,7 +1116,7 @@
                            break;
                        case 22030:
                        case 32030:
                        case HazyDemonKingModel.Client_MapID:
                        case HazyDemonKingModel.CLIENTDATAMAP:
                            WindowCenter.Instance.Open<HazyDemonKingVictoryWin>();
                            break;
                        default:
System/Dungeon/DungeonSuppliesLackWin.cs
@@ -31,6 +31,7 @@
        DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
        PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
        ComposeWinModel composeModel { get { return ModelCenter.Instance.GetModel<ComposeWinModel>(); } }
        PersonalBossModel personalBossModel { get { return ModelCenter.Instance.GetModel<PersonalBossModel>(); } }
        #region Built-in
        protected override void BindController()
@@ -243,6 +244,8 @@
            switch (_lackType)
            {
                case LackType.PersonalBoss:
                    personalBossModel.RequestGotoDungeon(personalBossModel.selectedBoss);
                    break;
                case LackType.ElderGodArea:
                    dungeonModel.SingleChallenge(GetDungeon(_lackType));
                    break;
System/Dungeon/DungeonVictoryWin.cs
@@ -151,6 +151,19 @@
        protected virtual void ExitDungeon()
        {
            if (ClientDungeonStageUtility.isClientDungeon)
            {
                switch (ClientDungeonStageUtility.clientMapId)
                {
                    case HazyDemonKingModel.CLIENTDATAMAP:
                    case HazyGrassModel.REIKI_CLIENTDATAMAP:
                    case HazyGrassModel.FAIRY_CLIENTDATAMAP:
                    case HazyRegionModel.PRECIOUS_CLIENTDATAMAP:
                    case PersonalBossModel.PERSONALBOSS_MAPID:
                        ClientDungeonStageUtility.ExitNormalClientDungeon();
                        return;
                }
            }
            dungeonModel.ExitCurrentDungeon();
        }
System/Dungeon/TreasureDungeonMissionHintWin.cs
@@ -53,9 +53,9 @@
            model.demonDungeonChallengeNext += ChallengeNextEvent;
            if (ClientDungeonStageUtility.isClientDungeon
                && ClientDungeonStageUtility.clientMapId == ClientTreasureDungeon.Client_DataMap)
                && ClientDungeonStageUtility.clientMapId == 4000)
            {
                treasureId = ClientTreasureDungeon.challengeTreasureId;
                treasureId = 101;
            }
            else
            {
@@ -161,7 +161,7 @@
            var dungeonId = 0;
            if (ClientDungeonStageUtility.isClientDungeon)
            {
                dungeonId = dungeonModel.GetDungeonId(ClientTreasureDungeon.Client_DataMap, 0);
                dungeonId = dungeonModel.GetDungeonId(4000, 0);
            }
            else
            {
System/FindPrecious/PersonalBossModel.cs
@@ -32,6 +32,18 @@
            }
        }
        public int clientBossNpcId
        {
            get
            {
                return LocalSave.GetInt("PersonalBossClient_" + PlayerDatas.Instance.PlayerId);
            }
            private set
            {
                LocalSave.SetInt("PersonalBossClient_" + PlayerDatas.Instance.PlayerId, value);
            }
        }
        public event Action<int> bossSelectedEvent;
        List<int> sortedBossIds = new List<int>();
        Dictionary<int, PersonalBossData> personalBosses = new Dictionary<int, PersonalBossData>();
@@ -159,7 +171,12 @@
            {
                var config = bossConfigs[i];
                var bossData = personalBosses[config.NPCID] = new PersonalBossData(config.NPCID);
                bossData.challengableLevel = config.ChanllengeLv;
                var dungeonId = dungeonModel.GetDungeonId(PERSONALBOSS_MAPID, config.lineId);
                var dungeonConfig = DungeonConfig.Get(dungeonId);
                if (dungeonConfig != null)
                {
                    bossData.challengableLevel = dungeonConfig.LVLimitMin;
                }
            }
            sortedBossIds.AddRange(personalBosses.Keys);
@@ -170,27 +187,35 @@
                return PersonalBossData.ChallengableLevelCompare(data1, data2);
            });
            var dungeonId = dungeonModel.GetDungeonId(PERSONALBOSS_MAPID, 0);
            var dungeonConfig = DungeonConfig.Get(dungeonId);
            dungeonTicket = dungeonConfig == null ? 0 : dungeonConfig.TicketID;
            {
                var dungeonId = dungeonModel.GetDungeonId(PERSONALBOSS_MAPID, 0);
                var dungeonConfig = DungeonConfig.Get(dungeonId);
                dungeonTicket = dungeonConfig == null ? 0 : dungeonConfig.TicketID;
            }
        }
        public void RequestGotoDungeon(int _bossId)
        {
            var config = PersonalBossConfig.Get(_bossId);
            clientBossNpcId = _bossId;
            ClientDungeonStageUtility.GotoNormalClientDungeon(PERSONALBOSS_MAPID, PERSONALBOSS_MAPID, config.lineId);
        }
        public void OnMapInitOk()
        {
            var dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>();
            var dataMapId = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
            switch (dataMapId)
            {
                case PERSONALBOSS_MAPID:
                    var sendInfo = new CA508_tagCMDoFBAction();
                    sendInfo.ActionType = 0;
                    sendInfo.ActionInfo = (uint)selectedBoss;
                    GameNetSystem.Instance.SendInfo(sendInfo);
                    MapTransferUtility.Instance.MoveToNPC(selectedBoss);
                    break;
            }
            //var dungeonModel = ModelCenter.Instance.GetModel<DungeonModel>();
            //var dataMapId = dungeonModel.GetDataMapIdByMapId(PlayerDatas.Instance.baseData.MapID);
            //
            //switch (dataMapId)
            //{
            //    case PERSONALBOSS_MAPID:
            //        var sendInfo = new CA508_tagCMDoFBAction();
            //        sendInfo.ActionType = 0;
            //        sendInfo.ActionInfo = (uint)selectedBoss;
            //        GameNetSystem.Instance.SendInfo(sendInfo);
            //        MapTransferUtility.Instance.MoveToNPC(selectedBoss);
            //        break;
            //}
        }
    }
System/FindPrecious/PersonalBossWin.cs
@@ -98,7 +98,9 @@
                        break;
                    case 3:
                        var config = PersonalBossConfig.Get(model.selectedBoss);
                        SysNotifyMgr.Instance.ShowTip("PersonalBoss_LevelLimit", config.ChanllengeLv);
                        var dungeonId = dungeonModel.GetDungeonId(PersonalBossModel.PERSONALBOSS_MAPID, config.lineId);
                        var dungeonConfig = DungeonConfig.Get(dungeonId);
                        SysNotifyMgr.Instance.ShowTip("PersonalBoss_LevelLimit", dungeonConfig.LVLimitMin);
                        break;
                    case 4:
                        SysNotifyMgr.Instance.ShowTip("DungeonNoGO");
System/GeneralConfig/GeneralDefine.cs
@@ -193,6 +193,7 @@
    public static Dictionary<int, float> AtkTypeIncreasePushDis = new Dictionary<int, float>();
    public static Dictionary<int, CameraController.LookAtData> NpcDieSetCamera = new Dictionary<int, CameraController.LookAtData>();
    public static int BlueEquipJumpLevel { get; private set; }
    public static int[] defenseGetWays { get; private set; }
    public static void Init()
    {
@@ -789,6 +790,8 @@
                    NpcDieSetCamera[(int)_child[0]] = _lookAtData;
                }
            }
            defenseGetWays = GetIntArray("DefenseGetWays", 1);
        }
        catch (Exception ex)
        {
System/HazyRegion/ClientHazyDemonKingStage.cs
@@ -1,9 +1,9 @@
using Snxxz.UI;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ClientHazyDemonKingStage : DungeonStage
{
    static readonly Vector3 playerBornPosition = new Vector3(10, 6.38f, 6.67f);
@@ -11,21 +11,12 @@
    static GA_NpcClientFightBoss clientFightBoss = null;
    float totalTime = 20f;
    float timer = 0f;
    DateTime playerAtkTime = DateTime.Now;
    Clock pickItemClock = null;
    float stepTimer = 0f;
    float existTime = 10f;
    bool pickAllDropItem = false;
    int itemCount = 0;
    Step m_Step = Step.Fight;
    Step step
    public Step step
    {
        get { return m_Step; }
        set
@@ -37,9 +28,6 @@
                {
                    case Step.Fight:
                        stepTimer = 0f;
                        break;
                    case Step.PickItem:
                        stepTimer = 5f;
                        break;
                    case Step.Settle:
                        stepTimer = 0f;
@@ -60,17 +48,10 @@
    {
        base.Initialize();
        timer = 0f;
        playerAtkTime = DateTime.MinValue;
        m_Step = Step.None;
        pickAllDropItem = false;
        itemCount = 0;
        DTC0403_tagPlayerLoginLoadOK.mapInitOkEvent += OnReconnected;
        AttackHandler.OnAttackTarget += OnPlayerAttack;
        ClientDungeonStageUtility.onReceiveCustomDropItme += OnReceiveCustomDropItme;
        dungeonModel.onDungeonResultEvent += OnDungeonResultEvent;
        ClientDropItemUtility.OnItemPickup += OnItemPickup;
        dungeonModel.onDungeonResultEvent += OnDungeonResultEvent;
        PersonalEnemy.OnNpcAppear += OnNpcAppear;
    }
    protected override void OnStageLoadFinish()
@@ -103,107 +84,36 @@
        CameraController.Instance.Apply();
    }
    void InitializeBoss()
    {
        if (clientFightBoss != null)
        {
            clientFightBoss.ActorInfo.serverDie = true;
            GAMgr.Instance.ServerDie(clientFightBoss.ServerInstID);
            GAMgr.Instance.Release(clientFightBoss);
            clientFightBoss = null;
        }
        var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
        var npcId = NPCConfig.Get(config.npcId);
        clientFightBoss = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightBoss>((uint)config.npcId, E_ActorGroup.Enemy);
        clientFightBoss.Pos = bossBornPosition;
        clientFightBoss.LockTargetSID = PlayerDatas.Instance.PlayerId;
    }
    private void OnPlayerAttack(uint _attackerId, uint _victimId, byte _type, uint _damage)
    {
        if (clientFightBoss == null)
        {
            return;
        }
        if (_victimId == clientFightBoss.ServerInstID)
        {
            var progress = Mathf.Clamp01(1 - timer / totalTime);
            var hp = (ulong)(clientFightBoss.ActorInfo.RealMaxHp * progress);
            TargetBriefInfo.OnRefreshBossLifeBar(_victimId, clientFightBoss.NpcConfig.NPCID,
                hp, clientFightBoss.ActorInfo.RealMaxHp);
            playerAtkTime = DateTime.Now;
        }
    }
    private void OnReceiveCustomDropItme(HB214_tagMCCuntomFBPrizeInfo package)
    {
        step = Step.PickItem;
        if (package.PrizeItemCount <= 0)
        {
            pickAllDropItem = true;
        }
        else
        {
            itemCount = package.PrizeItemCount;
            int[] items = new int[itemCount];
            for (int i = 0; i < itemCount; i++)
            {
                items[i] = (int)package.PrizeItemIDList[i];
            }
            ClientDropItemUtility.Instance.Drop(bossBornPosition, items);
            dungeonModel.UpdateCoolDown(DungeonCoolDownType.PickUpTime, 30 * 1000);
            if (pickItemClock != null)
            {
                Clock.Stop(pickItemClock);
                pickItemClock = null;
            }
            pickItemClock = Clock.AlarmAfter(30, OnPickUpItemLimit);
        }
    }
    void OnPickUpItemLimit()
    {
        pickAllDropItem = true;
    }
    private void OnItemPickup(int itemId)
    {
        itemCount--;
        if (itemCount == 0)
        {
            pickAllDropItem = true;
        }
        PersonalEnemy.Create((uint)config.npcId, E_ActorGroup.Enemy, bossBornPosition);
    }
    private void OnDungeonResultEvent()
    {
        step = Step.Settle;
        ClientDungeonStageUtility.ClearClientDataMapSymbol();
        dungeonModel.UpdateCoolDown(DungeonCoolDownType.LeaveMap, 10 * 1000);
    }
    private void OnNpcAppear(GA_NpcClientFightNorm _npc)
    {
        var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
        if (_npc.NpcConfig.NPCID == config.npcId)
        {
            clientFightBoss = _npc as GA_NpcClientFightBoss;
        }
    }
    protected override void OnUpdate()
    {
        base.OnUpdate();
        if (timer < totalTime)
        if (clientFightBoss != null && clientFightBoss.ActorInfo.serverDie)
        {
            if ((DateTime.Now - playerAtkTime).TotalSeconds < 1f)
            {
                timer += Time.deltaTime;
                if (timer >= totalTime)
                {
                    TargetBriefInfo.OnRefreshBossLifeBar(clientFightBoss.ServerInstID, clientFightBoss.NpcConfig.NPCID,
                        0, clientFightBoss.ActorInfo.RealMaxHp);
                    OnBossDie();
                }
            }
            OnBossDie();
        }
        switch (step)
@@ -215,18 +125,6 @@
                    if (stepTimer > 5f)
                    {
                        stepTimer = 0f;
                        RequestDropItem();
                    }
                }
                break;
            case Step.PickItem:
                if (pickAllDropItem)
                {
                    stepTimer += Time.deltaTime;
                    if (stepTimer >= 5f)
                    {
                        RequestSettle();
                        stepTimer = 0f;
                    }
                }
                break;
@@ -235,7 +133,7 @@
                if (stepTimer >= existTime)
                {
                    step = Step.Exit;
                    model.RequestExitClientDungeon();
                    ClientDungeonStageUtility.ExitNormalClientDungeon();
                }
                break;
        }
@@ -245,34 +143,8 @@
    {
        if (clientFightBoss != null)
        {
            clientFightBoss.ActorInfo.serverDie = true;
            GAMgr.Instance.ServerDie(clientFightBoss.ServerInstID);
            clientFightBoss.Die();
            clientFightBoss = null;
        }
        RequestDropItem();
    }
    void RequestDropItem()
    {
        var incidentId = hazyRegionModel.processingIncidentId;
        var config = HazyRegionConfig.Get(incidentId);
        ClientDungeonStageUtility.RequestClientDropItem(config.dungeonId, config.lineId);
    }
    void RequestSettle()
    {
        var incidentId = hazyRegionModel.processingIncidentId;
        var config = HazyRegionConfig.Get(incidentId);
        ClientDungeonStageUtility.RequestSettleClientDungeon(config.dungeonId, config.lineId);
    }
    private void OnReconnected()
    {
        var incidentId = hazyRegionModel.processingIncidentId;
        var config = HazyRegionConfig.Get(incidentId);
        ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
    }
    public override void UnInitialize()
@@ -281,23 +153,11 @@
        if (clientFightBoss != null)
        {
            clientFightBoss.ActorInfo.serverDie = true;
            GAMgr.Instance.ServerDie(clientFightBoss.ServerInstID);
            GAMgr.Instance.Release(clientFightBoss);
            clientFightBoss = null;
        }
        if (pickItemClock != null)
        {
            Clock.Stop(pickItemClock);
            pickItemClock = null;
        }
        DTC0403_tagPlayerLoginLoadOK.mapInitOkEvent -= OnReconnected;
        AttackHandler.OnAttackTarget -= OnPlayerAttack;
        ClientDungeonStageUtility.onReceiveCustomDropItme -= OnReceiveCustomDropItme;
        dungeonModel.onDungeonResultEvent -= OnDungeonResultEvent;
        ClientDropItemUtility.OnItemPickup -= OnItemPickup;
        PersonalEnemy.OnNpcAppear -= OnNpcAppear;
    }
#if UNITY_EDITOR
@@ -305,7 +165,7 @@
    {
        if (GUILayout.Button("Exit"))
        {
            model.RequestExitClientDungeon();
            ClientDungeonStageUtility.ExitNormalClientDungeon();
        }
    }
#endif
@@ -314,8 +174,7 @@
    {
        None,
        Fight,
        PickItem,
        Settle,
        Exit
    }
}
}
System/HazyRegion/ClientHazyGrassStage.cs
@@ -3,87 +3,58 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ClientHazyGrassStage : DungeonStage
{
    static readonly Vector3 PlayerBornPosition1 = new Vector3(19.401f, 4.985f, 5.494f);
    static List<HazyMapNpcScriptableObject.NpcInfo> s_NpcInfos = new List<HazyMapNpcScriptableObject.NpcInfo>();
    static Dictionary<Vector3, GA_NpcClientCollect> s_CollectNpcs = new Dictionary<Vector3, GA_NpcClientCollect>();
    static Dictionary<uint, Vector3> s_Sid2NpcPos = new Dictionary<uint, Vector3>();
    static List<int> s_RandomIndexs = new List<int>();
    static readonly int s_EnemyNpcId = 40208005;
    bool hasInitializedNpc = false;
    public bool hasCompleted { get; private set; }
    static Dictionary<uint, GA_NpcClientCollect> s_CollectNpcs = new Dictionary<uint, GA_NpcClientCollect>();
    static Dictionary<uint, int> s_Sid2NpcIds = new Dictionary<uint, int>();
    //static List<GA_NpcClientFightNorm> s_ClientFightNpcs = new List<GA_NpcClientFightNorm>();
    static List<HazyGrassNpcInfo> s_NpcRefreshInfos = new List<HazyGrassNpcInfo>();
    static Dictionary<int, int> s_NpcRefreshTimes = new Dictionary<int, int>();
    bool mapLoadFinish = false;
    bool initedFightNpc = false;
    static Dictionary<uint, int> s_Sid2NpcIndexs = new Dictionary<uint, int>();
    static Dictionary<int, int> s_NpcCounts = new Dictionary<int, int>();
    HazyRegionIncidentType incidentType;
    HazyGrassModel model { get { return ModelCenter.Instance.GetModel<HazyGrassModel>(); } }
    HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
    DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
    public override void Initialize()
    {
        base.Initialize();
        s_NpcInfos.Clear();
        s_RandomIndexs.Clear();
        s_Sid2NpcIds.Clear();
        s_Sid2NpcPos.Clear();
        s_NpcRefreshTimes.Clear();
        mapLoadFinish = false;
        initedFightNpc = false;
        var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
        if (config != null)
        {
            incidentType = (HazyRegionIncidentType)config.incidentType;
            s_NpcRefreshInfos = model.GetGrassNpcInfos(config.dungeonId);
            foreach (var npcInfo in s_NpcRefreshInfos)
            {
                s_NpcRefreshTimes.Add(npcInfo.npcId, GetNpcRefreshCount(npcInfo));
            }
        }
        s_CollectNpcs.Clear();
        s_Sid2NpcIndexs.Clear();
        s_NpcCounts.Clear();
        localNpcJsons.Clear();
        UnloadAllNpc();
        hasInitializedNpc = false;
        hasCompleted = false;
        ClientCollectUtility.OnCollectFinished += OnCollectFinished;
        dungeonModel.onDungeonResultEvent += OnDungeonResultEvent;
    }
    protected override void OnStageLoadFinish()
    {
        base.OnStageLoadFinish();
        mapLoadFinish = true;
        InitialPlayer();
        InitializeNpc();
        initedFightNpc = true;
        model.dugeonTargetStateRefresh -= DugeonTargetStateRefresh;
        model.dugeonTargetStateRefresh += DugeonTargetStateRefresh;
    }
    protected override void OnUpdate()
    {
        base.OnUpdate();
        if (mapLoadFinish)
        {
            foreach (var npcInfo in s_NpcRefreshInfos)
            {
                var _lastCount = s_NpcRefreshTimes[npcInfo.npcId];
                var count = GetNpcRefreshCount(npcInfo);
                if (_lastCount != count)
                {
                    RebornCollectedNpc(npcInfo.npcId);
                    s_NpcRefreshTimes[npcInfo.npcId] = count;
                }
            }
        }
        model.onMapNpcCountRefresh += OnMapNpcCountRefresh;
    }
    public override void UnInitialize()
@@ -93,25 +64,24 @@
        UnloadAllNpc();
        ClientCollectUtility.OnCollectFinished -= OnCollectFinished;
        model.dugeonTargetStateRefresh -= DugeonTargetStateRefresh;
        dungeonModel.onDungeonResultEvent -= OnDungeonResultEvent;
        model.onMapNpcCountRefresh -= OnMapNpcCountRefresh;
    }
    private void DugeonTargetStateRefresh()
    private void OnMapNpcCountRefresh()
    {
        if (model.IsDungeonTargetDone)
        if (!hasInitializedNpc)
        {
            if (!NewBieCenter.Instance.IsGuideCompleted(51))
            {
                NewBieCenter.Instance.StartNewBieGuide(51);
            }
            InitializeNpc();
        }
    }
    int GetNpcRefreshCount(HazyGrassNpcInfo npcInfo)
    private void OnDungeonResultEvent()
    {
        var used = TimeUtility.Minute * 60 + TimeUtility.Second;
        var refreshSeconds = npcInfo.refreshMinute * 60;
        return used / refreshSeconds;
        dungeonModel.UpdateCoolDown(DungeonCoolDownType.LeaveMap, 10 * 1000);
        hasCompleted = true;
        ClientDungeonStageUtility.ClearClientDataMapSymbol();
    }
    private void OnCollectFinished(uint _sid)
@@ -124,107 +94,153 @@
            GameNetSystem.Instance.SendInfo(pak);
            s_Sid2NpcIds.Remove(_sid);
        }
        if (s_Sid2NpcPos.ContainsKey(_sid))
        {
            var pos = s_Sid2NpcPos[_sid];
            if (s_CollectNpcs.ContainsKey(pos))
            if (s_Sid2NpcIndexs.ContainsKey(_sid))
            {
                s_CollectNpcs.Remove(pos);
                var index = s_Sid2NpcIndexs[_sid];
                localNpcJsons.RemoveAll((x) =>
                {
                    return x.npcId == npcId && x.index == index;
                });
                s_Sid2NpcIndexs.Remove(_sid);
                SaveNpcData();
            }
            if (s_NpcCounts.ContainsKey(npcId))
            {
                s_NpcCounts[npcId] = Mathf.Max(0, s_NpcCounts[npcId] - 1);
            }
        }
        RefreshMapNpcCount();
    }
    void InitializeNpc()
    {
        s_NpcInfos.Clear();
        var config = ScriptableObjectLoader.LoadSoHazyMapNpc(ClientDungeonStageUtility.clientMapId);
        var npcInfos = config.GetAllNpcInfos();
        if (npcInfos != null)
        if (s_CollectNpcs.ContainsKey(_sid))
        {
            s_NpcInfos.AddRange(npcInfos);
            RebornCollectedNpc();
            s_CollectNpcs.Remove(_sid);
        }
    }
    void InitialPlayer()
    {
        var hero = PlayerDatas.Instance.hero;
        hero.Pos = PlayerBornPosition1;
        hero.Rotation = Quaternion.Euler(0, -9.537001f, 0);
        CameraController.Instance.Apply();
        if (hero != null)
        {
            hero.Pos = PlayerBornPosition1;
            hero.Rotation = Quaternion.Euler(0, -9.537001f, 0);
            CameraController.Instance.Apply();
        }
    }
    void RebornCollectedNpc(int npcId = 0)
    void InitializeNpc()
    {
        foreach (var npcInfo in s_NpcInfos)
        {
            if (npcId != 0 && npcInfo.npcId != npcId)
            {
                continue;
            }
            switch (npcInfo.npcType)
            {
                case E_NpcType.Collect:
                    GA_NpcClientCollect _npc = null;
                    if (!s_CollectNpcs.TryGetValue(npcInfo.position, out _npc)
                        || _npc == null || _npc.ActorInfo.serverDie)
                    {
                        _npc = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>((uint)npcInfo.npcId,
                            E_ActorGroup.FuncNpc);
                        if (_npc != null)
                        {
                            _npc.Pos = npcInfo.position;
                            s_CollectNpcs[npcInfo.position] = _npc;
        var config = ScriptableObjectLoader.LoadSoHazyMapNpc(ClientDungeonStageUtility.clientMapId);
        var positions = config.GetNpcPositions();
                            s_Sid2NpcIds[_npc.ServerInstID] = npcInfo.npcId;
                            s_Sid2NpcPos[_npc.ServerInstID] = npcInfo.position;
                        }
                    }
                    break;
                case E_NpcType.Fight:
                    //if (!initedFightNpc)
                    //{
                    //    var fightNpc = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightNorm>((uint)npcInfo.npcId,
                    //         E_ActorGroup.Enemy);
                    //    if (fightNpc != null)
                    //    {
                    //        fightNpc.Pos = npcInfo.position;
                    //        fightNpc.OnAttacked -= OnAttackNpc;
                    //        fightNpc.OnAttacked += OnAttackNpc;
                    //    }
                    //    s_ClientFightNpcs.Add(fightNpc);
                    //}
                    break;
            }
        s_RandomIndexs.Clear();
        for (int i = 0; i < positions.Count; i++)
        {
            s_RandomIndexs.Add(i);
        }
        RefreshMapNpcCount();
    }
        var mapId = model.GetGrassMapId(hazyRegionModel.processingIncidentId);
        var npcInfos = model.GetGrassNpcInfos(mapId);
    void RefreshMapNpcCount()
    {
        foreach (var npcInfo in s_NpcRefreshInfos)
        var npcJsonDatas = GetLocalNpcData();
        if (npcJsonDatas != null && npcJsonDatas.Count > 0)
        {
            var count = 0;
            foreach (var npcId in s_Sid2NpcIds.Values)
            for (int i = 0; i < npcInfos.Count; i++)
            {
                if (npcId == npcInfo.npcId)
                var npcId = npcInfos[i];
                var count = model.GetMapNpcCount(npcId);
                if (count == 0)
                {
                    count++;
                    continue;
                }
                for (int j = 0; j < count; j++)
                {
                    var index = -1;
                    var jsonInfoIndex = npcJsonDatas.FindIndex((x) =>
                    {
                        return x.npcId == npcId;
                    });
                    if (jsonInfoIndex != -1)
                    {
                        index = npcJsonDatas[jsonInfoIndex].index;
                        npcJsonDatas.RemoveAt(jsonInfoIndex);
                    }
                    if (index == -1)
                    {
                        break;
                    }
                    InitializeNpc(npcId, index);
                    s_RandomIndexs.Remove(index);
                }
            }
            model.RefreshMapNpcCount(npcInfo.npcId, count);
        }
        for (int i = 0; i < npcInfos.Count; i++)
        {
            var npcId = npcInfos[i];
            var count = model.GetMapNpcCount(npcId) - (s_NpcCounts.ContainsKey(npcId) ? s_NpcCounts[npcId] : 0);
            for (int j = 0; j < count; j++)
            {
                var index = UnityEngine.Random.Range(0, s_RandomIndexs.Count);
                InitializeNpc(npcId, s_RandomIndexs[index]);
                s_RandomIndexs.RemoveAt(index);
            }
        }
        if (hasInitializedNpc)
        {
            var enemyPosition = positions[UnityEngine.Random.Range(0, positions.Count)];
            if (ClientDungeonStageUtility.clientMapId == HazyGrassModel.FAIRY_CLIENTDATAMAP)
            {
                PersonalEnemy.Create((uint)s_EnemyNpcId, E_ActorGroup.Enemy, enemyPosition);
            }
        }
        if (hasInitializedNpc)
        {
            SaveNpcData();
        }
    }
    private void OnAttackNpc()
    void InitializeNpc(int npcId, int index)
    {
        Debug.Log("攻击了宝箱怪");
        hasInitializedNpc = true;
        var config = ScriptableObjectLoader.LoadSoHazyMapNpc(ClientDungeonStageUtility.clientMapId);
        var positions = config.GetNpcPositions();
        var position = positions[index];
        GA_NpcClientCollect _npc = GAMgr.Instance.ReqClntNoFightNpc<GA_NpcClientCollect>((uint)npcId,
                E_ActorGroup.FuncNpc);
        _npc.Pos = position;
        s_CollectNpcs[_npc.ServerInstID] = _npc;
        s_Sid2NpcIds[_npc.ServerInstID] = npcId;
        s_Sid2NpcIndexs[_npc.ServerInstID] = index;
        if (!s_NpcCounts.ContainsKey(npcId))
        {
            s_NpcCounts.Add(npcId, 1);
        }
        else
        {
            s_NpcCounts[npcId] += 1;
        }
        localNpcJsons.Add(new NpcJsonInfo()
        {
            npcId = npcId,
            index = index,
        });
    }
    void UnloadAllNpc()
@@ -240,27 +256,39 @@
            }
        }
        //foreach (var _npc in s_ClientFightNpcs)
        //{
        //    if (_npc != null)
        //    {
        //        _npc.OnAttacked -= OnAttackNpc;
        //        _npc.ActorInfo.serverDie = true;
        //        GAMgr.Instance.ServerDie(_npc.ServerInstID);
        //        GAMgr.Instance.Release(_npc);
        //    }
        //}
        //
        //s_ClientFightNpcs.Clear();
        s_CollectNpcs.Clear();
    }
    #region 本地Npc数据
    List<NpcJsonInfo> localNpcJsons = new List<NpcJsonInfo>();
    public struct NpcJsonInfo
    {
        public int npcId;
        public int index;
    }
    void SaveNpcData()
    {
        LocalSave.SetString(model.GetLocalSaveKey(ClientDungeonStageUtility.clientMapId), LitJson.JsonMapper.ToJson(localNpcJsons));
    }
    List<NpcJsonInfo> GetLocalNpcData()
    {
        var key = model.GetLocalSaveKey(ClientDungeonStageUtility.clientMapId);
        if (LocalSave.HasKey(key))
        {
            return LitJson.JsonMapper.ToObject<List<NpcJsonInfo>>(LocalSave.GetString(key));
        }
        return null;
    }
    #endregion
#if UNITY_EDITOR
    private void OnGUI()
    {
        if (GUILayout.Button("Exit"))
        {
            model.RequestExitClientDungeon();
            ClientDungeonStageUtility.ExitNormalClientDungeon();
        }
    }
#endif
System/HazyRegion/DungeonAdventureVictoryWin.cs
@@ -19,7 +19,7 @@
        [SerializeField] Button m_Exit;
        [SerializeField] Text m_ExitTimer;
        const float totalTime = 5f;
        const float totalTime = 8f;
        float timer = 0f;
        float clockTimer = 0f;
@@ -81,7 +81,7 @@
        IEnumerator Co_DelayDisplay()
        {
            yield return WaitingForSecondConst.WaitMS500;
            yield return WaitingForSecondConst.WaitMS3000;
            Display();
        }
System/HazyRegion/HazyDemonKingDungeonWin.cs
@@ -14,6 +14,7 @@
    public class HazyDemonKingDungeonWin : Window
    {
        [SerializeField] Transform m_ContainerDungeonInfo;
        [SerializeField] CyclicScroll m_CyclicScroll;
        [SerializeField] HazyDemonKingPlayerBehaviour m_BelongToPlayer;
        [SerializeField] RectTransform m_ContainerPlayerList;
@@ -36,7 +37,21 @@
        uint belongToPlayerId = 0;
        private int dungeonType
        {
            get
            {
                var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
                if (config != null)
                {
                    return config.dungeonType;
                }
                return 0;
            }
        }
        HazyDemonKingModel model { get { return ModelCenter.Instance.GetModel<HazyDemonKingModel>(); } }
        HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
        DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
        #region Built-in
@@ -97,6 +112,8 @@
        void Display()
        {
            m_ContainerDungeonInfo.gameObject.SetActive(dungeonType != 0);
            DisplayBelongTo();
            DisplayPlayers();
            DisplayMyTargetName();
@@ -105,6 +122,11 @@
        void DisplayPlayers()
        {
            if (dungeonType == 0)
            {
                return;
            }
            playerIds.Clear();
            clonePlayerIds.Clear();
@@ -124,6 +146,11 @@
        void DisplayBelongTo()
        {
            if (dungeonType == 0)
            {
                return;
            }
            belongToPlayerId = 0;
            foreach (var sid in model.GetPlayerIds())
            {
@@ -153,20 +180,29 @@
        void DisplayInvincibleBuff()
        {
            var actors = GAMgr.Instance.GetTypeList(E_ActorClassType.NpcFightBoss);
            bool existInvincibleBuff = false;
            Status_Base status_Base = null;
            uint serverInstId = 0;
            if (actors != null && actors.Count > 0)
            if (dungeonType != 0)
            {
                var serverInstId = (actors[0] as GA_NpcFightBoss).ServerInstID;
                existInvincibleBuff = StatusMgr.Instance.IsExist(serverInstId, model.invincibleBuffId);
                if (existInvincibleBuff)
                var actors = GAMgr.Instance.GetTypeList(E_ActorClassType.NpcFightBoss);
                if (actors != null && actors.Count > 0)
                {
                    status_Base = StatusMgr.Instance.Get(serverInstId, model.invincibleBuffId);
                    serverInstId = (actors[0] as GA_NpcFightBoss).ServerInstID;
                    existInvincibleBuff = StatusMgr.Instance.IsExist(serverInstId, model.invincibleBuffId);
                }
            }
            else
            {
                serverInstId = ClientHazyDemonKingStage.GetClientBossSid();
                existInvincibleBuff = StatusMgr.Instance.IsExist(serverInstId, model.invincibleBuffId);
            }
            if (existInvincibleBuff)
            {
                status_Base = StatusMgr.Instance.Get(serverInstId, model.invincibleBuffId);
            }
            m_ContainerInvincibleBuff.gameObject.SetActive(existInvincibleBuff);
@@ -206,6 +242,11 @@
        private void PerSecond()
        {
            if (dungeonType == 0)
            {
                return;
            }
            if (clonePlayerIds.Count > 0)
            {
                clonePlayerIds.Sort(Compare);
@@ -246,6 +287,11 @@
        void DisplayMyTargetName()
        {
            if (dungeonType == 0)
            {
                return;
            }
            m_MyAtkTargetName.text = string.Empty;
            myAtkSid = model.GetPlayerAtkTarget(PlayerDatas.Instance.PlayerId);
System/HazyRegion/HazyDemonKingModel.cs
@@ -13,11 +13,9 @@
        public bool IsInDungeon { get; private set; }
        bool requireExitClientDungeon = false;
        public int invincibleBuffId { get; private set; }
        public const int Client_MapID = 2000;
        public const int CLIENTDATAMAP = 2000;
        public const int DEMONKINGMAPID1 = 22030;
        public const int DEMONKINGMAPID2 = 32030;
@@ -47,11 +45,6 @@
        public void OnPlayerLoginOk()
        {
            if (IsInDemonKingDungeon(PlayerDatas.Instance.baseData.MapID))
            {
                var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
                ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
            }
        }
        public override void UnInit()
@@ -68,12 +61,6 @@
            GA_Hero.OnStopBeAttacked -= OnStopBeAttacked;
            m_AttackHeroPlayers.Clear();
            if (requireExitClientDungeon)
            {
                requireExitClientDungeon = false;
                ClientDungeonStageUtility.RequestExitClientDungeon();
            }
            IsInDungeon = false;
            if (IsInDemonKingDungeon(mapId))
@@ -211,7 +198,7 @@
                return false;
            }
            if (mapId == Client_MapID)
            if (mapId == CLIENTDATAMAP)
            {
                return true;
            }
@@ -263,7 +250,7 @@
        public uint GetPlayerAtkTarget(uint sid)
        {
            if (ClientDungeonStageUtility.clientMapId == Client_MapID)
            if (ClientDungeonStageUtility.clientMapId == CLIENTDATAMAP)
            {
                return ClientHazyDemonKingStage.GetClientBossSid();
            }
@@ -288,7 +275,7 @@
        public bool IsExistBelongTo(uint playerId)
        {
            if (playerId == PlayerDatas.Instance.PlayerId
                && ClientDungeonStageUtility.clientMapId == Client_MapID)
                && ClientDungeonStageUtility.clientMapId == CLIENTDATAMAP)
            {
                return true;
            }
@@ -335,52 +322,7 @@
        public void RequestEnterClientDungeon()
        {
            var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
            var hero = PlayerDatas.Instance.hero;
            if (hero != null)
            {
                hero.StopAll();
            }
            MapTransferUtility.Instance.Clear();
            ClientDungeonStageUtility.SetClientDungeon(true, Client_MapID);
            ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
            StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
            {
                toMapId = Client_MapID,
                toLineId = 0,
                needEmpty = true,
                needLoadResource = true,
                serverType = ServerType.Main,
                isClientLoadMap = true
            });
            PlayerDatas.Instance.baseData.mainServerMapIdRecord = PlayerDatas.Instance.baseData.MapID;
            PlayerDatas.Instance.baseData.MapID = Client_MapID;
            var attackMode = new C030A_tagCChangeAttackMode();
            attackMode.Mode = (byte)E_AttackMode.Contest;
            GameNetSystem.Instance.PushPackage(attackMode, ServerType.Main);
        }
        public void RequestExitClientDungeon()
        {
            requireExitClientDungeon = true;
            ClientDungeonStageUtility.SetClientDungeon(false, 0);
            PlayerDatas.Instance.extersion.pkState = 0;
            ModelCenter.Instance.GetModel<DungeonModel>().ResetBufData();
            PlayerDatas.Instance.baseData.MapID = PlayerDatas.Instance.baseData.mainServerMapIdRecord;
            StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
            {
                toMapId = PlayerDatas.Instance.baseData.MapID,
                toLineId = 0,
                needEmpty = true,
                needLoadResource = true,
                serverType = ServerType.Main,
                isClientLoadMap = true,
                refreshPlayerDatas=true
            });
            ClientDungeonStageUtility.GotoNormalClientDungeon(CLIENTDATAMAP, config.dungeonId, config.lineId);
        }
    }
System/HazyRegion/HazyDemonKingVictoryWin.cs
@@ -15,6 +15,7 @@
    public class HazyDemonKingVictoryWin : Window
    {
        [SerializeField] Transform m_ContainerPoivt;
        [SerializeField] Transform m_ContainerBelongTo;
        [SerializeField] Text m_PlayerName;
        [SerializeField] ScrollRect m_RewardsScroll;
        [SerializeField] Text m_ExitTimer;
@@ -27,7 +28,21 @@
        float timer = 0f;
        private int dungeonType
        {
            get
            {
                var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
                if (config != null)
                {
                    return config.dungeonType;
                }
                return 0;
            }
        }
        DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
        HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
        #region Built-in
        protected override void BindController()
@@ -43,6 +58,7 @@
        {
            timer = 0f;
            m_ContainerPoivt.gameObject.SetActive(false);
            m_ContainerBelongTo.gameObject.SetActive(dungeonType != 0);
        }
        protected override void OnActived()
@@ -167,9 +183,9 @@
        private void ExitDungeon()
        {
            if (PlayerDatas.Instance.baseData.MapID == HazyDemonKingModel.Client_MapID)
            if (PlayerDatas.Instance.baseData.MapID == HazyDemonKingModel.CLIENTDATAMAP)
            {
                ModelCenter.Instance.GetModel<HazyDemonKingModel>().RequestExitClientDungeon();
                ClientDungeonStageUtility.ExitNormalClientDungeon();
            }
            else
            {
System/HazyRegion/HazyGrassDungeonWin.cs
@@ -19,8 +19,6 @@
        [SerializeField] HazyGrassCountBeha[] m_GrassCountBehas;
        [SerializeField] Text[] m_GrassTimes;
        float timer = 0f;
        DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
        HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
        HazyGrassModel hazyGrassModel { get { return ModelCenter.Instance.GetModel<HazyGrassModel>(); } }
@@ -37,10 +35,6 @@
        {
            Display();
            timer = 0f;
            //RequestGrassCount();
            GlobalTimeEvent.Instance.secondEvent += PerSecond;
            hazyGrassModel.onMapNpcCountRefresh += OnMapNpcCountRefresh;
        }
@@ -50,7 +44,6 @@
        protected override void OnPreClose()
        {
            GlobalTimeEvent.Instance.secondEvent -= PerSecond;
            hazyGrassModel.onMapNpcCountRefresh -= OnMapNpcCountRefresh;
        }
@@ -61,19 +54,8 @@
        protected override void LateUpdate()
        {
            base.LateUpdate();
            timer += Time.deltaTime;
            if (timer >= 5f)
            {
                timer = 0f;
                //RequestGrassCount();
            }
        }
        #endregion
        private void PerSecond()
        {
            DisplayGrassRefreshTime();
        }
        void Display()
        {
@@ -109,8 +91,7 @@
                if (npcInfos != null && i < npcInfos.Count)
                {
                    m_GrassCountBehas[i].SetActive(true);
                    m_GrassCountBehas[i].Display(npcInfos[i].npcId,
                        hazyGrassModel.GetMapNpcCount(npcInfos[i].npcId));
                    m_GrassCountBehas[i].Display(npcInfos[i], hazyGrassModel.GetMapNpcCount(npcInfos[i]));
                }
                else
                {
@@ -121,64 +102,9 @@
        void DisplayGrassRefreshTime()
        {
            var mapId = 0;
            if (ClientDungeonStageUtility.isClientDungeon)
            {
                mapId = hazyGrassModel.GetGrassMapId(hazyRegionModel.processingIncidentId);
            }
            else
            {
                mapId = PlayerDatas.Instance.baseData.MapID;
            }
            var npcInfos = hazyGrassModel.GetGrassNpcInfos(mapId);
            for (int i = 0; i < m_GrassTimes.Length; i++)
            {
                if (npcInfos != null && i < npcInfos.Count)
                {
                    m_GrassTimes[i].gameObject.SetActive(true);
                    var used = 0;
                    if (ClientDungeonStageUtility.isClientDungeon)
                    {
                        used = TimeUtility.Minute * 60 + TimeUtility.Second;
                    }
                    else
                    {
                        used = TimeUtility.CrossServerNow.Minute * 60 + TimeUtility.CrossServerNow.Second;
                    }
                    var refreshSeconds = npcInfos[i].refreshMinute * 60;
                    var seconds = refreshSeconds - used % refreshSeconds;
                    var npcConfig = NPCConfig.Get(npcInfos[i].npcId);
                    m_GrassTimes[i].text = Language.Get("HazyGrassRefresh", npcConfig.charName,
                        TimeUtility.SecondsToMS(seconds));
                }
                else
                {
                    m_GrassTimes[i].gameObject.SetActive(false);
                }
            }
        }
        void RequestGrassCount()
        {
            if (!ClientDungeonStageUtility.isClientDungeon)
            {
                var mapId = PlayerDatas.Instance.baseData.MapID;
                var npcInfos = hazyGrassModel.GetGrassNpcInfos(mapId);
                if (npcInfos != null)
                {
                    int[] npcs = new int[npcInfos.Count];
                    for (int i = 0; i < npcInfos.Count; i++)
                    {
                        npcs[i] = npcInfos[i].npcId;
                    }
                    var pak = new CA227_tagCMQueryNPCCntInfo();
                    pak.MapID = (uint)mapId;
                    pak.LineID = (ushort)PlayerDatas.Instance.baseData.dungeonLineId;
                    pak.NPCIDList = LitJson.JsonMapper.ToJson(npcs);
                    pak.NPCIDListLen = (byte)pak.NPCIDList.Length;
                    GameNetSystem.Instance.SendToCrossServer(pak);
                }
                m_GrassTimes[i].gameObject.SetActive(false);
            }
        }
System/HazyRegion/HazyGrassModel.cs
@@ -7,37 +7,17 @@
    [XLua.LuaCallCSharp]
    public class HazyGrassModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
    {
        Dictionary<int, List<HazyGrassNpcInfo>> mapNpcs = new Dictionary<int, List<HazyGrassNpcInfo>>();
        Dictionary<int, List<int>> m_MapNpcs = new Dictionary<int, List<int>>();
        Dictionary<int, int> m_MapNpcCount = new Dictionary<int, int>();
        public const int ReikiGrassMapId = 32040;
        public const int FairyGrassMapId = 32050;
        public const int Client_ReikiGrassMapID = 3240;
        public const int Client_FairyGrassMapID = 3250;
        public const int REIKI_CLIENTDATAMAP = 3240;
        public const int FAIRY_CLIENTDATAMAP = 3250;
        public bool IsInDungeon { get; private set; }
        bool requireExitClientDungeon = false;
        bool m_IsDungeonTargetDone = false;
        public bool IsDungeonTargetDone
        {
            get { return m_IsDungeonTargetDone; }
            private set
            {
                if (m_IsDungeonTargetDone != value)
                {
                    m_IsDungeonTargetDone = value;
                    if (dugeonTargetStateRefresh != null)
                    {
                        dugeonTargetStateRefresh();
                    }
                }
            }
        }
        public event Action onMapNpcCountRefresh;
        public event Action dugeonTargetStateRefresh;
        HazyRegionModel hazyRegionModel { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
        DungeonModel dungeonModel { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } }
@@ -47,7 +27,6 @@
            ParseConfig();
            StageLoad.Instance.onStageLoadFinish += OnStageLoadFinish;
            GlobalTimeEvent.Instance.secondEvent += PerSecond;
        }
        public void OnBeforePlayerDataInitialize()
@@ -56,25 +35,11 @@
        public void OnPlayerLoginOk()
        {
            if (IsInGrassDungeon(PlayerDatas.Instance.baseData.MapID))
            {
                var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
                ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
            }
        }
        public override void UnInit()
        {
            StageLoad.Instance.onStageLoadFinish -= OnStageLoadFinish;
            GlobalTimeEvent.Instance.secondEvent -= PerSecond;
        }
        private void PerSecond()
        {
            if (IsInDungeon)
            {
                IsDungeonTargetDone = GetDungeonTargetDone();
            }
        }
        void ParseConfig()
@@ -85,19 +50,15 @@
                if (config.MapID == ReikiGrassMapId
                    || config.MapID == FairyGrassMapId)
                {
                    List<HazyGrassNpcInfo> _npcs = null;
                    if (!mapNpcs.TryGetValue(config.MapID, out _npcs))
                    List<int> _npcs = null;
                    if (!m_MapNpcs.TryGetValue(config.MapID, out _npcs))
                    {
                        _npcs = new List<HazyGrassNpcInfo>();
                        mapNpcs.Add(config.MapID, _npcs);
                        _npcs = new List<int>();
                        m_MapNpcs.Add(config.MapID, _npcs);
                    }
                    for (int i = 0; i < config.NPCIDList.Length; i++)
                    {
                        _npcs.Add(new HazyGrassNpcInfo()
                        {
                            npcId = config.NPCIDList[i],
                            refreshMinute = config.RefreshPerMinutes,
                        });
                        _npcs.Add(config.NPCIDList[i]);
                    }
                }
            }
@@ -107,16 +68,7 @@
        {
            var mapId = PlayerDatas.Instance.baseData.MapID;
            m_MapNpcCount.Clear();
            if (requireExitClientDungeon)
            {
                requireExitClientDungeon = false;
                ClientDungeonStageUtility.RequestExitClientDungeon();
            }
            IsInDungeon = false;
            m_IsDungeonTargetDone = false;
            if (IsInGrassDungeon(mapId))
            {
                IsInDungeon = true;
@@ -130,8 +82,8 @@
                return false;
            }
            if (mapId == Client_ReikiGrassMapID
                || mapId == Client_FairyGrassMapID)
            if (mapId == REIKI_CLIENTDATAMAP
                || mapId == FAIRY_CLIENTDATAMAP)
            {
                return true;
            }
@@ -222,9 +174,9 @@
            switch ((HazyRegionIncidentType)config.incidentType)
            {
                case HazyRegionIncidentType.FairyGrass:
                    return Client_FairyGrassMapID;
                    return FAIRY_CLIENTDATAMAP;
                case HazyRegionIncidentType.ReikiGrass:
                    return Client_ReikiGrassMapID;
                    return REIKI_CLIENTDATAMAP;
            }
            return 0;
        }
@@ -239,11 +191,11 @@
            return 0;
        }
        public List<HazyGrassNpcInfo> GetGrassNpcInfos(int mapId)
        public List<int> GetGrassNpcInfos(int mapId)
        {
            if (mapNpcs.ContainsKey(mapId))
            if (m_MapNpcs.ContainsKey(mapId))
            {
                return mapNpcs[mapId];
                return m_MapNpcs[mapId];
            }
            return null;
        }
@@ -257,10 +209,22 @@
            return 0;
        }
        public string GetLocalSaveKey(int mapId)
        {
            return StringUtility.Contact("HazyGrassMap", mapId, "_", PlayerDatas.Instance.PlayerId);
        }
        public void DeleteLocalSaveKey()
        {
            LocalSave.DeleteKey(GetLocalSaveKey(FAIRY_CLIENTDATAMAP));
            LocalSave.DeleteKey(GetLocalSaveKey(REIKI_CLIENTDATAMAP));
        }
        public bool CanCollectClientNpc(int npcId)
        {
            if (ClientDungeonStageUtility.isClientDungeon
                && ClientDungeonStageUtility.clientMapId == Client_ReikiGrassMapID)
                && (ClientDungeonStageUtility.clientMapId == REIKI_CLIENTDATAMAP
                || ClientDungeonStageUtility.clientMapId == FAIRY_CLIENTDATAMAP))
            {
                var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
                if (config != null)
@@ -268,6 +232,18 @@
                    var collectCount = dungeonModel.GetDugneonNpcCollectCount(npcId);
                    var hintId = dungeonModel.GetDungeonHintId(config.dungeonId, config.lineId);
                    var hintConfig = DungeonHintConfig.Get(hintId);
                    if (hintConfig.NPC1ID.Length > 1
                        && Array.IndexOf(hintConfig.NPC1ID, npcId) != -1)
                    {
                        collectCount = 0;
                        for (int i = 0; i < hintConfig.NPC1ID.Length; i++)
                        {
                            collectCount += dungeonModel.GetDugneonNpcCollectCount(hintConfig.NPC1ID[i]);
                        }
                        return collectCount < hintConfig.targetValue1[0];
                    }
                    if (hintConfig.NPC1ID.Length > 0 && hintConfig.NPC1ID[0] == npcId)
                    {
                        return collectCount < hintConfig.targetValue1[0];
@@ -317,60 +293,9 @@
        public void RequestEnterClientDungeon()
        {
            var config = HazyRegionConfig.Get(hazyRegionModel.processingIncidentId);
            var mapId = GetClientMapId(hazyRegionModel.processingIncidentId);
            var hero = PlayerDatas.Instance.hero;
            if (hero != null)
            {
                hero.StopAll();
            }
            MapTransferUtility.Instance.Clear();
            ClientDungeonStageUtility.SetClientDungeon(true, (ushort)mapId);
            ClientDungeonStageUtility.RequestStartClientDungeon(config.dungeonId, config.lineId);
            StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
            {
                toMapId = mapId,
                toLineId = 0,
                needEmpty = true,
                needLoadResource = true,
                serverType = ServerType.Main,
                isClientLoadMap = true
            });
            PlayerDatas.Instance.baseData.mainServerMapIdRecord = PlayerDatas.Instance.baseData.MapID;
            PlayerDatas.Instance.baseData.MapID = (ushort)mapId;
            var attackMode = new C030A_tagCChangeAttackMode();
            attackMode.Mode = (byte)E_AttackMode.Peace;
            GameNetSystem.Instance.PushPackage(attackMode, ServerType.Main);
            ClientDungeonStageUtility.GotoNormalClientDungeon(mapId, config.dungeonId, config.lineId);
        }
        public void RequestExitClientDungeon()
        {
            requireExitClientDungeon = true;
            ClientDungeonStageUtility.SetClientDungeon(false, 0);
            PlayerDatas.Instance.extersion.pkState = 0;
            ModelCenter.Instance.GetModel<DungeonModel>().ResetBufData();
            PlayerDatas.Instance.baseData.MapID = PlayerDatas.Instance.baseData.mainServerMapIdRecord;
            StageLoad.Instance.PushSceneLoadCommand(new StageLoad.StageLoadCommand()
            {
                toMapId = PlayerDatas.Instance.baseData.MapID,
                toLineId = 0,
                needEmpty = true,
                needLoadResource = true,
                serverType = ServerType.Main,
                isClientLoadMap = true,
                refreshPlayerDatas=true
            });
        }
    }
    public struct HazyGrassNpcInfo
    {
        public int npcId;
        public int refreshMinute;
    }
}
System/HazyRegion/HazyMapNpcScriptableObject.cs
@@ -7,35 +7,22 @@
#endif
public class HazyMapNpcScriptableObject : ScriptableObject
{
    [SerializeField] NpcInfo[] m_MapNpcInfos;
    [SerializeField] List<Vector3> m_NpcPositions;
    public NpcInfo[] GetAllNpcInfos()
    public List<Vector3> GetNpcPositions()
    {
        return m_MapNpcInfos;
        return m_NpcPositions;
    }
#if UNITY_EDITOR
    public void Save(int index, Vector3 position)
    {
        if (m_MapNpcInfos != null && index < m_MapNpcInfos.Length)
        if (m_NpcPositions != null && index < m_NpcPositions.Count)
        {
            m_MapNpcInfos[index] = new NpcInfo()
            {
                npcId = m_MapNpcInfos[index].npcId,
                npcType = m_MapNpcInfos[index].npcType,
                position = position,
            };
            m_NpcPositions[index] = position;
        }
    }
#endif
    [Serializable]
    public struct NpcInfo
    {
        public int npcId;
        public E_NpcType npcType;
        public Vector3 position;
    }
}
#if UNITY_EDITOR
System/HazyRegion/HazyRegionCompleteWin.cs
New file
@@ -0,0 +1,90 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Monday, May 20, 2019
//--------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI {
    public class HazyRegionCompleteWin : Window
    {
        [SerializeField] Button m_Confirm;
        [SerializeField] Text m_Label;
        const float closeSeconds = 3f;
        float timer = 0f;
        float checkTimer = 0f;
        HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
        #region Built-in
        protected override void BindController()
        {
        }
        protected override void AddListeners()
        {
            m_Confirm.onClick.AddListener(CloseClick);
        }
        protected override void OnPreOpen()
        {
            timer = 0f;
            DisplayTimes();
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
            Confirm();
        }
        protected override void OnAfterClose()
        {
        }
        protected override void LateUpdate()
        {
            checkTimer += Time.deltaTime;
            if (checkTimer >= 0.5f)
            {
                checkTimer = 0f;
                DisplayTimes();
            }
            timer += Time.deltaTime;
            if (timer >= closeSeconds)
            {
                CloseImmediately();
            }
        }
        #endregion
        void DisplayTimes()
        {
            var seconds = Mathf.CeilToInt(closeSeconds - timer);
            m_Label.text = StringUtility.Contact("确定", "(", seconds, "秒)");
        }
        private void Confirm()
        {
            model.SendBackHazyRegion();
        }
    }
}
System/HazyRegion/HazyRegionCompleteWin.cs.meta
copy from System/Treasure/ClientTreasureDungeon.cs.meta copy to System/HazyRegion/HazyRegionCompleteWin.cs.meta
File was copied from System/Treasure/ClientTreasureDungeon.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 189ce34976654c34da06b3239c45076d
timeCreated: 1556000158
guid: 5da9fe99e210d404c805d3485886e582
timeCreated: 1558336399
licenseType: Pro
MonoImporter:
  serializedVersion: 2
System/HazyRegion/HazyRegionDialogueWin.cs
@@ -31,6 +31,8 @@
        public static int adventureDialogueId = 0;
        public static event Action onDialogueComplete;
        HazyRegionModel model { get { return ModelCenter.Instance.GetModel<HazyRegionModel>(); } }
        #region Built-in
@@ -125,7 +127,10 @@
        private void OnSkip()
        {
            Close();
            model.SendSwitchAdventureState(model.processingIncidentId, 3);
            if (onDialogueComplete != null)
            {
                onDialogueComplete();
            }
        }
        private void OnClickEmpty()
@@ -140,7 +145,10 @@
            else
            {
                Close();
                model.SendSwitchAdventureState(model.processingIncidentId, 3);
                if (onDialogueComplete != null)
                {
                    onDialogueComplete();
                }
            }
        }
    }
System/HazyRegion/HazyRegionIncidentBehaviour.cs
@@ -30,9 +30,13 @@
        [SerializeField] Transform m_RedpointSign;
        [SerializeField] Transform m_ContainerStar;
        [SerializeField] Transform[] m_Stars;
        [Header("Boss")]
        [SerializeField] Transform m_ContainerBoss;
        [SerializeField] Text m_BossName;
        [SerializeField] Transform m_BossAliveInfo;
        [SerializeField] Text m_PlayerCount;
        [SerializeField] Text m_RebornTime;
@@ -113,6 +117,7 @@
            DisplayBase();
            DisplayItems();
            DisplayStars();
            DisplayState();
            DisplaySelect();
            DisplayBoss();
@@ -145,7 +150,7 @@
            m_Icon.SetSprite(config.PortraitID);
            m_Icon.SetNativeSize();
            m_Icon.material = m_SmoothMask.imageMaterials[0];
            m_ContainerCrossServer.gameObject.SetActive(!model.InFakeHazyRegion && config.dungeonType == 2);
            m_ContainerCrossServer.gameObject.SetActive(config.dungeonType == 2);
            m_ContainerMustSign.gameObject.SetActive(false);
        }
@@ -170,6 +175,19 @@
            }
        }
        void DisplayStars()
        {
            var config = HazyRegionConfig.Get(incidentId);
            m_ContainerStar.gameObject.SetActive(config.star > 0);
            if (config.star > 0)
            {
                for (int i = 0; i < m_Stars.Length; i++)
                {
                    m_Stars[i].gameObject.SetActive(i < config.star);
                }
            }
        }
        void DisplayBoss()
        {
            m_ContainerBoss.gameObject.SetActive(incidentType == HazyRegionIncidentType.DemonKing);
@@ -187,17 +205,19 @@
        {
            if (incidentType == HazyRegionIncidentType.DemonKing)
            {
                if (model.InFakeHazyRegion)
                var config = HazyRegionConfig.Get(incidentId);
                if (config.dungeonType == 0)
                {
                    var fighting = ClientDungeonStageUtility.isClientDungeon &&
                        ClientDungeonStageUtility.clientMapId == HazyDemonKingModel.Client_MapID;
                    m_PlayerCount.gameObject.SetActive(true);
                    m_RebornTime.gameObject.SetActive(false);
                    m_PlayerCount.text = Language.Get("HazyDemonKingPlayerCount", fighting ? 1 : 0);
                    m_BossAliveInfo.gameObject.SetActive(false);
                    //var fighting = ClientDungeonStageUtility.isClientDungeon &&
                    //    ClientDungeonStageUtility.clientMapId == HazyDemonKingModel.CLIENTDATAMAP;
                    //m_PlayerCount.gameObject.SetActive(true);
                    //m_RebornTime.gameObject.SetActive(false);
                    //m_PlayerCount.text = Language.Get("HazyDemonKingPlayerCount", fighting ? 1 : 0);
                }
                else
                {
                    var config = HazyRegionConfig.Get(incidentId);
                    m_BossAliveInfo.gameObject.SetActive(true);
                    m_PlayerCount.gameObject.SetActive(bossAlive);
                    m_RebornTime.gameObject.SetActive(!bossAlive);
                    m_Icon.material = bossAlive ? m_SmoothMask.imageMaterials[0] : m_SmoothMask.imageMaterials[1];
@@ -317,8 +337,9 @@
        private void OnPlayerCountRefresh()
        {
            var config = HazyRegionConfig.Get(incidentId);
            if (incidentType == HazyRegionIncidentType.DemonKing
                && !model.InFakeHazyRegion && bossAlive)
                && config.dungeonType != 0 && bossAlive)
            {
                DisplayPlayerCount();
            }
System/HazyRegion/HazyRegionIncidentPanel.cs
@@ -31,7 +31,7 @@
        private void Awake()
        {
            //m_Back.AddListener(OnBack);
            m_Back.AddListener(OnBack);
            m_Goto.AddListener(Goto);
        }
@@ -113,7 +113,7 @@
        void DisplayBackButton()
        {
            m_Back.gameObject.SetActive(false);
            m_Back.gameObject.SetActive(!model.InFakeHazyRegion);
        }
        int Compare(int lhs, int rhs)
System/HazyRegion/HazyRegionModel.cs
@@ -1,8 +1,8 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
using UnityEngine;
namespace Snxxz.UI
{
    [XLua.LuaCallCSharp]
@@ -27,9 +27,23 @@
            IncidentState.Complete,
        };
        public const int PRECIOUS_CLIENTDATAMAP = 31190;
        public int limitPoint { get; private set; }
        public int point { get; private set; }
        public int processingIncidentId { get; private set; }
        public int processingIncidentId
        {
            get
            {
                return LocalSave.GetInt(StringUtility.Contact("HazyIncidentId", PlayerDatas.Instance.PlayerId));
            }
            private set
            {
                LocalSave.SetInt(StringUtility.Contact("HazyIncidentId", PlayerDatas.Instance.PlayerId), value);
            }
        }
        public int adventureDialogueId { get; private set; }
        public bool playing { get; private set; }
        public bool satisfyFakeOpen { get; private set; }
@@ -109,7 +123,7 @@
            if (AdventureStage.Instance.IsInAdventureStage)
            {
                ClientDungeonStageUtility.RequestStartClientDungeon(0, 0);
                ClientDungeonStageUtility.RequestStartClientDungeon(0, 0, null);
            }
            UpdateRedpoint();
@@ -244,7 +258,7 @@
                switch ((HazyRegionIncidentType)config.incidentType)
                {
                    case HazyRegionIncidentType.DemonKing:
                        if (!InFakeHazyRegion && !findPreciousModel.IsBossAlive(config.npcId))
                        if (config.dungeonType != 0 && !findPreciousModel.IsBossAlive(config.npcId))
                        {
                            error = 5;
                            return false;
@@ -351,9 +365,9 @@
            {
                return false;
            }
            if (mapId == HazyDemonKingModel.Client_MapID
                || mapId == HazyGrassModel.Client_FairyGrassMapID
                || mapId == HazyGrassModel.Client_ReikiGrassMapID)
            if (mapId == HazyDemonKingModel.CLIENTDATAMAP
                || mapId == HazyGrassModel.FAIRY_CLIENTDATAMAP
                || mapId == HazyGrassModel.REIKI_CLIENTDATAMAP)
            {
                return true;
            }
@@ -464,30 +478,32 @@
            switch ((HazyRegionIncidentType)config.incidentType)
            {
                case HazyRegionIncidentType.Adventure:
                    InitializeAdventure();
                    ClientDungeonStageUtility.RequestStartClientDungeon(0, 0, (dungeonInfo, isOk) =>
                      {
                          InitializeAdventure();
                    WindowJumpMgr.Instance.ClearJumpData();
                    WindowCenter.Instance.CloseAll(WindowCenter.CloseAllIgnoreType.BaseAndCustom);
                          WindowJumpMgr.Instance.ClearJumpData();
                          WindowCenter.Instance.CloseAll(WindowCenter.CloseAllIgnoreType.BaseAndCustom);
                    var hero = PlayerDatas.Instance.hero;
                    if (hero != null)
                    {
                        hero.StopAll();
                    }
                          var hero = PlayerDatas.Instance.hero;
                          if (hero != null)
                          {
                              hero.StopAll();
                          }
                    AdventureStage.Instance.Enter();
                    Incident incident;
                    if (TryGetIncident(id, out incident))
                    {
                        if (incident.state == IncidentState.UnStart)
                        {
                            SendSwitchAdventureState(id, 2);
                        }
                    }
                          AdventureStage.Instance.Enter();
                          Incident incident;
                          if (TryGetIncident(id, out incident))
                          {
                              if (incident.state == IncidentState.UnStart)
                              {
                                  SendSwitchAdventureState(id, 2);
                              }
                          }
                      });
                    break;
                case HazyRegionIncidentType.DemonKing:
                    if (InFakeHazyRegion)
                    if (config.dungeonType == 0)
                    {
                        hazyDemonKingModel.RequestEnterClientDungeon();
                    }
@@ -498,7 +514,7 @@
                    break;
                case HazyRegionIncidentType.FairyGrass:
                case HazyRegionIncidentType.ReikiGrass:
                    if (InFakeHazyRegion)
                    if (config.dungeonType == 0)
                    {
                        hazyGrassModel.RequestEnterClientDungeon();
                    }
@@ -508,16 +524,15 @@
                    }
                    break;
                case HazyRegionIncidentType.Precious:
                    SendGotoIncidentDungeon(config);
                    BossShowModel.Instance.reqDungeonLineId = 0;
                    ClientDungeonStageUtility.GotoNormalClientDungeon(config.dungeonId, config.dungeonId, config.lineId);
                    break;
            }
        }
        void SendGotoIncidentDungeon(HazyRegionConfig config)
        {
            if (config.dungeonId == HazyGrassModel.FairyGrassMapId ||
                config.dungeonId == HazyGrassModel.ReikiGrassMapId ||
                config.dungeonId == HazyDemonKingModel.DEMONKINGMAPID2)
            if (config.dungeonType == 2)
            {
                var pak = new CC105_tagCMEnterCrossServer();
                pak.DataMapID = (uint)config.dungeonId;
@@ -569,6 +584,11 @@
            if (package.IsAll == 1)
            {
                m_Incidents.Clear();
            }
            if (package.State != 1)
            {
                hazyGrassModel.DeleteLocalSaveKey();
            }
            for (int i = 0; i < package.Count; i++)
@@ -689,5 +709,5 @@
        DemonKing,
        ReikiGrass,
    }
}
}
System/HazyRegion/HazyRegionWin.cs
@@ -206,7 +206,7 @@
            if (allComplete)
            {
                model.SendBackHazyRegion();
                WindowCenter.Instance.Open<HazyRegionCompleteWin>();
            }
        }
System/Skill/ExpertSkillSelectWin.cs
@@ -99,7 +99,7 @@
            if (flyObject != null)
            {
                GameObject.Destroy(flyObject);
                GameObject.Destroy(flyObject.gameObject);
                flyObject = null;
            }
@@ -398,7 +398,7 @@
            {
                if (flyObject != null)
                {
                    GameObject.Destroy(flyObject);
                    GameObject.Destroy(flyObject.gameObject);
                    flyObject = null;
                }
System/Treasure/ClientTreasureDungeon.cs
File was deleted
System/Treasure/ClientTreasureDungeonStage.cs
@@ -108,7 +108,7 @@
    {
        IsCompleteDialogue = true;
        var pak = new CA50E_tagCMOpenMagicWeapon();
        pak.MWID = (uint)ClientTreasureDungeon.challengeTreasureId;
        pak.MWID = (uint)101;
        GameNetSystem.Instance.SendInfo(pak);
    }
@@ -116,7 +116,7 @@
    {
        if (!IsCompleteDialogue)
        {
            ClientTreasureDungeon.RequestExit();
            ClientDungeonStageUtility.ExitNormalClientDungeon();
        }
    }
System/Treasure/DemonDungeonChallengeConfirmWin.cs
New file
@@ -0,0 +1,119 @@
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Thursday, May 23, 2019
//--------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace Snxxz.UI
{
    public class DemonDungeonChallengeConfirmWin : Window
    {
        [SerializeField] Text m_Remind;
        [SerializeField] Button m_GetFightPower;
        [SerializeField] Button m_GetDefense;
        [SerializeField] Button m_Challenge;
        [SerializeField] Button m_Close;
        public static int treasureId = 0;
        TreasureModel model { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } }
        #region Built-in
        protected override void BindController()
        {
        }
        protected override void AddListeners()
        {
            m_GetFightPower.AddListener(GetFightPower);
            m_GetDefense.AddListener(GetDefense);
            m_Challenge.AddListener(Challenge);
            m_Close.AddListener(CloseClick);
        }
        protected override void OnPreOpen()
        {
            Display();
        }
        protected override void OnAfterOpen()
        {
        }
        protected override void OnPreClose()
        {
        }
        protected override void OnAfterClose()
        {
        }
        #endregion
        void Display()
        {
            var fightPower = PlayerDatas.Instance.baseData.FightPoint;
            var defense = UIHelper.GetPropertyValue(PropertyType.DEF);
            var recommandPower = 0;
            var recommandDefense = 0;
            TreasureDungeon treasureDungeon;
            if (model.TryGetTreasureDungeon(treasureId, out treasureDungeon))
            {
                var dungeonInfo = treasureDungeon.Get(treasureDungeon.currentLevel + 1);
                if (!dungeonInfo.Equals(default(TreasureDungeonInfo)))
                {
                    recommandPower = dungeonInfo.fightPower;
                    recommandDefense = dungeonInfo.defense;
                }
            }
            m_GetFightPower.gameObject.SetActive(fightPower < recommandPower);
            m_GetDefense.gameObject.SetActive(defense < recommandDefense);
            m_Challenge.gameObject.SetActive(fightPower >= recommandPower
                || defense >= recommandDefense);
            if (fightPower < recommandPower && defense < recommandDefense)
            {
                m_Remind.text = Language.Get("DemonDungeonNextError_1");
            }
            else if (fightPower < recommandPower)
            {
                m_Remind.text = Language.Get("DemonDungeonNextError_2");
            }
            else
            {
                m_Remind.text = Language.Get("DemonDungeonNextError_3");
            }
        }
        private void GetFightPower()
        {
            CloseImmediately();
            WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.RolePromote);
        }
        private void Challenge()
        {
            var config = TreasureConfig.Get(treasureId);
            ModelCenter.Instance.GetModel<DungeonModel>().SingleChallenge(TreasureModel.TREASURE_DATAMAPID, config.LineId);
        }
        private void GetDefense()
        {
            CloseImmediately();
            RealmRecommandEquipGetWayWin.equipGetWays.Clear();
            RealmRecommandEquipGetWayWin.equipGetWays.AddRange(GeneralDefine.defenseGetWays);
            WindowCenter.Instance.Open<RealmRecommandEquipGetWayWin>();
        }
    }
}
System/Treasure/DemonDungeonChallengeConfirmWin.cs.meta
File was renamed from System/Treasure/ClientTreasureDungeon.cs.meta
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 189ce34976654c34da06b3239c45076d
timeCreated: 1556000158
guid: 4517485b35c8cd84096a53b33739c393
timeCreated: 1558591909
licenseType: Pro
MonoImporter:
  serializedVersion: 2
System/Treasure/DemonTreasureWin.cs
@@ -187,30 +187,15 @@
                }
            }
            if (fightPower < recommandPower && defense < recommandDefense)
            if (fightPower < recommandPower || defense < recommandDefense)
            {
                SysNotifyMgr.Instance.ShowTip("TreasureDungeonGotoError_1");
                DemonDungeonChallengeConfirmWin.treasureId = model.selectedTreasure;
                WindowCenter.Instance.Open<DemonDungeonChallengeConfirmWin>();
                return;
            }
            var config = TreasureConfig.Get(model.selectedTreasure);
            if (fightPower < recommandPower && model.selectedTreasure != 201)
            {
                ConfirmCancel.ShowPopConfirm(Language.Get("DemonLackPowerTitle"), Language.Get("DemonLackFightPower", recommandPower)
                    , (bool isOk) =>
                     {
                         if (isOk)
                         {
                             model.collectingDemon = model.selectedTreasure;
                             dungeonModel.SingleChallenge(TreasureModel.TREASURE_DATAMAPID, config.LineId);
                         }
                     });
            }
            else
            {
                model.collectingDemon = model.selectedTreasure;
                dungeonModel.SingleChallenge(TreasureModel.TREASURE_DATAMAPID, config.LineId);
            }
            dungeonModel.SingleChallenge(TreasureModel.TREASURE_DATAMAPID, config.LineId);
        }
        private void Display()
System/Treasure/HumanTreasureWin.cs
@@ -312,7 +312,7 @@
            {
                if (model.selectedTreasure == 101)
                {
                    ClientTreasureDungeon.RequestEnter(101);
                    ClientDungeonStageUtility.GotoNormalClientDungeon(4000, 0, 0);
                    return;
                }
                if (PlayerDatas.Instance.baseData.LV >= config.ChallengeLevel)
System/Treasure/TreasureDungeonVictoryWin.cs
@@ -79,7 +79,7 @@
            }
            else
            {
                treasureId = ClientTreasureDungeon.challengeTreasureId;
                treasureId = 101;
            }
            var config = TreasureConfig.Get(treasureId);
System/WindowJump/WindowJumpMgr.cs
@@ -738,6 +738,9 @@
                ModelCenter.Instance.GetModel<EquipModel>().SelectSet(equipLevel);
                SetJumpLogic<RealmEquipWin>(_tagWinSearchModel.TABID);
                break;
            case JumpUIType.RolePromote:
                SetJumpLogic<RolePromoteWin>(_tagWinSearchModel.TABID);
                break;
            default:
                DebugEx.Log("未添加此跳转界面:" + jumpType);
                IsJumpState = false;
@@ -1683,6 +1686,7 @@
    FullServerAuction = 319,
    AlchemyNormal = 320,
    AlchemyFairy = 321,
    RolePromote = 322,
    DhszTs = 1001,//定海神针功法提升界面
    HyqTs = 1002,//皓月枪功法提升界面
Utility/EnumHelper.cs
@@ -133,6 +133,7 @@
    SGZC_FightAssist = 21,// 上古战场助战
    MonsterTime = 22,// 按时间掉血
    PersonalEnemy = 23,// 专属敌人
    PersonalEnemyPVP = 24,// 专属敌人
    OpenWorldMap = 99,// 打开世界地图
}
@@ -1246,34 +1247,34 @@
    /** 普通伤害 */
    Normal = 1,
    /** 恢复 */
    Recovery=2,
    Recovery = 2,
    /** 反弹伤害 */
    BounceHurt=3,
    BounceHurt = 3,
    /** 留血 */
    Bleed=4,
    Bleed = 4,
    /** 抵御 */
    Parry=5,
    Parry = 5,
    /** 连击 */
    DoubleHit=6,
    DoubleHit = 6,
    /** 暴击 */
    SuperHit=7,
    SuperHit = 7,
    /** 会心一击 */
    LuckyHit=8,
    LuckyHit = 8,
    /** 闪避 */
    Miss=9,
    Miss = 9,
    /** 免疫 */
    Immune=10,
    Immune = 10,
    /** 压制 */
    Suppress=11,
    Suppress = 11,
    /**斩杀**/
    ZhanSha=12,
    ZhanSha = 12,
    /** 诛仙一击 */
    ZhuXianAtk=13,
    ZhuXianAtk = 13,
    /** 终极斩杀 */
    FinalKill=14,
    FinalKill = 14,
    /*致命一击*/
    DeadlyHit=15,
    ThumpHit=16,// 重击
    DeadlyHit = 15,
    ThumpHit = 16,// 重击
    Yinji = 16,// 印记
    Burning = 17,// 灼烧
}
Utility/GlobalTimeEvent.cs
@@ -8,6 +8,7 @@
{
    public event Action secondEvent;
    public event Action fiveSecondEvent;
    public event Action minuteEvent;
    public event Action fiveMinuteEvent;
    public event Action tenMinuteEvent;
@@ -16,6 +17,7 @@
    public event Action halfMinuteEvent;
    int secondBuf = -1;
    int fiveSecondBuf = -1;
    int minuteBuf = -1;
    int fiveMinuteBuf = -1;
    int tenMinuteBuf = -1;
@@ -41,6 +43,27 @@
            secondBuf = second;
        }
        var fiveSecond = second / 5;
        if (fiveSecondBuf != fiveSecond)
        {
            try
            {
                if (fiveSecondEvent != null)
                {
                    fiveSecondEvent();
                }
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
            finally
            {
                fiveSecondBuf = fiveSecond;
            }
        }
        var minute = DateTime.Now.Minute;
        if (minuteBuf != minute)
        {