Example #1
0
    private bool CheckNpcType(KHeroType npcType)
    {
        switch (npcType)
        {
        case KHeroType.htMonster:
            return(true);

        case KHeroType.htBoss:
            return(true);

        case KHeroType.htPlotMonster:
            return(true);

        case KHeroType.htEliteMonster1:
            return(true);

        case KHeroType.htEliteMonster2:
            return(true);

        case KHeroType.htEliteMonster3:
            return(true);

        default:
            return(false);
        }
    }
Example #2
0
    /// <summary>
    /// 保存附近怪物信息
    /// </summary>
    public void SaveNewMonster(S2C_SYNC_NEW_HERO msg)
    {
        if (m_NeedAddUpdate)
        {
            m_NeedAddUpdate = false;
            ServerTimeUtil.Instance.OnTick += Update;
        }

        if (msg == null || msg.ownerPlayerID != 0)
        {
            return;
        }

        Npc       npcData = m_CfgEternityProxy.GetNpcByKey((uint)msg.templateID);
        KHeroType npcType = (KHeroType)npcData.NpcType;

        if (CheckNpcType(npcType))
        {
            if (!m_NearbyMonsterList.Contains(msg.id))
            {
                m_NearbyMonsterList.Add(msg.id);
            }
        }
    }