summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-09-12 02:43:02 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-09-12 02:43:02 +0000
commit1739298348c4d8c9052c05b7ac9a528e34de14d4 (patch)
tree43a8290fe0b32c6b303cfe0b4f3893be7893978a /src/map/clif.c
parent19842e42ba718181671aa80a0dec83b0f680a209 (diff)
downloadhercules-1739298348c4d8c9052c05b7ac9a528e34de14d4.tar.gz
hercules-1739298348c4d8c9052c05b7ac9a528e34de14d4.tar.bz2
hercules-1739298348c4d8c9052c05b7ac9a528e34de14d4.tar.xz
hercules-1739298348c4d8c9052c05b7ac9a528e34de14d4.zip
* Clarified the names of some questlog functions and eventually implemented kill counts updating.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14056 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c50
1 files changed, 34 insertions, 16 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 515d7642a..f05209d96 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -12585,9 +12585,8 @@ void clif_parse_EquipTick(int fd, struct map_session_data* sd)
/*==========================================
* Questlog System [Kevin] [Inkfish]
*------------------------------------------*/
-//Send simple list of quests upon login
-//* 02B1 <packet_len>.W <ignored>.L { <quest_id>.L <state>.B }.5B*
-void clif_send_questlog(struct map_session_data * sd)
+//* 02B1 <packet_len>.W <quest_num>.L { <quest_id>.L <state>.B }.5B*
+void clif_quest_send_list(struct map_session_data * sd)
{
int fd = sd->fd;
int i;
@@ -12608,9 +12607,8 @@ void clif_send_questlog(struct map_session_data * sd)
}
-//Send objective info on login
-//* 02B2 <packet_len>.W <ignored>.L { <quest_id>.L <ignored>.L <time>.L <num mobs>.W {<ignored>.L <mob count>.W <Mob Name>.24B}.30B[3] }.104B*
-void clif_send_questlog_info(struct map_session_data * sd)
+//* 02B2 <packet_len>.W <quest_num>.L { <quest_id>.L <start time>.L <expire time>.L <num mobs>.W {<mob id>.L <mob count>.W <Mob Name>.24B}.30B[3] }.104B*
+void clif_quest_send_mission(struct map_session_data * sd)
{
int fd = sd->fd;
int i, j;
@@ -12625,11 +12623,13 @@ void clif_send_questlog_info(struct map_session_data * sd)
for( i = 0; i < sd->avail_quests; i++ )
{
WFIFOL(fd, i*104+8) = sd->quest_log[i].quest_id;
+ WFIFOL(fd, i*104+12) = sd->quest_log[i].time - quest_db[sd->quest_index[i]].time;
WFIFOL(fd, i*104+16) = sd->quest_log[i].time;
WFIFOW(fd, i*104+20) = quest_db[sd->quest_index[i]].num_objectives;
for( j = 0 ; j < quest_db[sd->quest_index[i]].num_objectives; j++ )
{
+ WFIFOL(fd, i*104+22+j*30) = quest_db[sd->quest_index[i]].mob[j];
WFIFOW(fd, i*104+26+j*30) = sd->quest_log[i].count[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);
@@ -12639,24 +12639,24 @@ void clif_send_questlog_info(struct map_session_data * sd)
WFIFOSET(fd, len);
}
-//Send info when objective info needs an update
-//* 02B3 <quest_id>.L <state>.B <ignored>.L <time>.L <num mobs>.W {<ignored>.L <mob count>.W <Mob Name>.24B}.30B[3]
-void clif_send_quest_info(struct map_session_data * sd, struct quest * qd, int index)
+//* 02B3 <quest_id>.L <state>.B <start time>.L <expire time>.L <num mobs>.W {<mob id>.L <mob count>.W <Mob Name>.24B}.30B[3]
+void clif_quest_add(struct map_session_data * sd, struct quest * qd, int index)
{
int fd = sd->fd;
int i;
- //int len = MAX_QUEST_OBJECTIVES*30+17;
struct mob_db *mob;
WFIFOHEAD(fd, packet_len(0x02B3));
WFIFOW(fd, 0) = 0x02B3;
WFIFOL(fd, 2) = qd->quest_id;
WFIFOB(fd, 6) = qd->state;
+ WFIFOB(fd, 7) = qd->time - quest_db[index].time;
WFIFOL(fd, 11) = qd->time;
WFIFOW(fd, 15) = quest_db[index].num_objectives;
for( i = 0; i < quest_db[index].num_objectives; i++ )
{
+ WFIFOL(fd, i*30+17) = quest_db[index].mob[i];
WFIFOW(fd, i*30+21) = qd->count[i];
mob = mob_db(quest_db[index].mob[i]);
memcpy(WFIFOP(fd, i*30+23), mob?mob->jname:"NULL", NAME_LENGTH);
@@ -12665,9 +12665,8 @@ void clif_send_quest_info(struct map_session_data * sd, struct quest * qd, int i
WFIFOSET(fd, packet_len(0x02B3));
}
-//Send delete msg
//* 02B4 <quest_id>.L
-void clif_send_quest_delete(struct map_session_data * sd, int quest_id)
+void clif_quest_delete(struct map_session_data * sd, int quest_id)
{
int fd = sd->fd;
@@ -12677,17 +12676,36 @@ void clif_send_quest_delete(struct map_session_data * sd, int quest_id)
WFIFOSET(fd, packet_len(0x02B4));
}
-// * 02B5 <packet_len>.W <ignored>.L { }.10B* <-- UNKOWN PACKET
+//* 02b5 <packet_len>.w <mob_num>.w { <quest_id>.d <mob_id>.d <count>.w }.mob_num
+void clif_quest_update_objective(struct map_session_data * sd, struct quest * qd, int index)
+{
+ int fd = sd->fd;
+ int i;
+ int len = quest_db[index].num_objectives*10+6;
+
+ WFIFOHEAD(fd, len);
+ WFIFOW(fd, 0) = 0x02B5;
+ WFIFOW(fd, 2) = len;
+ WFIFOW(fd, 4) = quest_db[index].num_objectives;
+
+ for( i = 0; i < quest_db[index].num_objectives; i++ )
+ {
+ WFIFOL(fd, i*10+6) = qd->quest_id;
+ WFIFOL(fd, i*10+10) = quest_db[index].mob[i];
+ WFIFOW(fd, i*10+14) = qd->count[i];
+ }
+
+ WFIFOSET(fd, len);
+}
-// * 02B6 <quest_id>.L <state>.B
+//* 02B6 <quest_id>.L <state>.B
void clif_parse_questStateAck(int fd, struct map_session_data * sd)
{
quest_update_status(sd, RFIFOL(fd,2), RFIFOB(fd,6)?Q_ACTIVE:Q_INACTIVE);
}
-//Change active state of the quest
//* 02B7 <quest_id>.L <state_to>.B
-void clif_send_quest_status(struct map_session_data * sd, int quest_id, bool active)
+void clif_quest_update_status(struct map_session_data * sd, int quest_id, bool active)
{
int fd = sd->fd;