Преглед изворни кода

Updated item groups and little addition on src documentation

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
Cydh Ramdh пре 11 година
родитељ
комит
6b5c0f4163
7 измењених фајлова са 159 додато и 116 уклоњено
  1. 3 0
      db/const.txt
  2. 7 8
      db/re/item_db.txt
  3. 30 0
      db/re/item_misc.txt
  4. 14 11
      db/re/item_package.txt
  5. 7 8
      sql-files/item_db_re.sql
  6. 95 86
      src/map/itemdb.c
  7. 3 3
      src/map/itemdb.h

+ 3 - 0
db/const.txt

@@ -1148,6 +1148,9 @@ IG_Yong_Kwang_Scroll	385
 IG_HALLOWEEN_G_BOX	386
 IG_Solo_Christmas_Gift	387
 IG_Sg_Weapon_Supply_Box	388
+IG_Candy_Holder	389
+IG_Lucky_Bag	390
+IG_Holy_Egg_2	391
 
 SC_ALL	-1
 SC_STONE	0

+ 7 - 8
db/re/item_db.txt

@@ -6210,7 +6210,7 @@
 12700,Insideout_Shirt,Inside-out Shirt,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ warp "malaya",242,211; },{},{}
 12701,Old_Blue_Box_F,Old Blue Box,2,0,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
 12702,Old_Bleu_Box,Old Navy Box,2,0,,200,,,,,0xFFFFFFFF,63,2,,,,,,{ getrandgroupitem(IG_BleuBox),1; getrandgroupitem(IG_BleuBox),1; },{},{}
-12703,Holy_Egg_2,Holy Egg,11,0,,50,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
+12703,Holy_Egg_2,Holy Egg,11,0,,50,,,,,0xFFFFFFFF,63,2,,,,,,{ getrandgroupitem(IG_Holy_Egg_2,1); },{},{}
 12704,Elixir_Of_Life,Elixir of Life,0,0,,10,,,,,0xFFFFFFFF,63,2,,,85,,,{ percentheal 100,0; },{},{}
 12705,Noble_Nameplate,Noble Nameplate,2,0,,100,,,,,0xFFFFFFFF,63,2,,,90,,,{ sc_start SC_EXPBOOST,1800000,100; },{},{}
 12706,Lucky_Cookie01,Lucky Cookie,11,0,,100,,,,,0xFFFFFFFF,63,2,,,,,,{ itemskill "PR_GLORIA",5; },{},{}
@@ -8068,9 +8068,9 @@
 16625,Half_Asprika_box7,Half Asprika box7,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ rentitem 2566,604800; },{},{}
 16628,Brynhild_Box,Half Brynhild Box,2,20,,0,,,,,0xFFFFFFFF,63,2,,,47,,,{ rentitem 15023,604800; },{},{}
 16631,Aributa_Scroll,Aributa Scroll,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
-16638,Life_Ribbon_Box,Life Ribbon Box,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ /*getgroupitem(IG_Life_Ribbon_Box);*/ /*rentitem Life_Ribbon,3600;*/ },{},{}
-16639,Life_Ribbon_Box2,Life Ribbon Box2,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ /*getgroupitem(IG_Life_Ribbon_Box2);*/ /*rentitem Life_Ribbon,7200;*/ },{},{}
-16640,Life_Ribbon_Box3,Life Ribbon Box3,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ /*getgroupitem(IG_Life_Ribbon_Box3);*/ /*rentitem Life_Ribbon,14400;*/ },{},{}
+16638,Life_Ribbon_Box,Life Ribbon Box,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getgroupitem(IG_Life_Ribbon_Box); },{},{}
+16639,Life_Ribbon_Box2,Life Ribbon Box2,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getgroupitem(IG_Life_Ribbon_Box2); },{},{}
+16640,Life_Ribbon_Box3,Life Ribbon Box3,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getgroupitem(IG_Life_Ribbon_Box3); },{},{}
 //
 16652,Flame_Light,Flame Light,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getgroupitem(IG_Flame_Light); },{},{}
 16653,BM75_10Box,BM75 10Box,18,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getitem 12563,10; },{},{}
@@ -8187,7 +8187,7 @@
 16866,Siege_Map_Teleport_Scroll_II_Box_10,Siege Map Teleport Scroll II Box(10),18,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getitem 14591,10; },{},{}
 16867,Siege_Map_Teleport_Scroll_II_Box_30,Siege Map Teleport Scroll II Box(30),18,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getitem 14591,30; },{},{}
 //
-16972,Weather_Report_Box,Weather Report Box,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ /*getgroupitem(IG_Weather_Report_Box);*/ /*getitem Fine_Sun,1;*/ getitem 19518,1; getitem 19520,1; getitem 19519,1; },{},{}
+16972,Weather_Report_Box,Weather Report Box,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ /*getgroupitem(IG_Weather_Report_Box);*/ getitem 19507,1; getitem 19518,1; getitem 19520,1; getitem 19519,1; },{},{}
 16973,Yellow_Hat_Box,Yellow Hat Box,18,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getitem 19515,1; },{},{}
 16974,Comin_Actor_Box,Comin Actor Box,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ /*getgroupitem(IG_Comin_Actor_Box);*/ getitem 19514,1; getitem 19521,1; },{},{}
 16975,Singing_Bird_Box,Singing Bird Box,18,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getitem 19516,1; },{},{}
@@ -8902,9 +8902,9 @@
 22043,AGI_Complement,AGI Complement,4,10,,350,,25,,,0x00000400,56,2,64,,100,1,,{ bonus bAspdRate,5+(getrefine()/4); },{},{}
 22044,Reinforced_Parts_Booster,Reinforced Parts - Booster,4,10,,1000,,23,,,0x00000400,56,2,64,,100,1,,{ bonus2 bSkillUseSP,"NC_HOVERING",15; if(getrefine()>=7){bonus2 bSkillUseSP,"NC_HOVERING",-20;} },{},{}
 22045,Beach_Sandals,Summer Sandals,4,10,,200,,5,,0,0xFFFFFFFF,63,2,64,,0,1,0,{ bonus bFlee,5; bonus3 bAutoSpellWhenHit,"AL_INCAGI",10,300; },{},{}
-22514,Candy_Holder,Candy Holder,11,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
+22514,Candy_Holder,Candy Holder,11,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getrandgroupitem(IG_Candy_Holder,1); getrandgroupitem(IG_Candy_Holder,1); getrandgroupitem(IG_Candy_Holder,1); },{},{}
 22540,Runstone_Luxanima,Lux Anima Runestone,11,2,,100,,,,,0xFFFFFFFF,56,2,,,,,,{ itemskill "RK_LUXANIMA",1; },{},{}
-22558,Lucky_Bag,Lucky Bag,11,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{},{},{}
+22558,Lucky_Bag,Lucky Bag,11,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getrandgroupitem(IG_Lucky_Bag,1); },{},{}
 22559,Mock_Strawberry,Mock Strawberry,11,20,,100,,,,,0xFFFFFFFF,63,2,,,,,,{ percentheal 50,50; itemskill "SM_ENDURE",3; },{},{}
 22563,Lucky_Bag_Of_New_Era,Lucky Bag Of New Era,2,0,,0,,,,,0xFFFFFFFF,63,2,,,,,,{ /* TODO */ },{},{}
 22566,Last_Years_Frost,Last Year's Frost,3,20,,0,,,,,,,,,,,,,{},{},{}
@@ -9021,5 +9021,4 @@
 //unknown,Br_MerPackage,Br_MerPackage,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getgroupitem(IG_Br_MerPackage); },{},{}
 //unknown,Br_ThiefPackage,Br_ThiefPackage,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getgroupitem(IG_Br_ThiefPackage); },{},{}
 //unknown,Sakura_Scroll,Sakura_Scroll,18,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getgroupitem(IG_Sakura_Scroll); },{},{}
-//unknown,Ptotection_Seagod_Box,The Sea God's Call 1 Day Box,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ /*getgroupitem(IG_Ptotection_Seagod_Box);*/ rentitem 6436,86400; },{},{}
 //unknown,Blue_Scroll,Blue_Scroll,2,20,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ getgroupitem(IG_Blue_Scroll); },{},{}

+ 30 - 0
db/re/item_misc.txt

@@ -1220,3 +1220,33 @@
 70,545,1		// Condensed Red Potion
 70,546,1		// Condensed Yellow Potion
 70,547,1		// Condensed White Potion
+//Candy Holder
+IG_Candy_Holder,518,10 //Honey
+IG_Candy_Holder,529,20	//Candy
+IG_Candy_Holder,538,15	//Well_Baked_Cookie
+IG_Candy_Holder,539,10	//Piece_Of_Cake
+IG_Candy_Holder,580,20	//Bread
+IG_Candy_Holder,603,1	//Old_Blue_Box
+IG_Candy_Holder,607,1	//Yggdrasilberry
+IG_Candy_Holder,616,1	//Old_Card_Album
+IG_Candy_Holder,617,1	//Old_Violet_Box
+IG_Candy_Holder,641,1	//Contracts_In_Shadow
+IG_Candy_Holder,7460,10	//Niflheim_Ticket
+IG_Candy_Holder,11550,5	//Pumpkin_Cake
+IG_Candy_Holder,12192,5	//Pumpkin_Pie
+//Lucky Bag
+IG_Lucky_Bag,12018,8	//Fire_Cracker
+IG_Lucky_Bag,663,6	//Korea_Rice_Cake
+IG_Lucky_Bag,668,2	//Handsei
+IG_Lucky_Bag,7647,3	//Taiwan_Luk_Coin
+IG_Lucky_Bag,7649,1	//Big_Luk_Bookmark
+//Holy Egg 2
+IG_Holy_Egg_2,984,4	//Oridecon
+IG_Holy_Egg_2,985,10	//Elunium
+IG_Holy_Egg_2,547,30	//White_Slim_Potion
+IG_Holy_Egg_2,505,30	//Blue_Potion
+IG_Holy_Egg_2,607,3	//Yggdrasilberry
+IG_Holy_Egg_2,608,2	//Seed_Of_Yggdrasil
+IG_Holy_Egg_2,610,15	//Leaf_Of_Yggdrasil
+IG_Holy_Egg_2,616,5	//Old_Card_Album
+IG_Holy_Egg_2,5198,1	//Drooping_Bunny

+ 14 - 11
db/re/item_package.txt

@@ -108,7 +108,7 @@ IG_Solo_Gift_Basket,HandMade_Chocolate_,1,10,1
 
 IG_Couple_Event_Basket,Fire_Cracker_Love,1,10,1
 IG_Couple_Event_Basket,Fire_Cracker_Wday,1,10,1
-//IG_Couple_Event_Basket,Fire_Cracker_Vday,1,10,1
+IG_Couple_Event_Basket,14548,1,10,1
 IG_Couple_Event_Basket,Fire_Cracker_Bday,1,10,1
 IG_Couple_Event_Basket,Fire_Cracker_Xmas,1,10,1
 
@@ -183,11 +183,11 @@ IG_Pet_Egg_Scroll2,Aspersio_5_Scroll,200,2,1,0,0,1
 IG_Pet_Egg_Scroll2,Bubble_Gum,150,2,1,0,0,1
 IG_Pet_Egg_Scroll2,Red_Wizardry_Hat,10,1,1,0,0,1
 
-IG_Pet_Egg_Scroll_Box3,Pet_Egg_Scroll3,0,1,1,0,0,1
+IG_Pet_Egg_Scroll_Box3,Pet_Egg_Scroll3,0,1,0,0,0,1
 
-IG_Pet_Egg_Scroll_Box4,Pet_Egg_Scroll4,0,1,1,0,0,1
+IG_Pet_Egg_Scroll_Box4,Pet_Egg_Scroll4,0,1,0,0,0,1
 
-IG_Pet_Egg_Scroll_Box4,Pet_Egg_Scroll5,0,1,1,0,1
+IG_Pet_Egg_Scroll_Box4,Pet_Egg_Scroll5,0,1,0,0,0,1
 
 IG_Pet_Egg_Scroll3,Battle_Manual,100,2,1,0,0,1
 IG_Pet_Egg_Scroll3,Insurance,200,2,1,0,0,1
@@ -1275,11 +1275,11 @@ IG_Majestic_Devil_Scroll,Magic_Card_Album,10,1,1,0,0,1
 IG_Majestic_Devil_Scroll,Orleans_Glove,20,1,1,0,0,1
 IG_Majestic_Devil_Scroll,Majestic_Evil_Horn,1,1,1,0,0,1
 
-//IG_Life_Ribbon_Box,Life_Ribbon,0,1,0,0,60,1
+IG_Life_Ribbon_Box,5793,0,1,0,0,60,1
 
-//IG_Life_Ribbon_Box2,Life_Ribbon,0,1,0,0,120,1
+IG_Life_Ribbon_Box2,5793,0,1,0,0,120,1
 
-//IG_Life_Ribbon_Box3,Life_Ribbon,0,1,0,0,240,1
+IG_Life_Ribbon_Box3,5793,0,1,0,0,240,1
 
 IG_Magic_Candy_Box10,Magic_Candy,0,10,0,0,0,1
 
@@ -1940,6 +1940,7 @@ IG_Lucky_Egg_C2,Bogy_Horn,150,1,1,1,0,0
 IG_Lucky_Egg_C2,Flame_Sprits_Armor__,150,1,1,1,0,0
 IG_Lucky_Egg_C2,Jasper_Crest,150,1,1,1,0,0
 
+//Duplicated? But has different contents
 //IG_Lucky_Egg_C6,Yggdrasilberry_Box_,928,1,1,0,0,0
 //IG_Lucky_Egg_C6,Battle_Manual_Box,800,1,1,0,0,0
 //IG_Lucky_Egg_C6,Underripe_Yggseed,1000,10,1,0,0,0
@@ -2133,7 +2134,7 @@ IG_Lucky_Egg_C5,Ring_Of_Flame_Lord,50,1,1,1,0,0
 IG_Lucky_Egg_C5,Samambaia_Box,200,1,1,1,0,0
 IG_Lucky_Egg_C5,Ring_Of_Resonance,50,1,1,1,0,0
 
-//IG_Weather_Report_Box,Fine_Sun,0,1,0,0,0,0
+IG_Weather_Report_Box,19507,0,1,0,0,0,0 //Fine_Sun
 IG_Weather_Report_Box,Rainbow,0,1,0,0,0,0
 IG_Weather_Report_Box,Rain_Cloud,0,1,0,0,0,0
 IG_Weather_Report_Box,Lightning_Cloud,0,1,0,0,0,0
@@ -2205,6 +2206,7 @@ IG_Earth_Type_Scroll,Sealed_Lady_Tanee_Card,1,1,1,1,0,0
 IG_Earth_Type_Scroll,Silvervine_Fruit_Box10,1600,1,1,0,0,0
 IG_Earth_Type_Scroll,Diabolic_Scroll,1600,5,1,0,0,0
 
+//Duplicated?
 //IG_Earth_Type_Scroll,5745,150,1,1,1,0,0
 //IG_Earth_Type_Scroll,5744,150,1,1,1,0,0
 //IG_Earth_Type_Scroll,Virgo_Diadem,150,1,1,1,0,0
@@ -2224,7 +2226,7 @@ IG_Earth_Type_Scroll,Diabolic_Scroll,1600,5,1,0,0,0
 //IG_Earth_Type_Scroll,Hen_Set_Box,50,1,1,1,0,0
 //IG_Earth_Type_Scroll,Sealed_Knight_WS_Card,1,1,1,1,0,0
 //IG_Earth_Type_Scroll,Sealed_Lady_Tanee_Card,1,1,1,1,0,0
-//IG_Earth_Type_Scroll,Fruit_Of_Mastela_Box2,1600,1,1,0,0,0
+//IG_Earth_Type_Scroll,Fruit_Of_Mastela_Box2,1600,1,1,0,0,0 //The different only here
 //IG_Earth_Type_Scroll,Diabolic_Scroll,1600,5,1,0,0,0
 
 IG_Splash_Scroll,Songpyun_Box50,1200,1,1,0,0,0
@@ -2691,6 +2693,7 @@ IG_Tw_April_Scroll,Spiked_Scarf_Box,50,1,1,1,0,0
 IG_Tw_April_Scroll,Rainbow_Scarf_Box,50,1,1,1,0,0
 IG_Tw_April_Scroll,Fish_Head_Hat_Box,180,1,1,1,0,0
 
+//Duplicated?
 //IG_Tw_October_Scroll,Max_Weight_Up_Box,432,1,1,0,0,1
 //IG_Tw_October_Scroll,Token_Of_Siegfried_Box,1350,1,1,0,0,1
 //IG_Tw_October_Scroll,Int_Dish_Box,1350,1,1,0,0,1
@@ -2867,7 +2870,7 @@ IG_Egrade_Pocket,Egrade_Coin,200,2,2,0,0,0
 IG_Egrade_Pocket,Malang_Sp_Can,800,1,3,0,0,0
 IG_Egrade_Pocket,Egrade_Coin,200,1,3,0,0,0
 
-//IG_Ptotection_Seagod_Box,Ptotection_Seagod,0,1,0,0,1380,0
+IG_Ptotection_Seagod_Box,Ptotection_Seagod,0,1,0,0,1380,0
 
 IG_Hairtail_Box1,Hairtail,0,1,0,0,60,0
 
@@ -2912,7 +2915,7 @@ IG_Silvervine_Fruit_Box40,Malang_Sp_Can,0,120,0,0,0,0
 IG_Silvervine_Fruit_Box4,Silvervine,0,4,0,0,0,0
 IG_Silvervine_Fruit_Box4,Malang_Sp_Can,0,12,0,0,0,0
 
-//IG_Malang_Woe_Encard_Box,Ptotection_Seagod_Box,0,1,0,0,0,0
+IG_Malang_Woe_Encard_Box,Protection_Seagod_Box,0,1,0,0,0,0
 IG_Malang_Woe_Encard_Box,Octo_Hstick_Box,0,1,0,0,0,0
 
 IG_Xmas_Bless,Fire_Cracker_Xmas,0,10,0,0,0,1

+ 7 - 8
sql-files/item_db_re.sql

@@ -6241,7 +6241,7 @@ REPLACE INTO `item_db_re` VALUES (12699,'Tikbalang_Belt','Tikbalang Harness',2,2
 REPLACE INTO `item_db_re` VALUES (12700,'Insideout_Shirt','Inside-out Shirt',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'warp "malaya",242,211;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (12701,'Old_Blue_Box_F','Old Blue Box',2,0,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (12702,'Old_Bleu_Box','Old Navy Box',2,0,NULL,200,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getrandgroupitem(IG_BleuBox),1; getrandgroupitem(IG_BleuBox),1;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (12703,'Holy_Egg_2','Holy Egg',11,0,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (12703,'Holy_Egg_2','Holy Egg',11,0,NULL,50,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getrandgroupitem(IG_Holy_Egg_2,1);',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (12704,'Elixir_Of_Life','Elixir of Life',0,0,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,'85',NULL,NULL,'percentheal 100,0;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (12705,'Noble_Nameplate','Noble Nameplate',2,0,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,'90',NULL,NULL,'sc_start SC_EXPBOOST,1800000,100;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (12706,'Lucky_Cookie01','Lucky Cookie',11,0,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'itemskill "PR_GLORIA",5;',NULL,NULL);
@@ -8099,9 +8099,9 @@ REPLACE INTO `item_db_re` VALUES (16619,'Yellow_Bunnyband_Box','Yellow Bunnyband
 REPLACE INTO `item_db_re` VALUES (16625,'Half_Asprika_box7','Half Asprika box7',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'rentitem 2566,604800;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16628,'Brynhild_Box','Half Brynhild Box',2,20,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,'47',NULL,NULL,'rentitem 15023,604800;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16631,'Aributa_Scroll','Aributa Scroll',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16638,'Life_Ribbon_Box','Life Ribbon Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'/*getgroupitem(IG_Life_Ribbon_Box);*/ /*rentitem Life_Ribbon,3600;*/',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16639,'Life_Ribbon_Box2','Life Ribbon Box2',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'/*getgroupitem(IG_Life_Ribbon_Box2);*/ /*rentitem Life_Ribbon,7200;*/',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (16640,'Life_Ribbon_Box3','Life Ribbon Box3',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'/*getgroupitem(IG_Life_Ribbon_Box3);*/ /*rentitem Life_Ribbon,14400;*/',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16638,'Life_Ribbon_Box','Life Ribbon Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getgroupitem(IG_Life_Ribbon_Box);',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16639,'Life_Ribbon_Box2','Life Ribbon Box2',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getgroupitem(IG_Life_Ribbon_Box2);',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16640,'Life_Ribbon_Box3','Life Ribbon Box3',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getgroupitem(IG_Life_Ribbon_Box3);',NULL,NULL);
 #
 REPLACE INTO `item_db_re` VALUES (16652,'Flame_Light','Flame Light',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getgroupitem(IG_Flame_Light);',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16653,'BM75_10Box','BM75 10Box',18,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getitem 12563,10;',NULL,NULL);
@@ -8218,7 +8218,7 @@ REPLACE INTO `item_db_re` VALUES (16865,'Siege_Map_Teleport_Scroll_Box_30','Sieg
 REPLACE INTO `item_db_re` VALUES (16866,'Siege_Map_Teleport_Scroll_II_Box_10','Siege Map Teleport Scroll II Box(10)',18,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getitem 14591,10;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16867,'Siege_Map_Teleport_Scroll_II_Box_30','Siege Map Teleport Scroll II Box(30)',18,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getitem 14591,30;',NULL,NULL);
 #
-REPLACE INTO `item_db_re` VALUES (16972,'Weather_Report_Box','Weather Report Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'/*getgroupitem(IG_Weather_Report_Box);*/ /*getitem Fine_Sun,1;*/ getitem 19518,1; getitem 19520,1; getitem 19519,1;',NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (16972,'Weather_Report_Box','Weather Report Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'/*getgroupitem(IG_Weather_Report_Box);*/ getitem 19507,1; getitem 19518,1; getitem 19520,1; getitem 19519,1;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16973,'Yellow_Hat_Box','Yellow Hat Box',18,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getitem 19515,1;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16974,'Comin_Actor_Box','Comin Actor Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'/*getgroupitem(IG_Comin_Actor_Box);*/ getitem 19514,1; getitem 19521,1;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (16975,'Singing_Bird_Box','Singing Bird Box',18,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getitem 19516,1;',NULL,NULL);
@@ -8933,9 +8933,9 @@ REPLACE INTO `item_db_re` VALUES (22015,'Impr_Angel\'s_Arrival','Advanced Angel\
 REPLACE INTO `item_db_re` VALUES (22043,'AGI_Complement','AGI Complement',4,10,NULL,350,NULL,25,NULL,NULL,0x00000400,56,2,64,NULL,'100',1,NULL,'bonus bAspdRate,5+(getrefine()/4);',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (22044,'Reinforced_Parts_Booster','Reinforced Parts - Booster',4,10,NULL,1000,NULL,23,NULL,NULL,0x00000400,56,2,64,NULL,'100',1,NULL,'bonus2 bSkillUseSP,"NC_HOVERING",15; if(getrefine()>=7){bonus2 bSkillUseSP,"NC_HOVERING",-20;}',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (22045,'Beach_Sandals','Summer Sandals',4,10,NULL,200,NULL,5,NULL,0,0xFFFFFFFF,63,2,64,NULL,'0',1,0,'bonus bFlee,5; bonus3 bAutoSpellWhenHit,"AL_INCAGI",10,300;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (22514,'Candy_Holder','Candy Holder',11,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (22514,'Candy_Holder','Candy Holder',11,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getrandgroupitem(IG_Candy_Holder,1); getrandgroupitem(IG_Candy_Holder,1); getrandgroupitem(IG_Candy_Holder,1);',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (22540,'Runstone_Luxanima','Lux Anima Runestone',11,2,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,56,2,NULL,NULL,NULL,NULL,NULL,'itemskill "RK_LUXANIMA",1;',NULL,NULL);
-REPLACE INTO `item_db_re` VALUES (22558,'Lucky_Bag','Lucky Bag',11,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
+REPLACE INTO `item_db_re` VALUES (22558,'Lucky_Bag','Lucky Bag',11,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getrandgroupitem(IG_Lucky_Bag,1);',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (22559,'Mock_Strawberry','Mock Strawberry',11,20,NULL,100,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'percentheal 50,50; itemskill "SM_ENDURE",3;',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (22563,'Lucky_Bag_Of_New_Era','Lucky Bag Of New Era',2,0,NULL,0,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'/* TODO */',NULL,NULL);
 REPLACE INTO `item_db_re` VALUES (22566,'Last_Years_Frost','Last Year\'s Frost',3,20,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
@@ -9052,6 +9052,5 @@ REPLACE INTO `item_db_re` VALUES (28204,'Half_BF_Shotgun1','Half BF Shotgun1',5,
 #REPLACE INTO `item_db_re` VALUES (unknown,'Br_MerPackage','Br_MerPackage',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getgroupitem(IG_Br_MerPackage);',NULL,NULL);
 #REPLACE INTO `item_db_re` VALUES (unknown,'Br_ThiefPackage','Br_ThiefPackage',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getgroupitem(IG_Br_ThiefPackage);',NULL,NULL);
 #REPLACE INTO `item_db_re` VALUES (unknown,'Sakura_Scroll','Sakura_Scroll',18,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getgroupitem(IG_Sakura_Scroll);',NULL,NULL);
-#REPLACE INTO `item_db_re` VALUES (unknown,'Ptotection_Seagod_Box','The Sea God\'s Call 1 Day Box',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'/*getgroupitem(IG_Ptotection_Seagod_Box);*/ rentitem 6436,86400;',NULL,NULL);
 #REPLACE INTO `item_db_re` VALUES (unknown,'Blue_Scroll','Blue_Scroll',2,20,NULL,10,NULL,NULL,NULL,NULL,0xFFFFFFFF,63,2,NULL,NULL,NULL,NULL,NULL,'getgroupitem(IG_Blue_Scroll);',NULL,NULL);
 

+ 95 - 86
src/map/itemdb.c

@@ -611,11 +611,10 @@ bool itemdb_isrestricted(struct item* item, int gmlv, int gmlv2, int (*func)(str
 	return true;
 }
 
-/*==========================================
- *	Specifies if item-type should drop unidentified.
- *------------------------------------------*/
-char itemdb_isidentified(int nameid)
-{
+/** Specifies if item-type should drop unidentified.
+* @param nameid ID of item
+*/
+char itemdb_isidentified(int nameid) {
 	int type=itemdb_type(nameid);
 	switch (type) {
 		case IT_WEAPON:
@@ -628,12 +627,10 @@ char itemdb_isidentified(int nameid)
 	}
 }
 
-/*==========================================
- * Search by name for the override flags available items
- * (Give item another sprite)
- *------------------------------------------*/
-static bool itemdb_read_itemavail(char* str[], int columns, int current)
-{// <nameid>,<sprite>
+/** Search by name for the override flags available items (Give item another sprite)
+* Structure: <nameid>,<sprite>
+*/
+static bool itemdb_read_itemavail(char* str[], int columns, int current) {
 	int nameid, sprite;
 	struct item_data *id;
 
@@ -660,10 +657,9 @@ static bool itemdb_read_itemavail(char* str[], int columns, int current)
 	return true;
 }
 
-/*==========================================
- * read item group data
- * GroupID,ItemID,Rate{,Amount,isMust,isAnnounced,Duration,isNamed,isBound}
- *------------------------------------------*/
+/** Read item group data
+* Structure: GroupID,ItemID,Rate{,Amount,isMust,isAnnounced,Duration,isNamed,isBound}
+*/
 static void itemdb_read_itemgroup_sub(const char* filename, bool silent)
 {
 	FILE *fp;
@@ -716,15 +712,21 @@ static void itemdb_read_itemgroup_sub(const char* filename, bool silent)
 		else //Try reads group id by const
 			script_get_constant(trim(str[0]),&group_id);
 		if (!group_id || group_id >= MAX_ITEMGROUP) {
-			ShowWarning("itemdb_read_itemgroup: Invalid group id '%s' in %s:%d\n", str[0], filename, ln);
+			ShowWarning("itemdb_read_itemgroup: Cannot save '%s' because invalid group id or group db is overflow in %s:%d\n", str[0], filename, ln);
 			continue;
 		}
 
 		//Checking sub group
 		if (rand_group > MAX_ITEMGROUP_RANDGROUP) {
-			ShowWarning("itemdb_read_itemgroup: Invalid sub group %d for group id %d in %s:%d\n", rand_group, group_id, filename, ln);
+			ShowWarning("itemdb_read_itemgroup: Invalid sub group %d for group '%s' in %s:%d\n", rand_group, str[0], filename, ln);
+			continue;
+		}
+
+		if (rand_group && prob < 1) {
+			ShowWarning("itemdb_read_itemgroup: Invalid probaility for group '%s' sub: %d in %s:%d\n", str[0], rand_group, filename, ln);
 			continue;
 		}
+		rand_group -= 1;
 
 		//Checking item
 		trim(str[1]);
@@ -758,15 +760,14 @@ static void itemdb_read_itemgroup_sub(const char* filename, bool silent)
 			itemgroup_db[group_id].must[idx].isNamed = named;
 			itemgroup_db[group_id].must[idx].bound = bound;
 			itemgroup_db[group_id].must_qty++;
-			rand_group = 1;
-		}
-		prob = max(prob,0);
-		//Must item didn't set as random item, skip next process
-		if (!prob) {
-			entries++;
-			continue;
+			//If 'must' item isn't set as random item, skip the next process
+			if (!prob) {
+				entries++;
+				continue;
+			}
+			rand_group = 0;
 		}
-		rand_group -= 1;
+
 		random = &itemgroup_db[group_id].random[rand_group];
 
 		//Check, if the entry for this random group already created or not
@@ -793,19 +794,17 @@ static void itemdb_read_itemgroup_sub(const char* filename, bool silent)
 	return;
 }
 
-static void itemdb_read_itemgroup(const char* basedir, bool silent)
-{
+static void itemdb_read_itemgroup(const char* basedir, bool silent) {
 	char filepath[256];
 	sprintf(filepath, "%s/%s", basedir, "item_group_db.txt");
 	itemdb_read_itemgroup_sub(filepath, silent);
 	return;
 }
 
-/*==========================================
- * Read item forbidden by mapflag (can't equip item)
- *------------------------------------------*/
-static bool itemdb_read_noequip(char* str[], int columns, int current)
-{// <nameid>,<mode>
+/** Read item forbidden by mapflag (can't equip item)
+* Structure: <nameid>,<mode>
+*/
+static bool itemdb_read_noequip(char* str[], int columns, int current) {
 	int nameid;
 	struct item_data *id;
 
@@ -822,11 +821,10 @@ static bool itemdb_read_noequip(char* str[], int columns, int current)
 	return true;
 }
 
-/*==========================================
- * Reads item trade restrictions [Skotlex]
- *------------------------------------------*/
-static bool itemdb_read_itemtrade(char* str[], int columns, int current)
-{// <nameid>,<mask>,<gm level>
+/** Reads item trade restrictions [Skotlex]
+* Structure: <nameid>,<mask>,<gm level>
+*/
+static bool itemdb_read_itemtrade(char* str[], int columns, int current) {
 	int nameid, flag, gmlv;
 	struct item_data *id;
 
@@ -859,11 +857,10 @@ static bool itemdb_read_itemtrade(char* str[], int columns, int current)
 	return true;
 }
 
-/*==========================================
- * Reads item delay amounts [Paradox924X]
- *------------------------------------------*/
-static bool itemdb_read_itemdelay(char* str[], int columns, int current)
-{// <nameid>,<delay>
+/** Reads item delay amounts [Paradox924X]
+* Structure: <nameid>,<delay>
+*/
+static bool itemdb_read_itemdelay(char* str[], int columns, int current) {
 	int nameid, delay;
 	struct item_data *id;
 
@@ -888,11 +885,10 @@ static bool itemdb_read_itemdelay(char* str[], int columns, int current)
 	return true;
 }
 
-/*==================================================================
- * Reads item stacking restrictions
- *----------------------------------------------------------------*/
-static bool itemdb_read_stack(char* fields[], int columns, int current)
-{// <item id>,<stack limit amount>,<type>
+/** Reads item stacking restrictions
+* Structure: <item id>,<stack limit amount>,<type>
+*/
+static bool itemdb_read_stack(char* fields[], int columns, int current) {
 	unsigned short nameid, amount;
 	unsigned int type;
 	struct item_data* id;
@@ -928,10 +924,10 @@ static bool itemdb_read_stack(char* fields[], int columns, int current)
 	return true;
 }
 
-
-/// Reads items allowed to be sold in buying stores
-static bool itemdb_read_buyingstore(char* fields[], int columns, int current)
-{// <nameid>
+/** Reads items allowed to be sold in buying stores
+* <nameid>
+*/
+static bool itemdb_read_buyingstore(char* fields[], int columns, int current) {
 	int nameid;
 	struct item_data* id;
 
@@ -954,11 +950,10 @@ static bool itemdb_read_buyingstore(char* fields[], int columns, int current)
 	return true;
 }
 
-/*******************************************
-** Item usage restriction (item_nouse.txt)
-********************************************/
-static bool itemdb_read_nouse(char* fields[], int columns, int current)
-{// <nameid>,<flag>,<override>
+/** Item usage restriction (item_nouse.txt)
+* <nameid>,<flag>,<override>
+*/
+static bool itemdb_read_nouse(char* fields[], int columns, int current) {
 	int nameid, flag, override;
 	struct item_data* id;
 
@@ -1176,9 +1171,9 @@ static void itemdb_re_split_atoi(char *str, int *atk, int *matk) {
 	return;
 }
 #endif
-/*==========================================
- * processes one itemdb entry
- *------------------------------------------*/
+/**
+* Processes one itemdb entry
+*/
 static bool itemdb_parse_dbrow(char** str, const char* source, int line, int scriptopt) {
 	/*
 		+----+--------------+---------------+------+-----------+------------+--------+--------+---------+-------+-------+------------+-------------+---------------+-----------------+--------------+-------------+------------+------+--------+--------------+----------------+
@@ -1309,10 +1304,10 @@ static bool itemdb_parse_dbrow(char** str, const char* source, int line, int scr
 	return true;
 }
 
-/*==========================================
- * Reading item from item db
- * item_db2 overwriting item_db
- *------------------------------------------*/
+/**
+* Read item from item db
+* item_db2 overwriting item_db
+*/
 static int itemdb_readdb(void){
 	const char* filename[] = {
 		DBPATH"item_db.txt",
@@ -1437,9 +1432,9 @@ static int itemdb_readdb(void){
 	return 0;
 }
 
-/*======================================
- * item_db table reading
- *======================================*/
+/**
+* Read item_db table
+*/
 static int itemdb_read_sqldb(void) {
 
 	const char* item_db_name[] = {
@@ -1487,14 +1482,15 @@ static int itemdb_read_sqldb(void) {
 	return 0;
 }
 
-/*==========================================
-* Unique item ID function
+/** Unique item ID function
 * Only one operation by once
-* Flag:
+* @param flag
 * 0 return new id
 * 1 set new value, checked with current value
 * 2 set new value bypassing anything
-* 3/other return last value
+* 3/other
+* @param value
+* @return last value
 *------------------------------------------*/
 uint64 itemdb_unique_id(int8 flag, int64 value) {
 	static uint64 item_uid = 0;
@@ -1512,7 +1508,11 @@ uint64 itemdb_unique_id(int8 flag, int64 value) {
 
 	return ++item_uid;
 }
-static void itemdb_uid_load(){
+
+/**
+* Load Unique ID for Item
+*/
+static void itemdb_uid_load(void){
 
 	char * uid;
 	if (SQL_ERROR == Sql_Query(mmysql_handle, "SELECT `value` FROM `interreg` WHERE `varname`='unique_id'"))
@@ -1530,11 +1530,11 @@ static void itemdb_uid_load(){
 	Sql_FreeResult(mmysql_handle);
 }
 
-/*==========================================
- * Check if the item is restricted by item_noequip.txt (return):
- * true		- can't be used
- * false	- can be used
- *------------------------------------------*/
+/** Check if the item is restricted by item_noequip.txt
+* @param id Item that will be checked
+* @param m Map ID
+* @return true: can't be used; false: can be used
+*/
 bool itemdb_isNoEquip(struct item_data *id, uint16 m) {
 	if (!id->flag.no_equip)
 		return false;
@@ -1549,9 +1549,9 @@ bool itemdb_isNoEquip(struct item_data *id, uint16 m) {
 	return false;
 }
 
-/*====================================
- * read all item-related databases
- *------------------------------------*/
+/**
+* Read all item-related databases
+*/
 static void itemdb_read(void) {
 	int i;
 	const char* dbsubpath[] = {
@@ -1592,9 +1592,10 @@ static void itemdb_read(void) {
  * Initialize / Finalize
  *------------------------------------------*/
 
-/// Destroys the item_data.
-static void destroy_item_data(struct item_data* self, bool free_self)
-{
+/**
+* Destroys the item_data.
+*/
+static void destroy_item_data(struct item_data* self, bool free_self) {
 	if( self == NULL )
 		return;
 	// free scripts
@@ -1637,8 +1638,10 @@ static int itemdb_final_sub(DBKey key, DBData *data, va_list ap)
 	return 0;
 }
 
-void itemdb_reload(void)
-{
+/**
+* Reload Item DB
+*/
+void itemdb_reload(void) {
 	struct s_mapiterator* iter;
 	struct map_session_data* sd;
 
@@ -1720,8 +1723,11 @@ void itemdb_reload(void)
 	mapit_free(iter);
 }
 
-void do_final_itemdb(void)
-{
+
+/**
+* Finalizing Item DB
+*/
+void do_final_itemdb(void) {
 	int i;
 
 	for( i = 0; i < ARRAYLENGTH(itemdb_array); ++i )
@@ -1746,6 +1752,9 @@ void do_final_itemdb(void)
 	db_destroy(itemdb_combo);
 }
 
+/**
+* Initializing Item DB
+*/
 int do_init_itemdb(void) {
 	memset(itemdb_array, 0, sizeof(itemdb_array));
 	itemdb_other = idb_alloc(DB_OPT_BASE);

+ 3 - 3
src/map/itemdb.h

@@ -23,9 +23,9 @@
 #define IG_FINDINGORE 6
 #define IG_POTION 37
 
-#define MAX_ITEMGROUP 390 ///The max. item group count (increase this when needed). TODO: Remove this limit and use dynamic allocaton if needed
+#define MAX_ITEMGROUP 400 ///The max. item group count (increase this when needed). TODO: Remove this limit and use dynamic size or DBMap if needed
 
-#define MAX_ITEMGROUP_RANDGROUP 4	///Max group for random item (increase this when needed). TODO: Remove this limit and use dynamic allocaton if needed
+#define MAX_ITEMGROUP_RANDGROUP 4	///Max group for random item (increase this when needed). TODO: Remove this limit and use dynamic size if needed
 
 #define CARD0_FORGE 0x00FF
 #define CARD0_CREATE 0x00FE
@@ -402,7 +402,7 @@ struct s_item_group_random {
 struct s_item_group_db {
 	struct s_item_group *must;
 	uint16 must_qty;
-	struct s_item_group_random random[MAX_ITEMGROUP_RANDGROUP]; //! TODO: Move this fixed array to dynamic allocation if needed.
+	struct s_item_group_random random[MAX_ITEMGROUP_RANDGROUP]; //! TODO: Move this fixed array to dynamic size if needed.
 };
 
 struct item_data* itemdb_searchname(const char *name);