├── .github └── workflows │ ├── build.yml │ ├── license.yml │ └── package.yml ├── .gitignore ├── Assets ├── NAudio.meta ├── NAudio │ ├── COPYING │ ├── COPYING.meta │ ├── NAudio-Unity.dll │ ├── NAudio-Unity.dll.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── NAudioPlayer.cs │ │ └── NAudioPlayer.cs.meta ├── PackageExporter.meta ├── PackageExporter │ ├── Editor.meta │ ├── Editor │ │ ├── PackageExporter.dll │ │ └── PackageExporter.dll.meta │ ├── LICENSE.txt │ ├── LICENSE.txt.meta │ ├── README.pdf │ ├── README.pdf.meta │ ├── template.meta │ ├── template │ │ ├── template.unityignore │ │ └── template.unityignore.meta │ ├── unityignore.meta │ └── unityignore │ │ ├── README.txt │ │ ├── README.txt.meta │ │ ├── UnityWzLib.unityignore │ │ └── UnityWzLib.unityignore.meta ├── WzLib.meta └── WzLib │ ├── COPYING │ ├── COPYING.meta │ ├── DLL.meta │ ├── DLL │ ├── README.md │ ├── README.md.meta │ ├── System.Drawing.dll │ └── System.Drawing.dll.meta │ ├── Scenes.meta │ ├── Scenes │ ├── Demo.unity │ └── Demo.unity.meta │ ├── Scripts.meta │ └── Scripts │ ├── Helpers.meta │ ├── Helpers │ ├── ErrorLogger.cs │ └── ErrorLogger.cs.meta │ ├── MapleCryptoLib.meta │ ├── MapleCryptoLib │ ├── AESEncryption.cs │ ├── AESEncryption.cs.meta │ ├── CryptoConstants.cs │ ├── CryptoConstants.cs.meta │ ├── MapleCrypto.cs │ ├── MapleCrypto.cs.meta │ ├── MapleCustomEncryption.cs │ └── MapleCustomEncryption.cs.meta │ ├── WzLib.meta │ └── WzLib │ ├── IPropertyContainer.cs │ ├── IPropertyContainer.cs.meta │ ├── Util.meta │ ├── Util │ ├── WzBinaryReader.cs │ ├── WzBinaryReader.cs.meta │ ├── WzBinaryWriter.cs │ ├── WzBinaryWriter.cs.meta │ ├── WzKeyGenerator.cs │ ├── WzKeyGenerator.cs.meta │ ├── WzMutableKey.cs │ ├── WzMutableKey.cs.meta │ ├── WzTool.cs │ ├── WzTool.cs.meta │ ├── XmlUtil.cs │ └── XmlUtil.cs.meta │ ├── WzDirectory.cs │ ├── WzDirectory.cs.meta │ ├── WzExtended.cs │ ├── WzExtended.cs.meta │ ├── WzFile.cs │ ├── WzFile.cs.meta │ ├── WzHeader.cs │ ├── WzHeader.cs.meta │ ├── WzImage.cs │ ├── WzImage.cs.meta │ ├── WzImageProperty.cs │ ├── WzImageProperty.cs.meta │ ├── WzImageResource.cs │ ├── WzImageResource.cs.meta │ ├── WzListFile.cs │ ├── WzListFile.cs.meta │ ├── WzMapleVersion.cs │ ├── WzMapleVersion.cs.meta │ ├── WzObject.cs │ ├── WzObject.cs.meta │ ├── WzObjectType.cs │ ├── WzObjectType.cs.meta │ ├── WzProperties.meta │ ├── WzProperties │ ├── WzCanvasProperty.cs │ ├── WzCanvasProperty.cs.meta │ ├── WzConvexProperty.cs │ ├── WzConvexProperty.cs.meta │ ├── WzDoubleProperty.cs │ ├── WzDoubleProperty.cs.meta │ ├── WzFloatProperty.cs │ ├── WzFloatProperty.cs.meta │ ├── WzIntProperty.cs │ ├── WzIntProperty.cs.meta │ ├── WzListEntry.cs │ ├── WzListEntry.cs.meta │ ├── WzLongProperty.cs │ ├── WzLongProperty.cs.meta │ ├── WzNullProperty.cs │ ├── WzNullProperty.cs.meta │ ├── WzPngProperty.cs │ ├── WzPngProperty.cs.meta │ ├── WzShortProperty.cs │ ├── WzShortProperty.cs.meta │ ├── WzSoundProperty.cs │ ├── WzSoundProperty.cs.meta │ ├── WzStringProperty.cs │ ├── WzStringProperty.cs.meta │ ├── WzSubProperty.cs │ ├── WzSubProperty.cs.meta │ ├── WzUOLProperty.cs │ ├── WzUOLProperty.cs.meta │ ├── WzVectorProperty.cs │ └── WzVectorProperty.cs.meta │ ├── WzPropertyType.cs │ ├── WzPropertyType.cs.meta │ ├── WzSerializer.cs │ ├── WzSerializer.cs.meta │ ├── WzSettings.cs │ ├── WzSettings.cs.meta │ ├── WzStructure.meta │ └── WzStructure │ ├── Data.meta │ ├── Data │ ├── Data.cs │ ├── Data.cs.meta │ ├── Enums.cs │ └── Enums.cs.meta │ ├── Foothold.cs │ ├── Foothold.cs.meta │ ├── InfoTool.cs │ ├── InfoTool.cs.meta │ ├── MapInfo.cs │ ├── MapInfo.cs.meta │ ├── MapleBool.cs │ └── MapleBool.cs.meta ├── CHANGELOG.md ├── COPYING ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── MemorySettings.asset ├── MultiplayerManager.asset ├── NavMeshAreas.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── SceneTemplateSettings.json ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset └── XRSettings.asset ├── README.md ├── UserSettings ├── EditorUserSettings.asset └── Search.settings └── etc └── Wizet_Logo.png /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | pull_request: {} 5 | push: { branches: [main, master, develop] } 6 | 7 | concurrency: 8 | group: ${{ github.workflow }}-${{ github.ref }} 9 | cancel-in-progress: true 10 | 11 | env: 12 | # License 13 | UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} 14 | # Project 15 | UNITY_VERSION: 2022.1.9f1 16 | PROJECT_PATH: . 17 | 18 | jobs: 19 | checklicense: 20 | name: check if UNITY_LICENSE is set in github secrets 21 | runs-on: ubuntu-latest 22 | outputs: 23 | is_unity_license_set: ${{ steps.checklicense_job.outputs.is_unity_license_set }} 24 | steps: 25 | - name: Check whether unity activation requests should be done 26 | id: checklicense_job 27 | run: | 28 | echo "Skip activation job: ${{ env.UNITY_LICENSE != '' }}" 29 | echo "::set-output name=is_unity_license_set::${{ env.UNITY_LICENSE != '' }}" 30 | 31 | test: 32 | needs: [checklicense] 33 | if: needs.checklicense.outputs.is_unity_license_set == 'true' 34 | name: Test all modes ✨ 35 | runs-on: ubuntu-latest 36 | steps: 37 | - uses: actions/checkout@v2 38 | with: 39 | lfs: true 40 | - uses: actions/cache@v1.1.0 41 | with: 42 | path: Library 43 | key: Library-test-project-${{ matrix.targetPlatform }} 44 | restore-keys: | 45 | Library-test-project- 46 | Library- 47 | - uses: game-ci/unity-test-runner@main 48 | id: testRunner 49 | with: 50 | projectPath: ${{ env.PROJECT_PATH }} 51 | unityVersion: ${{ env.UNITY_VERSION }} 52 | testMode: all 53 | customParameters: "-nographics" 54 | - uses: actions/upload-artifact@v1 55 | with: 56 | name: Test results (all modes) 57 | path: ${{ steps.testRunner.outputs.artifactsPath }} 58 | 59 | build: 60 | needs: [checklicense] 61 | if: needs.checklicense.outputs.is_unity_license_set == 'true' 62 | name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }} 63 | runs-on: ubuntu-latest 64 | strategy: 65 | fail-fast: false 66 | matrix: 67 | targetPlatform: 68 | - StandaloneWindows64 69 | - StandaloneLinux64 70 | - StandaloneOSX 71 | - Android 72 | - iOS 73 | - WebGL 74 | #- WSAPlayer 75 | #- PS4 76 | #- XboxOne 77 | #- tvOS 78 | #- Switch 79 | #- Stadia 80 | #- CloudRendering 81 | steps: 82 | - uses: actions/checkout@v2 83 | with: 84 | lfs: true 85 | 86 | - uses: actions/cache@v1.1.0 87 | with: 88 | path: ${{ matrix.projectPath }}/Library 89 | key: Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }} 90 | restore-keys: | 91 | Library-${{ matrix.projectPath }}- 92 | Library- 93 | 94 | - uses: game-ci/unity-builder@v2.0.4 95 | with: 96 | projectPath: ${{ env.PROJECT_PATH }} 97 | unityVersion: ${{ env.UNITY_VERSION }} 98 | targetPlatform: ${{ matrix.targetPlatform }} 99 | 100 | - uses: actions/upload-artifact@v1 101 | with: 102 | name: Build 103 | path: build 104 | -------------------------------------------------------------------------------- /.github/workflows/license.yml: -------------------------------------------------------------------------------- 1 | name: License 2 | 3 | on: 4 | schedule: 5 | - cron: "0 0 * * 1" 6 | workflow_dispatch: 7 | 8 | concurrency: 9 | group: ${{ github.workflow }}-${{ github.ref }} 10 | cancel-in-progress: true 11 | 12 | env: 13 | UNITY_VER: 2022.1.9f1 14 | ULF_FILE: Unity_v2022.x.ulf 15 | 16 | jobs: 17 | request_alf: 18 | name: Request .alf file 🔑 19 | runs-on: ubuntu-latest 20 | outputs: 21 | alf: ${{ steps.output.outputs.alf }} 22 | steps: 23 | - name: Request manual activation file 24 | id: alfFile 25 | uses: game-ci/unity-request-activation-file@main 26 | with: 27 | unityVersion: ${{ env.UNITY_VER }} 28 | 29 | # Upload artifact (Unity_v20XX.X.XXXX.alf) 30 | - name: Expose as artifact 31 | uses: actions/upload-artifact@v1 32 | with: 33 | name: ${{ steps.alfFile.outputs.filePath }} 34 | path: ${{ steps.alfFile.outputs.filePath }} 35 | 36 | - name: Output 37 | id: output 38 | run: | 39 | echo "::set-output name=alf::${{ steps.alfFile.outputs.filePath }}" 40 | 41 | acquire_ulf: 42 | needs: [request_alf] 43 | name: Acquire .ulf file 🔑 44 | runs-on: ubuntu-latest 45 | steps: 46 | - name: Download .alf artifact 47 | uses: actions/download-artifact@v2 48 | with: 49 | name: ${{ needs.request_alf.outputs.alf }} 50 | 51 | - name: Set up Node.js 52 | uses: actions/setup-node@v2 53 | with: 54 | node-version: '16' 55 | 56 | - name: Install node package, `unity-license-activate` 57 | run: npm install --global unity-license-activate 58 | 59 | - name: Install node package, `unity-verify-code` 60 | run: npm install --global unity-verify-code 61 | 62 | - name: Activate the license 63 | continue-on-error: true 64 | run: unity-license-activate "${{ secrets.UNITY_EMAIL }}" "${{ secrets.UNITY_PASSWORD }}" "${{ needs.request_alf.outputs.alf }}" 65 | 66 | - name: Read ulf 67 | id: ulfRead 68 | uses: juliangruber/read-file-action@v1.1.4 69 | with: 70 | path: ${{ env.ULF_FILE }} 71 | 72 | - name: Update secret UNITY_LICENSE 73 | uses: hmanzur/actions-set-secret@v2.0.0 74 | with: 75 | name: 'UNITY_LICENSE' 76 | value: '${{ steps.ulfRead.outputs.content }}' 77 | token: ${{ secrets.PAT }} 78 | -------------------------------------------------------------------------------- /.github/workflows/package.yml: -------------------------------------------------------------------------------- 1 | name: Package 2 | 3 | on: 4 | pull_request: {} 5 | push: { branches: [main, master, develop] } 6 | 7 | concurrency: 8 | group: ${{ github.workflow }}-${{ github.ref }} 9 | cancel-in-progress: true 10 | 11 | env: 12 | # License 13 | UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} 14 | # Project 15 | UNITY_VERSION: 2022.1.9f1 16 | PROJECT_PATH: . 17 | # Packaging 18 | PKG_VERSION: 0.1.3 19 | BUILD_METHOD: PackageExporter.BatchMode.Export 20 | 21 | jobs: 22 | checklicense: 23 | name: check if UNITY_LICENSE is set in github secrets 24 | runs-on: ubuntu-latest 25 | outputs: 26 | is_unity_license_set: ${{ steps.checklicense_job.outputs.is_unity_license_set }} 27 | steps: 28 | - name: Check whether unity activation requests should be done 29 | id: checklicense_job 30 | run: | 31 | echo "Skip activation job: ${{ env.UNITY_LICENSE != '' }}" 32 | echo "::set-output name=is_unity_license_set::${{ env.UNITY_LICENSE != '' }}" 33 | 34 | package: 35 | needs: [checklicense] 36 | if: needs.checklicense.outputs.is_unity_license_set == 'true' 37 | name: 📦 ${{ matrix.package-name }} 38 | runs-on: ubuntu-latest 39 | strategy: 40 | fail-fast: false 41 | matrix: 42 | package-name: 43 | - UnityWzLib 44 | targetPlatform: 45 | - StandaloneWindows64 46 | steps: 47 | - uses: actions/checkout@v2 48 | with: 49 | lfs: true 50 | 51 | - uses: actions/cache@v1.1.0 52 | with: 53 | path: Library 54 | key: Library-test-project-${{ matrix.targetPlatform }} 55 | restore-keys: | 56 | Library-test-project- 57 | Library- 58 | 59 | - uses: game-ci/unity-builder@v2.0.4 60 | with: 61 | projectPath: ${{ env.PROJECT_PATH }} 62 | unityVersion: ${{ env.UNITY_VERSION }} 63 | targetPlatform: ${{ matrix.targetPlatform }} 64 | buildMethod: ${{ env.BUILD_METHOD }} 65 | customParameters: -nographics _name "${{ matrix.package-name }}" _version "${{ env.PKG_VERSION }}" _savePath "." 66 | 67 | - name: Upload package as artifact 68 | uses: actions/upload-artifact@v1 69 | with: 70 | name: ${{ matrix.package-name }}_v${{ env.PKG_VERSION }}.unitypackage 71 | path: ${{ env.PROJECT_PATH }}/${{ matrix.package-name }}_v${{ env.PKG_VERSION }}.unitypackage 72 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore the these directories 2 | /.git 3 | /.vs 4 | /Temp 5 | /Build 6 | /Library 7 | /Logs 8 | /obj 9 | /Publish 10 | 11 | # ignore build info 12 | /Assets/StreamingAssets/build_info 13 | /Assets/StreamingAssets/build_info.* 14 | 15 | # ignore webcam images 16 | /Assets/JCS_GameData/WebcamShot 17 | /Assets/JCS_GameData/WebcamShot.* 18 | 19 | # ignore the following extension file 20 | *.svd 21 | *.userprefs 22 | *.csproj 23 | *.pidb 24 | *.suo 25 | *.sln 26 | *.user 27 | *.unityproj 28 | *.booproj 29 | *.orig 30 | *.app 31 | *.exe 32 | *.*_data 33 | .vsconfig 34 | *.dwlt 35 | 36 | # Unity3D generated meta files 37 | *.pidb.meta 38 | 39 | # Unity3D Generated File On Crash Reports 40 | sysinfo.txt 41 | 42 | # ignore mac attribute file 43 | *.DS_Store 44 | 45 | # Builds 46 | *.apk 47 | *.unitypackage 48 | 49 | # ignore PSD 50 | *.psd 51 | -------------------------------------------------------------------------------- /Assets/NAudio.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d0c000ce15e72c4796d307586f4671e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/NAudio/COPYING: -------------------------------------------------------------------------------- 1 | Microsoft Public License (Ms-PL) 2 | 3 | This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. 4 | 5 | 1. Definitions 6 | 7 | The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. 8 | 9 | A "contribution" is the original software, or any additions or changes to the software. 10 | 11 | A "contributor" is any person that distributes its contribution under this license. 12 | 13 | "Licensed patents" are a contributor's patent claims that read directly on its contribution. 14 | 15 | 2. Grant of Rights 16 | 17 | (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. 18 | 19 | (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. 20 | 21 | 3. Conditions and Limitations 22 | 23 | (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. 24 | 25 | (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. 26 | 27 | (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. 28 | 29 | (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. 30 | 31 | (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement. 32 | -------------------------------------------------------------------------------- /Assets/NAudio/COPYING.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 561fa0a6c8c3c4e4ea6dc2e2278e2b9c 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/NAudio/NAudio-Unity.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MapleStoryUnity/UnityWzLib/2f2295dbb89c1d281c014b1f610f43068f43a855/Assets/NAudio/NAudio-Unity.dll -------------------------------------------------------------------------------- /Assets/NAudio/NAudio-Unity.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 347e93515d50f6c428578957dccc16cc 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Assets/NAudio/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5a7f4e25331ea64789ca5cd13092c3e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/NAudio/Scripts/NAudioPlayer.cs: -------------------------------------------------------------------------------- 1 | /** 2 | * $File: NAudioPlayer.cs $ 3 | * $Date: 2021-04-13 21:50:50 $ 4 | * $Revision: $ 5 | * $Creator: Jen-Chieh Shen $ 6 | * $Notice: See LICENSE.txt for modification and distribution information 7 | * Copyright © 2021 by Shen, Jen-Chieh $ 8 | */ 9 | using System; 10 | using System.IO; 11 | using UnityEngine; 12 | using NAudio.Wave; 13 | 14 | namespace UWL 15 | { 16 | public static class NAudioPlayer 17 | { 18 | public static AudioClip FromMp3Data(string name, byte[] data) 19 | { 20 | // Load the data into a stream 21 | MemoryStream mp3stream = new MemoryStream(data); 22 | // Convert the data in the stream to WAV format 23 | Mp3FileReader mp3audio = new Mp3FileReader(mp3stream); 24 | WaveStream waveStream = WaveFormatConversionStream.CreatePcmStream(mp3audio); 25 | // Convert to WAV data 26 | WAV wav = new WAV(AudioMemStream(waveStream).ToArray()); 27 | AudioClip audioClip = AudioClip.Create(name, wav.SampleCount, 1, wav.Frequency, false); 28 | audioClip.SetData(wav.LeftChannel, 0); 29 | // Return the clip 30 | return audioClip; 31 | } 32 | 33 | private static MemoryStream AudioMemStream(WaveStream waveStream) 34 | { 35 | MemoryStream outputStream = new MemoryStream(); 36 | using (WaveFileWriter waveFileWriter = new WaveFileWriter(outputStream, waveStream.WaveFormat)) 37 | { 38 | byte[] bytes = new byte[waveStream.Length]; 39 | waveStream.Position = 0; 40 | waveStream.Read(bytes, 0, Convert.ToInt32(waveStream.Length)); 41 | waveFileWriter.Write(bytes, 0, bytes.Length); 42 | waveFileWriter.Flush(); 43 | } 44 | return outputStream; 45 | } 46 | } 47 | 48 | /* From http://answers.unity3d.com/questions/737002/wav-byte-to-audioclip.html */ 49 | public class WAV 50 | { 51 | 52 | // convert two bytes to one float in the range -1 to 1 53 | static float bytesToFloat(byte firstByte, byte secondByte) 54 | { 55 | // convert two bytes to one short (little endian) 56 | short s = (short)((secondByte << 8) | firstByte); 57 | // convert to range from -1 to (just below) 1 58 | return s / 32768.0F; 59 | } 60 | 61 | static int bytesToInt(byte[] bytes, int offset = 0) 62 | { 63 | int value = 0; 64 | for (int i = 0; i < 4; i++) 65 | { 66 | value |= ((int)bytes[offset + i]) << (i * 8); 67 | } 68 | return value; 69 | } 70 | // properties 71 | public float[] LeftChannel { get; internal set; } 72 | public float[] RightChannel { get; internal set; } 73 | public int ChannelCount { get; internal set; } 74 | public int SampleCount { get; internal set; } 75 | public int Frequency { get; internal set; } 76 | 77 | public WAV(byte[] wav) 78 | { 79 | 80 | // Determine if mono or stereo 81 | ChannelCount = wav[22]; // Forget byte 23 as 99.999% of WAVs are 1 or 2 channels 82 | 83 | // Get the frequency 84 | Frequency = bytesToInt(wav, 24); 85 | 86 | // Get past all the other sub chunks to get to the data subchunk: 87 | int pos = 12; // First Subchunk ID from 12 to 16 88 | 89 | // Keep iterating until we find the data chunk (i.e. 64 61 74 61 ...... (i.e. 100 97 116 97 in decimal)) 90 | while (!(wav[pos] == 100 && wav[pos + 1] == 97 && wav[pos + 2] == 116 && wav[pos + 3] == 97)) 91 | { 92 | pos += 4; 93 | int chunkSize = wav[pos] + wav[pos + 1] * 256 + wav[pos + 2] * 65536 + wav[pos + 3] * 16777216; 94 | pos += 4 + chunkSize; 95 | } 96 | pos += 8; 97 | 98 | // Pos is now positioned to start of actual sound data. 99 | SampleCount = (wav.Length - pos) / 2; // 2 bytes per sample (16 bit sound mono) 100 | if (ChannelCount == 2) SampleCount /= 2; // 4 bytes per sample (16 bit stereo) 101 | 102 | // Allocate memory (right will be null if only mono sound) 103 | LeftChannel = new float[SampleCount]; 104 | if (ChannelCount == 2) RightChannel = new float[SampleCount]; 105 | else RightChannel = null; 106 | 107 | // Write to double array/s: 108 | int i = 0; 109 | while (pos < wav.Length) 110 | { 111 | LeftChannel[i] = bytesToFloat(wav[pos], wav[pos + 1]); 112 | pos += 2; 113 | if (ChannelCount == 2) 114 | { 115 | RightChannel[i] = bytesToFloat(wav[pos], wav[pos + 1]); 116 | pos += 2; 117 | } 118 | i++; 119 | } 120 | } 121 | 122 | public override string ToString() 123 | { 124 | return string.Format("[WAV: LeftChannel={0}, RightChannel={1}, ChannelCount={2}, SampleCount={3}, Frequency={4}]", LeftChannel, RightChannel, ChannelCount, SampleCount, Frequency); 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /Assets/NAudio/Scripts/NAudioPlayer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbcb83a7558779b4483303db30edc669 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/PackageExporter.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7610273dd6a5e154a8a14613a5c9b2a9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PackageExporter/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5853021e9881edc45bb5902b2bed704a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PackageExporter/Editor/PackageExporter.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MapleStoryUnity/UnityWzLib/2f2295dbb89c1d281c014b1f610f43068f43a855/Assets/PackageExporter/Editor/PackageExporter.dll -------------------------------------------------------------------------------- /Assets/PackageExporter/Editor/PackageExporter.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52e7e818d0a98674bae61a8fd842187d 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 0 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 1 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Assets/PackageExporter/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Pixisoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Assets/PackageExporter/LICENSE.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 775caf45e7564a84bb5d82e776e43433 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/PackageExporter/README.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MapleStoryUnity/UnityWzLib/2f2295dbb89c1d281c014b1f610f43068f43a855/Assets/PackageExporter/README.pdf -------------------------------------------------------------------------------- /Assets/PackageExporter/README.pdf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fe54e1506eb9c94abb363a31e447307 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/PackageExporter/template.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7659f2458d891dc45bb7efcfbae29818 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PackageExporter/template/template.unityignore: -------------------------------------------------------------------------------- 1 | # 2 | # Thank you for using `Package Exporter`. This is the generated 3 | # unityignore file. 4 | # 5 | # Package Name: [PACKAGE_NAME] 6 | # Version: [VERSION_NO] 7 | # Creation Date: [CREATION_DATE] 8 | # 9 | # Package Link: https://github.com/jcs090218/PackageExporter 10 | # Author: Shen, Jen-Chieh 11 | # Email: jcs090218@gmail.com 12 | # 13 | 14 | # Ignore this plugin itself. 15 | PackageExporter/ 16 | -------------------------------------------------------------------------------- /Assets/PackageExporter/template/template.unityignore.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7bbea4aa32de490498c55735c8464dca 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/PackageExporter/unityignore.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c851b3f4a69a84c41b502836cc028220 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/PackageExporter/unityignore/README.txt: -------------------------------------------------------------------------------- 1 | All .unityignore files should be under this folder! 2 | -------------------------------------------------------------------------------- /Assets/PackageExporter/unityignore/README.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5594f646605a2134d9503d1d053f26a5 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/PackageExporter/unityignore/UnityWzLib.unityignore: -------------------------------------------------------------------------------- 1 | # 2 | # Thank you for using 'Unity Package Exporter'. This is the generated 3 | # unityignore file. 4 | # 5 | # Package Name: UnityWzLib 6 | # Version: 0.1.2 7 | # Creation Date: 2021-04-09 13:05:19 8 | # 9 | # Package Link: https://github.com/jcs090218/UnityPackageExporter 10 | # Author: Shen, Jen-Chieh 11 | # Email: pixisoft.tw@gmail.com 12 | # 13 | 14 | # Ignore this plugin itself. 15 | PackageExporter 16 | -------------------------------------------------------------------------------- /Assets/PackageExporter/unityignore/UnityWzLib.unityignore.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c0b546089f8ee34cbf7f549ab2458b9 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/WzLib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 402feb3ed60fcbe45bf29d6cf1d607aa 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/WzLib/COPYING.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f0e8b259ef99a74fa06d3f65457afbd 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/WzLib/DLL.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e5c281b9fca710438b0af25e1cd537b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/WzLib/DLL/README.md: -------------------------------------------------------------------------------- 1 | This is copy from `%Unity Folder%\Editor\Data\MonoBleedingEdge\lib\mono\unityjit` 2 | 3 | Reference links 4 | 5 | - https://answers.unity.com/questions/53170/using-drawing-package-like-systemdrawing.html?childToView=253571#answer-253571 6 | - https://forum.unity.com/threads/problems-trying-to-use-sqlite-with-unity-2020-2-2.1044718/ 7 | -------------------------------------------------------------------------------- /Assets/WzLib/DLL/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: efa7d5972b52ecc46b9571288f4c0de8 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/WzLib/DLL/System.Drawing.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MapleStoryUnity/UnityWzLib/2f2295dbb89c1d281c014b1f610f43068f43a855/Assets/WzLib/DLL/System.Drawing.dll -------------------------------------------------------------------------------- /Assets/WzLib/DLL/System.Drawing.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ba69e12e4e9a294ba85c4a0a4830aed 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Assets/WzLib/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 23935e0df42c41e4f8d77e09fe2dd69c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/WzLib/Scenes/Demo.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0.37311992, g: 0.38074034, b: 0.35872713, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 512 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 1 83 | m_PVRDenoiserTypeDirect: 1 84 | m_PVRDenoiserTypeIndirect: 1 85 | m_PVRDenoiserTypeAO: 1 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 1 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_LightingSettings: {fileID: 0} 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | accuratePlacement: 0 121 | maxJobWorkers: 0 122 | preserveTilesOutsideBounds: 0 123 | debug: 124 | m_Flags: 0 125 | m_NavMeshData: {fileID: 0} 126 | -------------------------------------------------------------------------------- /Assets/WzLib/Scenes/Demo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc0a57efeaa4b8f4296a0a8498788c43 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b496bf03087d6f84e9168c4068d84faa 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/Helpers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ecc1a432ce8377645945ba822d0438b4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/Helpers/ErrorLogger.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using System.IO; 23 | using System.Linq; 24 | using System.Text; 25 | 26 | namespace MapleLib.Helpers 27 | { 28 | public static class ErrorLogger 29 | { 30 | private static List errorList = new List(); 31 | public static void Log(ErrorLevel level, string message) 32 | { 33 | errorList.Add(new Error(level, message)); 34 | } 35 | 36 | public static bool ErrorsPresent() 37 | { 38 | return errorList.Count > 0; 39 | } 40 | 41 | public static void ClearErrors() 42 | { 43 | errorList.Clear(); 44 | } 45 | 46 | public static void SaveToFile(string filename) 47 | { 48 | using (StreamWriter sw = new StreamWriter(File.Open(filename, FileMode.Append, FileAccess.Write, FileShare.Read))) 49 | { 50 | sw.WriteLine("Starting error log on " + DateTime.Today.ToShortDateString()); 51 | foreach (Error e in errorList) 52 | { 53 | sw.WriteLine(e.level.ToString() + ":" + e.message); 54 | } 55 | sw.WriteLine(); 56 | } 57 | } 58 | } 59 | 60 | public class Error 61 | { 62 | internal ErrorLevel level; 63 | internal string message; 64 | 65 | internal Error(ErrorLevel level, string message) 66 | { 67 | this.level = level; 68 | this.message = message; 69 | } 70 | } 71 | 72 | public enum ErrorLevel 73 | { 74 | MissingFeature, 75 | IncorrectStructure, 76 | Critical, 77 | Crash 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/Helpers/ErrorLogger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3202de7c6be4913499e8b1e61f294829 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/MapleCryptoLib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85735e4214a81a74d930f25a13d4d772 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/MapleCryptoLib/AESEncryption.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.IO; 22 | using System.Security.Cryptography; 23 | 24 | namespace MapleLib.MapleCryptoLib 25 | { 26 | 27 | /// 28 | /// Class to handle the AES Encryption routines 29 | /// 30 | public class AESEncryption 31 | { 32 | 33 | /// 34 | /// Encrypt data using MapleStory's AES algorithm 35 | /// 36 | /// IV to use for encryption 37 | /// Data to encrypt 38 | /// Length of data 39 | /// Crypted data 40 | public static byte[] aesCrypt(byte[] IV, byte[] data, int length) 41 | { 42 | return aesCrypt(IV, data, length, CryptoConstants.getTrimmedUserKey()); 43 | } 44 | 45 | /// 46 | /// Encrypt data using MapleStory's AES method 47 | /// 48 | /// IV to use for encryption 49 | /// data to encrypt 50 | /// length of data 51 | /// the AES key to use 52 | /// Crypted data 53 | public static byte[] aesCrypt(byte[] IV, byte[] data, int length, byte[] key) 54 | { 55 | AesManaged crypto = new AesManaged(); 56 | crypto.KeySize = 256; //in bits 57 | crypto.Key = key; 58 | crypto.Mode = CipherMode.ECB; // Should be OFB, but this works too 59 | 60 | MemoryStream memStream = new MemoryStream(); 61 | CryptoStream cryptoStream = new CryptoStream(memStream, crypto.CreateEncryptor(), CryptoStreamMode.Write); 62 | 63 | int remaining = length; 64 | int llength = 0x5B0; 65 | int start = 0; 66 | while (remaining > 0) 67 | { 68 | byte[] myIV = MapleCrypto.multiplyBytes(IV, 4, 4); 69 | if (remaining < llength) 70 | { 71 | llength = remaining; 72 | } 73 | for (int x = start; x < (start + llength); x++) 74 | { 75 | if ((x - start) % myIV.Length == 0) 76 | { 77 | cryptoStream.Write(myIV, 0, myIV.Length); 78 | byte[] newIV = memStream.ToArray(); 79 | Array.Copy(newIV, myIV, myIV.Length); 80 | memStream.Position = 0; 81 | } 82 | data[x] ^= myIV[(x - start) % myIV.Length]; 83 | } 84 | start += llength; 85 | remaining -= llength; 86 | llength = 0x5B4; 87 | } 88 | 89 | try 90 | { 91 | cryptoStream.Dispose(); 92 | memStream.Dispose(); 93 | } 94 | catch (Exception e) 95 | { 96 | Helpers.ErrorLogger.Log(Helpers.ErrorLevel.Critical, "Error disposing AES streams" + e); 97 | //Console.WriteLine("Error disposing AES streams" + e); 98 | } 99 | 100 | return data; 101 | } 102 | } 103 | } -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/MapleCryptoLib/AESEncryption.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 234356f941e38b7439e9ff91fde5d951 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/MapleCryptoLib/CryptoConstants.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | namespace MapleLib.MapleCryptoLib 21 | { 22 | /// 23 | /// Contains all the constant values used for various functions 24 | /// 25 | public class CryptoConstants 26 | { 27 | 28 | /// 29 | /// AES UserKey used by MapleStory 30 | /// 31 | public static byte[] UserKey = new byte[128] { //16 * 8 32 | 0x13, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x00, 33 | 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 34 | 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 35 | 0xB4, 0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 36 | 0x1B, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 37 | 0x0F, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 38 | 0x33, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 39 | 0x52, 0x00, 0x00, 0x00, 0xDE, 0x00, 0x00, 0x00, 0xC7, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00 40 | }; 41 | 42 | /// 43 | /// ShuffleBytes used by MapleStory to generate a new IV 44 | /// 45 | public static byte[] bShuffle = new byte[256] {//16 * 16 46 | 0xEC, 0x3F, 0x77, 0xA4, 0x45, 0xD0, 0x71, 0xBF, 0xB7, 0x98, 0x20, 0xFC, 0x4B, 0xE9, 0xB3, 0xE1, 47 | 0x5C, 0x22, 0xF7, 0x0C, 0x44, 0x1B, 0x81, 0xBD, 0x63, 0x8D, 0xD4, 0xC3, 0xF2, 0x10, 0x19, 0xE0, 48 | 0xFB, 0xA1, 0x6E, 0x66, 0xEA, 0xAE, 0xD6, 0xCE, 0x06, 0x18, 0x4E, 0xEB, 0x78, 0x95, 0xDB, 0xBA, 49 | 0xB6, 0x42, 0x7A, 0x2A, 0x83, 0x0B, 0x54, 0x67, 0x6D, 0xE8, 0x65, 0xE7, 0x2F, 0x07, 0xF3, 0xAA, 50 | 0x27, 0x7B, 0x85, 0xB0, 0x26, 0xFD, 0x8B, 0xA9, 0xFA, 0xBE, 0xA8, 0xD7, 0xCB, 0xCC, 0x92, 0xDA, 51 | 0xF9, 0x93, 0x60, 0x2D, 0xDD, 0xD2, 0xA2, 0x9B, 0x39, 0x5F, 0x82, 0x21, 0x4C, 0x69, 0xF8, 0x31, 52 | 0x87, 0xEE, 0x8E, 0xAD, 0x8C, 0x6A, 0xBC, 0xB5, 0x6B, 0x59, 0x13, 0xF1, 0x04, 0x00, 0xF6, 0x5A, 53 | 0x35, 0x79, 0x48, 0x8F, 0x15, 0xCD, 0x97, 0x57, 0x12, 0x3E, 0x37, 0xFF, 0x9D, 0x4F, 0x51, 0xF5, 54 | 0xA3, 0x70, 0xBB, 0x14, 0x75, 0xC2, 0xB8, 0x72, 0xC0, 0xED, 0x7D, 0x68, 0xC9, 0x2E, 0x0D, 0x62, 55 | 0x46, 0x17, 0x11, 0x4D, 0x6C, 0xC4, 0x7E, 0x53, 0xC1, 0x25, 0xC7, 0x9A, 0x1C, 0x88, 0x58, 0x2C, 56 | 0x89, 0xDC, 0x02, 0x64, 0x40, 0x01, 0x5D, 0x38, 0xA5, 0xE2, 0xAF, 0x55, 0xD5, 0xEF, 0x1A, 0x7C, 57 | 0xA7, 0x5B, 0xA6, 0x6F, 0x86, 0x9F, 0x73, 0xE6, 0x0A, 0xDE, 0x2B, 0x99, 0x4A, 0x47, 0x9C, 0xDF, 58 | 0x09, 0x76, 0x9E, 0x30, 0x0E, 0xE4, 0xB2, 0x94, 0xA0, 0x3B, 0x34, 0x1D, 0x28, 0x0F, 0x36, 0xE3, 59 | 0x23, 0xB4, 0x03, 0xD8, 0x90, 0xC8, 0x3C, 0xFE, 0x5E, 0x32, 0x24, 0x50, 0x1F, 0x3A, 0x43, 0x8A, 60 | 0x96, 0x41, 0x74, 0xAC, 0x52, 0x33, 0xF0, 0xD9, 0x29, 0x80, 0xB1, 0x16, 0xD3, 0xAB, 0x91, 0xB9, 61 | 0x84, 0x7F, 0x61, 0x1E, 0xCF, 0xC5, 0xD1, 0x56, 0x3D, 0xCA, 0xF4, 0x05, 0xC6, 0xE5, 0x08, 0x49 62 | }; 63 | 64 | /// 65 | /// Default AES Key used to generate a new IV 66 | /// 67 | public static byte[] bDefaultAESKeyValue = new byte[16] { 68 | 0xC6, 0x50, 0x53, 0xF2, 0xA8, 0x42, 0x9D, 0x7F, 0x77, 0x09, 0x1D, 0x26, 0x42, 0x53, 0x88, 0x7C, 69 | }; 70 | 71 | /// 72 | /// IV used to create the WzKey for GMS 73 | /// 74 | public static byte[] WZ_GMSIV = new byte[4] { 0x4D, 0x23, 0xC7, 0x2B }; 75 | 76 | /// 77 | /// IV used to create the WzKey for MSEA 78 | /// 79 | public static byte[] WZ_MSEAIV = new byte[4] { 0xB9, 0x7D, 0x63, 0xE9 }; 80 | 81 | /// 82 | /// Constant used in WZ offset encryption 83 | /// 84 | public static uint WZ_OffsetConstant = 0x581C3F6D; 85 | 86 | /// 87 | /// Trims the AES UserKey for use an AES cryptor 88 | /// 89 | public static byte[] getTrimmedUserKey() 90 | { 91 | byte[] key = new byte[32]; 92 | for (int i = 0; i < 128; i += 16) 93 | { 94 | key[i / 4] = UserKey[i]; 95 | } 96 | return key; 97 | } 98 | } 99 | } -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/MapleCryptoLib/CryptoConstants.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a0b474bd89dca743a87e29faa23279c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/MapleCryptoLib/MapleCrypto.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f24851f272b30494f993b7d543c181fc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/MapleCryptoLib/MapleCustomEncryption.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | namespace MapleLib.MapleCryptoLib 21 | { 22 | /// 23 | /// Class to handle the MapleStory Custom Encryption routines 24 | /// 25 | public class MapleCustomEncryption 26 | { 27 | 28 | /// 29 | /// Encrypt data using MapleStory's Custom Encryption 30 | /// 31 | /// data to encrypt 32 | /// Encrypted data 33 | public static void Encrypt(byte[] data) 34 | { 35 | int size = data.Length; 36 | int j; 37 | byte a, c; 38 | for (int i = 0; i < 3; i++) 39 | { 40 | a = 0; 41 | for (j = size; j > 0; j--) 42 | { 43 | c = data[size - j]; 44 | c = rol(c, 3); 45 | c = (byte)(c + j); 46 | c ^= a; 47 | a = c; 48 | c = ror(a, j); 49 | c ^= 0xFF; 50 | c += 0x48; 51 | data[size - j] = c; 52 | } 53 | a = 0; 54 | for (j = data.Length; j > 0; j--) 55 | { 56 | c = data[j - 1]; 57 | c = rol(c, 4); 58 | c = (byte)(c + j); 59 | c ^= a; 60 | a = c; 61 | c ^= 0x13; 62 | c = ror(c, 3); 63 | data[j - 1] = c; 64 | } 65 | } 66 | } 67 | 68 | /// 69 | /// Decrypt data using MapleStory's Custom Encryption 70 | /// 71 | /// data to decrypt 72 | /// Decrypted data 73 | public static void Decrypt(byte[] data) 74 | { 75 | int size = data.Length; 76 | int j; 77 | byte a, b, c; 78 | for (int i = 0; i < 3; i++) 79 | { 80 | a = 0; 81 | b = 0; 82 | for (j = size; j > 0; j--) 83 | { 84 | c = data[j - 1]; 85 | c = rol(c, 3); 86 | c ^= 0x13; 87 | a = c; 88 | c ^= b; 89 | c = (byte)(c - j); // Guess this is supposed to be right? 90 | c = ror(c, 4); 91 | b = a; 92 | data[j - 1] = c; 93 | } 94 | a = 0; 95 | b = 0; 96 | for (j = size; j > 0; j--) 97 | { 98 | c = data[size - j]; 99 | c -= 0x48; 100 | c ^= 0xFF; 101 | c = rol(c, j); 102 | a = c; 103 | c ^= b; 104 | c = (byte)(c - j); // Guess this is supposed to be right? 105 | c = ror(c, 3); 106 | b = a; 107 | data[size - j] = c; 108 | } 109 | } 110 | } 111 | 112 | /// 113 | /// Rolls a byte left 114 | /// 115 | /// input byte to roll 116 | /// amount of bits to roll 117 | /// The left rolled byte 118 | public static byte rol(byte val, int num) 119 | { 120 | int highbit; 121 | for (int i = 0; i < num; i++) 122 | { 123 | highbit = ((val & 0x80) != 0 ? 1 : 0); 124 | val <<= 1; 125 | val |= (byte)highbit; 126 | } 127 | return val; 128 | } 129 | 130 | /// 131 | /// Rolls a byte right 132 | /// 133 | /// input byte to roll 134 | /// amount of bits to roll 135 | /// The right rolled byte 136 | public static byte ror(byte val, int num) 137 | { 138 | int lowbit; 139 | for (int i = 0; i < num; i++) 140 | { 141 | lowbit = ((val & 1) != 0 ? 1 : 0); 142 | val >>= 1; 143 | val |= (byte)(lowbit << 7); 144 | } 145 | return val; 146 | } 147 | } 148 | } -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/MapleCryptoLib/MapleCustomEncryption.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c32eaafc8808674c850f6c71023a9ff 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f718aecc16a6c004b9fe5a8e36c28ce9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/IPropertyContainer.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | 25 | namespace MapleLib.WzLib 26 | { 27 | public interface IPropertyContainer 28 | { 29 | void AddProperty(WzImageProperty prop); 30 | void AddProperties(List props); 31 | void RemoveProperty(WzImageProperty prop); 32 | void ClearProperties(); 33 | List WzProperties { get; } 34 | WzImageProperty this[string name] { get; set; } 35 | } 36 | } -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/IPropertyContainer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51c959e16a2e0674c9a985cff51985b1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/Util.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a9a31f3833714624b8acf27a9e5c59cf 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/Util/WzBinaryReader.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.IO; 22 | using System.Text; 23 | using MapleLib.MapleCryptoLib; 24 | 25 | namespace MapleLib.WzLib.Util 26 | { 27 | public class WzBinaryReader : BinaryReader 28 | { 29 | #region Properties 30 | public WzMutableKey WzKey { get; set; } 31 | public uint Hash { get; set; } 32 | public WzHeader Header { get; set; } 33 | #endregion 34 | 35 | #region Constructors 36 | public WzBinaryReader(Stream input, byte[] WzIv) 37 | : base(input) 38 | { 39 | WzKey = WzKeyGenerator.GenerateWzKey(WzIv); 40 | } 41 | #endregion 42 | 43 | #region Methods 44 | public string ReadStringAtOffset(long Offset) 45 | { 46 | return ReadStringAtOffset(Offset, false); 47 | } 48 | 49 | public string ReadStringAtOffset(long Offset, bool readByte) 50 | { 51 | long CurrentOffset = BaseStream.Position; 52 | BaseStream.Position = Offset; 53 | if (readByte) 54 | { 55 | ReadByte(); 56 | } 57 | string ReturnString = ReadString(); 58 | BaseStream.Position = CurrentOffset; 59 | return ReturnString; 60 | } 61 | 62 | public override string ReadString() 63 | { 64 | sbyte smallLength = base.ReadSByte(); 65 | 66 | if (smallLength == 0) 67 | { 68 | return string.Empty; 69 | } 70 | 71 | int length; 72 | StringBuilder retString = new StringBuilder(); 73 | if (smallLength > 0) // Unicode 74 | { 75 | ushort mask = 0xAAAA; 76 | if (smallLength == sbyte.MaxValue) 77 | { 78 | length = ReadInt32(); 79 | } 80 | else 81 | { 82 | length = (int)smallLength; 83 | } 84 | if (length <= 0) 85 | { 86 | return string.Empty; 87 | } 88 | 89 | for (int i = 0; i < length; i++) 90 | { 91 | ushort encryptedChar = ReadUInt16(); 92 | encryptedChar ^= mask; 93 | encryptedChar ^= (ushort)((WzKey[i * 2 + 1] << 8) + WzKey[i * 2]); 94 | retString.Append((char)encryptedChar); 95 | mask++; 96 | } 97 | } 98 | else 99 | { // ASCII 100 | byte mask = 0xAA; 101 | if (smallLength == sbyte.MinValue) 102 | { 103 | length = ReadInt32(); 104 | } 105 | else 106 | { 107 | length = (int)(-smallLength); 108 | } 109 | if (length <= 0) 110 | { 111 | return string.Empty; 112 | } 113 | 114 | for (int i = 0; i < length; i++) 115 | { 116 | byte encryptedChar = ReadByte(); 117 | encryptedChar ^= mask; 118 | encryptedChar ^= (byte)WzKey[i]; 119 | retString.Append((char)encryptedChar); 120 | mask++; 121 | } 122 | } 123 | return retString.ToString(); 124 | } 125 | 126 | /// 127 | /// Reads an ASCII string, without decryption 128 | /// 129 | /// Length of bytes to read 130 | public string ReadString(int length) 131 | { 132 | return Encoding.ASCII.GetString(ReadBytes(length)); 133 | } 134 | 135 | public string ReadNullTerminatedString() 136 | { 137 | StringBuilder retString = new StringBuilder(); 138 | byte b = ReadByte(); 139 | while (b != 0) 140 | { 141 | retString.Append((char)b); 142 | b = ReadByte(); 143 | } 144 | return retString.ToString(); 145 | } 146 | 147 | public int ReadCompressedInt() 148 | { 149 | sbyte sb = base.ReadSByte(); 150 | if (sb == sbyte.MinValue) 151 | { 152 | return ReadInt32(); 153 | } 154 | return sb; 155 | } 156 | 157 | public long ReadLong() 158 | { 159 | sbyte sb = base.ReadSByte(); 160 | if (sb == sbyte.MinValue) 161 | { 162 | return ReadInt64(); 163 | } 164 | return sb; 165 | } 166 | 167 | public uint ReadOffset() 168 | { 169 | uint offset = (uint)BaseStream.Position; 170 | offset = (offset - Header.FStart) ^ uint.MaxValue; 171 | offset *= Hash; 172 | offset -= CryptoConstants.WZ_OffsetConstant; 173 | offset = WzTool.RotateLeft(offset, (byte)(offset & 0x1F)); 174 | uint encryptedOffset = ReadUInt32(); 175 | offset ^= encryptedOffset; 176 | offset += Header.FStart * 2; 177 | return offset; 178 | } 179 | 180 | public string DecryptString(char[] stringToDecrypt) 181 | { 182 | string outputString = ""; 183 | for (int i = 0; i < stringToDecrypt.Length; i++) 184 | outputString += (char)(stringToDecrypt[i] ^ ((char)((WzKey[i * 2 + 1] << 8) + WzKey[i * 2]))); 185 | return outputString; 186 | } 187 | 188 | public string DecryptNonUnicodeString(char[] stringToDecrypt) 189 | { 190 | string outputString = ""; 191 | for (int i = 0; i < stringToDecrypt.Length; i++) 192 | outputString += (char)(stringToDecrypt[i] ^ WzKey[i]); 193 | return outputString; 194 | } 195 | 196 | public string ReadStringBlock(uint offset) 197 | { 198 | switch (ReadByte()) 199 | { 200 | case 0: 201 | case 0x73: 202 | return ReadString(); 203 | case 1: 204 | case 0x1B: 205 | return ReadStringAtOffset(offset + ReadInt32()); 206 | default: 207 | return ""; 208 | } 209 | } 210 | 211 | #endregion 212 | } 213 | } -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/Util/WzBinaryReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ca750b2cf0d4e44195e6674784dc710 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/Util/WzBinaryWriter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13ba96ff4bfbd4346a2a773bd95601a4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/Util/WzKeyGenerator.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.IO; 22 | using System.Security.Cryptography; 23 | using MapleLib.MapleCryptoLib; 24 | 25 | namespace MapleLib.WzLib.Util 26 | { 27 | public class WzKeyGenerator 28 | { 29 | #region Methods 30 | 31 | public static byte[] GetIvFromZlz(FileStream zlzStream) 32 | { 33 | byte[] iv = new byte[4]; 34 | 35 | zlzStream.Seek(0x10040, SeekOrigin.Begin); 36 | zlzStream.Read(iv, 0, 4); 37 | return iv; 38 | } 39 | 40 | private static byte[] GetAesKeyFromZlz(FileStream zlzStream) 41 | { 42 | byte[] aes = new byte[32]; 43 | 44 | zlzStream.Seek(0x10060, SeekOrigin.Begin); 45 | for (int i = 0; i < 8; i++) 46 | { 47 | zlzStream.Read(aes, i * 4, 4); 48 | zlzStream.Seek(12, SeekOrigin.Current); 49 | } 50 | return aes; 51 | } 52 | 53 | public static WzMutableKey GenerateWzKey(byte[] WzIv) 54 | { 55 | return new WzMutableKey(WzIv, CryptoConstants.getTrimmedUserKey()); 56 | } 57 | #endregion 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/Util/WzKeyGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c1c663e61952714987022a9a786de9a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/Util/WzMutableKey.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.IO; 22 | using System.Security.Cryptography; 23 | using MapleLib.MapleCryptoLib; 24 | 25 | namespace MapleLib.WzLib.Util 26 | { 27 | public class WzMutableKey 28 | { 29 | public WzMutableKey(byte[] WzIv, byte[] AesKey) 30 | { 31 | this.iv = WzIv; 32 | this.aesKey = AesKey; 33 | } 34 | 35 | private static readonly int BatchSize = 4096; 36 | private byte[] iv; 37 | private byte[] aesKey; 38 | 39 | private byte[] keys; 40 | 41 | public byte this[int index] 42 | { 43 | get 44 | { 45 | if (keys == null || keys.Length <= index) 46 | { 47 | EnsureKeySize(index + 1); 48 | } 49 | return this.keys[index]; 50 | } 51 | } 52 | 53 | public void EnsureKeySize(int size) 54 | { 55 | if (keys != null && keys.Length >= size) 56 | { 57 | return; 58 | } 59 | 60 | size = (int)Math.Ceiling(1.0 * size / BatchSize) * BatchSize; 61 | byte[] newKeys = new byte[size]; 62 | 63 | if (BitConverter.ToInt32(this.iv, 0) == 0) 64 | { 65 | this.keys = newKeys; 66 | return; 67 | } 68 | 69 | int startIndex = 0; 70 | 71 | if (keys != null) 72 | { 73 | Buffer.BlockCopy(keys, 0, newKeys, 0, keys.Length); 74 | startIndex = keys.Length; 75 | } 76 | 77 | Rijndael aes = Rijndael.Create(); 78 | aes.KeySize = 256; 79 | aes.BlockSize = 128; 80 | aes.Key = aesKey; 81 | aes.Mode = CipherMode.ECB; 82 | MemoryStream ms = new MemoryStream(newKeys, startIndex, newKeys.Length - startIndex, true); 83 | CryptoStream s = new CryptoStream(ms, aes.CreateEncryptor(), CryptoStreamMode.Write); 84 | 85 | for (int i = startIndex; i < size; i += 16) 86 | { 87 | if (i == 0) 88 | { 89 | byte[] block = new byte[16]; 90 | for (int j = 0; j < block.Length; j++) 91 | { 92 | block[j] = iv[j % 4]; 93 | } 94 | s.Write(block, 0, block.Length); 95 | } 96 | else 97 | { 98 | s.Write(newKeys, i - 16, 16); 99 | } 100 | } 101 | 102 | s.Flush(); 103 | ms.Close(); 104 | this.keys = newKeys; 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/Util/WzMutableKey.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ef1dfcef37448b43ab498a870743869 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/Util/WzTool.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Collections; 22 | using System.IO; 23 | using MapleLib.MapleCryptoLib; 24 | 25 | namespace MapleLib.WzLib.Util 26 | { 27 | public class WzTool 28 | { 29 | 30 | public static Hashtable StringCache = new Hashtable(); 31 | 32 | public static UInt32 RotateLeft(UInt32 x, byte n) 33 | { 34 | return (UInt32)(((x) << (n)) | ((x) >> (32 - (n)))); 35 | } 36 | 37 | public static UInt32 RotateRight(UInt32 x, byte n) 38 | { 39 | return (UInt32)(((x) >> (n)) | ((x) << (32 - (n)))); 40 | } 41 | 42 | public static int GetCompressedIntLength(int i) 43 | { 44 | if (i > 127 || i < -127) 45 | return 5; 46 | return 1; 47 | } 48 | 49 | public static int GetEncodedStringLength(string s) 50 | { 51 | int len = 0; 52 | if (string.IsNullOrEmpty(s)) 53 | return 1; 54 | bool unicode = false; 55 | foreach (char c in s) 56 | if (c > 255) 57 | unicode = true; 58 | if (unicode) 59 | { 60 | if (s.Length > 126) 61 | len += 5; 62 | else 63 | len += 1; 64 | len += s.Length * 2; 65 | } 66 | else 67 | { 68 | if (s.Length > 127) 69 | len += 5; 70 | else 71 | len += 1; 72 | len += s.Length; 73 | } 74 | return len; 75 | } 76 | 77 | public static int GetWzObjectValueLength(string s, byte type) 78 | { 79 | string storeName = type + "_" + s; 80 | if (s.Length > 4 && StringCache.ContainsKey(storeName)) 81 | { 82 | return 5; 83 | } 84 | else 85 | { 86 | StringCache[storeName] = 1; 87 | return 1 + GetEncodedStringLength(s); 88 | } 89 | } 90 | 91 | public static T StringToEnum(string name) 92 | { 93 | try 94 | { 95 | return (T)Enum.Parse(typeof(T), name); 96 | } 97 | catch 98 | { 99 | return default(T); 100 | } 101 | } 102 | 103 | public static byte[] GetIvByMapleVersion(WzMapleVersion ver) 104 | { 105 | switch (ver) 106 | { 107 | case WzMapleVersion.EMS: 108 | return CryptoConstants.WZ_MSEAIV;//? 109 | case WzMapleVersion.GMS: 110 | return CryptoConstants.WZ_GMSIV; 111 | case WzMapleVersion.BMS: 112 | case WzMapleVersion.CLASSIC: 113 | default: 114 | return new byte[4]; 115 | } 116 | } 117 | 118 | private static int GetRecognizedCharacters(string source) 119 | { 120 | int result = 0; 121 | foreach (char c in source) 122 | if (0x20 <= c && c <= 0x7E) 123 | result++; 124 | return result; 125 | } 126 | 127 | private static double GetDecryptionSuccessRate(string wzPath, WzMapleVersion encVersion, ref short? version) 128 | { 129 | WzFile wzf; 130 | if (version == null) 131 | wzf = new WzFile(wzPath, encVersion); 132 | else 133 | wzf = new WzFile(wzPath, (short)version, encVersion); 134 | wzf.ParseWzFile(); 135 | if (version == null) version = wzf.Version; 136 | int recognizedChars = 0; 137 | int totalChars = 0; 138 | foreach (WzDirectory wzdir in wzf.WzDirectory.WzDirectories) 139 | { 140 | recognizedChars += GetRecognizedCharacters(wzdir.Name); 141 | totalChars += wzdir.Name.Length; 142 | } 143 | foreach (WzImage wzimg in wzf.WzDirectory.WzImages) 144 | { 145 | recognizedChars += GetRecognizedCharacters(wzimg.Name); 146 | totalChars += wzimg.Name.Length; 147 | } 148 | wzf.Dispose(); 149 | return (double)recognizedChars / (double)totalChars; 150 | } 151 | 152 | public static WzMapleVersion DetectMapleVersion(string wzFilePath, out short fileVersion) 153 | { 154 | Hashtable mapleVersionSuccessRates = new Hashtable(); 155 | short? version = null; 156 | mapleVersionSuccessRates.Add(WzMapleVersion.GMS, GetDecryptionSuccessRate(wzFilePath, WzMapleVersion.GMS, ref version)); 157 | mapleVersionSuccessRates.Add(WzMapleVersion.EMS, GetDecryptionSuccessRate(wzFilePath, WzMapleVersion.EMS, ref version)); 158 | mapleVersionSuccessRates.Add(WzMapleVersion.BMS, GetDecryptionSuccessRate(wzFilePath, WzMapleVersion.BMS, ref version)); 159 | fileVersion = (short)version; 160 | WzMapleVersion mostSuitableVersion = WzMapleVersion.GMS; 161 | double maxSuccessRate = 0; 162 | foreach (DictionaryEntry mapleVersionEntry in mapleVersionSuccessRates) 163 | if ((double)mapleVersionEntry.Value > maxSuccessRate) 164 | { 165 | mostSuitableVersion = (WzMapleVersion)mapleVersionEntry.Key; 166 | maxSuccessRate = (double)mapleVersionEntry.Value; 167 | } 168 | if (maxSuccessRate < 0.7 && File.Exists(Path.Combine(Path.GetDirectoryName(wzFilePath), "ZLZ.dll"))) 169 | return WzMapleVersion.GETFROMZLZ; 170 | else return mostSuitableVersion; 171 | } 172 | 173 | public const int WzHeader = 0x31474B50; //PKG1 174 | 175 | public static bool IsListFile(string path) 176 | { 177 | BinaryReader reader = new BinaryReader(File.OpenRead(path)); 178 | bool result = reader.ReadInt32() != WzHeader; 179 | reader.Close(); 180 | return result; 181 | } 182 | 183 | private static byte[] Combine(byte[] a, byte[] b) 184 | { 185 | byte[] result = new byte[a.Length + b.Length]; 186 | Array.Copy(a, 0, result, 0, a.Length); 187 | Array.Copy(b, 0, result, a.Length, b.Length); 188 | return result; 189 | } 190 | } 191 | } -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/Util/WzTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95272eb21bd8a7a4f84a1150d7e43cbe 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/Util/XmlUtil.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Collections; 22 | using System.IO; 23 | using System.Text; 24 | using MapleLib.MapleCryptoLib; 25 | 26 | namespace MapleLib.WzLib.Util 27 | { 28 | public class XmlUtil 29 | { 30 | 31 | private static readonly char[] specialCharacters = {'"', '\'', '&', '<', '>'}; 32 | private static readonly string[] replacementStrings = {""", "'", "&", "<", ">"}; 33 | 34 | public static string SanitizeText(string text) 35 | { 36 | string fixedText = ""; 37 | bool charFixed; 38 | for (int i = 0; i < text.Length; i++) 39 | { 40 | charFixed = false; 41 | for (int k = 0; k < specialCharacters.Length; k++) 42 | { 43 | 44 | if (text[i] == specialCharacters[k]) 45 | { 46 | fixedText += replacementStrings[k]; 47 | charFixed = true; 48 | break; 49 | } 50 | } 51 | if (!charFixed) 52 | { 53 | fixedText += text[i]; 54 | } 55 | } 56 | return fixedText; 57 | } 58 | 59 | public static string OpenNamedTag(string tag, string name, bool finish) 60 | { 61 | return OpenNamedTag(tag, name, finish, false); 62 | } 63 | 64 | public static string EmptyNamedTag(string tag, string name) 65 | { 66 | return OpenNamedTag(tag, name, true, true); 67 | } 68 | 69 | public static string EmptyNamedValuePair(string tag, string name, string value) 70 | { 71 | return OpenNamedTag(tag, name, false, false) + Attrib("value", value, true, true); 72 | } 73 | 74 | public static string OpenNamedTag(string tag, string name, bool finish, bool empty) 75 | { 76 | return "<" + tag + " name=\"" + name + "\"" + (finish ? (empty ? "/>" : ">") : " "); 77 | } 78 | 79 | public static string Attrib(string name, string value) 80 | { 81 | return Attrib(name, value, false, false); 82 | } 83 | 84 | public static string Attrib(string name, string value, bool closeTag, bool empty) 85 | { 86 | return name + "=\"" + SanitizeText(value) + "\"" + (closeTag ? (empty ? "/>" : ">") : " "); 87 | } 88 | 89 | public static string CloseTag(string tag) 90 | { 91 | return ""; 92 | } 93 | 94 | public static string Indentation(int level) 95 | { 96 | char[] indent = new char[level]; 97 | for (int i = 0; i < indent.Length; i++) 98 | { 99 | indent[i] = '\t'; 100 | } 101 | return new String(indent); 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/Util/XmlUtil.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3ee67e0bd07ba140b892c4dcc64c704 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzDirectory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf86fb3bc40f1684a863d52d3ea48e60 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzExtended.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | namespace MapleLib.WzLib 21 | { 22 | public abstract class WzExtended : WzImageProperty 23 | { 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzExtended.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 33ab4d2748026d644b9c0f70536ddf31 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzFile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59c445a491d504f4fae6088a863240e3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzHeader.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | 25 | namespace MapleLib.WzLib 26 | { 27 | public class WzHeader 28 | { 29 | private string ident; 30 | private string copyright; 31 | private ulong fsize; 32 | private uint fstart; 33 | 34 | public string Ident 35 | { 36 | get { return ident; } 37 | set { ident = value; } 38 | } 39 | 40 | public string Copyright 41 | { 42 | get { return copyright; } 43 | set { copyright = value; } 44 | } 45 | 46 | public ulong FSize 47 | { 48 | get { return fsize; } 49 | set { fsize = value; } 50 | } 51 | 52 | public uint FStart 53 | { 54 | get { return fstart; } 55 | set { fstart = value; } 56 | } 57 | 58 | public void RecalculateFileStart() 59 | { 60 | fstart = (uint)(ident.Length + sizeof(ulong) + sizeof(uint) + copyright.Length + 1); 61 | } 62 | 63 | public static WzHeader GetDefault() 64 | { 65 | WzHeader header = new WzHeader(); 66 | header.ident = "PKG1"; 67 | header.copyright = "Package file v1.0 Copyright 2002 Wizet, ZMS"; 68 | header.fstart = 60; 69 | header.fsize = 0; 70 | return header; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzHeader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 55a9733cf6bb71e4ebaa95f63755011a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzImage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee121a711bcc2a4488cf7c398e19e2d7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzImageProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 341f106d2344e164a96be60ba820c986 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzImageResource.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | 25 | namespace MapleLib.WzLib 26 | { 27 | public class WzImageResource : IDisposable 28 | { 29 | bool parsed; 30 | WzImage img; 31 | public WzImageResource(WzImage img) 32 | { 33 | this.img = img; 34 | this.parsed = img.Parsed; 35 | if (!parsed) 36 | { 37 | img.ParseImage(); 38 | } 39 | } 40 | 41 | public void Dispose() 42 | { 43 | if (!parsed) 44 | { 45 | img.UnparseImage(); 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzImageResource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de1d9227be1adeb4ea7620e0a1e86255 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzListFile.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System.Collections.Generic; 21 | using System.IO; 22 | using MapleLib.WzLib.Util; 23 | using MapleLib.WzLib.WzProperties; 24 | 25 | namespace MapleLib.WzLib 26 | { 27 | /// 28 | /// A class that parses and contains the data of a wz list file 29 | /// 30 | public static class ListFileParser 31 | { 32 | /// 33 | /// Parses a wz list file on the disk 34 | /// 35 | /// Path to the wz file 36 | public static List ParseListFile(string filePath, WzMapleVersion version) 37 | { 38 | return ParseListFile(filePath, WzTool.GetIvByMapleVersion(version)); 39 | } 40 | 41 | /// 42 | /// Parses a wz list file on the disk 43 | /// 44 | /// Path to the wz file 45 | public static List ParseListFile(string filePath, byte[] WzIv) 46 | { 47 | List listEntries = new List(); 48 | byte[] wzFileBytes = File.ReadAllBytes(filePath); 49 | WzBinaryReader wzParser = new WzBinaryReader(new MemoryStream(wzFileBytes), WzIv); 50 | while (wzParser.PeekChar() != -1) 51 | { 52 | int len = wzParser.ReadInt32(); 53 | char[] strChrs = new char[len]; 54 | for (int i = 0; i < len; i++) 55 | strChrs[i] = (char)wzParser.ReadInt16(); 56 | wzParser.ReadUInt16(); //encrypted null 57 | string decryptedStr = wzParser.DecryptString(strChrs); 58 | listEntries.Add(decryptedStr); 59 | } 60 | wzParser.Close(); 61 | int lastIndex= listEntries.Count - 1; 62 | string lastEntry = listEntries[lastIndex]; 63 | listEntries[lastIndex] = lastEntry.Substring(0, lastEntry.Length - 1) + "g"; 64 | return listEntries; 65 | } 66 | 67 | public static void SaveToDisk(string path, WzMapleVersion version, List listEntries) 68 | { 69 | SaveToDisk(path, WzTool.GetIvByMapleVersion(version), listEntries); 70 | } 71 | 72 | public static void SaveToDisk(string path, byte[] WzIv, List listEntries) 73 | { 74 | int lastIndex = listEntries.Count - 1; 75 | string lastEntry = listEntries[lastIndex]; 76 | listEntries[lastIndex] = lastEntry.Substring(0, lastEntry.Length - 1) + "/"; 77 | WzBinaryWriter wzWriter = new WzBinaryWriter(File.Create(path), WzIv); 78 | string s; 79 | for (int i = 0; i < listEntries.Count; i++) 80 | { 81 | s = listEntries[i]; 82 | wzWriter.Write((int)s.Length); 83 | char[] encryptedChars = wzWriter.EncryptString(s + (char)0); 84 | for (int j = 0; j < encryptedChars.Length; j++) 85 | wzWriter.Write((short)encryptedChars[j]); 86 | } 87 | listEntries[lastIndex] = lastEntry.Substring(0, lastEntry.Length - 1) + "/"; 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzListFile.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae638cb989a52844ab2106bca5e825dd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzMapleVersion.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | 25 | namespace MapleLib.WzLib 26 | { 27 | [Serializable] 28 | public enum WzMapleVersion 29 | { 30 | GMS, 31 | EMS, 32 | BMS, 33 | CLASSIC, 34 | GENERATE, 35 | GETFROMZLZ, 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzMapleVersion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5bb7c1a76954aab47ae49e7e624365df 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzObject.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Drawing; 22 | using MapleLib.WzLib.WzProperties; 23 | 24 | namespace MapleLib.WzLib 25 | { 26 | /// 27 | /// An abstract class for wz objects 28 | /// 29 | public abstract class WzObject : IDisposable 30 | { 31 | private object tag = null; 32 | private object tag2 = null; 33 | private object tag3 = null; 34 | 35 | public abstract void Dispose(); 36 | 37 | /// 38 | /// The name of the object 39 | /// 40 | public abstract string Name { get; set; } 41 | /// 42 | /// The WzObjectType of the object 43 | /// 44 | public abstract WzObjectType ObjectType { get; } 45 | /// 46 | /// Returns the parent object 47 | /// 48 | public abstract WzObject Parent { get; internal set; } 49 | /// 50 | /// Returns the parent WZ File 51 | /// 52 | public abstract WzFile WzFileParent { get; } 53 | 54 | public WzObject this[string name] 55 | { 56 | get 57 | { 58 | if (this is WzFile) 59 | { 60 | return ((WzFile)this)[name]; 61 | } 62 | else if (this is WzDirectory) 63 | { 64 | return ((WzDirectory)this)[name]; 65 | } 66 | else if (this is WzImage) 67 | { 68 | return ((WzImage)this)[name]; 69 | } 70 | else if (this is WzImageProperty) 71 | { 72 | return ((WzImageProperty)this)[name]; 73 | } 74 | else 75 | { 76 | throw new NotImplementedException(); 77 | } 78 | } 79 | } 80 | 81 | public string FullPath 82 | { 83 | get 84 | { 85 | if (this is WzFile) return ((WzFile)this).WzDirectory.Name; 86 | string result = this.Name; 87 | WzObject currObj = this; 88 | while (currObj.Parent != null) 89 | { 90 | currObj = currObj.Parent; 91 | result = currObj.Name + @"\" + result; 92 | } 93 | return result; 94 | } 95 | } 96 | 97 | /// 98 | /// Used in HaCreator to save already parsed images 99 | /// 100 | public virtual object HCTag 101 | { 102 | get { return tag; } 103 | set { tag = value; } 104 | } 105 | 106 | /// 107 | /// Used in HaCreator's MapSimulator to save already parsed textures 108 | /// 109 | public virtual object MSTag 110 | { 111 | get { return tag2; } 112 | set { tag2 = value; } 113 | } 114 | 115 | /// 116 | /// Used in HaRepacker to save WzNodes 117 | /// 118 | public virtual object HRTag 119 | { 120 | get { return tag3; } 121 | set { tag3 = value; } 122 | } 123 | 124 | public virtual object WzValue { get { return null; } } 125 | 126 | public abstract void Remove(); 127 | 128 | //Credits to BluePoop for the idea of using cast overriding 129 | //2015 - That is the worst idea ever, removed and replaced with Get* methods 130 | #region Cast Values 131 | public virtual int GetInt() 132 | { 133 | throw new NotImplementedException(); 134 | } 135 | 136 | public virtual short GetShort() 137 | { 138 | throw new NotImplementedException(); 139 | } 140 | 141 | public virtual long GetLong() 142 | { 143 | throw new NotImplementedException(); 144 | } 145 | 146 | public virtual float GetFloat() 147 | { 148 | throw new NotImplementedException(); 149 | } 150 | 151 | public virtual double GetDouble() 152 | { 153 | throw new NotImplementedException(); 154 | } 155 | 156 | public virtual string GetString() 157 | { 158 | throw new NotImplementedException(); 159 | } 160 | 161 | public virtual Point GetPoint() 162 | { 163 | throw new NotImplementedException(); 164 | } 165 | 166 | public virtual Bitmap GetBitmap() 167 | { 168 | throw new NotImplementedException(); 169 | } 170 | 171 | public virtual byte[] GetBytes() 172 | { 173 | throw new NotImplementedException(); 174 | } 175 | #endregion 176 | 177 | } 178 | } -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1aedeffea2412d843b8a43b235e347ff 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzObjectType.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | 25 | namespace MapleLib.WzLib 26 | { 27 | public enum WzObjectType 28 | { 29 | File, 30 | Image, 31 | Directory, 32 | Property, 33 | List 34 | } 35 | } -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzObjectType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4af8f0a2188830440b43a963d4b137d1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 086f93b2d2fab2c4f9f9003085f8e7bc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzCanvasProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cc6129f838c0726449efb0f41ebe8c99 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzConvexProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29507b6e4fd78014eafa2ba15e4a9d5a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzDoubleProperty.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System.IO; 21 | using MapleLib.WzLib.Util; 22 | 23 | namespace MapleLib.WzLib.WzProperties 24 | { 25 | /// 26 | /// A property that has the value of a double 27 | /// 28 | public class WzDoubleProperty : WzImageProperty 29 | { 30 | #region Fields 31 | internal string name; 32 | internal double val; 33 | internal WzObject parent; 34 | //internal WzImage imgParent; 35 | #endregion 36 | 37 | #region Inherited Members 38 | public override void SetValue(object value) 39 | { 40 | val = (double)value; 41 | } 42 | 43 | public override WzImageProperty DeepClone() 44 | { 45 | WzDoubleProperty clone = new WzDoubleProperty(name, val); 46 | return clone; 47 | } 48 | 49 | public override object WzValue { get { return Value; } } 50 | /// 51 | /// The parent of the object 52 | /// 53 | public override WzObject Parent { get { return parent; } internal set { parent = value; } } 54 | /*/// 55 | /// The image that this property is contained in 56 | /// 57 | public override WzImage ParentImage { get { return imgParent; } internal set { imgParent = value; } }*/ 58 | /// 59 | /// The WzPropertyType of the property 60 | /// 61 | public override WzPropertyType PropertyType { get { return WzPropertyType.Double; } } 62 | /// 63 | /// The name of this property 64 | /// 65 | public override string Name { get { return name; } set { name = value; } } 66 | public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer) 67 | { 68 | writer.Write((byte)5); 69 | writer.Write(Value); 70 | } 71 | public override void ExportXml(StreamWriter writer, int level) 72 | { 73 | writer.WriteLine(XmlUtil.Indentation(level) + XmlUtil.EmptyNamedValuePair("WzDouble", this.Name, this.Value.ToString())); 74 | } 75 | public override void Dispose() 76 | { 77 | name = null; 78 | } 79 | #endregion 80 | 81 | #region Custom Members 82 | /// 83 | /// The value of this property 84 | /// 85 | public double Value { get { return val; } set { val = value; } } 86 | /// 87 | /// Creates a blank WzDoubleProperty 88 | /// 89 | public WzDoubleProperty() { } 90 | /// 91 | /// Creates a WzDoubleProperty with the specified name 92 | /// 93 | /// The name of the property 94 | public WzDoubleProperty(string name) 95 | { 96 | this.name = name; 97 | } 98 | /// 99 | /// Creates a WzDoubleProperty with the specified name and value 100 | /// 101 | /// The name of the property 102 | /// The value of the property 103 | public WzDoubleProperty(string name, double value) 104 | { 105 | this.name = name; 106 | this.val = value; 107 | } 108 | #endregion 109 | 110 | #region Cast Values 111 | public override float GetFloat() 112 | { 113 | return (float)val; 114 | } 115 | 116 | public override double GetDouble() 117 | { 118 | return val; 119 | } 120 | 121 | public override int GetInt() 122 | { 123 | return (int)val; 124 | } 125 | 126 | public override short GetShort() 127 | { 128 | return (short)val; 129 | } 130 | 131 | public override long GetLong() 132 | { 133 | return (long)val; 134 | } 135 | 136 | public override string ToString() 137 | { 138 | return val.ToString(); 139 | } 140 | #endregion 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzDoubleProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 443a78ef067d50141b8924c6a3f18f29 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzFloatProperty.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System.IO; 21 | using MapleLib.WzLib.Util; 22 | 23 | namespace MapleLib.WzLib.WzProperties 24 | { 25 | /// 26 | /// A property that is stored in the wz file with a byte and possibly followed by a float. If the 27 | /// byte is 0, the value is 0, else the value is the float that follows. 28 | /// 29 | public class WzFloatProperty : WzImageProperty 30 | { 31 | #region Fields 32 | internal string name; 33 | internal float val; 34 | internal WzObject parent; 35 | //internal WzImage imgParent; 36 | #endregion 37 | 38 | #region Inherited Members 39 | public override void SetValue(object value) 40 | { 41 | val = (float)value; 42 | } 43 | 44 | public override WzImageProperty DeepClone() 45 | { 46 | WzFloatProperty clone = new WzFloatProperty(name, val); 47 | return clone; 48 | } 49 | 50 | public override object WzValue { get { return Value; } } 51 | /// 52 | /// The parent of the object 53 | /// 54 | public override WzObject Parent { get { return parent; } internal set { parent = value; } } 55 | /*/// 56 | /// The image that this property is contained in 57 | /// 58 | public override WzImage ParentImage { get { return imgParent; } internal set { imgParent = value; } }*/ 59 | /// 60 | /// The WzPropertyType of the property 61 | /// 62 | public override WzPropertyType PropertyType { get { return WzPropertyType.Float; } } 63 | /// 64 | /// The name of the property 65 | /// 66 | public override string Name { get { return name; } set { name = value; } } 67 | public override void WriteValue(WzBinaryWriter writer) 68 | { 69 | writer.Write((byte)4); 70 | if (Value == 0f) 71 | { 72 | writer.Write((byte)0); 73 | } 74 | else 75 | { 76 | writer.Write((byte)0x80); 77 | writer.Write(Value); 78 | } 79 | } 80 | public override void ExportXml(StreamWriter writer, int level) 81 | { 82 | writer.WriteLine(XmlUtil.Indentation(level) + XmlUtil.EmptyNamedValuePair("WzByteFloat", this.Name, this.Value.ToString())); 83 | } 84 | /// 85 | /// Dispose the object 86 | /// 87 | public override void Dispose() 88 | { 89 | name = null; 90 | } 91 | #endregion 92 | 93 | #region Custom Members 94 | /// 95 | /// The value of the property 96 | /// 97 | public float Value { get { return val; } set { val = Value; } } 98 | /// 99 | /// Creates a blank WzByteFloatProperty 100 | /// 101 | public WzFloatProperty() { } 102 | /// 103 | /// Creates a WzByteFloatProperty with the specified name 104 | /// 105 | /// The name of the property 106 | public WzFloatProperty(string name) 107 | { 108 | this.name = name; 109 | } 110 | /// 111 | /// Creates a WzByteFloatProperty with the specified name and value 112 | /// 113 | /// The name of the property 114 | /// The value of the property 115 | public WzFloatProperty(string name, float value) 116 | { 117 | this.name = name; 118 | this.val = value; 119 | } 120 | #endregion 121 | 122 | #region Cast Values 123 | public override float GetFloat() 124 | { 125 | return val; 126 | } 127 | 128 | public override double GetDouble() 129 | { 130 | return (double)val; 131 | } 132 | 133 | public override int GetInt() 134 | { 135 | return (int)val; 136 | } 137 | 138 | public override short GetShort() 139 | { 140 | return (short)val; 141 | } 142 | 143 | public override long GetLong() 144 | { 145 | return (long)val; 146 | } 147 | 148 | public override string ToString() 149 | { 150 | return val.ToString(); 151 | } 152 | #endregion 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzFloatProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 591914a54e1927548bf4d93e5b75dcc7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzIntProperty.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System.IO; 21 | using MapleLib.WzLib.Util; 22 | 23 | namespace MapleLib.WzLib.WzProperties 24 | { 25 | /// 26 | /// A property that is stored in the wz file with a signed byte and possibly followed by an int. If the 27 | /// signed byte is equal to -128, the value is is the int that follows, else the value is the byte. 28 | /// 29 | public class WzIntProperty : WzImageProperty 30 | { 31 | #region Fields 32 | internal string name; 33 | internal int val; 34 | internal WzObject parent; 35 | //internal WzImage imgParent; 36 | #endregion 37 | 38 | #region Inherited Members 39 | public override void SetValue(object value) 40 | { 41 | val = System.Convert.ToInt32(value); 42 | } 43 | 44 | public override WzImageProperty DeepClone() 45 | { 46 | WzIntProperty clone = new WzIntProperty(name, val); 47 | return clone; 48 | } 49 | 50 | public override object WzValue { get { return Value; } } 51 | /// 52 | /// The parent of the object 53 | /// 54 | public override WzObject Parent { get { return parent; } internal set { parent = value; } } 55 | /*/// 56 | /// The image that this property is contained in 57 | /// 58 | public override WzImage ParentImage { get { return imgParent; } internal set { imgParent = value; } }*/ 59 | /// 60 | /// The WzPropertyType of the property 61 | /// 62 | public override WzPropertyType PropertyType { get { return WzPropertyType.Int; } } 63 | /// 64 | /// The name of the property 65 | /// 66 | public override string Name { get { return name; } set { name = value; } } 67 | public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer) 68 | { 69 | writer.Write((byte)3); 70 | writer.WriteCompressedInt(Value); 71 | } 72 | public override void ExportXml(StreamWriter writer, int level) 73 | { 74 | writer.WriteLine(XmlUtil.Indentation(level) + XmlUtil.EmptyNamedValuePair("WzCompressedInt", this.Name, this.Value.ToString())); 75 | } 76 | /// 77 | /// Dispose the object 78 | /// 79 | public override void Dispose() 80 | { 81 | name = null; 82 | } 83 | #endregion 84 | 85 | #region Custom Members 86 | /// 87 | /// The value of the property 88 | /// 89 | public int Value { get { return val; } set { val = value; } } 90 | /// 91 | /// Creates a blank WzCompressedIntProperty 92 | /// 93 | public WzIntProperty() { } 94 | /// 95 | /// Creates a WzCompressedIntProperty with the specified name 96 | /// 97 | /// The name of the property 98 | public WzIntProperty(string name) 99 | { 100 | this.name = name; 101 | } 102 | /// 103 | /// Creates a WzCompressedIntProperty with the specified name and value 104 | /// 105 | /// The name of the property 106 | /// The value of the property 107 | public WzIntProperty(string name, int value) 108 | { 109 | this.name = name; 110 | this.val = value; 111 | } 112 | #endregion 113 | 114 | #region Cast Values 115 | public override float GetFloat() 116 | { 117 | return (float)val; 118 | } 119 | 120 | public override double GetDouble() 121 | { 122 | return (double)val; 123 | } 124 | 125 | public override int GetInt() 126 | { 127 | return val; 128 | } 129 | 130 | public override short GetShort() 131 | { 132 | return (short)val; 133 | } 134 | 135 | public override long GetLong() 136 | { 137 | return (long)val; 138 | } 139 | 140 | public override string ToString() 141 | { 142 | return val.ToString(); 143 | } 144 | #endregion 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzIntProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5d203bed8d48464c8fbfcb72652cf12 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzListEntry.cs: -------------------------------------------------------------------------------- 1 | ///* MapleLib - A general-purpose MapleStory library 2 | // * 3 | // * Copyright (C) 2009-2015 Snow and haha01haha01 4 | // * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | // * 6 | // * This program is free software: you can redistribute it and/or modify 7 | // * it under the terms of the GNU General Public License as published by 8 | // * the Free Software Foundation, either version 3 of the License, or 9 | // * (at your option) any later version. 10 | // * 11 | // * This program is distributed in the hope that it will be useful, 12 | // * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // * GNU General Public License for more details. 15 | // * 16 | // * You should have received a copy of the GNU General Public License 17 | // * along with this program. If not, see . 18 | // */ 19 | 20 | //using System; 21 | //using System.Collections.Generic; 22 | //using System.Linq; 23 | //using System.Text; 24 | 25 | //namespace MapleLib.WzLib.WzProperties 26 | //{ 27 | // public class WzListEntry : IWzObject 28 | // { 29 | // public WzListEntry(string value) 30 | // { 31 | // this.value = value; 32 | // } 33 | 34 | // private string value; 35 | // private WzListFile parentFile; 36 | 37 | // public override IWzObject Parent 38 | // { 39 | // get 40 | // { 41 | // return parentFile; 42 | // } 43 | // internal set 44 | // { 45 | // parentFile = (WzListFile)value; 46 | // } 47 | // } 48 | 49 | // public override string Name 50 | // { 51 | // get 52 | // { 53 | // return value; 54 | // } 55 | // set 56 | // { 57 | // this.value = value; 58 | // } 59 | // } 60 | 61 | // public override object WzValue 62 | // { 63 | // get 64 | // { 65 | // return value; 66 | // } 67 | // } 68 | 69 | // public override void Dispose() 70 | // { 71 | // } 72 | 73 | // public override void Remove() 74 | // { 75 | // parentFile.WzListEntries.Remove(this); 76 | // } 77 | 78 | // public override WzObjectType ObjectType 79 | // { 80 | // get { return WzObjectType.List; } 81 | // } 82 | 83 | // public override IWzFile WzFileParent 84 | // { 85 | // get { return parentFile; } 86 | // } 87 | // } 88 | //} 89 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzListEntry.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7cd02c100386d3b4f8e41da60fd63956 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzLongProperty.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System.IO; 21 | using MapleLib.WzLib.Util; 22 | 23 | namespace MapleLib.WzLib.WzProperties 24 | { 25 | class WzLongProperty : WzImageProperty 26 | { 27 | #region Fields 28 | internal string name; 29 | internal long val; 30 | internal WzObject parent; 31 | //internal WzImage imgParent; 32 | #endregion 33 | 34 | #region Inherited Members 35 | public override void SetValue(object value) 36 | { 37 | val = System.Convert.ToInt64(value); 38 | } 39 | 40 | public override WzImageProperty DeepClone() 41 | { 42 | WzLongProperty clone = new WzLongProperty(name, val); 43 | return clone; 44 | } 45 | 46 | public override object WzValue { get { return Value; } } 47 | /// 48 | /// The parent of the object 49 | /// 50 | public override WzObject Parent { get { return parent; } internal set { parent = value; } } 51 | /*/// 52 | /// The image that this property is contained in 53 | /// 54 | public override WzImage ParentImage { get { return imgParent; } internal set { imgParent = value; } }*/ 55 | /// 56 | /// The WzPropertyType of the property 57 | /// 58 | public override WzPropertyType PropertyType { get { return WzPropertyType.Long; } } 59 | /// 60 | /// The name of the property 61 | /// 62 | public override string Name { get { return name; } set { name = value; } } 63 | public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer) 64 | { 65 | writer.Write((byte)20); 66 | writer.WriteCompressedLong(Value); 67 | } 68 | public override void ExportXml(StreamWriter writer, int level) 69 | { 70 | writer.WriteLine(XmlUtil.Indentation(level) + XmlUtil.EmptyNamedValuePair("WzLong", this.Name, this.Value.ToString())); 71 | } 72 | /// 73 | /// Dispose the object 74 | /// 75 | public override void Dispose() 76 | { 77 | name = null; 78 | } 79 | #endregion 80 | 81 | #region Custom Members 82 | /// 83 | /// The value of the property 84 | /// 85 | public long Value { get { return val; } set { val = value; } } 86 | /// 87 | /// Creates a blank WzCompressedIntProperty 88 | /// 89 | public WzLongProperty() { } 90 | /// 91 | /// Creates a WzCompressedIntProperty with the specified name 92 | /// 93 | /// The name of the property 94 | public WzLongProperty(string name) 95 | { 96 | this.name = name; 97 | } 98 | /// 99 | /// Creates a WzCompressedIntProperty with the specified name and value 100 | /// 101 | /// The name of the property 102 | /// The value of the property 103 | public WzLongProperty(string name, long value) 104 | { 105 | this.name = name; 106 | this.val = value; 107 | } 108 | #endregion 109 | 110 | #region Cast Values 111 | public override float GetFloat() 112 | { 113 | return (float)val; 114 | } 115 | 116 | public override double GetDouble() 117 | { 118 | return (double)val; 119 | } 120 | 121 | public override long GetLong() 122 | { 123 | return val; 124 | } 125 | 126 | public override int GetInt() 127 | { 128 | return (int)val; 129 | } 130 | 131 | public override short GetShort() 132 | { 133 | return (short)val; 134 | } 135 | 136 | public override string ToString() 137 | { 138 | return val.ToString(); 139 | } 140 | #endregion 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzLongProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41fbf8056f4c2744b95ef7193b94daae 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzNullProperty.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System.IO; 21 | using MapleLib.WzLib.Util; 22 | 23 | namespace MapleLib.WzLib.WzProperties 24 | { 25 | /// 26 | /// A property that's value is null 27 | /// 28 | public class WzNullProperty : WzImageProperty 29 | { 30 | #region Fields 31 | internal string name; 32 | internal WzObject parent; 33 | //internal WzImage imgParent; 34 | #endregion 35 | 36 | #region Inherited Members 37 | public override void SetValue(object value) 38 | { 39 | throw new System.NotImplementedException(); 40 | } 41 | 42 | public override WzImageProperty DeepClone() 43 | { 44 | WzNullProperty clone = new WzNullProperty(name); 45 | return clone; 46 | } 47 | 48 | /// 49 | /// The parent of the object 50 | /// 51 | public override WzObject Parent { get { return parent; } internal set { parent = value; } } 52 | /*/// 53 | /// The image that this property is contained in 54 | /// 55 | public override WzImage ParentImage { get { return imgParent; } internal set { imgParent = value; } }*/ 56 | /// 57 | /// The WzPropertyType of the property 58 | /// 59 | public override WzPropertyType PropertyType { get { return WzPropertyType.Null; } } 60 | /// 61 | /// The name of the property 62 | /// 63 | /// 64 | public override string Name { get { return name; } set { name = value; } } 65 | /// 66 | /// The WzObjectType of the property 67 | /// 68 | public override WzObjectType ObjectType { get { return WzObjectType.Property; } } 69 | public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer) 70 | { 71 | writer.Write((byte)0); 72 | } 73 | public override void ExportXml(StreamWriter writer, int level) 74 | { 75 | writer.WriteLine(XmlUtil.Indentation(level) + XmlUtil.EmptyNamedTag("WzNull", this.Name)); 76 | } 77 | /// 78 | /// Disposes the object 79 | /// 80 | public override void Dispose() 81 | { 82 | name = null; 83 | } 84 | #endregion 85 | 86 | #region Custom Members 87 | /// 88 | /// Creates a blank WzNullProperty 89 | /// 90 | public WzNullProperty() { } 91 | /// 92 | /// Creates a WzNullProperty with the specified name 93 | /// 94 | /// The name of the property 95 | public WzNullProperty(string propName) 96 | { 97 | name = propName; 98 | } 99 | #endregion 100 | 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzNullProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27d7126cc0645fa4781a5d7edacae7c6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzPngProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 21b7c1cb54969734597080cef1c36775 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzShortProperty.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System.IO; 21 | using MapleLib.WzLib.Util; 22 | 23 | namespace MapleLib.WzLib.WzProperties 24 | { 25 | /// 26 | /// A wz property which has a value which is a ushort 27 | /// 28 | public class WzShortProperty : WzImageProperty 29 | { 30 | #region Fields 31 | internal string name; 32 | internal short val; 33 | internal WzObject parent; 34 | //internal WzImage imgParent; 35 | #endregion 36 | 37 | #region Inherited Members 38 | public override void SetValue(object value) 39 | { 40 | val = (short)value; 41 | } 42 | 43 | public override WzImageProperty DeepClone() 44 | { 45 | WzShortProperty clone = new WzShortProperty(name, val); 46 | return clone; 47 | } 48 | 49 | public override object WzValue { get { return Value; } } 50 | /// 51 | /// The parent of the object 52 | /// 53 | public override WzObject Parent { get { return parent; } internal set { parent = value; } } 54 | /*/// 55 | /// The image that this property is contained in 56 | /// 57 | public override WzImage ParentImage { get { return imgParent; } internal set { imgParent = value; } }*/ 58 | /// 59 | /// The WzPropertyType of the property 60 | /// 61 | public override WzPropertyType PropertyType { get { return WzPropertyType.Short; } } 62 | /// 63 | /// The name of the property 64 | /// 65 | public override string Name { get { return name; } set { name = value; } } 66 | public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer) 67 | { 68 | writer.Write((byte)2); 69 | writer.Write(Value); 70 | } 71 | public override void ExportXml(StreamWriter writer, int level) 72 | { 73 | writer.WriteLine(XmlUtil.Indentation(level) + XmlUtil.EmptyNamedValuePair("WzUnsignedShort", this.Name, this.Value.ToString())); 74 | } 75 | /// 76 | /// Disposes the object 77 | /// 78 | public override void Dispose() 79 | { 80 | name = null; 81 | } 82 | #endregion 83 | 84 | #region Custom Members 85 | /// 86 | /// The value of the property 87 | /// 88 | public short Value { get { return val; } set { val = value; } } 89 | /// 90 | /// Creates a blank WzUnsignedShortProperty 91 | /// 92 | public WzShortProperty() { } 93 | /// 94 | /// Creates a WzUnsignedShortProperty with the specified name 95 | /// 96 | /// The name of the property 97 | public WzShortProperty(string name) 98 | { 99 | this.name = name; 100 | } 101 | /// 102 | /// Creates a WzUnsignedShortProperty with the specified name and value 103 | /// 104 | /// The name of the property 105 | /// The value of the property 106 | public WzShortProperty(string name, short value) 107 | { 108 | this.name = name; 109 | this.val = value; 110 | } 111 | #endregion 112 | 113 | #region Cast Values 114 | public override float GetFloat() 115 | { 116 | return (float)val; 117 | } 118 | 119 | public override double GetDouble() 120 | { 121 | return (double)val; 122 | } 123 | 124 | public override int GetInt() 125 | { 126 | return (int)val; 127 | } 128 | 129 | public override short GetShort() 130 | { 131 | return val; 132 | } 133 | 134 | public override long GetLong() 135 | { 136 | return (long)val; 137 | } 138 | 139 | public override string ToString() 140 | { 141 | return val.ToString(); 142 | } 143 | #endregion 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzShortProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e4fddd51394d1f4391882e85c63ff8b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzSoundProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52863e0109e48b242bd2ad73edb8d1fd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzStringProperty.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System.IO; 21 | using MapleLib.WzLib.Util; 22 | 23 | namespace MapleLib.WzLib.WzProperties 24 | { 25 | /// 26 | /// A property with a string as a value 27 | /// 28 | public class WzStringProperty : WzImageProperty 29 | { 30 | #region Fields 31 | internal string name, val; 32 | internal WzObject parent; 33 | //internal WzImage imgParent; 34 | #endregion 35 | 36 | #region Inherited Members 37 | public override void SetValue(object value) 38 | { 39 | val = (string)value; 40 | } 41 | 42 | public override WzImageProperty DeepClone() 43 | { 44 | WzStringProperty clone = new WzStringProperty(name, val); 45 | return clone; 46 | } 47 | 48 | public override object WzValue { get { return Value; } } 49 | /// 50 | /// The parent of the object 51 | /// 52 | public override WzObject Parent { get { return parent; } internal set { parent = value; } } 53 | /*/// 54 | /// The image that this property is contained in 55 | /// 56 | public override WzImage ParentImage { get { return imgParent; } internal set { imgParent = value; } }*/ 57 | /// 58 | /// The WzPropertyType of the property 59 | /// 60 | public override WzPropertyType PropertyType { get { return WzPropertyType.String; } } 61 | /// 62 | /// The name of the property 63 | /// 64 | public override string Name { get { return name; } set { name = value; } } 65 | public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer) 66 | { 67 | writer.Write((byte)8); 68 | writer.WriteStringValue(Value, 0, 1); 69 | } 70 | public override void ExportXml(StreamWriter writer, int level) 71 | { 72 | writer.WriteLine(XmlUtil.Indentation(level) + XmlUtil.EmptyNamedValuePair("WzString", this.Name, this.Value)); 73 | } 74 | /// 75 | /// Disposes the object 76 | /// 77 | public override void Dispose() 78 | { 79 | name = null; 80 | val = null; 81 | } 82 | #endregion 83 | 84 | #region Custom Members 85 | /// 86 | /// The value of the property 87 | /// 88 | public string Value { get { return val; } set { val = value; } } 89 | /// 90 | /// Creates a blank WzStringProperty 91 | /// 92 | public WzStringProperty() { } 93 | /// 94 | /// Creates a WzStringProperty with the specified name 95 | /// 96 | /// The name of the property 97 | public WzStringProperty(string name) 98 | { 99 | this.name = name; 100 | } 101 | /// 102 | /// Creates a WzStringProperty with the specified name and value 103 | /// 104 | /// The name of the property 105 | /// The value of the property 106 | public WzStringProperty(string name, string value) 107 | { 108 | this.name = name; 109 | this.val = value; 110 | } 111 | #endregion 112 | 113 | #region Cast Values 114 | public override string GetString() 115 | { 116 | return val; 117 | } 118 | 119 | public override string ToString() 120 | { 121 | return val; 122 | } 123 | #endregion 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzStringProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d666fcf57eccbb940b080eebcd1b0cac 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzSubProperty.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System.Collections.Generic; 21 | using System.IO; 22 | using MapleLib.WzLib.Util; 23 | 24 | namespace MapleLib.WzLib.WzProperties 25 | { 26 | /// 27 | /// A property that contains a set of properties 28 | /// 29 | public class WzSubProperty : WzExtended, IPropertyContainer 30 | { 31 | #region Fields 32 | internal List properties = new List(); 33 | internal string name; 34 | internal WzObject parent; 35 | //internal WzImage imgParent; 36 | #endregion 37 | 38 | #region Inherited Members 39 | public override void SetValue(object value) 40 | { 41 | throw new System.NotImplementedException(); 42 | } 43 | 44 | public override WzImageProperty DeepClone() 45 | { 46 | WzSubProperty clone = new WzSubProperty(name); 47 | foreach (WzImageProperty prop in properties) 48 | clone.AddProperty(prop.DeepClone()); 49 | return clone; 50 | } 51 | 52 | /// 53 | /// The parent of the object 54 | /// 55 | public override WzObject Parent { get { return parent; } internal set { parent = value; } } 56 | /* /// 57 | /// The image that this property is contained in 58 | /// 59 | public override WzImage ParentImage { get { return imgParent; } internal set { imgParent = value; } }*/ 60 | /// 61 | /// The WzPropertyType of the property 62 | /// 63 | public override WzPropertyType PropertyType { get { return WzPropertyType.SubProperty; } } 64 | /// 65 | /// The wz properties contained in the property 66 | /// 67 | public override List WzProperties 68 | { 69 | get 70 | { 71 | return properties; 72 | } 73 | } 74 | /// 75 | /// The name of the property 76 | /// 77 | public override string Name { get { return name; } set { name = value; } } 78 | /// 79 | /// Gets a wz property by it's name 80 | /// 81 | /// The name of the property 82 | /// The wz property with the specified name 83 | public override WzImageProperty this[string name] 84 | { 85 | get 86 | { 87 | 88 | foreach (WzImageProperty iwp in properties) 89 | if (iwp.Name.ToLower() == name.ToLower()) 90 | return iwp; 91 | //throw new KeyNotFoundException("A wz property with the specified name was not found"); 92 | return null; 93 | } 94 | set 95 | { 96 | if (value != null) 97 | { 98 | value.Name = name; 99 | AddProperty(value); 100 | } 101 | } 102 | } 103 | 104 | /// 105 | /// Gets a wz property by a path name 106 | /// 107 | /// path to property 108 | /// the wz property with the specified name 109 | public override WzImageProperty GetFromPath(string path) 110 | { 111 | string[] segments = path.Split(new char[1] { '/' }, System.StringSplitOptions.RemoveEmptyEntries); 112 | if (segments[0] == "..") 113 | { 114 | return ((WzImageProperty)Parent)[path.Substring(name.IndexOf('/') + 1)]; 115 | } 116 | WzImageProperty ret = this; 117 | for (int x = 0; x < segments.Length; x++) 118 | { 119 | bool foundChild = false; 120 | foreach (WzImageProperty iwp in ret.WzProperties) 121 | { 122 | if (iwp.Name == segments[x]) 123 | { 124 | ret = iwp; 125 | foundChild = true; 126 | break; 127 | } 128 | } 129 | if (!foundChild) 130 | { 131 | return null; 132 | } 133 | } 134 | return ret; 135 | } 136 | public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer) 137 | { 138 | writer.WriteStringValue("Property", 0x73, 0x1B); 139 | WzImageProperty.WritePropertyList(writer, properties); 140 | } 141 | public override void ExportXml(StreamWriter writer, int level) 142 | { 143 | writer.WriteLine(XmlUtil.Indentation(level) + XmlUtil.OpenNamedTag("WzSub", this.Name, true)); 144 | WzImageProperty.DumpPropertyList(writer, level, WzProperties); 145 | writer.WriteLine(XmlUtil.Indentation(level) + XmlUtil.CloseTag("WzSub")); 146 | } 147 | /// 148 | /// Disposes the object 149 | /// 150 | public override void Dispose() 151 | { 152 | name = null; 153 | foreach (WzImageProperty prop in properties) 154 | prop.Dispose(); 155 | properties.Clear(); 156 | properties = null; 157 | } 158 | #endregion 159 | 160 | #region Custom Members 161 | /// 162 | /// Creates a blank WzSubProperty 163 | /// 164 | public WzSubProperty() { } 165 | /// 166 | /// Creates a WzSubProperty with the specified name 167 | /// 168 | /// The name of the property 169 | public WzSubProperty(string name) 170 | { 171 | this.name = name; 172 | } 173 | /// 174 | /// Adds a property to the list 175 | /// 176 | /// The property to add 177 | public void AddProperty(WzImageProperty prop) 178 | { 179 | prop.Parent = this; 180 | properties.Add(prop); 181 | } 182 | public void AddProperties(List props) 183 | { 184 | foreach (WzImageProperty prop in props) 185 | { 186 | AddProperty(prop); 187 | } 188 | } 189 | public void RemoveProperty(WzImageProperty prop) 190 | { 191 | prop.Parent = null; 192 | properties.Remove(prop); 193 | } 194 | /// 195 | /// Clears the list of properties 196 | /// 197 | public void ClearProperties() 198 | { 199 | foreach (WzImageProperty prop in properties) prop.Parent = null; 200 | properties.Clear(); 201 | } 202 | #endregion 203 | } 204 | } 205 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzSubProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9cb22905775b344fa53310f62d59959 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzUOLProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 106eb3853b6b6b848ab15453bdd0570d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzVectorProperty.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System.IO; 21 | using MapleLib.WzLib.Util; 22 | 23 | namespace MapleLib.WzLib.WzProperties 24 | { 25 | /// 26 | /// A property that contains an x and a y value 27 | /// 28 | public class WzVectorProperty : WzExtended 29 | { 30 | #region Fields 31 | internal string name; 32 | internal WzIntProperty x, y; 33 | internal WzObject parent; 34 | //internal WzImage imgParent; 35 | #endregion 36 | 37 | #region Inherited Members 38 | public override void SetValue(object value) 39 | { 40 | if (value is System.Drawing.Point) 41 | { 42 | x.val = ((System.Drawing.Point)value).X; 43 | y.val = ((System.Drawing.Point)value).Y; 44 | } 45 | else 46 | { 47 | x.val = ((System.Drawing.Size)value).Width; 48 | y.val = ((System.Drawing.Size)value).Height; 49 | } 50 | } 51 | 52 | public override WzImageProperty DeepClone() 53 | { 54 | WzVectorProperty clone = new WzVectorProperty(name, x, y); 55 | return clone; 56 | } 57 | 58 | public override object WzValue { get { return new System.Drawing.Point(x.Value, y.Value); } } 59 | /// 60 | /// The parent of the object 61 | /// 62 | public override WzObject Parent { get { return parent; } internal set { parent = value; } } 63 | /*/// 64 | /// The image that this property is contained in 65 | /// 66 | public override WzImage ParentImage { get { return imgParent; } internal set { imgParent = value; } }*/ 67 | /// 68 | /// The name of the property 69 | /// 70 | public override string Name { get { return name; } set { name = value; } } 71 | /// 72 | /// The WzPropertyType of the property 73 | /// 74 | public override WzPropertyType PropertyType { get { return WzPropertyType.Vector; } } 75 | public override void WriteValue(MapleLib.WzLib.Util.WzBinaryWriter writer) 76 | { 77 | writer.WriteStringValue("Shape2D#Vector2D", 0x73, 0x1B); 78 | writer.WriteCompressedInt(X.Value); 79 | writer.WriteCompressedInt(Y.Value); 80 | } 81 | public override void ExportXml(StreamWriter writer, int level) 82 | { 83 | writer.WriteLine(XmlUtil.Indentation(level) + XmlUtil.OpenNamedTag("WzVector", this.Name, false, false) + 84 | XmlUtil.Attrib("X", this.X.Value.ToString()) + XmlUtil.Attrib("Y", this.Y.Value.ToString(), true, true)); 85 | } 86 | /// 87 | /// Disposes the object 88 | /// 89 | public override void Dispose() 90 | { 91 | name = null; 92 | x.Dispose(); 93 | x = null; 94 | y.Dispose(); 95 | y = null; 96 | } 97 | #endregion 98 | 99 | #region Custom Members 100 | /// 101 | /// The X value of the Vector2D 102 | /// 103 | public WzIntProperty X { get { return x; } set { x = value; } } 104 | /// 105 | /// The Y value of the Vector2D 106 | /// 107 | public WzIntProperty Y { get { return y; } set { y = value; } } 108 | /// 109 | /// The Point of the Vector2D created from the X and Y 110 | /// 111 | public System.Drawing.Point Pos { get { return new System.Drawing.Point(X.Value, Y.Value); } } 112 | /// 113 | /// Creates a blank WzVectorProperty 114 | /// 115 | public WzVectorProperty() { } 116 | /// 117 | /// Creates a WzVectorProperty with the specified name 118 | /// 119 | /// The name of the property 120 | public WzVectorProperty(string name) 121 | { 122 | this.name = name; 123 | } 124 | /// 125 | /// Creates a WzVectorProperty with the specified name, x and y 126 | /// 127 | /// The name of the property 128 | /// The x value of the vector 129 | /// The y value of the vector 130 | public WzVectorProperty(string name, WzIntProperty x, WzIntProperty y) 131 | { 132 | this.name = name; 133 | this.x = x; 134 | this.y = y; 135 | } 136 | #endregion 137 | 138 | #region Cast Values 139 | public override System.Drawing.Point GetPoint() 140 | { 141 | return new System.Drawing.Point(x.val, y.val); 142 | } 143 | 144 | public override string ToString() 145 | { 146 | return "X: " + x.val.ToString() + ", Y: " + y.val.ToString(); 147 | } 148 | #endregion 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzProperties/WzVectorProperty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a5dd6a5ca04ce24b80d5c00997ffebf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzPropertyType.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | namespace MapleLib.WzLib 21 | { 22 | public enum WzPropertyType 23 | { 24 | #region Regular 25 | Null, 26 | Short, 27 | Int, 28 | Long, 29 | Float, 30 | Double, 31 | String, 32 | #endregion 33 | 34 | #region Extended 35 | SubProperty, 36 | Canvas, 37 | Vector, 38 | Convex, 39 | Sound, 40 | UOL, 41 | #endregion 42 | 43 | #region Png 44 | PNG 45 | #endregion 46 | } 47 | } -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzPropertyType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bca01ea8f65d6474884928e3bab9e0bb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzSerializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b91e184000f692348b1e2c79778c430e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4454965626150bf40b1079ad6b3958b4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzStructure.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62c9abee4c721fd41aaf1ff97a6a6962 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzStructure/Data.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3dc16beb9d423914fbb0a61d8a3ed0e8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzStructure/Data/Data.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | 23 | namespace MapleLib.WzLib.WzStructure.Data 24 | { 25 | 26 | public static class Tables 27 | { 28 | public static Dictionary PortalTypeNames = new Dictionary() { 29 | { "sp", "Start Point"}, 30 | { "pi", "Invisible" }, 31 | { "pv", "Visible" }, 32 | { "pc", "Collision" }, 33 | { "pg", "Changable" }, 34 | { "pgi", "Changable Invisible" }, 35 | { "tp", "Town Portal" }, 36 | { "ps", "Script" }, 37 | { "psi", "Script Invisible" }, 38 | { "pcs", "Script Collision" }, 39 | { "ph", "Hidden" }, 40 | { "psh", "Script Hidden" }, 41 | { "pcj", "Vertical Spring" }, 42 | { "pci", "Custom Impact Spring" }, 43 | { "pcig", "Unknown (PCIG)" }}; 44 | 45 | public static string[] BackgroundTypeNames = new string[] { 46 | "Regular", 47 | "Horizontal Copies", 48 | "Vertical Copies", 49 | "H+V Copies", 50 | "Horizontal Moving+Copies", 51 | "Vertical Moving+Copies", 52 | "H+V Copies, Horizontal Moving", 53 | "H+V Copies, Vertical Moving" 54 | }; 55 | } 56 | 57 | public static class WzConstants 58 | { 59 | public const int MinMap = 0; 60 | public const int MaxMap = 999999999; 61 | } 62 | 63 | public enum QuestState 64 | { 65 | Available = 0, 66 | InProgress = 1, 67 | Completed = 2 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzStructure/Data/Data.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b55ab6422c6718043baf43a220e281da 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzStructure/Data/Enums.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | 23 | namespace MapleLib.WzLib.WzStructure.Data 24 | { 25 | [Flags] 26 | public enum ItemTypes 27 | { 28 | None = 0x0, 29 | Tiles = 0x1, 30 | Objects = 0x2, 31 | Mobs = 0x4, 32 | NPCs = 0x8, 33 | Ropes = 0x10, 34 | Footholds = 0x20, 35 | Portals = 0x40, 36 | Chairs = 0x80, 37 | Reactors = 0x100, 38 | ToolTips = 0x200, 39 | Backgrounds = 0x400, 40 | Misc = 0x800, 41 | 42 | All = 0xFFF 43 | } 44 | 45 | [Flags] 46 | public enum FieldLimit //Credits to Koolk, LightPepsi, Bui 47 | { 48 | FIELDOPT_NONE = 0, 49 | FIELDOPT_MOVELIMIT = 1, 50 | FIELDOPT_SKILLLIMIT = 2, 51 | FIELDOPT_SUMMONLIMIT = 4, 52 | FIELDOPT_MYSTICDOORLIMIT = 8, 53 | FIELDOPT_MIGRATELIMIT = 0x10, 54 | FIELDOPT_PORTALSCROLLLIMIT = 0x20, 55 | FIELDOPT_TELEPORTITEMLIMIT = 0x40, 56 | FIELDOPT_MINIGAMELIMIT = 0x80, 57 | FIELDOPT_SPECIFICPORTALSCROLLLIMIT = 0x100, 58 | FIELDOPT_TAMINGMOBLIMIT = 0x200, 59 | FIELDOPT_STATCHANGEITEMCONSUMELIMIT = 0x400, 60 | FIELDOPT_PARTYBOSSCHANGELIMIT = 0x800, 61 | FIELDOPT_NOMOBCAPACITYLIMIT = 0x1000, 62 | FIELDOPT_WEDDINGINVITATIONLIMIT = 0x2000, 63 | FIELDOPT_CASHWEATHERCONSUMELIMIT = 0x4000, 64 | FIELDOPT_NOPET = 0x8000, 65 | FIELDOPT_ANTIMACROLIMIT = 0x10000, 66 | FIELDOPT_FALLDOWNLIMIT = 0x20000, 67 | FIELDOPT_SUMMONNPCLIMIT = 0x40000, 68 | FIELDOPT_NOEXPDECREASE = 0x80000, 69 | FIELDOPT_NODAMAGEONFALLING = 0x100000, 70 | FIELDOPT_PARCELOPENLIMIT = 0x200000, 71 | FIELDOPT_DROPLIMIT = 0x400000 72 | } 73 | 74 | public enum FieldType //Credits to Koolk for about half of them and me for the rest 75 | { 76 | FIELDTYPE_DEFAULT = 0, 77 | FIELDTYPE_SNOWBALL = 1, 78 | FIELDTYPE_CONTIMOVE = 2, 79 | FIELDTYPE_TOURNAMENT = 3, 80 | FIELDTYPE_COCONUT = 4, 81 | FIELDTYPE_OXQUIZ = 5, 82 | FIELDTYPE_PERSONALTIMELIMIT = 6, 83 | FIELDTYPE_WAITINGROOM = 7, 84 | FIELDTYPE_GUILDBOSS = 8, 85 | FIELDTYPE_LIMITEDVIEW = 9, 86 | FIELDTYPE_MONSTERCARNIVAL = 0xA, 87 | FIELDTYPE_MONSTERCARNIVALREVIVE = 0xB, 88 | FIELDTYPE_ZAKUM = 0xC, 89 | FIELDTYPE_ARIANTARENA = 0xD, 90 | FIELDTYPE_DOJANG = 0xE, 91 | FIELDTYPE_MONSTERCARNIVAL_S2 = 0xF, 92 | FIELDTYPE_MONSTERCARNIVALWAITINGROOM = 0x10, 93 | FIELDTYPE_COOKIEHOUSE = 0x11, 94 | FIELDTYPE_BALROG = 0x12, 95 | FIELDTYPE_BATTLEFIELD = 0x13, 96 | FIELDTYPE_SPACEGAGA = 0x14, 97 | FIELDTYPE_WITCHTOWER = 0x15, 98 | FIELDTYPE_ARANTUTORIAL = 0x16, 99 | FIELDTYPE_MASSACRE = 0x17, 100 | FIELDTYPE_MASSACRE_RESULT = 0x18, 101 | FIELDTYPE_PARTYRAID = 0x19, 102 | FIELDTYPE_PARTYRAID_BOSS = 0x1A, 103 | FIELDTYPE_PARTYRAID_RESULT = 0x1B, 104 | FIELDTYPE_NODRAGON = 0x1C, 105 | FIELDTYPE_DYNAMICFOOTHOLD = 0x1D, 106 | FIELDTYPE_ESCORT = 0x1E, 107 | FIELDTYPE_ESCORT_RESULT = 0x1F, 108 | FIELDTYPE_HUNTINGADBALLOON = 0x20, 109 | FIELDTYPE_CHAOSZAKUM = 0x21, 110 | FIELDTYPE_KILLCOUNT = 0x22, 111 | FIELDTYPE_WEDDING = 0x3C, 112 | FIELDTYPE_WEDDINGPHOTO = 0x3D, 113 | FIELDTYPE_FISHINGKING = 0x4A, 114 | FIELDTYPE_SHOWABATH = 0x51, 115 | FIELDTYPE_BEGINNERCAMP = 0x52, 116 | FIELDTYPE_SNOWMAN = 1000, 117 | FIELDTYPE_SHOWASPA = 1001, 118 | FIELDTYPE_HORNTAILPQ = 1013, 119 | FIELDTYPE_CRIMSONWOODPQ = 1014 120 | } 121 | 122 | public static class PortalType //Credits to me and BluePoop 123 | { 124 | public const string PORTALTYPE_STARTPOINT = "sp", 125 | PORTALTYPE_INVISIBLE = "pi", 126 | PORTALTYPE_VISIBLE = "pv", 127 | PORTALTYPE_COLLISION = "pc", 128 | PORTALTYPE_CHANGABLE = "pg", 129 | PORTALTYPE_CHANGABLE_INVISIBLE = "pgi", 130 | PORTALTYPE_TOWNPORTAL_POINT = "tp", 131 | PORTALTYPE_SCRIPT = "ps", 132 | PORTALTYPE_SCRIPT_INVISIBLE = "psi", 133 | PORTALTYPE_COLLISION_SCRIPT = "pcs", 134 | PORTALTYPE_HIDDEN = "ph", 135 | PORTALTYPE_SCRIPT_HIDDEN = "psh", 136 | PORTALTYPE_COLLISION_VERTICAL_JUMP = "pcj", 137 | PORTALTYPE_COLLISION_CUSTOM_IMPACT = "pci", 138 | PORTALTYPE_COLLISION_UNKNOWN_PCIG = "pcig"; 139 | } 140 | 141 | public enum MapType 142 | { 143 | RegularMap, 144 | MapLogin, 145 | CashShopPreview 146 | } 147 | 148 | public enum BackgroundType 149 | { 150 | Regular = 0, 151 | HorizontalTiling = 1, 152 | VerticalTiling = 2, 153 | HVTiling = 3, 154 | HorizontalMoving = 4, 155 | VerticalMoving = 5, 156 | HorizontalMovingHVTiling = 6, 157 | VerticalMovingHVTiling = 7 158 | } 159 | } 160 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzStructure/Data/Enums.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79a9eaeb6dd7f82468738706be1add15 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzStructure/Foothold.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | 25 | namespace MapleLib.WzLib.WzStructure 26 | { 27 | public struct Foothold 28 | { 29 | public int x1, x2, y1, y2; 30 | public int prev, next; 31 | public int num, layer; 32 | 33 | public Foothold(int x1, int x2, int y1, int y2, int num, int layer) 34 | { 35 | this.x1 = x1; 36 | this.x2 = x2; 37 | this.y1 = y1; 38 | this.y2 = y2; 39 | next = 0; 40 | prev = 0; 41 | this.num = num; 42 | this.layer = layer; 43 | } 44 | 45 | public bool IsWall() 46 | { 47 | return x1 == x2; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzStructure/Foothold.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a18c05331f3875d478b3fbeeb40cf6ea 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzStructure/InfoTool.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Text; 24 | using MapleLib.WzLib; 25 | using MapleLib.WzLib.WzProperties; 26 | //using HaCreator.MapEditor; 27 | using MapleLib.WzLib.WzStructure; 28 | 29 | namespace MapleLib.WzLib.WzStructure 30 | { 31 | public static class InfoTool 32 | { 33 | public static string GetString(WzImageProperty source) 34 | { 35 | return source.GetString(); 36 | } 37 | 38 | public static WzStringProperty SetString(string value) 39 | { 40 | return new WzStringProperty("", value); 41 | } 42 | 43 | public static string GetOptionalString(WzImageProperty source) 44 | { 45 | return source == null ? null : source.GetString(); 46 | } 47 | 48 | public static WzStringProperty SetOptionalString(string value) 49 | { 50 | return value == null ? null : SetString(value); 51 | } 52 | 53 | public static double GetDouble(WzImageProperty source) 54 | { 55 | return source.GetDouble(); 56 | } 57 | 58 | public static WzDoubleProperty SetDouble(double value) 59 | { 60 | return new WzDoubleProperty("", value); 61 | } 62 | 63 | public static int GetInt(WzImageProperty source) 64 | { 65 | return source.GetInt(); 66 | } 67 | 68 | public static WzIntProperty SetInt(int value) 69 | { 70 | return new WzIntProperty("", value); 71 | } 72 | 73 | public static int? GetOptionalInt(WzImageProperty source) 74 | { 75 | return source == null ? (int?)null : source.GetInt(); 76 | } 77 | 78 | public static WzIntProperty SetOptionalInt(int? value) 79 | { 80 | return value.HasValue ? SetInt(value.Value) : null; 81 | } 82 | 83 | public static bool GetBool(WzImageProperty source) 84 | { 85 | return source.GetInt() == 1; 86 | } 87 | 88 | public static WzIntProperty SetBool(bool value) 89 | { 90 | return new WzIntProperty("", value ? 1 : 0); 91 | } 92 | 93 | public static MapleBool GetOptionalBool(WzImageProperty source) 94 | { 95 | if (source == null) return MapleBool.NotExist; 96 | else return source.GetInt() == 1; 97 | } 98 | 99 | public static WzIntProperty SetOptionalBool(MapleBool value) 100 | { 101 | return value.HasValue ? SetBool(value.Value) : null; 102 | } 103 | 104 | public static float GetFloat(WzImageProperty source) 105 | { 106 | return source.GetFloat(); 107 | } 108 | 109 | public static WzFloatProperty SetFloat(float value) 110 | { 111 | return new WzFloatProperty("", value); 112 | } 113 | 114 | public static float? GetOptionalFloat(WzImageProperty source) 115 | { 116 | return source == null ? (float?)null : source.GetFloat(); 117 | } 118 | 119 | public static WzFloatProperty SetOptionalFloat(float? value) 120 | { 121 | return value.HasValue ? SetFloat(value.Value) : null; 122 | } 123 | 124 | public static int? GetOptionalTranslatedInt(WzImageProperty source) 125 | { 126 | string str = InfoTool.GetOptionalString(source); 127 | if (str == null) return null; 128 | return int.Parse(str); 129 | } 130 | 131 | public static WzStringProperty SetOptionalTranslatedInt(int? value) 132 | { 133 | if (value.HasValue) 134 | { 135 | return SetString(value.Value.ToString()); 136 | } 137 | else 138 | { 139 | return null; 140 | } 141 | } 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzStructure/InfoTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5abbc4ef5dd428f439cf243490dcdf38 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzStructure/MapInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff9586d54d0487546a7bc7f12842f698 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzStructure/MapleBool.cs: -------------------------------------------------------------------------------- 1 | /* MapleLib - A general-purpose MapleStory library 2 | * 3 | * Copyright (C) 2009-2015 Snow and haha01haha01 4 | * Copyright (C) 2021-2024 Jen-Chieh Shen 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | using System; 21 | using System.Collections.Generic; 22 | using System.Linq; 23 | using System.Runtime.Serialization; 24 | using System.Text; 25 | 26 | namespace MapleLib.WzLib.WzStructure 27 | { 28 | [DataContract] 29 | public struct MapleBool //I know I could have used the nullable bool. 30 | { 31 | public const byte NotExist = 0; 32 | public const byte False = 1; 33 | public const byte True = 2; 34 | 35 | [DataMember] 36 | private byte val { get; set; } 37 | public static implicit operator MapleBool(byte value) 38 | { 39 | return new MapleBool 40 | { 41 | val = value 42 | }; 43 | } 44 | 45 | public static implicit operator MapleBool(bool? value) 46 | { 47 | return new MapleBool 48 | { 49 | val = value == null ? MapleBool.NotExist : (bool)value ? MapleBool.True : MapleBool.False 50 | }; 51 | } 52 | 53 | public static implicit operator bool(MapleBool value) 54 | { 55 | return value == MapleBool.True; 56 | } 57 | 58 | public static implicit operator byte(MapleBool value) 59 | { 60 | return value.val; 61 | } 62 | 63 | public override bool Equals(object obj) 64 | { 65 | return obj is MapleBool ? ((MapleBool)obj).val.Equals(val) : false; 66 | } 67 | 68 | public override int GetHashCode() 69 | { 70 | return val.GetHashCode(); 71 | } 72 | 73 | public static bool operator ==(MapleBool a, MapleBool b) 74 | { 75 | return a.val.Equals(b.val); 76 | } 77 | 78 | public static bool operator ==(MapleBool a, bool b) 79 | { 80 | return (b && (a.val == MapleBool.True)) || (!b && (a.val == MapleBool.False)); 81 | } 82 | 83 | public static bool operator !=(MapleBool a, MapleBool b) 84 | { 85 | return !a.val.Equals(b.val); 86 | } 87 | 88 | public static bool operator !=(MapleBool a, bool b) 89 | { 90 | return (b && (a.val != MapleBool.True)) || (!b && (a.val != MapleBool.False)); 91 | } 92 | 93 | public bool HasValue 94 | { 95 | get 96 | { 97 | return val != NotExist; 98 | } 99 | } 100 | 101 | public bool Value 102 | { 103 | get 104 | { 105 | switch (val) 106 | { 107 | case False: 108 | return false; 109 | case True: 110 | return true; 111 | case NotExist: 112 | default: 113 | throw new Exception("Tried to get value of nonexistant MapleBool"); 114 | } 115 | } 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /Assets/WzLib/Scripts/WzLib/WzStructure/MapleBool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8bc71db1e2970c4aae06678cb86869b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. 6 | 7 | 8 | ## 0.1.3 (Unreleased) 9 | > Released N/A 10 | 11 | * N/A 12 | 13 | ## 0.1.2 14 | > Released Apr 13, 2021 15 | 16 | * Add audio player for `Sound.wz` file. 17 | 18 | ## 0.1.1 19 | > Released Apr 12, 2021 20 | 21 | * Fix `System.Drawing.dll` path. 22 | 23 | ## 0.1.0 24 | > Released Apr 9, 2021 25 | 26 | * Initial release. 27 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ai.navigation": "2.0.0", 4 | "com.unity.collab-proxy": "2.4.3", 5 | "com.unity.ide.rider": "3.0.28", 6 | "com.unity.ide.visualstudio": "2.0.22", 7 | "com.unity.test-framework": "1.4.4", 8 | "com.unity.timeline": "1.8.7", 9 | "com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.9", 10 | "com.unity.ugui": "2.0.0", 11 | "com.unity.visualscripting": "1.9.4", 12 | "com.unity.modules.accessibility": "1.0.0", 13 | "com.unity.modules.ai": "1.0.0", 14 | "com.unity.modules.androidjni": "1.0.0", 15 | "com.unity.modules.animation": "1.0.0", 16 | "com.unity.modules.assetbundle": "1.0.0", 17 | "com.unity.modules.audio": "1.0.0", 18 | "com.unity.modules.cloth": "1.0.0", 19 | "com.unity.modules.director": "1.0.0", 20 | "com.unity.modules.imageconversion": "1.0.0", 21 | "com.unity.modules.imgui": "1.0.0", 22 | "com.unity.modules.jsonserialize": "1.0.0", 23 | "com.unity.modules.particlesystem": "1.0.0", 24 | "com.unity.modules.physics": "1.0.0", 25 | "com.unity.modules.physics2d": "1.0.0", 26 | "com.unity.modules.screencapture": "1.0.0", 27 | "com.unity.modules.terrain": "1.0.0", 28 | "com.unity.modules.terrainphysics": "1.0.0", 29 | "com.unity.modules.tilemap": "1.0.0", 30 | "com.unity.modules.ui": "1.0.0", 31 | "com.unity.modules.uielements": "1.0.0", 32 | "com.unity.modules.umbra": "1.0.0", 33 | "com.unity.modules.unityanalytics": "1.0.0", 34 | "com.unity.modules.unitywebrequest": "1.0.0", 35 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 36 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 37 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 38 | "com.unity.modules.unitywebrequestwww": "1.0.0", 39 | "com.unity.modules.vehicles": "1.0.0", 40 | "com.unity.modules.video": "1.0.0", 41 | "com.unity.modules.vr": "1.0.0", 42 | "com.unity.modules.wind": "1.0.0", 43 | "com.unity.modules.xr": "1.0.0" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /ProjectSettings/MultiplayerManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!655991488 &1 4 | MultiplayerManager: 5 | m_ObjectHideFlags: 0 6 | m_EnableMultiplayerRoles: 0 7 | m_ActiveMultiplayerRole: 0 8 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_UserSelectedRegistryName: 29 | m_UserAddingNewScopedRegistry: 0 30 | m_RegistryInfoDraft: 31 | m_ErrorMessage: 32 | m_Original: 33 | m_Id: 34 | m_Name: 35 | m_Url: 36 | m_Scopes: [] 37 | m_IsDefault: 0 38 | m_Capabilities: 0 39 | m_Modified: 0 40 | m_Name: 41 | m_Url: 42 | m_Scopes: 43 | - 44 | m_SelectedScopeIndex: 0 45 | m_LoadAssets: 0 46 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 6000.0.11f1 2 | m_EditorVersionWithRevision: 6000.0.11f1 (fa01dd6b76d5) 3 | -------------------------------------------------------------------------------- /ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "ignore": false, 8 | "defaultInstantiationMode": 0, 9 | "supportsModification": true 10 | }, 11 | { 12 | "userAdded": false, 13 | "type": "UnityEditor.Animations.AnimatorController", 14 | "ignore": false, 15 | "defaultInstantiationMode": 0, 16 | "supportsModification": true 17 | }, 18 | { 19 | "userAdded": false, 20 | "type": "UnityEngine.AnimatorOverrideController", 21 | "ignore": false, 22 | "defaultInstantiationMode": 0, 23 | "supportsModification": true 24 | }, 25 | { 26 | "userAdded": false, 27 | "type": "UnityEditor.Audio.AudioMixerController", 28 | "ignore": false, 29 | "defaultInstantiationMode": 0, 30 | "supportsModification": true 31 | }, 32 | { 33 | "userAdded": false, 34 | "type": "UnityEngine.ComputeShader", 35 | "ignore": true, 36 | "defaultInstantiationMode": 1, 37 | "supportsModification": true 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEngine.Cubemap", 42 | "ignore": false, 43 | "defaultInstantiationMode": 0, 44 | "supportsModification": true 45 | }, 46 | { 47 | "userAdded": false, 48 | "type": "UnityEngine.GameObject", 49 | "ignore": false, 50 | "defaultInstantiationMode": 0, 51 | "supportsModification": true 52 | }, 53 | { 54 | "userAdded": false, 55 | "type": "UnityEditor.LightingDataAsset", 56 | "ignore": false, 57 | "defaultInstantiationMode": 0, 58 | "supportsModification": false 59 | }, 60 | { 61 | "userAdded": false, 62 | "type": "UnityEngine.LightingSettings", 63 | "ignore": false, 64 | "defaultInstantiationMode": 0, 65 | "supportsModification": true 66 | }, 67 | { 68 | "userAdded": false, 69 | "type": "UnityEngine.Material", 70 | "ignore": false, 71 | "defaultInstantiationMode": 0, 72 | "supportsModification": true 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEditor.MonoScript", 77 | "ignore": true, 78 | "defaultInstantiationMode": 1, 79 | "supportsModification": true 80 | }, 81 | { 82 | "userAdded": false, 83 | "type": "UnityEngine.PhysicMaterial", 84 | "ignore": false, 85 | "defaultInstantiationMode": 0, 86 | "supportsModification": true 87 | }, 88 | { 89 | "userAdded": false, 90 | "type": "UnityEngine.PhysicsMaterial2D", 91 | "ignore": false, 92 | "defaultInstantiationMode": 0, 93 | "supportsModification": true 94 | }, 95 | { 96 | "userAdded": false, 97 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 98 | "ignore": false, 99 | "defaultInstantiationMode": 0, 100 | "supportsModification": true 101 | }, 102 | { 103 | "userAdded": false, 104 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 105 | "ignore": false, 106 | "defaultInstantiationMode": 0, 107 | "supportsModification": true 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Rendering.VolumeProfile", 112 | "ignore": false, 113 | "defaultInstantiationMode": 0, 114 | "supportsModification": true 115 | }, 116 | { 117 | "userAdded": false, 118 | "type": "UnityEditor.SceneAsset", 119 | "ignore": false, 120 | "defaultInstantiationMode": 0, 121 | "supportsModification": false 122 | }, 123 | { 124 | "userAdded": false, 125 | "type": "UnityEngine.Shader", 126 | "ignore": true, 127 | "defaultInstantiationMode": 1, 128 | "supportsModification": true 129 | }, 130 | { 131 | "userAdded": false, 132 | "type": "UnityEngine.ShaderVariantCollection", 133 | "ignore": true, 134 | "defaultInstantiationMode": 1, 135 | "supportsModification": true 136 | }, 137 | { 138 | "userAdded": false, 139 | "type": "UnityEngine.Texture", 140 | "ignore": false, 141 | "defaultInstantiationMode": 0, 142 | "supportsModification": true 143 | }, 144 | { 145 | "userAdded": false, 146 | "type": "UnityEngine.Texture2D", 147 | "ignore": false, 148 | "defaultInstantiationMode": 0, 149 | "supportsModification": true 150 | }, 151 | { 152 | "userAdded": false, 153 | "type": "UnityEngine.Timeline.TimelineAsset", 154 | "ignore": false, 155 | "defaultInstantiationMode": 0, 156 | "supportsModification": true 157 | } 158 | ], 159 | "defaultDependencyTypeInfo": { 160 | "userAdded": false, 161 | "type": "", 162 | "ignore": false, 163 | "defaultInstantiationMode": 1, 164 | "supportsModification": true 165 | }, 166 | "newSceneOverride": 0 167 | } -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | UnityAdsSettings: 27 | m_Enabled: 0 28 | m_InitializeOnStartup: 1 29 | m_TestMode: 0 30 | m_IosGameId: 31 | m_AndroidGameId: 32 | m_GameIds: {} 33 | m_GameId: 34 | PerformanceReportingSettings: 35 | m_Enabled: 0 36 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-green.svg)](https://www.gnu.org/licenses/gpl-3.0) 4 | [![Unity Engine](https://img.shields.io/badge/unity-6000.0.11f1-black.svg?style=flat&logo=unity)](https://unity3d.com/get-unity/download/archive) 5 | [![.NET 4.x Scripting Runtime](https://img.shields.io/badge/.NET-4.x-blueviolet.svg?style=flat)](https://docs.unity3d.com/2018.3/Documentation/Manual/ScriptingRuntimeUpgrade.html) 6 | [![Release](https://img.shields.io/github/release/MapleStoryUnity/UnityWzLib.svg?logo=github)](https://github.com/MapleStoryUnity/UnityWzLib/releases/latest) 7 | 8 | # WzLib For Unity 9 | 10 | [![License](https://github.com/MapleStoryUnity/UnityWzLib/actions/workflows/license.yml/badge.svg)](https://github.com/MapleStoryUnity/UnityWzLib/actions/workflows/license.yml) 11 | [![Build](https://github.com/MapleStoryUnity/UnityWzLib/actions/workflows/build.yml/badge.svg)](https://github.com/MapleStoryUnity/UnityWzLib/actions/workflows/build.yml) 12 | [![Package](https://github.com/MapleStoryUnity/UnityWzLib/actions/workflows/package.yml/badge.svg)](https://github.com/MapleStoryUnity/UnityWzLib/actions/workflows/package.yml) 13 | 14 | ## 💾 Installation 15 | 16 | 1. Download the `.unitypackage` from the release page [here](https://github.com/MapleStoryUnity/UnityWzLib/releases) 17 | 2. Open Unity and import the `UnityWzLib_X.X.X.unitypackage` to your project. 18 | 19 | ## 📌 Dependencies 20 | 21 | - [WzLib](https://github.com/hadeutscher/MapleLib) by @hadeutscher 22 | - [NAudio-Unity](https://github.com/WulfMarius/NAudio-Unity) by @WulfMarius 23 | 24 | ## ⚜️ License 25 | 26 | This program is free software: you can redistribute it and/or modify it under 27 | the terms of the GNU General Public License as published by the Free Software 28 | Foundation, either version 3 of the License, or (at your option) any later 29 | version. 30 | 31 | This program is distributed in the hope that it will be useful, but WITHOUT ANY 32 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 33 | PARTICULAR PURPOSE. See the GNU General Public License for more details. 34 | 35 | You should have received a copy of the GNU General Public License along with 36 | this program. If not, see https://www.gnu.org/licenses/. 37 | 38 | See 39 | [COPYING](https://github.com/MapleStoryUnity/UnityWzLib/blob/master/COPYING) 40 | for details. 41 | -------------------------------------------------------------------------------- /UserSettings/EditorUserSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!162 &1 4 | EditorUserSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_ConfigSettings: 8 | RecentlyUsedScenePath-0: 9 | value: 22424703114646680e0b0227036c6c111b07142f1f2b233e2867083debf42d 10 | flags: 0 11 | RecentlyUsedScenePath-1: 12 | value: 224247031146466c172205205f105c1518120b65082d2b3f633c133af6f9 13 | flags: 0 14 | lightmappingBakingProfile: 15 | value: 51 16 | flags: 0 17 | vcSharedLogLevel: 18 | value: 0d5e400f0650 19 | flags: 0 20 | m_VCAutomaticAdd: 1 21 | m_VCDebugCom: 0 22 | m_VCDebugCmd: 0 23 | m_VCDebugOut: 0 24 | m_SemanticMergeMode: 2 25 | m_DesiredImportWorkerCount: 6 26 | m_StandbyImportWorkerCount: 2 27 | m_IdleImportWorkerShutdownDelay: 60000 28 | m_VCShowFailedCheckout: 1 29 | m_VCOverwriteFailedCheckoutAssets: 1 30 | m_VCProjectOverlayIcons: 1 31 | m_VCHierarchyOverlayIcons: 1 32 | m_VCOtherOverlayIcons: 1 33 | m_VCAllowAsyncUpdate: 1 34 | m_ArtifactGarbageCollection: 1 35 | m_CompressAssetsOnImport: 1 36 | -------------------------------------------------------------------------------- /UserSettings/Search.settings: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /etc/Wizet_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MapleStoryUnity/UnityWzLib/2f2295dbb89c1d281c014b1f610f43068f43a855/etc/Wizet_Logo.png --------------------------------------------------------------------------------