def e1_11_16():
    if ('ep2BrothelMorning' in pwutilities.keywords() and 
            not 'ep2BrothelMorningDone' in pwutilities.keywords()):
        pwutilities.add_keyword('ep2BrothelMorningDone')
        pwutilities.trigger_event('ep2 brothel common room morning')
        return True
    else:
        return False
def e1_18_18():
    if 'ep2ChasingEditaEvent2' in pwutilities.keywords():
        return False
    elif 'ep2ChasingEdita' in pwutilities.keywords():
        pwutilities.add_keyword('ep2ChasingEditaEvent2')
        pwutilities.trigger_event('ep2 chase edita event 2', "Busy Street")
        return True
    else:
        return False
def e1_16_11():
    if 'ep2ChaseEditaEvent1' in pwutilities.keywords():
        return False
    elif 'ep2ChasingEdita' in pwutilities.keywords():
        pwutilities.add_keyword('ep2ChaseEditaEvent1')
        pwutilities.trigger_event('ep2 chase edita event 1', "Two Girls")
        return True
    else:
        return False
def e1_10_18():
    if 'ep2ChasingEditaEvent3' in pwutilities.keywords():
        pwutilities.add_keyword('ep2MeetMagola')
        pwutilities.trigger_event('ep2 meet magola')
        return True
    elif 'ep2MeetMagola' in pwutilities.keywords():
        return False
    else:
        pwutilities.trigger_event('ep2 magola busy')
        return True
def e1_10_19():
    if 'ep2ChasingEditaEvent3' in pwutilities.keywords():
        return False
    elif 'ep2ChasingEdita' in pwutilities.keywords():
        pwutilities.add_keyword('ep2ChasingEditaEvent3')
        pwutilities.remove_keyword('ep2ChasingEdita')
        pwutilities.trigger_event('ep2 chase edita event 3')
        return True
    else:
        return False
def e1_9_19():
    if 'ep2ChasingEditaEvent3' in pwutilities.keywords() and universal.state.party.defeated():
        pwutilities.trigger_event('ep2 javier defeat rest at brothel')
        universal.state.location.coordinates = (1, 10, 19)
        return True
    else:
        return False
def e1_10_6():
    if 'ep2Marketplace' in pwutilities.keywords():
        return False
    else:
        pwutilities.add_keyword('ep2Marketplace')
        pwutilities.trigger_event("ep2 marketplace", "Marketplace")
        return True
def e1_0_0():
    if 'ep2Toll' in pwutilities.keywords():
        return False
    else:
        pwutilities.add_keyword('ep2Toll')
        pwutilities.trigger_event("ep2 dungeon toll", "Thugs")
        return True
def e1_2_11():
    if not 'ep2VisitedSquatters' in pwutilities.keywords():
        pwutilities.add_keyword('ep2VisitedSquatters')
        pwutilities.trigger_event('ep2 visited squatters')
        return True
    else:
        return False
def guild_bedroom_after_arrival():
    guildBedroom = universal.state.get_room('Bedroom')
    thisEpisode = episode.allEpisodes[universal.state.player.currentEpisode]  
    if universal.state.player.currentEpisode == episode1.name and thisEpisode.currentSceneIndex == 2:
        alondraSleeping = '''Alondra, the girl Vengador Ildri shielded from the city guard, is already curled up in one of the beds, soundly asleep.'''
        if not alondraSleeping  in guildBedroom.description:
            guildBedroom.description = universal.format_text([guildBedroom.description, alondraSleeping])
        if not universal.format_line(['''If''', name(), '''wishes,''', heshe(), '''can rest, and put an end to this seemingly neverending day.''']) in guildBedroom.description:
            guildBedroom.description = universal.format_text([guildBedroom.description, ['''If''', name(), '''wishes,''', heshe(), 
                '''can rest, and put an end to this seemingly neverending day.''']])
        if 'Elise_shows_you_around' in pwutilities.keywords() and universal.state.player.currentEpisode == episode1.name and not ("should go meet Elise at the Shrine" in 
                guildBedroom.description):
            guildBedroom.description = universal.format_text([guildBedroom.description, ['''If''', name(), '''hasn't already,''', p.heshe(), 
                '''should go meet Elise at the Shrine. After all,''', p.heshe(), '''shouldn't keep her waiting!''']])
    if guildBedroom.boarding:
        townmode.rest_mode(guildBedroom)
    else:
        townmode.town_mode()
def e1_1_18():
    if ('ep2BrothelMorning' in pwutilities.keywords() and
            not 'ep2FoundEdita' in pwutilities.keywords()):
        pwutilities.add_keyword('ep2FoundEdita')
        pwutilities.trigger_event('ep2 squatter edita')
def e1_1_17():
    if ('ep2BrothelMorning' in pwutilities.keywords() and 
            not 'ep2FamilySquatterFight' in pwutilities.keywords() and
            not 'ep2FoundEdita' in pwutilities.keywords()):
        pwutilities.add_keyword('ep2FamilySquatterFight')
        pwutilities.trigger_event('ep2 squatter family')