No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

protocolcodes.h 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. /*
  2. * Copyright (c) 2010-2017 OTClient <https://github.com/edubart/otclient>
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5. * of this software and associated documentation files (the "Software"), to deal
  6. * in the Software without restriction, including without limitation the rights
  7. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. * copies of the Software, and to permit persons to whom the Software is
  9. * furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. * THE SOFTWARE.
  21. */
  22. #ifndef PROTOCOLCODES_H
  23. #define PROTOCOLCODES_H
  24. #include "global.h"
  25. namespace Proto {
  26. enum LoginServerOpts {
  27. LoginServerError = 10,
  28. LoginServerMotd = 20,
  29. LoginServerUpdateNeeded = 30,
  30. LoginServerCharacterList = 100
  31. };
  32. enum ItemOpcode {
  33. StaticText = 96,
  34. UnknownCreature = 97,
  35. OutdatedCreature = 98,
  36. Creature = 99
  37. };
  38. enum GameServerOpcodes : uint8
  39. {
  40. GameServerLoginOrPendingState = 10,
  41. GameServerGMActions = 11,
  42. GameServerEnterGame = 15,
  43. GameServerUpdateNeeded = 17,
  44. GameServerLoginError = 20,
  45. GameServerLoginAdvice = 21,
  46. GameServerLoginWait = 22,
  47. GameServerLoginSuccess = 23,
  48. GameServerLoginToken = 24,
  49. GameServerStoreButtonIndicators = 25, // 1097
  50. GameServerPingBack = 29,
  51. GameServerPing = 30,
  52. GameServerChallenge = 31,
  53. GameServerDeath = 40,
  54. // all in game opcodes must be greater than 50
  55. GameServerFirstGameOpcode = 50,
  56. // otclient ONLY
  57. GameServerExtendedOpcode = 50,
  58. // NOTE: add any custom opcodes in this range
  59. // 51 - 99
  60. GameServerChangeMapAwareRange = 51,
  61. // original tibia ONLY
  62. GameServerFullMap = 100,
  63. GameServerMapTopRow = 101,
  64. GameServerMapRightRow = 102,
  65. GameServerMapBottomRow = 103,
  66. GameServerMapLeftRow = 104,
  67. GameServerUpdateTile = 105,
  68. GameServerCreateOnMap = 106,
  69. GameServerChangeOnMap = 107,
  70. GameServerDeleteOnMap = 108,
  71. GameServerMoveCreature = 109,
  72. GameServerOpenContainer = 110,
  73. GameServerCloseContainer = 111,
  74. GameServerCreateContainer = 112,
  75. GameServerChangeInContainer = 113,
  76. GameServerDeleteInContainer = 114,
  77. GameServerSetInventory = 120,
  78. GameServerDeleteInventory = 121,
  79. GameServerOpenNpcTrade = 122,
  80. GameServerPlayerGoods = 123,
  81. GameServerCloseNpcTrade = 124,
  82. GameServerOwnTrade = 125,
  83. GameServerCounterTrade = 126,
  84. GameServerCloseTrade = 127,
  85. GameServerAmbient = 130,
  86. GameServerGraphicalEffect = 131,
  87. GameServerTextEffect = 132,
  88. GameServerMissleEffect = 133,
  89. GameServerMarkCreature = 134,
  90. GameServerTrappers = 135,
  91. GameServerCreatureHealth = 140,
  92. GameServerCreatureLight = 141,
  93. GameServerCreatureOutfit = 142,
  94. GameServerCreatureSpeed = 143,
  95. GameServerCreatureSkull = 144,
  96. GameServerCreatureParty = 145,
  97. GameServerCreatureUnpass = 146,
  98. GameServerCreatureMarks = 147,
  99. GameServerPlayerHelpers = 148,
  100. GameServerCreatureType = 149,
  101. GameServerEditText = 150,
  102. GameServerEditList = 151,
  103. GameServerBlessings = 156,
  104. GameServerPreset = 157,
  105. GameServerPremiumTrigger = 158, // 1038
  106. GameServerPlayerDataBasic = 159, // 950
  107. GameServerPlayerData = 160,
  108. GameServerPlayerSkills = 161,
  109. GameServerPlayerState = 162,
  110. GameServerClearTarget = 163,
  111. GameServerPlayerModes = 167,
  112. GameServerSpellDelay = 164, // 870
  113. GameServerSpellGroupDelay = 165, // 870
  114. GameServerMultiUseDelay = 166, // 870
  115. GameServerSetStoreDeepLink = 168, // 1097
  116. GameServerTalk = 170,
  117. GameServerChannels = 171,
  118. GameServerOpenChannel = 172,
  119. GameServerOpenPrivateChannel = 173,
  120. GameServerRuleViolationChannel = 174,
  121. GameServerRuleViolationRemove = 175,
  122. GameServerRuleViolationCancel = 176,
  123. GameServerRuleViolationLock = 177,
  124. GameServerOpenOwnChannel = 178,
  125. GameServerCloseChannel = 179,
  126. GameServerTextMessage = 180,
  127. GameServerCancelWalk = 181,
  128. GameServerWalkWait = 182,
  129. GameServerUnjustifiedStats = 183,
  130. GameServerPvpSituations = 184,
  131. GameServerFloorChangeUp = 190,
  132. GameServerFloorChangeDown = 191,
  133. GameServerChooseOutfit = 200,
  134. GameServerVipAdd = 210,
  135. GameServerVipState = 211,
  136. GameServerVipLogout = 212,
  137. GameServerTutorialHint = 220,
  138. GameServerAutomapFlag = 221,
  139. GameServerCoinBalance = 223, // 1080
  140. GameServerStoreError = 224, // 1080
  141. GameServerRequestPurchaseData = 225, // 1080
  142. GameServerQuestLog = 240,
  143. GameServerQuestLine = 241,
  144. GameServerCoinBalanceUpdating = 242, // 1080
  145. GameServerChannelEvent = 243, // 910
  146. GameServerItemInfo = 244, // 910
  147. GameServerPlayerInventory = 245, // 910
  148. GameServerMarketEnter = 246, // 944
  149. GameServerMarketLeave = 247, // 944
  150. GameServerMarketDetail = 248, // 944
  151. GameServerMarketBrowse = 249, // 944
  152. GameServerModalDialog = 250, // 960
  153. GameServerStore = 251, // 1080
  154. GameServerStoreOffers = 252, // 1080
  155. GameServerStoreTransactionHistory = 253, // 1080
  156. GameServerStoreCompletePurchase = 254 // 1080
  157. };
  158. enum ClientOpcodes : uint8
  159. {
  160. ClientEnterAccount = 1,
  161. ClientPendingGame = 10,
  162. ClientEnterGame = 15,
  163. ClientLeaveGame = 20,
  164. ClientPing = 29,
  165. ClientPingBack = 30,
  166. // all in game opcodes must be equal or greater than 50
  167. ClientFirstGameOpcode = 50,
  168. // otclient ONLY
  169. ClientExtendedOpcode = 50,
  170. ClientChangeMapAwareRange = 51,
  171. // NOTE: add any custom opcodes in this range
  172. // 51 - 99
  173. // original tibia ONLY
  174. ClientAutoWalk = 100,
  175. ClientWalkNorth = 101,
  176. ClientWalkEast = 102,
  177. ClientWalkSouth = 103,
  178. ClientWalkWest = 104,
  179. ClientStop = 105,
  180. ClientWalkNorthEast = 106,
  181. ClientWalkSouthEast = 107,
  182. ClientWalkSouthWest = 108,
  183. ClientWalkNorthWest = 109,
  184. ClientTurnNorth = 111,
  185. ClientTurnEast = 112,
  186. ClientTurnSouth = 113,
  187. ClientTurnWest = 114,
  188. ClientEquipItem = 119, // 910
  189. ClientMove = 120,
  190. ClientInspectNpcTrade = 121,
  191. ClientBuyItem = 122,
  192. ClientSellItem = 123,
  193. ClientCloseNpcTrade = 124,
  194. ClientRequestTrade = 125,
  195. ClientInspectTrade = 126,
  196. ClientAcceptTrade = 127,
  197. ClientRejectTrade = 128,
  198. ClientUseItem = 130,
  199. ClientUseItemWith = 131,
  200. ClientUseOnCreature = 132,
  201. ClientRotateItem = 133,
  202. ClientCloseContainer = 135,
  203. ClientUpContainer = 136,
  204. ClientEditText = 137,
  205. ClientEditList = 138,
  206. ClientLook = 140,
  207. ClientLookCreature = 141,
  208. ClientTalk = 150,
  209. ClientRequestChannels = 151,
  210. ClientJoinChannel = 152,
  211. ClientLeaveChannel = 153,
  212. ClientOpenPrivateChannel = 154,
  213. ClientOpenRuleViolation = 155,
  214. ClientCloseRuleViolation = 156,
  215. ClientCancelRuleViolation = 157,
  216. ClientCloseNpcChannel = 158,
  217. ClientChangeFightModes = 160,
  218. ClientAttack = 161,
  219. ClientFollow = 162,
  220. ClientInviteToParty = 163,
  221. ClientJoinParty = 164,
  222. ClientRevokeInvitation = 165,
  223. ClientPassLeadership = 166,
  224. ClientLeaveParty = 167,
  225. ClientShareExperience = 168,
  226. ClientDisbandParty = 169,
  227. ClientOpenOwnChannel = 170,
  228. ClientInviteToOwnChannel = 171,
  229. ClientExcludeFromOwnChannel = 172,
  230. ClientCancelAttackAndFollow = 190,
  231. ClientUpdateTile = 201,
  232. ClientRefreshContainer = 202,
  233. ClientBrowseField = 203,
  234. ClientSeekInContainer = 204,
  235. ClientRequestOutfit = 210,
  236. ClientChangeOutfit = 211,
  237. ClientMount = 212, // 870
  238. ClientAddVip = 220,
  239. ClientRemoveVip = 221,
  240. ClientEditVip = 222,
  241. ClientBugReport = 230,
  242. ClientRuleViolation = 231,
  243. ClientDebugReport = 232,
  244. ClientTransferCoins = 239, // 1080
  245. ClientRequestQuestLog = 240,
  246. ClientRequestQuestLine = 241,
  247. ClientNewRuleViolation = 242, // 910
  248. ClientRequestItemInfo = 243, // 910
  249. ClientMarketLeave = 244, // 944
  250. ClientMarketBrowse = 245, // 944
  251. ClientMarketCreate = 246, // 944
  252. ClientMarketCancel = 247, // 944
  253. ClientMarketAccept = 248, // 944
  254. ClientAnswerModalDialog = 249, // 960
  255. ClientOpenStore = 250, // 1080
  256. ClientRequestStoreOffers = 251, // 1080
  257. ClientBuyStoreOffer = 252, // 1080
  258. ClientOpenTransactionHistory = 253, // 1080
  259. ClientRequestTransactionHistory = 254 // 1080
  260. };
  261. enum CreatureType {
  262. CreatureTypePlayer = 0,
  263. CreatureTypeMonster,
  264. CreatureTypeNpc,
  265. CreatureTypeSummonOwn,
  266. CreatureTypeSummonOther,
  267. CreatureTypeUnknown = 0xFF
  268. };
  269. enum CreaturesIdRange {
  270. PlayerStartId = 0x10000000,
  271. PlayerEndId = 0x40000000,
  272. MonsterStartId = 0x40000000,
  273. MonsterEndId = 0x80000000,
  274. NpcStartId = 0x80000000,
  275. NpcEndId = 0xffffffff
  276. };
  277. void buildMessageModesMap(int version);
  278. Otc::MessageMode translateMessageModeFromServer(uint8 mode);
  279. uint8 translateMessageModeToServer(Otc::MessageMode mode);
  280. }
  281. #endif