/* part of the hp/mp integer overflow fix */
ALTER TABLE `player`
MODIFY COLUMN `hp`  int NOT NULL DEFAULT 0 AFTER `exit_map_index`,
MODIFY COLUMN `mp`  int NOT NULL DEFAULT 0 AFTER `hp`;

/* update old mob_proto table */
ALTER TABLE `mob_proto`
MODIFY COLUMN `setRaceFlag`  set('ANIMAL','UNDEAD','DEVIL','HUMAN','ORC','MILGYO','INSECT','FIRE','ICE','DESERT','TREE','ATT_ELEC','ATT_FIRE','ATT_ICE','ATT_WIND','ATT_EARTH','ATT_DARK','ZODIAC') NOT NULL DEFAULT '' AFTER `mount_capacity`,
MODIFY COLUMN `setImmuneFlag`  set('STUN','SLOW','FALL','CURSE','POISON','TERROR','REFLECT') NOT NULL DEFAULT '' AFTER `setRaceFlag`;

/* add belt_inventory if missing */
ALTER TABLE `item`
MODIFY COLUMN `window`  enum('INVENTORY','EQUIPMENT','SAFEBOX','MALL','DRAGON_SOUL_INVENTORY','BELT_INVENTORY','GROUND') NOT NULL DEFAULT 'INVENTORY' AFTER `owner_id`;

/* new 40k game bonuses 1-5 */
ALTER TABLE `item_attr`
MODIFY COLUMN `apply`  enum('MAX_HP','MAX_SP','CON','INT','STR','DEX','ATT_SPEED','MOV_SPEED','CAST_SPEED','HP_REGEN','SP_REGEN','POISON_PCT','STUN_PCT','SLOW_PCT','CRITICAL_PCT','PENETRATE_PCT','ATTBONUS_HUMAN','ATTBONUS_ANIMAL','ATTBONUS_ORC','ATTBONUS_MILGYO','ATTBONUS_UNDEAD','ATTBONUS_DEVIL','STEAL_HP','STEAL_SP','MANA_BURN_PCT','DAMAGE_SP_RECOVER','BLOCK','DODGE','RESIST_SWORD','RESIST_TWOHAND','RESIST_DAGGER','RESIST_BELL','RESIST_FAN','RESIST_BOW','RESIST_FIRE','RESIST_ELEC','RESIST_MAGIC','RESIST_WIND','REFLECT_MELEE','REFLECT_CURSE','POISON_REDUCE','KILL_SP_RECOVER','EXP_DOUBLE_BONUS','GOLD_DOUBLE_BONUS','ITEM_DROP_BONUS','POTION_BONUS','KILL_HP_RECOVER','IMMUNE_STUN','IMMUNE_SLOW','IMMUNE_FALL','SKILL','BOW_DISTANCE','ATT_GRADE_BONUS','DEF_GRADE_BONUS','MAGIC_ATT_GRADE_BONUS','MAGIC_DEF_GRADE_BONUS','CURSE_PCT','MAX_STAMINA','ATT_BONUS_TO_WARRIOR','ATT_BONUS_TO_ASSASSIN','ATT_BONUS_TO_SURA','ATT_BONUS_TO_SHAMAN','ATT_BONUS_TO_MONSTER','ATT_BONUS','MALL_DEFBONUS','MALL_EXPBONUS','MALL_ITEMBONUS','MALL_GOLDBONUS','MAX_HP_PCT','MAX_SP_PCT','SKILL_DAMAGE_BONUS','NORMAL_HIT_DAMAGE_BONUS','SKILL_DEFEND_BONUS','NORMAL_HIT_DEFEND_BONUS','PC_BANG_EXP_BONUS','PC_BANG_DROP_BONUS','EXTRACT_HP_PCT','RESIST_WARRIOR','RESIST_ASSASSIN','RESIST_SURA','RESIST_SHAMAN','ENERGY','DEF_GRADE','COSTUME_ATTR_BONUS','MAGIC_ATT_BONUS_PER','MELEE_MAGIC_ATT_BONUS_PER','RESIST_ICE','RESIST_EARTH','RESIST_DARK','RESIST_CRITICAL','RESIST_PENETRATE','BLEEDING_REDUCE', 'BLEEDING_PCT', 'ATT_BONUS_TO_WOLFMAN', 'RESIST_WOLFMAN', 'RESIST_CLAW','ACCEDRAIN_RATE','RESIST_MAGIC_REDUCTION','ENCHANT_ELECT','ENCHANT_FIRE','ENCHANT_ICE','ENCHANT_WIND','ENCHANT_EARTH','ENCHANT_DARK','ATTBONUS_CZ','ATTBONUS_INSECT','ATTBONUS_DESERT','ATTBONUS_SWORD','ATTBONUS_TWOHAND','ATTBONUS_DAGGER','ATTBONUS_BELL','ATTBONUS_FAN','ATTBONUS_BOW','ATTBONUS_CLAW','RESIST_HUMAN','RESIST_MOUNT_FALL','UNK_117','MOUNT') NOT NULL DEFAULT 'MAX_HP' FIRST ;

/* new 40k game bonuses 6-7 */
ALTER TABLE `item_attr_rare`
MODIFY COLUMN `apply`  enum('MAX_HP','MAX_SP','CON','INT','STR','DEX','ATT_SPEED','MOV_SPEED','CAST_SPEED','HP_REGEN','SP_REGEN','POISON_PCT','STUN_PCT','SLOW_PCT','CRITICAL_PCT','PENETRATE_PCT','ATTBONUS_HUMAN','ATTBONUS_ANIMAL','ATTBONUS_ORC','ATTBONUS_MILGYO','ATTBONUS_UNDEAD','ATTBONUS_DEVIL','STEAL_HP','STEAL_SP','MANA_BURN_PCT','DAMAGE_SP_RECOVER','BLOCK','DODGE','RESIST_SWORD','RESIST_TWOHAND','RESIST_DAGGER','RESIST_BELL','RESIST_FAN','RESIST_BOW','RESIST_FIRE','RESIST_ELEC','RESIST_MAGIC','RESIST_WIND','REFLECT_MELEE','REFLECT_CURSE','POISON_REDUCE','KILL_SP_RECOVER','EXP_DOUBLE_BONUS','GOLD_DOUBLE_BONUS','ITEM_DROP_BONUS','POTION_BONUS','KILL_HP_RECOVER','IMMUNE_STUN','IMMUNE_SLOW','IMMUNE_FALL','SKILL','BOW_DISTANCE','ATT_GRADE_BONUS','DEF_GRADE_BONUS','MAGIC_ATT_GRADE_BONUS','MAGIC_DEF_GRADE_BONUS','CURSE_PCT','MAX_STAMINA','ATT_BONUS_TO_WARRIOR','ATT_BONUS_TO_ASSASSIN','ATT_BONUS_TO_SURA','ATT_BONUS_TO_SHAMAN','ATT_BONUS_TO_MONSTER','ATT_BONUS','MALL_DEFBONUS','MALL_EXPBONUS','MALL_ITEMBONUS','MALL_GOLDBONUS','MAX_HP_PCT','MAX_SP_PCT','SKILL_DAMAGE_BONUS','NORMAL_HIT_DAMAGE_BONUS','SKILL_DEFEND_BONUS','NORMAL_HIT_DEFEND_BONUS','PC_BANG_EXP_BONUS','PC_BANG_DROP_BONUS','EXTRACT_HP_PCT','RESIST_WARRIOR','RESIST_ASSASSIN','RESIST_SURA','RESIST_SHAMAN','ENERGY','DEF_GRADE','COSTUME_ATTR_BONUS','MAGIC_ATT_BONUS_PER','MELEE_MAGIC_ATT_BONUS_PER','RESIST_ICE','RESIST_EARTH','RESIST_DARK','RESIST_CRITICAL','RESIST_PENETRATE','BLEEDING_REDUCE', 'BLEEDING_PCT', 'ATT_BONUS_TO_WOLFMAN', 'RESIST_WOLFMAN', 'RESIST_CLAW','ACCEDRAIN_RATE','RESIST_MAGIC_REDUCTION','ENCHANT_ELECT','ENCHANT_FIRE','ENCHANT_ICE','ENCHANT_WIND','ENCHANT_EARTH','ENCHANT_DARK','ATTBONUS_CZ','ATTBONUS_INSECT','ATTBONUS_DESERT','ATTBONUS_SWORD','ATTBONUS_TWOHAND','ATTBONUS_DAGGER','ATTBONUS_BELL','ATTBONUS_FAN','ATTBONUS_BOW','ATTBONUS_CLAW','RESIST_HUMAN','RESIST_MOUNT_FALL','UNK_117','MOUNT') NOT NULL DEFAULT 'MAX_HP' FIRST ;

/* 5 characters in the select phase */
ALTER TABLE `player_index`
ADD COLUMN `pid5`  int UNSIGNED NOT NULL DEFAULT 0 AFTER `pid4`,
ADD INDEX `pid5_key` USING BTREE (`pid5`) ;

/* new skill_proto way to handle skill points (backwards compatible) varchar->enum */
ALTER TABLE `skill_proto`
MODIFY COLUMN `szPointOn`  enum('NONE','MAX_HP','MAX_SP','HP_REGEN','SP_REGEN','BLOCK','HP','SP','ATT_GRADE','DEF_GRADE','MAGIC_ATT_GRADE','MAGIC_DEF_GRADE','BOW_DISTANCE','MOV_SPEED','ATT_SPEED','POISON_PCT','RESIST_RANGE','RESIST_MELEE','CASTING_SPEED','REFLECT_MELEE','ATT_BONUS','DEF_BONUS','RESIST_NORMAL','DODGE','KILL_HP_RECOVER','KILL_SP_RECOVER','HIT_HP_RECOVER','HIT_SP_RECOVER','CRITICAL','MANASHIELD','SKILL_DAMAGE_BONUS','NORMAL_HIT_DAMAGE_BONUS') NOT NULL DEFAULT 'NONE' AFTER `bLevelLimit`,
MODIFY COLUMN `szPointOn2`  enum('NONE','MAX_HP','MAX_SP','HP_REGEN','SP_REGEN','BLOCK','HP','SP','ATT_GRADE','DEF_GRADE','MAGIC_ATT_GRADE','MAGIC_DEF_GRADE','BOW_DISTANCE','MOV_SPEED','ATT_SPEED','POISON_PCT','RESIST_RANGE','RESIST_MELEE','CASTING_SPEED','REFLECT_MELEE','ATT_BONUS','DEF_BONUS','RESIST_NORMAL','DODGE','KILL_HP_RECOVER','KILL_SP_RECOVER','HIT_HP_RECOVER','HIT_SP_RECOVER','CRITICAL','MANASHIELD','SKILL_DAMAGE_BONUS','NORMAL_HIT_DAMAGE_BONUS') NOT NULL DEFAULT 'NONE' AFTER `setAffectFlag`;

/* new skill_proto flag values */
ALTER TABLE `skill_proto`
MODIFY COLUMN `setFlag`  set('ATTACK','USE_MELEE_DAMAGE','COMPUTE_ATTGRADE','SELFONLY','USE_MAGIC_DAMAGE','USE_HP_AS_COST','COMPUTE_MAGIC_DAMAGE','SPLASH','GIVE_PENALTY','USE_ARROW_DAMAGE','PENETRATE','IGNORE_TARGET_RATING','ATTACK_SLOW','ATTACK_STUN','HP_ABSORB','SP_ABSORB','ATTACK_FIRE_CONT','REMOVE_BAD_AFFECT','REMOVE_GOOD_AFFECT','CRUSH','ATTACK_POISON','TOGGLE','DISABLE_BY_POINT_UP','CRUSH_LONG','ATTACK_WIND','ATTACK_ELEC','ATTACK_FIRE','ATTACK_BLEEDING','PARTY') NULL DEFAULT NULL AFTER `szAttackGradePoly`,
MODIFY COLUMN `setAffectFlag`  enum('YMIR','INVISIBILITY','SPAWN','POISON','SLOW','STUN','DUNGEON_READY','DUNGEON_UNIQUE','BUILDING_CONSTRUCTION_SMALL','BUILDING_CONSTRUCTION_LARGE','BUILDING_UPGRADE','MOV_SPEED_POTION','ATT_SPEED_POTION','FISH_MIND','JEONGWIHON','GEOMGYEONG','CHEONGEUN','GYEONGGONG','EUNHYUNG','GWIGUM','TERROR','JUMAGAP','HOSIN','BOHO','KWAESOK','MANASHIELD','MUYEONG','REVIVE_INVISIBLE','FIRE','GICHEON','JEUNGRYEOK','TANHWAN_DASH','PABEOP','CHEONGEUN_WITH_FALL','POLYMORPH','WAR_FLAG1','WAR_FLAG2','WAR_FLAG3','CHINA_FIREWORK','HAIR','GERMANY','RAMADAN_RING','BLEEDING','RED_POSSESSION','BLUE_POSSESSION') NOT NULL DEFAULT 'YMIR' AFTER `setFlag`,
MODIFY COLUMN `setAffectFlag2`  enum('YMIR','INVISIBILITY','SPAWN','POISON','SLOW','STUN','DUNGEON_READY','DUNGEON_UNIQUE','BUILDING_CONSTRUCTION_SMALL','BUILDING_CONSTRUCTION_LARGE','BUILDING_UPGRADE','MOV_SPEED_POTION','ATT_SPEED_POTION','FISH_MIND','JEONGWIHON','GEOMGYEONG','CHEONGEUN','GYEONGGONG','EUNHYUNG','GWIGUM','TERROR','JUMAGAP','HOSIN','BOHO','KWAESOK','MANASHIELD','MUYEONG','REVIVE_INVISIBLE','FIRE','GICHEON','JEUNGRYEOK','TANHWAN_DASH','PABEOP','CHEONGEUN_WITH_FALL','POLYMORPH','WAR_FLAG1','WAR_FLAG2','WAR_FLAG3','CHINA_FIREWORK','HAIR','GERMANY','RAMADAN_RING','BLEEDING','RED_POSSESSION','BLUE_POSSESSION') NOT NULL DEFAULT 'YMIR' AFTER `szDurationPoly2`;

/* new costume item attr fields */
ALTER TABLE `item_attr`
MODIFY COLUMN `prob`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `apply`,
MODIFY COLUMN `lv1`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `prob`,
MODIFY COLUMN `lv2`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `lv1`,
MODIFY COLUMN `lv3`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `lv2`,
MODIFY COLUMN `lv4`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `lv3`,
MODIFY COLUMN `lv5`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `lv4`,
MODIFY COLUMN `weapon`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `lv5`,
MODIFY COLUMN `body`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `weapon`,
MODIFY COLUMN `wrist`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `body`,
MODIFY COLUMN `foots`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `wrist`,
MODIFY COLUMN `neck`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `foots`,
MODIFY COLUMN `head`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `neck`,
MODIFY COLUMN `shield`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `head`,
MODIFY COLUMN `ear`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `shield`,
ADD COLUMN `costume_body`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `ear`,
ADD COLUMN `costume_hair`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `costume_body`,
ADD COLUMN `costume_weapon`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `costume_hair`,
ADD COLUMN `pendant` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `costume_weapon`,
ADD COLUMN `glove` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `pendant`;

ALTER TABLE `item_attr_rare`
MODIFY COLUMN `prob`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `apply`,
MODIFY COLUMN `lv1`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `prob`,
MODIFY COLUMN `lv2`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `lv1`,
MODIFY COLUMN `lv3`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `lv2`,
MODIFY COLUMN `lv4`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `lv3`,
MODIFY COLUMN `lv5`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `lv4`,
MODIFY COLUMN `weapon`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `lv5`,
MODIFY COLUMN `body`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `weapon`,
MODIFY COLUMN `wrist`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `body`,
MODIFY COLUMN `foots`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `wrist`,
MODIFY COLUMN `neck`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `foots`,
MODIFY COLUMN `head`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `neck`,
MODIFY COLUMN `shield`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `head`,
MODIFY COLUMN `ear`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `shield`,
ADD COLUMN `costume_body`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `ear`,
ADD COLUMN `costume_hair`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `costume_body`,
ADD COLUMN `costume_weapon`  int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `costume_hair`,
ADD COLUMN `pendant` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `costume_weapon`,
ADD COLUMN `glove` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `pendant`;

/* parts incremented from word to dword */
ALTER TABLE `player`
MODIFY COLUMN `part_main` int UNSIGNED NOT NULL DEFAULT 0 AFTER `ip`,
MODIFY COLUMN `part_base` tinyint UNSIGNED NOT NULL DEFAULT 0 AFTER `part_main`,
MODIFY COLUMN `part_hair` int UNSIGNED NOT NULL DEFAULT 0 AFTER `part_base`;

ALTER TABLE `player_deleted`
MODIFY COLUMN `part_main` int UNSIGNED NOT NULL DEFAULT 0 AFTER `ip`,
MODIFY COLUMN `part_base` tinyint UNSIGNED NOT NULL DEFAULT 0 AFTER `part_main`,
MODIFY COLUMN `part_hair` int UNSIGNED NOT NULL DEFAULT 0 AFTER `part_base`;

/* item attr types should be unsigned (0,255) instead of being signed (-126,127) */
ALTER TABLE `item`
MODIFY COLUMN `attrtype0` tinyint(0) UNSIGNED NOT NULL DEFAULT 0 AFTER `socket2`,
MODIFY COLUMN `attrtype1` tinyint(0) UNSIGNED NOT NULL DEFAULT 0 AFTER `attrvalue0`,
MODIFY COLUMN `attrtype2` tinyint(0) UNSIGNED NOT NULL DEFAULT 0 AFTER `attrvalue1`,
MODIFY COLUMN `attrtype3` tinyint(0) UNSIGNED NOT NULL DEFAULT 0 AFTER `attrvalue2`,
MODIFY COLUMN `attrtype4` tinyint(0) UNSIGNED NOT NULL DEFAULT 0 AFTER `attrvalue3`,
MODIFY COLUMN `attrtype5` tinyint(0) UNSIGNED NOT NULL DEFAULT 0 AFTER `attrvalue4`,
MODIFY COLUMN `attrtype6` tinyint(0) UNSIGNED NOT NULL DEFAULT 0 AFTER `attrvalue5`;

/* item_proto types should be unsigned and without useless socket fields */
ALTER TABLE `item_proto`
MODIFY COLUMN `type` tinyint(2) UNSIGNED NOT NULL DEFAULT 0 AFTER `locale_name`,
MODIFY COLUMN `subtype` tinyint(2) UNSIGNED NOT NULL DEFAULT 0 AFTER `type`,
MODIFY COLUMN `limittype0` tinyint(4) UNSIGNED NULL DEFAULT 0 AFTER `magic_pct`,
MODIFY COLUMN `limittype1` tinyint(4) UNSIGNED NULL DEFAULT 0 AFTER `limitvalue0`,
MODIFY COLUMN `applytype0` tinyint(4) UNSIGNED NULL DEFAULT 0 AFTER `limitvalue1`,
MODIFY COLUMN `applytype1` tinyint(4) UNSIGNED NULL DEFAULT 0 AFTER `applyvalue0`,
MODIFY COLUMN `applytype2` tinyint(4) UNSIGNED NULL DEFAULT 0 AFTER `applyvalue1`;

/* extended and fixed item_award */
ALTER TABLE `item_award`
ADD COLUMN `attrtype0` tinyint UNSIGNED NOT NULL DEFAULT 0 AFTER `socket2`,
ADD COLUMN `attrvalue0` smallint NOT NULL DEFAULT 0 AFTER `attrtype0`,
ADD COLUMN `attrtype1` tinyint UNSIGNED NOT NULL DEFAULT 0 AFTER `attrvalue0`,
ADD COLUMN `attrvalue1` smallint NOT NULL DEFAULT 0 AFTER `attrtype1`,
ADD COLUMN `attrtype2` tinyint UNSIGNED NOT NULL DEFAULT 0 AFTER `attrvalue1`,
ADD COLUMN `attrvalue2` smallint NOT NULL DEFAULT 0 AFTER `attrtype2`,
ADD COLUMN `attrtype3` tinyint UNSIGNED NOT NULL DEFAULT 0 AFTER `attrvalue2`,
ADD COLUMN `attrvalue3` smallint NOT NULL DEFAULT 0 AFTER `attrtype3`,
ADD COLUMN `attrtype4` tinyint UNSIGNED NOT NULL DEFAULT 0 AFTER `attrvalue3`,
ADD COLUMN `attrvalue4` smallint NOT NULL DEFAULT 0 AFTER `attrtype4`,
ADD COLUMN `attrtype5` tinyint UNSIGNED NOT NULL DEFAULT 0 AFTER `attrvalue4`,
ADD COLUMN `attrvalue5` smallint NOT NULL DEFAULT 0 AFTER `attrtype5`,
ADD COLUMN `attrtype6` tinyint UNSIGNED NOT NULL DEFAULT 0 AFTER `attrvalue5`,
ADD COLUMN `attrvalue6` smallint NOT NULL DEFAULT 0 AFTER `attrtype6`;

/* item_attr pendant bonus INCOMPLETE https://it-wiki.metin2.gameforge.com/index.php/Talismani */
UPDATE `item_attr` SET `pendant` = 5 WHERE `apply` = 'STUN_PCT' LIMIT 1;
UPDATE `item_attr` SET `pendant` = 5 WHERE `apply` = 'ATTBONUS_HUMAN' LIMIT 1;
INSERT INTO `item_attr` VALUES ('ATTBONUS_TWOHAND', 15, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0);
INSERT INTO `item_attr` VALUES ('ATTBONUS_SWORD', 15, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0);
INSERT INTO `item_attr` VALUES ('ATTBONUS_DAGGER', 15, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0);
INSERT INTO `item_attr` VALUES ('ATTBONUS_BELL', 15, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0);
INSERT INTO `item_attr` VALUES ('ATTBONUS_FAN', 15, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0);
INSERT INTO `item_attr` VALUES ('ATTBONUS_BOW', 15, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0);
INSERT INTO `item_attr` VALUES ('ATTBONUS_CLAW', 15, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0);
INSERT INTO `item_attr` VALUES ('RESIST_HUMAN', 5, 2, 3, 3, 6, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0);
INSERT INTO `item_attr`(`apply`, `prob`, `lv1`, `lv2`, `lv3`, `lv4`, `lv5`, `pendant`) VALUES ('ATTBONUS_DESERT', 10, 10, 15, 15, 20, 30, 5);
INSERT INTO `item_attr`(`apply`, `prob`, `lv1`, `lv2`, `lv3`, `lv4`, `lv5`, `pendant`) VALUES ('ATTBONUS_INSECT', 10, 10, 15, 15, 20, 30, 5);
INSERT INTO `item_attr`(`apply`, `prob`, `lv1`, `lv2`, `lv3`, `lv4`, `lv5`, `pendant`) VALUES ('ATTBONUS_CZ', 10, 10, 15, 15, 20, 30, 5);
INSERT INTO `item_attr`(`apply`, `prob`, `lv1`, `lv2`, `lv3`, `lv4`, `lv5`, `pendant`) VALUES ('RESIST_MOUNT_FALL', 10, 2, 4, 6, 10, 20, 5);

/* fix unauthorized guild auth logo upload */
ALTER TABLE `guild` ADD COLUMN `token` bigint UNSIGNED NOT NULL DEFAULT 0 AFTER `gold`;
