Esempio n. 1
0
    void AddNpcTip(Client.IEntity entity, uint effectId, uint nTaskId, GameCmd.TaskProcess process)
    {
        NpcTips tips;

        if (m_DictNpceffect.TryGetValue(entity.GetID(), out tips))
        {
            if (tips.process == process)
            {
                return;
            }
        }

        table.FxResDataBase edb = GameTableManager.Instance.GetTableItem <table.FxResDataBase>(effectId);
        if (edb != null)
        {
            Client.AddLinkEffect   node  = new Client.AddLinkEffect();
            table.ResourceDataBase resDB = GameTableManager.Instance.GetTableItem <table.ResourceDataBase>(edb.resPath);
            if (resDB == null)
            {
                Engine.Utility.Log.Error("找不到特效资源路径配置{0}", edb.resPath);
            }
            node.strEffectName = resDB.strPath;
            node.strLinkName   = edb.attachNode;
            node.nFollowType   = (int)edb.flowType;
            node.rotate        = new UnityEngine.Vector3(edb.rotate[0], edb.rotate[1], edb.rotate[2]);
            node.vOffset       = new UnityEngine.Vector3(edb.offset[0], edb.offset[1], edb.offset[2]);
            node.strEffectName = resDB.strPath;
            node.strLinkName   = edb.attachNode;
            if (node.strEffectName.Length != 0)
            {
                int eId = (int)entity.SendMessage(Client.EntityMessage.EntityCommand_AddLinkEffect, node);
                if (m_DictNpceffect.ContainsKey(entity.GetID()))
                {
                    entity.SendMessage(Client.EntityMessage.EntityCommand_RemoveLinkEffect, m_DictNpceffect[entity.GetID()].effectid);
                    m_DictNpceffect[entity.GetID()].effectid = eId;
                    m_DictNpceffect[entity.GetID()].process  = process;
                }
                else
                {
                    m_DictNpceffect.Add(entity.GetID(), new NpcTips()
                    {
                        effectid = eId, npcid = entity.GetID(), taskid = nTaskId, process = process
                    });
                }
            }
        }
    }
Esempio n. 2
0
 public void Reset()
 {
     Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();
     if (es != null)
     {
         if (m_DictNpceffect != null)
         {
             foreach (var item in m_DictNpceffect)
             {
                 Client.IEntity en = es.FindNPC(item.Key);
                 if (en != null)
                 {
                     en.SendMessage(Client.EntityMessage.EntityCommand_RemoveLinkEffect, item.Value.effectid);
                 }
             }
             m_DictNpceffect.Clear();
         }
     }
 }
Esempio n. 3
0
    public void Execute(stBroadCastRideUserCmd_S cmd)
    {//广播的发的是坐骑的baseid
        Client.IEntitySystem es = Client.ClientGlobal.Instance().GetEntitySystem();
        if (es == null)
        {
            return;
        }

        Client.IEntity entity = es.FindPlayer(cmd.user_id);
        if (entity != null)
        {
            if (Client.ClientGlobal.Instance().IsMainPlayer(entity))
            {//主角不处理 通过stStatusRideUserCmd_S 唯一决定
                return;
            }
            if (cmd.type == 0)//下马
            {
                bool bRide = (bool)entity.SendMessage(Client.EntityMessage.EntityCommond_IsRide, null);
                if (bRide)
                {
                    entity.SendMessage(Client.EntityMessage.EntityCommond_UnRide, null);
                }
                entity.SetProp((int)Client.PlayerProp.RideBaseId, 0);
                #region 主角废弃
                //if (Client.ClientGlobal.Instance().IsMainPlayer(entity))
                //{
                //    RideMgr.UsingRide = 0;
                //    if (RideMgr.UnRideCallback != null)
                //    {
                //        RideMgr.UnRideCallback(RideMgr.UnRideCallbackParam);
                //        RideMgr.UnRideCallback = null;
                //        RideMgr.UnRideCallbackParam = null;
                //    }
                //}
                #endregion
            }
            else if (cmd.type == 1)//上马
            {
                bool bRide = (bool)entity.SendMessage(Client.EntityMessage.EntityCommond_IsRide, null);
                if (bRide)
                {
                    return;
                }

                entity.SetProp((int)Client.PlayerProp.RideBaseId, (int)cmd.ride_id);
                entity.SendMessage(Client.EntityMessage.EntityCommond_Ride, (int)cmd.ride_id);

                #region 主角废弃
                //if (Client.ClientGlobal.Instance().IsMainPlayer(entity))
                //{
                //    RideMgr.UsingRide = RideMgr.Auto_Ride;

                //    Client.IControllerSystem cs = Client.ClientGlobal.Instance().GetControllerSystem();
                //    if (cs != null)
                //    {
                //        Client.ICombatRobot robot = cs.GetCombatRobot();
                //        if (robot != null && robot.Status != Client.CombatRobotStatus.STOP)
                //        {
                //            robot.Stop();
                //        }
                //    }
                //}
                #endregion
            }
        }
    }