diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 0c318bc972..df1bc7635b 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,10 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. +09/09/04 + * QuestLog Fix. [Inkfish] + - mob id no longer stores in sql. + - counts won't increase if you have killed sufficient mobs. 09/08/25 * Implemented Progress Bar.(topic:207933) [Inkfish] 09/08/21 diff --git a/db/item_db.txt b/db/item_db.txt index da1fb33ea4..5e42b90ce9 100644 --- a/db/item_db.txt +++ b/db/item_db.txt @@ -1533,7 +1533,7 @@ 2722,Medal_Acolyte,Medal of Honor,5,0,,0,,1,,0,0x00008110,7,2,136,,70,0,0,{ bonus bAtkRate,5; bonus bMatkRate,5; bonus bMdef,6; bonus bMaxHP,600; bonus3 bAddEff,Eff_Silence,1000,ATF_SHORT; },{},{} 2723,Medal_Mage,Medal of Honor,5,0,,0,,1,,0,0x00810204,7,2,136,,70,0,0,{ bonus bAtkRate,5; bonus bMatkRate,5; bonus bMdef,6; bonus bMaxHP,600; bonus2 bAddEffWhenHit,Eff_Stone,1000; },{},{} 2724,Medal_Archer,Medal of Honor,5,0,,0,,1,,0,0x00080808,7,2,136,,70,0,0,{ bonus bAtkRate,5; bonus bMatkRate,5; bonus bCritical,10; bonus bMaxHP,300; bonus bMaxSP,80; bonus3 bAddEff,Eff_Blind,1000,ATF_LONG; },{},{} -2725,Medal_Merchant,Medal of Honor,5,0,,0,,1,,0,0x00040420,7,2,136,,70,0,0,{ bonus bAtkRate,5; bonus bMatkRate,5; bonus bAspd,10; bonus bMaxHP,500; bonus bMaxSP,50; bonus3 bAddEff,Eff_Curse,1000,ATF_SHORT; },{},{} +2725,Medal_Merchant,Medal of Honor,5,0,,0,,1,,0,0x00040420,7,2,136,,70,0,0,{ bonus bAtkRate,5; bonus bMatkRate,5; bonus bAspdRate,10; bonus bMaxHP,500; bonus bMaxSP,50; bonus3 bAddEff,Eff_Curse,1000,ATF_SHORT; },{},{} 2726,Icarus_Wing,Icarus Wings,5,20,,100,,0,,0,0x00000800,2,2,136,,70,0,0,{ bonus bMaxSP,50; bonus bDex,3; },{},{} 2727,Bowman_Scarf,Bowman Scarf,5,20,,200,,0,,0,0x00000800,2,2,136,,0,0,0,{ bonus bMaxSP,50; bonus bDex,3; if (isequipped(2726)) bonus bUseSPrate,-25; },{},{} 2728,Cursed_Hand,Cursed Hand,5,0,,50,,0,,1,0xFFFFFFFE,7,2,136,,80,0,0,{ bonus3 bAutoSpell,"NPC_CRITICALWOUND",1,30; bonus bHit,10; bonus bHPrecovRate,20; },{},{} diff --git a/sql-files/upgrade_svn14036.sql b/sql-files/upgrade_svn14036.sql new file mode 100644 index 0000000000..17ddfd1382 --- /dev/null +++ b/sql-files/upgrade_svn14036.sql @@ -0,0 +1,3 @@ +ALTER TABLE `quest` DROP `mob1`; +ALTER TABLE `quest` DROP `mob2`; +ALTER TABLE `quest` DROP `mob3`; \ No newline at end of file diff --git a/src/char_sql/int_quest.c b/src/char_sql/int_quest.c index 21eb68be5f..16c74fd47a 100644 --- a/src/char_sql/int_quest.c +++ b/src/char_sql/int_quest.c @@ -34,25 +34,19 @@ int mapif_quests_fromsql(int char_id, struct quest questlog[]) memset(&tmp_quest, 0, sizeof(struct quest)); - if( SQL_ERROR == SqlStmt_Prepare(stmt, "SELECT `quest_id`, `state`, `time`, `mob1`, `count1`, `mob2`, `count2`, `mob3`, `count3` FROM `%s` WHERE `char_id`=? LIMIT %d", quest_db, MAX_QUEST_DB) + if( SQL_ERROR == SqlStmt_Prepare(stmt, "SELECT `quest_id`, `state`, `time`, `count1`, `count2`, `count3` FROM `%s` WHERE `char_id`=? LIMIT %d", quest_db, MAX_QUEST_DB) || SQL_ERROR == SqlStmt_BindParam(stmt, 0, SQLDT_INT, &char_id, 0) || SQL_ERROR == SqlStmt_Execute(stmt) || SQL_ERROR == SqlStmt_BindColumn(stmt, 0, SQLDT_INT, &tmp_quest.quest_id, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 1, SQLDT_INT, &tmp_quest.state, 0, NULL, NULL) || SQL_ERROR == SqlStmt_BindColumn(stmt, 2, SQLDT_UINT, &tmp_quest.time, 0, NULL, NULL) - || SQL_ERROR == SqlStmt_BindColumn(stmt, 3, SQLDT_INT, &tmp_quest.mob[0], 0, NULL, NULL) - || SQL_ERROR == SqlStmt_BindColumn(stmt, 4, SQLDT_INT, &tmp_quest.count[0], 0, NULL, NULL) - || SQL_ERROR == SqlStmt_BindColumn(stmt, 5, SQLDT_INT, &tmp_quest.mob[1], 0, NULL, NULL) - || SQL_ERROR == SqlStmt_BindColumn(stmt, 6, SQLDT_INT, &tmp_quest.count[1], 0, NULL, NULL) - || SQL_ERROR == SqlStmt_BindColumn(stmt, 7, SQLDT_INT, &tmp_quest.mob[2], 0, NULL, NULL) - || SQL_ERROR == SqlStmt_BindColumn(stmt, 8, SQLDT_INT, &tmp_quest.count[2], 0, NULL, NULL) ) + || SQL_ERROR == SqlStmt_BindColumn(stmt, 3, SQLDT_INT, &tmp_quest.count[0], 0, NULL, NULL) + || SQL_ERROR == SqlStmt_BindColumn(stmt, 4, SQLDT_INT, &tmp_quest.count[1], 0, NULL, NULL) + || SQL_ERROR == SqlStmt_BindColumn(stmt, 5, SQLDT_INT, &tmp_quest.count[2], 0, NULL, NULL) ) SqlStmt_ShowDebug(stmt); for( i = 0; i < MAX_QUEST_DB && SQL_SUCCESS == SqlStmt_NextRow(stmt); ++i ) - { memcpy(&questlog[i], &tmp_quest, sizeof(tmp_quest)); - questlog[i].num_objectives = (!questlog[i].mob[0] ? 0 : !questlog[i].mob[1] ? 1 : !questlog[i].mob[2] ? 2 : 3); - } SqlStmt_Free(stmt); return i; @@ -76,7 +70,7 @@ bool mapif_quest_add(int char_id, struct quest qd) StringBuf buf; StringBuf_Init(&buf); - StringBuf_Printf(&buf, "INSERT INTO `%s`(`quest_id`, `char_id`, `state`, `time`, `mob1`, `count1`, `mob2`, `count2`, `mob3`, `count3`) VALUES ('%d', '%d', '%d','%d', '%d', '%d', '%d', '%d', '%d', '%d')", quest_db, qd.quest_id, char_id, qd.state, qd.time, qd.mob[0], qd.count[0], qd.mob[1], qd.count[1], qd.mob[2], qd.count[2]); + StringBuf_Printf(&buf, "INSERT INTO `%s`(`quest_id`, `char_id`, `state`, `time`, `count1`, `count2`, `count3`) VALUES ('%d', '%d', '%d','%d', '%d', '%d', '%d')", quest_db, qd.quest_id, char_id, qd.state, qd.time, qd.count[0], qd.count[1], qd.count[2]); if ( SQL_ERROR == Sql_QueryStr(sql_handle, StringBuf_Value(&buf)) ) { diff --git a/src/common/mmo.h b/src/common/mmo.h index 3c82a8ad77..9979c5a8e9 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -132,10 +132,8 @@ typedef enum quest_state { Q_INACTIVE, Q_ACTIVE, Q_COMPLETE } quest_state; struct quest { int quest_id; unsigned int time; - int mob[MAX_QUEST_OBJECTIVES]; int count[MAX_QUEST_OBJECTIVES]; quest_state state; - int num_objectives; }; struct item { diff --git a/src/map/clif.c b/src/map/clif.c index 06a51354fa..515d7642a2 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -12626,12 +12626,12 @@ void clif_send_questlog_info(struct map_session_data * sd) { WFIFOL(fd, i*104+8) = sd->quest_log[i].quest_id; WFIFOL(fd, i*104+16) = sd->quest_log[i].time; - WFIFOW(fd, i*104+20) = sd->quest_log[i].num_objectives; + WFIFOW(fd, i*104+20) = quest_db[sd->quest_index[i]].num_objectives; - for( j = 0 ; j < sd->quest_log[i].num_objectives; j++ ) + for( j = 0 ; j < quest_db[sd->quest_index[i]].num_objectives; j++ ) { WFIFOW(fd, i*104+26+j*30) = sd->quest_log[i].count[j]; - mob = mob_db(sd->quest_log[i].mob[j]); + mob = mob_db(quest_db[sd->quest_index[i]].mob[j]); memcpy(WFIFOP(fd, i*104+28+j*30), mob?mob->jname:"NULL", NAME_LENGTH); } } @@ -12641,7 +12641,7 @@ void clif_send_questlog_info(struct map_session_data * sd) //Send info when objective info needs an update //* 02B3 .L .B .L