private AiData_Demo_Melee GetAiData(NpcInfo npc)
        {
            AiData_Demo_Melee data = npc.GetAiStateInfo().AiDatas.GetData <AiData_Demo_Melee>();

            if (null == data)
            {
                data = new AiData_Demo_Melee();
                npc.GetAiStateInfo().AiDatas.AddData(data);
            }
            return(data);
        }
        protected override void OnStateLogicInit(NpcInfo npc, AiCommandDispatcher aiCmdDispatcher, long deltaTime)
        {
            NpcAiStateInfo info = npc.GetAiStateInfo();

            info.Time = 0;
            npc.GetMovementStateInfo().IsMoving = false;
            info.HomePos = npc.GetMovementStateInfo().GetPosition3D();
            info.Target  = 0;
        }
예제 #3
0
        public void NpcFace(NpcInfo npc, AbstractNpcStateLogic logic)
        {
            NpcFaceCommand cmd = m_NpcFaceCommandPool.Alloc();

            if (null != cmd)
            {
                cmd.SetContext(npc, logic);
                cmd.Init();
                npc.GetAiStateInfo().CommandQueue.Enqueue(cmd);
            }
        }
        private void CombatHandler(NpcInfo npc, AiCommandDispatcher aiCmdDispatcher, long deltaTime)
        {
            NpcAiStateInfo info = npc.GetAiStateInfo();

            info.Time += deltaTime;
            if (info.Time > m_IntervalTime)
            {
                info.Time = 0;
                SkillInfo skillInfo = npc.GetSkillStateInfo().GetSkillInfoByIndex(0);
                NotifyNpcSkill(npc, skillInfo.SkillId);
            }
        }