#First band of dead adventurers in the Caves
from eventAPI import *
from APIUtils import *
from SDLKeys import *

DKP1 = 0

def fireEvent(e):
    global DKP1
    DKP1 = getTag(e, "DKP1")
    if (DKP1 == 1):
        finished(e)
    else:
        next(e)

def next(e):        
    choice = optionInput(e, ["You come across the remains of a party of adventurers. They seem to have fallen victim to a trap, as their bodies are crushed almost completely flat!", "", "Do you wish to take their belongings?"], ["(Y)es, (N)o"], [SDLK_y, SDLK_n])
    if (choice == SDLK_y):
        loot(e)
    elif (choice == SDLK_n):
        return 0
    else:
        return 0
        
def loot(e):
    setTag(e, "DKP1", 1)
    giveItems(e, ["Great Sword", "Poison Long Sword", "Elven Mail"])
    return 0

def finished(e):
    showMessage(e, ["The remains of a party of adventurers lie here. You have already taken everything of value, you thieving bastards!"])
    