void main()
{
    object oItem = GetModuleItemAcquired();
    string sItem = GetTag(oItem);
    object oPC = GetItemPossessor(oItem);
    object oAnim = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPC);
    object oDomin = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPC);
    object oFamiliar = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPC);
    object oHench = GetAssociate(ASSOCIATE_TYPE_HENCHMAN, oPC);
    object oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC);

    if (!GetIsPC(oPC))
        return;
    //if (sItem == "TatteredNote")
    //{
    //    AddJournalQuestEntry("SubQuest_000", 1, oPC);
    //}
    if (sItem == "AnOldJournal")
    {
        AddJournalQuestEntry("SubQuest_001", 1, oPC);
    }
    if (sItem == "ScrawledNote")
    {
        AddJournalQuestEntry("MAIN_QUEST", 4, oPC);
    }
    if (GetLocalInt(oPC, "GotTravel") != TRUE && sItem == "OnTravel")
    {
        RemoveJournalQuestEntry("Subquest_001", oPC, TRUE, TRUE);
        AddJournalQuestEntry("Subquest_001", 3, oPC, TRUE, TRUE, TRUE);
        GiveXPToCreature(oPC, 600);
        SetLocalInt(oPC, "GotTravel", TRUE);
    }
    if (GetLocalInt(oPC, "GotKey") != TRUE && sItem == "SlaveCollarKey")
    {
        AddJournalQuestEntry("Subquest_012", 2, oPC);
        SetLocalInt(oPC, "PCFreedHaleth", 1);
        GiveXPToCreature(oPC, 500);
        SetLocalInt(oPC, "GotKey", TRUE);
    }
    if (GetLocalInt(oPC, "GotTattered") != TRUE && sItem == "Atatterednote")
    {
        AddJournalQuestEntry("Subquest_015", 2, GetPCSpeaker(), TRUE, TRUE);
        GiveXPToCreature(GetPCSpeaker(), 700);
        SetLocalInt(oPC, "GotTattered", TRUE);
    }
    if ((sItem == "seal001") || (sItem == "seal002")||(sItem == "seal003")||(sItem == "seal004"))
    {
        effect ePORT = EffectVisualEffect(VFX_FNF_PWSTUN);
        location lRETURN = GetLocation(GetWaypointByTag("WP_RETURN"));
        ApplyEffectAtLocation(DURATION_TYPE_INSTANT, ePORT, lRETURN, 1.0f);
        AssignCommand(oPC, ClearAllActions());
        AssignCommand(oPC, ActionJumpToLocation(lRETURN));
        DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, ePORT, lRETURN, 1.0f));
            if (oAnim != OBJECT_INVALID){
            AssignCommand(oAnim, ClearAllActions());
            AssignCommand(oAnim, ActionJumpToLocation(lRETURN)); }
            if (oDomin != OBJECT_INVALID){
            AssignCommand(oDomin, ClearAllActions());
            AssignCommand(oDomin, ActionJumpToLocation(lRETURN)); }
            if (oFamiliar != OBJECT_INVALID){
            AssignCommand(oFamiliar, ClearAllActions());
            AssignCommand(oFamiliar, ActionJumpToLocation(lRETURN)); }
            if (oHench != OBJECT_INVALID){
            AssignCommand(oHench, ClearAllActions());
            AssignCommand(oHench, ActionJumpToLocation(lRETURN)); }
            if (oSummon != OBJECT_INVALID){
            AssignCommand(oSummon, ClearAllActions());
            AssignCommand(oSummon, ActionJumpToLocation(lRETURN)); }
    }
    if (GetLocalInt(oPC, "GotReaper") != TRUE && sItem == "reaperrelic")
    {
        AddJournalQuestEntry("MAIN_QUEST", 6, oPC);
        GiveGoldToCreature(oPC, 300);
        location lPortal = GetLocation(GetWaypointByTag("LOC_rPortal"));
        CreateObject(OBJECT_TYPE_PLACEABLE, "rportal", lPortal, FALSE);
        SetLocalInt(oPC, "GotReaper", TRUE);
            // makes the PC level 14 if they're not already (thanks Jassper)
        int nCurrentL = GetHitDice(oPC);
        int nLevelMax = 14;
        if(nCurrentL < nLevelMax)
            {
            int nXP = ((nLevelMax*(nLevelMax - 1))/2)*1000;
            SetXP(oPC,nXP);
            }
            // and if they are, give them 2k xp instead
        else {
            GiveXPToCreature(oPC, 2000);
             }
    }
}
