少年修仙传客户端代码仓库
client_Hale
2019-05-25 d8059db594b18ed7b4716a0b269c4ac3aab28303
382 0406出现包增加木桩绑定怪逻辑
1个文件已修改
47 ■■■■■ 已修改文件
Fight/GameActor/PersonalEnemy.cs 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Fight/GameActor/PersonalEnemy.cs
@@ -84,6 +84,53 @@
        GAMgr.Instance.Release(npc);
    }
    public static void Bind(H0406_tagNPCAppear h0406)
    {
        if (!BindInfoDict.ContainsKey(h0406.NPCID))
        {
            return;
        }
        if (BindInfoDict[h0406.NPCID].Count == 0)
        {
            BindInfoDict.Remove(h0406.NPCID);
            return;
        }
        var _bindInfo = BindInfoDict[h0406.NPCID][0];
        var _config = NPCConfig.Get((int)h0406.NPCID);
        GA_NpcClientFightNorm _npc = null;
        if (_config.IsBoss != (int)E_MonsterType.Normal
         && _config.IsBoss != (int)E_MonsterType.Elite)
        {
            _npc = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightBoss>(_bindInfo.npcID, _bindInfo.g);
        }
        else
        {
            _npc = GAMgr.Instance.ReqClntFightNpc<GA_NpcClientFightNorm>(_bindInfo.npcID, _bindInfo.g);
        }
        if (_npc != null)
        {
            var _vaildPos = _bindInfo.pos;
            GActor.TryGetValidPos(_bindInfo.pos, ref _vaildPos);
            _npc.BornPos = _npc.Pos = _vaildPos;
            m_CBinSdDict[_npc.ServerInstID] = h0406.ObjID;
            m_SBindCDict[h0406.ObjID] = _npc.ServerInstID;
            _npc.ActorInfo.Hp = h0406.NPCHP;
            _npc.ActorInfo.HpEx = h0406.NPCHPEx;
            _npc.ActorInfo.MaxHp = h0406.MaxHP;
            _npc.ActorInfo.MaxHpEx = h0406.MaxHPEx;
            _npc.ActorInfo.moveSpeed = 500f / h0406.Speed;
            if (OnNpcAppear != null)
            {
                OnNpcAppear(_npc);
            }
        }
        BindInfoDict[h0406.NPCID].RemoveAt(0);
    }
    public static void Bind(H0408_tagPlayerSummonNPCAppear h0408)
    {
        if (!BindInfoDict.ContainsKey(h0408.NPCID))