#!/usr/bin/env bash
# Author: chal55rus
# type: games
# name: Last Chaos
# image: lastchaos
# info_en: Last Chaos is a classic MMORPG with six classes, castle sieges, a Korean grind and kilometers of dungeons. The confrontation between Apollo and Eres is gaining momentum, so hurry up to take one of the sides.
# info_ru: Last Chaos – классическая MMORPG с шестью классами, осадами замков, корейским гриндом и километрами подземелий. Противостояние Апполона и Эреса набирает обороты, так что спешите принять одну из сторон.
########################################################################
export PW_PREFIX_NAME="LAST_CHAOS"
export PW_AUTOINSTALL_EXE="${PORT_WINE_TMP_PATH}/Last Chaos.zip"
export PORTWINE_CREATE_SHORTCUT_NAME="Last Chaos"

start_portproton
if try_download "https://last-chaos.ru/download/Last%20Chaos.zip" "${PW_AUTOINSTALL_EXE}" no_mirror
then
    "$pw_7z" x -y "${PW_AUTOINSTALL_EXE}" -o"${WINEPREFIX}/drive_c/Program Files/"
    PW_EXE_FILE="${WINEPREFIX}/drive_c/Program Files/Last Chaos/LC.exe"
    try_remove_file "${PW_AUTOINSTALL_EXE}"
    try_remove_file "${PW_EXE_FILE}.ppdb"
    kill_portwine
    portwine_create_shortcut
fi
stop_portproton
