summaryrefslogtreecommitdiff
path: root/src/map/intif.c
diff options
context:
space:
mode:
authorKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-13 22:19:02 +0000
committerKevin <Kevin@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-04-13 22:19:02 +0000
commite5242b4b3842fc94a60ad2f66284162948baefeb (patch)
tree8023e522ce29b67adb11c5db33dc0e71c27d04b1 /src/map/intif.c
parent40a44f83fc8c640412af6e4f227106eea9c17003 (diff)
downloadhercules-e5242b4b3842fc94a60ad2f66284162948baefeb.tar.gz
hercules-e5242b4b3842fc94a60ad2f66284162948baefeb.tar.bz2
hercules-e5242b4b3842fc94a60ad2f66284162948baefeb.tar.xz
hercules-e5242b4b3842fc94a60ad2f66284162948baefeb.zip
Major updates to the quest system.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12581 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/intif.c')
-rw-r--r--src/map/intif.c59
1 files changed, 58 insertions, 1 deletions
diff --git a/src/map/intif.c b/src/map/intif.c
index b0013aa52..0ce0aa8c1 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -20,6 +20,7 @@
#include "atcommand.h"
#include "mercenary.h" //albator
#include "mail.h"
+#include "quest.h"
#include <sys/types.h>
#include <stdio.h>
@@ -36,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0,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]
@@ -1398,7 +1399,58 @@ int intif_parse_DeleteHomunculusOk(int fd)
return 0;
}
+/**************************************
+
+QUESTLOG SYSTEM FUNCTIONS
+
+***************************************/
+
+int intif_parse_questDelete(int fd)
+{
+ quest_delete_ack(RFIFOL(fd, 2), RFIFOL(fd, 6), RFIFOB(fd, 10));
+ return 0;
+}
+
+int intif_quest_delete(int char_id, int quest_id)
+{
+ if(CheckForCharServer())
+ return 0;
+
+ WFIFOHEAD(inter_fd, 10);
+ WFIFOW(inter_fd,0) = 0x3062;
+ WFIFOL(inter_fd,2) = char_id;
+ WFIFOL(inter_fd,6) = quest_id;
+ WFIFOSET(inter_fd, 10);
+
+ return 0;
+}
+
+int intif_parse_questAdd(int fd)
+{
+ quest_add_ack(RFIFOL(fd, 2), RFIFOL(fd, 6), RFIFOB(fd, 10));
+ return 0;
+}
+
+int intif_quest_add(int char_id, struct quest * qd)
+{
+
+ int sSize = sizeof(struct quest);
+
+ if(CheckForCharServer())
+ return 0;
+
+ WFIFOHEAD(inter_fd, sSize + 8);
+ WFIFOW(inter_fd,0) = 0x3061;
+ WFIFOW(inter_fd,2) = sSize + 8;
+ WFIFOL(inter_fd,4) = char_id;
+ memcpy(WFIFOP(inter_fd,8), qd, sSize);
+ WFIFOSET(inter_fd, sSize + 8);
+
+ return 0;
+}
+
#ifndef TXT_ONLY
+
/*==========================================
* MAIL SYSTEM
* By Zephyrus
@@ -1938,6 +1990,11 @@ int intif_parse(int fd)
case 0x3841: intif_parse_GuildCastleDataSave(fd); break;
case 0x3842: intif_parse_GuildCastleAllDataLoad(fd); break;
case 0x3843: intif_parse_GuildMasterChanged(fd); break;
+
+ //Quest system
+ case 0x3861: intif_parse_questAdd(fd); break;
+ case 0x3862: intif_parse_questDelete(fd); break;
+
#ifndef TXT_ONLY
// Mail System
case 0x3848: intif_parse_Mail_inboxreceived(fd); break;