BuildNpcStopSkillMessage() static private method

static private BuildNpcStopSkillMessage ( EntityInfo obj ) : Msg_RC_NpcStopSkill
obj EntityInfo
return GameFrameworkMessage.Msg_RC_NpcStopSkill
示例#1
0
        private void OnAiStopSkill(EntityInfo npc)
        {
            Scene scene = npc.SceneContext.CustomData as Scene;

            if (null != scene)
            {
                SkillInfo skillInfo = npc.GetSkillStateInfo().GetCurSkillInfo();
                if (null == skillInfo || skillInfo.IsSkillActivated)
                {
                    scene.SkillSystem.StopAllSkill(npc.GetId(), true);
                }

                Msg_RC_NpcStopSkill skillBuilder = DataSyncUtility.BuildNpcStopSkillMessage(npc);

                LogSystem.Info("Send Msg_RC_NpcStopSkill, EntityId={0}",
                               npc.GetId());
                scene.NotifyAllUser(RoomMessageDefine.Msg_RC_NpcStopSkill, skillBuilder);
            }
        }
示例#2
0
        public static void Execute(object msg, User user)
        {
            Msg_CR_StopSkill stopMsg = msg as Msg_CR_StopSkill;

            if (null == stopMsg)
            {
                return;
            }
            EntityInfo userInfo = user.Info;

            if (null == userInfo)
            {
                return;
            }
            Scene scene = user.OwnRoomUserManager.ActiveScene;

            if (null != scene)
            {
                Msg_RC_NpcStopSkill retMsg = DataSyncUtility.BuildNpcStopSkillMessage(userInfo);
                scene.NotifyAllUser(RoomMessageDefine.Msg_RC_NpcStopSkill, retMsg);
            }
        }
        internal static void Execute(object msg, User user)
        {
            Msg_CR_StopSkill stopMsg = msg as Msg_CR_StopSkill;

            if (null == stopMsg)
            {
                return;
            }
            EntityInfo userInfo = user.Info;

            if (null == userInfo)
            {
                return;
            }
            Scene scene = user.OwnRoom.ActiveScene;

            if (null != scene)
            {
                scene.SkillSystem.StopAllSkill(userInfo.GetId(), true);

                Msg_RC_NpcStopSkill retMsg = DataSyncUtility.BuildNpcStopSkillMessage(userInfo);
                scene.NotifyAllUser(RoomMessageDefine.Msg_RC_NpcStopSkill, retMsg);
            }
        }