ManaPlus
Functions
EAthena::QuestRecv Namespace Reference

Functions

void processAddQuest (Net::MessageIn &msg)
 
void processAddQuest2 (Net::MessageIn &msg)
 
void processAddQuests (Net::MessageIn &msg)
 
void processAddQuests2 (Net::MessageIn &msg)
 
void processAddQuestsObjectives (Net::MessageIn &msg)
 
void processUpdateQuestsObjectives2 (Net::MessageIn &msg)
 
void processUpdateQuestsObjectives (Net::MessageIn &msg)
 
void processRemoveQuest (Net::MessageIn &msg)
 
void processActivateQuest (Net::MessageIn &msg)
 
void processNpcQuestEffect (Net::MessageIn &msg)
 

Function Documentation

◆ processActivateQuest()

void EAthena::QuestRecv::processActivateQuest ( Net::MessageIn msg)

Definition at line 251 of file questrecv.cpp.

252 {
254  // +++ need enable/disable quests depend on this packet
255  msg.readInt32("quest id");
256  msg.readUInt8("activate");
257 }
#define UNIMPLEMENTEDPACKET
Definition: logger.h:56
bool msg(InputEvent &event)
Definition: chat.cpp:39

References Actions::msg(), and UNIMPLEMENTEDPACKET.

◆ processAddQuest()

void EAthena::QuestRecv::processAddQuest ( Net::MessageIn msg)

Definition at line 36 of file questrecv.cpp.

37 {
38  const int var = msg.readInt32("quest id");
39  const int val = msg.readUInt8("state");
40  msg.readUInt8("time diff");
41  msg.readInt32("time");
42  const int num = msg.readInt16("objectives count");
43  for (int f = 0; f < num; f ++)
44  {
45  // need use in quests kills list
46  if (msg.getVersion() >= 20181010)
47  {
48  msg.readInt32("hunt ident");
49  msg.readInt32("hunt ident2");
50  msg.readInt32("mob type");
51  }
52  else if (msg.getVersion() >= 20150513)
53  {
54  msg.readInt32("hunt ident");
55  msg.readInt32("mob type");
56  }
57  msg.readInt32("mob id");
58  if (msg.getVersion() >= 20150513)
59  {
60  msg.readInt16("level min");
61  msg.readInt16("level max");
62  }
63  msg.readInt16("hunt count");
64  msg.readInt16("max count");
65  msg.readString(24, "mob name");
66  }
67 
68  msg.skipToEnd("unused");
69 
70  if (questsWindow != nullptr)
71  {
72  questsWindow->updateQuest(var, val, 0, 0, 0);
73  questsWindow->rebuild(true);
74  }
75  if (skillDialog != nullptr)
76  {
77  skillDialog->updateQuest(var, val, 0, 0, 0);
79  }
80 }
void updateQuest(const int var, const int val1, const int val2, const int val3, const int time1)
void rebuild(const bool playSound)
void updateQuest(const int var, const int val1, const int val2, const int val3, const int time1)
void playUpdateEffect(const int id) const
QuestsWindow * questsWindow
const unsigned int SKILL_VAR_MIN_ID
Definition: skill.h:26
SkillDialog * skillDialog
Definition: skilldialog.cpp:66

References Actions::msg(), SkillDialog::playUpdateEffect(), questsWindow, QuestsWindow::rebuild(), SKILL_VAR_MIN_ID, skillDialog, QuestsWindow::updateQuest(), and SkillDialog::updateQuest().

◆ processAddQuest2()

void EAthena::QuestRecv::processAddQuest2 ( Net::MessageIn msg)

Definition at line 82 of file questrecv.cpp.

83 {
84  const int var = msg.readInt32("quest id");
85  msg.readUInt8("state");
86  const int val1 = msg.readInt32("count1");
87  const int val2 = msg.readInt32("count2");
88  const int val3 = msg.readInt32("count3");
89  const int time = msg.readInt32("time");
90 
91  if (questsWindow != nullptr)
92  {
93  questsWindow->updateQuest(var, val1, val2, val3, time);
94  questsWindow->rebuild(true);
95  }
96  if (skillDialog != nullptr)
97  {
98  skillDialog->updateQuest(var, val1, val2, val3, time);
100  }
101 }

References Actions::msg(), SkillDialog::playUpdateEffect(), questsWindow, QuestsWindow::rebuild(), SKILL_VAR_MIN_ID, skillDialog, QuestsWindow::updateQuest(), and SkillDialog::updateQuest().

◆ processAddQuests()

void EAthena::QuestRecv::processAddQuests ( Net::MessageIn msg)

Definition at line 103 of file questrecv.cpp.

104 {
105  msg.readInt16("len");
106  const int num = msg.readInt32("quests count");
107  for (int f = 0; f < num; f ++)
108  {
109  const int var = msg.readInt32("quest id");
110  const int val = msg.readUInt8("state");
111  if (msg.getVersion() >= 20141022)
112  {
113  msg.readInt32("time diff");
114  msg.readInt32("time");
115  const int cnt = msg.readInt16("objectives count");
116  for (int d = 0; d < cnt; d ++)
117  {
118  if (msg.getVersion() >= 20181010)
119  {
120  msg.readInt32("hunt ident");
121  msg.readInt32("hunt ident2");
122  msg.readInt32("mob type");
123  }
124  else if (msg.getVersion() >= 20150513)
125  {
126  msg.readInt32("hunt ident");
127  msg.readInt32("mob type");
128  }
129  msg.readInt32("mob id");
130  if (msg.getVersion() >= 20150513)
131  {
132  msg.readInt16("level min");
133  msg.readInt16("level max");
134  }
135  msg.readInt16("hunt count");
136  msg.readInt16("max count");
137  msg.readString(24, "mob name");
138  }
139  }
140  if (questsWindow != nullptr)
141  questsWindow->updateQuest(var, val, 0, 0, 0);
142  if (skillDialog != nullptr)
143  skillDialog->updateQuest(var, val, 0, 0, 0);
144  }
145 
146  if (questsWindow != nullptr)
147  questsWindow->rebuild(false);
148 }

References Actions::msg(), questsWindow, QuestsWindow::rebuild(), skillDialog, QuestsWindow::updateQuest(), and SkillDialog::updateQuest().

◆ processAddQuests2()

void EAthena::QuestRecv::processAddQuests2 ( Net::MessageIn msg)

Definition at line 150 of file questrecv.cpp.

151 {
152  msg.readInt16("len");
153  const int num = msg.readInt32("quests count");
154  for (int f = 0; f < num; f ++)
155  {
156  const int var = msg.readInt32("quest id");
157  msg.readUInt8("state");
158  const int val1 = msg.readInt32("count1");
159  const int val2 = msg.readInt32("count2");
160  const int val3 = msg.readInt32("count3");
161  const int time = msg.readInt32("time");
162  if (questsWindow != nullptr)
163  questsWindow->updateQuest(var, val1, val2, val3, time);
164  if (skillDialog != nullptr)
165  skillDialog->updateQuest(var, val1, val2, val3, time);
166  }
167 
168  if (questsWindow != nullptr)
169  questsWindow->rebuild(false);
170 }

References Actions::msg(), questsWindow, QuestsWindow::rebuild(), skillDialog, QuestsWindow::updateQuest(), and SkillDialog::updateQuest().

◆ processAddQuestsObjectives()

void EAthena::QuestRecv::processAddQuestsObjectives ( Net::MessageIn msg)

Definition at line 172 of file questrecv.cpp.

173 {
174  msg.readInt16("len");
175  const int quests = msg.readInt32("quests count");
176  for (int f = 0; f < quests; f ++)
177  {
178  msg.readInt32("quest id");
179  msg.readInt32("time diff");
180  msg.readInt32("time");
181  const int num = msg.readInt16("objectives count");
182  for (int d = 0; d < num; d ++)
183  {
184  // need use in quests kills list
185  msg.readInt32("monster id");
186  msg.readInt16("count");
187  msg.readString(24, "monster name");
188  }
189  }
190  msg.skipToEnd("unused");
191 }

References Actions::msg().

◆ processNpcQuestEffect()

void EAthena::QuestRecv::processNpcQuestEffect ( Net::MessageIn msg)

Definition at line 259 of file questrecv.cpp.

260 {
262  // this packed mostly useless, because manaplus can show any
263  // kind of effects based on quest states.
264  msg.readInt32("npc id");
265  msg.readInt16("x");
266  msg.readInt16("y");
267  msg.readInt16("state");
268  msg.readInt16("color");
269 }

References Actions::msg(), and UNIMPLEMENTEDPACKET.

◆ processRemoveQuest()

void EAthena::QuestRecv::processRemoveQuest ( Net::MessageIn msg)

Definition at line 232 of file questrecv.cpp.

233 {
234  const int var = msg.readInt32("quest id");
235  const int val = -1;
236 
237  // not removing quest, because this is impossible,
238  // but changing status to -1
239  if (questsWindow != nullptr)
240  {
241  questsWindow->updateQuest(var, val, 0, 0, 0);
242  questsWindow->rebuild(true);
243  }
244  if (skillDialog != nullptr)
245  {
246  skillDialog->updateQuest(var, val, 0, 0, 0);
248  }
249 }

References Actions::msg(), SkillDialog::playUpdateEffect(), questsWindow, QuestsWindow::rebuild(), SKILL_VAR_MIN_ID, skillDialog, QuestsWindow::updateQuest(), and SkillDialog::updateQuest().

◆ processUpdateQuestsObjectives()

void EAthena::QuestRecv::processUpdateQuestsObjectives ( Net::MessageIn msg)

Definition at line 193 of file questrecv.cpp.

194 {
195  // ignored
196  msg.readInt16("len");
197  const int num = msg.readInt16("objectives count");
198  for (int f = 0; f < num; f ++)
199  {
200  msg.readInt32("quest id");
201  if (msg.getVersion() >= 20181010)
202  {
203  msg.readInt32("hunt ident");
204  msg.readInt32("hunt ident2");
205  }
206  else if (msg.getVersion() >= 20150513)
207  {
208  msg.readInt32("hunt ident");
209  }
210  else
211  {
212  msg.readInt32("monster id");
213  }
214  msg.readInt16("count old");
215  msg.readInt16("count new");
216  }
217 }

References Actions::msg().

◆ processUpdateQuestsObjectives2()

void EAthena::QuestRecv::processUpdateQuestsObjectives2 ( Net::MessageIn msg)

Definition at line 219 of file questrecv.cpp.

220 {
221  // ignored
222  const int num = (msg.readInt16("len") - 4) / 12;
223  for (int f = 0; f < num; f ++)
224  {
225  msg.readInt32("quest id");
226  msg.readInt32("monster id");
227  msg.readInt16("max count");
228  msg.readInt16("count");
229  }
230 }

References Actions::msg().