V-MapClass.asm
上传用户:santakups8
上传日期:2021-03-23
资源大小:544k
文件大小:6k
源码类别:

模拟服务器

开发平台:

Asm

  1. ;EasyCodeName=Module1,1
  2. ;-----------------------------------------------------------------------------------
  3. ;    VeMU
  4. ;    Its a package that allows the user to set his own server of the game
  5. ;    "MuOnline", this is not an emulator since i am not "emulating"
  6. ;    what the actual games does, i am "creating" a method for set a Server
  7. ;    of this Game.
  8. ;
  9. ;    Copyright (C) 2010  Felipe Ya馿z
  10. ;
  11. ;    This program is free software: you can redistribute it and/or modify
  12. ;    it under the terms of the GNU General Public License as published by
  13. ;    the Free Software Foundation, either version 3 of the License, or
  14. ;    (at your option) any later version.
  15. ;
  16. ;    This program is distributed in the hope that it will be useful,
  17. ;    but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. ;    GNU General Public License for more details.
  20. ;
  21. ;    You should have received a copy of the GNU General Public License
  22. ;    along with this program.  If not, see http://www.gnu.org/licenses/.
  23. ;-----------------------------------------------------------------------------------
  24. ;-----------------------------------------------------------------------------------
  25. ;                        -----------------
  26. ;                             Coded     /
  27. ;                              By      /
  28. ;                           -={FeN$x)=-
  29. ;                         /  Felipe Y.  
  30. ;                        /               
  31. ;                        -----------------
  32. ; Programming Lang: ASM
  33. ; Country: Chile
  34. ;              My respect for all those who lost their lifes
  35. ;              In the earthquake of my country...
  36. ;              Let god take their spirits home...
  37. ;-----------------------------------------------------------------------------------
  38. ;////////////////////////////////////////////////////////////////////////////////////
  39. ;                       VeMU Project
  40. ;                        MAP CLASS !
  41. ;////////////////////////////////////////////////////////////////////////////////////
  42. V_CMap_LoadTerrain Proto :DWord
  43. ;///////////////////////////////////////
  44. ;View Port Player struct
  45. ;Will be moved for sure
  46. ;to another file in future
  47. ;versions.
  48. ;/////////////////////////////////////
  49. VIEW_PORT_PLAYER Struct
  50.  State Word ? ;B
  51.  Number Word ?
  52.  iType Word ? ;B
  53.  Index Word ?
  54.  Dis DWord ?
  55. VIEW_PORT_PLAYER EndS
  56. ;///////////////////////////////////////
  57. ;CMAPItem struct, handles positions
  58. ;PlayersID, and alot of more
  59. ;variables that are important
  60. ;But only for ITEMS !
  61. ;/////////////////////////////////////
  62. CMAPITEM Struct
  63.  Items ItemStruct <?>
  64.  PlayerX Byte ?
  65.  PlayerY Byte ?
  66.  Live Byte ?
  67.  Give Byte ?
  68.  State DWord ?
  69.  Time DWord ?
  70.  PlayerID DWord ?
  71.  LootTime DWord ?
  72.  VpPlayer VIEW_PORT_PLAYER 75 Dup (<?>) ;this is weird the VIEW_PORT of players is for max 75 players
  73.  VpCounter DWord ?
  74. CMAPITEM EndS
  75. ;////////////////////////////////////////////////////
  76. ;The main Map structure
  77. ;This class got inside support
  78. ;for items, regen area, ViewPort
  79. ;and others, its a very big struct
  80. ;linked to the total of Maps to load.
  81. ;////////////////////////////////////////////////////
  82. MapClass Struct
  83.  pMapAttr DWord ? ;Pointer to save maps attributes
  84.  Header DWord ?
  85.  gWidth DWord ?
  86.  gHeight DWord ?
  87.  pPath DWord ? ;pointer to struct PATHDIMENSION
  88.  ItemMaps CMAPITEM 300 Dup (<?>)  ;How much items you can put in map, i cant put the constant but its MAXITEMS_INMAP
  89.  ItemCounter DWord ?
  90.  RegenArea RECT 57 Dup (<?>) ;This array is for the spawn area, i cant put the constats but its MAPLIMIT
  91.  MapNumber DWord ?
  92. MapClass EndS
  93. ;////////////////////////////////////////////////////
  94. ;This is a virtual initialised struct
  95. ;And got information about the path of maps
  96. ;its used for store the bytes readed from a terrain.
  97. ;////////////////////////////////////////////////////
  98. PATHDIMENSION Struct
  99.  vWidth DWord ?
  100.  vHeight DWord ?
  101.  NumPath DWord ?
  102.  PathX Byte 500 Dup(?)  ;Max X Cords (a little exagerated)
  103.  PathY Byte 500 Dup(?)  ;Max Y Cords (a little exagerated)
  104.  Dir Byte 64 Dup(?)  ; Direction a little weird so much bytes
  105.  LastDir DWord ?
  106.  NumFails DWord ?
  107.  pMap DWord ? ;same pointer has pMap from global struct no reason for this
  108.  pHitMap DWord ? ;Pointer
  109.  cStx DWord ?
  110.  cSty DWord ?
  111.  cEdx DWord ?
  112.  cEdy DWord ?
  113. PATHDIMENSION EndS
  114. ;////////////////////////////////////////////////////
  115. ;Constants for maps !
  116. ;////////////////////////////////////////////////////
  117. .Const
  118. ATT12 Equ 11 ;since terrain0.att doesnt exist its -1
  119. ATT19 Equ 18 ;since terrain0.att doesnt exist its -1
  120. ATT25 Equ 24 ;since terrain0.att doesnt exist its -1
  121. ATT46 equ 45 ;since terrain0.att doesnt exist its -1
  122. ATT57 equ 56 ;since terrain0.att doesnt exist its -1
  123. MAPLIMIT Equ 57 ;NEW MAPS LIMITS !
  124. MAPWIDTH Equ 256
  125. MAPHEIGHT Equ 256
  126. MAXITEMS_INMAP Equ 300
  127. MAPTRADEINV_SIZE equ 32
  128. MAPINV_SIZE equ 96
  129. MAPWARE_SIZE equ 120
  130. ALIGN_MAP_STRINGS equ 26 ;Aligment that each Map string use
  131. ;////////////////////////////////////////////////////
  132. ;Unitialized Data !
  133. ;////////////////////////////////////////////////////
  134. .Data?
  135. pMapObjSpace DB MAPLIMIT * SizeOf MapClass Dup(?) ;Main space for store allmost everything releated to maps
  136. pTempInventoryMap DB MAPINV_SIZE Dup(?)
  137. pTempTradeMap     DB MAPTRADEINV_SIZE Dup(?)
  138. pTempWareHouseMap DB MAPWARE_SIZE Dup(?)
  139. pInventoryMap1 DB (MAX_OBJ_ID - START_OBJ_PLAYERID) * SizeOf ItemStruct * MAPINV_SIZE Dup(?)
  140. pInventoryMap2 DB (MAX_OBJ_ID - START_OBJ_PLAYERID) * SizeOf ItemStruct * MAPINV_SIZE Dup(?)
  141. .Data
  142. .Code