#Script for Landru
#Helps make Power Crystal
from eventAPI import *
from APIUtils import *

def fireEvent(e):
    global kssCrystal
    who = firstHasItem(e, "Strange Crystal")
    showPicture(e, "Landrus")
    if ((getTag(e, "kssCrystal") == 1) and (who >= 0)):
        showMessage(e,
            ["When you show Landru the crystal, he says:","",
             "\"My little shop here is only a side occupation; all modesty set aside, I am a master at analyzing and crafting magical artifacts. Give me this and come back later.\""])
        showMessage(e, ["He takes the crystal and shooes you out."])
        tickGame(e, 1000)
        removeItem(e, who, "Strange Crystal")
        setTag(e, "kssCrystal", 2)
        return 0
    elif (getTag(e, "kssCrystal") == 2):
        showMessage(e,
            ["Landru greets you with a triumphant snarl:","",
             "\"Ha! This crystal met its master. Making it apparently required a large quantity of power components, as well as smaller amounts of air, light and dark.\""])
        showMessage(e,
            ["He turn a little somber:","","\"However, I was not able to determine the exact amounts.","","Anyway, I'll keep the crystal as payment...Don't bother to thank me...Be gone now.\""])
        setTag(e, "kssCrystal", 3)
        return 0
    else:
        callEvent(e, 1017, ["-1", "-1", "-1"])
        return 0
