Navigation

    City of Arabel

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Remains/Creature Treasure

    Scripting
    3
    3
    1505
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      H last edited by

      Does anybody know what the ResRef or tag of these things are? The treasure containers that are created when a creature is killed.

      1 Reply Last reply Reply Quote
      • T
        TheClownIsDown last edited by

        I don't know what the tag is but heres a script I wrote to destroy all the trash littering up areas on my module.

        It cycles through all the objects in the area and deletes it's contents and then deletes the container. I used the GetName(oTrash) == "Remains" because that's the name of the remains so it works :P

        // Destroy all items/remains in area of oWP.
        void DespawnTrash(string sWP)
        {
        object oWP;
        object oArea;
        location lLocation;
        object oTrash;
        object oInvItem;
        oWP = GetWaypointByTag(sWP);
        lLocation = GetLocation(oWP);
        oArea = GetAreaFromLocation(lLocation);
        oTrash = GetFirstObjectInArea(oArea);
        while(GetIsObjectValid(oTrash))
        {
        string sTagPrefix = GetStringLeft(GetTag(oTrash), 15);
        if(GetObjectType(oTrash) == OBJECT_TYPE_ITEM || GetName(oTrash) == "Remains")
        {
        AssignCommand(oTrash, SetIsDestroyable(TRUE));
        if(GetHasInventory(oTrash))
        {
        oInvItem = GetFirstItemInInventory(oTrash);
        while(GetIsObjectValid(oInvItem))
        {
        DestroyObject(oInvItem,0.0);
        oInvItem = GetNextItemInInventory(oTrash);
        }
        }
        else
        {
        DestroyObject(oTrash, 0.0);
        }
        DestroyObject(oTrash, 0.0);
        }
        oTrash = GetNextObjectInArea(oArea);
        }

        }

        -"Sorry I already put my clown down."~Some Judge

        1 Reply Last reply Reply Quote
        • Zool
          Zool last edited by

          Thanks buddy. We already have a script for this, I don't know if it was cancelled or doesnt run in some places or what. There are some issues with running it, like checking it really -should- run right then, so people don't lose out on loot they are about to pick up,m but those can be negated with further checks.

          > !!!MOLES for the MOLE GOD!!!

          1 Reply Last reply Reply Quote
          • 1 / 1
          • First post
            Last post