#Argent Plot events
from eventAPI import getTag, setTag, playSpecAudio, showPicture, optionInput, giveItems, callEvent, removeItem
from APIUtils import showMessage, poseYesNo, firstHasItem

ArgentPlt1 = 0

def fireEvent(e):
    ArgentPlt = getTag(e, "ArgentPlt1")
    CataFlag2 = getTag(e, "CataFlag2")
    if(CataFlag2 == 1 and ArgentPlt == 0):
        greetArgent(e)
    if(getTag(e, "OliasPlt1") == 6 and getTag(e, "TotEplot") == 0):
        meetGnav(e)
    return 1

def greetArgent(e):
    showMessage(e, 
        ["As the gates creak shut behind you, you see a rather odd pair approaching.", "One, a human female wearing brilliant shimmering armor",
         "The other, a dwarf in flowing blue robes. They catch sight of you and hurry towards your group, apparently eager to speak with you"])
    showPicture(e, "rose")
    showMessage(e, ["Blessed be the Redeemer, you MUST be the ones we've heard about - helping cure the town of the tainted fluid known as Devil Whiskey", "I am Rose - a servant of the gods, and this is my compatriot Argent", "We are in need of your help"])
    showPicture(e, "argent")
    showMessage(e, ["Rose, we should not bother these folk, they are obviously busy, probably on their way to slay a large rat or some-such",
         "We can handle our own problems.", "I apologize to you travelers, we will bother you no further"])
    showPicture(e, "rose")
    showMessage(e, ["Nonsense Argent! It is time you learned to suffer humility, and take responsibility for your mistakes"])
    showMessage(e, ["Dear hearts, my associate here has run afoul of an ancient and hideous magical device, and we require assitance to free him from it"])
    showMessage(e, ["During one of our many tours around the Orkney Isles, we came upon an old tomb, far beneath the surface of the world", "Within this tomb, amongst the few remaining artifacts we found what appeared to be a very ornate hourglass"])
    showPicture(e, "argent")
    showMessage(e, ["You mean, \"I\" found the hourglass Rose, you came out with that pretty hair ornament, and I find a cursed object of unspeakable evil. Just my luck"])
    showMessage(e, ["As you may have figured out by now, this hourglass I found was cursed - upon taking hold of it, I end up confronted by two rather large... err... constructs would be the proper word. Basically rather large skeletons who can't be killed, and are tied to this hourglass"])
    showMessage(e, ["They claim they are needed by their master, he has sent for them, and I am bound to take them to him", "Ordinarily I would find a way to seperate their essence from the hourglass, but these magics are particularly potent", "When i say potent, I mean impossibly strong."])
    showMessage(e, ["Apocalyptic"])
    showMessage(e, ["Just plain bad"])
    showMessage(e, ["Makes small babies cry it's so evil"])
    showPicture(e, "rose")
    showMessage(e, ["Forgive him, dwarves are known to ramble on as such"])
    showPicture(e, "argent")
    showMessage(e, ["Dogs and cats.. living together"])
    showPicture(e, "rose")
    showMessage(e, ["He'll keep at that forever", "Back to the issue at hand - we have traced back the origins of this hourglass, after speaking with many a wise sage", "Unfortunately we discovered that the \"Master\" the constructs spoke of was none other than Asher Inorri!!!"])
    showMessage(e, ["That's right Asher Inorri"])
    showMessage(e, ["Oh dear, I suppose you dont' know of Asher?", "He was a half-elven sorcerer of great power and ill repute", "A rather evil man"])
    showPicture(e, "argent")
    showMessage(e, ["What Rose here is afraid to mention - Asher Inorri is the father of what we now call Necromancy", "Crazy Orc-pup actually CREATED the art", "If that's not a sick mind, I'd challenge you to show us worse"])
    showMessage(e, ["Look, what we need from you bunch is help", "We've located the tomb of Asher,",
         "but with every hour the constructs pull harder and harder, we dare not enter that place on our own, and we'd heard you all did well in the city's catacombs"])
    showMessage(e, ["With Rose to help keep the constructs at bay, and you all to keep back the hordes that surely lurk in that tomb, I believe we can venture into Asher's Tomb and hopefully find a way to rid ourselves of this accursed hourglass"])
    showMessage(e, ["If you choose not to help us, I can understand - but we can't wait much longer", "If you'd like to help us meet us on the far west edge of these plains - right where they meet the foothills towards the north the entrance to Asher's Tomb lies buried in the side of a small hill",
         "Find us there should you choose to help"])
    showPicture(e, "rose")
    showMessage(e, ["Kind regards heros - I hope too see you again soon, may the redeemer smile upon you"])

    setTag(e,"ArgentPlt1", 1)

def meetGnav(e):
    showPicture(e, "Gnav")
    showMessage(e,["Before Rennibister's gates stands an old yet imposing gnome. As soon as he sees you, he approaches your party and speaks.",
                   "","\"Adventurers, please listen to my tale.","","I come from a distant gnomic village of lore-seekers."])
    showMessage(e,["Long had we been looking for the lost Book of Knowledge, a compendium of magic lore.",
                   "After patient and arduous research, we finally discovered its location.",
                   "Recovering it was not an easy task, but at last it came into our possession."])
    showMessage(e,["Our sages endeavored to study its contents. Most eager was my... a young female by the name of Savah.",
                   "","Since she was a gnomeling she had always desired power, and she saw the Book as an opportunity to fulfill her wishes."])
    showMessage(e,["As her eagerness turned to frenzy and her demeanor became somber, we deemed it best that she stay away from the Book.",
                   "","We elders met in council to decide what to do next, but when we went to convey our decision to her the next morning,"])
    showMessage(e,["we discovered that she had absconded with the Book. That was three weeks ago.","",
                   "Ever since then I've been looking for her. I have finally tracked her to a temple southwest of here, but upon entering it I was assailed by a horde of stone beasts,"])
    showMessage(e,["and barely managed to escape with my life.","",
                   "It seems Savah has begun to exert the power she wrested from the Book of Knowledge. She must be stopped while it's still feasible."])
    showMessage(e,["I've heard of your deeds. You are clearly capable of putting an end to Savah's madness, should you wish it.",
                   "I implore you to help me.\"","","After conferring together, the party members assure him of their assistance."])
    showMessage(e,["He thanks you profusely, then a look of sadness enters his eyes.",
                   "","\"Please, try not to hurt her...\"","","He turns and leaves."])
# For those who might have tested Origen's mod
# I reset the wards flags
    setTag(e, "TotEWard1", 0)
    setTag(e, "TotEWard2", 0)
    setTag(e, "TotEWard3", 0)
    setTag(e, "TotEWard4", 0)
    setTag(e,"TotEplot", 1)
