39static void parseMenu(
Event &event,
const std::string &options)
41 std::istringstream iss(options);
45 while (getline(iss, tmp,
':'))
48 event.setString(
"choice" +
toString(count), tmp);
51 event.setInt(
"choiceCount", count);
58 static const uint16_t _messages[] = {
105 event.
setInt(
"id", npcId);
122 event.
setInt(
"id", npcId);
130 event.
setInt(
"id", npcId);
143 event.
setInt(
"id", npcId);
152 event.
setInt(
"id", npcId);
161 event.
setInt(
"id", npcId);
254 const std::string &text)
Action getCurrentAction() const
Get the being's action currently performed.
void setInt(const std::string &key, int value)
Sets the given variable to the given integer, if it isn't already set.
void setAction(Action action, int attackId=1) override
Sets the current action.
const uint16_t * handledMessages
Used for parsing an incoming message from eAthena.
std::string readString(int length=-1)
Reads a string.
uint16_t readInt16()
Reads an unsigned 16-bit integer from the message.
uint16_t getId() const
Returns the message ID.
uint32_t readInt32()
Reads an unsigned 32-bit integer from the message.
unsigned int getLength() const
Returns the message length.
Used for building an outgoing message to eAthena.
void writeInt32(uint32_t value)
Writes an unsigned 32-bit integer to the message.
void writeInt8(uint8_t value)
Writes an unsigned 8-bit integer to the message.
void writeInt16(uint16_t value)
Writes an unsigned 16-bit integer to the message.
void writeString(const std::string &string, int length=-1)
Writes a string.
void integerInput(int npcId, int value) override
void handleMessage(MessageIn &msg) override
void closeDialog(int npcId) override
void sell(int beingId) override
void sendLetter(int npcId, const std::string &recipient, const std::string &text) override
void buy(int beingId) override
void sellItem(int beingId, int itemId, int amount) override
void talk(int npcId) override
void nextDialog(int npcId) override
void buyItem(int beingId, int itemId, int amount) override
void endShopping(int beingId) override
void stringInput(int npcId, const std::string &value) override
void startShopping(int beingId) override
void menuSelect(int npcId, int choice) override
LocalPlayer * local_player
Net::NpcHandler * npcHandler
Warning: buffers and other variables are shared, so there can be only one connection active at a time...
@ CMSG_NPC_BUY_SELL_REQUEST
std::string toString(const T &arg)
Converts the given value to a string using std::stringstream.