@echo off
color 17
REM ###############################################
REM ## Настройте конфигурации вашей базы MySQL ниже  ##
REM ###############################################
REM путь к папке bin в MySQL
set mysqlBinPath=

set DateT=%date%

REM Конфигурации loginserver
set lsuser=root
set lspass=
set lsdb=l2jdb
set lshost=localhost

REM Конфигурации к Gameserver
set gsuser=root
set gspass=
set gsdb=l2jdb
set gshost=localhost
REM ############################################

set mysqldumpPath="mysqldump"
set mysqlPath="mysql"


:Step1
cls
echo. ------------------------------------------------------------------------------------------------------------------------
echo.
echo.   L2jCore - Базы данных Login Server ` a
echo. ____________________________________________________________
echo.
echo.   1 - Полная заливка баз loginserver`a.
echo.   2 - Перейти к установке баз gameserver`a
echo.   3 - Выйти нах отсуда - нехера непонятна...
echo. ------------------------------------------------------------------------------------------------------------------------

set Step1prompt=x
set /p Step1prompt= Введите значение:
if /i %Step1prompt%==1 goto LoginInstall
if /i %Step1prompt%==2 goto Step2
if /i %Step1prompt%==3 goto addinstall
if /i %Step1prompt%==4 goto fullend
goto Step1


:LoginInstall
@cls
echo.
echo login_install.sql
%mysqlPath% -h %lshost% -u %lsuser% --password=%lspass% -D %lsdb% < login_install.sql
echo accounts.sql
%mysqlPath% -h %lshost% -u %lsuser% --password=%lspass% -D %lsdb% < ../sql/accounts.sql
echo gameservers.sql
%mysqlPath% -h %lshost% -u %lsuser% --password=%lspass% -D %lsdb% < ../sql/gameservers.sql
pause
goto :Step2

:Step2
 
echo. ----------------------------------------------------------------------------------------------------------------------
echo.
echo.   L2jCore - Операции с базой данных сервера игры
echo. ___________________________________________________________
echo.
echo.   1 - Полная установка баз данных сервера игры.
echo.   2 - Выйти.
echo. ----------------------------------------------------------------------------------------------------------------------

set Step2prompt=x
set /p Step2prompt= Введите значение:
if /i %Step2prompt%==1 goto fullinstall
if /i %Step2prompt%==2 goto fullend
goto Step2

:fullinstall
 
echo Чистим содержимое старых баз данных сервера.
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < full_install.sql
set title=установлен
goto CreateTables

:CreateTables
 
echo.
echo Сейчас будут %title%ы базы gameserver`a.
pause
 

 echo  Table --   armor.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/armor.sql
 echo  Table --   ban_hwid.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/ban_hwid.sql
echo  Table --   auction.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/auction.sql
echo  Table --   auction_bid.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/auction_bid.sql
echo  Table --   auction_watch.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/auction_watch.sql
echo  Table --   augmentations.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/augmentations.sql
echo  Table --   autoanounce.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/autoanounce.sql
echo  Table --   account_premium.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/account_premium.sql
echo  Table --   boxaccess.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/boxaccess.sql
echo  Table --   banned_ips.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/banned_ips.sql
echo  Table --   boxes.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/boxes.sql
echo  Table --   buff_templates.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/buff_templates.sql
echo  Table --   castle.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/castle.sql

echo  Table --   char_templates.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/char_templates.sql
echo  Table --   castle_door.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/castle_door.sql
echo  Table --   castle_doorupgrade.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/castle_doorupgrade.sql
echo  Table --   castle_manor_procure.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/castle_manor_procure.sql
echo  Table --   castle_manor_production.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/castle_manor_production.sql
echo  Table --   castle_siege_guards.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/castle_siege_guards.sql
echo  Table --   ..castlesiege_clans.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/castlesiege_clans.sql
echo  Table --   character_raid_points.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_raid_points.sql
echo  Table --   character_friends.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_friends.sql
echo  Table --   character_hennas.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_hennas.sql
echo  Table --   character_macroses.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_macroses.sql
echo  Table --   character_quests.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_quests.sql
echo  Table --   character_recipebook.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_recipebook.sql
echo  Table --   character_recommends.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_recommends.sql
echo  Table --   character_shortcuts.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_shortcuts.sql
echo  Table --   character_skills.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_skills.sql
echo  Table --   character_skills_save.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_skills_save.sql
echo  Table --   character_subclasses.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/character_subclasses.sql
echo  Table --   characters.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/characters.sql
echo  Table --   characters_custom_data.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/characters_custom_data.sql
echo  Table --   clan_data.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/clan_data.sql
echo  Table --   clan_privs.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/clan_privs.sql
echo  Table --   clan_skills.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/clan_skills.sql
echo  Table --   clan_subpledges.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/clan_subpledges.sql
echo  Table --   clan_wars.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/clan_wars.sql
echo  Table --   clan_notices.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/clan_notices.sql
echo  Table --   clanhall.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/clanhall.sql
echo  Table --   clanhall_functions.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/clanhall_functions.sql
echo  Table --   class_list.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/class_list.sql
echo  Table --   mods_buffer.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/mods_buffer.sql
echo  Table --   custom_npc.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/cursed_weapons.sql
echo  Table --   clanhall_siege.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/clanhall_siege.sql
echo  Table --   dm.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/dm.sql
echo  Table --   droplist.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/droplist.sql
echo  Table --   engraved_items.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/engraved_items.sql
echo  Table --   engraved_log.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/engraved_log.sql
echo  Table --   enchant_skill_trees.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/enchant_skill_trees.sql
echo  Table --   etcitem.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/etcitem.sql
echo  Table --   fishing_skill_trees.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/fishing_skill_trees.sql
echo  Table --   forums.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/forums.sql
echo  Table --   fort_door.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/fort_door.sql
echo  Table --   fort_doorupgrade.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/fort_doorupgrade.sql
echo  Table --   fort_siege_guards.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/fort_siege_guards.sql
echo  Table --   fort.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/fort.sql
echo  Table --   fortsiege_clans.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/fortsiege_clans.sql
echo  Table --   four_sepulchers_spawnlist.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/four_sepulchers_spawnlist.sql
echo  Table --   games.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/games.sql
echo  Table --   global_tasks.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/global_tasks.sql
echo  Table --   grandboss_data.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/grandboss_data.sql
echo  Table --   grandboss_list.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/grandboss_list.sql
echo  Table --   henna_trees.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/henna_trees.sql
echo  Table --   heroes.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/heroes.sql
echo  Table --   items.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/items.sql
echo  Table --   itemsonground.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/itemsonground.sql
echo  Table --   lvlupgain.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/lvlupgain.sql
echo  Table --   l2votes.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/l2votes.sql
echo  Table --   merchant_areas_list.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/merchant_areas_list.sql
echo  Table --   merchant_buylists.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/merchant_buylists.sql
echo  Table --   merchant_lease.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/merchant_lease.sql
echo  Table --   merchant_shopids.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/merchant_shopids.sql
echo  Table --   merchants.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/merchants.sql
echo  Table --   mods_wedding.sql  .....Load  
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/mods_wedding.sql
echo  Table --   npc.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/npc.sql
echo  Table --   npcskills.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/npcskills.sql
echo  Table --   olympiad_nobles.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/olympiad_nobles.sql
echo  Table --   pets.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/pets.sql
echo  Table --   pets_stats.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/pets_stats.sql
echo  Table --   pledge_skill_trees.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/pledge_skill_trees.sql
echo  Table --   posts.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/posts.sql
echo  Table --   paystream.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/paystream.sql
echo  Table --   pkkills.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/pkkills.sql
echo  Table --   quest_global_data.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/quest_global_data.sql
echo  Table --   raidboss_spawnlist.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/raidboss_spawnlist.sql
echo  Table --   random_spawn.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/random_spawn.sql
echo  Table --   random_spawn_loc.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/random_spawn_loc.sql
echo  Table --   rebirth_manager.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/rebirth_manager.sql
echo  Table --   raid_events_spawnlist.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/raid_events_spawnlist.sql
echo  Table --   raid_prizes.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/raid_prizes.sql
echo  Table --   seven_signs.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/seven_signs.sql
echo  Table --   seven_signs_festival.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/seven_signs_festival.sql
echo  Table --   seven_signs_status.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/seven_signs_status.sql
echo  Table --   siege_clans.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/siege_clans.sql
echo  Table --   skill_learn.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/skill_learn.sql
echo  Table --   smsonline.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/smsonline.sql
echo  Table --   skill_spellbooks.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/skill_spellbooks.sql
echo  Table --   skill_trees.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/skill_trees.sql
echo  Table --   spawnlist.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/spawnlist.sql
echo  Table --   tvt.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/tvt.sql
echo  Table --   tvt_teams.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/tvt_teams.sql
echo  Table --   teleport.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/teleport.sql
echo  Table --   topic.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/topic.sql
echo  Table --   vanhalter_spawnlist.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/vanhalter_spawnlist.sql
echo  Table --   weapon.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/weapon.sql
echo  Table --   zone_vertices.sql  .....Load
%mysqlPath% -h %gshost% -u %gsuser% --password=%gspass% -D %gsdb% < ../sql/zone_vertices.sql


echo GameServer Database %title%.
pause
goto :Step1

echo.
echo Installed Sucessfull.
echo.
pause
goto :Step1

:end
echo.
echo Installing sucessfull.
echo.
pause

:fullend

