예제 #1
0
        public static void FindNpc(int npcID)
        {
            KNpcPos npcPos = NpcLogic.GetInstance().GetNpcPosByID(npcID);

            if (npcPos != null)
            {
                Vector3 rolePosition = MapUtils.GetMetreFromInt(npcPos.nPathX, npcPos.nPathZ, npcPos.nPathY);
                Goto(npcPos.MapID, rolePosition);

                KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(npcID);
                if (null != npcInfo && npcInfo.HeroType == Assets.Scripts.Define.KHeroObjectType.hotMonster)
                {
                    NPC_ID      = npcID;
                    bAutoAttack = true;
                }
                //SceneLogic.GetInstance().MainHero.property.CmdAutoAttack = (npcInfo.HeroType == Assets.Scripts.Define.KHeroObjectType.hotMonster);
            }
        }
예제 #2
0
        public static void FindNpcAndOpen(int npcID)
        {
            if (NpcLogic.GetInstance().CheckNpcNearby(npcID) == true)
            {
                EventDispatcher.GameWorld.Dispath(ControllerCommand.OPEN_NPC_PANEL_BYID, npcID);
                return;
            }

            KNpcPos npcPos = NpcLogic.GetInstance().GetNpcPosByID(npcID);

            if (npcPos != null)
            {
                NPC_ID = npcID;
                Vector3 rolePosition = MapUtils.GetMetreFromInt(npcPos.nPathX, npcPos.nPathZ, npcPos.nPathY);
                Goto(npcPos.MapID, rolePosition);

                KHeroSetting npcInfo = NpcLogic.GetInstance().GetNpcLocalInfo(npcID);
                if (null != npcInfo)
                {
                    bAutoAttack = (npcInfo.HeroType == Assets.Scripts.Define.KHeroObjectType.hotMonster);
                }
                //SceneLogic.GetInstance().MainHero.property.CmdAutoAttack = (npcInfo.HeroType == Assets.Scripts.Define.KHeroObjectType.hotMonster);
            }
        }