ManaPlus
Public Member Functions
EAthena::SkillHandler Class Reference

#include <skillhandler.h>

Inheritance diagram for EAthena::SkillHandler:
Ea::SkillHandler Net::SkillHandler

Public Member Functions

 SkillHandler ()
 
 ~SkillHandler ()
 
void useBeing (const int id, const int level, const BeingId beingId) const
 
void useBeingStart (const int id, const int level, const BeingId beingId) const
 
void useStop (const int id) const
 
void usePos (const int id, const int level, const int x, const int y) const
 
void usePos (const int id, const int level, const int x, const int y, const std::string &text) const
 
void useMap (const int id, const std::string &map) const
 
void getAlchemistRanks () const
 
void getBlacksmithRanks () const
 
void getPkRanks () const
 
void getTaekwonRanks () const
 
void feelSaveOk (const int which) const
 
void lessEffects (const bool isLess) const
 
- Public Member Functions inherited from Ea::SkillHandler
 SkillHandler ()
 
- Public Member Functions inherited from Net::SkillHandler
 SkillHandler ()
 

Detailed Description

Definition at line 32 of file skillhandler.h.

Constructor & Destructor Documentation

◆ SkillHandler()

EAthena::SkillHandler::SkillHandler ( )

Definition at line 40 of file skillhandler.cpp.

40  :
42 {
43  skillHandler = this;
44 }
Net::SkillHandler * skillHandler
Definition: net.cpp:97

References skillHandler.

◆ ~SkillHandler()

EAthena::SkillHandler::~SkillHandler ( )
virtual

Reimplemented from Net::SkillHandler.

Definition at line 46 of file skillhandler.cpp.

47 {
48  skillHandler = nullptr;
49 }

References skillHandler.

Member Function Documentation

◆ feelSaveOk()

void EAthena::SkillHandler::feelSaveOk ( const int  which) const
virtual

Implements Net::SkillHandler.

Definition at line 175 of file skillhandler.cpp.

176 {
177  if (packetVersion >= 20050817)
178  {
179  createOutPacket(CMSG_SKILL_FEEL_SAVE_OK);
180  outMsg.writeInt8(CAST_S8(which), "which");
182  }
183 }
#define CAST_S8
Definition: cast.h:26
int packetVersion
Definition: client.cpp:125
#define createOutPacket(name)
Definition: messageout.h:37
MenuTypeT menu
Definition: menu.cpp:28
@ Unknown
Definition: menutype.h:29

References CAST_S8, createOutPacket, EAthena::menu, packetVersion, and MenuType::Unknown.

◆ getAlchemistRanks()

void EAthena::SkillHandler::getAlchemistRanks ( ) const
virtual

Implements Net::SkillHandler.

Definition at line 143 of file skillhandler.cpp.

144 {
145  if (packetVersion >= 20041108)
146  {
147  createOutPacket(CMSG_ALCHEMIST_RANKS);
148  }
149 }

References createOutPacket, and packetVersion.

◆ getBlacksmithRanks()

void EAthena::SkillHandler::getBlacksmithRanks ( ) const
virtual

Implements Net::SkillHandler.

Definition at line 151 of file skillhandler.cpp.

152 {
153  if (packetVersion >= 20041108)
154  {
155  createOutPacket(CMSG_BLACKSMITH_RANKS);
156  }
157 }

References createOutPacket, and packetVersion.

◆ getPkRanks()

void EAthena::SkillHandler::getPkRanks ( ) const
virtual

Implements Net::SkillHandler.

Definition at line 159 of file skillhandler.cpp.

160 {
161  if (packetVersion >= 20050530)
162  {
163  createOutPacket(CMSG_PK_RANKS);
164  }
165 }

References createOutPacket, and packetVersion.

◆ getTaekwonRanks()

void EAthena::SkillHandler::getTaekwonRanks ( ) const
virtual

Implements Net::SkillHandler.

Definition at line 167 of file skillhandler.cpp.

168 {
169  if (packetVersion >= 20050328)
170  {
171  createOutPacket(CMSG_TAEKWON_RANKS);
172  }
173 }

References createOutPacket, and packetVersion.

◆ lessEffects()

void EAthena::SkillHandler::lessEffects ( const bool  isLess) const
virtual

Implements Net::SkillHandler.

Definition at line 185 of file skillhandler.cpp.

186 {
187  if (packetVersion >= 20041115)
188  {
189  createOutPacket(CMSG_PLAYER_LESS_EFFECTS);
190  outMsg.writeInt32(isLess ? 1 : 0, "state");
191  }
192 }

References createOutPacket, and packetVersion.

◆ useBeing()

void EAthena::SkillHandler::useBeing ( const int  id,
const int  level,
const BeingId  beingId 
) const
virtual

Implements Net::SkillHandler.

Definition at line 51 of file skillhandler.cpp.

53 {
54  createOutPacket(CMSG_SKILL_USE_BEING);
55  outMsg.writeInt16(CAST_S16(level), "skill level");
56  outMsg.writeInt16(CAST_S16(id), "skill id");
57  outMsg.writeInt32(toInt(beingId, int), "target id");
58 }
#define CAST_S16
Definition: cast.h:28
#define toInt(val, name)
Definition: intdefines.h:47

References CAST_S16, createOutPacket, and toInt.

◆ useBeingStart()

void EAthena::SkillHandler::useBeingStart ( const int  id,
const int  level,
const BeingId  beingId 
) const
virtual

Implements Net::SkillHandler.

Definition at line 60 of file skillhandler.cpp.

63 {
64  if (packetVersionMain < 20181002 &&
65  packetVersionRe < 20181002 &&
66  packetVersionZero < 20181010)
67  {
68  return;
69  }
70 
71  createOutPacket(CMSG_SKILL_USE_BEING_START);
72  outMsg.writeInt16(CAST_S16(level), "skill level");
73  outMsg.writeInt16(CAST_S16(id), "skill id");
74  outMsg.writeInt32(toInt(beingId, int), "target id");
75 }
int packetVersionRe
Definition: client.cpp:127
int packetVersionMain
Definition: client.cpp:126
int packetVersionZero
Definition: client.cpp:128

References CAST_S16, createOutPacket, packetVersionMain, packetVersionRe, packetVersionZero, and toInt.

◆ useMap()

void EAthena::SkillHandler::useMap ( const int  id,
const std::string &  map 
) const
virtual

Implements Net::SkillHandler.

Definition at line 136 of file skillhandler.cpp.

137 {
138  createOutPacket(CMSG_SKILL_USE_MAP);
139  outMsg.writeInt16(CAST_S16(id), "skill id");
140  outMsg.writeString(map, 16, "map name");
141 }

References CAST_S16, and createOutPacket.

◆ usePos() [1/2]

void EAthena::SkillHandler::usePos ( const int  id,
const int  level,
const int  x,
const int  y 
) const
virtual

Implements Net::SkillHandler.

Definition at line 90 of file skillhandler.cpp.

92 {
93  createOutPacket(CMSG_SKILL_USE_POSITION);
94  if (packetVersion >= 20080827 && packetVersion < 20101124)
95  {
96  outMsg.writeInt32(0, "unused");
97  outMsg.writeInt32(0, "unused");
98  outMsg.writeInt16(CAST_S16(level), "skill level");
99  outMsg.writeInt16(0, "unused");
100  outMsg.writeInt16(CAST_S16(id), "skill id");
101  outMsg.writeInt16(0, "unused");
102  outMsg.writeInt16(CAST_S16(x), "x");
103  outMsg.writeInt16(0, "unused");
104  outMsg.writeInt8(0, "unused");
105  outMsg.writeInt16(CAST_S16(y), "y");
106  }
107  else
108  {
109  outMsg.writeInt16(CAST_S16(level), "skill level");
110  outMsg.writeInt16(CAST_S16(id), "skill id");
111  outMsg.writeInt16(CAST_S16(x), "x");
112  outMsg.writeInt16(CAST_S16(y), "y");
113 /*
114  // disabled due priority from shuffle packets over normal.
115  if (packetVersionZero >= 20180131 ||
116  packetVersion >= 20180207)
117  {
118  outMsg.writeInt8(0, "unknown");
119  }
120 */
121  }
122 }

References CAST_S16, createOutPacket, packetVersion, x, and y.

◆ usePos() [2/2]

void EAthena::SkillHandler::usePos ( const int  id,
const int  level,
const int  x,
const int  y,
const std::string &  text 
) const
virtual

Implements Net::SkillHandler.

Definition at line 124 of file skillhandler.cpp.

127 {
128  createOutPacket(CMSG_SKILL_USE_POSITION_MORE);
129  outMsg.writeInt16(CAST_S16(level), "level");
130  outMsg.writeInt16(CAST_S16(id), "id");
131  outMsg.writeInt16(CAST_S16(x), "x");
132  outMsg.writeInt16(CAST_S16(y), "y");
133  outMsg.writeString(text, 80, "text");
134 }

References CAST_S16, createOutPacket, x, and y.

◆ useStop()

void EAthena::SkillHandler::useStop ( const int  id) const
virtual

Implements Net::SkillHandler.

Definition at line 77 of file skillhandler.cpp.

78 {
79  if (packetVersionMain < 20181002 &&
80  packetVersionRe < 20181002 &&
81  packetVersionZero < 20181010)
82  {
83  return;
84  }
85 
86  createOutPacket(CMSG_SKILL_USE_BEING_STOP);
87  outMsg.writeInt16(CAST_S16(id), "skill id");
88 }

References CAST_S16, createOutPacket, packetVersionMain, packetVersionRe, and packetVersionZero.


The documentation for this class was generated from the following files: