from eventAPI import *
from APIUtils import *

def fireEvent(e):
    if ((getTag(e, "lFlagS") & 0x100) == 0):
        return 1
    global kssPlot
    kp = getTag(e, "kssPlot")
    if ((kp == 5) or (kp == 7)):
        showMessage(e, ["On the wall of this guard post, you spot a S-shaped depression.","","Lacking the means to do anything with it, you leave."])
        kp += 1
        setTag(e, "kssPlot", kp)
        return 1
    elif ((kp == 6) or (kp == 8)):
        showMessage(e, ["There's a small S-shaped indentation in the wall here."])
        return 1
    elif (kp == 9):
        showMessage(e, ["On the wall of this guard post, you spot a S-shaped depression.","","On a hunch, you try the glyph you took from the Black Ranger: it's a perfect fit."])
        showMessage(e, ["You feel a vibration coming from the hallway.","","You try to retrieve the stone, but it seems to be stuck: so much for your trophy..."])
        setTag(e, "kssPlot", 11)
        return 1
    elif (kp == 10):
        showMessage(e, ["You take out the glyph you took from the Black Ranger and press it onto the indentation: it clicks firmly into place.",
                        "","Immediately, you feel a vibration coming from the hallway."])
        setTag(e, "kssPlot", 11)
    else:
        return 1
               
