public void UpdateEngagement(PNpcEngagement engagementMsg) { if (m_engagementMsg == null) { m_engagementMsg = engagementMsg; } isCurEngagement = true; }
void _Packet(ScNpcDatingSelectNpc p) { if (p.result != 0) { return; } var npc = GetTargetNpc((NpcTypeID)p.npc.npcId); if (npc == null) { return; } PNpcEngagement engagementMsg = null; p.npc.CopyTo(ref engagementMsg); npc.UpdateEngagement(engagementMsg); }
public NpcMessage(PNpcInfo _npcinfo, PNpcEngagement engagement = null) { m_npcInfo = _npcinfo; npcInfo = ConfigManager.Get <NpcInfo>(m_npcInfo.npcId); if (npcInfo == null) { return; } actionInfo = ConfigManager.Get <NpcActionInfo>(m_npcInfo.npcId); m_engagementMsg = engagement; isCurEngagement = engagement != null; if (m_engagementMsg != null) { Logger.LogDetail("m_engagementMsg.npcid={0}", m_engagementMsg.npcId); lastMood = m_engagementMsg.mood; lastBodyPower = m_engagementMsg.bodyPower; } }
/// <summary> /// NPC信息 /// </summary> /// <param name="p"></param> void _Packet(ScNpcInfo p) { if (p != null && p.npcinfos != null && p.npcinfos.Length > 0) { m_allNpcs.Clear(); m_allNpcInfo.Clear(); PNpcInfo[] infos = null; p.npcinfos.CopyTo(ref infos); List <PNpcInfo> list = new List <PNpcInfo>(infos); list.Sort((a, b) => a.npcId.CompareTo(b.npcId)); PNpcEngagement engagement = null; if (p.engagementNpc != null) { p.engagementNpc.CopyTo(ref engagement); } for (int i = 0; i < list.Count; i++) { NpcMessage msg = null; if (engagement != null && engagement.npcId == list[i].npcId) { msg = new NpcMessage(list[i], engagement); } else { msg = new NpcMessage(list[i]); } if (msg.isNull || msg.npcInfo == null || msg.npcInfo.type == 2) { continue; } m_allNpcs.Add(msg); m_allNpcInfo.Add((NpcTypeID)list[i].npcId, msg); } DispatchModuleEvent(EventReceiveLoginNpcInfo); } }