internal static void Execute(object msg, User user) { Msg_CRC_NpcStopSkill end_skill = msg as Msg_CRC_NpcStopSkill; if (end_skill == null) { return; } Scene scene = user.OwnRoom.GetActiveScene(); if (null != scene) { CharacterInfo charactor = scene.SceneContext.GetCharacterInfoById(end_skill.npc_id); if (charactor == null) { LogSys.Log(LOG_TYPE.ERROR, "NpcStopSkillHandler, charactor {0} not exist", user.RoleId); return; } if (charactor.OwnerId != user.RoleId) { LogSys.Log(LOG_TYPE.ERROR, "NpcStopSkillHandler, charactor {0} owner {1} not user {2}", charactor.GetId(), charactor.OwnerId, user.RoleId); return; } scene.SkillSystem.StopSkill(end_skill.npc_id); user.BroadCastMsgToRoom(end_skill); } }
internal static void Execute(object msg, NetConnection conn, NetworkSystem networkSystem) { Msg_CRC_NpcStopSkill targetmsg = msg as Msg_CRC_NpcStopSkill; if (null == targetmsg) { return; } }
private void OnNpcStopSkill(NpcInfo npc) { Scene scene = npc.SceneContext.CustomData as Scene; if (null != scene) { SkillInfo skillInfo = npc.GetSkillStateInfo().GetCurSkillInfo(); if (null == skillInfo || skillInfo.IsSkillActivated) { scene.SkillSystem.StopSkill(npc.GetId()); } Msg_CRC_NpcStopSkill skillBuilder = new Msg_CRC_NpcStopSkill(); skillBuilder.npc_id = npc.GetId(); LogSystem.Debug("Send Msg_RC_NpcStopSkill, EntityId={0}", npc.GetId()); scene.NotifyAreaUser(npc, skillBuilder); } }