Browse Source

fixed spawn of treasure boxes
fixed present_log
Mobs drops: expanded 8 slots into 10 (except READING info from TXT / SQL dbs. But added a plug - to make eA work with old DBs)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/branches/stable@1115 54d463be-8e91-2dee-dedb-b68131a5f0ec

Lupus 20 years ago
parent
commit
03b82d9adb
10 changed files with 132 additions and 27 deletions
  1. 10 0
      Changelog-SVN.txt
  2. 4 1
      npc/Changelog.txt
  3. 51 7
      npc/guild/ev_agit_event.txt
  4. 31 1
      npc/guild/gldfunc_treasure.txt
  5. 1 1
      src/map/atcommand.c
  6. 1 0
      src/map/log.c
  7. 26 9
      src/map/mob.c
  8. 1 1
      src/map/mob.h
  9. 2 2
      src/map/pc.c
  10. 5 5
      src/map/script.c

+ 10 - 0
Changelog-SVN.txt

@@ -1,5 +1,15 @@
 Date	Added
 Date	Added
 
 
+02/16
+        * Fixed Treasure Box spawn bug in all castles. [Lupus]
+        * Fixed wrong PresentLOG (it wasn't showing PRESENT BOX type ID) [Lupus]
+	* Expanded Monsters Drops Slots from 8 to 10. Everywhere in the sources. [Lupus]
+	  But in TXT / SQL monsters DB reading functions, I added a temp plug
+	  to make eA work fine with existing DBs. It reads only 8 drops and fills
+	  9th and 10th drops with Zero.
+	  On expanding MOB_DB.TXT we'll remove that plug.
+	  We are adding new cards and some monsters
+	  have no free slots for them. Current state is tested and works fine.
 02/15
 02/15
         * Allow Potion Pitcher to be able to cast on yourself -- i've almost forgot
         * Allow Potion Pitcher to be able to cast on yourself -- i've almost forgot
           about this, thanks to Filougarou and Poki#3 for the fix ^^; [celest]
           about this, thanks to Filougarou and Poki#3 for the fix ^^; [celest]

+ 4 - 1
npc/Changelog.txt

@@ -9,7 +9,7 @@ Darkchild
 	* Monk Quest - Botting An Acolyte Atm
 	* Monk Quest - Botting An Acolyte Atm
 Lupus
 Lupus
 	* looking for exploits, optimization, bugs hunt
 	* looking for exploits, optimization, bugs hunt
-	* Lolz - 100%
+	* Adding new cards, checking/adding mobs/items
 Aria
 Aria
 	* Devnpc
 	* Devnpc
 	* Correct typos/mistakes
 	* Correct typos/mistakes
@@ -34,6 +34,9 @@ Other Ppl
 
 
 Date		Added
 Date		Added
 ======
 ======
+02/16
+        * Fixed treasure chests spawn in the castles. (had to simplify some code and unroll some loops) [Lupus]
+
 02/13
 02/13
         * Added midas's fixes for bugs in the novice training ground and the custom
         * Added midas's fixes for bugs in the novice training ground and the custom
           jobchanger script [celest]
           jobchanger script [celest]

+ 51 - 7
npc/guild/ev_agit_event.txt

@@ -4,7 +4,7 @@
 //= kalen (1.0)
 //= kalen (1.0)
 //= 1.1 by Akaru and ho|yAnge|
 //= 1.1 by Akaru and ho|yAnge|
 //===== Current Version: =====================================
 //===== Current Version: =====================================
-//= 1.3
+//= 1.4
 //===== Compatible With: =====================================
 //===== Compatible With: =====================================
 //= eAthena 0.1+; RO Episode 4+
 //= eAthena 0.1+; RO Episode 4+
 //===== Description: =========================================
 //===== Description: =========================================
@@ -19,6 +19,8 @@
 //= v1.3 Moved treasure spawn time here.[kobra_k88]
 //= v1.3 Moved treasure spawn time here.[kobra_k88]
 //= v1.3a Implemented Shadowlady's idea to allow for different
 //= v1.3a Implemented Shadowlady's idea to allow for different
 //= start/stop times on different days.[kobra_k88]
 //= start/stop times on different days.[kobra_k88]
+//= 1.4 Fixed treasure chests spawn! We had to unroll some loops
+//= Now they appear in castles from 00:01 to 00:24. [Lupus]
 //============================================================
 //============================================================
 
 
 // WoE Start/Stop times
 // WoE Start/Stop times
@@ -51,34 +53,76 @@ L_Start:
 - script TreasSpawn -1,{
 - script TreasSpawn -1,{
 	end;
 	end;
 
 
-OnClock0000:
+OnClock0001:
 	callfunc "F_GldTreas","aldeg_cas01","A01",$boxNumA01,$@bxA01,$@boxIdA01,1324,114,218,123,227,0;
 	callfunc "F_GldTreas","aldeg_cas01","A01",$boxNumA01,$@bxA01,$@boxIdA01,1324,114,218,123,227,0;
+	end;
+OnClock0002:
 	callfunc "F_GldTreas","aldeg_cas02","A02",$boxNumA02,$@bxA02,$@boxIdA02,1326,130,226,138,235,0;
 	callfunc "F_GldTreas","aldeg_cas02","A02",$boxNumA02,$@bxA02,$@boxIdA02,1326,130,226,138,235,0;
+	end;
+OnClock0003:
 	callfunc "F_GldTreas","aldeg_cas03","A03",$boxNumA03,$@bxA03,$@boxIdA03,1328,220,264,229,273,0;
 	callfunc "F_GldTreas","aldeg_cas03","A03",$boxNumA03,$@bxA03,$@boxIdA03,1328,220,264,229,273,0;
+	end;
+OnClock0004:
 	callfunc "F_GldTreas","aldeg_cas04","A04",$boxNumA04,$@bxA04,$@boxIdA04,1330,80,8,89,17,0;
 	callfunc "F_GldTreas","aldeg_cas04","A04",$boxNumA04,$@bxA04,$@boxIdA04,1330,80,8,89,17,0;
+	end;
+OnClock0005:
 	callfunc "F_GldTreas","aldeg_cas05","A05",$boxNumA05,$@bxA05,$@boxIdA05,1332,58,8,65,15,0;
 	callfunc "F_GldTreas","aldeg_cas05","A05",$boxNumA05,$@bxA05,$@boxIdA05,1332,58,8,65,15,0;
-
+	end;
+OnClock0006:
 	callfunc "F_GldTreas","gefg_cas01","G01",$boxNumG01,$@bxG01,$@boxIdG01,1334,150,108,158,114,0;
 	callfunc "F_GldTreas","gefg_cas01","G01",$boxNumG01,$@bxG01,$@boxIdG01,1334,150,108,158,114,0;
+	end;
+OnClock0007:
 	callfunc "F_GldTreas","gefg_cas02","G02",$boxNumG02,$@bxG02,$@boxIdG02,1336,136,112,145,118,0;
 	callfunc "F_GldTreas","gefg_cas02","G02",$boxNumG02,$@bxG02,$@boxIdG02,1336,136,112,145,118,0;
+	end;
+OnClock0008:
 	callfunc "F_GldTreas","gefg_cas03","G03",$boxNumG03,$@bxG03,$@boxIdG03,1338,266,286,275,293,0;
 	callfunc "F_GldTreas","gefg_cas03","G03",$boxNumG03,$@bxG03,$@boxIdG03,1338,266,286,275,293,0;
+	end;
+OnClock0009:
 	callfunc "F_GldTreas","gefg_cas04","G04",$boxNumG04,$@bxG04,$@boxIdG04,1340,112,114,119,123,0;
 	callfunc "F_GldTreas","gefg_cas04","G04",$boxNumG04,$@bxG04,$@boxIdG04,1340,112,114,119,123,0;
+	end;
+OnClock0010:
 	callfunc "F_GldTreas","gefg_cas05","G05",$boxNumG05,$@bxG05,$@boxIdG05,1342,140,106,147,113,0;
 	callfunc "F_GldTreas","gefg_cas05","G05",$boxNumG05,$@bxG05,$@boxIdG05,1342,140,106,147,113,0;
-
+	end;
+OnClock0011:
 	callfunc "F_GldTreas","payg_cas01","Py01",$boxNumPy01,$@bxPy01,$@boxIdPy01,1344,286,4,295,13,0;
 	callfunc "F_GldTreas","payg_cas01","Py01",$boxNumPy01,$@bxPy01,$@boxIdPy01,1344,286,4,295,13,0;
+	end;
+OnClock0012:
 	callfunc "F_GldTreas","payg_cas02","Py02",$boxNumPy02,$@bxPy02,$@boxIdPy02,1346,140,140,148,149,0;
 	callfunc "F_GldTreas","payg_cas02","Py02",$boxNumPy02,$@bxPy02,$@boxIdPy02,1346,140,140,148,149,0;
+	end;
+OnClock0013:
 	callfunc "F_GldTreas","payg_cas03","Py03",$boxNumPy03,$@bxPy03,$@boxIdPy03,1348,154,164,162,173,0;
 	callfunc "F_GldTreas","payg_cas03","Py03",$boxNumPy03,$@bxPy03,$@boxIdPy03,1348,154,164,162,173,0;
+	end;
+OnClock0014:
 	callfunc "F_GldTreas","payg_cas04","Py04",$boxNumPy04,$@bxPy04,$@boxIdPy04,1350,142,44,151,51,0;
 	callfunc "F_GldTreas","payg_cas04","Py04",$boxNumPy04,$@bxPy04,$@boxIdPy04,1350,142,44,151,51,0;
+	end;
+OnClock0015:
 	callfunc "F_GldTreas","payg_cas05","Py05",$boxNumPy05,$@bxPy05,$@boxIdPy05,1352,152,128,160,135,0;
 	callfunc "F_GldTreas","payg_cas05","Py05",$boxNumPy05,$@bxPy05,$@boxIdPy05,1352,152,128,160,135,0;
-
+	end;
+OnClock0016:
 	callfunc "F_GldTreas","prtg_cas01","Pt01",$boxNumPt01,$@bxPt01,$@boxIdPt01,1354,6,204,15,213,0;
 	callfunc "F_GldTreas","prtg_cas01","Pt01",$boxNumPt01,$@bxPt01,$@boxIdPt01,1354,6,204,15,213,0;
+	end;
+OnClock0017:
 	callfunc "F_GldTreas","prtg_cas02","Pt02",$boxNumPt02,$@bxPt02,$@boxIdPt02,1356,198,224,207,233,0;
 	callfunc "F_GldTreas","prtg_cas02","Pt02",$boxNumPt02,$@bxPt02,$@boxIdPt02,1356,198,224,207,233,0;
+	end;
+OnClock0018:
 	callfunc "F_GldTreas","prtg_cas03","Pt03",$boxNumPt03,$@bxPt03,$@boxIdPt03,1358,184,128,193,135,0;
 	callfunc "F_GldTreas","prtg_cas03","Pt03",$boxNumPt03,$@bxPt03,$@boxIdPt03,1358,184,128,193,135,0;
+	end;
+OnClock0019:
 	callfunc "F_GldTreas","prtg_cas04","Pt04",$boxNumPt04,$@bxPt04,$@boxIdPt04,1360,266,158,275,167,0;
 	callfunc "F_GldTreas","prtg_cas04","Pt04",$boxNumPt04,$@bxPt04,$@boxIdPt04,1360,266,158,275,167,0;
+	end;
+OnClock0020:
 	callfunc "F_GldTreas","prtg_cas05","Pt05",$boxNumPt05,$@bxPt05,$@boxIdPt05,1362,272,174,279,181,0;
 	callfunc "F_GldTreas","prtg_cas05","Pt05",$boxNumPt05,$@bxPt05,$@boxIdPt05,1362,272,174,279,181,0;
-
+	end;
+OnClock0021:
 	callfunc "F_GldTreas","nguild_alde","N01",$boxNumN01,$@bxN01,$@boxIdN01,1324,114,218,123,227,0;
 	callfunc "F_GldTreas","nguild_alde","N01",$boxNumN01,$@bxN01,$@boxIdN01,1324,114,218,123,227,0;
+	end;
+OnClock0022:
 	callfunc "F_GldTreas","nguild_gef","N02",$boxNumN02,$@bxN02,$@boxIdN02,1334,150,108,158,114,0;
 	callfunc "F_GldTreas","nguild_gef","N02",$boxNumN02,$@bxN02,$@boxIdN02,1334,150,108,158,114,0;
+	end;
+OnClock0023:
 	callfunc "F_GldTreas","nguild_pay","N03",$boxNumN03,$@bxN03,$@boxIdN03,1344,286,4,295,13,0;
 	callfunc "F_GldTreas","nguild_pay","N03",$boxNumN03,$@bxN03,$@boxIdN03,1344,286,4,295,13,0;
+	end;
+OnClock0024:
 	callfunc "F_GldTreas","nguild_prt","N04",$boxNumN04,$@bxN04,$@boxIdN04,1354,6,204,15,213,0;
 	callfunc "F_GldTreas","nguild_prt","N04",$boxNumN04,$@bxN04,$@boxIdN04,1354,6,204,15,213,0;
 	end;
 	end;
-}
+}

+ 31 - 1
npc/guild/gldfunc_treasure.txt

@@ -4,7 +4,7 @@
 //= holyAngelX (1.0)
 //= holyAngelX (1.0)
 //= 1.1 by Akaru and ho|yAnge|X
 //= 1.1 by Akaru and ho|yAnge|X
 //===== Current Version: =====================================
 //===== Current Version: =====================================
-//= 1.2b
+//= 1.3
 //===== Compatible With: =====================================
 //===== Compatible With: =====================================
 //= eAthena 0.1+; RO Episode 4+
 //= eAthena 0.1+; RO Episode 4+
 //===== Description: =========================================
 //===== Description: =========================================
@@ -32,6 +32,7 @@
 //= v1.2a Function now returns to script that called it.  Removed TreasureSpawn2.
 //= v1.2a Function now returns to script that called it.  Removed TreasureSpawn2.
 //= Changed back to using specific global variables for number of boxes and the box id. [kobra_k88]
 //= Changed back to using specific global variables for number of boxes and the box id. [kobra_k88]
 //= v1.2b Added a check to allow un broken treasure chests to respawn after map server restart.[kobra_k88]
 //= v1.2b Added a check to allow un broken treasure chests to respawn after map server restart.[kobra_k88]
+//= 1.3 Fixed treasure boxes spawn. (Unrolled one loop a bit) [Lupus]
 //============================================================
 //============================================================
 
 
 
 
@@ -51,6 +52,35 @@ function	script	F_GldTreas	{
 	set getarg(3), getarg(2);	//sets the counter variable = to the box number amount
 	set getarg(3), getarg(2);	//sets the counter variable = to the box number amount
 
 
 TreasureSpawn:
 TreasureSpawn:
+
+	set getarg(4), getarg(5);	//sets the box id variable = to the box id
+	set $@temp, rand(4);
+	if ($@temp > 2) set getarg(4), getarg(4) + 1;
+	areamonster getarg(0)+".gat",getarg(6),getarg(7),getarg(8),getarg(9),"Treasure Chest",getarg(4),1,"Treasure_"+getarg(1)+"::OnDied";
+	set getarg(3), getarg(3) - 1;
+	if(getarg(3) <= 0) return;
+
+	set getarg(4), getarg(5);	//sets the box id variable = to the box id
+	set $@temp, rand(4);
+	if ($@temp > 2) set getarg(4), getarg(4) + 1;
+	areamonster getarg(0)+".gat",getarg(6),getarg(7),getarg(8),getarg(9),"Treasure Chest",getarg(4),1,"Treasure_"+getarg(1)+"::OnDied";
+	set getarg(3), getarg(3) - 1;
+	if(getarg(3) <= 0) return;
+
+	set getarg(4), getarg(5);	//sets the box id variable = to the box id
+	set $@temp, rand(4);
+	if ($@temp > 2) set getarg(4), getarg(4) + 1;
+	areamonster getarg(0)+".gat",getarg(6),getarg(7),getarg(8),getarg(9),"Treasure Chest",getarg(4),1,"Treasure_"+getarg(1)+"::OnDied";
+	set getarg(3), getarg(3) - 1;
+	if(getarg(3) <= 0) return;
+
+	set getarg(4), getarg(5);	//sets the box id variable = to the box id
+	set $@temp, rand(4);
+	if ($@temp > 2) set getarg(4), getarg(4) + 1;
+	areamonster getarg(0)+".gat",getarg(6),getarg(7),getarg(8),getarg(9),"Treasure Chest",getarg(4),1,"Treasure_"+getarg(1)+"::OnDied";
+	set getarg(3), getarg(3) - 1;
+	if(getarg(3) <= 0) return;
+
 	set getarg(4), getarg(5);	//sets the box id variable = to the box id
 	set getarg(4), getarg(5);	//sets the box id variable = to the box id
 	set $@temp, rand(4);
 	set $@temp, rand(4);
 	if ($@temp > 2) set getarg(4), getarg(4) + 1;
 	if ($@temp > 2) set getarg(4), getarg(4) + 1;

+ 1 - 1
src/map/atcommand.c

@@ -8994,7 +8994,7 @@ int atcommand_mobinfo(
 	}
 	}
 	strcpy(output," Drops:");
 	strcpy(output," Drops:");
 	j=0;
 	j=0;
-	for (i=0; i<8; i++) {
+	for (i=0; i<10; i++) { // 8 -> 10 Lupus
 		if ( mob_db[mob_id].dropitem[i].nameid<=0 || mob_db[mob_id].dropitem[i].p<=0)
 		if ( mob_db[mob_id].dropitem[i].nameid<=0 || mob_db[mob_id].dropitem[i].p<=0)
 			continue;
 			continue;
 		if( (item_data = itemdb_search(mob_db[mob_id].dropitem[i].nameid)) == NULL)
 		if( (item_data = itemdb_search(mob_db[mob_id].dropitem[i].nameid)) == NULL)

+ 1 - 0
src/map/log.c

@@ -48,6 +48,7 @@ int log_drop(struct map_session_data *sd, int monster_id, int *log_drop)
 	#ifndef TXT_ONLY
 	#ifndef TXT_ONLY
 	if(log_config.sql_logs > 0)
 	if(log_config.sql_logs > 0)
 	{
 	{
+		//TODO: Expand 8 slots into 10
 		sprintf(tmp_sql, "INSERT DELAYED INTO `%s` (`drop_date`, `kill_char_id`, `monster_id`, `item1`, `item2`, `item3`, `item4`, `item5`, `item6`, `item7`, `item8`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s') ", log_config.log_drop_db, sd->status.char_id, monster_id, log_drop[0], log_drop[1], log_drop[2], log_drop[3], log_drop[4], log_drop[5], log_drop[6], log_drop[7], sd->mapname);
 		sprintf(tmp_sql, "INSERT DELAYED INTO `%s` (`drop_date`, `kill_char_id`, `monster_id`, `item1`, `item2`, `item3`, `item4`, `item5`, `item6`, `item7`, `item8`, `map`) VALUES (NOW(), '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%s') ", log_config.log_drop_db, sd->status.char_id, monster_id, log_drop[0], log_drop[1], log_drop[2], log_drop[3], log_drop[4], log_drop[5], log_drop[6], log_drop[7], sd->mapname);
 		if(mysql_query(&mmysql_handle, tmp_sql))
 		if(mysql_query(&mmysql_handle, tmp_sql))
 			printf("DB server Error - %s\n",mysql_error(&mmysql_handle));
 			printf("DB server Error - %s\n",mysql_error(&mmysql_handle));

+ 26 - 9
src/map/mob.c

@@ -2531,9 +2531,9 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
 
 
 	// item drop
 	// item drop
 	if(!(type&1)) {
 	if(!(type&1)) {
-		int log_item[8] = {0};
+		int log_item[10] = {0}; //8 -> 10 Lupus
 		int drop_ore = -1,drop_items=0; //slot N for DROP LOG, number of dropped items
 		int drop_ore = -1,drop_items=0; //slot N for DROP LOG, number of dropped items
-		for(i=0;i<8;i++){
+		for(i=0;i<10;i++){ // 8 -> 10 Lupus
 			struct delay_item_drop *ditem;
 			struct delay_item_drop *ditem;
 			int drop_rate;
 			int drop_rate;
 
 
@@ -2552,7 +2552,7 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
 				drop_ore = i; //we rmember an empty slot to put there ORE DISCOVERY drop later.
 				drop_ore = i; //we rmember an empty slot to put there ORE DISCOVERY drop later.
 				continue;
 				continue;
 			}
 			}
-			drop_items++;
+			drop_items++; //we cound if there were any drops
 
 
 			ditem=(struct delay_item_drop *)aCalloc(1,sizeof(struct delay_item_drop));
 			ditem=(struct delay_item_drop *)aCalloc(1,sizeof(struct delay_item_drop));
 			ditem->nameid = mob_db[md->class_].dropitem[i].nameid;
 			ditem->nameid = mob_db[md->class_].dropitem[i].nameid;
@@ -2573,8 +2573,9 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
 			int itemid[17] = { 714, 756, 757, 969, 984, 985, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1002 };
 			int itemid[17] = { 714, 756, 757, 969, 984, 985, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999, 1002 };
 			ditem=(struct delay_item_drop *)aCalloc(1,sizeof(struct delay_item_drop));
 			ditem=(struct delay_item_drop *)aCalloc(1,sizeof(struct delay_item_drop));
 			ditem->nameid = itemid[rand()%17]; //should return from 0 to 16
 			ditem->nameid = itemid[rand()%17]; //should return from 0 to 16
-			if (drop_ore<0) i=7; //we have only 8 slots in LOG, there's a check to not overflow
+			if (drop_ore<0) i=7; //we have only 10 slots in LOG, there's a check to not overflow <- TODO: change 7 to 9
 			log_item[i] = ditem->nameid; //it's for logging only
 			log_item[i] = ditem->nameid; //it's for logging only
+			drop_items++; //we cound if there were any drops
 			ditem->amount = 1;
 			ditem->amount = 1;
 			ditem->m = md->bl.m;
 			ditem->m = md->bl.m;
 			ditem->x = md->bl.x;
 			ditem->x = md->bl.x;
@@ -3836,9 +3837,9 @@ static int mob_makedummymobdb(int class_)
 	mob_db[class_].adelay=1000;
 	mob_db[class_].adelay=1000;
 	mob_db[class_].amotion=500;
 	mob_db[class_].amotion=500;
 	mob_db[class_].dmotion=500;
 	mob_db[class_].dmotion=500;
-	mob_db[class_].dropitem[0].nameid=909;	// Jellopy
-	mob_db[class_].dropitem[0].p=1000;
-	for(i=1;i<8;i++){
+	//mob_db[class_].dropitem[0].nameid=909;	// Jellopy
+	//mob_db[class_].dropitem[0].p=1000;
+	for(i=1;i<10;i++){ // 8-> 10 Lupus
 		mob_db[class_].dropitem[i].nameid=0;
 		mob_db[class_].dropitem[i].nameid=0;
 		mob_db[class_].dropitem[i].p=0;
 		mob_db[class_].dropitem[i].p=0;
 	}
 	}
@@ -3942,7 +3943,7 @@ static int mob_readdb(void)
 			mob_db[class_].amotion=atoi(str[27]);
 			mob_db[class_].amotion=atoi(str[27]);
 			mob_db[class_].dmotion=atoi(str[28]);
 			mob_db[class_].dmotion=atoi(str[28]);
 
 
-			for(i=0;i<8;i++){
+			for(i=0;i<8;i++){ // TODO: 8 -> 10 Lupus
 				int rate = 0,type,ratemin,ratemax;
 				int rate = 0,type,ratemin,ratemax;
 				mob_db[class_].dropitem[i].nameid=atoi(str[29+i*2]);
 				mob_db[class_].dropitem[i].nameid=atoi(str[29+i*2]);
 				type = itemdb_type(mob_db[class_].dropitem[i].nameid);
 				type = itemdb_type(mob_db[class_].dropitem[i].nameid);
@@ -4014,6 +4015,15 @@ static int mob_readdb(void)
 				rate = (rate < ratemin)? ratemin: (rate > ratemax)? ratemax: rate;
 				rate = (rate < ratemin)? ratemin: (rate > ratemax)? ratemax: rate;
 				mob_db[class_].dropitem[i].p = rate;
 				mob_db[class_].dropitem[i].p = rate;
 			}
 			}
+			//TEMP PLUG till we expand TXT DB and SQL DBs [Lupus]
+			for(i=8;i<10;i++){ //TODO: 8 -> 10 Lupus
+				//we fill 9th and 10th DROP slots with 0
+				mob_db[class_].dropitem[i].nameid = mob_db[class_].dropitem[i].p = 0;
+			}
+			//END of temp plug
+
+			//TODO: Shift columns (after adding 2 drops (4 coulmns)) Lupus
+
 			// Item1,Item2
 			// Item1,Item2
 			mob_db[class_].mexp=atoi(str[45])*battle_config.mvp_exp_rate/100;
 			mob_db[class_].mexp=atoi(str[45])*battle_config.mvp_exp_rate/100;
 			mob_db[class_].mexpper=atoi(str[46]);
 			mob_db[class_].mexpper=atoi(str[46]);
@@ -4409,7 +4419,7 @@ static int mob_read_sqldb(void)
 			mob_db[class_].amotion=atoi(str[27]);
 			mob_db[class_].amotion=atoi(str[27]);
 			mob_db[class_].dmotion=atoi(str[28]);
 			mob_db[class_].dmotion=atoi(str[28]);
 
 
-            for(i=0;i<8;i++){
+			for(i=0;i<8;i++){ //TODO: 8 -> 10 Lupus
 				int rate = 0,type,ratemin,ratemax;
 				int rate = 0,type,ratemin,ratemax;
 				mob_db[class_].dropitem[i].nameid=atoi(str[29+i*2]);
 				mob_db[class_].dropitem[i].nameid=atoi(str[29+i*2]);
 				type = itemdb_type(mob_db[class_].dropitem[i].nameid);
 				type = itemdb_type(mob_db[class_].dropitem[i].nameid);
@@ -4442,7 +4452,14 @@ static int mob_read_sqldb(void)
 				rate = (rate < ratemin)? ratemin: (rate > ratemax)? ratemax: rate;
 				rate = (rate < ratemin)? ratemin: (rate > ratemax)? ratemax: rate;
 				mob_db[class_].dropitem[i].p = rate;
 				mob_db[class_].dropitem[i].p = rate;
 			}
 			}
+			//TEMP PLUG till we expand TXT DB and SQL DBs [Lupus]
+			for(i=8;i<10;i++){ //TODO: 8 -> 10 Lupus
+				//we fill 9th and 10th DROP slots with 0
+				mob_db[class_].dropitem[i].nameid = mob_db[class_].dropitem[i].p = 0;
+			}
+			//END of temp plug
 
 
+			//TODO: Shift columns (after adding 2 drops (4 coulmns)) Lupus
 			mob_db[class_].mexp=atoi(str[45])*battle_config.mvp_exp_rate/100;
 			mob_db[class_].mexp=atoi(str[45])*battle_config.mvp_exp_rate/100;
 			mob_db[class_].mexpper=atoi(str[46]);
 			mob_db[class_].mexpper=atoi(str[46]);
 			for(i=0;i<3;i++){
 			for(i=0;i<3;i++){

+ 1 - 1
src/map/mob.h

@@ -28,7 +28,7 @@ struct mob_db {
 	int size,race,element,mode;
 	int size,race,element,mode;
 	int speed,adelay,amotion,dmotion;
 	int speed,adelay,amotion,dmotion;
 	int mexp,mexpper;
 	int mexp,mexpper;
-	struct { int nameid,p; } dropitem[8];
+	struct { int nameid,p; } dropitem[10]; //8 -> 10 Lupus
 	struct { int nameid,p; } mvpitem[3];
 	struct { int nameid,p; } mvpitem[3];
 	int view_class,sex;
 	int view_class,sex;
 	short hair,hair_color,weapon,shield,head_top,head_mid,head_buttom,option,clothes_color; // [Valaris]
 	short hair,hair_color,weapon,shield,head_top,head_mid,head_buttom,option,clothes_color; // [Valaris]

+ 2 - 2
src/map/pc.c

@@ -2614,9 +2614,9 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl)
 
 
 			if(0 < skill)
 			if(0 < skill)
 			{
 			{
-				for(count = 8; count <= 8 && count != 0; count--)
+				for(count = 10; count <= 10 && count != 0; count--) //8 -> 10 Lupus
 				{
 				{
-					i = rand()%8;
+					i = rand()%10; //8 -> 10 Lupus
 					itemid = mob_db[md->class_].dropitem[i].nameid;
 					itemid = mob_db[md->class_].dropitem[i].nameid;
 
 
 					if(itemid > 0 && itemdb_type(itemid) != 6)
 					if(itemid > 0 && itemdb_type(itemid) != 6)

+ 5 - 5
src/map/script.c

@@ -2302,7 +2302,7 @@ int buildin_checkweight(struct script_state *st)
  */
  */
 int buildin_getitem(struct script_state *st)
 int buildin_getitem(struct script_state *st)
 {
 {
-	int nameid,amount,flag = 0;
+	int nameid,nameidsrc,amount,flag = 0;
 	struct item item_tmp;
 	struct item item_tmp;
 	struct map_session_data *sd;
 	struct map_session_data *sd;
 	struct script_data *data;
 	struct script_data *data;
@@ -2324,12 +2324,12 @@ int buildin_getitem(struct script_state *st)
 		return 0; //return if amount <=0, skip the useles iteration
 		return 0; //return if amount <=0, skip the useles iteration
 	}
 	}
 	//Violet Box, Blue Box, etc - random item pick
 	//Violet Box, Blue Box, etc - random item pick
-	if(nameid<0) { // ƒ‰ƒ“ƒ_ƒ€
+	if((nameidsrc = nameid)<0) { // Save real ID of the source Box [Lupus]
 		nameid=itemdb_searchrandomid(-nameid);
 		nameid=itemdb_searchrandomid(-nameid);
-		#ifndef TXT_ONLY
+
 		if(log_config.present > 0)
 		if(log_config.present > 0)
-			log_present(sd, -nameid, nameid);
-		#endif //USE_SQL
+			log_present(sd, -nameidsrc, nameid); //fixed missing ID by Lupus
+
 		flag = 1;
 		flag = 1;
 	}
 	}