#feast begin
(0.1, 0, 0, [
(store_faction_of_party, ":center_faction", "$current_town"),
(faction_slot_eq, ":center_faction", slot_faction_ai_state, sfai_feast),
(faction_slot_eq, ":center_faction", slot_faction_ai_object, "$current_town"),
],
[
(eq, "$talk_context", tc_court_talk),
(try_for_agents, ":agent"),
(agent_get_troop_id, ":troop", ":agent"),
(try_begin),
(is_between, ":troop", tavern_minstrels_begin, tavern_minstrels_end),
(agent_slot_eq, ":agent", slot_agent_is_set_drinking_animation, 0), #set the animation only for the first time(ti_on_agent_spawn flag has been replaced),
(try_begin),
(agent_has_item_equipped, ":agent", "itm_dedal_lutnia"),
(agent_set_stand_animation, ":agent", "anim_lute_standing"),
(agent_set_animation, ":agent", "anim_lute_standing"),
(agent_play_sound, ":agent", "snd_dedal_tavern_lute"),
(else_try),
(agent_has_item_equipped, ":agent", "itm_dedal_lira"),
(agent_set_stand_animation, ":agent", "anim_lyre_standing"),
(agent_set_animation, ":agent", "anim_lyre_standing"),
(agent_play_sound,":agent", "snd_dedal_tavern_lyre"),
(try_end),
(store_random_in_range, ":random", 0, 300),
(agent_set_animation_progress, ":agent", ":random"),
(agent_set_slot, ":agent", slot_agent_is_set_drinking_animation, 1),
(else_try),
(this_or_next|eq, ":troop", "trp_temporary_minister"),
(is_between, ":troop", heroes_begin, heroes_end),
(agent_has_item_equipped, ":agent", "itm_dedal_kufel"),
(assign, ":replace_anim", 0),
(try_begin),
(conversation_screen_is_active),
(store_conversation_agent, ":conversation_agent"),
(eq, ":agent", ":conversation_agent"),
(assign, ":replace_anim", 1),
(try_end),
(try_begin),
(eq, ":replace_anim", 1),
(try_begin),
(agent_slot_eq, ":agent", slot_agent_is_set_drinking_animation, 1),
(agent_set_animation, ":agent", "anim_stand"),
# (agent_set_stand_animation, ":agent", "anim_stand"),
(agent_set_slot, ":agent", slot_agent_is_set_drinking_animation, 0),
(try_end),
(else_try),
(neq, ":replace_anim", 1),
(try_begin),
(agent_slot_eq, ":agent", slot_agent_is_set_drinking_animation, 0),
(agent_set_animation, ":agent", "anim_sitting_drinking_low"),
# (agent_set_stand_animation, ":agent", "anim_sitting_drinking_low"),
(store_random_in_range, ":random", 0, 300),
(agent_set_animation_progress, ":agent", ":random"),
(agent_set_slot, ":agent", slot_agent_is_set_drinking_animation, 1),
(try_end),
(try_end),
(try_end),
(try_end),
]),
#feast end