from eventAPI import *
from APIUtils import *

def fireEvent(e):
    showMessage(e, ["You finally come upon the object of your quest: a mangy dog, big but not terribly so, growls menacingly.",
                    "","Wondering what all that was about, you ready your weapons."])
    fight(e)
    setExit(e, "maps/renwild.cfg", 88, 33, 0)
    return 0

def fight(e):
    cr = combat(e, [("Mad Dog Tarjan", 1, 0, 10)])
    if (cr == 1):
        showMessage(e, ["Look at you, you managed to kill a dog!","","Anyway, with the beast dead, the wards crumble to dust, allowing you to return to Garzz's shoppe."])
        setTag(e, "kssCrypt", 80)
    elif (cr == 3):
        showMessage(e, ["Against all expectations, Tarjan managed to bite you to death."])
        setTag(e, "kssCrypt", 70)
    else:  
        showMessage(e, ["You start fleeing, then remember the wards. Uh oh..."])
        fight(e)
