# 004_note_maid.evc*****
# This event is enabled after the party fights the vial guards and have already had 5
#  arrest attempts made on them afterwards.  Once this event fires, Taire will be home.
from eventAPI import getTag, setTag, optionInput, showPicture, giveItems
from SDLKeys import SDLK_r
from APIUtils import firstHasItem, showMessage, issetall

def fireEvent(e):
    lFlagU = getTag(e, "lFlagU")
    if (lFlagU == 0xFFFFFFFF):
        return 1
    GuardPlt1 = getTag(e, "GuardPlt1")
    if (not issetall(GuardPlt1, 0x4)):
        return 1
    optionInput(e,
        ["Someone has placed a note in your hand...",
         "They slip out of sight mumbling something about a meeting of utmost urgency."],
        ["(R)ead the note"], [SDLK_r])
    showPicture(e, "001_Note_Taire")
    showMessage(e,
        ["The messenger has gone and the note is in your hands..."])
    giveItems(e, ["Watcher's Note 1"])
    setTag(e, "lFlagU", 0xFFFFFFFF)
    setTag(e, "TairePlt1", 0x1)
    return 1
