// Module : OnClientLeave by Brian "spilth" Kelly
// For Neverwinter Nights - Bleeding Tutorial

#include "bleeding_config"

void main() {
    // Remember what their hit points were at for when they next sign on...
    SetLocalInt(GetExitingObject(), "LastHitPoints", GetCurrentHitPoints(GetExitingObject()));

    object oPC = GetExitingObject();

    location lPClocation = GetLocation(oPC);
    object oInvItem = GetFirstItemInInventory(oPC);
//    object oLootBag = CreateObject(OBJECT_TYPE_PLACEABLE, "pclootbag", lPClocation);
    int nYes;
    string sItemTag;

    while (GetIsObjectValid(oInvItem) == TRUE)
    {
        nYes = 0;
        sItemTag = "";
        sItemTag = GetTag(oInvItem);
        if(sItemTag == "FalseMark")
          nYes = 1;
        if(sItemTag == "MarkofOron")
          nYes = 1;
        if(sItemTag == "MarkofGamlee")
          nYes = 1;
        if(sItemTag == "MarkofMaro")
          nYes = 1;
        if(sItemTag == "MarkofZool")
          nYes = 1;
        if(nYes == 1) {
//          AssignCommand(oLootBag, ActionTakeItem(oInvItem, oPC));
          DestroyObject(oInvItem);
        }

        oInvItem = GetNextItemInInventory(oPC);
    }

}
