ManaPlus
Functions | Variables
EAthena::NpcRecv Namespace Reference

Functions

void processNpcCutin (Net::MessageIn &msg)
 
void processNpcViewPoint (Net::MessageIn &msg)
 
void processNpcShowProgressBar (Net::MessageIn &msg)
 
void processNpcCloseTimeout (Net::MessageIn &msg)
 
void processArea (Net::MessageIn &msg)
 
void processShowDigit (Net::MessageIn &msg)
 
void processProgressBarAbort (Net::MessageIn &msg)
 
void processShowProgressBarFree (Net::MessageIn &msg)
 
void processNpcSkin (Net::MessageIn &msg)
 
void processPrivateAirShipResponse (Net::MessageIn &msg)
 

Variables

BeingTypeId mNpcTypeId = BeingTypeId_zero
 

Function Documentation

◆ processArea()

void EAthena::NpcRecv::processArea ( Net::MessageIn msg)

Definition at line 102 of file npcrecv.cpp.

103 {
104  if (actorManager == nullptr)
105  return;
106  const int len = msg.readInt16("len");
107  if (len < 12)
108  return;
109  Being *const dstBeing = actorManager->findBeing(
110  msg.readBeingId("npc id"));
111  const int area = msg.readInt32("area size");
112  if (dstBeing != nullptr)
113  dstBeing->setAreaSize(area);
114 }
ActorManager * actorManager
Being * findBeing(const BeingId id) const
Definition: being.h:96
void setAreaSize(const int areaSize)
Definition: being.h:1052
bool msg(InputEvent &event)
Definition: chat.cpp:39

References actorManager, ActorManager::findBeing(), Actions::msg(), and Being::setAreaSize().

◆ processNpcCloseTimeout()

void EAthena::NpcRecv::processNpcCloseTimeout ( Net::MessageIn msg)

Definition at line 94 of file npcrecv.cpp.

95 {
98  // this packet send after npc closed by timeout.
99  msg.readInt32("npc id");
100 }
#define UNIMPLEMENTEDPACKET
Definition: logger.h:56
bool mRequestLang
Definition: npcrecv.cpp:43

References Ea::NpcRecv::mRequestLang, Actions::msg(), and UNIMPLEMENTEDPACKET.

◆ processNpcCutin()

void EAthena::NpcRecv::processNpcCutin ( Net::MessageIn msg)

Definition at line 46 of file npcrecv.cpp.

47 {
49  if (cutInWindow == nullptr)
50  {
51  msg.readString(64, "image name");
52  msg.readUInt8("type");
53  return;
54  }
55  const std::string image = msg.readString(64, "image name");
56  const CutInT cutin = static_cast<CutInT>(msg.readUInt8("type"));
57  if (cutInWindow != nullptr)
58  cutInWindow->show(image, cutin);
59 }
void show(const std::string &name, const CutInT cutin)
Definition: cutinwindow.cpp:77
CutIn ::T CutInT
Definition: cutin.h:35
CutInWindow * cutInWindow
Definition: cutinwindow.cpp:37

References cutInWindow, Ea::NpcRecv::mRequestLang, Actions::msg(), and CutInWindow::show().

◆ processNpcShowProgressBar()

void EAthena::NpcRecv::processNpcShowProgressBar ( Net::MessageIn msg)

Definition at line 76 of file npcrecv.cpp.

77 {
80  // +++ probably need show progress bar in npc dialog
81  msg.readInt32("color");
82  msg.readInt32("seconds");
83 }

References Ea::NpcRecv::mRequestLang, Actions::msg(), and UNIMPLEMENTEDPACKET.

◆ processNpcSkin()

void EAthena::NpcRecv::processNpcSkin ( Net::MessageIn msg)

Definition at line 129 of file npcrecv.cpp.

130 {
131  const int len = msg.readInt16("len");
133  if (Ea::NpcRecv::mDialog != nullptr)
134  {
135  const std::string skin = msg.readString(len - 8, "skin");
137  }
138  else
139  {
140  msg.readString(len - 8, "skin");
141  }
142 }
virtual BeingId getNpc(Net::MessageIn &msg, const NpcActionT action)=0
void setSkin(const std::string &skin)
Definition: npcdialog.cpp:1251
NpcDialog * mDialog
Definition: npcrecv.cpp:42
Net::NpcHandler * npcHandler
Definition: net.cpp:93

References Net::NpcHandler::getNpc(), Ea::NpcRecv::mDialog, Actions::msg(), npcHandler, NpcAction::Other, and NpcDialog::setSkin().

◆ processNpcViewPoint()

void EAthena::NpcRecv::processNpcViewPoint ( Net::MessageIn msg)

Definition at line 61 of file npcrecv.cpp.

62 {
65  // +++ probably need add nav point and start moving to it
66  msg.readInt32("npc id");
67  msg.readInt32("type"); // 0 display for 15 sec,
68  // 1 display until teleport,
69  // 2 remove
70  msg.readInt32("x");
71  msg.readInt32("y");
72  msg.readUInt8("number"); // can be used for scripts
73  msg.readInt32("color");
74 }

References Ea::NpcRecv::mRequestLang, Actions::msg(), and UNIMPLEMENTEDPACKET.

◆ processPrivateAirShipResponse()

void EAthena::NpcRecv::processPrivateAirShipResponse ( Net::MessageIn msg)

Definition at line 144 of file npcrecv.cpp.

145 {
147  msg.readUInt32("flag");
148 }

References Actions::msg(), and UNIMPLEMENTEDPACKET.

◆ processProgressBarAbort()

void EAthena::NpcRecv::processProgressBarAbort ( Net::MessageIn msg)

Definition at line 124 of file npcrecv.cpp.

125 {
127 }

References UNIMPLEMENTEDPACKET.

◆ processShowDigit()

void EAthena::NpcRecv::processShowDigit ( Net::MessageIn msg)

Definition at line 116 of file npcrecv.cpp.

117 {
119 
120  msg.readUInt8("type");
121  msg.readInt32("value");
122 }

References Actions::msg(), and UNIMPLEMENTEDPACKET.

◆ processShowProgressBarFree()

void EAthena::NpcRecv::processShowProgressBarFree ( Net::MessageIn msg)

Definition at line 85 of file npcrecv.cpp.

86 {
89  msg.readBeingId("account id");
90  msg.readInt32("color");
91  msg.readInt32("time");
92 }

References Ea::NpcRecv::mRequestLang, Actions::msg(), and UNIMPLEMENTEDPACKET.

Variable Documentation

◆ mNpcTypeId

BeingTypeId EAthena::NpcRecv::mNpcTypeId = BeingTypeId_zero