summaryrefslogtreecommitdiff
path: root/src/map/intif.c
diff options
context:
space:
mode:
authorKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-14 02:32:24 +0000
committerKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-14 02:32:24 +0000
commit02a755111f9a707cc7fdef81772c74b1d10242b1 (patch)
tree83d051a5e7e3826a4c5fc50780cde68ebe82111c /src/map/intif.c
parent9fccafd43e1c30947f3d3748b30ecc292ec3bbe9 (diff)
downloadhercules-02a755111f9a707cc7fdef81772c74b1d10242b1.tar.gz
hercules-02a755111f9a707cc7fdef81772c74b1d10242b1.tar.bz2
hercules-02a755111f9a707cc7fdef81772c74b1d10242b1.tar.xz
hercules-02a755111f9a707cc7fdef81772c74b1d10242b1.zip
Some more updates to the quest log system. It has been completely moved to the inter server instead of the char server.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12584 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/intif.c')
-rw-r--r--src/map/intif.c43
1 files changed, 36 insertions, 7 deletions
diff --git a/src/map/intif.c b/src/map/intif.c
index 0ce0aa8c1..2d9b1894c 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -37,7 +37,7 @@ static const int packet_len_table[]={
10,-1,15, 0, 79,19, 7,-1, 0,-1,-1,-1, 14,67,186,-1, //0x3830
9, 9,-1,14, 0, 0, 0, 0, -1,74,-1,11, 11,-1, 0, 0, //0x3840
-1,-1, 7, 7, 7,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3850 Auctions [Zephyrus]
- 0,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3860 Quests [Kevin]
+ -1,11,11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3860 Quests [Kevin]
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
11,-1, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3880
-1,-1, 7, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3890 Homunculus [albator]
@@ -1405,6 +1405,36 @@ QUESTLOG SYSTEM FUNCTIONS
***************************************/
+int intif_request_questlog(TBL_PC *sd)
+{
+ WFIFOHEAD(inter_fd,6);
+ WFIFOW(inter_fd,0) = 0x3060;
+ WFIFOL(inter_fd,2) = sd->status.char_id;
+ WFIFOSET(inter_fd,6);
+ return 0;
+}
+
+int intif_parse_questlog(int fd)
+{
+
+ int num_quests = (RFIFOB(fd, 2)-8)/sizeof(struct quest);
+ int char_id = RFIFOL(fd, 4);
+ int i;
+ TBL_PC * sd = map_charid2sd(char_id);
+
+ //User not online anymore
+ if(!sd)
+ return 0;
+
+ for(i=0; i<num_quests; i++)
+ {
+ memcpy(&sd->quest_log[i], RFIFOP(fd, i*sizeof(struct quest)+8), sizeof(struct quest));
+ }
+ sd->num_quests = num_quests;
+
+ return 0;
+}
+
int intif_parse_questDelete(int fd)
{
quest_delete_ack(RFIFOL(fd, 2), RFIFOL(fd, 6), RFIFOB(fd, 10));
@@ -1434,17 +1464,15 @@ int intif_parse_questAdd(int fd)
int intif_quest_add(int char_id, struct quest * qd)
{
- int sSize = sizeof(struct quest);
-
if(CheckForCharServer())
return 0;
- WFIFOHEAD(inter_fd, sSize + 8);
+ WFIFOHEAD(inter_fd, sizeof(struct quest) + 8);
WFIFOW(inter_fd,0) = 0x3061;
- WFIFOW(inter_fd,2) = sSize + 8;
+ WFIFOW(inter_fd,2) = sizeof(struct quest) + 8;
WFIFOL(inter_fd,4) = char_id;
- memcpy(WFIFOP(inter_fd,8), qd, sSize);
- WFIFOSET(inter_fd, sSize + 8);
+ memcpy(WFIFOP(inter_fd,8), qd, sizeof(struct quest));
+ WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
return 0;
}
@@ -1992,6 +2020,7 @@ int intif_parse(int fd)
case 0x3843: intif_parse_GuildMasterChanged(fd); break;
//Quest system
+ case 0x3860: intif_parse_questlog(fd); break;
case 0x3861: intif_parse_questAdd(fd); break;
case 0x3862: intif_parse_questDelete(fd); break;