#script for weapons shop at (21,18)
from eventAPI import getTag, setTag, showPicture, playSpecAudio, giveItems, callEvent
from APIUtils import showMessage

def fireEvent(e):
    lFlagU = getTag(e, "lFlagU")
    if (lFlagU != 0):
        #print "lFlagU == 0x%08x - about to call Event."%(lFlagU)
        callEvent(e, 1012, ["21", "19", "0"])
        #shop(e)
        return 0
    showPicture(e, "Weapon_Shop")
    playSpecAudio(e, "WeaponShop")
    showMessage(e,
                ["You have just received a note by  a poor dirty street urchin of a boy.",
                 "He wisps away before you have a chance to stop him..."])
    giveItems(e, ["Naris' Note"])
    setTag(e, "lFlagU", 0xFFFFFFFF)
    lFlagU=getTag(e,"lFlagU")
    #print "lFlagU == 0x%08x - about to call event."%(lFlagU)
    callEvent(e, 1012, ["", "21", "19", "0"])
    lFlagU=getTag(e,"lFlagU")
    #print "lFlagU == 0x%08x - about to return..."%(lFlagU)
    #shop(e)
    return 0

def shop(e):
    return 0
