57 static const unsigned int RFAIL = 10;
73 const int skillCount = (
msg.getLength() - 4) / sz;
78 for (
int k = 0; k < skillCount; k++)
80 const int skillId =
msg.readInt16(
"skill id");
82 msg.readInt32(
"inf"));
84 msg.readInt32(
"inf2");
85 const int level =
msg.readInt16(
"skill level");
86 const int sp =
msg.readInt16(
"sp");
87 const int range =
msg.readInt16(
"range");
88 const std::string name =
msg.readString(24,
"skill name");
91 if ((oldLevel != 0) && oldLevel != level)
92 updateSkill = skillId;
99 skillId, name, level, range, up, inf, sp);
107 if (updateSkill != 0)
115 const int skillId =
msg.readInt16(
"skill id");
117 msg.readInt32(
"inf"));
118 const int level =
msg.readInt16(
"skill level");
119 const int sp =
msg.readInt16(
"sp");
120 const int range =
msg.readInt16(
"range");
121 const std::string name =
msg.readString(24,
"skill name");
124 if ((oldLevel != 0) && oldLevel != level)
125 updateSkill = skillId;
132 skillId, name, level, range, up, inf, sp);
135 if (updateSkill != 0)
143 msg.readInt16(
"len");
144 const int skillId =
msg.readInt16(
"skill id");
146 msg.readInt32(
"inf"));
147 msg.readInt32(
"inf2");
148 const int level =
msg.readInt16(
"skill level");
149 const int sp =
msg.readInt16(
"sp");
150 const int range =
msg.readInt16(
"range");
151 const std::string name =
msg.readString(24,
"skill name");
154 if ((oldLevel != 0) && oldLevel != level)
155 updateSkill = skillId;
162 skillId, name, level, range, up, inf, sp);
165 if (updateSkill != 0)
173 const int skillId =
msg.readInt16(
"skill id");
175 msg.readInt32(
"inf"));
176 const int level =
msg.readInt16(
"skill level");
177 const int sp =
msg.readInt16(
"sp");
178 const int range =
msg.readInt16(
"range");
181 if ((oldLevel != 0) && oldLevel != level)
182 updateSkill = skillId;
189 skillId,
"", level, range, up, inf, sp);
192 if (updateSkill != 0)
200 msg.readInt16(
"len");
201 const int skillId =
msg.readInt16(
"skill id");
203 msg.readInt32(
"inf"));
204 msg.readInt32(
"inf2");
205 const int level =
msg.readInt16(
"skill level");
206 const int sp =
msg.readInt16(
"sp");
207 const int range =
msg.readInt16(
"range");
210 if ((oldLevel != 0) && oldLevel != level)
211 updateSkill = skillId;
218 skillId,
"", level, range, up, inf, sp);
221 if (updateSkill != 0)
229 const int skillId =
msg.readInt16(
"skill id");
232 updateSkill = skillId;
238 if (updateSkill != 0)
245 const int skillId =
msg.readInt16(
"skill id");
246 const int duration =
msg.readInt32(
"duration");
254 if (
msg.getVersion() >= 20120604)
258 const int count = (
msg.readInt16(
"len") - 4) / packetLen;
259 for (
int f = 0; f < count; f ++)
261 const int skillId =
msg.readInt16(
"skill id");
262 if (
msg.getVersion() >= 20120604)
263 msg.readInt32(
"total");
264 const int duration =
msg.readInt32(
"duration");
277 const int skillId =
msg.readInt16(
"skill id");
278 const int bskill =
msg.readItemId(
"btype");
279 const int itemId =
msg.readItemId(
"item id");
280 const signed char success =
msg.readUInt8(
"success");
281 const signed char reason =
msg.readUInt8(
"reason");
285 logger->
log(
"Action: %d/%d", bskill, success);
302 txt =
info->errorText;
307 txt =
strprintf(
_(
"Unknown skill error: %d"), bskill);
315 txt =
info->errorText +
".";
320 txt =
strprintf(
_(
"Unknown skill error: %d."), skillId);
329 txt.append(
_(
"You have not yet reached a high enough lvl!"));
333 txt.append(
_(
"Insufficient HP!"));
337 txt.append(
_(
"Insufficient SP!"));
341 txt.append(
_(
"You have no memos!"));
345 txt.append(
_(
"You cannot do that right now!"));
349 txt.append(
_(
"Seems you need more money... ;-)"));
353 txt.append(
_(
"You cannot use this skill with that "
358 txt.append(
_(
"You need another red gem!"));
362 txt.append(
_(
"You need another blue gem!"));
366 txt.append(
_(
"You're carrying to much to do this!"));
370 txt.append(
_(
"Fail summon."));
374 txt.append(
_(
"Need spirits."));
378 const int amount = bskill;
384 info.getLink().c_str()));
389 txt.append(
strprintf(
_(
"Need equipment %s and amount %d"),
390 info.getLink().c_str(),
397 const int amount = bskill;
403 info.getLink().c_str()));
408 txt.append(
strprintf(
_(
"Need item %s and amount %d"),
409 info.getLink().c_str(),
417 txt.append(
_(
"Skill failed!"));
431 const int skillId =
msg.readInt16(
"skill id");
435 _(
"Select warp target"),
442 for (
int f = 0; f < 4; f ++)
443 dialog->
addText(
msg.readString(16,
"map name"));
448 const int count = (
msg.readInt16(
"len") - 6) / 16;
449 const int skillId =
msg.readInt16(
"skill id");
453 _(
"Select warp target"),
460 for (
int f = 0; f < count; f ++)
461 dialog->
addText(
msg.readString(16,
"map name"));
466 const int type =
msg.readUInt8(
"type");
488 const int count = (
msg.readInt16(
"len") - 4) / 4 *
itemIdLen;
489 for (
int f = 0; f < count; f ++)
491 msg.readItemId(
"item id");
492 for (
int d = 0; d < 3; d ++)
493 msg.readItemId(
"material id");
501 msg.readInt16(
"flag");
502 msg.readItemId(
"item id");
509 msg.readBeingId(
"being id");
516 const int count = (
msg.readInt16(
"len") - 4) /
itemIdLen;
517 for (
int f = 0; f < count; f ++)
518 msg.readItemId(
"item id");
525 for (
int f = 0; f < 7; f ++)
526 msg.readInt32(
"skill id");
535 const int count = (
msg.readInt16(
"len") - 4) / 4;
536 for (
int f = 0; f < count; f ++)
537 msg.readInt32(
"skill id");
546 msg.readBeingId(
"being id");
547 for (
int f = 0; f < 5; f ++)
548 msg.readInt32(
"devotee id");
549 msg.readInt16(
"range");
556 msg.readInt32(
"skill level");
557 msg.readInt32(
"unused");
562 msg.readBeingId(
"being id");
563 msg.readInt16(
"skill id");
564 msg.readInt16(
"skill level");
567 msg.readInt32(
"cast time");
const bool AllowQuit_false
#define fromBool(val, name)
void stopCast(const bool b)
void log(const char *const log_text,...)
void setSkillDuration(const SkillOwner::Type owner, const int id, const int duration)
SkillInfo * getSkill(const int id) const
bool updateSkill(const int id, const int range, const Modifiable modifiable, const SkillType::SkillType type, const int sp)
void playRemoveEffect(const int id) const
void updateModelsHidden()
void removeSkill(const int id)
void playUpdateEffect(const int id) const
void addSkill(const SkillOwner::Type owner, const int id, const std::string &name, const int level, const int range, const Modifiable modifiable, const SkillType::SkillType type, const int sp)
std::string update(const int id)
void hideSkills(const SkillOwner::Type owner)
void setSkill(const int skillId)
void setDialog(TextSelectDialog *const dialog)
void addText(const std::string &text)
static const unsigned int RFAIL_SUMMON
static const unsigned int RFAIL_SPIRITS
static const unsigned int RFAIL_NEED_ITEM
static const unsigned int RFAIL_NEED_EQUIPMENT
static const unsigned int RFAIL
LocalPlayer * localPlayer
#define UNIMPLEMENTEDPACKETFIELD(field)
#define UNIMPLEMENTEDPACKET
bool msg(InputEvent &event)
bool info(InputEvent &event)
void processSkillUnitUpdate(Net::MessageIn &msg)
void processSkillFailed(Net::MessageIn &msg)
void processSkillAdd(Net::MessageIn &msg)
void processPlayerSkills(Net::MessageIn &msg)
void processSkillItemListWindow(Net::MessageIn &msg)
void processSkillUpdate(Net::MessageIn &msg)
void processSkillProduceMixList(Net::MessageIn &msg)
void processSkillWarpPoint(Net::MessageIn &msg)
void processSkillDevotionEffect(Net::MessageIn &msg)
void processSkillWarpPoint2(Net::MessageIn &msg)
void processSkillArrowCreateList(Net::MessageIn &msg)
void processSkillDelete(Net::MessageIn &msg)
void processSkillMemoMessage(Net::MessageIn &msg)
void processSkillCoolDown(Net::MessageIn &msg)
void processSkillAdd2(Net::MessageIn &msg)
void processSkillScale(Net::MessageIn &msg)
void processSkillAutoSpells1(Net::MessageIn &msg)
void processSkillAutoSpells2(Net::MessageIn &msg)
void processSkillUpdate2(Net::MessageIn &msg)
void processSkillProduceEffect(Net::MessageIn &msg)
void processSkillCoolDownList(Net::MessageIn &msg)
const ItemInfo & get(const int id)
void notify(const unsigned int message)
int getSkillLevel(const int id)
void setSkillLevel(const int id, const int value)
static const unsigned int RFAIL_BLUEGEM
static const unsigned int RFAIL_OVERWEIGHT
static const unsigned int RFAIL_INSUFHP
static const unsigned int RFAIL_INSUFSP
static const unsigned int RFAIL_ZENY
static const unsigned int RFAIL_SKILLDELAY
static const unsigned int RFAIL_REDGEM
static const unsigned int RFAIL_SKILLDEP
static const unsigned int BSKILL_EMOTE
static const unsigned int RFAIL_WEAPON
static const unsigned int RFAIL_NOMEMO
static const unsigned int SKILL_FAILED
SkillDialog * skillDialog
SkillWarpListener skillWarpListener
std::string strprintf(const char *const format,...)