// Tutorial variables which are reset when the tutorial ends
    hasan
    kaan
    sorfina
    tanisha

FLAGS
    FLAG_HAS_BOWLER_BURNSDAY 1    // every year's poem at burns day, shannon gives you a bowler hat
    FLAG_OPENED_UNDERGROUND  2    // this flag is a replacement for variable Open_Underground_Palace_Barrier, which was used only as boolean
    FLAG_GOT_NAEM_GLOVES     4    // this replaces Naem_Quest_Done, which was used as a boolean variable
    FLAG_GOT_GRADUATIONCAP   8    // this is a bit which was to be found in Tut_var second bit
    FLAG_TOWEL_HELPED        16   // gave the towel npc the stuff he wants
    FLAG_TOWEL_COMPLETED     32   // got the towel from the towel npc
    FLAG_ANDRA_HELPED        64   // Knows Andra and agreed to help her
    FLAG_ROSSI_COMPLETED     128  // Completed the Rossi Quest
    FLAG_TUTORIAL_DONE       256  // player completed tutorial (or entered the tutorial area from outside after it was added)
    FLAG_SNOWMAN             512  // player gave candy to the snowman
    FLAG_SANTAS_HELPER       1024 // player gave presents to Santa's helper
    FLAG_HURNSMINE_CHEST     2048 // player opened the chest with the short sword in Hurnscald mines

QUEST_NorthTulimshar
// saves state for several quests in North Tulimshar
// Nibble 0 and 1: Hide and Seek with the kids
// Nibble 2: 2 Bit for Imec's Shop License quest, 2 Bit for Banu's water quest
// Nibble 3: Magic Fertilizer quest
// Nibble 4: Kylian's Businessman quest, flags if certain places in Tulimshar are known
// Nibble 5: Kylian's Businessman quest, progress
// Kylian's quest is planned to be continued -> Nibble 6 and 7

QUEST_SouthTulimshar
// saves state for several quests in South Tulimshar
// Nibble 0: Bernard and Mikhail
// Nibble 1: Sarah
// Nibble 2: Vincent
// Nibble 3: Sandra
// Nibble 4 and 5: Lieutnant Dausen, Guards and Miners
    // 1: accepted task from lieutnant dausen to get 10 Cactus Drinks
    // 2: gave 10 Cactus Drinks
    // 3: accepted task to bring orders to Stewen
    // 4: told Stewen to hold his post
    // 5: reported back to Dausen and got task to talk to Nickos
    // 6: told Nickos to hold his post
    // 7: reported back to Dausen
    // 8: accepted task from Nickos to check for the miners
    // 9: checked Nathan
    // 10: checked Naem
    // 11: reported back to Nickos
    // 12: offered help to Nathan
    // 13: got first bag from Naem
    // 14: brought first bag to Nathan
    // 15: got second bag from Naem
    // 16: brought second bag to Nathan
    // 17: got third bag from Naem
    // 18: brought third bag to Nathan and got reward and task to talk to Nickos about the scorpions
    // 19: accepted task to bring 10 Angry Scorpion Stingers
    // 20: brought 10 stingers, got reward and information about underground palace
    // 21: learned that Naem lost the key, got sent to dausen
    // 22: got key from dausen, or tried a wrong trigger/wrong direction
    // 23: unlocked first trigger
    // 24: unlocked third trigger
    // 25: unlocked second trigger (in parallel: flags that UGP is opened, minor gloves from naem)
    // 26: opened the chest in the underground palace, or reset from 39 if you didn't bring the Iten to Sema
    // 27: accepted task to kill the giant cave maggot
    // 28: got reward from Sema

QUEST_Hurnscald
// Nibble 0: Bandit quest
    // 1: accepted task from lena to bring 10 bandit hoods
    // 2: got fairy hat
    // 3: accepted task to hunt the bandit leader
    //      (quest gets reset to here if you talk to lena after failing to beat the bandit leader)
    // 4: got key to bandit lord cave from Bryant
    // 5: killed the bandit lord
    // 6: got forest armor
// Nibble 1: Scythe quest at Farmer Hinnak
// Nibble 2: Demon Mask quest in the Hurnscald mines
// Nibble 3: Inspector quest

Rossy_Quest
// is set to 0 when quest is completed, FLAG_ROSSI_COMPLETED is set in FLAGS
gotcherry
// used in the Rossy quest and set to 0 when state 5 is reached in the Rossy Quest
cavefights
// used in the Rossy quest to save which caves are already cleared (bitmasking)
// is set to 0 when Rossy Quest is completed

QUEST_Mirak
// state for NPC Mirak
Mirak_Bantime
// is reset when Mirak_Questtime is set
Mirak_Questtime
// is reset when Mirak_Bantime is set

Katze
// Nibble 0: used to save progress in Cat Ears quest
// Nibble 1: saves if the player got scared out of the cat's cave, or entered it

HEATHIN_QUEST
// Quest about terranite equipment
// Uses values up to 14
// TODO: use bitmasking in the script instead, so only a single nibble is used

QUEST_Nivalis_state
// used to save state for several quest around Nivalis
// Nibble 0 and 1: Baktar's quest, saves which items the player brought
// Nibble 2: Baktar's second quest (not released since unfinished)
// Nibble 3: Baktar: saves some information related to second part of his quests
//    TODO: restructure Nibble 2 and 3 so only one of them is needed?
// Nibble 4: Well quest (get help for a person trapped in a well)
// Nibble 5: Cindy quest

QUEST_Barbarians
// nibble 0: barbarian quests (kimarr, birrod, yerrnk)
wolvern_count
// is used in the wolvern hunting subquest of the barbarian quests
// is reset to 0 when state 5 of the barbarian quests is reached

QUEST_Graveyard_Inn
// used to save progress of quests in Graveyard in
// Nibble 0: Love Triangle subquest of Inntaker Reid
// Nibble 1: Love Triangle subquest of Lover Savaric
// Nibble 2: Love Triangle subquest of Child Aldred
// Nibble 3: Love Triangle subquest of Reid's husband Hammond
// Nibble 4: Love Triangle subquest of Golbenez
// Nibble 5: Werewolf quest (gambling)
// Nibble 6: Headless Man quest (Pinkie Helmet)

QUEST_WG_state
// saves progress of quest series with Agostine and Lora Tay (Fur Gloves, Fur Boots, Fine Dress), 23 states
// TODO: could bitmasking be used?

QUEST_BlueSage
// saves progress of the Blue Sage subquests
// Bit 0 - 4 collect missing bookpages
// Bit 5: Grimoire as reward for quests about repairing the books
// Bit 6: Reward for defeating the slimes in the library
// Nibble 2: flags about repair material
// Nibble 3: investigation subquest
// Nibble 4 and 5: slimes in the library

QUEST_Forestbow_state
// Used to save the state of several quests around Hurnscald
// Nibble 0: Forest Bow quest from Alan (5 states)
// Nibble 1: Wooden Shield quest from Jack (3 states)
// Nibble 2: saves state about interaction with Kfahr, Bone Knife and Golden Stinger (7 states)
// Nibble 3: Monster Oil and Setzer quest, Rauk, Caul and Nicholas involved (8 states)
// Nibble 4: Steel Shield quest from Nicholar (2 states)
// Nibble 5:
// Nibble 6: Archery Schhool quest from Gwendolyn to get the Mallard's Eye skill (6 states)
// Nibble 7: Antipoison quest from the nurse to get the Resist Poison skill (7 states)

QUEST_MIRIAM
// quest to get the Speed skill from Miriam (5 states). Is reset to 0 when the skill is gained.
QUEST_MIRIAM_start
// stores the time when you start running to Pachua, is reset when finishing the race, when cheated, when getting speed skill.
QUEST_MIRIAM_run
// stores the time difference between starting the race and arriving a Pachua. Is reset when talking to Miriam after the race.
QUEST_MIRIAM_cheat
// saves if the player cheated during the race. Is reset when starting the race and when getting the Speed skill.

QUEST_clothdyer_knowsdye
// saves the state of the player learning what's needed to dye clothes, including the value needed for the dark green dye quest

OrumQuest
// Progress of the Orum and Waric quest (currently 14 states, follow-up is wip)
OrumQuestBarrier
// Barrier colors save in nibble 0,1,2
// TODO: check if it can be reset when the quest is finished. if not, check if it can be moved into upper nibble of OrumQuest
OrumQuestTorch
// Color of torches saved in nibble 0,1,2 and intensity in nibble 3,4,5
// TODO: check if it can be reset when the quest is finished

Illia_Uniques_Count
// Counter how many unique rewards the character got in the repeatable illia quest

MAGIC_EXPERIENCE
// amount of magic experience the player has collected. Usually only modified when casting spells.

MAGIC_FLAGS
    MFLAG_DRANK_POTION         1     // Character drank at least one magic potion as prerequisite for the Mana Seed quest.
    MFLAG_KNOWS_MANASEED       2     // Character has found the Mana Seed.
    MFLAG_TOUCHED_MANASEED     4     // Character has touched the Mana Seed.
    MFLAG_MANASEED_MAXEDOUT    8     // Character has touched the Mana Seed while maxed out on magic.

    MFLAG_KNOWS_AULDSBEL       16    // Character has met Auldsbel.
    MFLAG_KNOWS_WYARA          32    // Character has met Wyara.
    MFLAG_KNOWS_SAGATHA        64    // Character has met Sagatha.
    MFLAG_KNOWS_MANAPOTION     128   // Has heard about the Mana Potion.

    MFLAG_MANASEED_RUMOUR      256   // Has heard rumour about Mana Seed.
    MFLAG_KNOWS_CUTTREE        512   // Knows about the 'cut the tree' quest.
    MFLAG_DID_CUTTREE          1024  // Did cut off a branch from the druid tree.
    MFLAG_KNOWS_DRUIDTREE      2048  // Knows about the druid tree quest.

    MFLAG_KNOWS_IMP            4096  // Knows about the imprisoned forest spirit.
    MFLAG_KNOWS_OLD_WIZARD     8192  // Knows Bjorn's old wizard.
    MFLAG_MADE_CONC_POTION     16384 // Made a concentration potion with T15 and/or T16.
    MFLAG_ELANORE_OMAR         32768 // Told Omar about Elanore's involvement.

    MFLAG_KNOWS_UNFOCUS_RECIPE 65536 // Has been told about unfocus by Luca.

QUEST_MAGIC
// Nibble 0 and 1: Auldsbel
// Nibble 2: Druid Tree and Injured Mouboo
// Nibble 3: Sagatha's happiness
// Nibble 4 and 5: Sagatha
// Nibble 6 and 7: war magic (swords)

QUEST_MAGIC2
// Nibble 0: Desert spirit
// Nibble 1: Elanore
// Nibble 2: Wyara and Purification Potion
// Nibble 3: Kadiya quest (Elanore, Omar, Caul)

QUEST_Graveyard_Caretaker
// Saves state for letter quest of the caretaker, 5 states
// is reset to 4 in Airlia, so the quest becomes repeatable
// TODO: move that to a nibble in a different variable? maybe in QUEST_Airlia?
QUEST_Airlia
// Saves state of Airlia's graveyard quests, usus only a few states
// TODO: make script more readable, see if variable structure could be changed

ResetA_charstate
// currently isn't in use, it seems it has been used in the script which allows stat resets (there are players who have this variable set)
// TODO: think about adding this to clear_vars

BOSS_POINTS
// amount of boss points won in boss battles

DailyQuestPoints
// amount of daily quest points the player currently has
DailyQuestTime
// time since the daily quest points were renewed
DailyQuestBonus
// bonus points which are added to the daily quest points, get used up

Menhir_Activated
// used as boolean if the player has evere activated a soul menhir
// TODO: move to a flag

TUT_var
// saves the time tick of when the character started the game

MPQUEST
// boolean if the player is registered for monster points
// TODO: move to a flag
Mobpt
// amount of Monster Points
tvis
// amount of items gotten from Ishi in exchange of monster points

PC_DIE_COUNTER
// counts how often the player died

Annual_Quest
//  This variable contains 4 bytes that are used to check if a player
//  completed or not an annual quest.
//  Byte 0: Used by After-Halloween quest.
//  Each byte contains the value "year minus 2000" where year is the next year
//  when the player can start over the annual quest.
//  Be sure to not have a quest whose duration overlaps on two years,
//  or this will cause problems.

Quest_Halloween
// TODO: check if it could be deleted in clear_vars if time is outside of quest's time
// Used in After-Halloween quest.
// Is deleted when completing the quest.

// Events:
    Easter_2010_QuestState // spell to reach Easter Island is contained in here
    hw2011 // bad karma is saved in here

///////////////
// Variables that are deleted:

MAGIC_CAST_TICK: 4 // will be cleared by the server on login

BankAccount
// Deleted in banker function and moved to an account variable

Deleted in clear_vars:

Now unused variables:
    QUEST_clothdyer_angus
    Scorp
    Bugleg
    QUEST_clothdyer_state
    KatzeBeenOutside
    LastHiss
    CaveSnakeLamp

    TMW_Quest // contents were moved to QUEST_SouthTulimshar and QUEST_Hurnscald
    QUEST_Scythe_state // contents were moved to QUEST_Hurnscald
    QUEST_demon_mines // contents were moved to QUEST_Hurnscald
    Inspector // contents were moved to QUEST_Hurnscald

    Open_Underground_Palace_Barrier // turned into flag FLAG_OPENED_UNDERGROUND
    Naem_Quest_Done // turned into flag FLAG_GOT_NAEM_GLOVES
    ChristmasQuest // turned into flag FLAG_SNOWMAN
    ChristmasQuest2 // turned into flag FLAG_SANTAS_HELPER
    ChestQuest // turned into flag FLAG_HURNSMINE_CHEST

Event variables:
    EasterQuest

    // Halloween 2006
    HWQUEST1
    HWQUEST2
    HWQUEST3
    HWQUEST4
    HWQUEST5
    HWQUEST6
    HWQUEST7
    HWQUEST8
    HWQUEST9
    HWQUEST10
    HWQUEST11
    HWQUEST12
    HWQUEST13
    HWQUEST14
    HWQUEST15
    HWQUEST16
    HWQUEST17
    HWQUEST18
    HWQUEST18
    HWQUEST19
    HWQUEST20

    // Christmas 2006
    XMASQUEST1
    XMASQUEST2
    XMASQUEST3
    XMASQUEST4
    XMASQUEST5
    XMASQUEST6
    XMASQUEST7
    XMASQUEST8
    XMASQUEST9
    XMASQUEST10
    XMASQUEST11
    XMASQUEST12
    XMASQUEST13
    XMASQUEST14
    XMASQUEST15
    XMASQUEST16
    XMASQUEST17
    XMASQUEST18
    XMASQUEST19
    XMASQUEST20

    QUEST_Halloween07_state

    QUEST_xmas07_state
    QUEST_xmas07_milk
    QUEST_xmas07_cookies
    QUEST_xmas07_presents

    QUEST_Easter08_state

    Halloween08

    QUEST_xmas08_state

    QUEST_Easter09

    Candyman // Halloween 2009

    QUEST_Christmas09_state

    QUEST_Easter09_slots

    // easter 2010
    Easter_2010_EggState1
    Easter_2010_EggState2
    Easter_2010_EggState3
    Easter_2010_EggState4
    Easter_2010_EggState5

    // halloween 2010
    hween10
    hween10_collect_canpump
    hween10_credits
    hween10_collect
    hween10_collect_mmallow
    hween10_collect_jelskul
    hween10_bonecount
    hween10_collect_tondel
    hween10_paid

    // Xmas 2010:
    Xmas2010
    Golbenez_Inn_Cost
    Count_Yellow
    Count_White
    Maze
    Yellow
    White

    QUEST_Easter11
    xmas11
    QUEST_Easter12
    xmas2012
