Remove trash script

Moderator: Event DM

Post Reply
User avatar
Neve
Prince of Bloated Discourse
Posts: 192
Joined: Mon Apr 14, 2003 4:09 pm
Location: The Netherlands
Contact:

Remove trash script

Post by Neve » Sat Aug 23, 2003 9:38 am

Place this in an OnExit of an area. If a player triggers the OnExit, the function will check wether there are players in the area. If not, all the remains will be emptied and removed.

Code: Select all

/*
    August 21 - 2003 - Raiko - zeiren@hotmail.com
    This script removes remains on exiting an area
*/

void main(){
    object oArea        = GetArea(OBJECT_SELF);
    object oRemains     = GetFirstObjectInArea(oArea);
    object oInventory;

    while(oRemains != OBJECT_INVALID){
        if(GetIsPC(oRemains)) return;
        oRemains = GetNextObjectInArea(oArea);
    }

    oRemains = GetFirstObjectInArea(oArea);

    while(oRemains != OBJECT_INVALID){
        if(GetName(oRemains) == "Remains"){
            SetPlotFlag(oRemains, FALSE);
            oInventory = GetFirstItemInInventory(oRemains);
            while(oInventory != OBJECT_INVALID){
                DestroyObject(oInventory);
                oInventory = GetNextItemInInventory(oRemains);
            }
        }
        oRemains = GetNextObjectInArea(oArea);
    }
}
- As you gaze unknowingly into the seemingly infinite depths of the optics of this altogether passionate embodiment of insatiability, you experience a gradual realisation that the heavily-embellished vocabulary scattered lavishly throughout the sentence you are currently reading is indisputably nothing greater than a generous ration of masculine bovine faeces.
User avatar
The Gray
Whiney Peasant
Posts: 11
Joined: Sat Jul 26, 2003 8:36 pm
Location: (GMT - 5)

Post by The Gray » Sat Aug 23, 2003 4:13 pm

But then we can't wander into areas and loot the bodies of enemies the characters who were there before us missed.
User avatar
Jordicus
Team Member; Retired with Honors
Posts: 8042
Joined: Tue Jan 21, 2003 3:46 pm
Location: Whitehall, PA (GMT -4)
Contact:

Post by Jordicus » Sat Aug 23, 2003 4:24 pm

that's why the one that Avlis uses waits 5 minutes after the last PC exits the area before it cleans uo...
User avatar
Neve
Prince of Bloated Discourse
Posts: 192
Joined: Mon Apr 14, 2003 4:09 pm
Location: The Netherlands
Contact:

Post by Neve » Sat Aug 23, 2003 4:59 pm

that's why the one that Avlis uses waits 5 minutes after the last PC exits the area before it cleans uo...
Whoops... I didn't know that Avlis has one now =)

Well, just put a localint on the lootbag with the time at that moment, and check for that time at the moment you cleanup if you'd like them to stay there for x hours.
- As you gaze unknowingly into the seemingly infinite depths of the optics of this altogether passionate embodiment of insatiability, you experience a gradual realisation that the heavily-embellished vocabulary scattered lavishly throughout the sentence you are currently reading is indisputably nothing greater than a generous ration of masculine bovine faeces.
Post Reply