JOBID = {

	JT_NOVICE = 0,
	JT_SWORDMAN = 1,
	JT_MAGICIAN = 2,
	JT_ARCHER = 3,
	JT_ACOLYTE = 4,
	JT_MERCHANT = 5,
	JT_THIEF = 6,
	JT_KNIGHT = 7,
	JT_PRIEST = 8,
	JT_WIZARD = 9,
	JT_BLACKSMITH = 10,
	JT_HUNTER = 11,
	JT_ASSASSIN = 12,
	JT_CRUSADER = 14,
	JT_MONK = 15,
	JT_SAGE = 16,
	JT_ROGUE = 17,
	JT_ALCHEMIST = 18,
	JT_BARD = 19,
	JT_DANCER = 20,
	--21 Skipped
	JT_MARRIED = 22,
	JT_SUPERNOVICE = 23,
	JT_GUNSLINGER = 24,
	JT_NINJA = 25,
	--26 Skipped
	JT_SUMMER = 27,
	JT_NOVICE_H = 4001,
	JT_SWORDMAN_H = 4002,
	JT_MAGICIAN_H = 4003,
	JT_ARCHER_H = 4004,
	JT_ACOLYTE_H = 4005,
	JT_MERCHANT_H = 4006,
	JT_THIEF_H = 4007,
	JT_KNIGHT_H = 4008,
	JT_PRIEST_H = 4009,
	JT_WIZARD_H = 4010,
	JT_BLACKSMITH_H = 4011,
	JT_HUNTER_H = 4012,
	JT_ASSASSIN_H = 4013,
	JT_CRUSADER_H = 4015,
	JT_MONK_H = 4016,
	JT_SAGE_H = 4017,
	JT_ROGUE_H = 4018,
	JT_ALCHEMIST_H = 4019,
	JT_BARD_H = 4020,
	JT_DANCER_H = 4021,
	JT_NOVICE_B = 4023,
	JT_SWORDMAN_B = 4024,
	JT_MAGICIAN_B = 4025,
	JT_ARCHER_B = 4026,
	JT_ACOLYTE_B = 4027,
	JT_MERCHANT_B = 4028,
	JT_THIEF_B = 4029,
	JT_KNIGHT_B = 4030,
	JT_PRIEST_B = 4031,
	JT_WIZARD_B = 4032,
	JT_BLACKSMITH_B = 4033,
	JT_HUNTER_B = 4034,
	JT_ASSASSIN_B = 4035,
	JT_CRUSADER_B = 4037,
	JT_MONK_B = 4038,
	JT_SAGE_B = 4039,
	JT_ROGUE_B = 4040,
	JT_ALCHEMIST_B = 4041,
	JT_BARD_B = 4042,
	JT_DANCER_B = 4043,
	JT_SUPERNOVICE_B = 4045,
	JT_TAEKWON = 4046,
	JT_STAR = 4047,
	JT_STAR2 = 4048,
	JT_LINKER = 4049,
	JT_RUNE_KNIGHT = 4054,
	JT_WARLOCK = 4055,
	JT_RANGER = 4056,
	JT_ARCHBISHOP = 4057,
	JT_MECHANIC = 4058,
	JT_GUILLOTINE_CROSS = 4059,
	JT_RUNE_KNIGHT_H = 4060,
	JT_WARLOCK_H = 4061,
	JT_RANGER_H = 4062,
	JT_ARCHBISHOP_H = 4063,
	JT_MECHANIC_H = 4064,
	JT_GUILLOTINE_CROSS_H = 4065,
	JT_ROYAL_GUARD = 4066,
	JT_SORCERER = 4067,
	JT_MINSTREL = 4068,
	JT_WANDERER = 4069,
	JT_SURA = 4070,
	JT_GENETIC = 4071,
	JT_SHADOW_CHASER = 4072,
	JT_ROYAL_GUARD_H = 4073,
	JT_SORCERER_H = 4074,
	JT_MINSTREL_H = 4075,
	JT_WANDERER_H = 4076,
	JT_SURA_H = 4077,
	JT_GENETIC_H = 4078,
	JT_SHADOW_CHASER_H = 4079,
	JT_RUNE_KNIGHT_B = 4096,
	JT_WARLOCK_B = 4097,
	JT_RANGER_B = 4098,
	JT_ARCHBISHOP_B = 4099,
	JT_MECHANIC_B = 4100,
	JT_GUILLOTINE_CROSS_B = 4101,
	JT_ROYAL_GUARD_B = 4102,
	JT_SORCERER_B = 4103,
	JT_MINSTREL_B = 4104,
	JT_WANDERER_B = 4105,
	JT_SURA_B = 4106,
	JT_GENETIC_B = 4107,
	JT_SHADOW_CHASER_B = 4108,
	JT_SUPERNOVICE2 = 4190,
	JT_SUPERNOVICE2_B = 4191,
	JT_RUNE_CHICKEN = 4080,
	JT_ROYAL_CHICKEN = 4082,
	JT_WOLF_RANGER = 4084,
	JT_FROG_NINJA = 4114,
	JT_PECO_GUNNER = 4115,
	JT_PECO_SWORD = 4116,
	JT_CHICKEN = 13,
	JT_PIG_MERCHANT = 4119,
	JT_PIG_WHITESMITH = 4118,
	JT_PIG_GENETIC = 4120,
	JT_PIG_CREATOR = 4121,
	JT_PIG_ALCHE = 4137,
	JT_PIG_BLACKSMITH = 4138,
	JT_PIG_MERCHANT_B = 4163,
	JT_PIG_ALCHE_B = 4169,
	JT_PIG_GENETIC_B = 4180,
	JT_PIG_MERCHANT_H = 4188,
	JT_PIG_BLACKSMITH_B = 4196,
	JT_SHEEP_MONK = 4125,
	JT_SHEEP_ACO = 4126,
	JT_SHEEP_SURA = 4127,
	JT_SHEEP_ARCB = 4129,
	JT_SHEEP_CHAMP = 4139,
	JT_SHEEP_PRIEST = 4156,
	JT_SHEEP_HPRIEST = 4157,
	JT_SHEEP_ACO_B = 4162,
	JT_SHEEP_MONK_B = 4166,
	JT_SHEEP_ARCB_B = 4174,
	JT_SHEEP_SURA_B = 4179,
	JT_SHEEP_ACO_H = 4187,
	JT_SHEEP_PRIEST_B = 4194,
	JT_DOG_G_CROSS = 4140,
	JT_DOG_THIEF = 4141,
	JT_DOG_ROGUE = 4142,
	JT_DOG_CHASER = 4143,
	JT_DOG_STALKER = 4144,
	JT_DOG_ASSASSIN = 4145,
	JT_DOG_ASSA_X = 4146,
	JT_DOG_ASSASSIN_B = 4165,
	JT_DOG_ROGUE_B = 4168,
	JT_DOG_G_CROSS_B = 4175,
	JT_DOG_THIEF_B = 4181,
	JT_DOG_CHASER_B = 4182,
	JT_DOG_THIEF_H = 4189,
	JT_OSTRICH_ARCHER = 4122,
	JT_OSTRICH_DANCER = 4147,
	JT_OSTRICH_MINSTREL = 4148,
	JT_OSTRICH_BARD = 4149,
	JT_OSTRICH_SNIPER = 4150,
	JT_OSTRICH_WANDER = 4151,
	JT_OSTRICH_ZIPSI = 4152,
	JT_OSTRICH_CROWN = 4153,
	JT_OSTRICH_HUNTER = 4154,
	JT_OSTRICH_ARCHER_B = 4161,
	JT_OSTRICH_HUNTER_B = 4164,
	JT_OSTRICH_BARD_B = 4170,
	JT_OSTRICH_DANCER_B = 4171,
	JT_OSTRICH_MINSTREL_B = 4177,
	JT_OSTRICH_WANDER_B = 4178,
	JT_OSTRICH_ARCHER_H = 4186,
	JT_FOX_MAGICIAN = 4130,
	JT_FOX_SAGE = 4131,
	JT_FOX_SORCERER = 4132,
	JT_FOX_WARLOCK = 4133,
	JT_FOX_WIZ = 4134,
	JT_FOX_HWIZ = 4136,
	JT_FOX_MAGICIAN_B = 4160,
	JT_FOX_SAGE_B = 4167,
	JT_FOX_WARLOCK_B = 4173,
	JT_FOX_SORCERER_B = 7176,
	JT_FOX_MAGICIAN_H = 4185,
	JT_FOX_WIZ_B = 4195,
	JT_PORING_NOVICE = 4124,
	JT_PORING_STAR = 4123,
	JT_PORING_SNOVICE = 4128,
	JT_PORING_TAEKWON = 4155,
	JT_PORING_NOVICE_B = 4158,
	JT_PORING_SNOVICE_B = 4172,
	JT_PORING_NOVICE_H = 4183,
	JT_PORING_SNOVICE2 = 4192,
	JT_PORING_SNOVICE2_B = 4193,
}

JOB_INHERIT_LIST = {

	[JOBID.JT_SWORDMAN] = JOBID.JT_NOVICE,
	[JOBID.JT_MAGICIAN] = JOBID.JT_NOVICE,
	[JOBID.JT_ARCHER] = JOBID.JT_NOVICE,	
	[JOBID.JT_ACOLYTE] = JOBID.JT_NOVICE,
	[JOBID.JT_MERCHANT] = JOBID.JT_NOVICE,
	[JOBID.JT_THIEF] = JOBID.JT_NOVICE,
	[JOBID.JT_KNIGHT] = JOBID.JT_SWORDMAN,
	[JOBID.JT_PRIEST] = JOBID.JT_ACOLYTE,
	[JOBID.JT_WIZARD] = JOBID.JT_MAGICIAN,
	[JOBID.JT_BLACKSMITH] = JOBID.JT_MERCHANT,
	[JOBID.JT_HUNTER] = JOBID.JT_ARCHER,
	[JOBID.JT_ASSASSIN] = JOBID.JT_THIEF,
	[JOBID.JT_CRUSADER] = JOBID.JT_SWORDMAN,
	[JOBID.JT_MONK] = JOBID.JT_ACOLYTE,
	[JOBID.JT_SAGE] = JOBID.JT_MAGICIAN,
	[JOBID.JT_ROGUE] = JOBID.JT_THIEF,
	[JOBID.JT_ALCHEMIST] = JOBID.JT_MERCHANT,
	[JOBID.JT_BARD] = JOBID.JT_ARCHER,
	[JOBID.JT_DANCER] = JOBID.JT_ARCHER,
	[JOBID.JT_SUPERNOVICE] = JOBID.JT_NOVICE,
	[JOBID.JT_GUNSLINGER] = JOBID.JT_NOVICE,
	[JOBID.JT_NINJA] = JOBID.JT_NOVICE,
	[JOBID.JT_NOVICE_H] = JOBID.JT_NOVICE,
	[JOBID.JT_SWORDMAN_H] = JOBID.JT_SWORDMAN,
	[JOBID.JT_MAGICIAN_H] = JOBID.JT_MAGICIAN,
	[JOBID.JT_ARCHER_H] = JOBID.JT_ARCHER,
	[JOBID.JT_ACOLYTE_H] = JOBID.JT_ACOLYTE,
	[JOBID.JT_MERCHANT_H] = JOBID.JT_MERCHANT,
	[JOBID.JT_THIEF_H] = JOBID.JT_THIEF,
	[JOBID.JT_KNIGHT_H] = JOBID.JT_KNIGHT,
	[JOBID.JT_PRIEST_H] = JOBID.JT_PRIEST,
	[JOBID.JT_WIZARD_H] = JOBID.JT_WIZARD,
	[JOBID.JT_BLACKSMITH_H] = JOBID.JT_BLACKSMITH,
	[JOBID.JT_HUNTER_H] = JOBID.JT_HUNTER,
	[JOBID.JT_ASSASSIN_H] = JOBID.JT_ASSASSIN,
	[JOBID.JT_CRUSADER_H] = JOBID.JT_CRUSADER,
	[JOBID.JT_MONK_H] = JOBID.JT_MONK,
	[JOBID.JT_SAGE_H] = JOBID.JT_SAGE,
	[JOBID.JT_ROGUE_H] = JOBID.JT_ROGUE,
	[JOBID.JT_ALCHEMIST_H] = JOBID.JT_ALCHEMIST,
	[JOBID.JT_BARD_H] = JOBID.JT_BARD,
	[JOBID.JT_DANCER_H] = JOBID.JT_DANCER,
	[JOBID.JT_NOVICE_B] = JOBID.JT_NOVICE,
	[JOBID.JT_SWORDMAN_B] = JOBID.JT_SWORDMAN,
	[JOBID.JT_MAGICIAN_B] = JOBID.JT_MAGICIAN,
	[JOBID.JT_ARCHER_B] = JOBID.JT_ARCHER,	
	[JOBID.JT_ACOLYTE_B] = JOBID.JT_ACOLYTE,
	[JOBID.JT_MERCHANT_B] = JOBID.JT_MERCHANT,
	[JOBID.JT_THIEF_B] = JOBID.JT_THIEF,
	[JOBID.JT_KNIGHT_B] = JOBID.JT_KNIGHT,
	[JOBID.JT_PRIEST_B] = JOBID.JT_PRIEST,
	[JOBID.JT_WIZARD_B] = JOBID.JT_WIZARD,
	[JOBID.JT_BLACKSMITH_B] = JOBID.JT_BLACKSMITH,
	[JOBID.JT_HUNTER_B] = JOBID.JT_HUNTER,
	[JOBID.JT_ASSASSIN_B] = JOBID.JT_ASSASSIN,
	[JOBID.JT_CRUSADER_B] = JOBID.JT_CRUSADER,
	[JOBID.JT_MONK_B] = JOBID.JT_MONK,
	[JOBID.JT_SAGE_B] = JOBID.JT_SAGE,
	[JOBID.JT_ROGUE_B] = JOBID.JT_ROGUE,
	[JOBID.JT_ALCHEMIST_B] = JOBID.JT_ALCHEMIST,
	[JOBID.JT_BARD_B] = JOBID.JT_BARD,
	[JOBID.JT_DANCER_B] = JOBID.JT_DANCER,
	[JOBID.JT_SUPERNOVICE_B] = JOBID.JT_SUPERNOVICE,
	[JOBID.JT_TAEKWON] = JOBID.JT_NOVICE,
	[JOBID.JT_STAR] = JOBID.JT_TAEKWON,
	[JOBID.JT_LINKER] = JOBID.JT_TAEKWON,
	[JOBID.JT_RUNE_KNIGHT] = JOBID.JT_KNIGHT,
	[JOBID.JT_WARLOCK] = JOBID.JT_WIZARD,
	[JOBID.JT_RANGER] = JOBID.JT_HUNTER,
	[JOBID.JT_ARCHBISHOP] = JOBID.JT_PRIEST,
	[JOBID.JT_MECHANIC] = JOBID.JT_BLACKSMITH,
	[JOBID.JT_GUILLOTINE_CROSS] = JOBID.JT_ASSASSIN,	
	[JOBID.JT_RUNE_KNIGHT_H] = JOBID.JT_KNIGHT_H,
	[JOBID.JT_WARLOCK_H] = JOBID.JT_WIZARD_H,
	[JOBID.JT_RANGER_H] = JOBID.JT_HUNTER_H,
	[JOBID.JT_ARCHBISHOP_H] = JOBID.JT_PRIEST_H,
	[JOBID.JT_MECHANIC_H] = JOBID.JT_BLACKSMITH_H,
	[JOBID.JT_GUILLOTINE_CROSS_H] = JOBID.JT_ASSASSIN_H,
	[JOBID.JT_ROYAL_GUARD] = JOBID.JT_CRUSADER,
	[JOBID.JT_SORCERER] = JOBID.JT_SAGE,
	[JOBID.JT_MINSTREL] = JOBID.JT_BARD,
	[JOBID.JT_WANDERER] = JOBID.JT_DANCER,
	[JOBID.JT_SURA] = JOBID.JT_MONK,
	[JOBID.JT_GENETIC] = JOBID.JT_ALCHEMIST,	
	[JOBID.JT_SHADOW_CHASER] = JOBID.JT_ROGUE,
	[JOBID.JT_ROYAL_GUARD_H] = JOBID.JT_CRUSADER_H,
	[JOBID.JT_SORCERER_H] = JOBID.JT_SAGE_H,
	[JOBID.JT_MINSTREL_H] = JOBID.JT_BARD_H,
	[JOBID.JT_WANDERER_H] = JOBID.JT_DANCER_H,
	[JOBID.JT_SURA_H] = JOBID.JT_MONK_H,
	[JOBID.JT_GENETIC_H] = JOBID.JT_ALCHEMIST_H,
	[JOBID.JT_SHADOW_CHASER_H] = JOBID.JT_ROGUE_H,
	[JOBID.JT_RUNE_KNIGHT_B] = JOBID.JT_RUNE_KNIGHT,
	[JOBID.JT_WARLOCK_B] = JOBID.JT_WARLOCK,
	[JOBID.JT_RANGER_B] = JOBID.JT_RANGER,
	[JOBID.JT_ARCHBISHOP_B] = JOBID.JT_ARCHBISHOP,
	[JOBID.JT_MECHANIC_B] = JOBID.JT_MECHANIC,
	[JOBID.JT_GUILLOTINE_CROSS_B] = JOBID.JT_GUILLOTINE_CROSS,
	[JOBID.JT_ROYAL_GUARD_B] = JOBID.JT_ROYAL_GUARD,
	[JOBID.JT_SORCERER_B] = JOBID.JT_SORCERER,
	[JOBID.JT_MINSTREL_B] = JOBID.JT_MINSTREL,
	[JOBID.JT_WANDERER_B] = JOBID.JT_WANDERER,
	[JOBID.JT_SURA_B] = JOBID.JT_SURA,
	[JOBID.JT_GENETIC_B] = JOBID.JT_GENETIC,
	[JOBID.JT_SHADOW_CHASER_B] = JOBID.JT_SHADOW_CHASER,
	[JOBID.JT_SUPERNOVICE2] = JOBID.JT_SUPERNOVICE,
	[JOBID.JT_SUPERNOVICE2_B] = JOBID.JT_SUPERNOVICE2,
	["__newindex"] = function () error("unknown state") end
}
setmetatable(JOB_INHERIT_LIST, JOB_INHERIT_LIST)

JOB_INHERIT_LIST2 = {

	[JOBID.JT_RUNE_KNIGHT_H] = JOBID.JT_RUNE_KNIGHT,
	[JOBID.JT_WARLOCK_H] = JOBID.JT_WARLOCK,
	[JOBID.JT_RANGER_H] = JOBID.JT_RANGER,
	[JOBID.JT_ARCHBISHOP_H] = JOBID.JT_ARCHBISHOP,
	[JOBID.JT_MECHANIC_H] = JOBID.JT_MECHANIC,
	[JOBID.JT_GUILLOTINE_CROSS_H] = JOBID.JT_GUILLOTINE_CROSS,
	[JOBID.JT_ROYAL_GUARD_H] = JOBID.JT_ROYAL_GUARD,
	[JOBID.JT_SORCERER_H] = JOBID.JT_SORCERER,
	[JOBID.JT_MINSTREL_H] = JOBID.JT_MINSTREL,
	[JOBID.JT_WANDERER_H] = JOBID.JT_WANDERER,
	[JOBID.JT_SURA_H] = JOBID.JT_SURA,
	[JOBID.JT_GENETIC_H] = JOBID.JT_GENETIC,
	[JOBID.JT_SHADOW_CHASER_H] = JOBID.JT_SHADOW_CHASER,
	["__newindex"] = function () error("unknown state") end
}
setmetatable(JOB_INHERIT_LIST2, JOB_INHERIT_LIST2)