V-MapActions.asm
资源名称:VeMU.rar [点击查看]
上传用户:santakups8
上传日期:2021-03-23
资源大小:544k
文件大小:6k
源码类别:
模拟服务器
开发平台:
Asm
- ;EasyCodeName=Module1,1
- ;-----------------------------------------------------------------------------------
- ; VeMU
- ; Its a package that allows the user to set his own server of the game
- ; "MuOnline", this is not an emulator since i am not "emulating"
- ; what the actual games does, i am "creating" a method for set a Server
- ; of this Game.
- ;
- ; Copyright (C) 2010 Felipe Ya馿z
- ;
- ; This program is free software: you can redistribute it and/or modify
- ; it under the terms of the GNU General Public License as published by
- ; the Free Software Foundation, either version 3 of the License, or
- ; (at your option) any later version.
- ;
- ; This program is distributed in the hope that it will be useful,
- ; but WITHOUT ANY WARRANTY; without even the implied warranty of
- ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ; GNU General Public License for more details.
- ;
- ; You should have received a copy of the GNU General Public License
- ; along with this program. If not, see http://www.gnu.org/licenses/.
- ;-----------------------------------------------------------------------------------
- ;-----------------------------------------------------------------------------------
- ; -----------------
- ; Coded /
- ; By /
- ; -={FeN$x)=-
- ; / Felipe Y.
- ; /
- ; -----------------
- ; Programming Lang: ASM
- ; Country: Chile
- ; My respect for all those who lost their lifes
- ; In the earthquake of my country...
- ; Let god take their spirits home...
- ;-----------------------------------------------------------------------------------
- ;////////////////////////////////////////////////////////////////////////////////////
- ; VeMU Project
- ; Maps Actions !
- ;////////////////////////////////////////////////////////////////////////////////////
- .Const
- .Data?
- .Data
- .Code
- ;////////////////////////////////////////
- ;Initialise specific data
- ;for 57 maps support, value changeable
- ;////////////////////////////////////////
- V_CMap_InitMaps Proc
- Invoke V_VectorCreator, addr pMapObjSpace, Offset V_CMap_SetDimensions, SizeOf MapClass, MAPLIMIT ;Vector constructor
- call V_CMap_LoadAll ;Load all maps
- Ret
- V_CMap_InitMaps EndP
- ;////////////////////////////////////////
- ;Check if map is valid or dont
- ;///////////////////////////////////////
- V_CMap_CheckValidMap Proc MapNumber:Dword
- .if (MapNumber < 0)
- xor eax, eax
- .elseif (MapNumber > MAPLIMIT)
- xor eax, eax
- .else
- mov eax, 1
- .endif
- Ret
- V_CMap_CheckValidMap EndP
- ;////////////////////////////////////////
- ;Initialise items for Maps
- ;///////////////////////////////////////
- V_CMap_InitItems Proc
- Local MyStruct:DWord
- Assume Ecx:Ptr CMAPITEM
- Mov MyStruct, Ecx
- Call V_CItem_Clear ;clear struct of ItemStruct for maps
- Mov [Ecx].VpCounter, 0 ;clean view port counter
- Mov [Ecx].State, 0
- Invoke V_ZeroBuff, addr [Ecx].VpPlayer, SizeOf CMAPITEM.VpPlayer ;clean the whole array
- Assume Ecx:Nothing
- Ret
- V_CMap_InitItems EndP
- ;////////////////////////////////////////////////////////
- ;Set map dimensions into all the
- ;MapClass struct, also set the Spawn
- ;Points for some maps.
- ;This meaby is removed in some future versions.
- ;////////////////////////////////////////////////////////
- V_CMap_SetDimensions Proc
- Local MyStruct:DWord
- Local Dir[SizeOf PATHDIMENSION.Dir]:Byte
- Local pPATH_struct:DWord
- Mov MyStruct, Ecx
- Assume Ecx:Ptr MapClass
- Invoke V_VectorCreator, addr [Ecx].ItemMaps, Offset V_CMap_InitItems, SizeOf CMAPITEM, MAXITEMS_INMAP
- fastalloc SizeOf PATHDIMENSION, 1
- Mov pPATH_struct, Eax
- .If (Eax == 0)
- Invoke MessageBox, NULL, $CTA0("CMapInit:] CANT_ALLOCATE_MEMORY"), $CTA0("CRITICAL ERROR"), MB_OK
- .Else
- Invoke V_ZeroBuff, Addr Dir, SizeOf Dir
- ;////////////////////////////////////
- ;SET DIRECTION PARAMETERS
- ;I AVOID THE 00 BYTES
- ;CAUSED I ALREADY USE V_ZeroBuff
- ;////////////////////////////////////
- Mov Dir, -1
- Mov Dir + 4, -1
- Mov Dir + 0CH, -1
- Mov Dir + 10H, 1
- Mov Dir + 14H, -1
- Mov Dir + 18H, 1
- Mov Dir + 20H, 1
- Mov Dir + 24H, 1
- Mov Dir + 2CH, 1
- Mov Dir + 30H, -1
- Mov Dir + 34H, 1
- Mov Dir + 38H, -1
- Mov Edx, pPATH_struct
- Assume Edx:Ptr PATHDIMENSION
- Invoke MemCopy, Addr Dir, addr [Edx].Dir, SizeOf PATHDIMENSION.Dir
- Mov Edx, pPATH_struct
- Mov Ecx, MyStruct
- Mov [Ecx].pPath, Edx ;save pointer of PATHDIMENSION struct into pPath of MapClass struct (a little confusing isnt? =P)
- Mov [Ecx].gWidth, 0
- Mov [Ecx].gHeight, 0
- ;////////////////////////////////////
- ;SET SOME DIMENSION MAPS
- ;USING VSETRECT MACROS
- ;////////////////////////////////////
- VSetRect 130, 116, 151, 137, addr [Ecx].RegenArea ;Terrain1.att
- VSetRect 106, 236, 112, 243, addr [Ecx].RegenArea + (SizeOf RECT) ;Terrain2.att
- VSetRect 197, 35, 213, 50, addr [Ecx].RegenArea + (SizeOf RECT * 2) ;Terrain3.att
- VSetRect 174, 101, 187, 125, addr [Ecx].RegenArea + (SizeOf RECT * 3) ;Terrain4.att
- VSetRect 201, 70, 213, 81, addr [Ecx].RegenArea + (SizeOf RECT * 4) ;Terrain5.att
- VSetRect 89, 135, 90, 136, addr [Ecx].RegenArea + (SizeOf RECT * 5) ;Terrain6.att
- VSetRect 89, 135, 90, 136, addr [Ecx].RegenArea + (SizeOf RECT * 6) ;Terrain7.att
- VSetRect 14, 11, 27, 23, addr [Ecx].RegenArea + (SizeOf RECT * 7) ;Terrain8.att
- VSetRect 187, 54, 203, 69, addr [Ecx].RegenArea + (SizeOf RECT * 8) ;Terrain9.att
- VSetRect 82, 8, 87, 14, addr [Ecx].RegenArea + (SizeOf RECT * 33) ;Terrain34.att
- VSetRect 133, 41, 140, 44, addr [Ecx].RegenArea + (SizeOf RECT * 34) ;Terrain35.att
- VSetRect 40, 214, 43, 224, addr [Ecx].RegenArea + (SizeOf RECT * 45) ;Terrain52.att ;Elbeland
- .EndIf
- Assume Edx:Nothing
- Assume Ecx:Nothing
- Ret
- V_CMap_SetDimensions Endp