summaryrefslogtreecommitdiff
path: root/src/map/clif.cpp
diff options
context:
space:
mode:
authorWushin <pasekei@gmail.com>2015-04-29 22:40:55 -0500
committerWushin <pasekei@gmail.com>2015-04-29 22:40:55 -0500
commitc7f0a0dbb9fe0cb42b0516ae1d4d60f72bd4ebb5 (patch)
tree804da9630fafbd0a0321fd6ea586a576ce07c431 /src/map/clif.cpp
parenta75608ef2f62a07879e7ef6d73c0ebe5b23908b2 (diff)
parent950bc8a1a239829864600b82e40d801514fca709 (diff)
downloadtmwa-c7f0a0dbb9fe0cb42b0516ae1d4d60f72bd4ebb5.tar.gz
tmwa-c7f0a0dbb9fe0cb42b0516ae1d4d60f72bd4ebb5.tar.bz2
tmwa-c7f0a0dbb9fe0cb42b0516ae1d4d60f72bd4ebb5.tar.xz
tmwa-c7f0a0dbb9fe0cb42b0516ae1d4d60f72bd4ebb5.zip
Merge pull request #65 from wushin/quest-log
Quest log
Diffstat (limited to 'src/map/clif.cpp')
-rw-r--r--src/map/clif.cpp54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index 339adda..e3cd55f 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -4665,6 +4665,60 @@ RecvResult clif_parse_PartyMessage(Session *s, dumb_ptr<map_session_data> sd)
return rv;
}
+void clif_sendallquest(dumb_ptr<map_session_data> sd)
+{
+ int i;
+ QuestId questid;
+ if (!sd)
+ return;
+
+ if (!sd->sess)
+ return;
+
+ Session *s = sd->sess;
+ Packet_Head<0x0215> head_215;
+ std::vector<Packet_Repeat<0x0215>> repeat_215;
+
+ assert (sd->status.global_reg_num < GLOBAL_REG_NUM);
+ for (QuestId q = wrap<QuestId>(0); q < wrap<QuestId>(-1); q = next(q))
+ {
+ P<struct quest_data> quest_data_ = TRY_UNWRAP(questdb_exists(q), continue);
+ for (i = 0; i < sd->status.global_reg_num; i++)
+ {
+ if (sd->status.global_reg[i].str == quest_data_->quest_vr)
+ {
+ int val = ((sd->status.global_reg[i].value & (((1 << quest_data_->quest_mask) - 1) << (quest_data_->quest_shift * quest_data_->quest_mask))) >> (quest_data_->quest_shift * quest_data_->quest_mask));
+ Packet_Repeat<0x0215> info;
+ info.variable = unwrap<QuestId>(quest_data_->questid);
+ info.value = val;
+ repeat_215.push_back(info);
+ break;
+ }
+ }
+ }
+
+ send_vpacket<0x0215, 4, 6>(s, head_215, repeat_215);
+ return;
+}
+
+void clif_sendquest(dumb_ptr<map_session_data> sd, QuestId questid, int value)
+{
+ if (!sd)
+ return;
+
+ if (!sd->sess)
+ return;
+
+ Session *s = sd->sess;
+
+ Packet_Fixed<0x0214> fixed;
+ fixed.variable = unwrap<QuestId>(questid);
+ fixed.value = value;
+ send_fpacket<0x0214, 8>(s, fixed);
+ return;
+}
+
+
func_table clif_parse_func_table[0x0220] =
{
{0, 10, nullptr, }, // 0x0000