瀏覽代碼

* Some updates of Quest Log system
- renamed table 'questlog' to 'quest' to avoid misunderstanding
- updated main.sql
- fixed the server can't load more than 16 quests
- removed the MAX_QUEST limit. tests show the client can handle more than 100 quests.

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

Inkfish 16 年之前
父節點
當前提交
4a6f0d122c
共有 7 個文件被更改,包括 23 次插入30 次删除
  1. 1 1
      conf/inter_athena.conf
  2. 9 15
      sql-files/main.sql
  3. 1 0
      sql-files/upgrade_svn_13963.sql
  4. 1 1
      src/char_sql/char.c
  5. 1 1
      src/map/intif.c
  6. 10 3
      src/map/quest.c
  7. 0 9
      src/map/quest.h

+ 1 - 1
conf/inter_athena.conf

@@ -120,7 +120,7 @@ pet_db: pet
 friend_db: friends
 mail_db: mail
 auction_db: auction
-quest_db: questlog
+quest_db: quest
 
 // Map Database Tables
 item_db_db: item_db

+ 9 - 15
sql-files/main.sql

@@ -556,21 +556,15 @@ CREATE TABLE IF NOT EXISTS `pet` (
 CREATE TABLE IF NOT EXISTS `quest` (
   `char_id` int(11) unsigned NOT NULL default '0',
   `quest_id` int(10) unsigned NOT NULL,
-  `state` enum('1','0') NOT NULL default '0',
-  PRIMARY KEY  USING BTREE (`char_id`,`quest_id`)
-) ENGINE=MyISAM;
-
---
--- Table structure for table `quest_mob`
---
-
-CREATE TABLE IF NOT EXISTS `quest_objective` (
-  `quest_id` int(11) unsigned NOT NULL,
-  `count` mediumint(8) unsigned NOT NULL default '0',
-  `name` varchar(255) NOT NULL default '',
-  `num` tinyint(3) unsigned NOT NULL,
-  `char_id` int(10) unsigned NOT NULL,
-  PRIMARY KEY  USING BTREE (`quest_id`,`num`,`char_id`)
+  `state` enum('0','1','2') NOT NULL default '0',
+  `time` int(11) unsigned NOT NULL default '0',
+  `mob1` mediumint(9) unsigned NOT NULL default '0',
+  `count1` mediumint(8) unsigned NOT NULL default '0',
+  `mob2` mediumint(9) unsigned NOT NULL default '0',
+  `count2` mediumint(8) unsigned NOT NULL default '0',
+  `mob3` mediumint(9) unsigned NOT NULL default '0',
+  `count3` mediumint(8) unsigned NOT NULL default '0',
+  PRIMARY KEY  (`char_id`,`quest_id`)
 ) ENGINE=MyISAM;
 
 --

+ 1 - 0
sql-files/upgrade_svn_13963.sql

@@ -0,0 +1 @@
+RENAME TABLE `questlog` TO `quest`;

+ 1 - 1
src/char_sql/char.c

@@ -58,7 +58,7 @@ char mail_db[256] = "mail"; // MAIL SYSTEM
 char auction_db[256] = "auction"; // Auctions System
 char friend_db[256] = "friends";
 char hotkey_db[256] = "hotkey";
-char quest_db[256] = "questlog";
+char quest_db[256] = "quest";
 
 //If your code editor is having problems syntax highlighting this file, uncomment this and RECOMMENT IT BEFORE COMPILING
 //#undef TXT_SQL_CONVERT

+ 1 - 1
src/map/intif.c

@@ -1348,7 +1348,7 @@ int intif_parse_questlog(int fd)
 	if(!sd)
 		return -1;
 
-	sd->avail_quests = sd->num_quests = (RFIFOB(fd, 2)-8)/sizeof(struct quest);
+	sd->avail_quests = sd->num_quests = (RFIFOW(fd, 2)-8)/sizeof(struct quest);
 
 	memset(&sd->quest_log, 0, sizeof(sd->quest_log));
 

+ 10 - 3
src/map/quest.c

@@ -33,7 +33,14 @@
 #include <stdarg.h>
 #include <time.h>
 
-#define MAX_QUEST 25
+struct s_quest_db {
+	int id;
+	unsigned int time;
+	int mob[MAX_QUEST_OBJECTIVES];
+	int count[MAX_QUEST_OBJECTIVES];
+	//char name[NAME_LENGTH];
+};
+struct s_quest_db quest_db[MAX_QUEST_DB];
 
 //Send quest info on login
 int quest_pc_login(TBL_PC * sd)
@@ -64,9 +71,9 @@ int quest_add(TBL_PC * sd, int quest_id)
 		return -1;
 	}
 
-	if( sd->num_quests >= MAX_QUEST_DB || sd->avail_quests >= MAX_QUEST )
+	if( sd->num_quests >= MAX_QUEST_DB )
 	{
-		ShowError("quest_add: your quest log is full.(max quests: %d, max incompleted quests: %d)\n", MAX_QUEST_DB, MAX_QUEST);
+		ShowError("quest_add: your quest log is full.(max quests: %d)\n", MAX_QUEST_DB);
 		return 1;
 	}
 

+ 0 - 9
src/map/quest.h

@@ -6,15 +6,6 @@
 
 typedef enum quest_check_type { HAVEQUEST, PLAYTIME, HUNTING } quest_check_type;
 
-struct s_quest_db {
-	int id;
-	unsigned int time;
-	int mob[MAX_QUEST_OBJECTIVES];
-	int count[MAX_QUEST_OBJECTIVES];
-	//char name[NAME_LENGTH];
-};
-struct s_quest_db quest_db[MAX_QUEST_DB];
-
 int quest_pc_login(TBL_PC * sd);
 
 int quest_add(TBL_PC * sd, int quest_id);