Ejemplo n.º 1
0
 void SetCampNpOnTrigger(GameCmd.eCamp mycamp)
 {
     Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();
     if (es != null)
     {
         es.FindAllEntity <Client.INPC>(ref m_lstNpc);
         for (int i = 0; i < m_lstNpc.Count; i++)
         {
             Client.INPC   npc  = m_lstNpc[i];
             GameCmd.eCamp camp = (GameCmd.eCamp)npc.GetProp((int)Client.CreatureProp.Camp);
             if (mycamp != camp)
             {
                 CampNpcOnTrigger callback = new CampNpcOnTrigger();
                 npc.SetCallback(callback);
                 UnityEngine.Debug.Log("SetCallback : " + npc.GetName());
             }
         }
         m_lstNpc.Clear();
     }
 }
Ejemplo n.º 2
0
    bool IsNeedSetTip(Client.INPC en, ref List <QuestTraceInfo> traceTask, out int index)
    {
        index = -1;
        if (en == null)
        {
            return(false);
        }

        if (en.IsMonster())
        {
            return(false);
        }
        QuestTraceInfo tranceInfo = null;

        GameCmd.TaskProcess process = GameCmd.TaskProcess.TaskProcess_Max;
        for (int i = 0; i < traceTask.Count; i++)
        {
            int npcid = en.GetProp((int)Client.EntityProp.BaseID);
            tranceInfo = traceTask[i];
            process    = tranceInfo.GetTaskProcess();
            if (process == GameCmd.TaskProcess.TaskProcess_None)
            {
                if (tranceInfo.beginNpc == npcid)
                {
                    index = i;
                    return(true);
                }
            }
            else if (process == GameCmd.TaskProcess.TaskProcess_CanDone ||
                     process == GameCmd.TaskProcess.TaskProcess_Doing)
            {
                if (tranceInfo.endNpc == npcid)
                {
                    index = i;
                    return(true);
                }
            }
        }
        return(false);
    }