예제 #1
0
        public void botSetMap(string keyOfBot, LSL_List positions, LSL_List movementType, LSL_Integer flags)
        {
            if (!ScriptProtection.CheckThreatLevel(ThreatLevel.Moderate, "botSetMap", m_host, "bot", m_itemID))
            {
                return;
            }
            List <Vector3> PositionsMap = new List <Vector3>();

            for (int i = 0; i < positions.Length; i++)
            {
                LSL_Vector pos = positions.GetVector3Item(i);
                PositionsMap.Add(new Vector3((float)pos.x, (float)pos.y, (float)pos.z));
            }
            List <TravelMode> TravelMap = new List <TravelMode>();

            for (int i = 0; i < movementType.Length; i++)
            {
                LSL_Integer travel = movementType.GetLSLIntegerItem(i);
                TravelMap.Add((TravelMode)travel.value);
            }

            IBotManager manager = World.RequestModuleInterface <IBotManager>();

            if (manager != null)
            {
                manager.SetBotMap(UUID.Parse(keyOfBot), PositionsMap, TravelMap, flags.value, m_host.OwnerID);
            }
        }
예제 #2
0
        public void llNavigateTo(LSL_Vector point, LSL_List options)
        {
            List <Vector3> positions = new List <Vector3>()
            {
                point.ToVector3()
            };
            List <TravelMode> travelMode = new List <TravelMode>()
            {
                TravelMode.Walk
            };
            IBotManager botManager = World.RequestModuleInterface <IBotManager>();
            int         flags      = 0;

            if (options.Length > 0)
            {
                flags |= options.GetLSLIntegerItem(0);
            }
            if (botManager != null)
            {
                botManager.SetBotMap(m_host.ParentEntity.UUID, positions, travelMode, flags, m_host.ParentEntity.OwnerID);
            }
        }
예제 #3
0
        public void llPatrolPoints(LSL_List patrolPoints, LSL_List options)
        {
            List <Vector3>    positions  = new List <Vector3>();
            List <TravelMode> travelMode = new List <TravelMode>();

            foreach (object pos in patrolPoints.Data)
            {
                if (!(pos is LSL_Vector))
                {
                    continue;
                }
                LSL_Vector p = (LSL_Vector)pos;
                positions.Add(p.ToVector3());
                travelMode.Add(TravelMode.Walk);
            }
            IBotManager botManager = World.RequestModuleInterface <IBotManager>();

            if (botManager != null)
            {
                botManager.SetBotMap(m_host.ParentEntity.UUID, positions, travelMode, 1, m_host.ParentEntity.OwnerID);
            }
        }
예제 #4
0
파일: Bot_API.cs 프로젝트: kow/Aurora-Sim
        public void botSetMap(string keyOfBot, LSL_List positions, LSL_List movementType)
        {
            List <Vector3> PositionsMap = new List <Vector3>();

            for (int i = 0; i < positions.Length; i++)
            {
                LSL_Vector pos = positions.GetVector3Item(i);
                PositionsMap.Add(new Vector3((float)pos.x, (float)pos.y, (float)pos.z));
            }
            List <TravelMode> TravelMap = new List <TravelMode>();

            for (int i = 0; i < movementType.Length; i++)
            {
                LSL_Integer travel = movementType.GetLSLIntegerItem(i);
                TravelMap.Add((TravelMode)travel.value);
            }

            IBotManager manager = World.RequestModuleInterface <IBotManager>();

            if (manager != null)
            {
                manager.SetBotMap(UUID.Parse(keyOfBot), PositionsMap, TravelMap);
            }
        }