'********************************************************************
' By UnLiMiTeD Corporation * all copiright reserved                 *
' atomose.fr                                                        *
' Creat with : LibertyBasic 4.51                                    *
'              By Alexandre Lomuto                                  *
' Version$ = "4.83.1 spéciale édition"                              *
'********************************************************************

nomainwin


    loadbmp "over", "data\OVER.bmp"
    loadbmp "gardien", "data\ennemis\gardien.bmp"
    loadbmp "select", "data\select.bmp"
    loadbmp "aide", "data\aide.bmp"
    loadbmp "clear", "data\CLEAR.bmp"
    loadbmp "main0", "data\main0.bmp"
    loadbmp "mapHEALER", "data\healer.bmp"
    loadbmp "mapFORGERON", "data\forgeron.bmp"
    loadbmp "mainINV", "data\inventaire.bmp"
    loadbmp "back", "data\add2.bmp"
    loadbmp "p1", "data\lifePOTION.bmp"
    loadbmp "p2", "data\lifePOTION2.bmp"
    loadbmp "p3", "data\lifePOTION3.bmp"
    loadbmp "p4", "data\lifePOTION4.bmp"
    loadbmp "p5", "data\lifePOTION5.bmp"
    loadbmp "miniTANKfemme", "data\miniTANKfemme.bmp"
    loadbmp "miniGUERRIERfemme", "data\miniGUERRIERfemme.bmp"
    loadbmp "miniARCHERfemme", "data\miniARCHERfemme.bmp"
    loadbmp "miniARTISANfemme", "data\miniARTISANfemme.bmp"
    loadbmp "miniSOIGNEURfemme", "data\miniSOIGNEURfemme.bmp"
    loadbmp "miniSOIGNEURhomme", "data\miniSOIGNEURhomme.bmp"
    loadbmp "miniGUERRIERhomme", "data\miniGUERRIERhomme.bmp"
    loadbmp "miniARTISANhomme", "data\miniARTISANhomme.bmp"
    loadbmp "miniTANKhomme", "data\miniTANKhomme.bmp"
    loadbmp "miniARCHERhomme", "data\miniARCHERhomme.bmp"
    loadbmp "mapMARCHAND", "data\marchand1.bmp"
    loadbmp "mapMARCHAND2", "data\marchand2.bmp"
    loadbmp "main", "data\choix.bmp"
    loadbmp "add", "data\add3.bmp"
    loadbmp "add2", "data\add4.bmp"
    loadbmp "mainCASTLE", "data\main1.bmp"
    loadbmp "mapbutton", "data\mapBUTTON.bmp"
    loadbmp "perso", "data\persoBUTTON.bmp"
    loadbmp "barre", "data\barre.bmp"
    loadbmp "barre2", "data\barre.bmp"
    loadbmp "boum", "data\boum.bmp"
    loadbmp "boum2", "data\boum2.bmp"
    loadbmp "fuir", "data\fuir.bmp"
    loadbmp "attaquer", "data\attaquer.bmp"
    loadbmp "guard1", "data\ennemis\garde1.bmp"
    loadbmp "guard2", "data\ennemis\garde2.bmp"
    loadbmp "guard4", "data\ennemis\garde4.bmp"
    loadbmp "boss1", "data\ennemis\boss1.bmp"
    loadbmp "boss2", "data\ennemis\boss2.bmp"
    loadbmp "boss3", "data\ennemis\boss3.bmp"
    loadbmp "boss4", "data\ennemis\boss4.bmp"
    loadbmp "boss5", "data\ennemis\boss5.bmp"
    loadbmp "boss6", "data\ennemis\boss6.bmp"
    loadbmp "boss7", "data\ennemis\boss7.bmp"
    loadbmp "boss8", "data\ennemis\boss8.bmp"
    loadbmp "boss9", "data\ennemis\boss9.bmp"
    loadbmp "boss10", "data\ennemis\boss10.bmp"
    loadbmp "boss11", "data\ennemis\boss11.bmp"
    loadbmp "boss12", "data\ennemis\boss12.bmp"
    loadbmp "tankHOMME", "data\tank1.bmp"
    loadbmp "tankFEMME", "data\tank2.bmp"
    loadbmp "archerHOMME", "data\archer1.bmp"
    loadbmp "archerFEMME", "data\archer2.bmp"
    loadbmp "guerrierHOMME", "data\guerrier1.bmp"
    loadbmp "guerrierFEMME", "data\guerrier2.bmp"
    loadbmp "mageHOMME", "data\mage1.bmp"
    loadbmp "mageFEMME", "data\mage2.bmp"
    loadbmp "artisanHOMME", "data\artisan1.bmp"
    loadbmp "artisanFEMME", "data\artisan2.bmp"
    loadbmp "donjon1", "data\donjon1.bmp"
    loadbmp "foret1", "data\foret1.bmp"
    loadbmp "sanglier1", "data\ennemis\sanglier1.bmp"
    loadbmp "sanglier2", "data\ennemis\sanglier2.bmp"
    loadbmp "araigner1", "data\ennemis\araigner1.bmp"
    loadbmp "araigner2", "data\ennemis\araigner2.bmp"
    loadbmp "araigner3", "data\ennemis\araigner3.bmp"
    loadbmp "araigner4", "data\ennemis\araigner4.bmp"
    loadbmp "araigner5", "data\ennemis\araigner5.bmp"
    loadbmp "gobelin1", "data\ennemis\gobelin1.bmp"
    loadbmp "gobelin2", "data\ennemis\gobelin2.bmp"
    loadbmp "gobelin3", "data\ennemis\gobelin3.bmp"
    loadbmp "gobelin4", "data\ennemis\gobelin4.bmp"
    loadbmp "gobelin5", "data\ennemis\gobelin5.bmp"
    loadbmp "gobelin6", "data\ennemis\gobelin6.bmp"
    loadbmp "plante1", "data\ennemis\plante1.bmp"
    loadbmp "ud1", "data\ennemis\garde1.bmp"
    loadbmp "ud2", "data\ennemis\garde2.bmp"
    loadbmp "phenix1", "data\ennemis\phenix1.bmp"
    loadbmp "centaur1", "data\ennemis\centaur1.bmp"
    loadbmp "golem1", "data\ennemis\golem1.bmp"
    loadbmp "golem2", "data\ennemis\golem2.bmp"
    loadbmp "dragon1", "data\ennemis\RedDragon1.bmp"
    loadbmp "map", "data\map1.bmp"
    loadbmp "map2", "data\map2.bmp"
    MusicSELECT = 1 : LvlDONJON = 1 : secu1PALLIER = 0 : secu2PALLIER = 0 : SECUmusic = 1 : RACE$ = "GUERRIER" : sexe = 1
    gosub [loading2]
    goto [start]

[ini]
timer 0
close #main
if MusicSELECT = 1 then playwave "data\sons\hit.wav", async

[start]
gosub [data]
PotionLittleHP = 0 : PotionMediumHP = 0 : PotionBigHP = 0 : PotionBig2HP = 0 : PotionBig3HP = 0 : noGAME = 1 : nameTAPER$ = "" : mdpTAPER$ = "" : TYPEatkEQUIP$ = "" : TYPEdefEQUIP$ = "" : lvlITEM2 = 0 : lvlITEM1 = 0 : load = 0 : PoS = 0
r = 11: b = 201 : v = 117 : WindowWidth = 800 : WindowHeight = 600 : BackgroundColor$ = "white" : ForegroundColor$ = "black"
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)

Langue$(0) = "Français / French"
Langue$(1) = "Anglais / English"
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight
combobox #main.langue, Langue$(, [version], 270, 185, 150, 40
textbox #main.login, 290, 370, 225, 25
textbox #main.mdp, 290, 420, 225, 25
groupbox #main.one, "",  60, 50, 680, 470
button #main.default, "Connexion", [confirm],UL 550,380,85,23

if version = 1 then button #main.a, "Créer Compte", [creatAC],UL 550,410,85,23
if version = 2 then button #main.a, "Creat Account", [creatAC],UL 550,410,85,23

open "SAOA Spéciale édition" for dialog_nf as #main
#main, "trapclose [quit]"
#main.map , "down;fill white"
print #main.map, "drawbmp main0 0 0"
print #main.map, "background main0"
print #main.map, "font Times Times New Roman 10;color white;backcolor ";r;" ";v;" ";b
if version = 1 then
    print #main.map, "place 290 365 ;\"; ":compte"
    print #main.map, "place 290 415 ;\"; ":mot de passe"
    print #main.map, "font Times New Roman 15"
    print #main.map, "place 165 363 ;\"; "Identifiants_::"
    print #main.map, "place 175 195 ;\"; "Langue"
    print #main.map, "font Times New Roman 9; color black; backcolor white"
    print #main.langue, "selectindex 1"
end if
if version = 2 then
    print #main.map, "place 290 365 ;\"; ":account"
    print #main.map, "place 290 415 ;\"; ":password"
    print #main.map, "font Times New Roman 15"
    print #main.map, "place 170 360 ;\"; "Log in_::"
    print #main.map, "place 175 203 ;\"; "Language"
    print #main.map, "font Times New Roman 9; color black; backcolor white"
    print #main.langue, "selectindex 2"
end if

print #main.a, "!font Times New Roman 10"
print #main.default, "!font Times New Roman 10"
print #main.one, "!font Times New Roman 9"
print #main.one, "S.A.O : Ascension [ Version : ";Version$; " ";langue$;" ]"
print #main.map, "flush"
wait

[confirm]
on error goto [noConfirm]
if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
print #main.login, "!contents? nameTAPER$"
print #main.mdp, "!contents? mdpTAPER$"
open "data\id\login";nameTAPER$;".sao" for input as #save
input #save, name$
input #save, mdp$
input #save, MusicSELECT
CLOSE #save
if name$ = nameTAPER$ and mdp$ = mdpTAPER$ then goto [confirm2]
[noConfirm]
print #main.map, "font Times New Roman 12; color black; backcolor white"
if version = 1 then print #main.map, "place 140 315 ;\"; "Identifiants incorrectes ou compte non créé !";"                                                                                                 "
if version = 2 then print #main.map, "place 140 315 ;\"; "Incorrect password or account not created !";"                                                                                             "
wait
[confirm2]
on error goto [GameStart]
open "data\id\Save";name$;".sao" for input as #save
input #save, name$
input #save, mdp$
input #save, MusicSELECT
CLOSE #save
if name$ = nameTAPER$ and mdp$ = mdpTAPER$ then goto [load]
goto [GameStart]

[creatAC]
if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
print #main.login, "!contents? nameTAPER$"
print #main.mdp, "!contents? mdpTAPER$"
if nameTAPER$ = "" or mdpTAPER$ = "" then
    print #main.map, "font Times New Roman 12; color black; backcolor white"
    if version = 1 then print #main.map, "place 140 315 ;\"; "Mettez votre identifiant et votre mot de passe puis confirmez avec 'créer compte'!";"                     "
    if version = 2 then print #main.map, "place 140 315 ;\"; "Put your login and password for creat account and click on 'creat account!";"                                    "
    wait
end if
open "data\id\login";nameTAPER$;".sao" for output as #save
print #save, nameTAPER$
print #save, mdpTAPER$
print #save, MusicSELECT
CLOSE #save
    print #main.map, "font Times New Roman 12; color black; backcolor white"
    if version = 1 then print #main.map, "place 140 315 ;\"; "Compte créé ! Vous pouvez maintenant vous connecter.";"                                                              "
    if version = 2 then print #main.map, "place 140 315 ;\"; "Account creat! You can now log in.";"                                                                   "
wait

[w]
if KILLER = 1 then end
wait

[version]
if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
print #main.langue, "selectionindex? xVar"
if xVar=1 then
   version = 1
   langue$ = "Français"
end if
if xVar=2 then
   version = 2
   langue$ = "English"
end if
close #main
goto [start]

[SimpleClickPRINT]
r = 215 : b = 215 : v = 215
print #main.map, "backcolor white;font Times New Roman 13"
print #main.map, "place 60 70 ;\"; "ID - ";nameTAPER$
if version = 1 then
    print #main.map, "font Times New Roman 9; color black;backcolor ";r;" ";v;" ";b
    print #main.map, "place 60 320 ;\"; "Points de vie : "; data1
    print #main.map, "place 60 335 ;\"; "Points de Science : "; data2
    print #main.map, "place 60 360 ;\"; "Armure : "; data3
    print #main.map, "place 60 375 ;\"; "Points d'attaque : "; data4
    print #main.map, "place 60 420 ;\"; "Agilité : "; data5
    print #main.map, "place 60 435 ;\"; "Force : "; data6
    print #main.map, "place 60 450 ;\"; "Intelligence : "; data7
    print #main.map, "place 60 475 ;\"; "Argent de départ : "; data8
    print #main.map, "place 60 400 ;\"; "Caractéristique principale : "; data9$
end if
if version= 2 then
    print #main.map, "font Times New Roman 9; color black;backcolor ";r;" ";v;" ";b
    print #main.map, "place 60 320 ;\"; "Points of life : "; data1
    print #main.map, "place 60 335 ;\"; "Points of Science : "; data2
    print #main.map, "place 60 360 ;\"; "Armore : "; data3
    print #main.map, "place 60 375 ;\"; "Points of dammages : "; data4
    print #main.map, "place 60 420 ;\"; "Agility : "; data5
    print #main.map, "place 60 435 ;\"; "Strengh : "; data6
    print #main.map, "place 60 450 ;\"; "Intelligence : "; data7
    print #main.map, "place 60 475 ;\"; "Starting money : "; data8
    print #main.map, "place 60 400 ;\"; "Main Characteristic : "; data9$
end if
return

[SimpleClick1]
if version = 1 then RACE$ = "GUERRIER" : data9$ = "Force"
if version = 2 then RACE$ = "WARRIOR" : data9$ = "Strenght"
data1 = 93 : data2 = 7 : data3 = 5 : data4 = 40 : data5 = 8 : data6 = 12 : data7 = 6 : data8 = 100 : campagne = 1
gosub [SimpleClickPRINT]
if sexe = 1 then print #main.map, "drawbmp miniGUERRIERhomme 100 100"
if sexe = 2 then print #main.map, "drawbmp miniGUERRIERfemme 115 100"
return

[SimpleClick2]
if version = 1 then data9$ = "Agilité"
if version = 2 then data9$ = "Agility"
data1 = 60 : data2 = 11 : data3 = 4 : data4 = 44 : data5 = 15 : data6 = 7 : data7 = 10 : data8 = 100 : campagne = 2 : RACE$ = "ARCHER"
gosub [SimpleClickPRINT]
if sexe = 1 then print #main.map, "drawbmp miniARCHERhomme 110 90"
if sexe = 2 then print #main.map, "drawbmp miniARCHERfemme 100 100"
return

[SimpleClick3]
if version = 1 then data9$ = "Force"
if version = 2 then data9$ = "Strenght"
data1 = 154 : data2 = 2 : data3 = 6 : data4 = 45 : data5 = 7 : data6 = 19 : data7 = 1 : data8 = 100 : campagne = 3 : RACE$ = "TANK"
gosub [SimpleClickPRINT]
if sexe = 1 then print #main.map, "drawbmp miniTANKhomme 100 100"
if sexe = 2 then print #main.map, "drawbmp miniTANKfemme 115 100"
return

[SimpleClick4]
data1 = 52 : data2 = 13 : data3 = 4 : data4 = 25 : data5 = 6 : data6 = 5 : data7 = 11 : data8 = 350 : campagne = 4 : data9$ = "Intelligence" : RACE$ = "ARTISAN"
gosub [SimpleClickPRINT]
if sexe = 1 then print #main.map, "drawbmp miniARTISANhomme 100 100"
if sexe = 2 then print #main.map, "drawbmp miniARTISANfemme 115 100"
return

[SimpleClick5]
if version = 2 then RACE$ = "HEALER"
if version = 1 then RACE$ = "SOIGNEUR"
data1 = 50 : data2 = 18 : data3 = 2 : data4 = 37 : data5 = 5 : data6 = 5 : data7 = 16 : data8 = 200 : campagne = 5 : data9$ = "Intelligence"
gosub [SimpleClickPRINT]
if sexe = 1 then print #main.map, "drawbmp miniSOIGNEURhomme 100 100"
if sexe = 2 then print #main.map, "drawbmp miniSOIGNEURfemme 115 100"
return

[GameStart]
gosub [FLOOR]
close #main
if version = 1 then sexe$ = "Homme"
if version = 2 then sexe$ = "Man"
returnAction = 1 : sexe = 1 : campagne = 0
lvlPASSIVE1 = 0 : lvlPASSIVE2 = 0 : lvlPASSIVE3 = 0 : lvlPASSIVE4 = 0 : lvlPASSIVE5 = 0 : lvlPASSIVE6 = 0
BONUSatk = 0 : TYPEatk$ = "" : BONUSdef = 0 : TYPEdef$ = "" : r = 100 : b = 100 : v = 100
WindowWidth = 800 : WindowHeight = 600 : UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)
graphicbox #main.map, 1, 1, WindowWidth-7, WindowHeight-30
open " " for dialog_nf as #main
#main, "trapclose [quit]"
print #main.map, "color black"
#main.map , "down;fill white"
print #main.map, "drawbmp main 0 0"
print #main.map, "background main"
print #main.map, "font Times New Roman 11;color white;backcolor ";r;" ";v;" ";b
if version = 2 then
    print #main.map, "place 405 215 ;\"; "MAN"
    print #main.map, "place 405 255 ;\"; "WOMAN"
    print #main.map, "backcolor white;color black"
    print #main.map, "place 565 145 ;\"; "WARRIOR"
    print #main.map, "place 565 185 ;\"; "ARCHER"
    print #main.map, "place 565 225 ;\"; "TANK"
    print #main.map, "place 565 266 ;\"; "ARTISAN"
    print #main.map, "place 565 307 ;\"; "HEALER"
end if
if version = 1 then
    print #main.map, "place 405 215 ;\"; "HOMME"
    print #main.map, "place 405 255 ;\"; "FEMME"
    print #main.map, "backcolor white;color black"
    print #main.map, "place 565 145 ;\"; "GUERRIER"
    print #main.map, "place 565 185 ;\"; "ARCHER"
    print #main.map, "place 565 225 ;\"; "TANK"
    print #main.map, "place 565 266 ;\"; "ARTISAN"
    print #main.map, "place 565 307 ;\"; "SOIGNEUR"
end if
#main.map, "setfocus; when leftButtonDown [SimpleClickRACE]"
returnAction = 0 : campagne = 6
gosub [SimpleClick1]
print #main.map, "drawbmp add 680 128"
print #main.map, "drawbmp add2 370 200"
print #main.map, "flush"
wait

[SimpleClickRACE]
mX = MouseX
mY = MouseY

    r = 100 : v = 100 : b = 100
    print #main.map, "font Times New Roman 12;backcolor ";r;" ";v;" ";b
    if mX>355 and mX<505 and mY>190 and mY<225 then
        sexe = 1
        if version = 1 then sexe$ = "Homme"
        if version = 2 then sexe$ = "Man"
        print #main.map, "place 360 255 ;\"; "         "
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        print #main.map, "drawbmp add2 370 200"
        print #main.map, "drawbmp clear 40 40"
        if campagne= 1 then print #main.map, "drawbmp miniGUERRIERhomme 100 100"
        if campagne= 3 then print #main.map, "drawbmp miniTANKhomme 100 100"
        if campagne= 2 then print #main.map, "drawbmp miniARCHERhomme 110 90"
        if campagne= 4 then print #main.map, "drawbmp miniARTISANhomme 100 100"
        if campagne= 5 then print #main.map, "drawbmp miniSOIGNEURhomme 100 100"
        if RACE$ = "GUERRIER" or RACE$ = "WARRIOR" then gosub [SimpleClick1]
        if RACE$ = "ARCHER" then gosub [SimpleClick2]
        if RACE$ = "TANK" then gosub [SimpleClick3]
        if RACE$ = "ARTISAN" then gosub [SimpleClick4]
        if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" then gosub [SimpleClick5]
        wait
    end if
    if mX>355 and mX<505 and mY>230 and mY<275 then
        sexe = 2
        if version = 1 then sexe$ = "Femme"
        if version = 2 then sexe$ = "Woman"
        print #main.map, "place 360 215 ;\"; "         "
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        print #main.map, "drawbmp add2 370 240"
        print #main.map, "drawbmp clear 40 40"
        if campagne= 1 then print #main.map, "drawbmp miniGUERRIERfemme 115 100"
        if campagne= 3 then print #main.map, "drawbmp miniTANKfemme 115 100"
        if campagne= 2 then print #main.map, "drawbmp miniARCHERfemme 100 100"
        if campagne= 4 then print #main.map, "drawbmp miniARTISANfemme 115 100"
        if campagne= 5 then print #main.map, "drawbmp miniSOIGNEURfemme 115 100"
        if RACE$ = "GUERRIER" or RACE$ = "WARRIOR" then gosub [SimpleClick1]
        if RACE$ = "ARCHER" then gosub [SimpleClick2]
        if RACE$ = "TANK" then gosub [SimpleClick3]
        if RACE$ = "ARTISAN" then gosub [SimpleClick4]
        if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" then gosub [SimpleClick5]
        wait
    end if
    if mX>520 and mX<580 and mY>355 and mY<400 then goto [ini]
    if mX>605 and mX<660 and mY>355 and mY<400 then goto [RACE]
    if mX>550 and mX<650 and mY<170 and mY>130 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        print #main.map, "color black; size 40"
        print #main.map, "line "; 700; " "; 100; " "; 700; " "; 500
        print #main.map, "drawbmp clear 40 40"
        print #main.map, "drawbmp add 680 128"
        gosub [SimpleClick1]
    end if
    if mX>550 and mX<650 and mY<205 and mY>170 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        print #main.map, "color black; size 40"
        print #main.map, "line "; 700; " "; 100; " "; 700; " "; 500
        print #main.map, "drawbmp clear 40 40"
        print #main.map, "drawbmp add 680 168"
        gosub [SimpleClick2]
    end if
    if mX>550 and mX<650 and mY<244 and mY>206 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        print #main.map, "color black; size 40"
        print #main.map, "line "; 700; " "; 100; " "; 700; " "; 500
        print #main.map, "drawbmp clear 40 40"
        print #main.map, "drawbmp add 680 208"
        gosub [SimpleClick3]
    end if
    if mX>550 and mX<650 and mY<285 and mY>245 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        print #main.map, "color black; size 40"
        print #main.map, "line "; 700; " "; 100; " "; 700; " "; 500
        print #main.map, "drawbmp clear 40 40"
        print #main.map, "drawbmp add 680 249"
        gosub [SimpleClick4]
    end if
    if mX>550 and mX<650 and mY<325 and mY>286 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        print #main.map, "color black; size 40"
        print #main.map, "line "; 700; " "; 100; " "; 700; " "; 500
        print #main.map, "drawbmp clear 40 40"
        print #main.map, "drawbmp add 680 290"
        gosub [SimpleClick5]
    end if
wait

[RACE]
if sexe = 0 or sexe$ = "" then
    if version = 1 then notice " " + chr$(13) + "Choisisez le sexe de votre personnage"
    if version = 2 then notice " " + chr$(13) + "Choose the sex of your character"
    wait
end if
Select case campagne
case 1
    goto [GameHUMAN]
case 2
    goto [GameELVE]
case 3
    goto [GameORCS]
case 4
    goto [GameDWARF]
case 5
    goto [GameNECRO]
case 6
    goto [randomGAME]
end select
wait
[randomGAME]
val = int(rnd(1)*5)+1
if val < 1 then goto [randomGAME]
campagne = val
gosub [data]
goto [RACE]

[GameHUMAN]
close #main
campagne = 1
if version = 1 then capacity$ = "Force" : RACE$ = "GUERRIER"
if version = 2 then capacity$ = "Strength" : RACE$ = "WARRIOR"
gosub [data]
goto [GameStartMAIN]

[GameELVE]
close #main
campagne = 2
if version = 1 then capacity$ = "Agilité" : RACE$ = "ARCHER"
if version = 2 then capacity$ = "Agility" : RACE$ = "ARCHER"
gosub [data]
goto [GameStartMAIN]

[GameORCS]
close #main
campagne = 3
if version = 1 then capacity$ = "Strength" : RACE$ = "TANK"
if version = 2 then capacity$ = "Force" : RACE$ = "TANK"
gosub [data]
goto [GameStartMAIN]

[GameDWARF]
close #main
campagne = 4
if version = 1 then capacity$ = "Science" : RACE$ = "ARTISAN"
if version = 2 then capacity$ = "Science" : RACE$ = "ARTISAN"
gosub [data]
goto [GameStartMAIN]

[GameNECRO]
close #main
campagne = 5
if version = 1 then capacity$ = "Science" : RACE$ = "SOIGNEUR"
if version = 2 then capacity$ = "Science" : RACE$ = "HEALER"
gosub [data]
goto [GameStartMAIN]

[versionINGAME]
if version = 1 then version = 2 : goto [GameStartMAINsecu2]
if version = 2 then version = 1 : goto [GameStartMAINsecu2]

[BUTTONmenu]
BUTTONmenu = 1 : BUTTONmenu2 = 0

r = 12 : b = 102 : v = 49
print #main.map, "size 50; color ";r;" ";v;" ";b
print #main.map, "line "; 180; " "; 30; " "; 435; " "; 30
print #main.map, "line "; 180; " "; 70; " "; 435; " "; 70
print #main.map, "line "; 180; " "; 110; " "; 520; " "; 110
print #main.map, "line "; 180; " "; 150; " "; 520; " "; 150
r = 186 : v = 184 : b = 135
print #main.map, "size 5 ; color ";r;" ";v;" ";b
print #main.map, "place "; 200; " "; 60
print #main.map, "ellipse "; 60 ; " "; 60
print #main.map, "size 1 ; color black"
print #main.map, "place "; 200; " "; 60
print #main.map, "ellipse "; 55 ; " "; 55
print #main.map, "place "; 200; " "; 60
print #main.map, "ellipse "; 65 ; " "; 65
r = 186 : v = 184 : b = 135
print #main.map, "size 5 ; color ";r;" ";v;" ";b
print #main.map, "place "; 200; " "; 130
print #main.map, "ellipse "; 60 ; " "; 60
print #main.map, "size 1 ; color black"
print #main.map, "place "; 200; " "; 130
print #main.map, "ellipse "; 55 ; " "; 55
print #main.map, "place "; 200; " "; 130
print #main.map, "ellipse "; 65 ; " "; 65
r = 186 : v = 184 : b = 135
print #main.map, "size 5 ; color ";r;" ";v;" ";b
print #main.map, "place "; 320; " "; 60
print #main.map, "ellipse "; 60 ; " "; 60
print #main.map, "size 1 ; color black"
print #main.map, "place "; 320; " "; 60
print #main.map, "ellipse "; 55 ; " "; 55
print #main.map, "place "; 320; " "; 60
print #main.map, "ellipse "; 65 ; " "; 65
r = 186 : v = 184 : b = 135
print #main.map, "size 5 ; color ";r;" ";v;" ";b
print #main.map, "place "; 320; " "; 130
print #main.map, "ellipse "; 60 ; " "; 60
print #main.map, "size 1 ; color black"
print #main.map, "place "; 320; " "; 130
print #main.map, "ellipse "; 55 ; " "; 55
print #main.map, "place "; 320; " "; 130
print #main.map, "ellipse "; 65 ; " "; 65
r = 186 : v = 184 : b = 135
print #main.map, "size 5 ; color ";r;" ";v;" ";b
print #main.map, "place "; 430; " "; 130
print #main.map, "ellipse "; 60 ; " "; 60
print #main.map, "size 1 ; color black"
print #main.map, "place "; 430; " "; 130
print #main.map, "ellipse "; 55 ; " "; 55
print #main.map, "place "; 430; " "; 130
print #main.map, "ellipse "; 65 ; " "; 65
r = 12 : b = 102 : v = 49
print #main.map, "font Times New Roman 12; color white;backcolor ";r;" ";v;" ";b
if version = 1 then
    print #main.map, "place 190 64 ;\"; "Sauvegarder    "
    print #main.map, "place 190 135 ;\"; "Identifiants  "
    print #main.map, "place 310 135 ;\"; "Langue        "
    print #main.map, "place 420 135 ;\"; " (!) Aide"
end if
if version = 2 then
    print #main.map, "place 190 64 ;\"; "Save data      "
    print #main.map, "place 190 135 ;\"; "Log in    "
    print #main.map, "place 310 135 ;\"; "Language      "
    print #main.map, "place 420 135 ;\"; " (!) Help          "
end if
if version = 1 and MusicSELECT = 0 then print #main.map, "place 310 64 ;\"; "Bruitage (Off)              "
if version = 1 and MusicSELECT = 1 then print #main.map, "place 310 64 ;\"; "Bruitage (On)            "
if version = 2 and MusicSELECT = 0 then print #main.map, "place 310 62 ;\"; "Sounds (Off)               "
if version = 2 and MusicSELECT = 1 then print #main.map, "place 310 62 ;\"; "Sounds (On)            "
wait

[BUTTONmenu2]
BUTTONmenu = 0 : BUTTONmenu2 = 1 : activBUTON1 = 0
r = 12 : b = 102 : v = 49
print #main.map, "size 50; color ";r;" ";v;" ";b
print #main.map, "line "; 180; " "; 30; " "; 435; " "; 30
print #main.map, "line "; 180; " "; 70; " "; 435; " "; 70
print #main.map, "line "; 180; " "; 110; " "; 520; " "; 110
print #main.map, "line "; 180; " "; 150; " "; 520; " "; 150
r = 186 : v = 184 : b = 135
print #main.map, "size 5 ; color ";r;" ";v;" ";b
print #main.map, "place "; 200; " "; 60
print #main.map, "ellipse "; 60 ; " "; 60
print #main.map, "size 1 ; color black"
print #main.map, "place "; 200; " "; 60
print #main.map, "ellipse "; 55 ; " "; 55
print #main.map, "place "; 200; " "; 60
print #main.map, "ellipse "; 65 ; " "; 65
r = 186 : v = 184 : b = 135
print #main.map, "size 5 ; color ";r;" ";v;" ";b
print #main.map, "place "; 200; " "; 130
print #main.map, "ellipse "; 60 ; " "; 60
print #main.map, "size 1 ; color black"
print #main.map, "place "; 200; " "; 130
print #main.map, "ellipse "; 55 ; " "; 55
print #main.map, "place "; 200; " "; 130
print #main.map, "ellipse "; 65 ; " "; 65
r = 186 : v = 184 : b = 135
print #main.map, "size 5 ; color ";r;" ";v;" ";b
print #main.map, "place "; 320; " "; 60
print #main.map, "ellipse "; 60 ; " "; 60
print #main.map, "size 1 ; color black"
print #main.map, "place "; 320; " "; 60
print #main.map, "ellipse "; 55 ; " "; 55
print #main.map, "place "; 320; " "; 60
print #main.map, "ellipse "; 65 ; " "; 65
r = 186 : v = 184 : b = 135
print #main.map, "size 5 ; color ";r;" ";v;" ";b
print #main.map, "place "; 320; " "; 130
print #main.map, "ellipse "; 60 ; " "; 60
print #main.map, "size 1 ; color black"
print #main.map, "place "; 320; " "; 130
print #main.map, "ellipse "; 55 ; " "; 55
print #main.map, "place "; 320; " "; 130
print #main.map, "ellipse "; 65 ; " "; 65
r = 12 : b = 102 : v = 49
print #main.map, "font Times New Roman 12; color white;backcolor ";r;" ";v;" ";b
if version = 1 then
    print #main.map, "place 190 65 ;\"; "Guérisseuse "
    print #main.map, "place 190 135 ;\"; "Armes      "
    print #main.map, "place 310 65 ;\"; "Armures          "
    print #main.map, "place 310 135 ;\"; "Forgeron   "
end if
if version = 2 then
    print #main.map, "place 190 65 ;\"; "Healer                "
    print #main.map, "place 190 135 ;\"; "Weapon Seller"
    print #main.map, "place 310 65 ;\"; "Armors Seller"
    print #main.map, "place 310 135 ;\"; "Black-Smith "
end if
wait

[SimpleClickG1]
    mX = MouseX
    mY = MouseY

    if mX>30 and mX<130 and mY>20 and mY<100 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        goto [BUTTONmenu]
    end if

    if BUTTONmenu = 1 then
    if mX>160 and mX<260 and mY>30 and mY<90 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        goto [save]
    end if
    if mX>160 and mX<260 and mY>100 and mY<160 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        goto [confirmationC]
    end if
    if mX>285 and mX<380 and mY>30 and mY<90 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        goto [MusicSELECT]
    end if
    if mX>285 and mX<380 and mY>100 and mY<160 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        goto [versionINGAME]
    end if
    if mX>395 and mX<480 and mY>100 and mY<1600 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        goto [GameStartMAINsecu]
    end if

    end if

    if mX>30 and mX<130 and mY>120 and mY<200 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        goto [BUTTONmenu2]
    end if

    if BUTTONmenu2 = 1 then
    if mX>160 and mX<260 and mY>30 and mY<90 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        goto [healer]
    end if
    if mX>160 and mX<240 and mY>100 and mY<160 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        goto [Weapon]
    end if
    if mX>285 and mX<380 and mY>30 and mY<90 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        goto [Armory]
    end if
    if mX>285 and mX<380 and mY>100 and mY<160 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        goto [forgeron]
    end if
    end if

    if mX>360 and mX<440 and mY>325 and mY<395 then
        goto [donjon]
    end if
    if mX>545 and mX<635 and mY>85 and mY<175 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        goto [Arena0]
    end if
    if mX>665 and mX<745 and mY>85 and mY<175 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        goto [Character]
    end if

    BUTTONmenu = 0 : BUTTONmenu2 = 0
    r = 12 : b = 102 : v = 49
    print #main.map, "size 50; color ";r;" ";v;" ";b
    print #main.map, "line "; 180; " "; 30; " "; 435; " "; 30
    print #main.map, "line "; 180; " "; 70; " "; 435; " "; 70
    print #main.map, "line "; 180; " "; 110; " "; 520; " "; 110
    print #main.map, "line "; 180; " "; 150; " "; 520; " "; 150
    goto [GameStartMAINsecu2]

[GameStartMAINsecu]
timer 0
close #main
[GameStartMAIN]
if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
WindowWidth = 800 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)
graphicbox #main.map, 1, 1, WindowWidth-7, WindowHeight-30
if version = 1 then button #main.1, "ALLER A L'AVENTURE", [GameStartMAINsecu2],UL 70,520,220,30
if version = 2 then button #main.1, "GO TO ADVENTURE", [GameStartMAINsecu2],UL 70,520,220,30
open " " for dialog_nf as #main
#main, "trapclose [quit]"
#main.map , "down;fill black"
print #main.map, "drawbmp aide 0 0"
print #main.map, "background aide"
print #main.map, "backcolor white;font Times New Roman 9; color black"
if version = 1 then
    print #main.map, "place 50 45 ;\"; "Bienvenue dans SAOA Version ";Version$;"\Vous commencez l'aventure au premier niveau de l'immence donjon que vous voyez ci-dessous. Chacun de ses niveau est si vaste qu'il y\contient une ville et des terres qui lui sont propres. Dans chaques villes vous trouverez de nombreux marchands vous proposants différents\items et équipements pour vous aider dans votre aventure. Il existe deux entrées pour le donjon principal. Une sur la vue principale et\l'autre sur la carte du niveau.Attention a ne pas vous lancer directement dans le donjon ! Gagnez vos niveaux sur les vastes terres de\chaques niveaux.Un dernier point important : Si vous mourrez une fois... votre mort sera définitive ! Ne faite pas d'actes irréfléchis.\Vous terminerez le jeu une fois le Boss du 100ème niveau vaincu ! Bonne chance !"
    print #main.map, "place 440 190 ;\"; "Les compétences et les points de\caractéristiques sont importants\surtout au début ! Ne les oubliez\pas après chaque niveau !"
    print #main.map, "place 50 190 ;\"; "Le donjon centrale est un lieu\dangereux ! N'y allez pas dès le\début ! Gagnez des niveaux et\équipez vous lourdement !\Entrainez vous sur la carte."
    print #main.map, "place 50 380 ;\"; "Conseils pour un bon départ !\1) Allez dans votre inventaire et répartissez vos points de caractéristiques et\vos compétences\2) Achetez une arme et une armure.\3) Allez sur la carte et combattez jusqu'au niveau 6-8.\4) Achetez des potions, améliorez votre équipement.\Si votre vie baisse trop, soignez vous ! ne mourrez pas !!!"
end if
if version = 2 then
    print #main.map, "place 50 45 ;\"; "Welcome to SAOA Version ";Version$;"\Vous commencez l'aventure au premier niveau de l'immence donjon que vous voyez ci-dessous. Chacun de ses niveau est si vaste qu'il y\contient une ville et des terres qui lui sont propres. Dans chaques villes vous trouverez de nombreux marchands vous proposants différents\items et équipements pour vous aider dans votre aventure. Il existe deux entrées pour le donjon principal. Une sur la vue principale et\l'autre sur la carte du niveau.Attention a ne pas vous lancer directement dans le donjon ! Gagnez vos niveaux sur les vastes terres de\chaques niveaux.Un dernier point important : Si vous mourrez une fois... votre mort sera définitive ! Ne faite pas d'actes irréfléchis.\Vous terminerez le jeu une fois le Boss du 100ème niveau vaincu ! Bonne chance !"
    print #main.map, "place 440 190 ;\"; "Skills and characters points are\importants, mostly at the beginning !\Do not forget they\after each level up !"
    print #main.map, "place 50 190 ;\"; "The central dungeon is a dangerous\place ! Dont go at the beginning !\Take levels and weapons, train you\on the map and be stronger!"
    print #main.map, "place 50 380 ;\"; "Advices for good start !\1) Go to your inventory and divide you characteristics and your skills.\2) Buy a weapon and a armor.\3) Go to the map and train your character until level 6-8.\4) Buy potions and upgrade your stuff.\If your heal is to weak, go to heal you ! Do not dead !!!"
end if
print #main.1, "!font Times New Roman 10"
print #main.map, "flush"
wait

[GameStartMAINsecu2]
timer 0
close #main
[GameStartMAIN2]
if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
if SECUmusic = 1 then SECUmusic = 0
noGAME = 0 : arena = 0 : donjon = 0 : city = 1 : camp = 1 : WindowWidth = 800 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)
if NumberFLOORmonster <= 0 then BOSS = 1
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight

if version = 2 then
    if BOSS = 1 then statutDONJON$ = "BOSS chalenge"
    if BOSS = 0 then statutDONJON$ = "Explore"
end if
if version = 1 then
    if BOSS = 1 then statutDONJON$ = "BOSS chalenge"
    if BOSS = 0 then statutDONJON$ = "Exploration"
end if

open "Sword Art Online : Ascension [Build ";Version$;"]"for window_nf as #main
#main, "trapclose [quit]"
#main.map , "down; fill white"
#main.map, "when leftButtonDown [SimpleClickG1]"
print #main.map, "drawbmp mainCASTLE 0 0"
print #main.map, "background mainCASTLE"
#main.map,"addsprite barre barre"
#main.map,"spritexy barre 515 24"
#main.map "SetFocus; DrawSprites"
print #main.map, "drawbmp mapbutton 550 85"
print #main.map, "drawbmp perso 660 85"
gosub [HPbarre]
gosub [DATAlife]
'button
r = 186 : v = 184 : b = 135
print #main.map, "size 80 ; color ";r;" ";v;" ";b
print #main.map, "line "; 400; " "; 360; " "; 400; " "; 360
print #main.map, "line "; 80; " "; 60; " "; 80; " "; 60
print #main.map, "line "; 80; " "; 160; " "; 80; " "; 160
'--------
print #main.map, "font Times New Roman 9; color black"
print #main.map, "size 2 ; color black"
print #main.map, "place "; 80; " "; 60
print #main.map, "ellipse "; 80 ; " "; 80
print #main.map, "size 1 ; color black"
print #main.map, "place "; 80; " "; 60
print #main.map, "ellipse "; 75 ; " "; 75
print #main.map, "size 2 ; color black"
print #main.map, "place "; 80; " "; 160
print #main.map, "ellipse "; 80 ; " "; 80
print #main.map, "size 1 ; color black"
print #main.map, "place "; 80; " "; 160
print #main.map, "ellipse "; 75 ; " "; 75
print #main.map, "size 2 ; color black"
print #main.map, "place "; 400; " "; 360
print #main.map, "ellipse "; 80 ; " "; 80
print #main.map, "size 1 ; color black"
print #main.map, "place "; 400; " "; 360
print #main.map, "ellipse "; 75 ; " "; 75
r = 136 : v = 136 : b = 136
print #main.map, "font Times New Roman 8; color white;backcolor ";r;" ";v;" ";b
if version = 1 then print #main.map, "backcolor ";r;" ";v;" ";b ;"; place 540 36 ;\"; name$; " - ";RACE$;" - Palier ";LvlDONJON
if version = 2 then print #main.map, "backcolor ";r;" ";v;" ";b ;"; place 540 36 ;\"; name$; " - ";RACE$;" - Floor ";LvlDONJON
r = 186 : v = 184 : b = 135
print #main.map, "size 1 ; color black;backcolor ";r;" ";v;" ";b
if version = 1 then
    print #main.map, "place 378 357 ;\"; "DONJON"
    print #main.map, "place 380 372 ;\"; "(Entrée)"
    print #main.map, "font Times New Roman 12"
    print #main.map, "place 58 165 ;\"; "VILLE"
end if
if version = 2 then
    print #main.map, "place 374 357 ;\"; "DUNGEON"
    print #main.map, "place 376 372 ;\"; "(Entrance)"
    print #main.map, "font Times New Roman 12"
    print #main.map, "place 62 165 ;\"; "CITY"
end if
print #main.map, "place 58 65 ;\"; "MENU"
if activBUTON1 = 1 then goto [BUTTONmenu2]
print #main.map, "flush"
wait

[reZIZ]
if pv > 99999 then pv$ = "";str$(int(pv/1000));" k"
if pv > 99999999 then pv$ = "";str$(int(pv/1000000));" m"
if pv > 99999999999 then pv$ = "";str$(int(pv/1000000000));" M"
if pv > 99999999999999 then pv$ = "";str$(int(pv/1000000000999));" kM"
if pv < 99999 then pv$ = "";str$(pv)
if pvTOTAL > 99999 then pvTOTAL$ = "";str$(int(pvTOTAL/1000));" k"
if pvTOTAL > 99999999 then pvTOTAL$ = "";str$(int(pvTOTAL/1000000));" m"
if pvTOTAL > 99999999999 then pvTOTAL$ = "";str$(int(pvTOTAL/1000000000));" M"
if pvTOTAL > 99999999999999 then pvTOTAL$ = "";str$(int(pvTOTAL/1000000000000));" kM"
if pvTOTAL < 99999 then pvTOTAL$ = "";str$(pvTOTAL)
if atk > 99999 then atk$ = "";str$(int(atk/1000));" k"
if atk > 99999999 then atk$ = "";str$(int(atk/1000000));" m"
if atk > 99999999999 then atk$ = "";str$(int(atk/1000000000));" M"
if atk > 99999999999999 then atk$ = "";str$(int(atk/1000000000000));" kM"
if atk < 99999 then atk$ = "";str$(atk)
if BONUSatk > 99999 then BONUSatk$ = "";str$(int(BONUSatk/1000));" k"
if BONUSatk > 99999999 then BONUSatk$ = "";str$(int(BONUSatk/1000000));" m"
if BONUSatk > 99999999999 then BONUSatk$ = "";str$(int(BONUSatk/1000000000));" M"
if BONUSatk > 99999999999999 then BONUSatk$ = "";str$(int(BONUSatk/1000000000000));" kM"
if BONUSatk < 99999 then BONUSatk$ = "";str$(BONUSatk)
if def > 99999 then def$ = "";str$(int(def/1000));" k"
if def > 99999999 then def$ = "";str$(int(def/1000000));" m"
if def > 99999999999 then def$ = "";str$(int(def/1000000000));" M"
if def > 99999999999999 then def$ = "";str$(int(def/1000000000000));" kM"
if def < 99999 then def$ = "";str$(def)
if BONUSdef > 99999 then BONUSdef$ = "";str$(int(BONUSdef/1000));" k"
if BONUSdef > 99999999 then BONUSdef$ = "";str$(int(BONUSdef/1000000));" m"
if BONUSdef > 99999999999 then BONUSdef$ = "";str$(int(BONUSdef/1000000000));" M"
if BONUSdef > 99999999999999 then BONUSdef$ = "";str$(int(BONUSdef/1000000000000));" kM"
if BONUSdef < 99999 then BONUSdef$ = "";str$(BONUSdef)
if xpTOTAL < 99999 then xpTOTAL$ = "";str$(xpTOTAL)
if xpTOTAL > 99999 then xpTOTAL$ = "";str$(int(xpTOTAL/1000));" k"
if xpTOTAL > 99999999 then xpTOTAL$ = "";str$(int(xpTOTAL/1000000));" m"
if xpTOTAL > 99999999999 then xpTOTAL$ = "";str$(int(xpTOTAL/1000000000));" M"
if xpTOTAL > 99999999999999 then xpTOTAL$ = "";str$(int(xpTOTAL/1000000000000));" kM"
if xp < 99999 then xp$ = "";str$(xp)
if xp > 99999 then xp$ = "";str$(int(xp/1000));" k"
if xp > 99999999 then xp$ = "";str$(int(xp/1000000));" m"
if xp > 99999999999 then xp$ = "";str$(int(xp/1000000000));" M"
if xp > 99999999999999 then xp$ = "";str$(int(xp/1000000000000));" kM"
if pvENNEMI > 99999 then pvENNEMI$ = "";str$(int(pvENNEMI/1000));" k"
if pvENNEMI > 99999999 then pvENNEMI$ = "";str$(int(pvENNEMI/1000000));" m"
if pvENNEMI > 99999999999 then pvENNEMI$ = "";str$(int(pvENNEMI/1000000000));" M"
if pvENNEMI > 99999999999999 then pvENNEMI$ = "";str$(int(pvENNEMI/1000000000999));" kM"
if pvENNEMI < 99999 then pvENNEMI$ = "";str$(pvENNEMI)
if pvTOTALennemi > 99999 then pvTOTALennemi$ = "";str$(int(pvTOTALennemi/1000));" k"
if pvTOTALennemi > 99999999 then pvTOTALennemi$ = "";str$(int(pvTOTALennemi/1000000));" m"
if pvTOTALennemi > 99999999999 then pvTOTALennemi$ = "";str$(int(pvTOTALennemi/1000000000));" M"
if pvTOTALennemi > 99999999999999 then pvTOTALennemi$ = "";str$(int(pvTOTALennemi/1000000000000));" kM"
if pvTOTALennemi < 99999 then pvTOTALennemi$ = "";str$(pvTOTALennemi)
return

[passive1]
r = 215: v =215 : b = 215
print #main.map, "backcolor ";r;" ";v;" ";b
if PoS <= 0 then wait
lvlPASSIVE1 = lvlPASSIVE1 + 1
lvlPASSIVE1$ = str$(lvlPASSIVE1)
pv = pv + int((11+(4*LvlDONJON))*1)
pvTOTAL = pvTOTAL + int((11+(4*LvlDONJON))*1)
PoS = PoS - 1
print #main.map, "font Times New Roman 10; color black"
if version = 1 then print #main.map, "place 80 360 ;\"; "Points de vie : "; pv$; " / ";pvTOTAL$
if version = 2 then print #main.map, "place 80 360 ;\"; "Points of Life : "; pv$; " / ";pvTOTAL$
print #main.map, "backcolor black; color white"
print #main.map, "font Times New Roman 9"
if version = 1 then print #main.map, "place 545 110 ;\"; "Points de compétences disponibles :  "; PoS;"       "
if version = 2 then print #main.map, "place 545 110 ;\"; "Points of skills available :  "; PoS;"        "
print #main.map, "font Times New Roman 8;backcolor white"
print #main.map, "color black"
print #main.map, "place 580 140 ;\"; "+ ";int(11+(4*LvlDONJON));" Pv (x";lvlPASSIVE1;")"
wait
[passive2]
r = 215: v =215 : b = 215
print #main.map, "backcolor ";r;" ";v;" ";b
if PoS <= 0 then wait
lvlPASSIVE2 = lvlPASSIVE2 + 1
lvlPASSIVE2$ = str$(lvlPASSIVE2)
atk = atk + int((5+(1*LvlDONJON))*1)
PoS = PoS - 1
gosub [reZIZ]
print #main.map, "font Times New Roman 10; color black"
if version = 1 then print #main.map, "place 80 415 ;\"; "Points d'attaque : "; atk$ ; " + ";BONUSatk$;"   "
if version = 2 then print #main.map, "place 80 415 ;\"; "Points of Damages : "; atk$ ; " + ";BONUSatk$;"   "
print #main.map, "backcolor black; color white"
print #main.map, "font Times New Roman 9"
if version = 1 then print #main.map, "place 545 110 ;\"; "Points de compétences disponibles :  "; PoS;"        "
if version = 2 then print #main.map, "place 545 110 ;\"; "Points of skills available :  "; PoS;"        "
print #main.map, "font Times New Roman 8;backcolor white"
print #main.map, "color black"
print #main.map, "place 580 181 ;\"; "+ ";int(5+(1*LvlDONJON));" Atk (x";lvlPASSIVE2;")"
wait
[passive3]
r = 215: v =215 : b = 215
print #main.map, "backcolor ";r;" ";v;" ";b
if PoS <= 0 then wait
lvlPASSIVE3 = lvlPASSIVE3 + 1
lvlPASSIVE3$ = str$(lvlPASSIVE3)
def = def + int((5+(1*LvlDONJON))*1)
PoS = PoS - 1
gosub [reZIZ]
print #main.map, "font Times New Roman 10; color black"
if version = 2 then print #main.map, "place 80 400 ;\"; "Armor : "; def$; " + "; BONUSdef$;"        "
if version = 1 then print #main.map, "place 80 400 ;\"; "Armure : "; def$; " + "; BONUSdef$;"        "
print #main.map, "backcolor black; color white"
print #main.map, "font Times New Roman 9"
if version = 1 then print #main.map, "place 545 110 ;\"; "Points de compétences disponibles :  "; PoS;"        "
if version = 2 then print #main.map, "place 545 110 ;\"; "Points of skills available :  "; PoS;"        "
print #main.map, "font Times New Roman 8;backcolor white"
print #main.map, "color black"
print #main.map, "place 580 222 ;\"; "+ ";int(5+(1*LvlDONJON));" Def (x";lvlPASSIVE3;")"
wait
[passive4]
r = 215: v =215 : b = 215
print #main.map, "backcolor ";r;" ";v;" ";b
if PoS <= 0 then wait
lvlPASSIVE4 = lvlPASSIVE4 + 1
lvlPASSIVE4$ = str$(lvlPASSIVE4)
pm = pm + int((3+(2*LvlDONJON))*1)
pmTOTAL = pmTOTAL + int((3+(2*LvlDONJON))*1)
PoS = PoS - 1
gosub [reZIZ]
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 80 375 ;\"; "Points de Science : "; pm; "   "
print #main.map, "backcolor black; color white"
print #main.map, "font Times New Roman 9"
if version = 1 then print #main.map, "place 545 110 ;\"; "Points de compétences disponibles :  "; PoS;"        "
if version = 2 then print #main.map, "place 545 110 ;\"; "Points of skills available :  "; PoS;"        "
print #main.map, "font Times New Roman 8;backcolor white"
print #main.map, "color black"
print #main.map, "place 580 264 ;\"; "+ 5 Science (x";lvlPASSIVE4;")"
wait
[passive5]
r = 215: v =215 : b = 215
print #main.map, "backcolor ";r;" ";v;" ";b
if PoS <= 0 then wait
lvlPASSIVE5 = lvlPASSIVE5 + 1
lvlPASSIVE5$ = str$(lvlPASSIVE5)
BONUSxp = BONUSxp + int((49+(6*LvlDONJON))*1)
PoS = PoS - 1
gosub [reZIZ]
print #main.map, "font Times New Roman 10; color black"
if version = 2 then print #main.map, "place 80 400 ;\"; "Armor : "; def; " + "; BONUSdef;"        "
if version = 1 then print #main.map, "place 80 400 ;\"; "Armure : "; def; " + "; BONUSdef;"        "
if version = 1 then print #main.map, "place 80 360 ;\"; "Points de vie : "; pv; " / ";pvTOTAL
if version = 2 then print #main.map, "place 80 360 ;\"; "Points of Life : "; pv; " / ";pvTOTAL
print #main.map, "backcolor black; color white"
print #main.map, "font Times New Roman 9"
if version = 1 then print #main.map, "place 545 110 ;\"; "Points de compétences disponibles :  "; PoS;"        "
if version = 2 then print #main.map, "place 545 110 ;\"; "Points of skills available :  "; PoS;"        "
print #main.map, "font Times New Roman 8;backcolor white"
print #main.map, "color black"
print #main.map, "place 580 306 ;\"; "+ ";int(49+(6*LvlDONJON));" Xp (x";lvlPASSIVE5;")"
wait
[passive6]
r = 215: v =215 : b = 215
print #main.map, "backcolor ";r;" ";v;" ";b
if PoS <= 0 then wait
lvlPASSIVE6 = lvlPASSIVE6 + 1
lvlPASSIVE6$ = str$(lvlPASSIVE6)
BONUSgold = BONUSgold + int(25*1)
PoS = PoS - 1

print #main.map, "font Times New Roman 10; color black"
if version = 1 then print #main.map, "place 80 415 ;\"; "Points d'attaque : "; atk ; " + ";BONUSatk;"   "
if version = 2 then print #main.map, "place 80 415 ;\"; "Points of Damages : "; atk ; " + ";BONUSatk;"   "
if version = 1 then print #main.map, "place 80 400 ;\"; "Armure : "; def; " + "; BONUSdef;"        "
if version = 2 then print #main.map, "place 80 400 ;\"; "Armor : "; def; " + "; BONUSdef;"        "
print #main.map, "backcolor black; color white"
print #main.map, "font Times New Roman 9"
if version = 1 then print #main.map, "place 545 110 ;\"; "Points de compétences disponibles :  "; PoS;"         "
if version = 2 then print #main.map, "place 545 110 ;\"; "Points of skills available :  "; PoS;"        "
print #main.map, "font Times New Roman 8;backcolor white"
print #main.map, "color black"
print #main.map, "place 580 348 ;\"; "+ 25 or (x";lvlPASSIVE6;")"
wait

[Character]
close #main
lvlPASSIVE1$ = str$(lvlPASSIVE1)
lvlPASSIVE2$ = str$(lvlPASSIVE2)
lvlPASSIVE3$ = str$(lvlPASSIVE3)
lvlPASSIVE4$ = str$(lvlPASSIVE4)
lvlPASSIVE5$ = str$(lvlPASSIVE5)
lvlPASSIVE6$ = str$(lvlPASSIVE6)

WindowWidth = 800 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight

button #main.back, "+", [PoPagi],UL 210,427,15,15
button #main.back, "+", [PoPstr],UL 210,442,15,15
button #main.back, "+", [PoPint],UL 210,457,15,15

'passive
bmpbutton #main.p1, "data\add.bmp" , [passive1],UL 555,130
bmpbutton #main.p2, "data\add.bmp" , [passive2],UL 555,170
bmpbutton #main.p3, "data\add.bmp" , [passive3],UL 555,211
bmpbutton #main.p4, "data\add.bmp" , [passive4],UL 555,252
bmpbutton #main.p5, "data\add.bmp" , [passive5],UL 555,293
bmpbutton #main.p6, "data\add.bmp" , [passive6],UL 555,336

open "Sword Art Online : Ascension [Build ";Version$;"]" for window_nf as #main
#main, "trapclose [quit]"
#main.map , "backcolor white"
#main.map, "when leftButtonDown [SimpleClickINVENTAIRE]"
#main.map , "down"

print #main.map, "drawbmp mainINV 0 0"
print #main.map, "drawbmp back 580 450"
print #main.map, "background mainINV"
print #main.map, "drawbmp select 340 225"

if sexe = 1 then
    if campagne$= "Warrior" then print #main.map, "drawbmp miniGUERRIERhomme 120 122"
    if campagne$= "Tank" then print #main.map, "drawbmp miniTANKhomme 116 122"
    if campagne$= "Archer" then print #main.map, "drawbmp miniARCHERhomme 125 110"
    if campagne$= "Artisan" then print #main.map, "drawbmp miniARTISANhomme 122 122"
    if campagne$= "HEALER" then print #main.map, "drawbmp miniSOIGNEURhomme 118 122"
end if
if sexe = 2 then
    if campagne$= "Warrior" then print #main.map, "drawbmp miniGUERRIERfemme 132 122"
    if campagne$= "Tank" then print #main.map, "drawbmp miniTANKfemme 132 122"
    if campagne$= "Archer" then print #main.map, "drawbmp miniARCHERfemme 132 122"
    if campagne$= "Artisan" then print #main.map, "drawbmp miniARTISANfemme 132 122"
    if campagne$= "HEALER" then print #main.map, "drawbmp miniSOIGNEURfemme 132 122"
end if

gosub [reZIZ]
print #main.map, "font Times New Roman 10; color black"
r = 100 : v =100 : b = 100
print #main.map, "backcolor ";r;" ";v;" ";b
if version = 1 then
    print #main.map, "place 430 200 ;\"; "OBJETS"
    print #main.map, "place 430 242 ;\"; "COMPETENCES"
    print #main.map, "place 430 285 ;\"; "EQUIPEMENT"
    r = 215: v =215 : b = 215
    print #main.map, "backcolor ";r;" ";v;" ";b
    print #main.map, "place 80 320 ;\"; "Niveau : ";lvl
    print #main.map, "backcolor ";r;" ";v;" ";b ;"; color black"
    print #main.map, "place 80 340 ;\"; "Xp : "; xp$; " / "; xpTOTAL$
    print #main.map, "place 80 360 ;\";"Points de vie : ";pv$; " / "; pvTOTAL$;"    "
    print #main.map, "place 80 375 ;\"; "Points de Science : "; pm
    print #main.map, "place 80 400 ;\"; "Armure : "; def$; " + "; BONUSdef$
    print #main.map, "place 80 415 ;\"; "Points d'attaque : "; atk$ ; " + ";BONUSatk$
    print #main.map, "place 80 440 ;\"; "Agilité : "
    print #main.map, "place 80 455 ;\"; "Force : "
    print #main.map, "place 80 470 ;\"; "Intelligence : "
    print #main.map, "font Times New Roman 9; color black"
    print #main.map, "place 80 495 ;\"; "Points de caractéristique :  ";PoP
    print #main.map, "place 150 440 ;\"; Agility
    print #main.map, "place 150 455 ;\"; Strength
    print #main.map, "place 150 470 ;\"; intelligence
    print #main.map, "backcolor black; color white"
    print #main.map, "place 545 110 ;\"; "Points de compétences disponibles :  "; PoS
    print #main.map, "backcolor white;font Times New Roman 10; color black"
end if
if version = 2 then
    print #main.map, "place 430 200 ;\"; "ITEMS"
    print #main.map, "place 430 242 ;\"; "SKILLS"
    print #main.map, "place 430 285 ;\"; "EQUIPMENT"
    r = 215: v =215 : b = 215
    print #main.map, "backcolor ";r;" ";v;" ";b
    print #main.map, "place 80 320 ;\"; "Level : ";lvl
    r = 136 : b = 136 : v = 136
    print #main.map, "backcolor ";r;" ";v;" ";b ;"; color white"
    print #main.map, "backcolor ";r;" ";v;" ";b ;"; color black"
    print #main.map, "place 80 340 ;\"; "Xp : "; xp$; " / "; xpTOTAL$
    print #main.map, "place 80 360 ;\";"Points of life : ";pv$; " / "; pvTOTAL$;"    "
    print #main.map, "place 80 375 ;\"; "Points of Science : "; pm
    print #main.map, "place 80 400 ;\"; "Armor : "; def$; " + "; BONUSdef$
    print #main.map, "place 80 415 ;\"; "Points of Damages : "; atk$ ; " + ";BONUSatk$
    print #main.map, "place 80 440 ;\"; "Agility : "
    print #main.map, "place 80 455 ;\"; "Strength : "
    print #main.map, "place 80 470 ;\"; "Intelligence : "
    print #main.map, "font Times New Roman 9; color black"
    print #main.map, "place 80 495 ;\"; "Points of capacities  :  "; PoP
    print #main.map, "place 150 440 ;\"; Agility
    print #main.map, "place 150 455 ;\"; Strength
    print #main.map, "place 150 470 ;\"; intelligence
    print #main.map, "backcolor black; color white"
    print #main.map, "place 545 110 ;\"; "Points of skills available :  "; PoS
    print #main.map, "backcolor white;font Times New Roman 10; color black"
end if

r = 240 : v =166 : b = 2
print #main.map, "size 1 ; color white;backcolor ";r;" ";v;" ";b
if version = 1 then print #main.map, "place 597 495 ;\"; "RETOUR"
if version = 2 then print #main.map, "place 603 495 ;\"; "BACK"
print #main.map, "backcolor white;color black;font Times New Roman 10"
if capacity$ = "Strength" and version = 1 then capacity$ = "Force"
if capacity$ = "Force" and version = 2 then capacity$ = "Strength"
if capacity$ = "Agility" and version = 1 then capacity$ = "Agilité"
if capacity$ = "Agilité" and version = 2 then capacity$ = "Agility"

print #main.map, "place 80 80 ;\"; name$;" : "; RACE$ ; " [ ";capacity$;" ]"
#main.p1, "hide"
#main.p2, "hide"
#main.p3, "hide"
#main.p4, "hide"
#main.p5, "hide"
#main.p6, "hide"
goto [invINI]

[SimpleClickINVENTAIRE]
    mX = MouseX
    mY = MouseY
    CLICKinv = 4
    print #main.map, "size 22 ; color black"
    print #main.map, "line "; 350; " "; 100; " "; 350; " "; 300
    if mX>400 and mX<520 and mY>175 and mY<215 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        CLICKinv = 1
        print #main.map, "drawbmp select 340 183"
    end if
    if mX>400 and mX<520 and mY>215 and mY<255 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        CLICKinv = 2
        print #main.map, "drawbmp select 340 225"
    end if
    if mX>400 and mX<520 and mY>260 and mY<300 then
        if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
        CLICKinv = 3
        print #main.map, "drawbmp select 340 267"
    end if
    if mX>580 and mX<660 and mY>445 and mY<525 then
        SECUmusic = 0
        goto [GameStartMAINsecu2]
    end if

    goto [invINI2]
    [invINI]
    CLICKinv = 2
    [invINI2]

    'if mX<580 and mX>700 and mY>130 and mY<350 then
    #main.p1, "hide"
    #main.p2, "hide"
    #main.p3, "hide"
    #main.p4, "hide"
    #main.p5, "hide"
    #main.p6, "hide"
    print #main.map, "backcolor white"
    print #main.map, "font Times New Roman 22; color white"
    print #main.map, "place 548 147 ;\"; "                               "
    print #main.map, "place 548 190 ;\"; "                               "
    print #main.map, "place 548 231 ;\"; "                               "
    print #main.map, "place 548 272 ;\"; "                               "
    print #main.map, "place 548 314 ;\"; "                               "
    print #main.map, "place 548 356 ;\"; "                               "
    'end if

    print #main.map, "font Times New Roman 11; color black"
    print #main.map, "backcolor white"

    if version = 1 and CLICKinv = 1 then
    if PotionLittleHP>0 then
        print #main.map, "drawbmp p1 555 126"
        print #main.map, "place 580 143 ;\"; "Petite : ";PotionLittleHP
    end if
    if PotionLittleHP=0 and version = 1 then print #main.map, "place 590 143 ;\"; "- Vide -                                "
    if PotionMediumHP>0 then
        print #main.map, "drawbmp p2 555 168"
        print #main.map, "place 580 185 ;\"; "Moyenne : ";PotionMediumHP
    end if
    if PotionMediumHP =0 and version = 1 then print #main.map, "place 590 184 ;\"; "- Vide -                               "
    if PotionBigHP>0 then
        print #main.map, "drawbmp p3 555 210"
        print #main.map, "place 580 227 ;\"; "Grande : ";PotionBigHP
    end if
    if PotionBigHP=0 and version = 1 then print #main.map, "place 590 227 ;\"; "- Vide -                               "
    if PotionBig2HP>0 then
        print #main.map, "drawbmp p4 555 252"
        print #main.map, "place 580 270 ;\"; "Géante : ";PotionBig2HP
    end if
    if PotionBig2HP=0 and version = 1 then print #main.map, "place 590 270 ;\"; "- Vide -                               "
    if PotionBig3HP>0 then
        print #main.map, "drawbmp p5 555 294"
        print #main.map, "place 580 313 ;\"; "Max : ";PotionBig3HP
    end if
    if PotionBig3HP=0 and version = 1 then print #main.map, "place 590 313 ;\"; "- Vide -                             "

    end if

    if version = 2 and CLICKinv = 1 then
    if PotionLittleHP>0 then
        print #main.map, "drawbmp p1 555 126"
        print #main.map, "place 580 143 ;\"; "Little : ";PotionLittleHP
    end if
    if PotionLittleHP=0 and version = 2 then print #main.map, "place 590 143 ;\"; "- Empty -                                 "
    if PotionMediumHP>0 then
        print #main.map, "drawbmp p2 555 168"
        print #main.map, "place 580 185 ;\"; "Medium : ";PotionMediumHP
    end if
    if PotionMediumHP =0 and version = 2 then print #main.map, "place 590 184 ;\"; "- Empty -                                 "
    if PotionBigHP>0 then
        print #main.map, "drawbmp p3 555 210"
        print #main.map, "place 580 227 ;\"; "Large : ";PotionBigHP
    end if
    if PotionBigHP=0 and version = 2 then print #main.map, "place 590 227 ;\"; "- Empty -                                 "
    if PotionBig2HP>0 then
        print #main.map, "drawbmp p4 555 252"
        print #main.map, "place 580 270 ;\"; "Giante : ";PotionBig2HP
    end if
    if PotionBig2HP=0 and version = 1 then print #main.map, "place 590 270 ;\"; "- Empty -                                 "
    if PotionBig3HP>0 then
        print #main.map, "drawbmp p5 555 294"
        print #main.map, "place 580 313 ;\"; "Max : ";PotionBig3HP
    end if
    if PotionBig3HP=0 and version = 1 then print #main.map, "place 590 313 ;\"; "- Empty -                                 "

    end if

    print #main.map, "font Times New Roman 11; color black"
    if TYPEatkEQUIP$ = "" and version = 1 and CLICKinv = 3 then print #main.map, "place 590 143 ;\"; "- Vide -"
    if TYPEatkEQUIP$ = "" and version = 2 and CLICKinv = 3 then print #main.map, "place 590 143 ;\"; "- Empty -"
    if TYPEdefEQUIP$ = "" and version = 1 and CLICKinv = 3 then print #main.map, "place 590 184 ;\"; "- Vide -"
    if TYPEdefEQUIP$ = "" and version = 2 and CLICKinv = 3 then print #main.map, "place 590 184 ;\"; "- Empty -"

    print #main.map, "font Times New Roman 9; color black"
    if TYPEdefEQUIP$ <> "" and CLICKinv = 3 then print #main.map, "place 560 176 ;\"; TYPEdefEQUIP$; " [ ";lvlITEM2;" ]"
    if version = 1 and TYPEdefEQUIP$ <> "" and CLICKinv = 3 then print #main.map, "place 550 191 ;\"; " + ";BONUSdef;" D'armure "
    if version = 2 and TYPEdefEQUIP$ <> "" and CLICKinv = 3 then print #main.map, "place 550 191 ;\"; " + ";BONUSdef;" Armor "
    if TYPEatkEQUIP$ <> "" and CLICKinv = 3 then print #main.map, "place 560 135 ;\"; TYPEatkEQUIP$; " [ ";lvlITEM1;" ]"
    if version = 1 and TYPEatkEQUIP$ <> "" and CLICKinv = 3 then print #main.map, "place 550 150 ;\"; " + ";BONUSatk;" de dégâts"
    if version = 2 and TYPEatkEQUIP$ <> "" and CLICKinv = 3 then print #main.map, "place 550 150 ;\"; " + ";BONUSatk;" Damages"



    print #main.map, "font Times New Roman 8; color black"
    print #main.map, "backcolor white"
    if CLICKinv = 2 then
    #main.p1, "show"
    #main.p2, "show"
    #main.p3, "show"
    #main.p4, "show"
    #main.p5, "show"
    #main.p6, "show"
    'passiv set 1
    print #main.map, "place 580 140 ;\"; "+ ";int(11+(4*LvlDONJON));" Pv (x";lvlPASSIVE1;")"
    print #main.map, "place 580 181 ;\"; "+ ";int(5+(1*LvlDONJON));" Atk (x";lvlPASSIVE2;")"
    'passiv set 2
    print #main.map, "place 580 222 ;\"; "+ ";int(5+(1*LvlDONJON));" Def (x";lvlPASSIVE3;")"
    print #main.map, "place 580 264 ;\"; "+ ";int(3+(2*LvlDONJON));" Science (x";lvlPASSIVE4;")"
    'passiv set 3
    print #main.map, "place 580 306 ;\"; "+ ";int(49+(6*LvlDONJON));" Xp (x";lvlPASSIVE5;")"
    print #main.map, "place 580 348 ;\"; "+ 25 Or (x";lvlPASSIVE6;")"
    end if

print #main.map, "flush"
wait


[PoPint]
r = 215: v =215 : b = 215
print #main.map, "backcolor ";r;" ";v;" ";b
if PoP >0 then
    intelligence = intelligence + (1*1)
    pm = int(pm +(2*1))
    pmTOTAL = int(pmTOTAL+(2*1))
    if capacity$ = "Intelligence" then
        print #main.map, "font Times New Roman 10; color black"
        atk = atk + (2*1)
        if version = 1 then print #main.map, "place 80 415 ;\"; "Points d'attaque : "; atk ; " + ";BONUSatk
        if version = 2 then print #main.map, "place 80 415 ;\"; "Points of Damages : "; atk ; " + ";BONUSatk
    end if
    PoP = PoP - 1
    if version = 1 then
        print #main.map, "place 80 470 ;\"; "Intelligence : "
        print #main.map, "place 150 470 ;\"; intelligence
        print #main.map, "place 80 375 ;\"; "Points de Science : "; pm;"   "
        print #main.map, "font Times New Roman 9; color black"
        print #main.map, "place 80 495 ;\"; "Points de caractéristique :  "; PoP;"  "
    end if
    if version = 2 then
        print #main.map, "place 80 470 ;\"; "Intelligence : "
        print #main.map, "place 150 470 ;\"; intelligence
        print #main.map, "place 80 375 ;\"; "Points of Science : "; pm;"   "
        print #main.map, "font Times New Roman 9; color black"
        print #main.map, "place 80 495 ;\"; "Points of capacities :  "; PoP;"   "
    end if

end if
wait
[PoPstr]
r = 215: v =215 : b = 215
print #main.map, "backcolor ";r;" ";v;" ";b
if PoP >0 then
    Strength = Strength + 1
    pv = int(pv+(3*1))
    pvTOTAL = int(pvTOTAL+(3*1))
    if capacity$ = "Strength" or capacity$ = "Force" then
        print #main.map, "font Times New Roman 10; color black"
        atk = atk + (2*1)
        if version = 1 then print #main.map, "place 80 415 ;\"; "Points d'attaque : "; atk ; " + ";BONUSatk
        if version = 2 then print #main.map, "place 80 415 ;\"; "Points of Damages : "; atk ; " + ";BONUSatk
    end if
    PoP = PoP - 1
    if version = 1 then
    print #main.map, "place 80 455 ;\"; "Force : "
    print #main.map, "place 150 455 ;\"; Strength
    print #main.map, "place 80 415 ;\"; "Points d'attaque : "; atk ; " + ";BONUSatk;"   "
   ' print #main.map, "place 80 360 ;\"; "Points de vie : "; pv; " / ";pvTOTAL
    print #main.map, "font Times New Roman 9; color black"
    print #main.map, "place 80 495 ;\"; "Points de caractéristique :  "; PoP;"   "
    end if
    if version = 2 then
    print #main.map, "place 80 455 ;\"; "Strength : "
    print #main.map, "place 150 455 ;\"; Strength
    print #main.map, "place 80 415 ;\"; "Points of Damages : "; atk ; " + ";BONUSatk;"   "
   ' print #main.map, "place 80 360 ;\"; "Points of Life : "; pv; " / ";pvTOTAL
    print #main.map, "font Times New Roman 9; color black"
    print #main.map, "place 80 495 ;\"; "Points of capacities :  "; PoP;"   "
    end if
    print #main.map, "font Times New Roman 10; color black"
    if pv > 99999 then pv$ = "";str$(int(pv/1000));" k"
    if pv > 99999999 then pv$ = "";str$(int(pv/1000000));" m"
    if pv > 99999999999 then pv$ = "";str$(int(pv/1000000000));" M"
    if pv > 99999999999999 then pv$ = "";str$(int(pv/1000000000999));" kM"
    if pv < 99999 then pv$ = "";str$(pv)
    if pvTOTAL > 99999 then pvTOTAL$ = "";str$(int(pvTOTAL/1000));" k"
    if pvTOTAL > 99999999 then pvTOTAL$ = "";str$(int(pvTOTAL/1000000));" m"
    if pvTOTAL > 99999999999 then pvTOTAL$ = "";str$(int(pvTOTAL/1000000000));" M"
    if pvTOTAL > 99999999999999 then pvTOTAL$ = "";str$(int(pvTOTAL/1000000000000));" kM"
    if pvTOTAL < 99999 then pvTOTAL$ = "";str$(pvTOTAL)
    if version = 1 then print #main.map, "place 80 360 ;\"; "Points de vie : "; pv$; " / ";pvTOTAL$
    if version = 2 then print #main.map, "place 80 360 ;\"; "Points of Life : "; pv$; " / ";pvTOTAL$
end if
wait
[PoPagi]
r = 215: v =215 : b = 215
print #main.map, "backcolor ";r;" ";v;" ";b
if PoP >0 then
    Agility = Agility + 1
    def = def+ (1*1)
    if capacity$ = "Agility" or capacity$ = "Agilité" then
        print #main.map, "font Times New Roman 10; color black"
        atk = atk + (2*1)
        if version = 1 then print #main.map, "place 80 415 ;\"; "Points d'attaque : "; atk ; " + ";BONUSatk
        if version = 2 then print #main.map, "place 80 415 ;\"; "Points of Damages : "; atk ; " + ";BONUSatk
    end if
    PoP = PoP - 1
    if version = 1 then
    print #main.map, "place 80 440 ;\"; "Agilité : "
    print #main.map, "place 150 440 ;\"; Agility
    print #main.map, "place 80 400 ;\"; "Armure : "; def ;" + ";BONUSdef;"    "
    print #main.map, "font Times New Roman 9; color black"
    print #main.map, "place 80 495 ;\"; "Points de caractéristique :  "; PoP;"   "
    end if
    if version = 2 then
    print #main.map, "place 80 440 ;\"; "Agility :                      "
    print #main.map, "place 150 440 ;\"; Agility
    print #main.map, "place 80 400 ;\"; "Armor : "; def ;" + ";BONUSdef;"    "
    print #main.map, "font Times New Roman 9; color black"
    print #main.map, "place 80 495 ;\"; "Points of capacities :  "; PoP;"   "
    end if
end if
wait

[Armory]
armoryMarchand = 1
close #main
WindowWidth = 800 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)

graphicbox #main.map, 0, 0, WindowWidth, WindowHeight
open "Sword Art Online : Ascension [Build ";Version$;"] " for window_nf as #main
#main, "trapclose [quit]"
#main.map , "backcolor white"
#main.map , "down"
#main.map, "when leftButtonDown [SimpleClickG4]"
print #main.map, "drawbmp mapMARCHAND2 -03 -05"
print #main.map, "background mapMARCHAND2"
print #main.map, "font Times New Roman 11; color black"

if secu1PALLIER = 0 then gosub [dataDEF]
secu1PALLIER = 1

print #main, "font Times New Roman 11"
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"

if version = 1 then
    if TYPEdefEQUIP$ <> "" then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEdefEQUIP$ ;" avec ";BONUSdef;" d'armure\Niveau d'amélioration : ";lvlITEM2;"\\Argent  : ";money; " d'or"
    if TYPEdefEQUIP$ = "" then #main.map, "place 250 40 ;\"; "Equipement : vide ";"\\\Argent  : ";money;" d'or"
    r = 100 : b = 100 : v = 100
    print #main.map, "backcolor ";r;" ";v;" ";b
    #main.map, "place 70 46 ;\"; "VENDEUSE"
    #main.map, "place 70 62 ;\"; "D'ARMURES"
    txtWeapon$ = "Armure"
    levelTXT$ = "Niveau "
    prixTXT$ = " Prix : "
    goldTXT$ = " d'or "
    achatTXT$ = "Acheter"
end if

if version = 2 then
    if TYPEdefEQUIP$ <> "" then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEdefEQUIP$ ;" with ";BONUSdef;" armor\Upgrade level : ";lvlITEM2;"\\Money  : ";money;" gold"
    if TYPEdefEQUIP$ <> "" then #main.map, "place 250 40 ;\"; "Stuff : "; "\\\Money  : ";money;" gold"
    r = 100 : b = 100 : v = 100
    print #main.map, "backcolor ";r;" ";v;" ";b
    #main.map, "place 70 46 ;\"; "ARMORS"
    #main.map, "place 70 62 ;\"; "SELLER"
    txtWeapon$ = "Armor"
    levelTXT$ = "Level "
    prixTXT$ = " Price : "
    goldTXT$ = " gold "
    achatTXT$ = "Buy it"
end if


print #main.map, "font Times New Roman 9;color black"
print #main.map, "backcolor white"
'items atk 1
#main.map, "place 250 140 ;\"; nameDEF1$;" - ";levelTXT$;lvlDEF1
#main.map, "place 250 155 ;\"; txtWeapon$;" : ";defDEF1;"       |      ";prixTXT$; int(defDEF1*lvlDEF1)*2;" ";goldTXT$
#main.map, "place 645 146 ;\"; achatTXT$
'items atk 2
#main.map, "place 250 190 ;\"; nameDEF2$;" - ";levelTXT$;lvlDEF2
#main.map, "place 250 205 ;\"; txtWeapon$;" : ";defDEF2;"       |      ";prixTXT$; int(defDEF2*lvlDEF2)*2;" ";goldTXT$
'items atk 3
#main.map, "place 250 242 ;\"; nameDEF3$;" - ";levelTXT$;lvlDEF3
#main.map, "place 250 257 ;\"; txtWeapon$;" : ";defDEF3;"       |      ";prixTXT$; int(defDEF3*lvlDEF3)*2;" ";goldTXT$
'items atk 4
#main.map, "place 250 292 ;\"; nameDEF4$;" - ";levelTXT$;lvlDEF4
#main.map, "place 250 307 ;\"; txtWeapon$;" : ";defDEF4;"       |      ";prixTXT$; int(defDEF4*lvlDEF4)*2;" ";goldTXT$
'items atk 1bis
#main.map, "place 250 342 ;\"; nameDEF5$;" - ";levelTXT$;lvlDEF5
#main.map, "place 250 357 ;\"; txtWeapon$;" : ";defDEF5;"       |      ";prixTXT$; int(defDEF5*lvlDEF5)*2;" ";goldTXT$
'items atk 2bis
#main.map, "place 250 394 ;\"; nameDEF6$;" - ";levelTXT$;lvlDEF6
#main.map, "place 250 409 ;\"; txtWeapon$;" : ";defDEF6;"       |      ";prixTXT$; int(defDEF6*lvlDEF6)*2;" ";goldTXT$
'items atk 3bis
#main.map, "place 250 444 ;\"; nameDEF7$;" - ";levelTXT$;lvlDEF7
#main.map, "place 250 459 ;\"; txtWeapon$;" : ";defDEF7;"       |      ";prixTXT$; int(defDEF7*lvlDEF7)*2;" ";goldTXT$
'items atk 4bis
#main.map, "place 250 494 ;\"; nameDEF8$;" - ";levelTXT$;lvlDEF8
#main.map, "place 250 509 ;\"; txtWeapon$;" : ";defDEF8;"       |      ";prixTXT$; int(defDEF8*lvlDEF8)*2;" ";goldTXT$


print #main.map, "font Times New Roman 9;color white"
print #main.map, "backcolor black"
#main.map, "place 645 146 ;\"; achatTXT$
#main.map, "place 645 196 ;\"; achatTXT$
#main.map, "place 645 248 ;\"; achatTXT$
#main.map, "place 645 300 ;\"; achatTXT$
#main.map, "place 645 352 ;\"; achatTXT$
#main.map, "place 645 402 ;\"; achatTXT$
#main.map, "place 645 452 ;\"; achatTXT$
#main.map, "place 645 504 ;\"; achatTXT$
print #main.map, "flush"
wait

[SimpleClickG4]
    mX = MouseX
    mY = MouseY
    SECUmusic = 0
    if mX>615 and mX<710 and mY>125 and mY<160 then
        if weaponMarchand = 1 then goto [achatATKmelee1]
        if armoryMarchand = 1 then goto [achatDEF1]
    end if
    if mX>615 and mX<710 and mY>175 and mY<210 then
        if weaponMarchand = 1 then goto [achatATKmelee2]
        if armoryMarchand = 1 then goto [achatDEF2]
    end if
    if mX>615 and mX<710 and mY>225 and mY<260 then
        if weaponMarchand = 1 then goto [achatATKmelee3]
        if armoryMarchand = 1 then goto [achatDEF3]
    end if
    if mX>615 and mX<710 and mY>275 and mY<310 then
        if weaponMarchand = 1 then goto [achatATKmelee4]
        if armoryMarchand = 1 then goto [achatDEF4]
    end if
    if mX>615 and mX<710 and mY>330 and mY<365 then
        if weaponMarchand = 1 then goto [achatATKdistance1]
        if armoryMarchand = 1 then goto [achatDEF5]
    end if
    if mX>615 and mX<710 and mY>380 and mY<410 then
        if weaponMarchand = 1 then goto [achatATKdistance2]
        if armoryMarchand = 1 then goto [achatDEF6]
    end if
    if mX>615 and mX<710 and mY>430 and mY<465 then
        if weaponMarchand = 1 then goto [achatATKdistance3]
        if armoryMarchand = 1 then goto [achatDEF7]
    end if
    if mX>615 and mX<710 and mY>480 and mY<515 then
        if weaponMarchand = 1 then goto [achatATKdistance4]
        if armoryMarchand = 1 then goto [achatDEF8]
    end if
    if mX>80 and mX<150 and mY>450 and mY<520 then
        weaponMarchand = 0
        armoryMarchand = 0
        if ACHAT = 1 then SECUmusic = 1
        ACHAT = 0
        goto [GameStartMAINsecu2]
    end if
wait


[Weapon]
weaponMarchand = 1
close #main
WindowWidth = 800 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight

open "Sword Art Online : Ascension [Build ";Version$;"] " for window_nf as #main
#main, "trapclose [quit]"
#main.map , "backcolor white"
#main.map , "down"
#main.map, "when leftButtonDown [SimpleClickG4]"
print #main.map, "drawbmp mapMARCHAND 0 0"
print #main.map, "background mapMARCHAND"
print #main.map, "font Times New Roman 11; color black"

if secu2PALLIER = 0 then gosub [dataATKmelee]
if secu2PALLIER = 0 then gosub [dataATKdistance]
secu2PALLIER = 1

print #main, "font Times New Roman 11"
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black" ' ";r;" ";v;" ";b

if version = 1 then
    if TYPEatkEQUIP$ <> "" then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEatkEQUIP$ ;" avec ";BONUSatk;" d'attaque\Niveau d'amélioration : ";lvlITEM1;"\\Argent  : ";money;" d'or"
    r = 100 : b = 100 : v = 100
    if TYPEatkEQUIP$ = "" then #main.map, "place 250 40 ;\"; "Equipement : vide ";"\\\Argent  : ";money;" d'or"
    r = 100 : b = 100 : v = 100
    print #main.map, "backcolor ";r;" ";v;" ";b
    #main.map, "place 50 60 ;\"; "VENDEUSE D'ARMES"
    txtWeapon$ = "Dégâts"
    levelTXT$ = "Niveau "
    prixTXT$ = " Prix : "
    goldTXT$ = " d'or "
    achatTXT$ = "Acheter"
end if

if version = 2 then
    if TYPEatkEQUIP$ <> "" then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEatkEQUIP$ ;" with ";BONUSatk;" atack\Upgrade level : ";lvlITEM1;"\\money  : ";money;" gold"
    if TYPEatkEQUIP$ = "" then #main.map, "place 250 40 ;\"; "Stuff : emply"; "\\\money  : ";money;" gold"
    r = 100 : b = 100 : v = 100
    print #main.map, "backcolor ";r;" ";v;" ";b
    #main.map, "place 48 60 ;\"; "WEAPON SELLER"
    txtWeapon$ = "Damages"
    levelTXT$ = "Level "
    prixTXT$ = " Price : "
    goldTXT$ = " gold "
    achatTXT$ = "Buy it"
end if

print #main.map, "font Times New Roman 9;color black"
print #main.map, "backcolor white"
'items atk1
#main.map, "place 250 140 ;\"; nameATKmelee1$;" - ";levelTXT$;lvlATKmelee1
#main.map, "place 250 155 ;\"; txtWeapon$;" : ";atkATKmelee1;"       |      ";prixTXT$; int(atkATKmelee1*lvlATKmelee1)*2;" ";goldTXT$
'items atk 2
#main.map, "place 250 190 ;\"; nameATKmelee2$;" - ";levelTXT$;lvlATKmelee2
#main.map, "place 250 205 ;\"; txtWeapon$;" : ";atkATKmelee2;"       |      ";prixTXT$; int(atkATKmelee2*lvlATKmelee2)*2;" ";goldTXT$
'items atk 3
#main.map, "place 250 242 ;\"; nameATKmelee3$;" - ";levelTXT$;lvlATKmelee3
#main.map, "place 250 257 ;\"; txtWeapon$;" : ";atkATKmelee3;"       |      ";prixTXT$; int(atkATKmelee3*lvlATKmelee3)*2;" ";goldTXT$
'items atk 4
#main.map, "place 250 292 ;\"; nameATKmelee4$;" - ";levelTXT$;lvlATKmelee4
#main.map, "place 250 307 ;\"; txtWeapon$;" : ";atkATKmelee4;"       |      ";prixTXT$; int(atkATKmelee4*lvlATKmelee4)*2;" ";goldTXT$
'items atk 1bis
#main.map, "place 250 342 ;\"; nameATKdistance1$;" - ";levelTXT$;lvlATKdistance1
#main.map, "place 250 357 ;\"; txtWeapon$;" : ";atkATKdistance1;"       |      ";prixTXT$; int(atkATKdistance1*lvlATKdistance1)*2;" ";goldTXT$
'items atk 2bis
#main.map, "place 250 394 ;\"; nameATKdistance2$;" - ";levelTXT$;lvlATKdistance2
#main.map, "place 250 409 ;\"; txtWeapon$;" : ";atkATKdistance2;"       |      ";prixTXT$; int(atkATKdistance2*lvlATKdistance2)*2;" ";goldTXT$
'items atk 3bis
#main.map, "place 250 444 ;\"; nameATKdistance3$;" - ";levelTXT$;lvlATKdistance3
#main.map, "place 250 459 ;\"; txtWeapon$;" : ";atkATKdistance3;"       |      ";prixTXT$; int(atkATKdistance3*lvlATKdistance3)*2;" ";goldTXT$
'items atk 4bis
#main.map, "place 250 494 ;\"; nameATKdistance4$;" - ";levelTXT$;lvlATKdistance4
#main.map, "place 250 509 ;\"; txtWeapon$;" : ";atkATKdistance4;"       |      ";prixTXT$; int(atkATKdistance4*lvlATKdistance4)*2;" ";goldTXT$


print #main.map, "font Times New Roman 9;color white"
print #main.map, "backcolor black"
#main.map, "place 645 146 ;\"; achatTXT$
#main.map, "place 645 196 ;\"; achatTXT$
#main.map, "place 645 248 ;\"; achatTXT$
#main.map, "place 645 300 ;\"; achatTXT$
#main.map, "place 645 352 ;\"; achatTXT$
#main.map, "place 645 402 ;\"; achatTXT$
#main.map, "place 645 452 ;\"; achatTXT$
#main.map, "place 645 504 ;\"; achatTXT$
print #main.map, "flush"
wait

' olala
[forgeron]
close #main
WindowWidth = 800 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)

graphicbox #main.map, 0, 0, WindowWidth, WindowHeight

if version =  1 then txtButtonAchat$ = "AMELIORER" : txtButtonAchat2$ = "AMELIORER MAX"
if version = 2 then txtButtonAchat$ = "UPGRADE" : txtButtonAchat2$ = "UPGRADE MAX"

if TYPEatkEQUIP$ <> "" then button #main.def1, txtButtonAchat$, [ameliorationARME],UL 500,80,80,25
if TYPEdefEQUIP$ <> "" then button #main.def2, txtButtonAchat$, [ameliorationARMURE],UL 500,255,80,25

if TYPEatkEQUIP$ <> "" then button #main.def1, txtButtonAchat2$, [ameliorationARMEmax],UL 600,80,140,25
if TYPEdefEQUIP$ <> "" then button #main.def2, txtButtonAchat2$, [ameliorationARMUREmax],UL 600,255,140,25

open "Sword Art Online : Ascension [Build ";Version$;"] " for window_nf as #main
#main, "trapclose [quit]"
#main.map , "backcolor white"
#main.map , "down"
print #main.map, "drawbmp mapFORGERON 0 0"
print #main.map, "background mapFORGERON"
#main.map, "when leftButtonDown [SimpleClickG4]"
print #main.map, "font Times New Roman 10"
print #main.map, "color black"
if TYPEdefEQUIP$ <> "" then print #main.map, "place 230 240 ;\"; "Equipement : ";TYPEdefEQUIP$
if TYPEdefEQUIP$ <> "" and version = 1 then print #main.map, "place 230 260 ;\"; "Avant amélioration : ";BONUSdef ; " [ ";lvlITEM2;" ]"
if TYPEdefEQUIP$ <> "" and version = 1 then print #main.map, "place 230 275 ;\"; "Après amélioration : ";int(BONUSdef+lvlITEM2)
if TYPEdefEQUIP$ <> "" and version = 2 then print #main.map, "place 230 260 ;\"; "Before upgrade : ";BONUSdef ; " [ ";lvlITEM2;" ]"
if TYPEdefEQUIP$ <> "" and version = 2 then print #main.map, "place 230 275 ;\"; "After upgrade : ";int(BONUSdef+lvlITEM2)

if TYPEatkEQUIP$ <> "" then print #main.map, "place 230 65 ;\"; "Equipement : ";TYPEatkEQUIP$ 
if TYPEatkEQUIP$ <> "" and version = 1 then print #main.map, "place 230 85 ;\"; "Avant amélioration : ";BONUSatk ; " [ ";lvlITEM1;" ]"
if TYPEatkEQUIP$ <> "" and version = 1 then print #main.map, "place 230 100 ;\"; "Après amélioration : ";int(BONUSatk+lvlITEM1)
if TYPEatkEQUIP$ <> "" and version = 2 then print #main.map, "place 230 85 ;\"; "Before upgrade : ";BONUSatk ; " [ ";lvlITEM1;" ]"
if TYPEatkEQUIP$ <> "" and version = 2 then print #main.map, "place 230 100 ;\"; "After upgrade : ";int(BONUSatk+lvlITEM1)

if RACE$ = "ARTISAN" then
costITEM1forgeUP = int(((BONUSatk+lvlITEM1)*5)/2)
costITEM2forgeUP = int(((BONUSdef+lvlITEM2)*5)/2)
goto [secuFor1]
end if
costITEM1forgeUP = int((BONUSatk+lvlITEM1)*5)
costITEM2forgeUP = int((BONUSdef+lvlITEM2)*5)
[secuFor1]
if TYPEatkEQUIP$ <> "" and version = 1 then #main.map, "place 500 65 ;\"; "Coût : ";costITEM1forgeUP
if TYPEatkEQUIP$ <> "" and version = 2 then #main.map, "place 500 65 ;\"; "Cost : ";costITEM1forgeUP
if TYPEdefEQUIP$ <> "" and version = 1 then #main.map, "place 500 240 ;\"; "Coût : ";costITEM2forgeUP
if TYPEdefEQUIP$ <> "" and version = 2 then #main.map, "place 500 240 ;\"; "Cost : ";costITEM2forgeUP
print #main.map, "backcolor black"
print #main.map, "color white"
if version = 2 then print #main.map, "place 230 350 ;\"; "Your Gold  : ";money
if version = 1 then print #main.map, "place 230 350 ;\"; "Votre Or  : ";money

r = 100 : b = 100 : v = 100
print #main.map, "backcolor ";r;" ";v;" ";b
if version = 1 then #main.map, "place 80 65 ;\"; "ARME"
if version = 2 then #main.map, "place 75 80 ;\"; "Weapon"
if version = 1 then #main.map, "place 75 280 ;\"; "ARMURE"
if version = 2 then #main.map, "place 75 280 ;\"; "ARMOR"
print #main, "font Times New Roman 10"
print #main.map, "flush"
wait

[ameliorationARME]
if money < costITEM1forgeUP then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 230 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 230 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if BONUSatk+lvlITEM1 = 0 then wait
SECUmusic = 1
if MusicSELECT = 1 then playwave "data\sons\forgeron.wav", async
money = money - costITEM1forgeUP
BONUSatk = BONUSatk + lvlITEM1
print #main.map, "backcolor white"
print #main.map, "color black"
if TYPEatkEQUIP$ <> "" then print #main.map, "place 230 65 ;\"; "Equipement : ";TYPEatkEQUIP$
if TYPEatkEQUIP$ <> "" and version = 1 then print #main.map, "place 230 85 ;\"; "Avant amélioration : ";BONUSatk; " [ ";lvlITEM1;" ]"
if TYPEatkEQUIP$ <> "" and version = 1 then print #main.map, "place 230 100 ;\"; "Après amélioration : ";int(BONUSatk+lvlITEM1)
if TYPEatkEQUIP$ <> "" and version = 2 then print #main.map, "place 230 85 ;\"; "Before upgrade : ";BONUSatk; " [ ";lvlITEM1;" ]"
if TYPEatkEQUIP$ <> "" and version = 2 then print #main.map, "place 230 100 ;\"; "After upgrade : ";int(BONUSatk+lvlITEM1)
if version = 1 then #main.map, "place 500 65 ;\"; "Coût : ";costITEM1forgeUP; "    "
if version = 2 then #main.map, "place 500 65 ;\"; "Cost : ";costITEM1forgeUP; "    "
print #main.map, "backcolor white"
print #main.map, "color black"
if RACE$ = "ARTISAN" then
    costITEM1forgeUP = int(((BONUSatk+lvlITEM1)*5)/2)
    if version = 1 then #main.map, "place 500 65 ;\"; "Coût : ";costITEM1forgeUP
    if version = 2 then #main.map, "place 500 65 ;\"; "Cost : ";costITEM1forgeUP
    if MAXup1 = 1 and money <= costITEM1forgeUP then goto [ameliorationARME]
    if version = 2 then print #main.map, "place 230 350 ;\"; "Your Gold  : ";money;"          "
    if version = 1 then print #main.map, "place 230 350 ;\"; "Votre Or  : ";money;"          "
    wait
end if
costITEM1forgeUP = int((BONUSatk+lvlITEM1)*5)
if version = 1 then #main.map, "place 500 65 ;\"; "Coût : ";costITEM1forgeUP;"                     "
if version = 2 then #main.map, "place 500 65 ;\"; "Cost : ";costITEM1forgeUP;"                     "
print #main.map, "backcolor black"
print #main.map, "color white"
if version = 2 then print #main.map, "place 230 350 ;\"; "Your Gold  : ";money;"          "
if version = 1 then print #main.map, "place 230 350 ;\"; "Votre Or  : ";money;"          "
if MAXup1 = 1 and money >= costITEM1forgeUP then goto [ameliorationARMEmax]
MAXup1 = 0
wait
[ameliorationARMEmax]
MAXup1 = 1
goto [ameliorationARME]
wait


[ameliorationARMURE]
if money < costITEM2forgeUP then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 230 330 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 230 330 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if BONUSdef+lvlITEM2 = 0 then wait
SECUmusic = 1
if MusicSELECT = 1 then playwave "data\sons\forgeron.wav", async
money = money - costITEM2forgeUP
BONUSdef = BONUSdef + lvlITEM2
print #main.map, "backcolor white"
print #main.map, "color black"
if TYPEdefEQUIP$ <> "" then print #main.map, "place 230 240 ;\"; "Equipement : ";TYPEdefEQUIP$
if TYPEdefEQUIP$ <> "" and version = 1 then print #main.map, "place 230 260 ;\"; "Avant amélioration : ";BONUSdef; " [ ";lvlITEM2;" ]"
if TYPEdefEQUIP$ <> "" and version = 1 then print #main.map, "place 230 275 ;\"; "Après amélioration : ";int(BONUSdef+lvlITEM2)
if TYPEdefEQUIP$ <> "" and version = 2 then print #main.map, "place 230 260 ;\"; "Before upgrade : ";BONUSdef; " [ ";lvlITEM2;" ]"
if TYPEdefEQUIP$ <> "" and version = 2 then print #main.map, "place 230 275 ;\"; "After upgrade : ";int(BONUSdef+lvlITEM2)
if version = 1 then #main.map, "place 500 240 ;\"; "Coût : ";costITEM2forgeUP;"    "
if version = 2 then #main.map, "place 500 240 ;\"; "Cost : ";costITEM2forgeUP;"    "
print #main.map, "backcolor white"
print #main.map, "color black"
if RACE$ = "ARTISAN" then
    costITEM2forgeUP = int(((BONUSdef+lvlITEM2)*5)/2)
    if version = 1 then #main.map, "place 500 240 ;\"; "Coût : ";costITEM2forgeUP;"                     "
    if version = 2 then #main.map, "place 500 240 ;\"; "Cost : ";costITEM2forgeUP;"                     "
    if MAXup2 = 1 and money <= costITEM2forgeUP then goto [ameliorationARME]
    if version = 2 then print #main.map, "place 230 350 ;\"; "Your Gold  : ";money;"          "
    if version = 1 then print #main.map, "place 230 350 ;\"; "Votre Or  : ";money;"          "
    wait
end if
costITEM2forgeUP = int((BONUSdef+lvlITEM2)*5)
if version = 1 then #main.map, "place 500 240 ;\"; "Coût : ";costITEM2forgeUP;"                     "
if version = 2 then #main.map, "place 500 240 ;\"; "Cost : ";costITEM2forgeUP;"                     "
print #main.map, "backcolor black"
print #main.map, "color white"
if version = 2 then print #main.map, "place 230 350 ;\"; "Your Gold  : ";money;"          "
if version = 1 then print #main.map, "place 230 350 ;\"; "Votre Or  : ";money;"          "
if MAXup2 = 1 and money >= costITEM2forgeUP then goto [ameliorationARMUREmax]
MAXup2 = 0
wait
[ameliorationARMUREmax]
MAXup2 = 1
goto [ameliorationARMURE]
wait


[achatDEF1]
print #main.map, "font Times New Roman 9;color white"
if achatdefITEM = 1 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(defDEF1*lvlDEF1)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(defDEF1*lvlDEF1)*2
BONUSdef = defDEF1
TYPEdefEQUIP$ = nameDEF1$
lvlITEM2 = lvlDEF1
ACHAT = 1
achatdefITEM = 1
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEdefEQUIP$ ;" avec ";BONUSdef;" d'armure";"                              ";"\Niveau d'amélioration : ";lvlITEM2;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEdefEQUIP$ ;" with ";BONUSdef;" armor\Upgrade level : ";lvlITEM2;"\\Money  : ";money;"          "
wait
[achatDEF2]
print #main.map, "font Times New Roman 9;color white"
if achatdefITEM = 2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(defDEF2*lvlDEF2)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(defDEF2*lvlDEF2)*2
BONUSdef = defDEF2
TYPEdefEQUIP$ = nameDEF2$
lvlITEM2 = lvlDEF2
ACHAT = 1
achatdefITEM = 2
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEdefEQUIP$ ;" avec ";BONUSdef;" d'armure";"                              ";"\Niveau d'amélioration : ";lvlITEM2;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEdefEQUIP$ ;" with ";BONUSdef;" armor\Upgrade level : ";lvlITEM2;"\\Money  : ";money;"          "

wait
[achatDEF3]
print #main.map, "font Times New Roman 9;color white"
if achatdefITEM = 3 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(defDEF3*lvlDEF3)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(defDEF3*lvlDEF3)*2
BONUSdef = defDEF3
TYPEdefEQUIP$ = nameDEF3$
lvlITEM2 = lvlDEF3
ACHAT = 1
achatdefITEM = 3
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEdefEQUIP$ ;" avec ";BONUSdef;" d'armure";"                              ";"\Niveau d'amélioration : ";lvlITEM2;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEdefEQUIP$ ;" with ";BONUSdef;" armor\Upgrade level : ";lvlITEM2;"\\Money  : ";money;"          "

wait
[achatDEF4]
print #main.map, "font Times New Roman 9;color white"
if achatdefITEM = 4 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(defDEF4*lvlDEF4)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(defDEF4*lvlDEF4)*2
BONUSdef = defDEF4
TYPEdefEQUIP$ = nameDEF4$
lvlITEM2 = lvlDEF4
ACHAT = 1
achatdefITEM = 4
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEdefEQUIP$;" avec ";BONUSdef;" d'armure";"                              ";"\Niveau d'amélioration : ";lvlITEM2;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEdefEQUIP$ ;" with ";BONUSdef;" armor\Upgrade level : ";lvlITEM2;"\\Money  : ";money;"          "

wait
[achatDEF5]
print #main.map, "font Times New Roman 9;color white"
if achatdefITEM = 5 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(defDEF5*lvlDEF5)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(defDEF5*lvlDEF5)*2
BONUSdef = defDEF5
TYPEdefEQUIP$ = nameDEF5$
lvlITEM2 = lvlDEF5
ACHAT = 1
achatdefITEM = 5
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEdefEQUIP$;" avec ";BONUSdef;" d'armure";"                              ";"\Niveau d'amélioration : ";lvlITEM2;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEdefEQUIP$ ;" with ";BONUSdef;" armor\Upgrade level : ";lvlITEM2;"\\Money  : ";money;"          "

wait
[achatDEF6]
print #main.map, "font Times New Roman 9;color white"
if achatdefITEM = 6 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(defDEF6*lvlDEF6)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(defDEF6*lvlDEF6)*2
BONUSdef = defDEF6
TYPEdefEQUIP$ = nameDEF6$
lvlITEM2 = lvlDEF6
ACHAT = 1
achatdefITEM = 6
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEdefEQUIP$ ;" avec ";BONUSdef;" d'armure";"                              ";"\Niveau d'amélioration : ";lvlITEM2;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEdefEQUIP$ ;" with ";BONUSdef;" armor\Upgrade level : ";lvlITEM2;"\\Money  : ";money;"          "

wait
[achatDEF7]
print #main.map, "font Times New Roman 9;color white"
if achatdefITEM = 7 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(defDEF7*lvlDEF7)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(defDEF7*lvlDEF7)*2
BONUSdef = defDEF7
TYPEdefEQUIP$ = nameDEF7$
lvlITEM2 = lvlDEF7
ACHAT = 1
achatdefITEM = 7
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEdefEQUIP$;" avec ";BONUSdef;" d'armure";"                              ";"\Niveau d'amélioration : ";lvlITEM2;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEdefEQUIP$ ;" with ";BONUSdef;" armor\Upgrade level : ";lvlITEM2;"\\Money  : ";money;"          "

wait
[achatDEF8]
print #main.map, "font Times New Roman 9;color white"
if achatdefITEM = 8 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(defDEF8*lvlDEF8)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(defDEF8*lvlDEF8)*2
BONUSdef = defDEF8
TYPEdefEQUIP$ = nameDEF8$
lvlITEM2 = lvlDEF8
ACHAT = 1
achatdefITEM = 8
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEdefEQUIP$;" avec ";BONUSdef;" d'armure";"                              ";"\Niveau d'amélioration : ";lvlITEM2;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEdefEQUIP$ ;" with ";BONUSdef;" armor\Upgrade level : ";lvlITEM2;"\\Money  : ";money;"          "

wait

[achatATKmelee1]
print #main.map, "font Times New Roman 9;color white"
if achatatkITEM = 1 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(atkATKmelee1*lvlATKmelee1)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(atkATKmelee1*lvlATKmelee1)*2
BONUSatk = atkATKmelee1
TYPEatkEQUIP$ = nameATKmelee1$
lvlITEM1 = lvlATKmelee1
ACHAT = 1
achatatkITEM = 1
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEatkEQUIP$;" avec ";BONUSatk;" d'attaque";"                              ";"\Niveau d'amélioration : ";lvlITEM1;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEatkEQUIP$ ;" with ";BONUSatk;" atack\Upgrade level : ";lvlITEM1;"\\Money  : ";money;"          "
wait
[achatATKmelee2]
print #main.map, "font Times New Roman 9;color white"
if achatatkITEM = 2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(atkATKmelee2*lvlATKmelee2)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(atkATKmelee2*lvlATKmelee2)*2
BONUSatk = atkATKmelee2
TYPEatkEQUIP$ = nameATKmelee2$
lvlITEM1 = lvlATKmelee2
ACHAT = 1
achatatkITEM = 2
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEatkEQUIP$;" avec ";BONUSatk;" d'attaque";"                              ";"\Niveau d'amélioration : ";lvlITEM1;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEatkEQUIP$ ;" with ";BONUSatk;" atack\Upgrade level : ";lvlITEM1;"\\Money  : ";money;"          "

wait
[achatATKmelee3]
print #main.map, "font Times New Roman 9;color white"
if achatatkITEM = 3 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(atkATKmelee3*lvlATKmelee3)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(atkATKmelee3*lvlATKmelee3)*2
BONUSatk = atkATKmelee3
TYPEatkEQUIP$ = nameATKmelee3$
lvlITEM1 = lvlATKmelee3
ACHAT = 1
achatatkITEM = 3
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEatkEQUIP$;" avec ";BONUSatk;" d'attaque";"                              ";"\Niveau d'amélioration : ";lvlITEM1;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEatkEQUIP$ ;" with ";BONUSatk;" atack\Upgrade level : ";lvlITEM1;"\\Money  : ";money;"          "

wait
[achatATKmelee4]
print #main.map, "font Times New Roman 9;color white"
if achatatkITEM = 4 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(atkATKmelee4*lvlATKmelee4)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(atkATKmelee4*lvlATKmelee4)*2
BONUSatk = atkATKmelee4
TYPEatkEQUIP$ = nameATKmelee4$
lvlITEM1 = lvlATKmelee4
ACHAT = 1
achatatkITEM = 4
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEatkEQUIP$;" avec ";BONUSatk;" d'attaque";"                              ";"\Niveau d'amélioration : ";lvlITEM1;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEatkEQUIP$ ;" with ";BONUSatk;" atack\Upgrade level : ";lvlITEM1;"\\Money  : ";money;"          "

wait

[achatATKdistance1]
print #main.map, "font Times New Roman 9;color white"
if achatatkITEM = 5 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(atkATKdistance1*lvlATKdistance1)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(atkATKdistance1*lvlATKdistance1)*2
BONUSatk = atkATKdistance1
TYPEatkEQUIP$ = nameATKdistance1$
lvlITEM1 = lvlATKdistance1
ACHAT = 1
achatatkITEM = 5
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEatkEQUIP$;" avec ";BONUSatk;" d'attaque ";"                              ";"\Niveau d'amélioration : ";lvlITEM1;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEatkEQUIP$ ;" with ";BONUSatk;" atack\Upgrade level : ";lvlITEM1;"\\Money  : ";money;"          "

wait
[achatATKdistance2]
print #main.map, "font Times New Roman 9;color white"
if achatatkITEM = 6 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(atkATKdistance2*lvlATKdistance2)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(atkATKdistance2*lvlATKdistance2)*2
BONUSatk = atkATKdistance2
TYPEatkEQUIP$ = nameATKdistance2$
lvlITEM1 = lvlATKdistance2
ACHAT = 1
achatatkITEM = 6
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEatkEQUIP$;" avec ";BONUSatk;" d'attaque";"                              ";"\Niveau d'amélioration : ";lvlITEM1;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEatkEQUIP$ ;" with ";BONUSatk;" atack\Upgrade level : ";lvlITEM1;"\\Money  : ";money;"          "

wait
[achatATKdistance3]
print #main.map, "font Times New Roman 9;color white"
if achatatkITEM = 7 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(atkATKdistance3*lvlATKdistance3)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(atkATKdistance3*lvlATKdistance3)*2
BONUSatk = atkATKdistance3
TYPEatkEQUIP$ = nameATKdistance3$
lvlITEM1 = lvlATKdistance3
ACHAT = 1
achatatkITEM = 7
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEatkEQUIP$;" avec ";BONUSatk;" d'attaque";"                              ";"\Niveau d'amélioration : ";lvlITEM1;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEatkEQUIP$ ;" with ";BONUSatk;" atack\Upgrade level : ";lvlITEM1;"\\Money  : ";money;"          "
wait
[achatATKdistance4]
print #main.map, "font Times New Roman 9;color white"
if achatatkITEM = 8 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "Vous avez déjà acheté cet objet !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU ALLDREAY BOUGHT THIS ITEM!"
    wait
end if
if money < int(atkATKdistance4*lvlATKdistance4)*2 then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 250 105 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 250 105 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
money = money - int(atkATKdistance4*lvlATKdistance4)*2
BONUSatk = atkATKdistance4
TYPEatkEQUIP$ = nameATKdistance4$
lvlITEM1 = lvlATKdistance4
ACHAT = 1
achatatkITEM = 8
print #main.map, "font Times New Roman 9;color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor black"
if version = 1 then #main.map, "place 250 40 ;\"; "Equipement : "; TYPEatkEQUIP$;" avec ";BONUSatk;" d'attaque ";"                              ";"\Niveau d'amélioration : ";lvlITEM1;"\\Argent  : ";money;"          "
if version = 2 then #main.map, "place 250 40 ;\"; "Stuff : "; TYPEatkEQUIP$ ;" with ";BONUSatk;" atack\Upgrade level : ";lvlITEM1;"\\Money  : ";money;"          "

wait

[dataDEF]
achatdefITEM = 0
for x = 1 to 8
nameDEF = int(rnd(1)*15+1)
lvlDEF = int(rnd(1)*LvlDONJON*LvlDONJON+1)
select case nameDEF
    case 1
        if version = 1 then nameDEF$ = "Simple veste"
        if version = 2 then nameDEF$ = "Single jacket"
        defDEF = int(rnd(1)*(lvl*2)*LvlDONJON+1)
    case 2
        if version = 1 then nameDEF$ = "Veste de cuir"
        if version = 2 then nameDEF$ = "Leather Jacket"
        defDEF = int(rnd(1)*(lvl*3)*LvlDONJON+3)
    case 3
        if version = 1 then nameDEF$ = "Cotte de mailles"
        if version = 2 then nameDEF$ = "Chainmail"
        defDEF = int(rnd(1)*(lvl*5)*LvlDONJON+15)
    case 4
        if version = 1 then nameDEF$ = "Plastron de fer"
        if version = 2 then nameDEF$ = "Iron Breastplate"
        defDEF = int(rnd(1)*(lvl*6)*LvlDONJON+25)
    case 5
        if version = 1 then nameDEF$ = "Manteau épais"
        if version = 2 then nameDEF$ = "Thick coat"
        defDEF = int(rnd(1)*(lvl*2)*LvlDONJON+2)
    case 6
        if version = 1 then nameDEF$ = "Chemise"
        if version = 2 then nameDEF$ = "Shirt"
        defDEF = int(rnd(1)*(lvl*1)*LvlDONJON+1)
    case 7
        if version = 1 then nameDEF$ = "Armure de cuir"
        if version = 2 then nameDEF$ = "Leather Armor"
        defDEF = int(rnd(1)*(lvl*4)*LvlDONJON+8)
    case 8
        if version = 1 then nameDEF$ = "Armure de cuivre"
        if version = 2 then nameDEF$ = "Copper armor"
        defDEF = int(rnd(1)*(lvl*6)*LvlDONJON+21)
    case 9
        if version = 1 then nameDEF$ = "Armure de fer"
        if version = 2 then nameDEF$ = "Iron armor"
        defDEF = int(rnd(1)*(lvl*7)*LvlDONJON+32)
    case 10
        if version = 1 then nameDEF$ = "Armure d'acier"
        if version = 2 then nameDEF$ = "Steel Armor"
        defDEF = int(rnd(1)*(lvl*9)*LvlDONJON+50)
    case 11
        if version = 1 then nameDEF$ = "Armure de dragon"
        if version = 2 then nameDEF$ = "Dragon armor"
        defDEF = int(rnd(1)*(lvl*12)*LvlDONJON+100)
        if defDEF < 1 then defDEF = 1
    case 12
        if version = 1 then nameDEF$ = "Plastron d'aciers"
        if version = 2 then nameDEF$ = "Breastplate of steel"
        defDEF = int(rnd(1)*(lvl*8)*LvlDONJON+42)
    case 13
        if version = 1 then nameDEF$ = "Armure imaginaire"
        if version = 2 then nameDEF$ = "Imaginary armor"
        defDEF = int(rnd(1)*(lvl*1)*LvlDONJON+1)
    case 14
        if version = 1 then nameDEF$ = "Robe de sorcier"
        if version = 2 then nameDEF$ = "Dress sorcerer"
        defDEF = int(rnd(1)*(lvl*6)*LvlDONJON+10)
    case 15
        if version = 1 then nameDEF$ = "Cape précieuse"
        if version = 2 then nameDEF$ = "Cape valuable"
        defDEF = int(rnd(1)*(lvl*3)*LvlDONJON+5)
end select
    if x = 1 then
        nameDEF1$ = nameDEF$
        defDEF1 = defDEF
        TYPEdef$ = nameDEF$
        lvlDEF1 = lvlDEF
    end if
    if x = 2 then
        nameDEF2$ = nameDEF$
        defDEF2 = defDEF
        TYPEdef$ = nameDEF$
        lvlDEF2 = lvlDEF
    end if
    if x = 3 then
        nameDEF3$ = nameDEF$
        defDEF3 = defDEF
        TYPEdef$ = nameDEF$
        lvlDEF3 = lvlDEF
    end if
    if x = 4 then
        nameDEF4$ = nameDEF$
        defDEF4 = defDEF
        TYPEdef$ = nameDEF$
        lvlDEF4 = lvlDEF
    end if
    if x = 5 then
        nameDEF5$ = nameDEF$
        defDEF5 = defDEF
        TYPEdef$ = nameDEF$
        lvlDEF5 = lvlDEF
    end if
    if x = 6 then
        nameDEF6$ = nameDEF$
        defDEF6 = defDEF
        TYPEdef$ = nameDEF$
        lvlDEF6 = lvlDEF
    end if
    if x = 7 then
        nameDEF7$ = nameDEF$
        defDEF7 = defDEF
        TYPEdef$ = nameDEF$
        lvlDEF7 = lvlDEF
    end if
    if x = 8 then
        nameDEF8$ = nameDEF$
        defDEF8 = defDEF
        TYPEdef$ = nameDEF$
        lvlDEF8 = lvlDEF
    end if
next x
return

[dataATKmelee]
achatatkITEM = 0
for x = 1 to 4
nameATKmelee = int(rnd(1)*10+1)
lvlATKmelee = int(rnd(1)*LvlDONJON*LvlDONJON+1)
select case nameATKmelee
    case 1
        if version = 1 then nameATKmelee$ = "Epée"
        if version = 2 then nameATKmelee$ = "Sword"
        atkATKmelee = int(rnd(1)*(LvlDONJON+lvl)*10)
        if RACE$ = "GUERRIER" or RACE$ = "WARRIOR" then
            if version = 1 then nameATKmelee$ = "Epée +25%"
            if version = 2 then nameATKmelee$ = "Sword +25%"
            atkATKmelee = int((rnd(1)*(LvlDONJON+lvl)*10) + ((rnd(1)*(LvlDONJON+lvl)*10)/4))
        end if
    case 2
        if version = 1 then nameATKmelee$ = "Hache lourde"
        if version = 2 then nameATKmelee$ = "Heavy ax"
        atkATKmelee = int(rnd(1)*(LvlDONJON+lvl)*14)
        if RACE$ = "TANK" then
            if version = 1 then nameATKmelee$ = "Hache lourde +25%"
            if version = 2 then nameATKmelee$ = "Heavy ax +25%"
            atkATKmelee = int((rnd(1)*(LvlDONJON+lvl)*14) + ((rnd(1)*(LvlDONJON+lvl)*14)/4))
        end if
    case 3
        if version = 1 then nameATKmelee$ = "Lance"
        if version = 2 then nameATKmelee$ = "Spear"
        atkATKmelee = int(rnd(1)*(LvlDONJON+lvl)*15)
        if RACE$ = "GUERRIER" or RACE$ = "WARRIOR" then
            if version = 1 then nameATKmelee$ = "Lance +25%"
            if version = 2 then nameATKmelee$ = "Spear +25%"
            atkATKmelee = int((rnd(1)*(LvlDONJON+lvl)*15) + ((rnd(1)*(LvlDONJON+lvl)*15)/4))
        end if
    case 4
        if version = 1 then nameATKmelee$ = "Masse"
        if version = 2 then nameATKmelee$ = "Mass"
        atkATKmelee = int(rnd(1)*(LvlDONJON+lvl)*20)
        if RACE$ = "TANK" then
            if version = 1 then nameATKmelee$ = "Masse +25%"
            if version = 2 then nameATKmelee$ = "Mass +25%"
            atkATKmelee = int((rnd(1)*(LvlDONJON+lvl)*20) + ((rnd(1)*(LvlDONJON+lvl)*20)/4))
        end if
    case 5
        if version = 1 then nameATKmelee$ = "Marteau"
        if version = 2 then nameATKmelee$ = "Hammer"
        atkATKmelee = int(rnd(1)*(LvlDONJON+lvl)*8)
        if RACE$ = "TANK" then
            if version = 1 then nameATKmelee$ = "Marteau +25%"
            if version = 2 then nameATKmelee$ = "Hammer +25%"
            atkATKmelee = int((rnd(1)*(LvlDONJON+lvl)*8) + ((rnd(1)*(LvlDONJON+lvl)*8)/4))
        end if
    case 6
        if version = 1 then nameATKmelee$ = "Bâton"
        if version = 2 then nameATKmelee$ = "Stick"
        atkATKmelee = int(rnd(1)*(LvlDONJON+lvl)*3)
        if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" or RACE$ = "ARTISAN" then
            if version = 1 then nameATKmelee$ = "Bâton +25%"
            if version = 2 then nameATKmelee$ = "Stick +25%"
            atkATKmelee = int((rnd(1)*(LvlDONJON+lvl)*3) + ((rnd(1)*(LvlDONJON+lvl)*3)/4))
        end if
    case 7
        if version = 1 then nameATKmelee$ = "Sabre"
        if version = 2 then nameATKmelee$ = "Saber"
        atkATKmelee = int(rnd(1)*(LvlDONJON+lvl)*9)
        if RACE$ = "GUERRIER" or RACE$ = "WARRIOR" then
            if version = 1 then nameATKmelee$ = "Sabre +25%"
            if version = 2 then nameATKmelee$ = "Saber +25%"
            atkATKmelee = int((rnd(1)*(LvlDONJON+lvl)*9) + ((rnd(1)*(LvlDONJON+lvl)*9)/4))
        end if
    case 8
        nameATKmelee$ = "Katana"
        atkATKmelee = int(rnd(1)*(LvlDONJON+lvl)*28)
        if RACE$ = "GUERRIER" or RACE$ = "WARRIOR" then
            nameATKmelee$ = "Katana +25%"
            atkATKmelee = int((rnd(1)*(LvlDONJON+lvl)*28) + ((rnd(1)*(LvlDONJON+lvl)*28)/4))
        end if
    case 9
        if version = 1 then nameATKmelee$ = "Coûteau"
        if version = 2 then nameATKmelee$ = "Knife"
        atkATKmelee = int(rnd(1)*(LvlDONJON+lvl)*4)
        if RACE$ = "ARTISAN" then
            if version = 1 then nameATKmelee$ = "Coûteau +25%"
            if version = 2 then nameATKmelee$ = "Knife +25%"
            atkATKmelee = int((rnd(1)*(LvlDONJON+lvl)*4) + ((rnd(1)*(LvlDONJON+lvl)*4)/4))
        end if
    case 10
        if version = 1 then nameATKmelee$ = "Double épées"
        if version = 2 then nameATKmelee$ = "Double swords"
        atkATKmelee = int(rnd(1)*(LvlDONJON+lvl)*30)
        if RACE$ = "GUERRIER" or RACE$ = "WARRIOR" then
            if version = 1 then nameATKmelee$ = "Double épées +25%"
            if version = 2 then nameATKmelee$ = "Double swords +25%"
            atkATKmelee = int((rnd(1)*(LvlDONJON+lvl)*30) + ((rnd(1)*(LvlDONJON+lvl)*30)/4))
        end if
end select
    if x = 1 then
        nameATKmelee1$ = nameATKmelee$
        atkATKmelee1 = atkATKmelee
        TYPEatk$ = nameATKmelee$
        lvlATKmelee1 = lvlATKmelee
    end if
    if x = 2 then
        nameATKmelee2$ = nameATKmelee$
        atkATKmelee2 = atkATKmelee
        TYPEatk$ = nameATKmelee$
        lvlATKmelee2 = lvlATKmelee
    end if
    if x = 3 then
        nameATKmelee3$ = nameATKmelee$
        atkATKmelee3 = atkATKmelee
        TYPEatk$ = nameATKmelee$
        lvlATKmelee3 = lvlATKmelee
    end if
    if x = 4 then
        nameATKmelee4$ = nameATKmelee$
        atkATKmelee4 = atkATKmelee
        TYPEatk$ = nameATKmelee$
        lvlATKmelee4 = lvlATKmelee
    end if
next x

if atkATKmelee = 0 then atkATKmelee = 1

return

[dataATKdistance]
achatatkITEM = 0
for x = 1 to 4
nameATKdistance = int(rnd(1)*7+1)
lvlATKdistance = int(rnd(1)*LvlDONJON*lvl+1)
select case nameATKdistance
    case 1
        nameATKdistance$ = "Arc"
        atkATKdistance = int(rnd(1)*(LvlDONJON+lvl)*11)
        if RACE$ = "ARCHER" then
           nameATKdistance$ = "Arc +25%"
           atkATKdistance = int((rnd(1)*(LvlDONJON+lvl)*11) + ((rnd(1)*(LvlDONJON+lvl)*11)/4))
        end if
    case 2
        nameATKdistance$ = "Arbalète"
        atkATKdistance = int(rnd(1)*(LvlDONJON+lvl)*21)
        if RACE$ = "ARCHER" then
            nameATKdistance$ = "Arbalète +25%"
            atkATKdistance = int((rnd(1)*(LvlDONJON+lvl)*21) + ((rnd(1)*(LvlDONJON+lvl)*21)/4))
        end if
    case 3
        nameATKdistance$ = "Baguette"
        atkATKdistance = int(rnd(1)*(LvlDONJON+lvl)*18)
        if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" then
            nameATKdistance$ = "Baguette +25%"
            atkATKdistance = int((rnd(1)*(LvlDONJON+lvl)*18) + ((rnd(1)*(LvlDONJON+lvl)*18)/4))
        end if
    case 4
        nameATKdistance$ = "Javelot"
        atkATKdistance = int(rnd(1)*(LvlDONJON+lvl)*15)
        if RACE$ = "ARCHER" then
            nameATKdistance$ = "Javelot +25%"
            atkATKdistance = int((rnd(1)*(LvlDONJON+lvl)*15) + ((rnd(1)*(LvlDONJON+lvl)*15)/4))
        end if
    case 5
        if version = 1 then nameATKdistance$ = "Hachette"
        if version = 2 then nameATKdistance$ = "Hatchet"
        atkATKdistance = int(rnd(1)*(LvlDONJON+lvl)*12)
        if RACE$ = "GUERRIER" or RACE$ = "WARRIOR" then
            if version = 1 then nameATKdistance$ = "Hachette +25%"
            if version = 1 then nameATKdistance$ = "Hatchet +25%"
            atkATKdistance = int((rnd(1)*(LvlDONJON+lvl)*12) + ((rnd(1)*(LvlDONJON+lvl)*12)/4))
        end if
    case 6
        if version = 1 then nameATKdistance$ = "Mortier"
        if version = 2 then nameATKdistance$ = "Mortar"
        atkATKdistance = int(rnd(1)*(LvlDONJON+lvl)*40)
        if RACE$ = "ARTISAN" then
            if version = 1 then nameATKdistance$ = "Mortier +25%"
            if version = 2 then nameATKdistance$ = "Mortar +25%"
            atkATKdistance = int((rnd(1)*(LvlDONJON+lvl)*40) + ((rnd(1)*(LvlDONJON+lvl)*40)/4))
        end if
    case 7
        if version = 1 then nameATKdistance$ = "Fronde"
        if version = 2 then nameATKdistance$ = "Sling"
        atkATKdistance = int(rnd(1)*(LvlDONJON+lvl)*10)
        if RACE$ = "ARCHER" then
            if version = 1 then nameATKdistance$ = "Fronde +25%"
            if version = 2 then nameATKdistance$ = "Sling +25%"
            atkATKdistance = int((rnd(1)*(LvlDONJON+lvl)*10) + ((rnd(1)*(LvlDONJON+lvl)*10)/4))
        end if
end select
    if x = 1 then
        nameATKdistance1$ = nameATKdistance$
        atkATKdistance1 = atkATKdistance
        TYPEatk$ = nameATKdistance$
        lvlATKdistance1 = lvlATKdistance
    end if
    if x = 2 then
        nameATKdistance2$ = nameATKdistance$
        atkATKdistance2 = atkATKdistance
        TYPEatk$ = nameATKdistance$
        lvlATKdistance2 = lvlATKdistance
    end if
    if x = 3 then
        nameATKdistance3$ = nameATKdistance$
        atkATKdistance3 = atkATKdistance
        TYPEatk$ = nameATKdistance$
        lvlATKdistance3 = lvlATKdistance
    end if
    if x = 4 then
        nameATKdistance4$ = nameATKdistance$
        atkATKdistance4 = atkATKdistance
        TYPEatk$ = nameATKdistance$
        lvlATKdistance4 = lvlATKdistance
    end if
next x

if atkATKdistance = 0 then atkATKdistance = 1

return



[achatPOTION1]
if ValeurORPotion1 > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PotionLittleHP = PotionLittleHP + 1
money = money - ValeurORPotion1
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 200 ;\"; PotionLittleHP;"  "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"    "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"     "
wait
[achatPOTION1b]
if (ValeurORPotion1*100) > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PotionLittleHP = PotionLittleHP + 100
money = money - (ValeurORPotion1*100)
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 200 ;\"; PotionLittleHP;"  "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"    "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"     "
wait


[achatPOTION2]
if ValeurORPotion2 > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PotionMediumHP = PotionMediumHP + 1
money = money - ValeurORPotion2
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 242 ;\"; PotionMediumHP;"  "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"    "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"     "
wait
[achatPOTION2b]
if (ValeurORPotion2*100) > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PotionMediumHP = PotionMediumHP + 100
money = money - (ValeurORPotion2*100)
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 242 ;\"; PotionMediumHP;"  "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"    "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"     "
wait
[achatPOTION3]
if ValeurORPotion3 > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PotionBigHP = PotionBigHP + 1
money = money - ValeurORPotion3
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 284 ;\"; PotionBigHP;"  "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"    "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"     "
wait
[achatPOTION3b]
if (ValeurORPotion3*100) > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PotionBigHP = PotionBigHP + 100
money = money - (ValeurORPotion3*100)
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 284 ;\"; PotionBigHP;"  "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"    "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"     "
wait
[achatPOTION4]
if ValeurORPotion4 > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PotionBig2HP = PotionBig2HP + 1
money = money - ValeurORPotion4
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 326 ;\"; PotionBig2HP;"  "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"    "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"     "
wait
[achatPOTION4b]
if (ValeurORPotion4*100) > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PotionBig2HP = PotionBig2HP + 100
money = money - (ValeurORPotion4*100)
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 326 ;\"; PotionBig2HP;"  "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"    "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"     "
wait
[achatPOTION5]
if ValeurORPotion5 > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PotionBig3HP = PotionBig3HP + 1
money = money - ValeurORPotion5
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 366 ;\"; PotionBig3HP;"  "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"    "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"     "
wait
[achatPOTION5b]
if (ValeurORPotion5*100) > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PotionBig3HP = PotionBig3HP + 100
money = money - (ValeurORPotion5*100)
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 366 ;\"; PotionBig3HP;"  "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"    "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"     "
wait
[achatPoS]
if ValeurORPoS > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PoS = PoS + 1
money = money - ValeurORPoS
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 406 ;\"; PoS;"   "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"    "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"     "
wait
[achatPoSb]
if (ValeurORPoS*100) > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PoS = PoS + 100
money = money - (ValeurORPoS*100)
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 406 ;\"; PoS;"   "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"       "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"        "
if achatPoSbMAX = 1 and money >= (ValeurORPoS*10000) then goto [achatPoSb]
achatPoSbMAX = 0
wait
[achatPoSbMAX]
achatPoSbMAX = 1
goto [achatPoSb]

[achatPoP]
if ValeurORPoP > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PoP = PoP + 1
money = money - ValeurORPoP
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 446 ;\"; PoP;"   "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"       "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"        "
wait
[achatPoPb]
if (ValeurORPoP*100) > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
print #main.map, "backcolor white"
if MusicSELECT = 1 then playwave "data\sons\hit6.wav", async
PoP = PoP + 100
money = money - (ValeurORPoP*100)
print #main.map, "font Times New Roman 10; color black"
print #main.map, "place 400 446 ;\"; PoP;"   "
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"       "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"        "
wait

[healer]
close #main
ValeurORPoP = int(2000+(1000*LvlDONJON)-1000)
ValeurORPoS = int(2000+(1000*LvlDONJON)-1000)
ValeurORPotion5 = int(400 + (125*LvlDONJON-100))
ValeurORPotion4 = int(300 + (100*LvlDONJON-80))
ValeurORPotion3 = int(200 + (75*LvlDONJON-60))
ValeurORPotion2 = int(90 + (50*LvlDONJON-40))
ValeurORPotion1 = int(40 + (25*LvlDONJON-20))

if RACE$ = "ARTISAN" then ValeurORPotion1 = 20
if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" then ValeurORPotion1 = 30
if RACE$ = "ARTISAN" then ValeurORPotion2 = 40
if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" then ValeurORPotion2 = 60
if RACE$ = "ARTISAN" then ValeurORPotion3 = 80
if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" then ValeurORPotion3 = 100
if RACE$ = "ARTISAN" then ValeurORPotion4 = 120
if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" then ValeurORPotion4 = 150
if RACE$ = "ARTISAN" then ValeurORPotion5 = 160
if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" then ValeurORPotion5 = 200
if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" then ValeurORPoS = int(1000+(500*LvlDONJON)-500)
if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" then ValeurORPoP = int(1000+(500*LvlDONJON)-500)

WindowWidth = 800 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)

graphicbox #main.map, 0, 0, WindowWidth, WindowHeight


if pv < pvTOTAL then
    if version = 1 then button #main.b1, "Soigne moi", [heal],UL 220,85,100,25
    if version = 2 then button #main.b1, "Heal me", [heal],UL 220,85,100,25
end if

if version = 1 then
button #main.1, "Acheter", [achatPOTION1],UL 397,205,50,20
button #main.2, "Acheter", [achatPOTION2],UL 397,247,50,20
button #main.3, "Acheter", [achatPOTION3],UL 397,287,50,20
button #main.4, "Acheter", [achatPOTION4],UL 397,329,50,20
button #main.5, "Acheter", [achatPOTION5],UL 397,369,50,20
button #main.6, "Acheter", [achatPoS],UL 397,409,50,20
button #main.7, "Acheter", [achatPoP],UL 397,449,50,20

button #main.1b, "Acheter", [achatPOTION1b],UL 660,188,50,20
button #main.2b, "Acheter", [achatPOTION2b],UL 660,229,50,20
button #main.3b, "Acheter", [achatPOTION3b],UL 660,270,50,20
button #main.4b, "Acheter", [achatPOTION4b],UL 660,311,50,20
button #main.5b, "Acheter", [achatPOTION5b],UL 660,352,50,20
button #main.6b, "Acheter", [achatPoSb],UL 660,393,50,20
  '  button #main.6b2, "MAX", [achatPoSbMAX],UL 720,399,40,20
button #main.7b, "Acheter", [achatPoPb],UL 660,434,50,20

end if
if version = 2 then
button #main.1, "Buy it", [achatPOTION1],UL 397,205,50,20
button #main.2, "Buy it", [achatPOTION2],UL 397,247,50,20
button #main.3, "Buy it", [achatPOTION3],UL 397,287,50,20
button #main.4, "Buy it", [achatPOTION4],UL 397,329,50,20
button #main.5, "Buy it", [achatPOTION5],UL 397,369,50,20
button #main.4, "Buy it", [achatPoS],UL 397,409,50,20
button #main.5, "Buy it", [achatPoP],UL 397,449,50,20

button #main.1b, "Buy it", [achatPOTION1b],UL 660,188,50,20
button #main.2b, "Buy it", [achatPOTION2b],UL 660,229,50,20
button #main.3b, "Buy it", [achatPOTION3b],UL 660,270,50,20
button #main.4b, "Buy it", [achatPOTION4b],UL 660,311,50,20
button #main.5b, "Buy it", [achatPOTION5b],UL 660,352,50,20
button #main.6b, "Buy it", [achatPoSb],UL 660,393,50,20
   ' button #main.6b2, "MAX", [achatPoSbMAX],UL 720,399,40,20
button #main.7b, "Buy it", [achatPoPb],UL 660,434,50,20

end if

open "Sword Art Online : Ascension [Build ";Version$;"] " for window_nf as #main
#main, "trapclose [quit]"
#main.map , "down"

print #main.map, "drawbmp mapHEALER 0 0"
print #main.map, "background mapHEALER"


#main.map , "backcolor white"
#main.map, "when leftButtonDown [SimpleClickG4]"
print #main.map, "font Times New Roman 12; color white"
r = 100 : b = 100 : v = 100
print #main.map, "backcolor ";r;" ";v;" ";b
if version = 1 then #main.map, "place 80 65 ;\"; "SOINS"
if version = 2 then #main.map, "place 75 65 ;\"; "HEALS"
if version = 1 then #main.map, "place 75 290 ;\"; "DIVERS"
if version = 2 then #main.map, "place 75 290 ;\"; "DIVERS"
print #main.map, "backcolor white"

'potions----
print #main.map, "font Times New Roman 10; color black"
if version = 1 then
    print #main.map, "place 260 205 ;\"; "Soigne "; int(pvTOTAL/10)+(pmTOTAL*1);" Pv"
    print #main.map, "place 260 245 ;\"; "Soigne "; int(pvTOTAL/4)+(pmTOTAL*2);" Pv"
    print #main.map, "place 260 285 ;\"; "Soigne "; int(pvTOTAL/2)+(pmTOTAL*3);" Pv"
    print #main.map, "place 260 325 ;\"; "Soigne "; int((pvTOTAL/4)*3)+(pmTOTAL*4);" Pv"
    print #main.map, "place 260 365 ;\"; "Soigne totalement"
    print #main.map, "place 260 405 ;\"; "+1 Point"
    print #main.map, "place 260 445 ;\"; "+1 Point"

    print #main.map, "place 260 220 ;\"; "Pour ";ValeurORPotion1;" pièces d'or"
    print #main.map, "place 260 260 ;\"; "Pour ";ValeurORPotion2;" pièces d'or"
    print #main.map, "place 260 300 ;\"; "Pour ";ValeurORPotion3;" pièces d'or"
    print #main.map, "place 260 340 ;\"; "Pour ";ValeurORPotion4;" pièces d'or"
    print #main.map, "place 260 380 ;\"; "Pour ";ValeurORPotion5;" pièces d'or"
    print #main.map, "place 260 420 ;\"; "Pour ";ValeurORPoS;" pièces d'or"
    print #main.map, "place 260 460 ;\"; "Pour ";ValeurORPoP;" pièces d'or"

    print #main.map, "place 515 205 ;\"; "Pack de 100 !"
    print #main.map, "place 515 245 ;\"; "Pack de 100 !"
    print #main.map, "place 515 285 ;\"; "Pack de 100 !"
    print #main.map, "place 515 325 ;\"; "Pack de 100 !"
    print #main.map, "place 515 365 ;\"; "Pack de 100 !"
    print #main.map, "place 515 405 ;\"; "Pack de 100 !"
    print #main.map, "place 515 445 ;\"; "Pack de 100 !"

    print #main.map, "place 515 220 ;\"; "Pour ";ValeurORPotion1*100;" pièces d'or"
    print #main.map, "place 515 260 ;\"; "Pour ";ValeurORPotion2*100;" pièces d'or"
    print #main.map, "place 515 300 ;\"; "Pour ";ValeurORPotion3*100;" pièces d'or"
    print #main.map, "place 515 340 ;\"; "Pour ";ValeurORPotion4*100;" pièces d'or"
    print #main.map, "place 515 380 ;\"; "Pour ";ValeurORPotion5*100;" pièces d'or"
    print #main.map, "place 515 420 ;\"; "Pour ";ValeurORPoS*100;" pièces d'or"
    print #main.map, "place 515 460 ;\"; "Pour ";ValeurORPoP*100;" pièces d'or"

end if
if version = 2 then
    print #main.map, "place 260 205 ;\"; "Heal "; int(pvTOTAL/10)+(pmTOTAL*1);" Hp"
    print #main.map, "place 260 245 ;\"; "Heal "; int(pvTOTAL/4)+(pmTOTAL*2);" Hp"
    print #main.map, "place 260 285 ;\"; "Heal "; int(pvTOTAL/2)+(pmTOTAL*3);" Hp"
    print #main.map, "place 260 325 ;\"; "Heal "; int((pvTOTAL/4)*3)+(pmTOTAL*4);" Hp"
    print #main.map, "place 260 365 ;\"; "Total HP Healing"
    print #main.map, "place 260 405 ;\"; "+1 Point"
    print #main.map, "place 260 445 ;\"; "+1 Point"

    print #main.map, "place 260 220 ;\"; "For ";ValeurORPotion1;" gold coins"
    print #main.map, "place 260 260 ;\"; "For ";ValeurORPotion2;" gold coins"
    print #main.map, "place 260 300 ;\"; "For ";ValeurORPotion3;" gold coins"
    print #main.map, "place 260 340 ;\"; "For ";ValeurORPotion4;" gold coins"
    print #main.map, "place 260 380 ;\"; "For ";ValeurORPotion5;" gold coins"
    print #main.map, "place 260 420 ;\"; "For ";ValeurORPoS;" gold coins"
    print #main.map, "place 260 460 ;\"; "For ";ValeurORPoP;" gold coins"

    print #main.map, "place 515 205 ;\"; "Pack to 100 !"
    print #main.map, "place 515 245 ;\"; "Pack to 100 !"
    print #main.map, "place 515 285 ;\"; "Pack to 100 !"
    print #main.map, "place 515 325 ;\"; "Pack to 100 !"
    print #main.map, "place 515 365 ;\"; "Pack to 100 !"
    print #main.map, "place 515 405 ;\"; "Pack to 100 !"
    print #main.map, "place 515 445 ;\"; "Pack to 100 !"

    print #main.map, "place 515 220 ;\"; "For ";ValeurORPotion1*100;" gold coins"
    print #main.map, "place 515 260 ;\"; "For ";ValeurORPotion2*100;" gold coins"
    print #main.map, "place 515 300 ;\"; "For ";ValeurORPotion3*100;" gold coins"
    print #main.map, "place 515 340 ;\"; "For ";ValeurORPotion4*100;" gold coins"
    print #main.map, "place 515 380 ;\"; "For ";ValeurORPotion5*100;" gold coins"
    print #main.map, "place 515 420 ;\"; "For ";ValeurORPoS*100;" gold coins"
    print #main.map, "place 515 460 ;\"; "For ";ValeurORPoP*100;" gold coins"

end if
print #main.map, "place 400 200 ;\"; PotionLittleHP
print #main.map, "place 400 242 ;\"; PotionMediumHP
print #main.map, "place 400 284 ;\"; PotionBigHP
print #main.map, "place 400 326 ;\"; PotionBig2HP
print #main.map, "place 400 366 ;\"; PotionBig3HP
print #main.map, "place 400 406 ;\"; PoS
print #main.map, "place 400 446 ;\"; PoP


print #main.map, "font Times New Roman 11; color black"
'------------------------

soin = int((pvTOTAL-pv)/15)
if soin = 0 then soin = 1
if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" then soin = 0

print #main, "font Times New Roman 11"
if pv = pvTOTAL then
    if version = 1 then print #main.map, "place 220 70 ;\"; "Bonjour ! J'ai de nombreux articles disponibles."
    if version = 2 then print #main.map, "place 220 70 ;\"; "Hello ! I have a lot of items availables."
    else
    if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" then
        if version = 1 then print #main.map, "place 220 70 ;\"; "Bonjour cher confrère, pour toi les soins sont gratuits ! Veux tu que je te soigne ?"
        if version = 2 then print #main.map, "place 220 70 ;\"; "Hello dear colleague, for you the healing is free ! Do you want to be treated ?"
        goto [secHeal1]
    end if
    if pv < pvTOTAL then
        if version = 1 then print #main.map, "place 220 70 ;\"; "Bonjour ! Je peux te soigner pour "; soin;" pièce(s) d'or."
        if version = 2 then print #main.map, "place 220 70 ;\"; "Hello ! I can heal you for "; soin;" coin(s) of gold ."
    end if
end if
[secHeal1]
print #main.map, "backcolor black;font Times New Roman 8"
print #main.map, "color white"
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money
print #main.map, "backcolor black;font Times New Roman 11"
print #main.1, "!font Times New Roman 9"
print #main.2, "!font Times New Roman 9"
print #main.3, "!font Times New Roman 9"
print #main.4, "!font Times New Roman 9"
print #main.5, "!font Times New Roman 9"
print #main.6, "!font Times New Roman 9"
print #main.7, "!font Times New Roman 9"

print #main.1b, "!font Times New Roman 9"
print #main.2b, "!font Times New Roman 9"
print #main.3b, "!font Times New Roman 9"
print #main.4b, "!font Times New Roman 9"
print #main.5b, "!font Times New Roman 9"
print #main.6b, "!font Times New Roman 9"
print #main.7b, "!font Times New Roman 9"

print #main.map, "flush"
wait

[heal]
on error goto [w]
if pv = pvTOTAL then wait
if RACE$ = "HEALER" or RACE$ = "SOIGNEUR" then goto [heal2]
if int((pvTOTAL-pv)/2) > money then
    print #main.map, "backcolor black"
    print #main.map, "color red"
    if version = 1 then print #main.map, "place 333 150 ;\"; "VOUS N'AVEZ PAS ASSEZ D'ARGENT !"
    if version = 2 then print #main.map, "place 333 150 ;\"; "YOU NEED MORE MONEY !"
    wait
end if
money = money - int((pvTOTAL-pv)/15)
[heal2]
if MusicSELECT = 1 then playwave "data\sons\heal.wav", async
pv = pvTOTAL
if version = 2 then print #main.map, "place 55 330 ;\"; "Your Gold  : ";money;"      "
if version = 1 then print #main.map, "place 55 330 ;\"; "Votre Or  : ";money;"      "
print #main.map, "backcolor white; color black"
if version = 1 then print #main.map, "place 220 70 ;\"; "Tu es maintenant en pleine santé. Bonne journée !                                              "
if version = 2 then print #main.map, "place 220 70 ;\"; "You are now full life. Have a good day !                                                       "
print #main.b1, ""
wait


[SimpleClickG3]
    mX = MouseX
    mY = MouseY

    'notice mX; " / "; mY
    if mX>560 and mX<660 and mY>350 and mY<425 then
        arena = 0 : activBUTON1 = 1
        goto [Arena0SECU]
    end if
    if mX>150 and mX<200 and mY>185 and mY<240 then
        goto [donjon]
    end if
    if mX>100 and mX<680 and mY>30 and mY<540 then
        goto [ArenaLVL]
    end if
wait


[Arena0SECU]
timer 0
SECUmusic = 0
if city = 1 then
    SECUmusic = 1
    goto [GameStartMAINsecu2]
end if
if arena = 1 then goto [Arena0]
goto [GameStartMAINsecu2]
[Arena0]
if SECUmusic = 1 then
    'playwave "data\sons\main.wav", loop
    SECUmusic = 0
end if
if action = 1 then
    action = 0
    wait
end if
timer 0
close #main
arena = 1 : donjon = 0 : city = 0
WindowWidth = 800 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight
open "Sword Art Online : Ascension [Build ";Version$;"] " for window_nf as #main
#main, "trapclose [quit]"
#main.map, "when leftButtonDown [SimpleClickG3]"
#main.map , "down"
if LvlDONJON < 5 then
    print #main.map, "drawbmp map -20 0"
    print #main.map, "background map"
end if
if LvlDONJON > 5 then
    print #main.map, "drawbmp map2 -20 0"
    print #main.map, "background map2"
end if

print #main.map, "font Times New Roman 10; color black"
r = 140 : b = 70 : v = 160
print #main.map, "backcolor ";r;" ";v;" ";b
if version = 1 then print #main.map, "place 605 400 ;\"; "Ville"
if version = 2 then print #main.map, "place 605 400 ;\"; "City"

r = 180 : b = 130 : v = 180
print #main.map, "backcolor ";r;" ";v;" ";b
print #main.map, "font Times New Roman 7; color black"
if version = 1 then print #main.map, "place 156 206 ;\"; "DONJON"
if version = 2 then print #main.map, "place 156 206 ;\"; "Dungeon"


print #main.map, "font Times New Roman 9"
r = 91 : b = 234 : v = 152
print #main.map, "backcolor ";r;" ";v;" ";b

if LvlDONJON = 1 then indicMAPlvl = LvlDONJON
if LvlDONJON >= 2 then indicMAPlvl=int(5*LvlDONJON)
if version = 1 then
print #main.map, "place 360 60 ;\"; "Argent : ";money
print #main.map, "font Times New Roman 12"
print #main.map, "place 250 40 ;\"; "Palier ";LvlDONJON;" : MONSTRES DE NIVEAU ";indicMAPlvl;" à ";LvlDONJON*10
'print #main.map, "place 360 60 ;\"; "(Cliquez sur la carte)"
end if
if version = 2 then
print #main.map, "place 360 60 ;\"; "Money : ";money
print #main.map, "font Times New Roman 12"
print #main.map, "place 250 40 ;\"; "FLOOR ";LvlDONJON;" : MONSTERS LEVEL ";indicMAPlvl;" to ";LvlDONJON*10
'print #main.map, "place 360 60 ;\"; "(Click on the map)"
end if
print #main.map, "flush"
wait


[ArenaLVL]
lvlENNEMI = int(rnd(1)*(10*LvlDONJON)+1)
if lvl <= 2 and lvlENNEMI >= 3 then lvlENNEMI = 1
if LvlDONJON >= 2 and lvlENNEMI <= int(5*LvlDONJON) then lvlENNEMI = int(5*LvlDONJON)
pvENNEMI = int(100*lvlENNEMI)
pvTOTALennemi = pvENNEMI
atkENNEMI = int(10*lvlENNEMI)
defENNEMI = int(5*lvlENNEMI)
if LvlDONJON >= 5 then
    pvENNEMI = int(500*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(100*lvlENNEMI)
    defENNEMI = int(10*lvlENNEMI)
end if
if LvlDONJON >= 10 then
    pvENNEMI = int(1000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(200*lvlENNEMI)
    defENNEMI = int(20*lvlENNEMI)
end if
if LvlDONJON >= 15 then
    pvENNEMI = int(1500*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(300*lvlENNEMI)
    defENNEMI = int(40*lvlENNEMI)
end if
if LvlDONJON >= 20 then
    pvENNEMI = int(2000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(400*lvlENNEMI)
    defENNEMI = int(60*lvlENNEMI)
end if
if LvlDONJON >= 25 then
    pvENNEMI = int(2500*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(500*lvlENNEMI)
    defENNEMI = int(80*lvlENNEMI)
end if
if LvlDONJON >= 30 then
    pvENNEMI = int(3000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(600*lvlENNEMI)
    defENNEMI = int(100*lvlENNEMI)
end if
if LvlDONJON >= 35 then
    pvENNEMI = int(3500*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(700*lvlENNEMI)
    defENNEMI = int(135*lvlENNEMI)
end if
if LvlDONJON >= 40 then
    pvENNEMI = int(4000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(800*lvlENNEMI)
    defENNEMI = int(150*lvlENNEMI)
end if
if LvlDONJON >= 45 then
    pvENNEMI = int(5000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(1000*lvlENNEMI)
    defENNEMI = int(200*lvlENNEMI)
end if
if LvlDONJON >= 50 then
    pvENNEMI = int(10000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(300*lvlENNEMI)*LvlDONJON
    defENNEMI = int(400*lvlENNEMI)
end if
if LvlDONJON >= 55 then
    pvENNEMI = int(14000*lvlENNEMI)*LvlDONJON
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(350*lvlENNEMI)*LvlDONJON
    defENNEMI = int(600*lvlENNEMI)
end if
if LvlDONJON >= 60 then
    pvENNEMI = int(21000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(400*lvlENNEMI)*LvlDONJON
    defENNEMI = int(800*lvlENNEMI)
end if
if LvlDONJON >= 65 then
    pvENNEMI = int(32000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(500*lvlENNEMI)*LvlDONJON
    defENNEMI = int(1000*lvlENNEMI)
end if
if LvlDONJON >= 70 then
    pvENNEMI = int(40000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(600*lvlENNEMI)*LvlDONJON
    defENNEMI = int(1500*lvlENNEMI)
end if
if LvlDONJON >= 75 then
    pvENNEMI = int(55000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(600*lvlENNEMI)*LvlDONJON
    defENNEMI = int(2000*lvlENNEMI)
end if
if LvlDONJON >= 80 then
    pvENNEMI = int(70000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(600*lvlENNEMI)*LvlDONJON
    defENNEMI = int(2500*lvlENNEMI)
end if
if LvlDONJON >= 85 then
    pvENNEMI = int(85000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(750*lvlENNEMI)*LvlDONJON
    defENNEMI = int(3000*lvlENNEMI)
end if
if LvlDONJON >= 90 then
    pvENNEMI = int(100000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(1000*lvlENNEMI)*LvlDONJON
    defENNEMI = int(4000*lvlENNEMI)
end if
if LvlDONJON >= 95 then
    pvENNEMI = int(140000*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(1500*lvlENNEMI)*LvlDONJON
    defENNEMI = int(5000*lvlENNEMI)
end if
xpENNEMI = int(rnd(1)*(pvTOTALennemi)+(pvTOTALennemi/2))
moneyENNEMI = int((rnd(1)*(pvTOTALennemi)+(pvTOTALennemi/lvlENNEMI))/2)

if LvlDONJON > 100 then
    compteurDANStonCUL = compteurDANStonCUL + 1
    lvlENNEMI = int(rnd(1)*(12*LvlDONJON)+1)
    pvENNEMI = int(lvlENNEMI*lvlENNEMI*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(lvlENNEMI*lvlENNEMI*lvlENNEMI)
    defENNEMI = int(lvlENNEMI*lvlENNEMI*lvlENNEMI)
    xpENNEMI = int(rnd(1)*(pvTOTALennemi)+(pvTOTALennemi/2))
    moneyENNEMI = int(pvTOTALennemi/2)
    if compteurDANStonCUL = 25 then
        compteurDANStonCUL = 0
        lvlENNEMI = int(rnd(1)*(40*LvlDONJON)+1)
        pvENNEMI = int(lvlENNEMI*lvlENNEMI*lvlENNEMI)
        pvTOTALennemi = pvENNEMI
        atkENNEMI = int(lvlENNEMI*lvlENNEMI*lvlENNEMI)
        defENNEMI = int(lvlENNEMI*lvlENNEMI*lvlENNEMI)
        xpENNEMI = int(rnd(1)*(pvTOTALennemi)+(pvTOTALennemi/2))
        moneyENNEMI = int(pvTOTALennemi/2)
    end if
end if
if defENNEMI < 0 then defENNEMI = 1



if version = 1 and lvlENNEMI>=1 and lvlENNEMI<=15 then nameEnnemy$ = "Sanglier"
if version = 2 and lvlENNEMI>=1 and lvlENNEMI<=15 then nameEnnemy$ = "Boar"
if version = 1 and lvlENNEMI>=16 and lvlENNEMI<=30 then nameEnnemy$ = "Gobelin"
if version = 2 and lvlENNEMI>=16 and lvlENNEMI<=30 then nameEnnemy$ = "Gobelin"
if version = 1 and lvlENNEMI>=31 and lvlENNEMI<=45 then nameEnnemy$ = "Araigné géante"
if version = 2 and lvlENNEMI>=31 and lvlENNEMI<=45 then nameEnnemy$ = "Giant Spider"
if version = 1 and lvlENNEMI>=46 and lvlENNEMI<=60 then nameEnnemy$ = "Plante carnivore géante"
if version = 2 and lvlENNEMI>=46 and lvlENNEMI<=60 then nameEnnemy$ = "Giant carnivorous plant"
if version = 1 and lvlENNEMI>=61 and lvlENNEMI<=75 then nameEnnemy$ = "Mort-vivant"
if version = 2 and lvlENNEMI>=61 and lvlENNEMI<=75 then nameEnnemy$ = "Undead"
if version = 1 and lvlENNEMI>=76 and lvlENNEMI<=90 then nameEnnemy$ = "Champion centaure"
if version = 2 and lvlENNEMI>=76 and lvlENNEMI<=90 then nameEnnemy$ = "Centaur champion"
if version = 1 and lvlENNEMI>=91 and lvlENNEMI<=105 then nameEnnemy$ = "Golem géant"
if version = 2 and lvlENNEMI>=91 and lvlENNEMI<=105 then nameEnnemy$ = "Giant golem"
if version = 1 and lvlENNEMI>=106 and lvlENNEMI<=120 then nameEnnemy$ = "Phénix" 'and lvlENNEMI<=80
if version = 2 and lvlENNEMI>=71 and lvlENNEMI<=120 then nameEnnemy$ = "Pheonix" 'and lvlENNEMI<=80
if version = 1 and lvlENNEMI>=121 then nameEnnemy$ = "Dragon rouge"
if version = 2 and lvlENNEMI>=121 then nameEnnemy$ = "Red dragon"
'if version = 1 and lvlENNEMI>=91 and lvlENNEMI<=99 then nameEnnemy$ = "Titan"
'if version = 2 and lvlENNEMI>=91 and lvlENNEMI<=99 then nameEnnemy$ = "Titan"
'if version = 1 and lvlENNEMI>=100 then nameEnnemy$ = "Gardien d'aincrad"
'if version = 2 and lvlENNEMI>=100 then nameEnnemy$ = "Guardian Aincrad"
'if version = 1 and lvlENNEMI>=110 then nameEnnemy$ = "Titan d'élite"
'if version = 2 and lvlENNEMI>=110 then nameEnnemy$ = "Elite Titan"
'if version = 1 and lvlENNEMI>=120 then nameEnnemy$ = "Phénix divin"
'if version = 2 and lvlENNEMI>=120 then nameEnnemy$ = "Divin pheonix"
'if version = 1 and lvlENNEMI>=130 then nameEnnemy$ = "Dragon vert"
'if version = 2 and lvlENNEMI>=130 then nameEnnemy$ = "Green dragon"
'if version = 1 and lvlENNEMI>=140 then nameEnnemy$ = "Dragon noir"
'if version = 2 and lvlENNEMI>=140 then nameEnnemy$ = "Black dragon"
'if version = 1 and lvlENNEMI>150 then nameEnnemy$ = "Vieux Gardien d'aincrad"
'if version = 2 and lvlENNEMI>150 then nameEnnemy$ = "Old Guardian of Aincrad"


[Arena]
timer 0
if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
action = 0
donjon = 0
SECUmusic = 0
close #main
WindowWidth = 800 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight
ennemiX = 520 : ennemiY = 40
open "Sword Art Online : Ascension [Build ";Version$;"] " for window_nf as #main
#main, "trapclose [quit]"
#main.map , "backcolor white"
#main.map , "down"
#main.map, "drawbmp foret1 0 0"
#main.map,"background foret1"
#main.map, "when leftButtonDown [SimpleClickDONJON]"
#main.map,"addsprite barre barre"
#main.map,"spritexy barre 515 375"
#main.map,"addsprite barre2 barre2"
#main.map,"spritexy barre2 17 24"
#main.map,"addsprite fuir fuir"
#main.map,"spritexy fuir 244 496"
#main.map,"addsprite attaquer attaquer"
#main.map,"spritexy attaquer 302 425"

if sexe = 1 then
    if campagne$= "Warrior" then
        #main.map,"addsprite guerrierHOMME guerrierHOMME"
        #main.map,"spritexy guerrierHOMME 50 337"
    end if
    if campagne$= "Tank" then
        #main.map,"addsprite tankHOMME tankHOMME"
        #main.map,"spritexy tankHOMME 50 340"
    end if
    if campagne$= "Archer" then
        #main.map,"addsprite archerHOMME archerHOMME"
        #main.map,"spritexy archerHOMME 50 294"
    end if
    if campagne$= "HEALER" then
        #main.map,"addsprite mageHOMME mageHOMME"
        #main.map,"spritexy mageHOMME 50 358"
    end if
    if campagne$= "Artisan" then
        #main.map,"addsprite artisanHOMME artisanHOMME"
        #main.map,"spritexy artisanHOMME 50 358"
    end if
end if

if sexe = 2 then
    if campagne$= "Warrior" then
        #main.map,"addsprite guerrierFEMME guerrierFEMME"
        #main.map,"spritexy guerrierFEMME 50 363"
    end if
    if campagne$= "Tank" then
        #main.map,"addsprite tankFEMME tankFEMME"
        #main.map,"spritexy tankFEMME 50 365"
    end if
    if campagne$= "Archer" then
        #main.map,"addsprite archerFEMME archerFEMME"
        #main.map,"spritexy archerFEMME 50 361"
    end if
    if campagne$= "Artisan" then
        #main.map,"addsprite artisanFEMME artisanFEMME"
        #main.map,"spritexy artisanFEMME 50 361"
    end if
    if campagne$= "HEALER" then
        #main.map,"addsprite mageFEMME mageFEMME"
        #main.map,"spritexy mageFEMME 50 368"
    end if
end if

if nameEnnemy$ = "Sanglier" or nameEnnemy$ ="Boar" then
    if sanglier = 0 then sanglier = int(rnd(1)*2+1)
    if sanglier = 1 then
        #main.map,"addsprite sanglier1 sanglier1"
        #main.map,"spritexy sanglier1 ";ennemiX-15;" ";ennemiY+150
    end if
    if sanglier = 2 then
        #main.map,"addsprite sanglier2 sanglier2"
        #main.map,"spritexy sanglier2 ";ennemiX;" ";ennemiY+188
    end if
end if

if nameEnnemy$ = "Gobelin" then
    if Gobelin = 0 then Gobelin = int(rnd(1)*6+1)
    if Gobelin = 1 then
        #main.map,"addsprite gobelin1 gobelin1"
        #main.map,"spritexy gobelin1 ";ennemiX+20;" ";ennemiY+190
    end if
    if Gobelin = 2 then
        #main.map,"addsprite gobelin2 gobelin2"
        #main.map,"spritexy gobelin2 480 200"
    end if
    if Gobelin = 3 then
        #main.map,"addsprite gobelin3 gobelin3"
        #main.map,"spritexy gobelin3 480 200"
    end if
    if Gobelin = 4 then
        #main.map,"addsprite gobelin4 gobelin4"
        #main.map,"spritexy gobelin4 480 200"
    end if
    if Gobelin = 5 then
        #main.map,"addsprite gobelin5 gobelin5"
        #main.map,"spritexy gobelin5 480 200"
    end if
    if Gobelin = 6 then
        #main.map,"addsprite gobelin6 gobelin6"
        #main.map,"spritexy gobelin6 500 190"
    end if
end if
if nameEnnemy$ = "Araigné géante" or nameEnnemy$ ="Giant Spider" then
    if araigner = 0 then araigner = int(rnd(1)*5+1)
    if araigner = 1 then
        #main.map,"addsprite araigner1 araigner1"
        #main.map,"spritexy araigner1 ";ennemiX+10;" ";ennemiY+240
    end if
    if araigner = 2 then
        #main.map,"addsprite araigner2 araigner2"
        #main.map,"spritexy araigner2 ";ennemiX+10;" ";ennemiY+230
    end if
    if araigner = 3 then
        #main.map,"addsprite araigner3 araigner3"
        #main.map,"spritexy araigner3 ";ennemiX-50;" ";ennemiY+190
    end if
    if araigner = 4 then
        #main.map,"addsprite araigner4 araigner4"
        #main.map,"spritexy araigner4 ";ennemiX-50;" ";ennemiY+190
    end if
    if araigner = 5 then
        #main.map,"addsprite araigner5 araigner5"
        #main.map,"spritexy araigner5 ";ennemiX-70;" ";ennemiY+200
    end if
end if

if nameEnnemy$ = "Plante carnivore géante" or nameEnnemy$ ="Giant carnivorous plant" then
    if plante = 0 then plante = int(rnd(1)*2+1)
    if plante = 1 then
        #main.map,"addsprite plante1 plante1"
        #main.map,"spritexy plante1 ";ennemiX+10;" ";ennemiY+140
    end if
    if plante = 2 then
        #main.map,"addsprite plante1 plante1"
        #main.map,"spritexy plante1 ";ennemiX+10;" ";ennemiY+140
    end if
end if

if nameEnnemy$ = "Mort-vivant" or nameEnnemy$ = "Undead" then
    if ud = 0 then ud = int(rnd(1)*2+1)
    if ud = 1 then
        #main.map,"addsprite ud1 ud1"
        #main.map,"spritexy ud1 ";ennemiX+10;" ";ennemiY+170
    end if
    if ud = 2 then
        #main.map,"addsprite ud2 ud2"
        #main.map,"spritexy ud2 ";ennemiX+10;" ";ennemiY+170
    end if
end if

if nameEnnemy$ = "Champion centaure" or nameEnnemy$ = "Centaur champion" then
    if centaur = 0 then centaur = int(rnd(1)*1+1)
    if centaur = 1 then
        #main.map,"addsprite centaur1 centaur1"
        #main.map,"spritexy centaur1 ";ennemiX-80;" ";ennemiY+150
    end if
    if centaur = 2 then
        #main.map,"addsprite centaur1 centaur1"
        #main.map,"spritexy centaur1 ";ennemiX+10;" ";ennemiY+170
    end if
end if

if nameEnnemy$ = "Phénix" or nameEnnemy$ = "Pheonix" then
    if Pheonix = 0 then Pheonix = int(rnd(1)*1+1)
    if Pheonix = 1 then
        #main.map,"addsprite phenix1 phenix1"
        #main.map,"spritexy phenix1 ";ennemiX+10;" ";ennemiY+120
    end if
    if Pheonix = 2 then
        #main.map,"addsprite phenix1 phenix1"
        #main.map,"spritexy phenix1 ";ennemiX+10;" ";ennemiY+120
    end if
end if

if nameEnnemy$ = "Golem géant" or nameEnnemy$ = "Giant golem" then
    if golem = 0 then golem = int(rnd(1)*2+1)
    if golem = 1 then
         #main.map,"addsprite golem1 golem1"
        #main.map,"spritexy golem1 ";ennemiX+10;" ";ennemiY+150
    end if
    if golem = 2 then
         #main.map,"addsprite golem2 golem2"
        #main.map,"spritexy golem2 ";ennemiX+10;" ";ennemiY+150
    end if
end if

if nameEnnemy$ = "Dragon rouge" or nameEnnemy$ = "Red dragon" then
    if dragon = 0 then dragon = int(rnd(1)*1+1)
    if dragon = 1 then
        #main.map,"addsprite dragon1 dragon1"
        #main.map,"spritexy dragon1 ";ennemiX-50;" ";ennemiY+80
    end if
end if

MENUmapFIX = 0
#main.map,"addsprite boum boum"
rndX1 = rnd(1)*100+500
rndY1 = rnd(1)*100+200
#main.map,"spritexy boum ";rndX1;" ";rndY1
#main.map,"addsprite boum2 boum2"
#main.map,"spritexy boum2 550 255"
#main.map,"SpriteVisible boum off"
#main.map,"SpriteVisible boum2 off"
#main.map "SetFocus; DrawSprites"

gosub [HPbarreE]
gosub [HPbarre]
gosub [DATAlife]

print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
r = 100 : v =100 : b = 100
print #main.map, "backcolor ";r;" ";v;" ";b
if version = 1 then print #main.map, "place 495 452 ;\"; "Potions de soin :"
if version = 2 then print #main.map, "place 495 452 ;\"; "Healing potions :"
print #main.map, "backcolor white"
print #main.map, "font Times New Roman 8; color black"
if version = 1 then
r = 195 : b = 195 : v = 195
print #main.map, "backcolor white"
print #main.map, "place 256 525 ;\"; "FUIR"
print #main.map, "place 327 465 ;\"; "ATTAQUER"
print #main.map, "font Times New Roman 9"
end if
if version = 2 then
r = 195 : b = 195 : v = 195
print #main.map, "backcolor white"
print #main.map, "place 258 525 ;\"; "EXIT"
print #main.map, "place 335 465 ;\"; "ATTACK"
print #main.map, "font Times New Roman 9"
end if

print #main.map, "font Times New Roman 7; color white"
print #main, "font Times New Roman 11"

r = 136 : b = 136 : v = 136
print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
gosub [reZIZ]
print #main.map, "backcolor ";r;" ";v;" ";b ;"; place 165 65 ;\";pvENNEMI$; " / "; pvTOTALennemi$
print #main.map, "place 665 415 ;\";pv$; " / "; pvTOTAL$;"    "
r = 136 : b = 136 : v = 136
print #main.map, "backcolor ";r;" ";v;" ";b
print #main.map, "font Times New Roman 8; color white"
print #main.map, "place 40 36 ;\"; nameEnnemy$
print #main.map, "place 540 387 ;\"; name$; " - ";RACE$

print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
r = 100 : v =100 : b = 100
print #main.map, "backcolor ";r;" ";v;" ";b
print #main.map, "place 515 510 ;\"; PotionLittleHP;"    "
print #main.map, "place 565 510 ;\"; PotionMediumHP;"    "
print #main.map, "place 610 510 ;\"; PotionBigHP;"    "
print #main.map, "place 660 510 ;\"; PotionBig2HP;"    "
print #main.map, "place 705 510 ;\"; PotionBig3HP;"    "

print #main.map, "flush"
wait

[SimpleClickDONJON]
    mX = MouseX
    mY = MouseY
    if mX>505 and mX<535 and mY>455 and mY<480 then goto [usePotion1]
    if mX>555 and mX<585 and mY>455 and mY<480 then goto [usePotion2]
    if mX>605 and mX<625 and mY>455 and mY<480 then goto [usePotion3]
    if mX>655 and mX<675 and mY>455 and mY<480 then goto [usePotion4]
    if mX>700 and mX<720 and mY>455 and mY<480 then goto [usePotion5]
    if mX>310 and mX<410 and mY>420 and mY<530 then goto [Attaque]
    if mX>245 and mX<295 and mY>495 and mY<535 then
        timer 0
        fuite = int(rnd(1)*10+1)
        gardien = 0
        if fuite = 10 then goto [runUSED]
        fuite = 0
        guard = 0 : dragon = 0 : golem = 0 : Pheonix = 0 : centaur = 0 : ud = 0 : plante = 0 : araigner = 0 : Gobelin = 0 : sanglier = 0
        if donjon = 1 then
           if city = 1 then goto [Arena0SECU]
           if city = 0 then goto [Arena0]
        end if
        if donjon = 0 then goto [Arena0]
    end if
    if arena = 1 then goto [Arena]
    if donjon = 1 then goto [donjon]
wait

[donjon]
timer 0
if MusicSELECT = 1 then playwave "data\sons\hit.wav", async
close #main
WindowWidth = 800 : WindowHeight = 600
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2)
donjon = 1
action = 0
arena = 0
SECUmusic = 0
if version = 1 then nameEnnemy$ = "Garde du donjon"
if version = 2 then nameEnnemy$ = "Guard of dunjeon"

    ennemiX = 520 : ennemiY = 40

gosub [FLOOR2]

if BOSS = 1 then
    defENNEMI = defBOOS
    atkENNEMI = atkBOOS
    pvENNEMI = pvBOOS
    pvTOTALennemi = pvENNEMI
    xpENNEMI = xpBOSS
    moneyENNEMI = moneyBOSS
end if
graphicbox #main.map, 0, 0, WindowWidth, WindowHeight

open "Sword Art Online : Ascension [Build ";Version$;"] " for window_nf as #main
#main, "trapclose [quit]"
#main.map , "backcolor white"
#main.map, "when leftButtonDown [SimpleClickDONJON]"
#main.map , "down"
#main.map, "drawbmp donjon1 0 0"
#main.map,"background donjon1"

#main.map,"addsprite barre barre"
#main.map,"spritexy barre 515 375"
#main.map,"addsprite barre2 barre2"
#main.map,"spritexy barre2 17 24"
#main.map,"addsprite fuir fuir"
#main.map,"spritexy fuir 244 496"
#main.map,"addsprite attaquer attaquer"
#main.map,"spritexy attaquer 302 425"

if sexe = 1 then
    if campagne$= "Warrior" then
        #main.map,"addsprite guerrierHOMME guerrierHOMME"
        #main.map,"spritexy guerrierHOMME 50 337"
    end if
    if campagne$= "Tank" then
        #main.map,"addsprite tankHOMME tankHOMME"
        #main.map,"spritexy tankHOMME 50 340"
    end if
    if campagne$= "Archer" then
        #main.map,"addsprite archerHOMME archerHOMME"
        #main.map,"spritexy archerHOMME 50 294"
    end if
    if campagne$= "HEALER" then
        #main.map,"addsprite mageHOMME mageHOMME"
        #main.map,"spritexy mageHOMME 50 358"
    end if
    if campagne$= "Artisan" then
        #main.map,"addsprite artisanHOMME artisanHOMME"
        #main.map,"spritexy artisanHOMME 50 358"
    end if
end if

if sexe = 2 then
    if campagne$= "Warrior" then
        #main.map,"addsprite guerrierFEMME guerrierFEMME"
        #main.map,"spritexy guerrierFEMME 50 363"
    end if
    if campagne$= "Tank" then
        #main.map,"addsprite tankFEMME tankFEMME"
        #main.map,"spritexy tankFEMME 50 368"
    end if
    if campagne$= "Archer" then
        #main.map,"addsprite archerFEMME archerFEMME"
        #main.map,"spritexy archerFEMME 50 361"
    end if
    if campagne$= "Artisan" then
        #main.map,"addsprite artisanFEMME artisanFEMME"
        #main.map,"spritexy artisanFEMME 50 361"
    end if
    if campagne$= "HEALER" then
        #main.map,"addsprite mageFEMME mageFEMME"
        #main.map,"spritexy mageFEMME 50 368"
    end if
end if

if BOSS = 0 and nameEnnemy$ = "Garde du donjon" or nameEnnemy$ = "Guard of dunjeon" then
    if MENUmapFIX = 0 then guard = int(rnd(1)*2+1)
    if NumberFLOORmonster = 1 then guard = 3
    if guard = 1 then
        #main.map,"addsprite guard1 guard1"
        #main.map,"spritexy guard1 ";ennemiX+70;" ";ennemiY+120
        guard = 0
    end if
    if guard = 2 then
        #main.map,"addsprite guard2 guard2"
        #main.map,"spritexy guard2 ";ennemiX+70;" ";ennemiY+120
        guard = 0
    end if
    if guard = 3 and gardien = 0 then
        gardien = 1
        nameEnnemy$ = "Gardien"
        #main.map,"addsprite gardien gardien"
        #main.map,"spritexy gardien ";ennemiX+40;" ";ennemiY+100
        guard = 0
        if LvlDONJON < 100 then
        lvlENNEMI = int(LvlDONJON*10)
        pvENNEMI = int((100*lvlENNEMI*2)+int(10*lvlENNEMI*LvlDONJON)*3)
        pvTOTALennemi = pvENNEMI
        atkENNEMI = int(23*lvlENNEMI*lvlENNEMI)
        defENNEMI = int(5*lvlENNEMI*lvlENNEMI)
        xpENNEMI = int((rnd(1)*pvTOTALennemi+pvTOTALennemi)*LvlDONJON)
        moneyENNEMI = int((rnd(1)*pvTOTALennemi)*LvlDONJON)
        end if
        if LvlDONJON > 100 then
        lvlENNEMI = int(LvlDONJON*10)
        pvENNEMI = int((200*lvlENNEMI*2)+int(10*lvlENNEMI*LvlDONJON)*3)
        pvTOTALennemi = pvENNEMI
        atkENNEMI = int(50*lvlENNEMI*lvlENNEMI)
        defENNEMI = int(10*lvlENNEMI*lvlENNEMI)
        xpENNEMI = int((rnd(1)*pvTOTALennemi+pvTOTALennemi)*LvlDONJON)
        moneyENNEMI = int((rnd(1)*pvTOTALennemi)*LvlDONJON)
        end if
    end if
end if

'BOSS = 1 : LvlDONJON = 12
if BOSS = 1 then
    if LvlDONJON = 1 then
        nameEnnemy$ = "BOSS : Hulk'ar, le ravageur"
        #main.map,"addsprite boss1 boss1"
        #main.map,"spritexy boss1 ";ennemiX+40;" ";ennemiY+100
    end if
    if LvlDONJON = 2 then
        nameEnnemy$ = "BOSS : Hendrax l'Egorgeur"
        #main.map,"addsprite boss2 boss2"
        #main.map,"spritexy boss2 ";ennemiX+40;" ";ennemiY+60
    end if
    if LvlDONJON = 3 then
        nameEnnemy$ = "BOSS : Titanos le puissant"
        #main.map,"addsprite boss3 boss3"
        #main.map,"spritexy boss3 ";ennemiX;" ";ennemiY+40
    end if
    if LvlDONJON = 4 then
        nameEnnemy$ = "BOSS : Tengû le divin"
        #main.map,"addsprite boss4 boss4"
        #main.map,"spritexy boss4 ";ennemiX;" ";ennemiY+40
    end if
    if LvlDONJON = 5 then
        nameEnnemy$ = "BOSS : Nirull le roi déchu"
        #main.map,"addsprite boss5 boss5"
        #main.map,"spritexy boss5 ";ennemiX-20;" ";ennemiY+40
    end if
    if LvlDONJON = 6 then
        nameEnnemy$ = "BOSS : Nabasu le vengeur"
        #main.map,"addsprite boss6 boss6"
        #main.map,"spritexy boss6 ";ennemiX-85;" ";ennemiY+20
    end if
    if LvlDONJON = 7 then
        nameEnnemy$ = "BOSS : Daageros le seigneur des lames"
        #main.map,"addsprite boss7 boss7"
        #main.map,"spritexy boss7 ";ennemiX-40;" ";ennemiY+10
    end if
    if LvlDONJON = 8 then
        nameEnnemy$ = "BOSS : Agamemnon le chevaucheur du chaos"
        #main.map,"addsprite boss8 boss8"
        #main.map,"spritexy boss8 ";ennemiX-120;" ";ennemiY+10
    end if
    if LvlDONJON = 9 then
        nameEnnemy$ = "BOSS : Titanos, titan des 5 mondes"
        #main.map,"addsprite boss9 boss9"
        #main.map,"spritexy boss9 ";ennemiX-10;" ";ennemiY-22
    end if
    if LvlDONJON = 10 then
        nameEnnemy$ = "BOSS : Tholrilk, ancien dieu déchu"
        #main.map,"addsprite boss10 boss10"
        #main.map,"spritexy boss10 ";ennemiX+10;" ";ennemiY-95
    end if
    if LvlDONJON = 11 then
        nameEnnemy$ = "BOSS : Itara, tueur de faux dieux"
        #main.map,"addsprite boss11 boss11"
        #main.map,"spritexy boss11 ";ennemiX+35;" ";ennemiY-20
    end if
    if LvlDONJON = 12 then
        nameEnnemy$ = "BOSS : OULRAK, le marteleur de crâne"
        #main.map,"addsprite boss12 boss12"
        #main.map,"spritexy boss12 ";ennemiX+10;" ";ennemiY-80
    end if
    if LvlDONJON > 12 then
        nameEnnemy$ = "BOSS"
        #main.map,"addsprite boss1 boss1"
        #main.map,"spritexy boss1 ";ennemiX+40;" ";ennemiY+100
    end if
end if

#main.map,"addsprite boum boum"
rndX1 = rnd(1)*100+600
rndY1 = rnd(1)*100+150
#main.map,"spritexy boum ";rndX1;" ";rndY1
#main.map,"addsprite boum2 boum2"
#main.map,"spritexy boum2 600 200"
#main.map,"SpriteVisible boum off"
#main.map,"SpriteVisible boum2 off"
#main.map "SetFocus; DrawSprites"

gosub [HPbarreE]
gosub [HPbarre]
gosub [DATAlife]

if version = 1 then floor$ = "PALIER ";LvlDONJON
if version = 2 then floor$ = "FLOOR ";LvlDONJON

print #main.map, "font Times New Roman 7; color white"
print #main, "font Times New Roman 11"
r = 136 : b = 136 : v = 136
print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
gosub [reZIZ]
print #main.map, "backcolor ";r;" ";v;" ";b ;"; place 165 65 ;\";pvENNEMI$; " / "; pvTOTALennemi$
print #main.map, "place 665 415 ;\";pv$; " / "; pvTOTAL$;"    "
print #main.map, "font Times New Roman 8; color white"
if BOSS = 0 then print #main.map, "place 40 36 ;\"; nameEnnemy$ ; " [";floor$;"] Ennemis : ";NumberFLOORmonster
if BOSS = 1 and LvlDONJON <100 then print #main.map, "place 40 36 ;\"; nameEnnemy$ ; " [";floor$;"]"
print #main.map, "place 540 387 ;\"; name$; " - ";RACE$
print #main.map, "font Times New Roman 7; color white"
if BOSS = 0 or arena = 1 then print #main.map, "place 238 65 ;\"; "lv."; lvlENNEMI
print #main.map, "place 738 416 ;\"; "lv."; lvl
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
r = 100 : v =100 : b = 100
print #main.map, "backcolor ";r;" ";v;" ";b
if version = 1 then print #main.map, "place 495 452 ;\"; "Potions de soins :"
if version = 2 then print #main.map, "place 495 452 ;\"; "Healing potions :"
print #main.map, "backcolor white; color black"
if version = 1 then
r = 195 : b = 195 : v = 195
print #main.map, "backcolor white"
print #main.map, "place 256 525 ;\"; "FUIR"
print #main.map, "place 327 465 ;\"; "ATTAQUER"
print #main.map, "font Times New Roman 9"
end if
if version = 2 then
r = 195 : b = 195 : v = 195
print #main.map, "backcolor white"
print #main.map, "place 258 525 ;\"; "EXIT"
print #main.map, "place 335 465 ;\"; "ATTACK"
print #main.map, "font Times New Roman 9"
end if
print #main.map, "font Times New Roman 7; color black"
if BOSS = 1 and LvlDONJON = 100 then
    r = 136 : b = 136 : v = 136
    print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
    print #main.map, "place 40 35 ;\"; "ULTIMATE BOSS : HEATHCLIFF "
end if
print #main.map, "backcolor black;font Times New Roman 8; color white"
r = 100 : v =100 : b = 100
print #main.map, "backcolor ";r;" ";v;" ";b
print #main.map, "place 515 510 ;\"; PotionLittleHP;"    "
print #main.map, "place 565 510 ;\"; PotionMediumHP;"    "
print #main.map, "place 610 510 ;\"; PotionBigHP;"    "
print #main.map, "place 660 510 ;\"; PotionBig2HP;"    "
print #main.map, "place 705 510 ;\"; PotionBig3HP;"    "
print #main.map, "backcolor white;font Times New Roman 10; color black"
wait

[HPbarreE]
r = 99 : v = 175 : b = 13
print #main.map, "size 9; color ";r;" ";v;" ";b
if pvENNEMI<= INT((pvTOTALennemi/100)*60) then print #main.map, "size 9; color ";255;" ";113;" ";17
if pvENNEMI<= INT((pvTOTALennemi/100)*20) then print #main.map, "size 9; color ";217;" ";17;" ";27
print #main.map, "line "; 50; " "; 50; " "; 250; " "; 50
return

[HPbarre]
r = 99 : v = 175 : b = 13
if arena = 1 or donjon = 1 then
print #main.map, "size 9; color ";r;" ";v;" ";b
if pv<= INT((pvTOTAL/100)*60) then print #main.map, "size 9; color ";255;" ";113;" ";17
if pv<= INT((pvTOTAL/100)*20) then print #main.map, "size 9; color ";217;" ";17;" ";27
print #main.map, "line "; 550; " "; 400; " "; 750; " "; 400
end if
if arena = 0 and donjon = 0 then
print #main.map, "size 9; color ";r;" ";v;" ";b
if pv<= INT((pvTOTAL/100)*60) then print #main.map, "size 9; color ";255;" ";113;" ";17
if pv<= INT((pvTOTAL/100)*20) then print #main.map, "size 9; color ";217;" ";17;" ";27
print #main.map, "line "; 550; " "; 50; " "; 750; " "; 50
end if
return


    [restorBarreHpE]
    print #main.map, "font Times New Roman 7; color white"
    r = 136 : b = 136 : v = 136
    print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
    gosub [reZIZ]
    print #main.map, "backcolor ";r;" ";v;" ";b ;"; place 165 65 ;\";pvENNEMI$; " / "; pvTOTALennemi$;"        "
    if BOSS = 0 or arena = 1 then print #main.map, "place 238 65 ;\"; "lv."; lvlENNEMI
    return

    [restorBarreHp]
    gosub [reZIZ]
    if arena = 0 and donjon = 0 then
        r = 136 : b = 136 : v = 136
        print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
        print #main.map, "place 665 65 ;\";pv$; " / "; pvTOTAL$;"    "
        print #main.map, "place 738 65 ;\"; "lv."; lvl
        r = 12 : b = 102 : v = 49
        print #main.map, "backcolor ";r;" ";v;" ";b ;"; place 540 35 ;\"; name$
    end if
    if arena = 1 or donjon = 1 then
        r = 136 : b = 136 : v = 136
        print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
        print #main.map, "place 665 415 ;\";pv$; " / "; pvTOTAL$;"    "
        print #main.map, "place 738 415 ;\"; "lv."; lvl
        r = 136 : b = 136 : v = 136
        print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
        print #main.map, "place 680 387 ;\"; "Xp : "; xp$; " / "; xpTOTAL$
        print #main.map, "backcolor ";r;" ";v;" ";b
        print #main.map, "font Times New Roman 8; color white"
        if donjon = 0 then print #main.map, "place 40 36 ;\"; nameEnnemy$
        if BOSS = 0 and donjon = 1 then print #main.map, "place 40 36 ;\"; nameEnnemy$ ; " [";floor$;"] Ennemis : ";NumberFLOORmonster
        if BOSS = 1 and donjon = 1 then print #main.map, "place 40 36 ;\"; nameEnnemy$ ; " [";floor$;"]"
        print #main.map, "place 540 387 ;\"; name$; " - ";RACE$
    end if
    return



[DATAlife]
'ennemi
if arena = 1 or donjon = 1 then
gosub [HPbarreE]
print #main.map, "size 9; color black"
if pvENNEMI< INT((pvTOTALennemi/100)*100) AND pvENNEMI>= INT((pvTOTALennemi/100)*95) then print #main.map, "line "; 250; " "; 50; " "; 240; " "; 50
if pvENNEMI< INT((pvTOTALennemi/100)*95) AND pvENNEMI>= INT((pvTOTALennemi/100)*90) then print #main.map, "line "; 250; " "; 50; " "; 230; " ";50
if pvENNEMI < INT((pvTOTALennemi/100)*90) AND pvENNEMI >= INT((pvTOTALennemi/100)*85) then print #main.map, "line "; 250; " "; 50; " "; 220; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*85) AND pvENNEMI >= INT((pvTOTALennemi/100)*80) then print #main.map, "line "; 250; " "; 50; " "; 210; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*80) AND pvENNEMI >= INT((pvTOTALennemi/100)*75) then print #main.map, "line "; 250; " "; 50; " "; 200; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*75) AND pvENNEMI >= INT((pvTOTALennemi/100)*70) then print #main.map, "line "; 250; " "; 50; " "; 190; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*70) AND pvENNEMI >= INT((pvTOTALennemi/100)*65) then print #main.map, "line "; 250; " "; 50; " "; 180; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*65) AND pvENNEMI >= INT((pvTOTALennemi/100)*70) then print #main.map, "line "; 250; " "; 50; " "; 170; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*70) AND pvENNEMI >= INT((pvTOTALennemi/100)*55) then print #main.map, "line "; 250; " "; 50; " "; 160; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*55) AND pvENNEMI >= INT((pvTOTALennemi/100)*50) then print #main.map, "line "; 250; " "; 50; " "; 150; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*50) AND pvENNEMI >= INT((pvTOTALennemi/100)*45) then print #main.map, "line "; 250; " "; 50; " "; 140; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*45) AND pvENNEMI >= INT((pvTOTALennemi/100)*40) then print #main.map, "line "; 250; " "; 50; " "; 130; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*40) AND pvENNEMI >= INT((pvTOTALennemi/100)*35) then print #main.map, "line "; 250; " "; 50; " "; 120; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*35) AND pvENNEMI >= INT((pvTOTALennemi/100)*30) then print #main.map, "line "; 250; " "; 50; " "; 110; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*30) AND pvENNEMI >= INT((pvTOTALennemi/100)*25) then print #main.map, "line "; 250; " "; 50; " "; 100; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*25) AND pvENNEMI >= INT((pvTOTALennemi/100)*20) then print #main.map, "line "; 250; " "; 50; " "; 90; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*20) AND pvENNEMI >= INT((pvTOTALennemi/100)*15) then print #main.map, "line "; 250; " "; 50; " "; 80; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*15) AND pvENNEMI >= INT((pvTOTALennemi/100)*10) then print #main.map, "line "; 250; " "; 50; " "; 70; " "; 50
if pvENNEMI < INT((pvTOTALennemi/100)*10) AND pvENNEMI >= 1 then print #main.map, "line "; 250; " "; 50; " "; 60; " "; 50
if pvENNEMI <= 0 then print #main.map, "line "; 250; " "; 50; " "; 55; " "; 50
gosub [restorBarreHpE]
end if

'perso
if arena = 1 or donjon = 1 then
gosub [HPbarre]
print #main.map, "size 9; color black"
if pv< pvTOTAL AND pv>= INT((pvTOTAL/100)*95) then print #main.map, "line "; 750; " "; 400; " "; 745; " ";400
if pv< INT((pvTOTAL/100)*95) AND pv>= INT((pvTOTAL/100)*90) then print #main.map, "line "; 750; " "; 400; " "; 740; " ";400
if pv< INT((pvTOTAL/100)*90) AND pv>= INT((pvTOTAL/100)*85) then print #main.map, "line "; 750; " "; 400; " "; 735; " ";400
if pv < INT((pvTOTAL/100)*85) AND pv >= INT((pvTOTAL/100)*80) then print #main.map, "line "; 750; " "; 400; " "; 730; " "; 400
if pv < INT((pvTOTAL/100)*80) AND pv >= INT((pvTOTAL/100)*75) then print #main.map, "line "; 750; " "; 400; " "; 720; " "; 400
if pv < INT((pvTOTAL/100)*75) AND pv >= INT((pvTOTAL/100)*70) then print #main.map, "line "; 750; " "; 400; " "; 710; " "; 400
if pv < INT((pvTOTAL/100)*70) AND pv >= INT((pvTOTAL/100)*65) then print #main.map, "line "; 750; " "; 400; " "; 700; " "; 400
if pv < INT((pvTOTAL/100)*65) AND pv >= INT((pvTOTAL/100)*60) then print #main.map, "line "; 750; " "; 400; " "; 690; " "; 400
if pv < INT((pvTOTAL/100)*60) AND pv >= INT((pvTOTAL/100)*55) then print #main.map, "line "; 750; " "; 400; " "; 680; " "; 400
if pv < INT((pvTOTAL/100)*55) AND pv >= INT((pvTOTAL/100)*50) then print #main.map, "line "; 750; " "; 400; " "; 670; " "; 400
if pv < INT((pvTOTAL/100)*50) AND pv >= INT((pvTOTAL/100)*45) then print #main.map, "line "; 750; " "; 400; " "; 660; " "; 400
if pv < INT((pvTOTAL/100)*45) AND pv >= INT((pvTOTAL/100)*40) then print #main.map, "line "; 750; " "; 400; " "; 650; " "; 400
if pv < INT((pvTOTAL/100)*40) AND pv >= INT((pvTOTAL/100)*35) then print #main.map, "line "; 750; " "; 400; " "; 640; " "; 400
if pv < INT((pvTOTAL/100)*35) AND pv >= INT((pvTOTAL/100)*30) then print #main.map, "line "; 750; " "; 400; " "; 630; " "; 400
if pv < INT((pvTOTAL/100)*30) AND pv >= INT((pvTOTAL/100)*25) then print #main.map, "line "; 750; " "; 400; " "; 620; " "; 400
if pv < INT((pvTOTAL/100)*25) AND pv >= INT((pvTOTAL/100)*20) then print #main.map, "line "; 750; " "; 400; " "; 610; " "; 400
if pv < INT((pvTOTAL/100)*20) AND pv >= INT((pvTOTAL/100)*15) then print #main.map, "line "; 750; " "; 400; " "; 600; " "; 400
if pv < INT((pvTOTAL/100)*15) AND pv >= INT((pvTOTAL/100)*10) then print #main.map, "line "; 750; " "; 400; " "; 590; " "; 400
if pv < INT((pvTOTAL/100)*10) AND pv >= INT((pvTOTAL/100)*05) then print #main.map, "line "; 750; " "; 400; " "; 580; " "; 400
if pv < INT((pvTOTAL/100)*5) AND pv >= INT((pvTOTAL/100)*2) then print #main.map, "line "; 750; " "; 400; " "; 570; " "; 400
if pv <= INT((pvTOTAL/100)*1) then print #main.map, "line "; 750; " "; 400; " "; 560; " "; 400
gosub [restorBarreHp]
end if

if arena = 0 and donjon = 0 then
gosub [HPbarre]
print #main.map, "size 9; color black"
if pv< INT((pvTOTAL/100)*100) AND pv>= INT((pvTOTAL/100)*90) then print #main.map, "line "; 750; " "; 50; " "; 740; " "; 50
if pv < INT((pvTOTAL/100)*90) AND pv >= INT((pvTOTAL/100)*80) then print #main.map, "line "; 750; " "; 50; " "; 740; " "; 50
if pv < INT((pvTOTAL/100)*80) AND pv >= INT((pvTOTAL/100)*70) then print #main.map, "line "; 750; " "; 50; " "; 720; " "; 50
if pv < INT((pvTOTAL/100)*70) AND pv >= INT((pvTOTAL/100)*60) then print #main.map, "line "; 750; " "; 50; " "; 700; " "; 50
if pv < INT((pvTOTAL/100)*60) AND pv >= INT((pvTOTAL/100)*50) then print #main.map, "line "; 750; " "; 50; " "; 680; " "; 50
if pv < INT((pvTOTAL/100)*50) AND pv >= INT((pvTOTAL/100)*40) then print #main.map, "line "; 750; " "; 50; " "; 660; " "; 50
if pv < INT((pvTOTAL/100)*40) AND pv >= INT((pvTOTAL/100)*30) then print #main.map, "line "; 750; " "; 50; " "; 640; " "; 50
if pv < INT((pvTOTAL/100)*30) AND pv >= INT((pvTOTAL/100)*20) then print #main.map, "line "; 750; " "; 50; " "; 620; " "; 50
if pv < INT((pvTOTAL/100)*20) AND pv >= INT((pvTOTAL/100)*10) then print #main.map, "line "; 750; " "; 50; " "; 600; " "; 50
if pv < INT((pvTOTAL/100)*10) AND pv >= INT((pvTOTAL/100)*1) then print #main.map, "line "; 750; " "; 50; " "; 580; " "; 50
if pv <=0 then print #main.map, "line "; 750; " "; 50; " "; 560; " "; 50
gosub [restorBarreHp]
end if
return

[SONGbattle]
on error goto [w]
if MusicSELECT = 1 then
    select case TYPEatkEQUIP$
    case "Mortier","Mortar"
        playwave "data\sons\hit7.wav", async
    case ""
        playwave "data\sons\hit0.wav", async
    case "Sling","Spear +25%","Spear","Arc","Arbalète", "Javelot", "Fronde","Arc +25%","Arbalète +25%", "Javelot +25%","Fronde +25%"
        playwave "data\sons\hit2.wav", async
    case "Hatchet +25%","Saber","Heavy ax +25%","Heavy ax","Sword +25%","Sword","Saber +25%","Knife +25%","Double swords","Double swords +25%","Knife","Hachette +25%","Hatchet","Hachette","Epée","Hache lourde","Lance","Sabre","Katana","Coûteau","Double épées","Epée +25%","Hache lourde +25%","Lance +25%","Sabre +25%","Katana +25%","Coûteau +25%","Double épées +25%"
        playwave "data\sons\hit1.wav", async
    case "Bâton","Hammer +25%","Hammer","Mass","Mass +25%","Masse","Marteau","Stick","Stick +25%","Bâton +25%","Masse +25%","Marteau +25%"
        playwave "data\sons\hit3.wav", async
    end select
end if
return


[usePotion1]
if pv = pvTOTAL or PotionLittleHP = 0 then wait
if MusicSELECT = 1 then playwave "data\sons\heal.wav", async
PotionLittleHP = PotionLittleHP -1
pv = int((pv + (pvTOTAL/10)) + 1 * pmTOTAL)
if pv > pvTOTAL then pv = pvTOTAL
gosub [HPbarre]
gosub [DATAlife]
gosub [reZIZ]
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
r = 100 : v =100 : b = 100
print #main.map, "backcolor ";r;" ";v;" ";b
print #main.map, "place 515 510 ;\"; PotionLittleHP;"    "
print #main.map, "place 565 510 ;\"; PotionMediumHP;"    "
print #main.map, "place 610 510 ;\"; PotionBigHP;"    "
print #main.map, "place 660 510 ;\"; PotionBig2HP;"    "
print #main.map, "place 705 510 ;\"; PotionBig3HP;"    "
print #main, "font Times New Roman 11;color white"
print #main.map, "font Times New Roman 7"
r = 136 : b = 136 : v = 136
print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
print #main.map, "backcolor ";r;" ";v;" ";b ;"; place 165 65 ;\";pvENNEMI$; " / "; pvTOTALennemi$
print #main.map, "place 665 415 ;\";pv$; " / "; pvTOTAL$;"    "
print #main.map, "backcolor white; color black;font Times New Roman 10"
if BOSS = 0 then print #main.map, "place 60 75 ;\"; alifeE$
if BOSS = 1 and donjon = 1 then
    if LvlDONJON = 100 then r = 136 : b = 136 : v = 136
    print #main.map, "backcolor ";r;" ";v;" ";b
    print #main.map, "place 235 66 ;\"; "          "
    print #main.map, "backcolor white"
    r = 136 : b = 136 : v = 136
    print #main.map, "backcolor ";r;" ";v;" ";b
    print #main.map, "place 235 66 ;\"; "          "
    print #main.map, "backcolor white"
end if
goto [potionUSED]


[usePotion2]
if pv = pvTOTAL or PotionMediumHP = 0 then wait
if MusicSELECT = 1 then playwave "data\sons\heal.wav", async
PotionMediumHP = PotionMediumHP -1
pv = int((pv + (pvTOTAL/4)) + 2 * pmTOTAL)
if pv > pvTOTAL then pv = pvTOTAL
gosub [HPbarre]
gosub [DATAlife]
gosub [reZIZ]
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
r = 100 : v =100 : b = 100
print #main.map, "backcolor ";r;" ";v;" ";b
print #main.map, "place 515 510 ;\"; PotionLittleHP;"    "
print #main.map, "place 565 510 ;\"; PotionMediumHP;"    "
print #main.map, "place 610 510 ;\"; PotionBigHP;"    "
print #main.map, "place 660 510 ;\"; PotionBig2HP;"    "
print #main.map, "place 705 510 ;\"; PotionBig3HP;"    "
print #main, "font Times New Roman 11;color white"
print #main.map, "font Times New Roman 7"
r = 136 : b = 136 : v = 136
print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
print #main.map, "backcolor ";r;" ";v;" ";b ;"; place 165 65 ;\";pvENNEMI$; " / "; pvTOTALennemi$
print #main.map, "place 665 415 ;\";pv$; " / "; pvTOTAL$;"    "
print #main.map, "backcolor white; color black;font Times New Roman 10"
if BOSS = 0 then print #main.map, "place 60 75 ;\"; alifeE$
if BOSS = 1 and donjon = 1 then
    r = 136 : b = 136 : v = 136
    print #main.map, "backcolor ";r;" ";v;" ";b
    print #main.map, "place 235 66 ;\"; "          "
    print #main.map, "backcolor white"
    if LvlDONJON = 100 then
    r = 136 : b = 136 : v = 136
    print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
    print #main.map, "place 40 35 ;\"; "ULTIMATE BOSS : HEATHCLIFF "
    end if
end if
goto [potionUSED]

[usePotion3]
if pv = pvTOTAL or PotionBigHP = 0 then wait
if MusicSELECT = 1 then playwave "data\sons\heal.wav", async
PotionBigHP = PotionBigHP -1
pv = int((pv + (pvTOTAL/2)) + 3 * pmTOTAL)
if pv > pvTOTAL then pv = pvTOTAL
gosub [HPbarre]
gosub [DATAlife]
gosub [reZIZ]
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
r = 100 : v =100 : b = 100
print #main.map, "backcolor ";r;" ";v;" ";b
print #main.map, "place 515 510 ;\"; PotionLittleHP;"    "
print #main.map, "place 565 510 ;\"; PotionMediumHP;"    "
print #main.map, "place 610 510 ;\"; PotionBigHP;"    "
print #main.map, "place 660 510 ;\"; PotionBig2HP;"    "
print #main.map, "place 705 510 ;\"; PotionBig3HP;"    "

print #main, "font Times New Roman 11;color white"
r = 136 : b = 136 : v = 136
print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
print #main.map, "place 165 65 ;\";pvENNEMI$; " / "; pvTOTALennemi$
print #main.map, "place 665 415 ;\";pv$; " / "; pvTOTAL$;"    "
print #main.map, "backcolor white;font Times New Roman 10; color black"
if BOSS = 0 then print #main.map, "place 60 75 ;\"; alifeE$
if BOSS = 1 and donjon = 1 then
    r = 136 : b = 136 : v = 136
    print #main.map, "backcolor ";r;" ";v;" ";b
    print #main.map, "place 235 66 ;\"; "          "
    print #main.map, "backcolor white"
    if LvlDONJON = 100 then
    r = 136 : b = 136 : v = 136
    print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
    print #main.map, "place 40 35 ;\"; "ULTIMATE BOSS : HEATHCLIFF "
    end if
end if
goto [potionUSED]

[usePotion4]
if pv = pvTOTAL or PotionBig2HP = 0 then wait
if MusicSELECT = 1 then playwave "data\sons\heal.wav", async
PotionBig2HP = PotionBig2HP -1
pv = int((pv + ((pvTOTAL/4)*3))+ 4 * pmTOTAL)
if pv > pvTOTAL then pv = pvTOTAL
gosub [HPbarre]
gosub [DATAlife]
gosub [reZIZ]
print #main.map, "backcolor black;font Times New Roman 8; color white"
r = 100 : v =100 : b = 100
print #main.map, "backcolor ";r;" ";v;" ";b
print #main.map, "place 515 510 ;\"; PotionLittleHP;"    "
print #main.map, "place 565 510 ;\"; PotionMediumHP;"    "
print #main.map, "place 610 510 ;\"; PotionBigHP;"    "
print #main.map, "place 660 510 ;\"; PotionBig2HP;"    "
print #main.map, "place 705 510 ;\"; PotionBig3HP;"    "
print #main, "font Times New Roman 11;color white"
r = 136 : b = 136 : v = 136
print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
print #main.map, "place 165 65 ;\";pvENNEMI$; " / "; pvTOTALennemi$
print #main.map, "place 665 415 ;\";pv$; " / "; pvTOTAL$;"    "
print #main.map, "backcolor white;font Times New Roman 10; color black"
if BOSS = 0 then print #main.map, "place 60 75 ;\"; alifeE$
if BOSS = 1 and donjon = 1 then
    r = 136 : b = 136 : v = 136
    print #main.map, "backcolor ";r;" ";v;" ";b
    print #main.map, "place 235 66 ;\"; "          "
    print #main.map, "backcolor white"
    if LvlDONJON = 100 then
    r = 136 : b = 136 : v = 136
    print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
    print #main.map, "place 40 35 ;\"; "ULTIMATE BOSS : HEATHCLIFF "
    end if
end if
goto [potionUSED]

[usePotion5]
if pv = pvTOTAL or PotionBig3HP = 0 then wait
if MusicSELECT = 1 then playwave "data\sons\heal.wav", async
PotionBig3HP = PotionBig3HP -1
pv = pvTOTAL
gosub [HPbarre]
gosub [DATAlife]
gosub [reZIZ]
print #main.map, "backcolor black;font Times New Roman 8; color white"
r = 100 : v =100 : b = 100
print #main.map, "backcolor ";r;" ";v;" ";b
print #main.map, "place 515 510 ;\"; PotionLittleHP;"    "
print #main.map, "place 565 510 ;\"; PotionMediumHP;"    "
print #main.map, "place 610 510 ;\"; PotionBigHP;"    "
print #main.map, "place 660 510 ;\"; PotionBig2HP;"    "
print #main.map, "place 705 510 ;\"; PotionBig3HP;"    "
print #main, "font Times New Roman 11;color white"
r = 136 : b = 136 : v = 136
print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
print #main.map, "backcolor ";r;" ";v;" ";b ;"; place 165 65 ;\";pvENNEMI$; " / "; pvTOTALennemi$
print #main.map, "place 665 415 ;\";pv$; " / "; pvTOTAL$;"    "
print #main.map, "backcolor white;font Times New Roman 10; color black"
if BOSS = 0 then print #main.map, "place 60 75 ;\"; alifeE$
if BOSS = 1 and donjon = 1 then
    r = 136 : b = 136 : v = 136
    print #main.map, "backcolor ";r;" ";v;" ";b
    print #main.map, "place 235 66 ;\"; "          "
    print #main.map, "backcolor white"
    if LvlDONJON = 100 then
    r = 136 : b = 136 : v = 136
    print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
    print #main.map, "place 40 35 ;\"; "ULTIMATE BOSS : HEATHCLIFF "
    end if
end if
goto [potionUSED]

[Attaque]
if action = 1 then wait
action = 1
if version = 1 then point2vi$ = "PV"
if version = 2 then point2vi$ = "HP"
gosub [SONGbattle]
dommage = int((rnd(atk/2)*int(atk+BONUSatk))-defENNEMI)
if dommage< 0 then dommage = 0
if dommage = 0 then #main.map,"SpriteVisible boum2 on"
if dommage > 0 then #main.map,"SpriteVisible boum on"
#main.map,"drawsprites"
gosub [aniREFRESH1]
pvENNEMI = int(pvENNEMI - dommage)
if pvENNEMI <= 0 then
    pvENNEMI = 0
    gosub [DATAlife]
    goto [ENDattaque]
end if
[runUSED]
dommageE = int((rnd(atkENNEMI/2)*int(atkENNEMI))-def/2)
if dommageE< 0 then dommageE = 0
pv = int(pv - dommageE)
if pv < 0 then pv = 0
gosub [DATAlife]

[potionUSED]
gosub [reZIZ]
r = 136 : b = 136 : v = 136
print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
print #main.map, "backcolor ";r;" ";v;" ";b ;"; place 165 65 ;\";pvENNEMI$; " / "; pvTOTALennemi$;"    "
print #main.map, "place 665 415 ;\";pv$; " / "; pvTOTAL$;"    "
if BOSS = 0 or arena = 1 then print #main.map, "place 238 65 ;\"; "lv."; lvlENNEMI
print #main.map, "place 738 415 ;\"; "lv."; lvl
r = 136 : b = 136 : v = 136
print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
print #main.map, "place 680 387 ;\"; "Xp : "; xp$; " / "; xpTOTAL$
print #main.map, "font Times New Roman 8; color white;backcolor ";r;" ";v;" ";b
if donjon = 0 then print #main.map, "place 40 36 ;\"; nameEnnemy$
if BOSS = 0 and donjon = 1 then print #main.map, "place 40 36 ;\"; nameEnnemy$ ; " [";floor$;"] Ennemis : ";NumberFLOORmonster
if BOSS = 1 and donjon = 1 then print #main.map, "place 40 36 ;\"; nameEnnemy$ ; " [";floor$;"]"
print #main.map, "place 540 387 ;\"; name$; " - ";RACE$
if pv <= 0 then goto [die]
action = 0
timer 150, [ani1]
wait

[ani1]
timer 0
#main.map,"SpriteVisible boum off"
#main.map,"SpriteVisible boum2 off"
#main.map,"drawsprites"
gosub [aniREFRESH1]
wait

[aniREFRESH1]
if donjon = 0 then
    rndX1 = rnd(1)*100+500
    rndY1 = rnd(1)*100+200
end if
if donjon = 1 then
    rndX1 = rnd(1)*100+600
    rndY1 = rnd(1)*100+150
end if
#main.map,"spritexy boum ";rndX1;" ";rndY1
gosub [HPbarreE]
gosub [HPbarre]
gosub [DATAlife]
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
r = 100 : v =100 : b = 100
print #main.map, "backcolor ";r;" ";v;" ";b
if version = 1 then print #main.map, "place 495 452 ;\"; "Potions de soin :"
if version = 2 then print #main.map, "place 495 452 ;\"; "Healing potions :"
print #main.map, "backcolor white"
print #main.map, "font Times New Roman 8; color black"
if version = 1 then
r = 195 : b = 195 : v = 195
print #main.map, "backcolor white"
print #main.map, "place 256 525 ;\"; "FUIR"
print #main.map, "place 327 465 ;\"; "ATTAQUER"
print #main.map, "font Times New Roman 9"
'print #main.map, "place 330 472 ;\"; "(Cliquez ici)"
end if
if version = 2 then
r = 195 : b = 195 : v = 195
print #main.map, "backcolor white"
print #main.map, "place 258 525 ;\"; "EXIT"
print #main.map, "place 335 465 ;\"; "ATTACK"
print #main.map, "font Times New Roman 9"
'print #main.map, "place 335 472 ;\"; "(Click here)"
end if
print #main.map, "font Times New Roman 7; color white"
print #main, "font Times New Roman 11"

r = 136 : b = 136 : v = 136
print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
print #main.map, "backcolor ";r;" ";v;" ";b ;"; place 165 65 ;\";pvENNEMI$; " / "; pvTOTALennemi$;"        "
print #main.map, "place 665 415 ;\";pv$; " / "; pvTOTAL$;"    "
r = 136 : b = 136 : v = 136
print #main.map, "backcolor ";r;" ";v;" ";b
print #main.map, "font Times New Roman 8; color white"
print #main.map, "place 40 36 ;\"; nameEnnemy$
print #main.map, "place 540 387 ;\"; name$; " - ";RACE$
print #main.map, "backcolor black"
print #main.map, "font Times New Roman 8; color white"
r = 100 : v =100 : b = 100
print #main.map, "backcolor ";r;" ";v;" ";b
print #main.map, "place 515 510 ;\"; PotionLittleHP;"    "
print #main.map, "place 565 510 ;\"; PotionMediumHP;"    "
print #main.map, "place 610 510 ;\"; PotionBigHP;"    "
print #main.map, "place 660 510 ;\"; PotionBig2HP;"    "
print #main.map, "place 705 510 ;\"; PotionBig3HP;"    "
return

[die]
timer 0
if sexe = 1 then playwave "data\sons\hitman.wav", async
if sexe = 2 then playwave "data\sons\hitgirl.wav", async
dir$ = "" : file$ = "data\id\Save";name$;".sao"
if fileExist(dir$,file$) = 1 then
    kill "data\id\Save";name$;".sao"
end if
#main.map , "down"
#main.map, "drawbmp over 0 0"
#main.map,"background over"
timer 3000, [ini]
wait

[ENDattaque]
if BOSS = 1 and pv >0 and donjon = 1 then BOSS = 2
r = 136 : b = 136 : v = 136
print #main.map, "font Times New Roman 7; backcolor ";r;" ";v;" ";b ;"; color white"
print #main.map, "place 680 387 ;\"; "Xp : "; xp$; " / "; xpTOTAL$
print #main.map, "backcolor ";r;" ";v;" ";b
print #main.map, "font Times New Roman 8; color white"
print #main.map, "place 540 387 ;\"; name$; " - ";RACE$
print #main.map, "size 5 ; backcolor black ; color white"
GAINxp = int(xpENNEMI+BONUSxp+pmTOTAL)
    if GAINxp < 99999 then GAINxp$ = "";str$(GAINxp)
    if GAINxp > 99999 then GAINxp$ = "";str$(int(GAINxp/1000));" k"
    if GAINxp > 99999999 then GAINxp$ = "";str$(int(GAINxp/1000000));" m"
    if GAINxp > 99999999999 then GAINxp$ = "";str$(int(GAINxp/1000000000));" M"
    if GAINxp > 99999999999999 then GAINxp$ = "";str$(int(GAINxp/1000000000000));" kM"
GAINor = int(moneyENNEMI+BONUSgold)
    if GAINor < 99999 then GAINor$ = "";str$(GAINor)
    if GAINor > 99999 then GAINor$ = "";str$(int(GAINor/1000));" k"
    if GAINor > 99999999 then GAINor$ = "";str$(int(GAINor/1000000));" m"
    if GAINor > 99999999999 then GAINor$ = "";str$(int(GAINor/1000000000));" M"
    if GAINor > 99999999999999 then GAINor$ = "";str$(int(GAINor/1000000000000));" kM"
if version = 1 then print #main.map, "place 300 250 ;\"; "VICTOIRE : + ";GAINxp$;" XP + ";GAINor$;" D'OR"
if version = 2 then print #main.map, "place 300 250 ;\"; "VICTORY : + ";GAINxp$;" XP + ";GAINor$;" GOLD"

gardien = 0
xp = int(xp +xpENNEMI + BONUSxp + pmTOTAL)
if donjon = 1 and BOSS = 2 then playwave "data\sons\hit5.wav", async
[lvlUPsecurity]
if xp >= xpTOTAL then
    gosub[lvlUP]
    if xp >= xpTOTAL then goto [lvlUPsecurity]
end if
money = money +moneyENNEMI + BONUSgold
guard = 0 : dragon = 0 : golem = 0 : Pheonix = 0 : centaur = 0 : ud = 0 : plante = 0 : araigner = 0 : Gobelin = 0 : sanglier = 0
if arena = 1 then
    #main.map, "when leftButtonDown [Arena0REFRESH]"
    timer 1500, [Arena0REFRESH]
    wait
    else
    if donjon = 1 then
        NumberFLOORmonster = NumberFLOORmonster-1
        if BOSS = 2 then
            if LvlDONJON = 100 then
                notice " " + chr$(13) + "You win the game !!! Thx for playing this game !"
            end if
            LvlDONJON = LvlDONJON + 1
            secu1PALLIER = 0
            secu2PALLIER = 0
            gosub [FLOOR]
            #main.map, "when leftButtonDown [GameStartMAINsecu2]"
            timer 2000, [GameStartMAINsecu2]
            wait
        end if
        if NumberFLOORmonster <= 0 then
            BOSS = 1
        end if
        #main.map, "when leftButtonDown [donjon]"
        timer 1500, [donjon]
    end if
end if
wait

[Arena0REFRESH]
action = 0
#main.map, "when leftButtonDown [SimpleClickDONJON]"
goto [Arena0]

[lvlUP]
lvlIND = lvl/10
if lvlIND <1 then lvlIND = 1

select case campagne$
    case "Warrior"
    atk = int(atk + 9)
    def = int(def + 5)
    pv = int(pvTOTAL + 23)
    pm = int(pmTOTAL + 2)
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = lvl +1
    xpTOTAL = int(xpTOTAL + ((100*lvl) * lvlIND) )
    CC = CC + 0.2
    Agility = Agility +4
    Strength = Strength +4
    intelligence = intelligence +1
    PoP = PoP + (int(3+(2*LvlDONJON)-2))
    PoS = PoS + (int(1+(1*LvlDONJON)-1))
    case "Archer"
    atk = int(atk + 31)
    def = int(def + 3)
    pv = int(pvTOTAL + 12)
    pm = int(pmTOTAL + 2)
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = lvl +1
    xpTOTAL = int(xpTOTAL + ((100*lvl) * lvlIND) )
    CC = CC + 0.1
    Agility = Agility +10
    Strength = Strength +2
    intelligence = intelligence +2
    PoP = PoP + (int(3+(2*LvlDONJON)-2))
    PoS = PoS + (int(1+(1*LvlDONJON)-1))
    case "Tank"
    atk = int(atk + 7)
    def = int(def + 4)
    pv = int(pvTOTAL + 41)
    pm = int(pmTOTAL + 1)
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = lvl +1
    xpTOTAL = int(xpTOTAL + ((100*lvl) * lvlIND) )
    CC = CC + 0.5
    Agility = Agility +1
    Strength = Strength +9
    intelligence = intelligence +1
    PoP = PoP + (int(3+(2*LvlDONJON)-2))
    PoS = PoS + (int(1+(1*LvlDONJON)-1))
    case "Artisan"
    atk = int(atk + 8)
    def = int(def + 2)
    pv = int(pvTOTAL + 14)
    pm = int(pmTOTAL + 3)
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = lvl +1
    xpTOTAL = int(xpTOTAL + ((100*lvl) * lvlIND) )
    CC = CC + 0.3
    Agility = Agility +3
    Strength = Strength +3
    intelligence = intelligence +3
    PoP = PoP + (int(3+(2*LvlDONJON)-2))
    PoS = PoS + (int(1+(1*LvlDONJON)-1))
    case "HEALER"
    atk = int(atk + 9)
    def = int(def + 3)
    pv = int(pvTOTAL + 12)
    pm = int(pmTOTAL + 6)
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = lvl +1
    xpTOTAL = int(xpTOTAL + ((100*lvl) * lvlIND) )
    CC = CC + 0.1
    Agility = Agility +1
    Strength = Strength +1
    intelligence = intelligence +6
    PoP = PoP + (int(3+(2*LvlDONJON)-2))
    PoS = PoS + (int(1+(1*LvlDONJON)-1))
end select
return

[data]
select case campagne
    case 1
    Agility = 8
    Strength = 12
    intelligence = 6
    LvlDONJON= 1
    campagne$ = "Warrior"
    atk = int(16+(Strength*2))
    def = int(4+Agility/5)
    pv = int(45+(Strength*4))
    pm = int(5+intelligence/5)
    money = 100
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = 1
    xp = 00
    xpTOTAL = 200
    CC = 6
    PoP = 5
    PoS = 1
    case 2
    Agility = 15
    Strength = 7
    intelligence = 10
    LvlDONJON= 1
    campagne$ = "Archer"
    atk = int(14+(Agility*2))
    def = int(1+Agility/5)
    pv = int(32+(Strength*4))
    pm = int(8+(intelligence/5))
    money = 100
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = 1
    xp = 00
    xpTOTAL = 150
    CC = 10
    PoP = 5
    PoS = 1
    case 3
    Agility = 7
    Strength = 19
    intelligence = 4
    LvlDONJON= 1
    campagne$ = "Tank"
    atk = int(4+(Strength*2))
    def = int(4+Agility/5)
    pv = int(90+Strength*4)
    pm = int(2+intelligence/5)
    money = 100
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = 1
    xp = 00
    xpTOTAL = 300
    CC = 8
    PoP = 5
    PoS = 1
    case 4
    Agility = 6
    Strength = 5
    intelligence = 11
    LvlDONJON= 1
    campagne$ = "Artisan"
    atk = int(4+(intelligence*2))
    def = int(3+Agility/5)
    pv = int(32+(Strength*4))
    pm = int(11+intelligence/5)
    money = 350
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = 1
    xp = 00
    xpTOTAL = 100
    CC = 12
    PoP = 5
    PoS = 1
    case 5
    Agility = 5
    Strength = 5
    intelligence = 16
    LvlDONJON= 1
    campagne$ = "HEALER"
    atk = int(5+intelligence*2)
    def = int(1+Agility/5)
    pv = int(30+Strength*4)
    pm = int(15+intelligence/5)
    money = 200
    pvTOTAL = pv
    pmTOTAL = pm
    lvl = 1
    xp = 00
    xpTOTAL = 150
    CC = 2
    PoP = 5
    PoS = 1
end select
return

[FLOOR]
BOSS = 0
MaxlvlMONSTERbyFLOOR = (LvlDONJON*4)-1
NumberFLOORmonster = 10
[FLOOR2]

lvlENNEMI = int(rnd(1)*LvlDONJON*5)+(LvlDONJON*5)
if lvlENNEMI < LvlDONJON*6 then lvlENNEMI = LvlDONJON*5
lvlBOOS = int(LvlDONJON*20)

if LvlDONJON <= 49 then
    pvENNEMI = int(70*lvlENNEMI*LvlDONJON)+int(10*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(14*lvlENNEMI*LvlDONJON)+int(2*lvlENNEMI)
    defENNEMI = int(8*lvlENNEMI*LvlDONJON)+int(1*lvlENNEMI)
    xpENNEMI = int(rnd(1)*pvTOTALennemi+pvTOTALennemi*LvlDONJON)
    moneyENNEMI = int(rnd(lvlENNEMI)*lvlENNEMI+(lvl*LvlDONJON))*LvlDONJON

    pvBOOS = int(2000*LvlDONJON*lvlBOOS)
    atkBOOS = int(12*LvlDONJON*lvlBOOS)
    defBOOS = int((6*lvlENNEMI)*LvlDONJON)
    xpBOSS = int(5*pvBOOS)
    moneyBOSS = int(3*pvBOOS)
end if

if LvlDONJON >= 50 and LvlDONJON < 75 then
    pvENNEMI = int(150*lvlENNEMI*LvlDONJON)+int(10*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(22*lvlENNEMI*LvlDONJON)+int(2*lvlENNEMI)
    defENNEMI = int(12*lvlENNEMI*LvlDONJON)+int(1*lvlENNEMI)
    xpENNEMI = (int(rnd(1)*pvTOTALennemi+pvTOTALennemi*LvlDONJON))*5
    moneyENNEMI = (int(rnd(lvlENNEMI)*lvlENNEMI+(lvl*LvlDONJON))*LvlDONJON)*3

    pvBOOS = int(5000*LvlDONJON*lvlBOOS)
    atkBOOS = int(30*LvlDONJON*lvlBOOS)
    defBOOS = int((15*lvlENNEMI)*LvlDONJON)
    xpBOSS = int(10*pvBOOS)
    moneyBOSS = int(10*pvBOOS)
end if

if LvlDONJON >= 75 and LvlDONJON <=100 then
    pvENNEMI = int(300*lvlENNEMI*LvlDONJON)+int(10*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(40*lvlENNEMI*LvlDONJON)+int(2*lvlENNEMI)
    defENNEMI = int(20*lvlENNEMI*LvlDONJON)+int(1*lvlENNEMI)
    xpENNEMI = (int(rnd(1)*pvTOTALennemi+pvTOTALennemi*LvlDONJON))*20
    moneyENNEMI = (int(rnd(lvlENNEMI)*lvlENNEMI+(lvl*LvlDONJON))*LvlDONJON)*10

    pvBOOS = int(10000*LvlDONJON*lvlBOOS)
    atkBOOS = int(50*LvlDONJON*lvlBOOS)
    defBOOS = int((30*lvlENNEMI)*LvlDONJON)
    xpBOSS = int(25*pvBOOS)
    moneyBOSS = int(25*pvBOOS)
end if

if LvlDONJON > 100 then
    lvlENNEMI = int(LvlDONJON*10)
    pvENNEMI = int(int(LvlDONJON/2)*lvlENNEMI*lvlENNEMI*lvlENNEMI)
    pvTOTALennemi = pvENNEMI
    atkENNEMI = int(lvlENNEMI*lvlENNEMI*lvlENNEMI)
    defENNEMI = int(lvlENNEMI*lvlENNEMI*lvlENNEMI)
    xpENNEMI = int((rnd(1)*pvTOTALennemi+pvTOTALennemi)*LvlDONJON)
    moneyENNEMI = int(pvTOTALennemi/2)

    lvlBOOS = int(LvlDONJON*10)
    pvBOOS = int(lvlBOOS*lvlBOOS*lvlBOOS*lvlBOOS)
    atkBOOS = int(lvlBOOS*lvlBOOS*lvlBOOS)
    defBOOS = int(lvlBOOS*lvlBOOS*lvlBOOS)
    xpBOSS = int(pvBOOS)
    moneyBOSS = int(pvBOOS)
end if

return

'----sauvegarde-----------------------------------------------------------------------------------------------------------------------|
[save]
open "data\id\Save";name$;".sao" for output as #save
print #save, name$
print #save, mdp$
print #save, MusicSELECT
print #save, version
print #save, langue$
print #save, LvlDONJON
print #save, campagne$
print #save, atk
print #save, def
print #save, pv
print #save, pm
print #save, money
print #save, def
print #save, pv
print #save, pm
print #save, money
print #save, regen
print #save, Tregen
print #save, TPMregen
print #save, pvTOTAL
print #save, pmTOTAL
print #save, PMregen
print #save, lvl
print #save, xp
print #save, xpTOTAL
print #save, CC
print #save, Agility
print #save, Strength
print #save, intelligence
print #save, PoP
print #save, PoS
print #save, NumberFLOORmonster
print #save, BOSS
print #save, RACE$
print #save, capacity$
print #save, lvlPASSIVE1
print #save, lvlPASSIVE2
print #save, lvlPASSIVE3
print #save, lvlPASSIVE4
print #save, lvlPASSIVE5
print #save, lvlPASSIVE6
print #save, BONUSatk
print #save, TYPEatkEQUIP$
print #save, BONUSdef
print #save, TYPEdefEQUIP$
print #save, lvlITEM1
print #save, lvlITEM2
print #save, PotionLittleHP
print #save, PotionMediumHP
print #save, PotionBigHP
print #save, sexe
print #save, BONUSgold
print #save, BONUSxp
print #save, PotionBig2HP
print #save, PotionBig3HP
CLOSE #save

r = 12 : b = 102 : v = 49
print #main.map, "font Times New Roman 12 ; backcolor ";r;" ";v;" ";b ;" color black"
if version = 1 then print #main.map, "place 185 64 ;\"; "Sauvegarde OK"
if version = 2 then print #main.map, "place 185 64 ;\"; "Save data OK"
wait

'----chargement----------------------------------------------------------------------------------------------------------------|
[confirmationC]
if version = 1 then confirm "Voulez vous quitter cette partie pour en charger une autre ?"; load$
if version = 2 then confirm "Do you want to leave this game for load a other ?"; load$
if load$ = "no" then wait
camp = 0
goto [ini]


[load]
dir$ = "" : file$ = "data\id\Save";name$;".sao"
if fileExist(dir$,file$) = 0 then
    if version = 1 then notice " " + chr$(13) + "Aucune partie n'est sauvegardé!"
    if version = 2 then notice " " + chr$(13) + "You have no backup saved!"
    goto [GameStart]
end if
if version = 1 then confirm "Charger votre dernière partie?"; load$
if version = 2 then confirm "Load your last save?"; load$
if load$ = "no" and camp = 0 then goto [GameStart]
if load$ = "no" and camp = 1 then wait
load = 1


[loading1]
achatdefITEM = 0
achatatkITEM = 0
close #main
open "data\id\Save";name$;".sao" for input as #save
input #save, name$
input #save, mdp$
input #save, MusicSELECT
input #save, version
input #save, langue$
input #save, LvlDONJON
input #save, campagne$
input #save, atk
input #save, def
input #save, pv
input #save, pm
input #save, money
input #save, def
input #save, pv
input #save, pm
input #save, money
input #save, regen
input #save, Tregen
input #save, TPMregen
input #save, pvTOTAL
input #save, pmTOTAL
input #save, PMregen
input #save, lvl
input #save, xp
input #save, xpTOTAL
input #save, CC
input #save, Agility
input #save, Strength
input #save, intelligence
input #save, PoP
input #save, PoS
gosub [FLOOR]
input #save, NumberFLOORmonster
input #save, BOSS
input #save, RACE$
input #save, capacity$
input #save, lvlPASSIVE1
input #save, lvlPASSIVE2
input #save, lvlPASSIVE3
input #save, lvlPASSIVE4
input #save, lvlPASSIVE5
input #save, lvlPASSIVE6
input #save, BONUSatk
input #save, TYPEatkEQUIP$
input #save, BONUSdef
input #save, TYPEdefEQUIP$
input #save, lvlITEM1
input #save, lvlITEM2
input #save, PotionLittleHP
input #save, PotionMediumHP
input #save, PotionBigHP
input #save, sexe
input #save, BONUSgold
input #save, BONUSxp
input #save, PotionBig2HP
input #save, PotionBig3HP
CLOSE #save
goto [GameStartMAIN2]

[loading2]
version = 1
langue$ = "Français"
on error goto [loading2END]
open "data\id\Save";name$;".sao" for input as #save
input #save, name$
input #save, mdp$
input #save, MusicSELECT
input #save, version
input #save, langue$
CLOSE #save
[loading2END]
return

'fonctions ----------------------------------
function fileExist(dir$,file$)
    dim info$(10, 10)
    files dir$,file$, info$(
    if val(info$(0, 0)) > 0 then
        fileExist = 1
    else
        fileExist = 0
    end if
end function

    [MusicSELECT]
    if MusicSELECT = 1 then goto [stopMusic]
    MusicSELECT = 1
    goto [refreshSONGtxt]
    [stopMusic]
    MusicSELECT = 0
    [refreshSONGtxt]
if version = 1 and MusicSELECT = 0 then
print #main.map, "place 310 64 ;\"; "Bruitage (Off)                    "
else
    if version = 1 and MusicSELECT = 1 then
    print #main.map, "place 310 64 ;\"; "Bruitage (On)                    "
    end if
end if
if version = 2 and MusicSELECT = 0 then
print #main.map, "place 310 64 ;\"; "Sounds (Off)                    "
else
    if version = 2 and MusicSELECT = 1 then
    print #main.map, "place 310 64 ;\"; "Sounds (On)                    "
    end if
end if
    wait


[quit]
playwave ""
close #main
end
