DMH-Online

Dungeon Masters Helper · Est. 2005

PCs Scripts

NWN Script: strip_inv_plot.htm

Author Sticky: Post Working Scripts Here
ForgottenSoul Posted: Monday, 08 July 05:41PM
Maybe this has been done, but in another area of the boards it was requested. It loops through all the character items and destroys anything marked as a plot item. Useful for keeping those pesky super characters from having super plot items.

Just attach it to the "onEnter" of an area, or to the On Client Enter.

NWScript:
//::///////////////////////////////////////////////
//:: Name RemovePlotItems
//:: Copyright (c) 2002 ForgottenSoul
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By: Forgottensoul
//:: Created On: July 8, 2002
//:://////////////////////////////////////////////
void main()
{
    object oPC = GetEnteringObject();
    object currentItemInInv;
    object firstItemInInv;

    firstItemInInv = GetNextItemInInventory(oPC);
    currentItemInInv = firstItemInInv;
    // Insure they have at least one object
    if(currentItemInInv != OBJECT_INVALID)
    {
        do{
            // Check to see if it is a plot item.
            if(GetPlotFlag(currentItemInInv) == TRUE)
            {
                // Be nice an inform player why items is gone
                SendMessageToPC(oPC,"Plot Object:");
                SendMessageToPC(oPC,GetName(currentItemInInv));
                SendMessageToPC(oPC,"has been removed because plot items have been known to " +
                    "be super/cheat weapons.");
                // it is a plot item. Destroy it.
                DestroyObject(currentItemInInv);
            }
            // get next item
            currentItemInInv = GetNextItemInInventory(oPC);
        // loop while we have a new item to check
        }while(currentItemInInv != OBJECT_INVALID &&
               currentItemInInv != firstItemInInv);
    }
}



_________________
Forgotten Soul
“You stand on the shoulders of giants and claim you are tall.”

[ Edited By ForgottenSoul: Monday, 08 July 05:42PM (GMT) ]

⌂ All Scripts ← PreviousNext → 👁 Category List

All PCs Scripts

📄 adjust_faction 📄 alt_idle_pc_anim 📄 bleeding 📄 bleeding_002 📄 bleeding_003 📄 bleeding_004 📄 creature_item 📄 drop_items 📄 force_zone 📄 give_pc_item 📄 inspect_inv 📄 limited_druid 📄 move_items_to_container 📄 notify_of_loot 📄 pc_respawn 📄 pc_respawn_002 📄 pc_respawn_003 📄 pc_respawn_004 📄 pc_respawn_005 📄 pc_respawn_006 📄 pc_respawn_007 📄 remove_neg 📄 save_spots 📄 strip_inv_give_gold 📄 strip_inv_plot 📄 subraces 📄 subraces_002 📄 voting