| | |
| | | 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)) |