40 #include "gui/viewport.h"
46 #include "resources/map/map.h"
66 BLOCK_END(
"BeingRecv::processBeingRemove")
72 const BeingId id =
msg.readBeingId(
"being id");
73 const uint8_t type =
msg.readUInt8(
"remove flag");
75 if (dstBeing ==
nullptr)
77 BLOCK_END(
"BeingRecv::processBeingRemove")
99 if ((
info ==
nullptr) || (
info->getAllowDelete() != 0))
108 const std::string name = dstBeing->
getName();
146 BLOCK_END(
"BeingRecv::processBeingRemove")
154 BLOCK_END(
"BeingRecv::processBeingAction")
159 msg.readBeingId(
"src being id"));
161 msg.readBeingId(
"dst being id"));
163 msg.readInt32(
"tick");
164 const int srcSpeed =
msg.readInt32(
"src speed");
165 msg.readInt32(
"dst speed");
166 const int param1 =
msg.readInt16(
"param1");
167 msg.readInt16(
"param 2");
169 msg.readUInt8(
"type"));
170 msg.readInt16(
"param 3");
179 if (srcBeing !=
nullptr)
188 if (dstBeing !=
nullptr)
203 if (srcBeing !=
nullptr)
216 if (srcBeing !=
nullptr)
241 BLOCK_END(
"BeingRecv::processBeingAction")
249 BLOCK_END(
"BeingRecv::processBeingEmotion")
254 msg.readBeingId(
"being id"));
255 if (dstBeing ==
nullptr)
258 msg.readUInt8(
"emote");
259 BLOCK_END(
"BeingRecv::processBeingEmotion")
263 const uint8_t
emote =
msg.readUInt8(
"emote");
272 BLOCK_END(
"BeingRecv::processBeingEmotion")
280 BLOCK_END(
"BeingRecv::processNameResponse")
284 const BeingId beingId =
msg.readBeingId(
"being id");
285 const std::string name =
msg.readString(24,
"name");
290 if (dstBeing !=
nullptr)
325 if (member !=
nullptr)
330 BLOCK_END(
"BeingRecv::processNameResponse")
334 BLOCK_END(
"BeingRecv::processNameResponse")
342 BLOCK_END(
"BeingRecv::processPlayerStop")
346 const BeingId id =
msg.readBeingId(
"account id");
351 if (dstBeing !=
nullptr)
353 const uint16_t
x =
msg.readInt16(
"x");
354 const uint16_t
y =
msg.readInt16(
"y");
358 BLOCK_END(
"BeingRecv::processPlayerStop")
364 BLOCK_END(
"BeingRecv::processPlayerStop")
370 msg.readInt32(
"target id");
371 msg.readInt16(
"target x");
372 msg.readInt16(
"target y");
375 msg.readInt16(
"attack range");
379 BLOCK_END(
"BeingRecv::processPlayerStop")
386 const int id =
msg.readInt16(
"skill id");
388 if (
msg.getVersion() >= 20131223)
393 msg.readBeingId(
"dst being id"));
395 msg.readBeingId(
"src being id"));
396 msg.readUInt8(
"fail");
398 if (srcBeing !=
nullptr)
408 BLOCK_END(
"BeingRecv::processPvpMapMode")
415 BLOCK_END(
"BeingRecv::processPvpMapMode")
423 BLOCK_END(
"BeingRecv::processBeingMove3")
427 static const int16_t dirx[8] = {0, -1, -1, -1, 0, 1, 1, 1};
428 static const int16_t diry[8] = {1, 1, 0, -1, -1, -1, 0, 1};
430 const int len =
msg.readInt16(
"len") - 14;
432 msg.readBeingId(
"being id"));
433 if (dstBeing ==
nullptr ||
437 msg.readInt16(
"speed");
440 unsigned char *bytes =
msg.readBytes(len,
"moving path");
442 BLOCK_END(
"BeingRecv::processBeingMove3")
445 const int16_t speed =
msg.readInt16(
"speed");
447 const int16_t
x =
msg.readInt16(
"x");
448 const int16_t
y =
msg.readInt16(
"y");
449 const unsigned char *moves =
msg.readBytes(len,
"moving path");
452 if (moves !=
nullptr)
458 for (
int f = len - 1; f >= 0; f --)
460 const unsigned char dir = moves[f];
471 if (x2 ==
x && y2 ==
y)
504 BLOCK_END(
"BeingRecv::processBeingMove3")
514 if (job <= 25 || (job >= 4001 && job <= 4049))
516 else if (job >= 46 && job <= 1000)
518 else if (job > 1000 && job <= 2000)
ActorManager * actorManager
AttackType ::T AttackTypeT
const BeingId BeingId_zero
Being * findBeing(const BeingId id) const
void destroy(ActorSprite *const actor)
void updateNameId(const std::string &name, const BeingId beingId)
Being * createBeing(const BeingId id, const ActorTypeT type, const BeingTypeId subtype)
void setName(const std::string &name)
virtual void setAction(const BeingActionT &action, const int attackId)
virtual void setTileCoords(const int x, const int y)
void setPath(const Path &path)
void setWalkSpeed(const int speed)
void recalcSpritesOrder()
void handleAttack(Being *const victim, const int damage, const int attackId)
void setName(const std::string &name)
void takeDamage(Being *const attacker, const int amount, const AttackTypeT type, const int attackId, const int level)
void setEmote(const uint8_t emotion, const int emote_time)
const std::string & getName() const
BeingActionT getCurrentAction() const
void handleSkill(Being *const victim, const int damage, const int skillId, const int skillLevel)
ActorTypeT getType() const
const BeingInfo * getInfo() const
void setAttackDelay(const int n)
bool getBoolValue(const std::string &key) const
Map * getCurrentMap() const
void followMoveTo(const Being *const being, const int x, const int y)
Being * getTarget() const
void imitateEmote(const Being *const being, const unsigned char action) const
void stopAttack(const bool keepAttack)
void checkNewName(Being *const being)
void imitateAction(const Being *const being, const BeingActionT &action)
void log(const char *const log_text,...)
void setPvpMode(const int mode)
void addPortalTile(const std::string &name, const int type, const int x, const int y)
virtual bool haveMove3() const =0
bool hasPermission(const Being *const being, const unsigned int flags) const
#define FOR_EACHR(type, iter, array)
#define fromInt(val, name)
LocalPlayer * localPlayer
#define UNIMPLEMENTEDPACKETFIELD(field)
bool heal(InputEvent &event)
bool msg(InputEvent &event)
bool emote(InputEvent &event)
bool info(InputEvent &event)
void processSkillNoDamage(Net::MessageIn &msg)
Being * createBeing(const BeingId id, const int job)
void processPlayerMoveToAttack(Net::MessageIn &msg)
void processPlayerStop(Net::MessageIn &msg)
void processPvpMapMode(Net::MessageIn &msg)
void processBeingEmotion(Net::MessageIn &msg)
void processNameResponse(Net::MessageIn &msg)
void processBeingRemove(Net::MessageIn &msg)
void processBeingMove3(Net::MessageIn &msg)
void processBeingAction(Net::MessageIn &msg)
void notify(const unsigned int message)
@ BEING_REMOVE_TRICK_DEAD
@ BEING_REMOVE_LOGGED_OUT
Net::ServerFeatures * serverFeatures
#define BLOCK_START(name)
PlayerRelationsManager playerRelations
Path::reverse_iterator PathRIterator
std::list< Position > Path
SocialWindow * socialWindow
static const unsigned int EMOTE