OpenSim.Region.ScriptEngine.Shared.Api.LSL_Api.llGodLikeRezObject C# (CSharp) Method

llGodLikeRezObject() public method

public llGodLikeRezObject ( string inventory, OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3 pos ) : void
inventory string
pos OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3
return void
        public void llGodLikeRezObject(string inventory, LSL_Vector pos)
        {
            m_host.AddScriptLPS(1);

            if (!World.Permissions.IsGod(m_host.OwnerID))
                NotImplemented("llGodLikeRezObject");

            AssetBase rezAsset = World.AssetService.Get(inventory);
            if (rezAsset == null)
            {
                llSay(0, "Asset not found");
                return;
            }

            SceneObjectGroup group = null;

            try
            {
                string xmlData = Utils.BytesToString(rezAsset.Data);
                group = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
            }
            catch
            {
                llSay(0, "Asset not found");
                return;
            }

            if (group == null)
            {
                llSay(0, "Asset not found");
                return;
            }

            group.RootPart.AttachPoint = group.RootPart.Shape.State;
            group.RootPart.AttachedPos = group.AbsolutePosition;

            group.ResetIDs();

            Vector3 llpos = new Vector3((float)pos.x, (float)pos.y, (float)pos.z);
            World.AddNewSceneObject(group, true, llpos, Quaternion.Identity, Vector3.Zero);
            group.CreateScriptInstances(0, true, World.DefaultScriptEngine, 3);
            group.ScheduleGroupForFullUpdate();

            // objects rezzed with this method are die_at_edge by default.
            group.RootPart.SetDieAtEdge(true);

            group.ResumeScripts();

            m_ScriptEngine.PostObjectEvent(m_host.LocalId, new EventParams(
                    "object_rez", new Object[] {
                    new LSL_String(
                    group.RootPart.UUID.ToString()) },
                    new DetectParams[0]));
        }
LSL_Api