//MAIN.C runs when Dink is started, right after dink.ini. It also runs when the load_game command is used
void main
{
//These globals are REQUIRED by dink.exe (it directly uses them, removing any of these could result in a game crash.)
make_global_int("&exp",0)
make_global_int("&strength",3)
make_global_int("&defense",0)
make_global_int("&cur_weapon",0)
make_global_int("&cur_magic",0)
make_global_int("&gold",0)
make_global_int("&magic",0)
make_global_int("&magic_level",0)
make_global_int("&vision",0)
make_global_int("&result",0)
make_global_int("&lifemax",10)
make_global_int("&life",&lifemax)
make_global_int("&level",1)
make_global_int("&player_map",1)
make_global_int("&last_text",0)
make_global_int("&update_status",0)
make_global_int("&missile_target",0)
make_global_int("&enemy_sprite",0)
make_global_int("&magic_cost",0)
make_global_int("&missle_source",0)

//These two aren't technically required, but they're used by all monsters in original Dink to place goodies on death
make_global_int("&save_x",0)
make_global_int("&save_y",0)

//Add new globals for your dmod here
make_global_int("&story",0)



//If Dink had herb boots armed, let's reset his speed.
set_dink_speed(3)
sp_frame_delay(1,0)

//If Dink had a weapon armed, let's reset the graphics to fists.
init("load_sequence_now graphics\dink\walk\ds-w1- 71 43 38 72 -14 -9 14 9")
init("load_sequence_now graphics\dink\walk\ds-w2- 72 43 37 69 -13 -9 13 9")
init("load_sequence_now graphics\dink\walk\ds-w3- 73 43 38 72 -14 -9 14 9")
init("load_sequence_now graphics\dink\walk\ds-w4- 74 43 38 72 -12 -9 12 9")
init("load_sequence_now graphics\dink\walk\ds-w6- 76 43 38 72 -13 -9 13 9")
init("load_sequence_now graphics\dink\walk\ds-w7- 77 43 38 72 -12 -10 12 10")
init("load_sequence_now graphics\dink\walk\ds-w8- 78 43 37 69 -13 -9 13 9")
init("load_sequence_now graphics\dink\walk\ds-w9- 79 43 38 72 -14 -9 14 9")
init("load_sequence_now graphics\dink\idle\ds-i2- 12 250 33 70 -12 -9 12 9")
init("load_sequence_now graphics\dink\idle\ds-i4- 14 250 30 71 -11 -9 11 9")
init("load_sequence_now graphics\dink\idle\ds-i6- 16 250 36 70 -11 -9 11 9")
init("load_sequence_now graphics\dink\idle\ds-i8- 18 250 32 68 -12 -9 12 9")
init("load_sequence_now graphics\dink\hit\normal\ds-h2- 102 75 60 72 -19 -9 19 9")
init("load_sequence_now graphics\dink\hit\normal\ds-h4- 104 75 61 73 -19 -10 19 10")
init("load_sequence_now graphics\dink\hit\normal\ds-h6- 106 75 58 71 -18 -10 18 10")
init("load_sequence_now graphics\dink\hit\normal\ds-h8- 108 75 61 71 -19 -10 19 10")

debug("Loading sounds..")
load_sound("QUACK.WAV",1)
load_sound("PIG1.WAV",2)
load_sound("PIG2.WAV",3)
load_sound("PIG3.WAV",4)
load_sound("PIG4.WAV",5)
load_sound("BURN.WAV",6)
load_sound("OPEN.WAV",7)
load_sound("SWING.WAV",8)
load_sound("PUNCH.WAV",9)
load_sound("SWORD2.WAV",10)
load_sound("SELECT.WAV",11)
load_sound("WSCREAM.WAV",12)
load_sound("PICKER.WAV",13)
load_sound("GOLD.WAV",14)
load_sound("GRUNT1.WAV",15)
load_sound("GRUNT2.WAV",16)
load_sound("SEL1.WAV",17)
load_sound("ESCAPE.WAV",18)
load_sound("NONO.WAV",19)
load_sound("SEL2.WAV",20)
load_sound("SEL3.WAV",21)
load_sound("HIGH2.WAV",22)
load_sound("FIRE.WAV",23)
load_sound("SPELL1.WAV",24)
load_sound("CAVEENT.WAV",25) //Duplicate sound - this one is never used anywhere in Original Dink
load_sound("SNARL1.WAV",26)
load_sound("SNARL2.WAV",27)
load_sound("SNARL3.WAV",28)
load_sound("HURT1.WAV",29)
load_sound("HURT2.WAV",30)
load_sound("ATTACK1.WAV",31)
load_sound("CAVEENT.WAV",32)
load_sound("LEVEL.WAV",33)
load_sound("SAVE.WAV",34)
load_sound("SPLASH.WAV",35)
load_sound("SWORD1.WAV",36)
load_sound("BHIT.WAV",37)
load_sound("SQUISH.WAV",38)
load_sound("STAIRS.WAV",39)
load_sound("STEPS.WAV",40)
load_sound("ARROW.WAV",41)
load_sound("FLYBY.WAV",42)
load_sound("SECRET.WAV",43)
load_sound("BOW1.WAV",44)
load_sound("KNOCK.WAV",45)
load_sound("DRAG1.WAV",46)
load_sound("DRAG2.WAV",47)
load_sound("AXE.WAV",48)
load_sound("BIRD1.WAV",49)



load_sound("mystery.wav", 53)
load_sound("monk.wav", 54)
load_sound("ezdrummer.ogg", 55)
load_sound("wololo.wav", 56)
//Seth's favourite sample CD
load_sound("scoringtools.mp3", 57)
load_sound("fountain.ogg", 58)


kill_this_task
}
