7 Commits

Author SHA1 Message Date
Stephen Triche
612cfe22d9 Merged in TorqMySqlFix (pull request #78)
Addresses issues new people have been having running project on Windows 10 and Windows 11

Approved-by: Joe Lin
2024-12-12 03:36:08 +00:00
striche
1e311904cc Addressed issues where users on Windows 10 and Windows 11 were having issues running running the project.
1) Updated all projects to .NET Framework 4.7.2. This was a necessary prerequisite for the core fix.

2) The core fix is to upgrade the version of MySql.Data to address an error when opening connections. There is some kind of nuget issue with updating to the latest version (8.0.32) so fell back to updating to version 8.0.31. This also causes the addition of several all dependant libraries. Opted to just keep those at whatever version was specified by MySql.Data for now.

3) With the upgrade to MySql.Data, there is a behavioral change with the way the .Prepare statemenet works, and now it's required that parameters be added BEFORE calling .Prepare. So I've maded adjustments to the calls to .Prepare.
2023-02-04 16:35:15 -06:00
Robert Baker
8ceee35492 Batch script to copy all files for postbuild -- Reiichi001 2022-11-18 16:34:37 +00:00
Filip Maj
40b677f871 README.md edited online with Bitbucket 2022-11-18 16:31:52 +00:00
Robert Baker
57e7ee1894 Merged in Robert-Baker/importbat-had-a-line-missing-password-fi-1590334814488 (pull request #71)
import.bat had a line missing %PASSWORD% field for importing SQL files.

Approved-by: Filip Maj
2022-01-20 03:15:59 +00:00
PW Anon
61069e6d49 Merged in issue-21 (pull request #69)
Fix to Character Name Reservation

* Ported over changes from resharc/ffxiv-classic-server and merged into new branch.


Approved-by: Filip Maj
2022-01-20 03:15:31 +00:00
Filip Maj
0521b167fb README.md edited online with Bitbucket 2021-03-24 19:58:16 +00:00
68 changed files with 1377 additions and 7562 deletions

View File

@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Meteor.Common</RootNamespace> <RootNamespace>Meteor.Common</RootNamespace>
<AssemblyName>Meteor.Common</AssemblyName> <AssemblyName>Meteor.Common</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile> <TargetFrameworkProfile>
</TargetFrameworkProfile> </TargetFrameworkProfile>
@@ -59,21 +59,49 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="DotNetZip"> <Reference Include="DotNetZip">
<HintPath>..\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll</HintPath> <HintPath>..\packages\DotNetZip.1.10.1\lib\net20\DotNetZip.dll</HintPath>
</Reference> </Reference>
<Reference Include="MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath>
<Private>True</Private> </Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=8.0.31.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.8.0.31\lib\net452\MySql.Data.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.0\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.5.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" /> <Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" /> <Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" /> <Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" /> <Reference Include="System.Transactions" />
@@ -83,6 +111,9 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="ZstdNet, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.8.0.31\lib\net452\ZstdNet.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="BasePacket.cs" /> <Compile Include="BasePacket.cs" />

View File

@@ -267,15 +267,7 @@ namespace Meteor.Common
public static string ReadNullTermString(BinaryReader reader, int maxSize = 0x20) public static string ReadNullTermString(BinaryReader reader, int maxSize = 0x20)
{ {
byte[] str = reader.ReadBytes(maxSize); return Encoding.ASCII.GetString(reader.ReadBytes(maxSize)).Trim(new[] { '\0' });
int i;
for (i = 0; i <= str.Length; i++)
{
if (str[i] == 0)
break;
}
return Encoding.ASCII.GetString(str, 0, i);
} }
public static void WriteNullTermString(BinaryWriter writer, string value, int maxSize = 0x20) public static void WriteNullTermString(BinaryWriter writer, string value, int maxSize = 0x20)

View File

@@ -1,9 +1,13 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<system.data>
<DbProviderFactories> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup>
<remove invariant="MySql.Data.MySqlClient"/> <runtime>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
</DbProviderFactories> <dependentAssembly>
</system.data> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration> <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -1,6 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="DotNetZip" version="1.10.1" targetFramework="net45" /> <package id="DotNetZip" version="1.10.1" targetFramework="net45" />
<package id="MySql.Data" version="6.9.8" targetFramework="net45" /> <package id="Google.Protobuf" version="3.19.4" targetFramework="net472" />
<package id="K4os.Compression.LZ4" version="1.2.6" targetFramework="net472" />
<package id="K4os.Compression.LZ4.Streams" version="1.2.6" targetFramework="net472" />
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net472" />
<package id="MySql.Data" version="8.0.31" targetFramework="net472" />
<package id="NLog" version="4.5.0" targetFramework="net451" /> <package id="NLog" version="4.5.0" targetFramework="net451" />
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" />
</packages> </packages>

View File

@@ -1,8 +0,0 @@
---Iron Lake---
l'wonjhali
wymar
aylufa
ignemortel
ironlake battlewarden
storm sargeant nolan

110
Data/postbuild_copy.bat Normal file
View File

@@ -0,0 +1,110 @@
@ECHO OFF
REM SETLOCAL
SET CWD = %~dp0
REM Echo Launch dir: "%~dp0"
REM Echo Current dir: "%CD%"
REM =============
REM COPY LOBBY CONFIG
REM =============
REM Required files: lobby_config.ini
SET /a foundlfolders = 0
if exist "%~dp0\..\Lobby Server\bin\Debug" (
SET /a foundlfolders = %foundlfolders% + 1
echo Found Lobby Debug build folder.
echo Copying lobby_config.ini if needed...
xcopy lobby_config.ini "%~dp0\..\Lobby Server\bin\Debug\" /d /y /q
)
if exist "%~dp0\..\Lobby Server\bin\Release" (
SET /a foundlfolders = %foundlfolders% + 1
echo Found Lobby Release build folder.
echo Copying lobby_config.ini if needed...
xcopy lobby_config.ini "%~dp0\..\Lobby Server\bin\Release\" /d /y /q
)
if %foundlfolders% LSS 1 (
echo Could not find debug or release folder for the Lobby server. Please compile the project first!
)
REM =============
REM COPY WORLD CONFIG
REM =============
REM Required files: world_config.ini
SET /a foundwfolders = 0
if exist "%~dp0\..\World Server\bin\Debug" (
SET /a foundwfolders = %foundwfolders% + 1
echo Found World Debug build folder.
echo Copying world_config.ini if needed...
xcopy world_config.ini "%~dp0\..\World Server\bin\Debug\" /d /y /q
)
if exist "%~dp0\..\World Server\bin\Release" (
SET /a foundwfolders = %foundwfolders% + 1
echo Found World Release build folder.
echo Copying world_config.ini if needed...
xcopy world_config.ini "%~dp0\..\World Server\bin\Release\" /d /y /q
)
if %foundwfolders% LSS 1 (
echo Could not find debug or release folder for the World server. Please compile the project first!
)
REM =============
REM COPY MAP CONFIG
REM =============
REM Required files: map_config.ini staticactors.bin scripts/
SET /a foundmfolders = 0
if exist "%~dp0\..\Map Server\bin\Debug" (
SET /a foundmfolders = %foundmfolders% + 1
echo Found Map Debug build folder.
echo Copying map_config.ini if needed...
xcopy map_config.ini "%~dp0\..\Map Server\bin\Debug\" /d /y /q
if exist staticactors.bin (
echo Copying staticactors.bin if needed...
xcopy staticactors.bin "%~dp0\..\Map Server\bin\Debug\" /d /y /q
) else (
echo Cannot copy the staticactors.bin file because it doesn't exist in data\
)
echo Copying scripts folder if needed...
xcopy scripts "%~dp0\..\Map Server\bin\Debug\scripts\" /e /d /y /s /q
)
if exist "%~dp0\..\Map Server\bin\Release" (
SET /a foundmfolders = %foundmfolders% + 1
echo Found Map Release build folder.
echo Copying map_config.ini if needed...
xcopy map_config.ini "%~dp0\..\Map Server\bin\Release\" /d /y /q
if exist staticactors.bin (
echo Copying staticactors.bin if needed...
xcopy staticactors.bin "%~dp0\..\Map Server\bin\Release\" /d /y /q
) else (
echo Cannot copy the staticactors.bin file because it doesn't exist in data\
)
echo Copying scripts folder if needed...
xcopy scripts "%~dp0\..\Map Server\bin\Release\scripts\" /e /d /y /s /q
)
if %foundmfolders% LSS 1 (
echo Could not find debug or release folder for the Map server. Please compile the project first!
)
Pause

View File

@@ -13,7 +13,8 @@ loadTextData()
start(facility, requestsMode, material1, material2, material3, material4, material5, material6, material7, material8) start(facility, requestsMode, material1, material2, material3, material4, material5, material6, material7, material8)
Desc: Opens the Craft Start widget, with any preloaded materials. Widget has two modes; one for normal synthesis and another Desc: Opens the Craft Start widget, with any preloaded materials. Widget has two modes; one for normal synthesis and another
for local leve "requested items" mode. for local leve "requested items" mode.
Params: * facility - The current facility id buff the player may have. Params: * facility/widgetMode - The current facility id buff the player may have. After opening a recipe tab, start() has to be called with this
set to -1. After the player chooses a recipe, start() has to be called with this set to -2.
* requestMode - If true, switches the UI to Requested Items mode otherwise it opens Normal Synthesis mode. * requestMode - If true, switches the UI to Requested Items mode otherwise it opens Normal Synthesis mode.
* material1-8 - ItemID for each of the 8 material slots. If empty, they must be set to 0 or the client will crash. * material1-8 - ItemID for each of the 8 material slots. If empty, they must be set to 0 or the client will crash.
@@ -21,10 +22,9 @@ closeCraftStartWidget()
Desc: Closes the Craft Start widget. Desc: Closes the Craft Start widget.
Params: None Params: None
selectRcp(itemId) selectRcp(item1, item2, item3, item4, item5, item6, item7, item8)
Desc: Selects the recipe to be crafted. May be a legacy function but still required to properly initialize the UI. Requires start() to have Desc: Opens a recipe selection window. If one recipe is provided, automatically selects that recipe.
been called. Params: * itemId1-8 - The itemIDs to show in the list. If only one provided, select it.
Params: * itemId - The itemID of the item to be crafted.
confirmRcp(craftedItem, quantity, crystalItem1, crystalQuantity1, crystalQuantity1, crystalItem2, crystalQuantity2, recommendedSkill, recommendedFacility) confirmRcp(craftedItem, quantity, crystalItem1, crystalQuantity1, crystalQuantity1, crystalItem2, crystalQuantity2, recommendedSkill, recommendedFacility)
Desc: Opens the confirmation window, detailing what is needed and the item that will be created. Requires a selectRcp() call first. Desc: Opens the confirmation window, detailing what is needed and the item that will be created. Requires a selectRcp() call first.
@@ -41,6 +41,17 @@ selectCraftQuest()
Desc: Opens the journal to select the local leve that the player would like to do. Desc: Opens the journal to select the local leve that the player would like to do.
Params: None Params: None
confirmLeve()
Desc: Opens the summery page for the local leve.
Params: * localLeveID -
* craftedItem -
* ?
* ?
* itemsCompleted -
* remainingMaterials -
* ?
* ?
askContinueLocalLeve(localLeveID, craftedItem, itemsCompleted, craftTotal, attempts) askContinueLocalLeve(localLeveID, craftedItem, itemsCompleted, craftTotal, attempts)
Desc: Opens the dialog to continue crafting for a local leve after an item was completed. Desc: Opens the dialog to continue crafting for a local leve after an item was completed.
Params: * localLeveID - The id of the current leve in progress. Params: * localLeveID - The id of the current leve in progress.
@@ -68,7 +79,7 @@ craftCommandUI(classID, hasWait, command1, command2, command3, command4, command
* command1-5 - Five possible crafting commands (crafting skills). * command1-5 - Five possible crafting commands (crafting skills).
craftTuningUI(command1, command2, command3, command4, command5, command6, command7, command8) craftTuningUI(command1, command2, command3, command4, command5, command6, command7, command8)
Desc: Displays a full list of commands for the legacy "Tuning" phase that happens after crafting. Deprecated in 1.23b. Desc: Displays only the provided commands for the "Double Down" phase that happens after crafting.
Params: * command1-8 - The list of commands available. Params: * command1-8 - The list of commands available.
updateInfo(progress, durability, quality, tuningItem, tuningItemQuality, tuningItemQuantity, hqChance) updateInfo(progress, durability, quality, tuningItem, tuningItemQuality, tuningItemQuantity, hqChance)
@@ -89,17 +100,6 @@ cfmQst()
Desc: Quest confirmation window for when starting a crafting quest from the journal. Desc: Quest confirmation window for when starting a crafting quest from the journal.
Params: Params:
confirmLeve()
Desc: Opens the summery page for the local leve.
Params: * localLeveID - The quest id of the leve you are confirming.
* difficulty - Changes the objective.
* craftedItem? -
* ? -
* numSuccess - The number of successful crafts you did.
* remainingMaterials - The number of materials you have left.
* hasMaterials - Shows the in-progress panel of successes and attempts left.
* ? -
startRepair(craftMode, item, quality, durability, hasMateria, spiritbind) startRepair(craftMode, item, quality, durability, hasMateria, spiritbind)
Desc: Opens the repair item widget. Desc: Opens the repair item widget.
Params: * craftMode - Either 0 or 1. Anything else crashes. Params: * craftMode - Either 0 or 1. Anything else crashes.
@@ -133,292 +133,214 @@ Class ID + Starting skill
35 ALC = 22586 35 ALC = 22586
36 CUL = 22592 36 CUL = 22592
Leve objectives/rewards are in passiveGL_craft.
* Index 1:
* Index 2: Recommended Class
* Index 3: Issuing Authority
* Index 7: Levequest Location
* Index 8: Deliver Display Name
* Starts at index 14. Four sections for the four difficulties.
* Required Item, Amount, ?, Recommended Level, , Reward Item, Reward Amount, |
--]] --]]
require ("global") require ("global")
local skillAnim = {
skillAnim = {
[22553] = 0x10002000; [22553] = 0x10002000;
[22554] = 0x10001000; [22554] = 0x10001000;
[22555] = 0x10003000; [22555] = 0x10003000;
[29531] = 0x10009002; [29531] = 0x10009002;
} }
local craftStartWidgetOpen = false;
materialSlots = {0,0,0,0,0,0,0,0}; -- The 8 slots
recentRecipe = {10008205, 4030706, 4070009} -- Recent Recipe list
awardedRecipe = {7020105, 7030011} -- Awarded Recipe list
materialRecipe = { -- Always 8 params because we can't have any nils here for "start" command
[6071007] = {4070402, 4070309,0,0,0,0,0,0},
[10008205] = {10008005,10008005,0,0,0,0,0,0},
[10009617] = {4040009, 4040010, 4040011,0,0,0,0,0},
[4070009] = {4070006, 10005401, 10008203,0,0,0,0,0},
[4070010] = {10008204,10008106,10005302,0,0,0,0,0}
}
materialQuest = { -- What a quest or leve will preload slots with, in addition to any extras the player does manual
[0] = {0,0,0,0,0,0,0,0},
[1] = {0,0,0,0,0,0,0,0},
[110442] = {11000075, 11000074, 0, 0, 0, 0, 0, 0}
}
function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, checkedActorId) function onEventStarted(player, commandactor, triggerName, arg1, arg2, arg3, arg4, checkedActorId)
local MENU_CANCEL, MENU_MAINHAND, MENU_OFFHAND, MENU_REQUEST = 0, 1, 2, 3;
local MENU_RECENT, MENU_AWARDED, MENU_RECENT_DETAILED, MENU_AWARDED_DETAILED = 7, 8, 9, 10;
local debugMessage = true; MENU_CANCEL, MENU_MAINHAND, MENU_OFFHAND, MENU_REQUEST = 0, 1, 2, 3;
MENU_RECIPE, MENU_AWARDED, MENU_RECIPE_DETAILED, MENU_AWARDED_DETAILED = 7, 8, 9, 10;
local isRecipeRecentSent = false; debugMessage = false;
local isRecipeAwardSent = false;
local craftJudge = GetStaticActor("CraftJudge"); isRecipeRecentSent = false;
local recipeResolver = GetRecipeResolver(); isRecipeAwardSent = false;
detailWindow = true;
local operationResult; isRequested = false; -- False = The default state. True = User picked a quest recipe/local leve
local operationMode = -1; facilityId = 0;
local recipeMode = -1; chosenQuest = 0; -- Use this to store any chosen recipe/local leve
local chosenMaterials; recipeDetail = 0;
detailWindowState = 0;
local facilityId = 0;
local isRequestedItemsMode = false; -- False = The default state. True = User picked a quest recipe/local leve
local recentRecipes;
local awardedRecipes;
local currentCraftQuest = nil; -- Use this to store any chosen craft quest
local currentCraftQuestGuildleve = nil; -- Use this to store any chosen local leve
craftJudge = GetStaticActor("CraftJudge");
callClientFunction(player, "delegateCommand", craftJudge, "loadTextData", commandactor); callClientFunction(player, "delegateCommand", craftJudge, "loadTextData", commandactor);
chosenOperation = -1;
while chosenOperation ~= 0 do
player:ChangeState(30); player:ChangeState(30);
while operationMode ~= 0 do if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Menu ID: "..tostring(chosenOperation).." Recipe : "..tostring(recipeMode).." Quest : "..chosenQuest); end
-- Operate the start crafting window... confusing shit
if (craftStartWidgetOpen == false) then if materialQuest[chosenQuest] then
-- Shows the initial window if debugMessage then player:SendMessage(0x20, "", "Key is valid: "..chosenQuest); end
local startMats = {0, 0, 0, 0, 0, 0, 0, 0}; materialSlots = materialQuest[chosenQuest];
if (isRequestedItemsMode == true) then -- If requested items, preload the quest recipe materials
startMats = recipeResolver.RecipeToMatIdTable(currentCraftQuestGuildleve.getRecipe());
end
operationResult = {callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, facilityId, isRequestedItemsMode, unpack(startMats))};
craftStartWidgetOpen = true;
elseif ((operationMode == MENU_RECENT or operationMode == MENU_AWARDED) and recipeMode != 0) then
local prepedMaterials;
-- Recent Recipes/Awarded Recipes
if (operationMode == MENU_RECENT) then
prepedMaterials = recipeResolver.RecipeToMatIdTable(recentRecipes[recipeMode]);
else else
prepedMaterials = recipeResolver.RecipeToMatIdTable(awardedRecipes[recipeMode]); if debugMessage then player:SendMessage(0x20, "", "Key is not valid: "..chosenQuest); end
end end
-- Causes the item info window to appear for recent/awarded recipes. Only happens if a recipe was chosen.
operationResult = {callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -2, isRequestedItemsMode, unpack(prepedMaterials))};
if isRecipeRecentSent == false then -- If Recipe button not hit, aka default state.
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, facilityId, isRequested, unpack(materialSlots)); -- Initial window
elseif isRecipeRecentSent == true and recipeMode == 0 then -- If recipe window/award tab was hit
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -1, isRequested, unpack(materialSlots)); -- Keep window going
elseif isRecipeRecentSent == true and recipeMode > 0 then -- If recipe item picked
if recipeDetail then
chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -2, isRequested, unpack(recipeDetail)); -- Item mat(s) for picked item.
else else
-- Keep window going if the user "returned" to the starting point chosenOperation, recipeMode = callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -2, isRequested, 10009617,0,0,0,0,0,0,0); -- Show dummy info for unfilled item
operationResult = {callClientFunction(player, "delegateCommand", craftJudge, "start", commandactor, -1, isRequestedItemsMode)}; end
end end
operationMode = operationResult[1];
recipeMode = operationResult[2];
if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Menu ID: " .. tostring(operationMode) .. ", RecipeMode : " .. recipeMode); end if chosenOperation == MENU_CANCEL then
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
-- Operation
if operationMode == MENU_CANCEL then
closeCraftStartWidget(player, craftJudge, commandactor);
elseif (operationMode == MENU_MAINHAND or operationMode == MENU_OFFHAND) then
-- Recipe choosing loop
while (true) do
-- Figure out the number of preloaded mats
local numArgs = #operationResult;
local numMatArgs = numArgs - 2;
local materials;
player:SendMessage(0x20, "", "[DEBUG] " .. tostring(numArgs));
player:SendMessage(0x20, "", "[DEBUG] " .. tostring(numMatArgs));
-- Handle the possible args returned: Either 0 player items, 1 player item, 2+ palyer items. The rest is always the remaining prepped items. elseif (chosenOperation == MENU_MAINHAND or chosenOperation == MENU_OFFHAND) then
if (numMatArgs == 8 and type(operationResult[3]) == "number") then
materials = {unpack(operationResult, 3)}; if isRequested == true then
elseif (numMatArgs == 8 and type(operationResult[3]) ~= "number") then recipeResult = callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, 10009617);
player:SendMessage(0x20, "", "[DEBUG] " .. tostring(player:GetItemPackage(operationResult[3].itemPackage):GetItemAtSlot(operationResult[3].slot).itemId));
materials = {player:GetItemPackage(operationResult[3].itemPackage):GetItemAtSlot(operationResult[3].slot).itemId, unpack(operationResult, 3)};
else else
local itemIds = {}; recipeResult = callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, 10009617,6071007,5030112,5030007,10009617,6071007,5030112,5030007);
for i=0,operationResult[3].itemSlots.length do
converted = player:GetItemPackage(operationResult[3].itemPackages[i]):GetItemAtSlot(operationResult[3].slots[i]).itemId
end
materials = {unpack(itemIds), unpack(operationResult, 4)};
end end
-- Choosing a recipe from the given materials if recipeResult == 0 then -- Closed/Return hit.
local recipes = recipeResolver.GetRecipeFromMats(unpack(materials)); callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
local itemIds = recipeResolver.RecipesToItemIdTable(recipes); currentlyCrafting = -1;
-- No recipes found elseif (recipeResult >= 1 or recipeResult <= 8) then
if (#itemIds == 0) then --item yld, xstal1, qty, xstal2, qty
player:SendGameMessage(GetWorldMaster(), 40201, 0x20); -- You cannot synthesize with those materials. recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor, 10009617, 1, 0xF4247, 1, 0xf4245, 1, 0, 0);
break;
end
local chosenRecipeIndex = callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds));
-- Hit back on recipe list
if (chosenRecipeIndex <= 0) then break end;
chosenRecipe = recipes[chosenRecipeIndex-1];
if (chosenRecipe ~= nil) then
-- Player confirms recipe
local recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor,
chosenRecipe.resultItemID,
chosenRecipe.resultQuantity,
chosenRecipe.crystalId1,
chosenRecipe.crystalQuantity1,
chosenRecipe.crystalId2,
chosenRecipe.crystalQuantity2,
0,
0);
if recipeConfirmed then if recipeConfirmed then
closeCraftStartWidget(player, craftJudge, commandactor); callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
isRecipeRecentSent = false;
isRecipeAwardSent = false;
currentlyCrafting = startCrafting(player, chosenOperation, isRequested, 80, 100, 50);
end
end
elseif chosenOperation == MENU_REQUEST then -- Conditional button label based on isRequested
if isRequested == false then -- "Request Items" hit, close Start and open up the Quest select
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
isRecipeRecentSent = false; isRecipeRecentSent = false;
isRecipeAwardSent = false; isRecipeAwardSent = false;
-- CRAFTING STARTED local questConfirmed, returnedQuest = GetCraftQuest(player, craftjudge, commandactor);
currentlyCrafting = startCrafting(player, commandactor, craftJudge, operationMode, chosenRecipe, currentCraftQuestGuildleve, 80, 100, 50); chosenQuest = tonumber(returnedQuest);
--Once crafting is over, return to the original non-quest state. if debugMessage then player:SendMessage(0x20, "", "[DEBUG] Chosen Quest: "..tostring(chosenQuest)); end
isRequestedItemsMode = false;
currentCraftQuestGuildleve = nil;
currentCraftQuest = nil;
break; if questConfirmed then
isRequested = true;
end end
end
end
-- End of Recipe choosing loops
elseif operationMode == MENU_REQUEST then -- Conditional button label based on isRequestedItemsMode
closeCraftStartWidget(player, craftJudge, commandactor);
if isRequestedItemsMode == false then -- "Request Items" hit, close Start and open up the Quest select
isRecipeRecentSent = false;
isRecipeAwardSent = false;
local quest = getCraftQuest(player, craftJudge, commandactor); elseif isRequested == true then -- "Normal Synthesis" button hit
if (quest ~= nil) then isRequested = false;
isRequestedItemsMode = true; chosenQuest = 0;
if (quest.isCraftPassiveGuildleve()) then callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
currentCraftQuestGuildleve = quest;
else
currentCraftQuest = quest;
end end
end
elseif isRequestedItemsMode == true then -- "Normal Synthesis" button hit elseif chosenOperation == MENU_RECIPE then -- "Recipes" button hit
isRequestedItemsMode = false;
currentCraftQuestGuildleve = nil;
currentCraftQuest = nil;
end
elseif operationMode == MENU_RECENT then -- "Recipes" button hit
if isRecipeRecentSent == false then if isRecipeRecentSent == false then
recentRecipes = player.GetRecentRecipes(); callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(recentRecipe)); -- Load up recipe list
local itemIds = recipeResolver.RecipesToItemIdTable(recentRecipes);
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds)); -- Load up recipe list
isRecipeRecentSent = true; isRecipeRecentSent = true;
end end
elseif operationMode == MENU_AWARDED then -- "Awarded Recipes" tab hit
recipeDetail = materialRecipe[recentRecipe[recipeMode]];
elseif chosenOperation == MENU_AWARDED then -- "Awarded Recipes" tab hit
if isRecipeAwardSent == false then if isRecipeAwardSent == false then
awardedRecipes = player.GetAwardedRecipes(); callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(awardedRecipe)); -- Load up Award list
local itemIds = recipeResolver.RecipesToItemIdTable(awardedRecipes);
callClientFunction(player, "delegateCommand", craftJudge, "selectRcp", commandactor, unpack(itemIds)); -- Load up Award list
isRecipeAwardSent = true; isRecipeAwardSent = true;
end end
elseif ((operationMode == MENU_RECENT_DETAILED or operationMode == MENU_AWARDED_DETAILED) and recipeMode > 0) then -- Pop-up for an item's stats/craft mats on a recent recipe
local chosenRecipe = operationMode == MENU_RECENT_DETAILED and recentRecipes[recipeMode-1] or recentRecipes[awardedMode-1];
local recipeConfirmed = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor,
chosenRecipe.resultItemID,
chosenRecipe.resultQuantity,
chosenRecipe.crystalId1,
chosenRecipe.crystalQuantity1,
chosenRecipe.crystalId2,
chosenRecipe.crystalQuantity2,
0,
0);
-- This should never call? The window with this button only appears when you select a recent recipe with not enough materials. Otherwise it just auto-fills your "table". recipeDetail = materialRecipe[awardedRecipe[recipeMode]];
if (recipeConfirmed) then
closeCraftStartWidget(player, craftJudge, commandactor); elseif (chosenOperation == MENU_RECIPE_DETAILED or chosenOperation == MENU_AWARDED_DETAILED) and recipeMode > 0 then -- Pop-up for an item's stats/craft mats
isRecipeRecentSent = false; detailWindowState = callClientFunction(player, "delegateCommand", craftJudge, "confirmRcp", commandactor, 10009617, 1, 0xF4247, 1, 0xf4245, 1, 0, 0);
isRecipeAwardSent = false;
currentlyCrafting = startCrafting(player, commandactor, craftJudge, operationMode, chosenRecipe, isRequestedItemsMode, 80, 100, 50);
end
else else
break; break;
end end
end end
player:ResetMusic(); player:ChangeMusic(7); -- Need way to reset music back to the zone's default
player:ChangeState(0); player:ChangeState(0);
player:EndEvent(); player:EndEvent();
end end
-- Handles the menus to pick a crafter quest or local leve quest that run separate widgets from the Start command. -- Handles the menus to pick a crafter quest or local leve quest that run separate widgets from the Start command.
-- Returns whether a quest was selected, and what id the quest is. -- Returns whether a quest was selected, and what id the quest is.
function getCraftQuest(player, craftJudge, commandactor); function GetCraftQuest(player, craftjudge, commandactor);
local questId = nil;
while (true) do local questOffset = 0xA0F00000;
local questCommandId = callClientFunction(player, "delegateCommand", craftJudge, "selectCraftQuest", commandactor); local questId = 0;
local requestState = false;
local requestedMenuChoice = callClientFunction(player, "delegateCommand", craftJudge, "selectCraftQuest", commandactor);
if questCommandId then if requestedMenuChoice then
questId = questCommandId - 0xA0F00000; questId = requestedMenuChoice - questOffset;
-- Craft Quest Chosen
if isCraftQuest(questId) then if isCraftQuest(questId) then
local quest = player.GetQuest(questId); confirm = callClientFunction(player, "delegateCommand", craftJudge, "cfmQst", commandactor, questId, 20, 1, 1, 1, 0, 0, "<Path Companion>");
local confirm = callClientFunction(player, "delegateCommand", craftJudge, "cfmQst", commandactor, quest.getQuestId(), 20, 1, 1, 1, 0, 0, "<Path Companion>");
if confirm == true then if confirm == true then
requestState = true;
player:SendGameMessage(craftJudge, 21, 0x20); player:SendGameMessage(craftJudge, 21, 0x20);
return quest;
end end
-- PassiveGL Quest Chosen
elseif isLocalLeve(questId) then elseif isLocalLeve(questId) then
local difficulty = 0; confirm = callClientFunction(player, "delegateCommand", craftJudge, "confirmLeve", commandactor, questId, 0, 8030421, 5, 50, 0, 0);
local hasMaterials = 1;
local quest = player:getQuestGuildleve(questId); if confirm == true then
requestState = true;
itemSlots = { unpack(materialRecipe[4070010])};
end
if (quest ~= nil) then elseif isScenarioQuest(questId) == true then
-- Did they pickup the materials?
if (quest:hasMaterials() == false) then
player:SendGameMessage(GetWorldMaster(), 40210, 0x20); -- You have not obtained the proper materials from the client.
-- Did they use em all up?
elseif (quest:getRemainingMaterials() == 0) then
player:SendGameMessage(GetWorldMaster(), 40211, 0x20); -- You have used up all of the provided materials.
-- Confirm dialog
else
local confirm = callClientFunction(player, "delegateCommand", craftJudge, "confirmLeve", commandactor,
quest:getQuestId(),
quest:getCurrentDifficulty() + 1, -- Lua, 1-indexed
0,
quest:getCurrentCrafted(),
quest:getRemainingMaterials(),
quest:hasMaterials() and 1 or 0, -- Fucked up way of doing terneries on Lua
0
);
-- Quest confirmed
if (confirm == true) then
return quest;
end
end
else
return nil; -- Shouldn't happen unless db fucked with
end
-- Scenario Quest Chosen
else
-- TEMP for now. Cannot find source for what happens if you confirm a non-craft quest. -- TEMP for now. Cannot find source for what happens if you confirm a non-craft quest.
player:SendGameMessage(GetWorldMaster(), 40209, 0x20); -- You cannot undertake that endeavor. player:SendGameMessage(GetWorldMaster(), 40209, 0x20);
end
else
return nil;
end end
end end
return requestState, questId;
end end
function isScenarioQuest(id) function isScenarioQuest(id)
if (id >= 110001 and id <= 120026) then if (id >= 110001 and id <= 120026) then
return true; return true;
else else
@@ -437,6 +359,7 @@ end
function isLocalLeve(id) function isLocalLeve(id)
if (id >= 120001 and id <= 120452) then if (id >= 120001 and id <= 120452) then
return true; return true;
else else
@@ -444,54 +367,43 @@ function isLocalLeve(id)
end end
end end
function closeCraftStartWidget(player, craftJudge, commandactor)
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftStartWidget", commandactor);
craftStartWidgetOpen = false;
end
-- No real logic in this function. Just smoke and mirrors to 'see' the minigame in action at the minimum level. -- No real logic in this function. Just smoke and mirrors to 'see' the minigame in action at the minimum level.
function startCrafting(player, commandactor, craftJudge, hand, recipe, quest, startDur, startQly, startHQ) function startCrafting(player, hand, quest, startDur, startQly, startHQ)
local worldMaster = GetWorldMaster(); local worldMaster = GetWorldMaster();
local progress = 0; local craftProg = 0;
local attempts = 5; local attempts = 5;
local craftedCount = 0; local craftedCount = 0;
local craftTotal = 2; local craftTotal = 2;
local itemId = 10009617;
player:ChangeState(30+hand); -- Craft kneeling w/ appropriate tool out player:ChangeState(30+hand); -- Craft kneeling w/ appropriate tool out
player:ChangeMusic(73); player:ChangeMusic(73);
callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ); callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ);
while (true) do while true do
local progDiff = math.random(30,50);
local progDiff = math.random(25,25);
local duraDiff = math.random(1,3); local duraDiff = math.random(1,3);
local qltyDiff = math.random(0,2); local qltyDiff = math.random(0,2);
if (progress >= 100) then if craftProg >= 100 then
testChoice2 = callClientFunction(player, "delegateCommand", craftJudge, "updateInfo", commandactor, 100, 10, 20, 5020111, 69, 70, 75);
-- From Lodestone: If the HQ odds are 1% or better, players will have the option of selecting either Finish or Double Down.
-- By electing to double down, the player takes a chance on creating an HQ item at the risk of losing the completed item if the attempt fails
testChoice = callClientFunction(player, "delegateCommand", craftJudge, "craftTuningUI", commandactor, 22503, 22504);
player:SendGameMessage(GetWorldMaster(), 40111, 0x20, player, itemId, 3, 8); -- "You create <#3 quantity> <#1 item> <#2 quality>."
callClientFunction(player, "delegateCommand", craftJudge, "closeCraftProgressWidget", commandactor); callClientFunction(player, "delegateCommand", craftJudge, "closeCraftProgressWidget", commandactor);
-- Handle local levequest craft success
if quest then if quest then
quest:craftSuccess(); continueLeve = callClientFunction(player, "delegateCommand", craftJudge, "askContinueLocalLeve", 120001, itemId, craftedCount, craftTotal, attempts);
if (quest:getCurrentCrafted() >= quest:getObjectiveQuantity()) then if continueLeve == true then
attentionMessage(player, 40121, quest:getQuestId(), quest:getCurrentCrafted(), quest:getObjectiveQuantity()); -- "All items for <QuestId> complete!" craftProg = 0;
else
attentionMessage(player, 40119, quest:getQuestId(), quest:getCurrentCrafted(), quest:getObjectiveQuantity()); -- "<QuestId> Successfull. (<crafted> of <attempts>)"
end
-- Continue local levequest (should this be in here??)
if (quest:getRemainingMaterials() ~= 0) then
continueLeve = callClientFunction(player, "delegateCommand", craftJudge, "askContinueLocalleve", commandactor,
quest:getQuestId(),
quest:getRecipe().resultItemID,
quest:getCurrentCrafted(),
quest:getObjectiveQuantity(),
quest:getRemainingMaterials()
);
if (continueLeve == 1) then
progress = 0;
callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ); callClientFunction(player, "delegateCommand", craftJudge, "openCraftProgressWidget", commandactor, startDur, startQly, startHQ);
else else
break; break;
@@ -499,18 +411,14 @@ function startCrafting(player, commandactor, craftJudge, hand, recipe, quest, st
else else
break; break;
end end
-- Normal synth craft success
else
player:SendGameMessage(GetWorldMaster(), 40111, 0x20, player, recipe.resultItemID, 1, recipe.resultQuantity); -- "You create <#3 quantity> <#1 item> <#2 quality>."
player:getItemPackage(location):addItem(recipe.resultItemID, recipe.resultQuantity, 1);
break;
end
end end
choice = callClientFunction(player, "delegateCommand", craftJudge, "craftCommandUI", commandactor, 29, 2, 29530,29531,29532,29533,29534); choice = callClientFunction(player, "delegateCommand", craftJudge, "craftCommandUI", commandactor, 29, 2, 29530,29531,29532,29533,29534);
--player:SendMessage(0x20, "", "[DEBUG] Command id selected: "..choice); --player:SendMessage(0x20, "", "[DEBUG] Command id selected: "..choice);
if (choice) then
if choice then
if skillAnim[choice] then if skillAnim[choice] then
player:PlayAnimation(skillAnim[choice]); player:PlayAnimation(skillAnim[choice]);
@@ -520,11 +428,11 @@ function startCrafting(player, commandactor, craftJudge, hand, recipe, quest, st
player:SendGameMessage(worldMaster, 40108, 0x20, choice,2); player:SendGameMessage(worldMaster, 40108, 0x20, choice,2);
if (choice ~= 29531) then if choice ~= 29531 then
progress = progress + progDiff; craftProg = craftProg + progDiff;
if (progress >= 100) then if craftProg >= 100 then
progress = 100; craftProg = 100;
end end
startDur = startDur - duraDiff; startDur = startDur - duraDiff;
@@ -535,9 +443,12 @@ function startCrafting(player, commandactor, craftJudge, hand, recipe, quest, st
player:SendGameMessage(worldMaster, 40104, 0x20, qltyDiff); player:SendGameMessage(worldMaster, 40104, 0x20, qltyDiff);
end end
--prg dur qly, ???, ???, ???, HQ --prg dur qly, ???, ???, ???, HQ
callClientFunction(player, "delegateCommand", craftJudge, "updateInfo", commandactor, progress, startDur, startQly, nil, nil, nil, nil, nil); callClientFunction(player, "delegateCommand", craftJudge, "updateInfo", commandactor, craftProg, startDur, startQly, nil, nil, nil, nil, nil);
--testChoice = callClientFunction(player, "delegateCommand", craftJudge, "craftTuningUI", commandactor, 29501, 24233, 29501,29501, 24223, 29501,12008,12004);
end end
end end
return -1;
end end

View File

@@ -63,37 +63,40 @@ rangeInputWidget()
* goodMax * goodMax
* bool * bool
Notes:
* Aim = Where on the aim gauge the player chose.
* Remainder = How many attempts you get on the section portion of the minigame
* Sweetspot = Where you hit on the second portion of the minigame
--]] --]]
minerAnim = {0x14001000, 0x14002000, 0x14003000}; minerAnim = {0x14001000, 0x14002000, 0x14003000};
--[[ Mooglebox - Aim --[[ Mooglebox - Aim
+5 = 0 +5 +4 +3 +2 +1 0 -1 -2 -3 -4 -5
+4 = 10 0 10 20 30 40 50 60 70 80 90 100
+3 = 20
+2 = 30
+1 = 40
0 = 50
-1 = 60
-2 = 70
-3 = 80
-4 = 90
-5 = 100
Sweetspots 1=10 2=30 3=70 4=100 for Mining Sweetspots 1=10 2=30 3=70 4=100 for Mining
remainder A=40 B=60 C=70 D=80 Remainder A=40 B=60 C=70 D=80
--]] --]]
nodeContainer = { -- harvestAttempts, #ofItemsBecauseLuaIsShitAtTableLength, Item1, Item2, etc harvestNodeContainer = { -- nodeGrade, harvestAttempts, #ofItemsBecauseICantIntoIpairs, Item1, Item2, etc
[1] = {4, 3, 1, 2, 3} [1001] = {2, 2, 3, 1, 2, 3},
[1002] = {2, 4, 5, 3005, 3003, 3002, 3001, 3004}
} }
nodeItems = { harvestNodeItems = {
--itemId, remainder, aim, sweetspot, max yield --itemId, remainder, aim, sweetspot, max yield
[1] = {10009104, 70, 30, 30, 4}, -- Rock Salt [1] = {10009104, 70, 30, 30, 4}, -- Rock Salt
[2] = {10006001, 80, 10, 30, 4}, -- Bone Chip [2] = {10006001, 80, 10, 30, 4}, -- Bone Chip
[3] = {10001006, 80, 20, 30, 3} -- Copper Ore [3] = {10001006, 80, 20, 30, 3}, -- Copper Ore
[3001] = {10001003, 80, 50, 30, 3},
[3002] = {10001006, 70, 70, 10, 4},
[3003] = {10001005, 80, 90, 70, 1},
[3004] = {10009104, 40, 10, 100, 2},
[3005] = {10001007, 40, 0, 30, 1}
} }
@@ -103,18 +106,23 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
debugMsg = false; debugMsg = false;
powerCurrent = 0;
powerLast = 0;
powerRange = 10; -- 'Feels' look a good amount compared to vids/ARR's minigame.
showTutorial = 0;
commandMine = 22002; commandMine = 22002;
commandLog = 22003; commandLog = 22003;
commandFish = 22004; commandFish = 22004;
remainderA, remainderB, remainderC, remainderD = 40, 60, 70, 80;
harvestNodeId = 1001; -- What the server should send eventually
harvestNode = BuildHarvestNode(player, harvestNodeId); -- [1-11] = {itemId, remainder, sweetspot, maxYield}
harvestGrade = harvestNodeContainer[harvestNodeId][1] or 0;
harvestAttempts = harvestNodeContainer[harvestNodeId][2] or 0;
nodeRemainder = 0;
currentPower = 0;
nodeGrade = 3;
showTutorial = 0;
harvestAttempts = 2;
nodeRemainder = remainderC;
item = 10001006;
harvestType = commandMine; harvestType = commandMine;
@@ -126,10 +134,12 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
player:ChangeState(50); player:ChangeState(50);
if harvestType == commandMine then
player:SendGameMessage(harvestJudge, 26, MESSAGE_TYPE_SYSTEM, 1, nodeGrade);
callClientFunction(player, "delegateCommand", harvestJudge, "openInputWidget", commandActor, harvestType, nodeGrade);
if harvestType == commandMine then
player:SendGameMessage(harvestJudge, 26, MESSAGE_TYPE_SYSTEM, 1, harvestGrade);
callClientFunction(player, "delegateCommand", harvestJudge, "openInputWidget", commandActor, harvestType, harvestGrade);
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType);
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0); callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0);
@@ -137,22 +147,43 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
while harvestAttempts > 0 do while harvestAttempts > 0 do
-- "Aim", 0 = Top of bar, 100 = Bottom. Mooglebox conversion is +5 = 0, 0 = 50, -5 = 100 -- "Aim", 0 = Top of bar, 100 = Bottom.
menuResult, sliderPhase, ret3 = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 1, showTutorial, false, false, nil, false); menuResult, sliderPhase, unk3 = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 1, showTutorial, false, false, nil, false);
if debugMsg then player:SendMessage(0x20, "", "menuResult: "..tostring(menuResult).." sliderPhase: "..tostring(sliderPhase).." Unk: "..tostring(unk3)); end
if debugMsg then player:SendMessage(0x20, "", tostring(menuResult).." unk: "..tostring(sliderPhase).." unk: "..tostring(ret3)); end
if menuResult == 22701 then -- Begin. if menuResult == 22701 then -- Begin.
player:SendGameMessage(harvestJudge, 36, MESSAGE_TYPE_SYSTEM);
nodeRemainder = remainderC; local aimSlot = (sliderPhase/10)+1; -- Thanks LUA index = 1
local nodeDetails = harvestNode[aimSlot];
local nodeItem = nodeDetails[1];
local nodeRemainder = nodeDetails[2];
local nodeSweetspot = nodeDetails[3];
local nodeYield = nodeDetails[4];
local isFirstSwing = true;
local sweetspotDifference;
local sweetspotDifferencePrevious;
if debugMsg then
player:SendMessage(0x20, "", "aimSlot: "..(aimSlot).." itemId:"..tostring(nodeDetails[1]).." remainder: "..tostring(nodeDetails[2]));
end
player:SendGameMessage(harvestJudge, 36, MESSAGE_TYPE_SYSTEM); -- "You set your sights on an area."
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, nil, harvestType);
while true do while true do
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0);
-- "Strike" 0 = Empty, 100 = Filled. Mooglebox sweespots are 1=10, 2=30, 3=70, 4=100 for Mining -- "Strike" 0 = Empty, 100 = Filled. Mooglebox sweespots are 1=10, 2=30, 3=70, 4=100 for Mining
chosenCommand, currentPower = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 2, showTutorial, false, false, nil, false); -- Strike chosenCommand, powerCurrent = callClientFunction(player, "delegateCommand", harvestJudge, "askInputWidget", commandActor, harvestType, 2, showTutorial, false, false, nil, false); -- Strike
if debugMsg then player:SendMessage(0x20, "", tostring(chosenCommand).." Power: "..tostring(powerCurrent)); end
if debugMsg then player:SendMessage(0x20, "", tostring(chosenCommand).." Power: "..tostring(currentPower)); end
if chosenCommand == 22702 then -- Cancel. if chosenCommand == 22702 then -- Cancel.
harvestAttempts = harvestAttempts - 1; harvestAttempts = harvestAttempts - 1;
@@ -165,19 +196,63 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts); player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts);
end end
break; break;
elseif chosenCommand == 22703 then -- Strike. elseif chosenCommand == 22703 then -- Strike.
player:PlayAnimation(minerAnim[math.random(1,3)]);
nodeRemainder = nodeRemainder - 20; nodeRemainder = nodeRemainder - 20;
if nodeRemainder < 0 then if nodeRemainder < 0 then
nodeRemainder = 0; nodeRemainder = 0;
end end
--player:SendGameMessage(harvestJudge, 25, MESSAGE_TYPE_SYSTEM, item, 4, 1); callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, nil, 0, 0, 0, 0);
player:PlayAnimation(minerAnim[math.random(1,3)]);
wait(2);
sweetspotDifference = math.abs(powerCurrent - nodeSweetspot);
if powerRange >= sweetspotDifference then
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType);
-- "You obtain <yield> <item> <quality>"
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 25, nodeItem, 0, nodeYield, 0);
player:SendGameMessage(player, worldMaster, 40301, MESSAGE_TYPE_SYSTEM, player, nodeItem, nodeYield); -- TODO: Refer to caps to see wtf is going on here
HarvestReward(player, nodeItem, nodeYield);
nodeRemainder = 0;
else
if isFirstSwing then
if sweetspotDifference < 19 then -- TODO: TWEAK THESE, likely need to be larger
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 45);
player:SendGameMessage(harvestJudge, 45, MESSAGE_TYPE_SYSTEM); -- "You feel something promising."
elseif sweetspotDifference > 20 then
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 42);
player:SendGameMessage(harvestJudge, 42, MESSAGE_TYPE_SYSTEM); -- "You feel nothing promising."
end
else
if sweetspotDifference > sweetspotDifferencePrevious then
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 43);
player:SendGameMessage(harvestJudge, 43, MESSAGE_TYPE_SYSTEM); -- "You are getting farther from the mark."
elseif sweetspotDifference < sweetspotDifferencePrevious then
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 44);
player:SendGameMessage(harvestJudge, 44, MESSAGE_TYPE_SYSTEM); -- "You are getting closer to the mark."
else
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 42);
player:SendGameMessage(harvestJudge, 42, MESSAGE_TYPE_SYSTEM); -- "You feel nothing promising."
end
end
end
if not isFirstSwing then
powerLast = powerCurrent;
end;
callClientFunction(player, "delegateCommand", harvestJudge, "orderInputWidget", commandActor, nodeRemainder, false, harvestType);
callClientFunction(player, "delegateCommand", harvestJudge, "textInputWidget", commandActor, harvestType, harvestJudge, 25, item, 4, 1, 0);
if nodeRemainder == 0 then if nodeRemainder == 0 then
harvestAttempts = harvestAttempts - 1; harvestAttempts = harvestAttempts - 1;
@@ -187,12 +262,20 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
player:SendGameMessage(player, worldMaster, 40344, 0x20, harvestAttempts); player:SendGameMessage(player, worldMaster, 40344, 0x20, harvestAttempts);
else else
-- There is nothing left to gather at this location. -- There is nothing left to gather at this location.
player:ChangeMusic(101);
player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts); player:SendGameMessage(player, worldMaster, 40339, 0x20, harvestAttempts);
end end
wait(2); wait(2);
break; break;
end end
if isFirstSwing and debugMsg then player:SendMessage(0x20, "", "First swing"); end
isFirstSwing = false;
sweetspotDifferencePrevious = sweetspotDifference;
elseif chosenCommand == 22710 then -- "Strike" Tutorial. elseif chosenCommand == 22710 then -- "Strike" Tutorial.
SendTutorial(player, harvestJudge, 2); SendTutorial(player, harvestJudge, 2);
end end
@@ -212,8 +295,12 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
end end
if harvestAttempts == 0 then
player:SendGameMessage(harvestJudge, 31, MESSAGE_TYPE_SYSTEM); player:SendGameMessage(harvestJudge, 31, MESSAGE_TYPE_SYSTEM);
if harvestAttempts == 0 then
player:SendGameMessage(player, worldMaster, 40310, 0x20); -- "The deposit has been exhausted."
--TO:DO Despawn node + whatever logic to respawn an exsiting expired node in the area.
end end
callClientFunction(player, "delegateCommand", harvestJudge, "closeInputWidget", commandActor, harvestType); callClientFunction(player, "delegateCommand", harvestJudge, "closeInputWidget", commandActor, harvestType);
@@ -224,6 +311,67 @@ function onEventStarted(player, commandActor, triggerName, arg1, arg2, arg3, arg
end end
-- Returns a table in the following format: nodeTable = { [1-11] = {itemId, remainder, sweetspot, maxYield} }
function BuildHarvestNode(player, sentNode)
if harvestNodeContainer[sentNode] then
local node = harvestNodeContainer[sentNode];
local nodeTable = {};
local nodeItems = {};
local nodeItemCount = node[3];
local grade = node[1];
local attempts = node[2];
-- Load up nodeItems[] with the harvestNodeItems{} key and Aim point
for i=1, nodeItemCount do
local nodeItemKey = node[3+i];
local item = harvestNodeItems[ node[3+i] ]
nodeItems[i] = { nodeItemKey, ((item[3] / 10)+1) };
if debugMsg then player:SendMessage(0x20, "", "nodeItems: "..nodeItems[i][1].." "..nodeItems[i][2]); end
end
-- Iterate through the 11 Aim spots
for i=1,11,1 do
local hasItem = false;
-- See if there's a nodeItems[] that has an Aim spot that matches the current loop
-- TODO: Just set nodeItems[] keys to the actual slots to skip this loop inside a loop
for j=1, nodeItemCount do
if nodeItems[j][2] == i then
hasItem = j;
break;
end
end
if hasItem then
local item = harvestNodeItems[ nodeItems[hasItem][1] ];
-- Assign itemId, remainder, sweetspot, yield to this slot
nodeTable[i] = {item[1], item[2], item[4], item[5] };
if debugMsg then
player:SendMessage(0x20, "", "nodeTable: "..i.." "..nodeTable[i][1].." "..nodeTable[i][2].." "..nodeTable[i][3].." "..nodeTable[i][3]);
end
else
nodeTable[i] = {0,0,0,0};
if debugMsg then player:SendMessage(0x20, "", "nodeTable: "..i); end
end
end
return nodeTable
end
end
function SendTutorial(player, harvestJudge, id) function SendTutorial(player, harvestJudge, id)
if id == 1 then if id == 1 then
@@ -239,4 +387,25 @@ function SendTutorial(player, harvestJudge, id)
wait(3); wait(3);
player:SendGameMessage(harvestJudge, 16, MESSAGE_TYPE_SYSTEM); player:SendGameMessage(harvestJudge, 16, MESSAGE_TYPE_SYSTEM);
end end
end
function HarvestReward(player, item, qty) -- Really should get a helper function for this
local worldMaster = GetWorldMaster();
local location = INVENTORY_NORMAL;
local invCheck = player:getItemPackage(location):addItem(item, qty, 1);
if (invCheck == INV_ERROR_FULL) then
-- Your inventory is full.
player:SendGameMessage(player, worldMaster, 60022, MESSAGE_TYPE_SYSTEM_ERROR);
elseif (invCheck == INV_ERROR_ALREADY_HAS_UNIQUE) then
-- You cannot have more than one <itemId> <quality> in your possession at any given time.
player:SendGameMessage(player, worldMaster, 40279, MESSAGE_TYPE_SYSTEM_ERROR, item, 1);
elseif (invCheck == INV_ERROR_SYSTEM_ERROR) then
player:SendMessage(MESSAGE_TYPE_SYSTEM_ERROR, "", "[DEBUG] Server Error on adding item.");
elseif (invCheck == INV_ERROR_SUCCESS) then
--player:SendMessage(MESSAGE_TYPE_SYSTEM, "", message);
player:SendGameMessage(player, worldMaster, 25246, MESSAGE_TYPE_SYSTEM, item, qty);
end
end end

View File

@@ -11,13 +11,13 @@ require("global")
function onEventStarted(player, actor, triggerName, pushCommand, unk1, unk2, unk3, ownerActorId, unk4, unk5, unk6, unk7) function onEventStarted(player, actor, triggerName, pushCommand, unk1, unk2, unk3, ownerActorId, unk4, unk5, unk6, unk7)
actor = player:GetActorInInstance(ownerActorId); actor = player:GetActorInInstance(ownerActorId);
print("TESSSSSSSSSSSSSST");
harvestCommand = GetStaticActorById(0xA0F055F7);
if (actor != nil) then if (actor != nil) then
if (actor:GetActorClassId() == 1200052) then if (actor:GetActorClassId() == 1200052) then
player:KickEventSpecial(harvestCommand, 0, "commandJudgeMode", 0, 0, 0, 0, 0x4E26, 0, nil, 0xF, actor, nil, nil, nil, nil); player:kickEvent(actor, "commandJudgeMode", "commandJudgeMode");
else else
--player:kickEvent(actor, "pushCommand", false); printf("TEST");
player:kickEvent(actor, "pushCommand", "pushCommand");
end end
else else
player:endEvent(); player:endEvent();

View File

@@ -1,30 +0,0 @@
require("global");
properties = {
permissions = 0,
parameters = "ddd",
description =
[[
Sets anim id for current target
!anim <animID> |
]],
}
function onTrigger(player, argc, aType, a1, a2)
npc = player;--GetWorldManager():GetActorInWorldByUniqueId("test");
aType = tonumber(aType);
a1 = tonumber(a1);
a2 = tonumber(a2);
a1 = bit32.band(a1, 0xFFF);
a2 = bit32.band(a2, 0xFFF);
aType = bit32.band(aType, 0xFF);
animId = bit32.bor(bit32.lshift(a2, 12), a1);
animId = bit32.bor(bit32.lshift(aType, 24), animId);
print("AHHH");
player:PlayAnimation(0x10005000);
end;

View File

@@ -21,7 +21,7 @@ function main(thisDirector)
if (members ~= nil and #members ~= 0) then if (members ~= nil and #members ~= 0) then
player = members[0]; player = members[0];
player:SendGameMessage(GetWorldMaster(), 50036, 0x20, thisDirector.guildleveId, player, 0); --"You have started the leve..." player:SendGameMessage(GetWorldMaster(), 50036, 0x20, thisDirector.guildleveId, player, 0); --"You have started the leve..."
player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.plateId, guildleveData.borderId, false)); player:PlayAnimation(getGLStartAnimationFromSheet(guildleveData.borderId, guildleveData.plateId, false));
end end
wait(3); wait(3);
@@ -47,3 +47,8 @@ function main(thisDirector)
thisDirector:UpdateAimNumNow(0, 3); thisDirector:UpdateAimNumNow(0, 3);
end end
function attentionMessage(player, textId, ...)
player:SendGameMessage(GetWorldMaster(), textId, 0x20, ...);
player:SendDataPacket("attention", GetWorldMaster(), "", textId, ...);
end

View File

@@ -52,7 +52,7 @@ function onEventStarted(player, director, triggerName)
wait(6); --Should be wait for mobkill wait(6); --Should be wait for mobkill
worldMaster = GetWorldMaster(); worldMaster = GetWorldMaster();
attentionMessage(player, 51073, 1); player:SendDataPacket("attention", worldMaster, "", 51073, 1);
wait(7); wait(7);
player:ChangeMusic(7); player:ChangeMusic(7);
player:ChangeState(0); player:ChangeState(0);

View File

@@ -132,13 +132,13 @@ CLASSID_THM = 22;
CLASSID_CNJ = 23; CLASSID_CNJ = 23;
-- SPAWNS -- SPAWNS
SPAWN_NO_ANIM1 = 0x00; SPAWN_NO_ANIM = 0x00;
SPAWN_ANIM1 = 0x02; SPAWN_ANIM1 = 0x02;
SPAWN_RETAINER = 0x03; SPAWN_RETAINER = 0x03;
SPAWN_POPMOB = 0x4; SPAWN_POPMOB = 0x4;
SPAWN_UKN1 = 0x5; SPAWN_UKN1 = 0x5;
SPAWN_UKN2 = 0x7; SPAWN_UKN2 = 0x7;
SPAWN_NO_ANIM = 0x0F; SPAWN_LOADING1 = 0x0F;
SPAWN_LOADING2 = 0x10; SPAWN_LOADING2 = 0x10;
SPAWN_INSTANCE_ERROR = 0x12; SPAWN_INSTANCE_ERROR = 0x12;
SPAWN_CHOCOBO_GET = 0x13; SPAWN_CHOCOBO_GET = 0x13;
@@ -146,13 +146,8 @@ SPAWN_CHOCOBO_RENTAL = 0x14;
SPAWN_CUTTER_SANDS = 0x17; SPAWN_CUTTER_SANDS = 0x17;
SPAWN_NIGHTMARE = 0x18; SPAWN_NIGHTMARE = 0x18;
-- Common Helper Functions --UTILS
function attentionMessage(player, textId, ...)
player:SendGameMessage(GetWorldMaster(), textId, 0x20, ...);
player:SendDataPacket("attention", GetWorldMaster(), "", textId, ...);
end
-- Core Event Functions
function kickEventContinue(player, actor, trigger, ...) function kickEventContinue(player, actor, trigger, ...)
player:kickEvent(actor, trigger, ...); player:kickEvent(actor, trigger, ...);
return coroutine.yield("_WAIT_EVENT", player); return coroutine.yield("_WAIT_EVENT", player);

View File

@@ -14,11 +14,11 @@ function glPlateIconIDToAnimID(iconId)
return iconId - 20020; return iconId - 20020;
end end
function getGLStartAnimationFromSheet(plate, border, isBoost) function getGLStartAnimationFromSheet(border, plate, isBoost)
return getGLStartAnimation(glPlateIconIDToAnimID(plate), glBorderIconIDToAnimID(border), isBoost); return getGLStartAnimation(glBorderIconIDToAnimID(border), glPlateIconIDToAnimID(plate), isBoost);
end end
function getGLStartAnimation(plate, border, isBoost) function getGLStartAnimation(border, plate, isBoost)
borderBits = border; borderBits = border;
plateBits = bit32.lshift(plate, 7); plateBits = bit32.lshift(plate, 7);

View File

@@ -1,7 +0,0 @@
require ("global")
function onEventStarted(player, npc)
defaultSea = GetStaticActor("DftSea");
callClientFunction(player, "delegateEvent", player, defaultSea, "defaultTalkWithKurtz_001");
player:endEvent();
end

View File

@@ -1,6 +0,0 @@
shopInfo = {
welcomeText = 94,
shopPack = 0x67,
shopCurrancy = nil
}

View File

@@ -1,6 +0,0 @@
shopInfo = {
welcomeText = 69,
shopPack = 3020,
tutorialId = 35
}

View File

@@ -1,6 +0,0 @@
shopInfo = {
welcomeText = 64,
shopPack = 3021,
tutorialId = 34
}

View File

@@ -1,6 +0,0 @@
shopInfo = {
welcomeText = 76,
shopPack = 3022,
tutorialId = 39
}

View File

@@ -1,6 +0,0 @@
shopInfo = {
welcomeText = 54,
shopPack = 3019,
tutorialId = 32
}

View File

@@ -1,5 +0,0 @@
shopInfo = {
welcomeText = 265,
shopPack = 3024
}

View File

@@ -1,5 +0,0 @@
shopInfo = {
welcomeText = 111,
shopPack = 3003
}

View File

@@ -1,5 +0,0 @@
shopInfo = {
welcomeText = 110,
shopPack = 3002
}

View File

@@ -1,34 +1,54 @@
-- -------------------------------------------------------- -- MySQL dump 10.13 Distrib 5.7.10, for Win64 (x86_64)
-- Host: 127.0.0.1 --
-- Server version: 5.6.17 - MySQL Community Server (GPL) -- Host: localhost Database: ffxiv_database
-- Server OS: Win64 -- ------------------------------------------------------
-- HeidiSQL Version: 10.1.0.5464 -- Server version 5.7.10-log
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */; /*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */; /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `characters_quest_guildleve_local`
--
-- Dumping database structure for ffxiv_server DROP TABLE IF EXISTS `characters_quest_guildleve_local`;
CREATE DATABASE IF NOT EXISTS `ffxiv_server` /*!40100 DEFAULT CHARACTER SET latin1 */; /*!40101 SET @saved_cs_client = @@character_set_client */;
USE `ffxiv_server`; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `characters_quest_guildleve_local` (
-- Dumping structure for table ffxiv_server.characters_quest_guildleve_local
CREATE TABLE IF NOT EXISTS `characters_quest_guildleve_local` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT, `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`characterId` int(10) unsigned NOT NULL, `characterId` int(10) unsigned NOT NULL,
`slot` smallint(5) unsigned NOT NULL, `slot` smallint(5) unsigned NOT NULL,
`questId` int(10) unsigned NOT NULL, `questId` int(10) unsigned NOT NULL,
`questData` longtext,
`abandoned` tinyint(1) unsigned DEFAULT '0', `abandoned` tinyint(1) unsigned DEFAULT '0',
`completed` tinyint(1) DEFAULT '0', `completed` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
-- Data exporting was unselected. --
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */; -- Dumping data for table `characters_quest_guildleve_local`
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */; --
LOCK TABLES `characters_quest_guildleve_local` WRITE;
/*!40000 ALTER TABLE `characters_quest_guildleve_local` DISABLE KEYS */;
/*!40000 ALTER TABLE `characters_quest_guildleve_local` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2016-06-07 22:54:48

View File

@@ -11,11 +11,6 @@
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for ffxiv_server
CREATE DATABASE IF NOT EXISTS `ffxiv_server` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `ffxiv_server`;
-- Dumping structure for table ffxiv_server.gamedata_items_graphics -- Dumping structure for table ffxiv_server.gamedata_items_graphics
DROP TABLE IF EXISTS `gamedata_items_graphics`; DROP TABLE IF EXISTS `gamedata_items_graphics`;
CREATE TABLE IF NOT EXISTS `gamedata_items_graphics` ( CREATE TABLE IF NOT EXISTS `gamedata_items_graphics` (

View File

@@ -1,236 +0,0 @@
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.6.17 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 10.1.0.5464
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
-- Dumping database structure for ffxiv_server
CREATE DATABASE IF NOT EXISTS `ffxiv_server` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `ffxiv_server`;
-- Dumping structure for table ffxiv_server.gamedata_passivegl_craft
DROP TABLE IF EXISTS `gamedata_passivegl_craft`;
CREATE TABLE IF NOT EXISTS `gamedata_passivegl_craft` (
`id` int(11) unsigned NOT NULL,
`plateId` int(11) unsigned NOT NULL,
`borderId` int(11) unsigned NOT NULL,
`recommendedClass` int(11) NOT NULL,
`issuingLocation` int(11) NOT NULL,
`guildleveLocation` int(11) NOT NULL,
`deliveryDisplayName` int(11) NOT NULL,
`unk1` int(11) NOT NULL,
`unk2` int(11) NOT NULL,
`unk3` int(11) NOT NULL,
`unk4` int(11) NOT NULL,
`objectiveItemId1` int(11) NOT NULL,
`objectiveQuantity1` int(11) NOT NULL,
`numberOfAttempts1` int(11) NOT NULL,
`recommendedLevel1` int(11) NOT NULL,
`rewardItemId1` int(11) NOT NULL,
`rewardQuantity1` int(11) NOT NULL,
`objectiveItemId2` int(11) NOT NULL,
`objectiveQuantity2` int(11) NOT NULL,
`numberOfAttempts2` int(11) NOT NULL,
`recommendedLevel2` int(11) NOT NULL,
`rewardItemId2` int(11) NOT NULL,
`rewardQuantity2` int(11) NOT NULL,
`objectiveItemId3` int(11) NOT NULL,
`objectiveQuantity3` int(11) NOT NULL,
`numberOfAttempts3` int(11) NOT NULL,
`recommendedLevel3` int(11) NOT NULL,
`rewardItemId3` int(11) NOT NULL,
`rewardQuantity3` int(11) NOT NULL,
`objectiveItemId4` int(11) NOT NULL,
`objectiveQuantity4` int(11) NOT NULL,
`numberOfAttempts4` int(11) NOT NULL,
`recommendedLevel4` int(11) NOT NULL,
`rewardItemId4` int(11) NOT NULL,
`rewardQuantity4` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='Data about passiveGuildleves AKA Local Guildleves';
-- Dumping data for table ffxiv_server.gamedata_passivegl_craft: ~169 rows (approximately)
/*!40000 ALTER TABLE `gamedata_passivegl_craft` DISABLE KEYS */;
INSERT INTO `gamedata_passivegl_craft` (`id`, `plateId`, `borderId`, `recommendedClass`, `issuingLocation`, `guildleveLocation`, `deliveryDisplayName`, `unk1`, `unk2`, `unk3`, `unk4`, `objectiveItemId1`, `objectiveQuantity1`, `numberOfAttempts1`, `recommendedLevel1`, `rewardItemId1`, `rewardQuantity1`, `objectiveItemId2`, `objectiveQuantity2`, `numberOfAttempts2`, `recommendedLevel2`, `rewardItemId2`, `rewardQuantity2`, `objectiveItemId3`, `objectiveQuantity3`, `numberOfAttempts3`, `recommendedLevel3`, `rewardItemId3`, `rewardQuantity3`, `objectiveItemId4`, `objectiveQuantity4`, `numberOfAttempts4`, `recommendedLevel4`, `rewardItemId4`, `rewardQuantity4`) VALUES
(120001, 20033, 20005, 1, 1, 1001, 1000333, 185, 186, 187, 188, 4040002, 2, 4, 5, 10002011, 3, 3910101, 72, 5, 10, 10002011, 3, 4030002, 4, 6, 15, 10002011, 3, 4040102, 5, 7, 25, 10002011, 3),
(120002, 20033, 20005, 1, 1, 1001, 1000333, 101, 102, 103, 104, 10303101, 2, 4, 1, 10002011, 3, 10300011, 3, 5, 15, 10002011, 3, 10303109, 4, 6, 1, 10002011, 3, 10303103, 5, 7, 20, 10002011, 3),
(120003, 20033, 20005, 1, 1, 1001, 1000333, 221, 222, 223, 224, 6020002, 2, 4, 5, 10002011, 3, 6021001, 3, 5, 10, 10002011, 3, 6020006, 4, 6, 5, 10002011, 3, 6020003, 5, 7, 25, 10002011, 3),
(120004, 20033, 20005, 1, 1, 1001, 1000333, 29, 30, 31, 32, 0, 0, 4, 1, 10001004, 8, 0, 0, 5, 1, 10001004, 8, 10002002, 48, 6, 10, 10001004, 8, 0, 0, 7, 10, 10001004, 8),
(120005, 20033, 20005, 30, 1051, 1014, 1400065, 361, 362, 363, 364, 4030001, 2, 4, 1, 6020004, 1, 4030001, 3, 5, 1, 8032501, 1, 4030001, 4, 6, 1, 8070320, 1, 4030001, 5, 7, 1, 8080615, 1),
(120006, 20033, 20005, 34, 1051, 1014, 1400065, 361, 362, 363, 364, 8031315, 2, 4, 1, 6060008, 1, 8031315, 3, 5, 1, 8032501, 1, 8031315, 4, 6, 1, 8070320, 1, 8031315, 5, 7, 1, 8080615, 1),
(120007, 20033, 20005, 29, 1051, 1014, 1400065, 361, 362, 363, 364, 10008203, 2, 4, 1, 6010009, 1, 10008203, 3, 5, 1, 8032501, 1, 10008203, 4, 6, 1, 8070320, 1, 10008203, 5, 7, 1, 8080615, 1),
(120008, 20033, 20005, 33, 1051, 1014, 1400065, 361, 362, 363, 364, 8080615, 2, 4, 1, 6050009, 1, 8080615, 3, 5, 1, 8032501, 1, 8080615, 4, 6, 1, 8070320, 1, 8080615, 5, 7, 1, 8080615, 1),
(120009, 20033, 20005, 31, 1051, 1014, 1400065, 361, 362, 363, 364, 10002071, 6, 4, 1, 6030009, 1, 10002071, 9, 5, 1, 8032501, 1, 10002071, 12, 6, 1, 8070320, 1, 10002071, 15, 7, 1, 8080615, 1),
(120010, 20033, 20005, 32, 1051, 1014, 1400065, 361, 362, 363, 364, 9050052, 2, 4, 1, 6040009, 1, 9050052, 3, 5, 1, 8032501, 1, 9050052, 4, 6, 1, 8070320, 1, 9050052, 5, 7, 1, 8080615, 1),
(120011, 20033, 20005, 35, 1051, 1014, 1400065, 361, 362, 363, 364, 10009308, 6, 4, 1, 6070009, 1, 10009308, 9, 5, 1, 8032501, 1, 10009308, 12, 6, 1, 8070320, 1, 10009308, 15, 7, 1, 8080615, 1),
(120012, 20033, 20005, 36, 1051, 1014, 1400065, 361, 362, 363, 364, 3010202, 12, 4, 1, 6080009, 1, 3010202, 18, 5, 1, 8032501, 1, 3010202, 24, 6, 1, 8070320, 1, 3010202, 30, 7, 1, 8080615, 1),
(120013, 20033, 20005, 30, 1051, 1510, 1400104, 333, 334, 335, 336, 10002012, 2, 4, 10, 10001004, 9, 10002013, 3, 5, 20, 10001004, 9, 10003015, 4, 6, 30, 10001010, 9, 10002015, 5, 7, 35, 10001013, 9),
(120014, 20033, 20005, 30, 1051, 1509, 1900094, 329, 330, 331, 332, 10002072, 6, 4, 15, 10002012, 3, 10002073, 9, 5, 25, 10002013, 3, 10003074, 12, 6, 35, 10003015, 3, 10002074, 15, 7, 40, 10002015, 3),
(120015, 20033, 20004, 30, 1051, 1509, 1000333, 325, 326, 327, 328, 4040106, 2, 4, 15, 10002012, 3, 4030115, 3, 5, 25, 10002013, 3, 4040206, 4, 6, 45, 10003015, 3, 4030506, 5, 7, 50, 10002015, 3),
(120016, 20033, 20005, 34, 1051, 1510, 1400104, 333, 334, 335, 336, 8012011, 2, 4, 10, 10005201, 6, 8010910, 3, 5, 20, 10005005, 3, 8012014, 4, 6, 35, 10005020, 3, 8010620, 5, 7, 45, 10005025, 3),
(120017, 20033, 20005, 29, 1051, 1510, 1400104, 333, 334, 335, 336, 7030009, 2, 4, 5, 10008203, 3, 7030104, 3, 5, 10, 10008205, 3, 3940107, 12, 6, 30, 10008207, 3, 7030107, 5, 7, 40, 10008211, 3),
(120018, 20033, 20005, 33, 1051, 1510, 1400104, 333, 334, 335, 336, 8090503, 2, 4, 10, 10007104, 3, 8091106, 3, 5, 15, 10007104, 3, 8090902, 4, 6, 20, 10007126, 3, 8090204, 5, 7, 35, 10007116, 3),
(120019, 20033, 20005, 31, 1051, 1510, 1400104, 333, 334, 335, 336, 8011605, 2, 4, 20, 10002022, 2, 8011606, 3, 5, 20, 10002022, 2, 8011607, 4, 6, 30, 10002023, 2, 8011607, 5, 7, 30, 10002023, 2),
(120020, 20033, 20005, 31, 1051, 1509, 1900094, 329, 330, 331, 332, 8011710, 2, 4, 45, 10003025, 2, 8011710, 3, 5, 45, 10003025, 2, 8011712, 4, 6, 50, 10002024, 2, 8011712, 5, 7, 50, 10002024, 2),
(120021, 20033, 20004, 31, 1051, 1509, 1000333, 325, 326, 327, 328, 8030320, 2, 4, 35, 10002053, 3, 8031720, 3, 5, 45, 10003055, 3, 8031722, 4, 6, 50, 10002054, 3, 8031722, 5, 7, 50, 10002054, 3),
(120022, 20033, 20005, 32, 1051, 1510, 1400104, 333, 334, 335, 336, 8010808, 2, 4, 25, 10003013, 3, 8010210, 3, 5, 30, 10002023, 2, 8010833, 4, 6, 40, 10003015, 3, 8010823, 5, 7, 50, 10003014, 3),
(120023, 20033, 20005, 35, 1051, 1510, 1400104, 333, 334, 335, 336, 10009314, 8, 4, 40, 3011224, 2, 10009314, 3, 5, 15, 3011102, 4, 10009315, 4, 6, 30, 10006005, 2, 10009315, 10, 7, 45, 10006007, 2),
(120024, 20033, 20005, 36, 1051, 1509, 1900094, 329, 330, 331, 332, 3010605, 12, 4, 5, 3011451, 9, 3010605, 18, 5, 5, 3011451, 9, 3010611, 20, 6, 20, 3011452, 18, 3010607, 15, 7, 40, 3011455, 18),
(120025, 20033, 20005, 36, 1051, 1509, 1900094, 329, 330, 331, 332, 3010007, 10, 4, 10, 3011309, 3, 3010108, 15, 5, 15, 3011101, 3, 3010010, 16, 6, 20, 3011006, 3, 3010308, 10, 7, 45, 3011310, 12),
(120026, 20033, 20004, 36, 1051, 1510, 1400104, 333, 334, 335, 336, 3011501, 12, 4, 10, 3010609, 12, 3011504, 18, 5, 1, 3010604, 3, 3011505, 48, 6, 20, 3011008, 3, 3011535, 60, 7, 10, 3011506, 3),
(120027, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120028, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120029, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120030, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120031, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120032, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120033, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120034, 20033, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002011, 3, 3020002, 3, 5, 1, 10002011, 3, 3020002, 4, 6, 1, 10002011, 3, 3020002, 5, 7, 1, 10002011, 3),
(120035, 20034, 20005, 30, 1051, 1018, 1900056, 105, 107, 108, 106, 6010009, 2, 4, 5, 10002011, 3, 7020104, 3, 5, 10, 10002011, 3, 6010013, 4, 6, 35, 10002013, 3, 7020107, 5, 7, 45, 10003015, 3),
(120036, 20034, 20005, 31, 1051, 1018, 1900056, 105, 107, 108, 106, 10002052, 2, 4, 15, 10002012, 3, 10002053, 3, 5, 25, 10002013, 3, 10002053, 4, 6, 25, 10002013, 3, 10003055, 5, 7, 35, 10003015, 3),
(120037, 20034, 20005, 36, 1051, 1018, 1900056, 105, 107, 108, 106, 3010104, 10, 4, 15, 3011213, 3, 3010105, 18, 5, 5, 3011112, 3, 3010311, 12, 6, 35, 3011316, 3, 3010107, 15, 7, 30, 3011217, 3),
(120038, 20034, 20005, 34, 1051, 1018, 1900056, 105, 107, 108, 106, 8031224, 2, 4, 10, 10005001, 3, 8031121, 3, 5, 15, 10005005, 3, 8031419, 4, 6, 30, 10005015, 3, 8032303, 5, 7, 45, 10005025, 3),
(120039, 20034, 20005, 29, 1051, 1018, 1900056, 105, 107, 108, 106, 10008205, 2, 4, 10, 10008005, 3, 10008204, 3, 5, 15, 10008004, 3, 10008207, 4, 6, 20, 10008007, 3, 10008211, 5, 7, 30, 10008011, 3),
(120040, 20034, 20005, 33, 1051, 1018, 1900056, 105, 107, 108, 106, 8081016, 2, 4, 10, 10007104, 3, 8081311, 3, 5, 15, 10007104, 3, 8080517, 4, 6, 35, 10007116, 3, 8080521, 5, 7, 40, 10007125, 3),
(120041, 20034, 20005, 32, 1051, 1018, 1900056, 105, 107, 108, 106, 5020108, 2, 4, 10, 10006003, 3, 5020212, 3, 5, 30, 10006005, 3, 5020109, 4, 6, 40, 10006005, 3, 5020214, 5, 7, 45, 10006005, 3),
(120042, 20034, 20005, 35, 1051, 1018, 1900056, 105, 107, 108, 106, 3011527, 24, 4, 10, 3011415, 8, 3011524, 36, 5, 1, 3011524, 8, 3011532, 48, 6, 10, 3011404, 8, 3011536, 60, 7, 20, 10009405, 8),
(120043, 20034, 20005, 30, 1051, 1022, 1400076, 61, 63, 64, 62, 4040009, 2, 4, 15, 10002012, 3, 4040405, 3, 5, 25, 10002012, 3, 4020302, 4, 6, 30, 10002013, 3, 4070107, 5, 7, 45, 10002015, 3),
(120044, 20034, 20005, 31, 1051, 1022, 1400076, 61, 63, 64, 62, 10002022, 6, 4, 15, 10002012, 3, 10002023, 9, 5, 25, 10002013, 3, 10002023, 12, 6, 25, 10002013, 3, 10003025, 5, 7, 35, 10003015, 3),
(120045, 20034, 20005, 36, 1051, 1022, 1400076, 61, 63, 64, 62, 3010001, 10, 4, 15, 3011003, 3, 3010017, 6, 5, 50, 3011012, 3, 3010008, 8, 6, 40, 3011002, 3, 3010011, 15, 7, 35, 3011004, 3),
(120046, 20034, 20005, 34, 1051, 1022, 1400076, 61, 63, 64, 62, 8030423, 2, 4, 20, 10005005, 3, 8031417, 3, 5, 25, 10005005, 3, 8030520, 4, 6, 45, 10005025, 3, 8032305, 5, 7, 50, 10005033, 3),
(120047, 20034, 20005, 29, 1051, 1022, 1400076, 61, 63, 64, 62, 10008207, 2, 4, 20, 10008007, 3, 10008211, 3, 5, 30, 10008011, 3, 10008216, 4, 6, 40, 10008016, 3, 10008214, 5, 7, 45, 10008014, 3),
(120048, 20034, 20005, 33, 1051, 1022, 1400076, 61, 63, 64, 62, 8080224, 2, 4, 20, 10007104, 3, 8080513, 3, 5, 25, 10007126, 3, 8080427, 4, 6, 45, 10007116, 3, 8080712, 5, 7, 50, 10007116, 3),
(120049, 20034, 20005, 32, 1051, 1022, 1400076, 61, 63, 64, 62, 5020210, 2, 4, 20, 10006006, 3, 5020211, 3, 5, 25, 10006006, 3, 5020213, 4, 6, 35, 10006005, 3, 5020215, 5, 7, 50, 10006005, 3),
(120050, 20034, 20005, 35, 1051, 1022, 1400076, 61, 63, 64, 62, 3020002, 8, 4, 20, 10009611, 2, 3020525, 9, 5, 25, 10009611, 2, 3020201, 4, 6, 50, 10009508, 2, 3020402, 15, 7, 30, 10009605, 6),
(120051, 20034, 20005, 30, 1051, 1020, 1300073, 141, 143, 144, 142, 4040108, 2, 4, 40, 10002013, 3, 7020014, 3, 5, 40, 10003015, 3, 6040015, 4, 6, 50, 10002015, 3, 4020309, 5, 7, 50, 10002015, 3),
(120052, 20034, 20005, 31, 1051, 1020, 1300073, 141, 143, 144, 142, 10003025, 2, 4, 35, 10003015, 3, 10003025, 3, 5, 35, 10003015, 3, 10002024, 4, 6, 45, 10002015, 3, 10002024, 5, 7, 45, 10002015, 3),
(120053, 20034, 20005, 36, 1051, 1020, 1300073, 141, 143, 144, 142, 3010011, 6, 4, 35, 3011004, 3, 3010017, 6, 5, 50, 3011012, 3, 3010008, 8, 6, 40, 3011002, 3, 3010002, 20, 7, 25, 3011001, 3),
(120054, 20034, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002012, 3, 3020002, 3, 5, 1, 10002012, 3, 3020002, 4, 6, 1, 10002012, 3, 3020002, 5, 7, 1, 10002012, 3),
(120055, 20034, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002012, 3, 3020002, 3, 5, 1, 10002012, 3, 3020002, 4, 6, 1, 10002012, 3, 3020002, 5, 7, 1, 10002012, 3),
(120056, 20034, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002012, 3, 3020002, 3, 5, 1, 10002012, 3, 3020002, 4, 6, 1, 10002012, 3, 3020002, 5, 7, 1, 10002012, 3),
(120057, 20034, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002012, 3, 3020002, 3, 5, 1, 10002012, 3, 3020002, 4, 6, 1, 10002012, 3, 3020002, 5, 7, 1, 10002012, 3),
(120058, 20034, 20005, 1, 1, 1, 0, 1, 2, 3, 4, 3020002, 2, 4, 1, 10002012, 3, 3020002, 3, 5, 1, 10002012, 3, 3020002, 4, 6, 1, 10002012, 3, 3020002, 5, 7, 1, 10002012, 3),
(120059, 20034, 20005, 30, 1051, 1014, 1600125, 45, 47, 48, 46, 6020004, 2, 4, 5, 10002011, 3, 4030004, 3, 5, 10, 10002011, 3, 6030010, 4, 6, 15, 10002011, 3, 4030405, 5, 7, 35, 10002013, 3),
(120060, 20034, 20005, 34, 1051, 1014, 1600125, 45, 47, 48, 46, 8030819, 2, 4, 5, 10005001, 3, 8030821, 3, 5, 15, 10005005, 3, 8031224, 4, 6, 10, 10005001, 3, 8030220, 5, 7, 35, 10005020, 3),
(120061, 20034, 20005, 29, 1051, 1014, 1600125, 45, 47, 48, 46, 10008203, 2, 4, 1, 10008003, 3, 10008205, 3, 5, 10, 10008005, 3, 10008204, 4, 6, 15, 10008004, 3, 10008207, 5, 7, 20, 10008007, 3),
(120062, 20034, 20005, 33, 1051, 1014, 1600125, 45, 47, 48, 46, 8081118, 2, 4, 5, 10007101, 3, 8081120, 3, 5, 15, 10007126, 3, 8080529, 4, 6, 25, 10007126, 3, 8080541, 5, 7, 35, 10007116, 3),
(120063, 20034, 20005, 31, 1051, 1014, 1600125, 45, 47, 48, 46, 10002051, 2, 4, 5, 10002011, 3, 10002051, 3, 5, 5, 10002011, 3, 10002052, 4, 6, 15, 10002012, 3, 10002053, 5, 7, 25, 10002013, 3),
(120064, 20034, 20005, 32, 1051, 1014, 1600125, 45, 47, 48, 46, 5020106, 2, 4, 5, 10006003, 3, 5020108, 3, 5, 10, 10006003, 3, 5020011, 4, 6, 35, 10003013, 3, 5020109, 5, 7, 40, 10006005, 3),
(120065, 20034, 20005, 35, 1051, 1014, 1600125, 45, 47, 48, 46, 3011527, 24, 4, 10, 3011415, 8, 3011529, 36, 5, 1, 10009104, 2, 3011526, 48, 6, 1, 3011525, 8, 3011530, 60, 7, 1, 10009301, 6),
(120066, 20034, 20005, 36, 1051, 1014, 1600125, 45, 47, 48, 46, 3010301, 8, 4, 20, 3011301, 3, 3010303, 6, 5, 45, 10009502, 3, 3010305, 20, 6, 10, 3011303, 3, 3010308, 10, 7, 45, 3011310, 12),
(120067, 20034, 20005, 30, 1051, 1026, 2200258, 161, 163, 164, 162, 4030116, 2, 4, 40, 10003015, 3, 4020209, 3, 5, 45, 10002015, 3, 4040305, 4, 6, 45, 10002015, 3, 4030406, 5, 7, 50, 10002015, 3),
(120068, 20034, 20005, 31, 1051, 1026, 2200258, 161, 163, 164, 162, 10003055, 2, 4, 35, 10003015, 3, 10003055, 3, 5, 35, 10003015, 3, 10002054, 4, 6, 40, 10002015, 3, 10002054, 5, 7, 40, 10002015, 3),
(120069, 20034, 20005, 36, 1051, 1026, 2200258, 161, 163, 164, 162, 3010110, 4, 4, 45, 3011121, 3, 3010109, 6, 5, 40, 3011016, 3, 3010113, 16, 6, 25, 3011207, 3, 3010111, 10, 7, 50, 3011123, 3),
(120201, 20033, 20005, 30, 2001, 2017, 1300085, 365, 366, 367, 368, 10002011, 2, 4, 1, 6020004, 1, 10002011, 3, 5, 1, 8032501, 1, 10002011, 4, 6, 1, 8070320, 1, 10002011, 5, 7, 1, 8080615, 1),
(120202, 20033, 20005, 34, 2001, 2017, 1300085, 365, 366, 367, 368, 8030420, 2, 4, 1, 6060008, 1, 8030420, 3, 5, 1, 8032501, 1, 8030420, 4, 6, 1, 8070320, 1, 8030420, 5, 7, 1, 8080615, 1),
(120203, 20033, 20005, 29, 2001, 2017, 1300085, 365, 366, 367, 368, 10008203, 2, 4, 1, 6010009, 1, 10008203, 3, 5, 1, 8032501, 1, 10008203, 4, 6, 1, 8070320, 1, 10008203, 5, 7, 1, 8080615, 1),
(120204, 20033, 20005, 33, 2001, 2017, 1300085, 365, 366, 367, 368, 8080220, 2, 4, 1, 6050009, 1, 8080220, 3, 5, 1, 8032501, 1, 8080220, 4, 6, 1, 8070320, 1, 8080220, 5, 7, 1, 8080615, 1),
(120205, 20033, 20005, 31, 2001, 2017, 1300085, 365, 366, 367, 368, 10002071, 6, 4, 1, 6030009, 1, 10002071, 9, 5, 1, 8032501, 1, 10002071, 12, 6, 1, 8070320, 1, 10002071, 15, 7, 1, 8080615, 1),
(120206, 20033, 20005, 32, 2001, 2017, 1300085, 365, 366, 367, 368, 9050052, 2, 4, 1, 6040009, 1, 9050052, 3, 5, 1, 8032501, 1, 9050052, 4, 6, 1, 8070320, 1, 9050052, 5, 7, 1, 8080615, 1),
(120207, 20033, 20005, 35, 2001, 2017, 1300085, 365, 366, 367, 368, 3011530, 24, 4, 1, 6070009, 1, 3011530, 36, 5, 1, 8032501, 1, 3011530, 48, 6, 1, 8070320, 1, 3011530, 60, 7, 1, 8080615, 1),
(120208, 20033, 20005, 36, 2001, 2017, 1300085, 365, 366, 367, 368, 3010202, 12, 4, 1, 6080009, 1, 3010202, 18, 5, 1, 8032501, 1, 3010202, 24, 6, 1, 8070320, 1, 3010202, 30, 7, 1, 8080615, 1),
(120209, 20033, 20005, 30, 2001, 2001, 1100374, 337, 338, 339, 340, 6021003, 2, 4, 10, 10002011, 3, 6021004, 3, 5, 20, 10002012, 3, 6021005, 4, 6, 35, 10002013, 3, 6021007, 5, 7, 45, 10003015, 3),
(120210, 20033, 20005, 34, 2001, 2001, 1100374, 337, 338, 339, 340, 8030621, 2, 4, 45, 10005025, 3, 8030621, 3, 5, 45, 10005025, 3, 8030623, 4, 6, 50, 10005033, 3, 8030623, 5, 7, 50, 10005033, 3),
(120211, 20033, 20005, 29, 2001, 2001, 1100374, 337, 338, 339, 340, 4100604, 2, 4, 5, 10008203, 3, 4100605, 3, 5, 15, 10008205, 3, 4100110, 4, 6, 25, 10008207, 3, 4100111, 5, 7, 45, 10008216, 3),
(120212, 20033, 20005, 29, 2001, 2001, 1100374, 337, 338, 339, 340, 5030107, 2, 4, 15, 10008004, 3, 5030207, 3, 5, 25, 10008008, 3, 5030208, 4, 6, 35, 10008008, 3, 5030109, 5, 7, 40, 10008011, 3),
(120213, 20033, 20004, 29, 2001, 2001, 1100374, 337, 338, 339, 340, 4070204, 2, 4, 5, 10008203, 3, 4070208, 3, 5, 20, 10008205, 3, 4070212, 4, 6, 35, 10008211, 3, 4070213, 5, 7, 50, 10008214, 3),
(120214, 20033, 20005, 33, 2001, 2001, 1100374, 337, 338, 339, 340, 9010054, 2, 4, 5, 10007101, 3, 9010055, 3, 5, 15, 10007104, 3, 9010056, 4, 6, 25, 10007126, 3, 9010057, 5, 7, 40, 10007116, 3),
(120215, 20033, 20005, 33, 2001, 2001, 1100374, 337, 338, 339, 340, 10007104, 2, 4, 10, 10007003, 3, 10007126, 3, 5, 15, 10007016, 3, 10007116, 4, 6, 30, 10007018, 3, 10007127, 5, 7, 45, 10007020, 3),
(120216, 20033, 20004, 33, 2001, 2001, 1100374, 337, 338, 339, 340, 9040057, 2, 4, 15, 10007104, 3, 9040058, 3, 5, 25, 10007126, 3, 9040059, 4, 6, 35, 10007116, 3, 9040060, 5, 7, 45, 10007127, 3),
(120217, 20033, 20005, 31, 2001, 2001, 1100374, 337, 338, 339, 340, 8080819, 2, 4, 20, 10002012, 3, 8080821, 3, 5, 30, 10002023, 2, 8080823, 4, 6, 45, 10003025, 2, 8080825, 5, 7, 50, 10002024, 2),
(120218, 20033, 20005, 32, 2001, 2001, 1100374, 337, 338, 339, 340, 9010027, 2, 4, 15, 10003012, 3, 9010052, 3, 5, 30, 10006005, 3, 9010038, 4, 6, 40, 10003015, 3, 9010037, 5, 7, 40, 10003015, 3),
(120219, 20033, 20005, 35, 2001, 2001, 1100374, 337, 338, 339, 340, 3020102, 8, 4, 35, 10009507, 4, 3020102, 12, 5, 35, 10009507, 4, 3020519, 12, 6, 35, 10006010, 12, 3020519, 15, 7, 35, 10006010, 12),
(120220, 20033, 20005, 36, 2001, 2001, 1500110, 341, 342, 343, 344, 3010208, 6, 4, 35, 3011530, 12, 3010203, 15, 5, 20, 3010603, 12, 3010207, 16, 6, 25, 3011527, 3, 3010211, 10, 7, 50, 3011016, 3),
(120221, 20034, 20005, 30, 2001, 2017, 1100050, 181, 183, 184, 182, 7010004, 2, 4, 5, 10002011, 3, 6050012, 3, 5, 30, 10002012, 3, 7010010, 4, 6, 25, 10002012, 3, 6050014, 5, 7, 40, 10003015, 3),
(120222, 20034, 20005, 34, 2001, 2017, 1100050, 181, 183, 184, 182, 8070320, 2, 4, 1, 10005001, 3, 8070416, 3, 5, 5, 10005001, 3, 8070322, 4, 6, 15, 10005005, 3, 8070418, 5, 7, 20, 10005005, 3),
(120223, 20034, 20005, 29, 2001, 2017, 1100050, 181, 183, 184, 182, 4070006, 2, 4, 5, 10008203, 3, 4070009, 3, 5, 10, 10008203, 3, 4070011, 4, 6, 20, 10008204, 3, 4070104, 5, 7, 35, 10008205, 3),
(120224, 20034, 20005, 33, 2001, 2017, 1100050, 181, 183, 184, 182, 8070911, 2, 4, 20, 10007126, 3, 8070913, 3, 5, 30, 10007113, 3, 8070720, 4, 6, 45, 10007116, 3, 8070722, 5, 7, 50, 10007116, 3),
(120225, 20034, 20005, 31, 2001, 2017, 1100050, 181, 183, 184, 182, 4100709, 2, 4, 5, 10002021, 2, 8070606, 3, 5, 10, 10002021, 2, 5020306, 4, 6, 15, 10002011, 3, 8090105, 5, 7, 40, 10002023, 2),
(120226, 20034, 20005, 32, 2001, 2017, 1100050, 181, 183, 184, 182, 4020005, 2, 4, 5, 10006001, 3, 4020005, 3, 5, 5, 10006001, 3, 4020005, 4, 6, 5, 10006001, 3, 4020207, 5, 7, 15, 10003012, 3),
(120227, 20034, 20005, 35, 2001, 2017, 1100050, 181, 183, 184, 182, 10009208, 2, 4, 30, 10009502, 2, 10009206, 3, 5, 5, 3011407, 2, 10009207, 4, 6, 15, 3011011, 2, 10009207, 10, 7, 30, 3011117, 2),
(120228, 20034, 20005, 36, 2001, 2017, 1100050, 181, 183, 184, 182, 3010102, 12, 4, 1, 3011205, 3, 3010104, 15, 5, 15, 3011213, 3, 3010107, 12, 6, 30, 3011217, 3, 3010110, 10, 7, 45, 3011121, 3),
(120229, 20034, 20005, 29, 2001, 2021, 1600205, 185, 187, 188, 186, 5030029, 2, 4, 35, 10008109, 3, 5030031, 3, 5, 45, 10008112, 3, 5030209, 4, 6, 45, 10008016, 3, 5030035, 5, 7, 50, 10008115, 3),
(120230, 20034, 20005, 33, 2001, 2021, 1600205, 185, 187, 188, 186, 8031033, 2, 4, 45, 10007116, 3, 8031036, 3, 5, 45, 10007116, 3, 8031039, 4, 6, 45, 10007116, 3, 8031026, 5, 7, 50, 10007127, 3),
(120231, 20034, 20005, 30, 2001, 2021, 1600205, 185, 187, 188, 186, 6020012, 2, 4, 40, 10002013, 3, 6010014, 3, 5, 40, 10003015, 3, 7010013, 4, 6, 50, 10002015, 3, 6010015, 5, 7, 50, 10002015, 3),
(120232, 20034, 20005, 34, 2001, 2021, 1600205, 185, 187, 188, 186, 8070324, 2, 4, 45, 10005025, 3, 8070420, 3, 5, 45, 10005025, 3, 8070328, 4, 6, 50, 10005033, 3, 8070424, 5, 7, 50, 10005033, 3),
(120233, 20034, 20005, 31, 2001, 2033, 1200093, 197, 199, 200, 198, 8031609, 2, 4, 20, 10002022, 2, 8030320, 3, 5, 35, 10002053, 3, 8030109, 4, 6, 40, 10002023, 2, 8031610, 5, 7, 45, 10002013, 3),
(120234, 20034, 20005, 32, 2001, 2021, 1600205, 185, 187, 188, 186, 4020006, 2, 4, 35, 10006106, 3, 4020006, 3, 5, 35, 10006106, 3, 4020008, 4, 6, 45, 10006115, 3, 4020008, 5, 7, 45, 10006115, 3),
(120235, 20034, 20005, 35, 2001, 2033, 1200093, 197, 199, 200, 198, 10009208, 2, 4, 30, 10009502, 2, 10009207, 6, 5, 30, 3011117, 2, 10009207, 8, 6, 30, 3011117, 2, 10009208, 5, 7, 30, 10009502, 2),
(120236, 20034, 20005, 36, 2001, 2021, 1600205, 185, 187, 188, 186, 3010507, 4, 4, 40, 3011304, 6, 3010113, 12, 5, 25, 3011207, 3, 3010508, 8, 6, 45, 3011227, 3, 3010110, 10, 7, 45, 3011121, 3),
(120237, 20034, 20005, 29, 2001, 2025, 1400069, 189, 191, 192, 190, 4030706, 2, 4, 10, 10008205, 3, 4030707, 3, 5, 30, 10008204, 3, 4030708, 4, 6, 35, 10008207, 3, 4030709, 5, 7, 45, 10008211, 3),
(120238, 20034, 20005, 33, 2001, 2025, 1400069, 189, 191, 192, 190, 8031514, 2, 4, 10, 10007104, 3, 8031514, 3, 5, 10, 10007104, 3, 8031516, 4, 6, 40, 10007116, 3, 8031518, 5, 7, 45, 10007125, 3),
(120239, 20034, 20005, 30, 2001, 2025, 1400069, 189, 191, 192, 190, 4040103, 2, 4, 10, 10002011, 3, 4040304, 3, 5, 30, 10002013, 3, 4020307, 4, 6, 40, 10003015, 3, 4040207, 5, 7, 50, 10002015, 3),
(120240, 20034, 20005, 34, 2001, 2025, 1400069, 189, 191, 192, 190, 8070322, 2, 4, 15, 10005005, 3, 8070418, 3, 5, 20, 10005005, 3, 8071116, 4, 6, 30, 10005015, 3, 8071119, 5, 7, 40, 10005020, 3),
(120241, 20034, 20005, 31, 2001, 2025, 1400069, 189, 191, 192, 190, 8011106, 2, 4, 10, 10002021, 2, 8011404, 3, 5, 20, 10002022, 2, 8010005, 4, 6, 40, 10002023, 2, 8011406, 5, 7, 45, 10003025, 2),
(120242, 20034, 20005, 32, 2001, 2025, 1400069, 189, 191, 192, 190, 4020207, 2, 4, 15, 10003012, 3, 4020207, 3, 5, 15, 10003012, 3, 4020006, 4, 6, 35, 10006106, 3, 4020008, 5, 7, 45, 10006115, 3),
(120243, 20034, 20005, 35, 2001, 2025, 1400069, 189, 191, 192, 190, 3020002, 8, 4, 20, 10009611, 2, 3020522, 9, 5, 25, 10009210, 4, 3020201, 4, 6, 50, 10009508, 2, 3020515, 20, 7, 15, 10006104, 2),
(120244, 20034, 20005, 36, 2001, 2025, 1400069, 189, 191, 192, 190, 3010104, 10, 4, 15, 3011213, 3, 3010115, 12, 5, 25, 3011209, 3, 3010109, 8, 6, 40, 3011016, 3, 3010110, 10, 7, 45, 3011121, 3),
(120245, 20034, 20005, 29, 2001, 2029, 1900111, 193, 195, 196, 194, 5030030, 2, 4, 45, 10008112, 3, 5030032, 3, 5, 45, 10008112, 3, 5030033, 4, 6, 50, 10008115, 3, 5030034, 5, 7, 50, 10008115, 3),
(120246, 20034, 20005, 33, 2001, 2029, 1900111, 193, 195, 196, 194, 8031022, 2, 4, 45, 10007116, 3, 8031046, 3, 5, 50, 10007127, 3, 8031050, 4, 6, 50, 10007127, 3, 8031054, 5, 7, 50, 10007127, 3),
(120247, 20034, 20005, 29, 2001, 2033, 1200093, 197, 199, 200, 198, 4080406, 2, 4, 25, 10008205, 3, 4070306, 3, 5, 30, 10008205, 3, 4070307, 4, 6, 40, 10008211, 3, 4080407, 5, 7, 50, 10008214, 3),
(120248, 20034, 20005, 33, 2001, 2033, 1200093, 197, 199, 200, 198, 8031516, 2, 4, 40, 10007116, 3, 8031518, 3, 5, 45, 10007125, 3, 8031520, 4, 6, 50, 10007116, 3, 8031520, 5, 7, 50, 10007116, 3),
(120401, 20033, 20005, 30, 3051, 3011, 1200106, 369, 370, 371, 372, 4030110, 2, 4, 1, 6020004, 1, 4030110, 3, 5, 1, 8032501, 1, 4030110, 4, 6, 1, 8070320, 1, 4030110, 5, 7, 1, 8080615, 1),
(120402, 20033, 20005, 34, 3051, 3011, 1200106, 369, 370, 371, 372, 8050220, 2, 4, 1, 6060008, 1, 8050220, 3, 5, 1, 8032501, 1, 8050220, 4, 6, 1, 8070320, 1, 8050220, 5, 7, 1, 8080615, 1),
(120403, 20033, 20005, 29, 3051, 3011, 1200106, 369, 370, 371, 372, 10008203, 2, 4, 1, 6010009, 1, 10008203, 3, 5, 1, 8032501, 1, 10008203, 4, 6, 1, 8070320, 1, 10008203, 5, 7, 1, 8080615, 1),
(120404, 20033, 20005, 33, 3051, 3011, 1200106, 369, 370, 371, 372, 8080615, 2, 4, 1, 6050009, 1, 8080615, 3, 5, 1, 8032501, 1, 8080615, 4, 6, 1, 8070320, 1, 8080615, 5, 7, 1, 8080615, 1),
(120405, 20033, 20005, 31, 3051, 3011, 1200106, 369, 370, 371, 372, 10002071, 6, 4, 1, 6030009, 1, 10002071, 9, 5, 1, 8032501, 1, 10002071, 12, 6, 1, 8070320, 1, 10002071, 15, 7, 1, 8080615, 1),
(120406, 20033, 20005, 32, 3051, 3011, 1200106, 369, 370, 371, 372, 9050052, 2, 4, 1, 6040009, 1, 9050052, 3, 5, 1, 8032501, 1, 9050052, 4, 6, 1, 8070320, 1, 9050052, 5, 7, 1, 8080615, 1),
(120407, 20033, 20005, 35, 3051, 3011, 1200106, 369, 370, 371, 372, 3011529, 24, 4, 1, 6070009, 1, 3011529, 36, 5, 1, 8032501, 1, 3011529, 48, 6, 1, 8070320, 1, 3011529, 60, 7, 1, 8080615, 1),
(120408, 20033, 20005, 36, 3051, 3011, 1200106, 369, 370, 371, 372, 3010201, 12, 4, 1, 6080009, 1, 3010201, 18, 5, 1, 8032501, 1, 3010201, 24, 6, 1, 8070320, 1, 3010201, 30, 7, 1, 8080615, 1),
(120409, 20033, 20005, 30, 3051, 3509, 1600214, 357, 358, 359, 360, 4030203, 2, 4, 20, 10002012, 3, 4030008, 3, 5, 25, 10002012, 3, 4030304, 4, 6, 30, 10002013, 3, 4030204, 5, 7, 45, 10002015, 3),
(120410, 20033, 20005, 34, 3051, 3509, 1600214, 357, 358, 359, 360, 8050609, 2, 4, 5, 10005001, 3, 8050611, 3, 5, 25, 10005005, 3, 8050613, 4, 6, 45, 10005025, 3, 8050615, 5, 7, 50, 10005033, 3),
(120411, 20033, 20005, 34, 3051, 3509, 1600214, 357, 358, 359, 360, 8050712, 2, 4, 25, 10005015, 3, 8050716, 3, 5, 35, 10005020, 3, 8050741, 4, 6, 35, 10005020, 3, 8050720, 5, 7, 40, 10005025, 3),
(120412, 20033, 20004, 34, 3051, 3509, 1600214, 357, 358, 359, 360, 8050120, 2, 4, 35, 10005015, 3, 8050125, 3, 5, 40, 10005020, 3, 8050122, 4, 6, 45, 10005025, 3, 8050130, 5, 7, 50, 10005033, 3),
(120413, 20033, 20005, 29, 3051, 3509, 1300033, 353, 354, 355, 356, 8081404, 2, 4, 1, 10008203, 3, 8080320, 3, 5, 45, 10008211, 3, 8080320, 4, 6, 45, 10008211, 3, 8080324, 5, 7, 50, 10008216, 3),
(120414, 20033, 20005, 33, 3051, 3509, 1600214, 357, 358, 359, 360, 8050503, 2, 4, 10, 10007104, 3, 8050509, 3, 5, 40, 10007116, 3, 8050511, 4, 6, 45, 10007125, 3, 8050513, 5, 7, 50, 10007127, 3),
(120415, 20033, 20005, 31, 3051, 3509, 1600214, 357, 358, 359, 360, 4100709, 2, 4, 5, 10002021, 2, 4100307, 3, 5, 25, 10002022, 2, 4100711, 4, 6, 30, 10002023, 2, 4100204, 5, 7, 50, 10002024, 2),
(120416, 20033, 20005, 32, 3051, 3509, 1000213, 349, 350, 351, 352, 5020007, 2, 4, 5, 10003011, 3, 5020008, 3, 5, 15, 10003012, 3, 5020010, 4, 6, 30, 10003013, 3, 5020012, 5, 7, 45, 10003014, 3),
(120417, 20033, 20005, 32, 3051, 3509, 1000213, 349, 350, 351, 352, 9030022, 2, 4, 15, 10003012, 3, 9030048, 3, 5, 35, 10003015, 3, 9030038, 4, 6, 40, 10003015, 3, 9030041, 5, 7, 50, 10003014, 3),
(120418, 20033, 20004, 32, 3051, 3509, 1000213, 349, 350, 351, 352, 9040028, 2, 4, 20, 10003012, 3, 9040035, 3, 5, 30, 10003013, 3, 9040034, 4, 6, 30, 10003013, 3, 9040042, 5, 7, 40, 10003015, 3),
(120419, 20033, 20005, 35, 3051, 3509, 1300033, 353, 354, 355, 356, 10009313, 2, 4, 15, 10007001, 2, 10009302, 36, 5, 5, 10009301, 6, 10009307, 4, 6, 10, 10009306, 4, 10009201, 10, 7, 5, 10009108, 4),
(120420, 20033, 20005, 35, 3051, 3509, 1300033, 353, 354, 355, 356, 10009207, 4, 4, 30, 3011117, 2, 10009208, 3, 5, 30, 10009502, 2, 10009207, 8, 6, 30, 3011117, 2, 10009208, 5, 7, 30, 10009502, 2),
(120421, 20033, 20004, 35, 3051, 3509, 1300033, 353, 354, 355, 356, 3020308, 2, 4, 45, 3011133, 6, 3020303, 6, 5, 45, 10009406, 6, 3020304, 8, 6, 45, 10009606, 6, 3020307, 10, 7, 40, 3011212, 12),
(120422, 20033, 20005, 36, 3051, 3509, 1000213, 349, 350, 351, 352, 3010412, 10, 4, 10, 3011542, 3, 3010211, 6, 5, 50, 3011016, 3, 3010001, 20, 6, 15, 3011003, 3, 3010012, 10, 7, 45, 3011016, 3),
(120423, 20034, 20005, 30, 3051, 3011, 1500060, 201, 203, 204, 202, 7020009, 2, 4, 5, 10002011, 3, 6081005, 3, 5, 20, 10002012, 3, 6071006, 4, 6, 30, 10002013, 3, 6081007, 5, 7, 45, 10003015, 3),
(120424, 20034, 20005, 34, 3051, 3011, 1500060, 201, 203, 204, 202, 10005302, 2, 4, 15, 10005203, 12, 10005307, 3, 5, 25, 10005306, 12, 10005303, 4, 6, 30, 10005204, 12, 10005304, 5, 7, 40, 10005503, 12),
(120425, 20034, 20005, 29, 3051, 3011, 1500060, 201, 203, 204, 202, 4080205, 2, 4, 5, 10008203, 3, 4080206, 3, 5, 15, 10008204, 3, 4080208, 4, 6, 25, 10008207, 3, 4080209, 5, 7, 30, 10008207, 3),
(120426, 20034, 20005, 33, 3051, 3011, 1500060, 201, 203, 204, 202, 8071013, 2, 4, 1, 10007101, 3, 4020107, 3, 5, 5, 10007101, 3, 8030920, 4, 6, 20, 10007126, 3, 9010057, 5, 7, 40, 10007116, 3),
(120427, 20034, 20005, 31, 3051, 3011, 1500060, 201, 203, 204, 202, 6070009, 2, 4, 5, 10002021, 2, 4100504, 3, 5, 15, 10002021, 2, 6070012, 4, 6, 30, 10002013, 3, 6080014, 5, 7, 40, 10002023, 2),
(120428, 20034, 20005, 32, 3051, 3011, 1500060, 201, 203, 204, 202, 10004102, 2, 4, 15, 10004002, 3, 10004106, 3, 5, 15, 10004006, 3, 10004109, 4, 6, 25, 10004009, 3, 10004113, 5, 7, 40, 10004013, 3),
(120429, 20034, 20005, 35, 3051, 3011, 1500060, 201, 203, 204, 202, 3020002, 8, 4, 20, 10009611, 2, 3020525, 9, 5, 25, 10009611, 2, 3020528, 12, 6, 25, 10009507, 4, 3020522, 15, 7, 25, 10009210, 4),
(120430, 20034, 20005, 36, 3051, 3011, 1500060, 201, 203, 204, 202, 3010102, 12, 4, 1, 3011205, 3, 3010019, 6, 5, 40, 3011458, 3, 3010403, 16, 6, 20, 3011453, 3, 3010402, 20, 7, 20, 3011502, 12),
(120431, 20034, 20005, 35, 3051, 3014, 1100072, 205, 207, 208, 206, 3011536, 24, 4, 20, 10009405, 8, 3011536, 36, 5, 20, 10009405, 8, 3011536, 48, 6, 20, 10009405, 8, 3011536, 60, 7, 20, 10009405, 8),
(120432, 20034, 20005, 32, 3051, 3014, 1100072, 205, 207, 208, 206, 9050027, 2, 4, 5, 10003011, 3, 9050028, 3, 5, 15, 10003012, 3, 9050029, 4, 6, 25, 10003013, 3, 9050030, 5, 7, 40, 10003015, 3),
(120433, 20034, 20005, 34, 3051, 3014, 1100072, 205, 207, 208, 206, 10005005, 2, 4, 15, 10005302, 6, 10005015, 3, 5, 25, 10005307, 6, 10005020, 4, 6, 30, 10005303, 6, 10005025, 5, 7, 40, 10005304, 6),
(120434, 20034, 20005, 30, 3051, 3014, 1100072, 205, 207, 208, 206, 4020206, 2, 4, 10, 10002011, 3, 7010104, 3, 5, 20, 10002012, 3, 4020208, 4, 6, 25, 10002012, 3, 7010107, 5, 7, 45, 10003015, 3),
(120435, 20034, 20005, 29, 3051, 3014, 1100072, 205, 207, 208, 206, 4080008, 2, 4, 10, 10008203, 3, 4080304, 3, 5, 30, 10008207, 3, 4080009, 4, 6, 40, 10008207, 3, 4080305, 5, 7, 45, 10008211, 3),
(120436, 20034, 20005, 33, 3051, 3014, 1100072, 205, 207, 208, 206, 4070205, 2, 4, 10, 10007104, 3, 4070210, 3, 5, 25, 10007126, 3, 8030922, 4, 6, 30, 10007113, 3, 8070520, 5, 7, 40, 10007125, 3),
(120437, 20034, 20005, 31, 3051, 3014, 1100072, 205, 207, 208, 206, 8070606, 2, 4, 10, 10002021, 2, 8070218, 3, 5, 20, 10002022, 2, 8070109, 4, 6, 40, 10002023, 2, 8070610, 5, 7, 50, 10002024, 2),
(120438, 20034, 20005, 36, 3051, 3014, 1100072, 205, 207, 208, 206, 3010019, 4, 4, 40, 3011458, 3, 3010306, 9, 5, 35, 3011512, 3, 3010206, 16, 6, 20, 3011524, 12, 3010208, 15, 7, 35, 3011530, 12),
(120439, 20034, 20005, 35, 3051, 3018, 1600028, 209, 211, 212, 210, 3020409, 4, 4, 50, 10009508, 2, 3020003, 6, 5, 40, 10009402, 2, 3020404, 8, 6, 40, 10009606, 6, 3020403, 20, 7, 15, 10009406, 6),
(120440, 20034, 20005, 32, 3051, 3018, 1600028, 209, 211, 212, 210, 8010419, 2, 4, 15, 10003012, 3, 8010423, 3, 5, 15, 10003012, 3, 8010440, 4, 6, 30, 10003013, 3, 8010442, 5, 7, 30, 10003013, 3),
(120441, 20034, 20005, 34, 3051, 3018, 1600028, 209, 211, 212, 210, 8030717, 2, 4, 25, 10005015, 3, 8030728, 3, 5, 25, 10005015, 3, 8030730, 4, 6, 25, 10005015, 3, 8030720, 5, 7, 35, 10005020, 3),
(120442, 20034, 20005, 30, 3051, 3018, 1600028, 209, 211, 212, 210, 6051005, 2, 4, 20, 10002012, 3, 6031006, 3, 5, 35, 10002013, 3, 6051007, 4, 6, 45, 10003015, 3, 6030015, 5, 7, 50, 10002015, 3),
(120443, 20034, 20005, 29, 3051, 3018, 1600028, 209, 211, 212, 210, 4080104, 2, 4, 20, 10008203, 3, 4080105, 3, 5, 35, 10008207, 3, 4080106, 4, 6, 40, 10008211, 3, 4080210, 5, 7, 50, 10008216, 3),
(120444, 20034, 20005, 33, 3051, 3018, 1600028, 209, 211, 212, 210, 4020108, 2, 4, 20, 10007104, 3, 4100007, 3, 5, 30, 10007126, 3, 8071204, 4, 6, 35, 10007116, 3, 8050809, 5, 7, 45, 10007116, 3),
(120445, 20034, 20005, 31, 3051, 3018, 1600028, 209, 211, 212, 210, 6080011, 2, 4, 25, 10002022, 2, 8090804, 3, 5, 35, 10002023, 2, 8080109, 4, 6, 40, 10002023, 2, 8070224, 5, 7, 50, 10002024, 2),
(120446, 20034, 20005, 36, 3051, 3018, 1600028, 209, 211, 212, 210, 3010402, 8, 4, 20, 3011502, 12, 3010008, 6, 5, 40, 3011002, 3, 3010011, 12, 6, 35, 3011004, 3, 3010208, 15, 7, 35, 3011530, 12),
(120447, 20034, 20005, 35, 3051, 3022, 2200114, 213, 215, 216, 214, 3020526, 4, 4, 40, 10007024, 2, 3020517, 6, 5, 45, 10006015, 2, 3020103, 8, 6, 50, 10009508, 2, 3020514, 10, 7, 50, 10006005, 2),
(120448, 20034, 20005, 32, 3051, 3022, 2200114, 213, 215, 216, 214, 9050054, 2, 4, 45, 10006110, 3, 9050031, 3, 5, 50, 10003014, 3, 9050046, 4, 6, 50, 10003014, 3, 9050051, 5, 7, 50, 10003014, 3),
(120449, 20034, 20005, 34, 3051, 3022, 2200114, 213, 215, 216, 214, 10005025, 2, 4, 40, 10005304, 6, 10005025, 3, 5, 40, 10005304, 6, 10005033, 4, 6, 40, 10005504, 12, 10005033, 5, 7, 40, 10005504, 12),
(120450, 20034, 20005, 35, 3051, 3026, 1300070, 217, 219, 220, 218, 3020405, 6, 4, 30, 10009401, 6, 3020201, 3, 5, 50, 10009508, 2, 3020407, 8, 6, 35, 3011212, 8, 3020408, 10, 7, 45, 3011133, 6),
(120451, 20034, 20005, 32, 3051, 3026, 1300070, 217, 219, 220, 218, 8010446, 2, 4, 40, 10003015, 3, 8010447, 3, 5, 40, 10003015, 3, 8010449, 4, 6, 50, 10003014, 3, 8010454, 5, 7, 50, 10003014, 3),
(120452, 20034, 20005, 34, 3051, 3026, 1300070, 217, 219, 220, 218, 8030734, 2, 4, 35, 10005020, 3, 8030736, 3, 5, 35, 10005020, 3, 8030723, 4, 6, 40, 10005025, 3, 8030741, 5, 7, 40, 10005025, 3);
/*!40000 ALTER TABLE `gamedata_passivegl_craft` ENABLE KEYS */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

File diff suppressed because it is too large Load Diff

View File

@@ -27,7 +27,7 @@ ECHO Creating new database
ECHO Loading tables into the database ECHO Loading tables into the database
cd %PATH_SQL% cd %PATH_SQL%
FOR %%X IN (*.sql) DO ECHO Importing %%X & %PATH_MYSQL% %DBNAME% -h %DBADDRESS% -u %USER% < %%X FOR %%X IN (*.sql) DO ECHO Importing %%X & %PATH_MYSQL% %DBNAME% -h %DBADDRESS% -u %USER% %PASSWORD% < %%X
ECHO Finished! ECHO Finished!
ENDLOCAL ENDLOCAL

View File

@@ -70,57 +70,75 @@ namespace Meteor.Lobby
try try
{ {
conn.Open(); conn.Open();
pid = 0;
//Check if exists cid = 0;
MySqlCommand cmd = new MySqlCommand("SELECT * FROM characters WHERE name=@name AND serverId=@serverId AND state != 2 AND state != 1", conn); //Check if there exists a character not reserved by the user with the same name and in the same server
MySqlCommand cmd = new MySqlCommand("SELECT * FROM characters WHERE (name=@name AND serverId=@serverId AND (userId!=@userId OR state!=0))", conn);
cmd.Parameters.AddWithValue("@serverId", serverId); cmd.Parameters.AddWithValue("@serverId", serverId);
cmd.Parameters.AddWithValue("@name", name); cmd.Parameters.AddWithValue("@name", name);
cmd.Parameters.AddWithValue("@userId", userId);
using (MySqlDataReader Reader = cmd.ExecuteReader()) using (MySqlDataReader Reader = cmd.ExecuteReader())
{ {
if (Reader.HasRows) if (Reader.HasRows)
{ {
alreadyExists = true; Program.Log.Debug("[SQL] Found character with same name. Exiting...");
return true; //Early exit as we don't need to bother with anything else in this.
} }
} }
//Reserve //Now check for a reserved character
if (!alreadyExists) MySqlCommand cmd3 = new MySqlCommand("SELECT * FROM characters WHERE userId=@userId AND state=0", conn);
cmd3.Parameters.AddWithValue("@userId", userId);
using (MySqlDataReader Reader = cmd3.ExecuteReader())
{
if (Reader.HasRows) //We can reasonably assume that there's only one reserved character per used id
{
Reader.Read();
cid = Reader.GetUInt16(0);
pid = 0xBABE;
}
}
if (cid != 0) //Update our reservation
{
MySqlCommand cmd2 = new MySqlCommand();
cmd2.Connection = conn;
cmd2.CommandText = "UPDATE characters SET serverId = @serverId, name = @name WHERE id = @cid";
cmd2.Parameters.AddWithValue("@serverId", serverId);
cmd2.Parameters.AddWithValue("@name", name);
cmd2.Parameters.AddWithValue("@cid", cid);
cmd2.Prepare();
cmd2.ExecuteNonQuery();
} else //Reserve
{ {
MySqlCommand cmd2 = new MySqlCommand(); MySqlCommand cmd2 = new MySqlCommand();
cmd2.Connection = conn; cmd2.Connection = conn;
cmd2.CommandText = "INSERT INTO characters(userId, slot, serverId, name, state) VALUES(@userId, @slot, @serverId, @name, 0)"; cmd2.CommandText = "INSERT INTO characters(userId, slot, serverId, name, state) VALUES(@userId, @slot, @serverId, @name, 0)";
cmd2.Prepare();
cmd2.Parameters.AddWithValue("@userId", userId); cmd2.Parameters.AddWithValue("@userId", userId);
cmd2.Parameters.AddWithValue("@slot", slot); cmd2.Parameters.AddWithValue("@slot", slot);
cmd2.Parameters.AddWithValue("@serverId", serverId); cmd2.Parameters.AddWithValue("@serverId", serverId);
cmd2.Parameters.AddWithValue("@name", name); cmd2.Parameters.AddWithValue("@name", name);
cmd2.Prepare();
cmd2.ExecuteNonQuery(); cmd2.ExecuteNonQuery();
cid = (ushort)cmd2.LastInsertedId; cid = (ushort)cmd2.LastInsertedId;
pid = 0xBABE; pid = 0xBABE;
} }
else
{
pid = 0;
cid = 0;
}
} }
catch (MySqlException e) catch (MySqlException e)
{ {
Program.Log.Error(e.ToString()); Program.Log.Error(e.ToString());
Program.Log.Error(e.ToString()); Program.Log.Error(e.ToString());
pid = 0;
cid = 0; cid = 0;
pid = 0;
} }
finally finally
{ {
conn.Dispose(); conn.Dispose();
} }
Program.Log.Debug("[SQL] CID={0} Created on 'characters' table.", cid); Program.Log.Debug("[SQL] CID={0} Created on 'characters' table.", cid);
} }
return alreadyExists; return alreadyExists;
} }
@@ -216,13 +234,17 @@ namespace Meteor.Lobby
{ {
MySqlCommand cmd = new MySqlCommand(); MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn; cmd.Connection = conn;
cmd.CommandText = String.Format("INSERT INTO characters_class_levels(characterId, {0}) VALUES(@characterId, 1); INSERT INTO characters_class_exp(characterId) VALUES(@characterId)", CharacterCreatorUtils.GetClassNameForId((short)charaInfo.currentClass)); cmd.CommandText = String.Format("INSERT INTO characters_class_levels(characterId, {0}) VALUES(@characterId, 1);", CharacterCreatorUtils.GetClassNameForId((short)charaInfo.currentClass));
cmd.Prepare();
cmd.Parameters.AddWithValue("@characterId", cid); cmd.Parameters.AddWithValue("@characterId", cid);
cmd.Prepare();
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
MySqlCommand cmd2 = new MySqlCommand();
cmd.Connection = conn;
cmd.CommandText = String.Format("INSERT INTO characters_class_exp(characterId) VALUES(@characterId2)");
cmd.Parameters.AddWithValue("@characterId2", cid);
cmd.Prepare();
cmd.ExecuteNonQuery();
} }
catch (MySqlException e) catch (MySqlException e)
{ {
@@ -238,11 +260,9 @@ namespace Meteor.Lobby
MySqlCommand cmd = new MySqlCommand(); MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn; cmd.Connection = conn;
cmd.CommandText = String.Format("INSERT INTO characters_parametersave(characterId, hp, hpMax, mp, mpMax, mainSkill, mainSkillLevel) VALUES(@characterId, 1900, 1000, 115, 115, @mainSkill, 1);", CharacterCreatorUtils.GetClassNameForId((short)charaInfo.currentClass)); cmd.CommandText = String.Format("INSERT INTO characters_parametersave(characterId, hp, hpMax, mp, mpMax, mainSkill, mainSkillLevel) VALUES(@characterId, 1900, 1000, 115, 115, @mainSkill, 1);", CharacterCreatorUtils.GetClassNameForId((short)charaInfo.currentClass));
cmd.Prepare();
cmd.Parameters.AddWithValue("@characterId", cid); cmd.Parameters.AddWithValue("@characterId", cid);
cmd.Parameters.AddWithValue("@mainSkill", charaInfo.currentClass); cmd.Parameters.AddWithValue("@mainSkill", charaInfo.currentClass);
cmd.Prepare();
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
@@ -259,9 +279,8 @@ namespace Meteor.Lobby
MySqlCommand cmd = new MySqlCommand(); MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn; cmd.Connection = conn;
cmd.CommandText = "SELECT id FROM server_battle_commands WHERE classJob = @classjob AND lvl = 1 ORDER BY id DESC"; cmd.CommandText = "SELECT id FROM server_battle_commands WHERE classJob = @classjob AND lvl = 1 ORDER BY id DESC";
cmd.Prepare();
cmd.Parameters.AddWithValue("@classJob", charaInfo.currentClass); cmd.Parameters.AddWithValue("@classJob", charaInfo.currentClass);
cmd.Prepare();
List<uint> defaultActions = new List<uint>(); List<uint> defaultActions = new List<uint>();
using (var reader = cmd.ExecuteReader()) using (var reader = cmd.ExecuteReader())
{ {
@@ -273,7 +292,6 @@ namespace Meteor.Lobby
MySqlCommand cmd2 = new MySqlCommand(); MySqlCommand cmd2 = new MySqlCommand();
cmd2.Connection = conn; cmd2.Connection = conn;
cmd2.CommandText = "INSERT INTO characters_hotbar (characterId, classId, hotbarSlot, commandId, recastTime) VALUES (@characterId, @classId, @hotbarSlot, @commandId, 0)"; cmd2.CommandText = "INSERT INTO characters_hotbar (characterId, classId, hotbarSlot, commandId, recastTime) VALUES (@characterId, @classId, @hotbarSlot, @commandId, 0)";
cmd2.Prepare();
cmd2.Parameters.AddWithValue("@characterId", cid); cmd2.Parameters.AddWithValue("@characterId", cid);
cmd2.Parameters.AddWithValue("@classId", charaInfo.currentClass); cmd2.Parameters.AddWithValue("@classId", charaInfo.currentClass);
cmd2.Parameters.Add("@hotbarSlot", MySqlDbType.Int16); cmd2.Parameters.Add("@hotbarSlot", MySqlDbType.Int16);
@@ -283,6 +301,7 @@ namespace Meteor.Lobby
{ {
cmd2.Parameters["@hotbarSlot"].Value = i; cmd2.Parameters["@hotbarSlot"].Value = i;
cmd2.Parameters["@commandId"].Value = defaultActions[i]; cmd2.Parameters["@commandId"].Value = defaultActions[i];
cmd2.Prepare();
cmd2.ExecuteNonQuery(); cmd2.ExecuteNonQuery();
} }
} }
@@ -322,10 +341,10 @@ namespace Meteor.Lobby
cmd = new MySqlCommand(); cmd = new MySqlCommand();
cmd.Connection = conn; cmd.Connection = conn;
cmd.CommandText = "UPDATE characters SET name=@name, DoRename=0 WHERE id=@cid AND userId=@uid"; cmd.CommandText = "UPDATE characters SET name=@name, DoRename=0 WHERE id=@cid AND userId=@uid";
cmd.Prepare();
cmd.Parameters.AddWithValue("@uid", userId); cmd.Parameters.AddWithValue("@uid", userId);
cmd.Parameters.AddWithValue("@cid", characterId); cmd.Parameters.AddWithValue("@cid", characterId);
cmd.Parameters.AddWithValue("@name", newName); cmd.Parameters.AddWithValue("@name", newName);
cmd.Prepare();
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
@@ -356,9 +375,9 @@ namespace Meteor.Lobby
MySqlCommand cmd = new MySqlCommand(); MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn; cmd.Connection = conn;
cmd.CommandText = "UPDATE characters SET state=1 WHERE id=@cid AND name=@name"; cmd.CommandText = "UPDATE characters SET state=1 WHERE id=@cid AND name=@name";
cmd.Prepare();
cmd.Parameters.AddWithValue("@cid", characterId); cmd.Parameters.AddWithValue("@cid", characterId);
cmd.Parameters.AddWithValue("@name", name); cmd.Parameters.AddWithValue("@name", name);
cmd.Prepare();
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }

View File

@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Meteor.Lobby</RootNamespace> <RootNamespace>Meteor.Lobby</RootNamespace>
<AssemblyName>Lobby Server</AssemblyName> <AssemblyName>Lobby Server</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper> <IsWebBootstrapper>false</IsWebBootstrapper>
<NuGetPackageImportStamp>cc1ba6f5</NuGetPackageImportStamp> <NuGetPackageImportStamp>cc1ba6f5</NuGetPackageImportStamp>
@@ -74,20 +74,49 @@
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Cyotek.Collections.Generic.CircularBuffer"> <Reference Include="Cyotek.Collections.Generic.CircularBuffer">
<HintPath>..\packages\Cyotek.CircularBuffer.1.0.0.0\lib\net20\Cyotek.Collections.Generic.CircularBuffer.dll</HintPath> <HintPath>..\packages\Cyotek.CircularBuffer.1.0.0.0\lib\net20\Cyotek.Collections.Generic.CircularBuffer.dll</HintPath>
</Reference> </Reference>
<Reference Include="MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath>
<Private>True</Private> </Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=8.0.31.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.8.0.31\lib\net452\MySql.Data.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.0\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.5.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" /> <Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" /> <Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" /> <Reference Include="System.Transactions" />
@@ -96,6 +125,9 @@
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="ZstdNet, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.8.0.31\lib\net452\ZstdNet.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="DataObjects\Account.cs" /> <Compile Include="DataObjects\Account.cs" />

View File

@@ -1,9 +1,13 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<system.data>
<DbProviderFactories> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /></startup>
<remove invariant="MySql.Data.MySqlClient"/> <runtime>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
</DbProviderFactories> <dependentAssembly>
</system.data> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration> <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -1,7 +1,16 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Cyotek.CircularBuffer" version="1.0.0.0" targetFramework="net45" /> <package id="Cyotek.CircularBuffer" version="1.0.0.0" targetFramework="net45" />
<package id="Google.Protobuf" version="3.19.4" targetFramework="net472" />
<package id="K4os.Compression.LZ4" version="1.2.6" targetFramework="net472" />
<package id="K4os.Compression.LZ4.Streams" version="1.2.6" targetFramework="net472" />
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net472" />
<package id="Microsoft.Net.Compilers" version="2.0.0-beta3" targetFramework="net45" developmentDependency="true" /> <package id="Microsoft.Net.Compilers" version="2.0.0-beta3" targetFramework="net45" developmentDependency="true" />
<package id="MySql.Data" version="6.9.8" targetFramework="net45" /> <package id="MySql.Data" version="8.0.31" targetFramework="net472" />
<package id="NLog" version="4.5.0" targetFramework="net451" /> <package id="NLog" version="4.5.0" targetFramework="net451" />
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" />
</packages> </packages>

View File

@@ -363,7 +363,7 @@ namespace Meteor.Map.Actors
return packets; return packets;
} }
public override bool Equals(object obj) public override bool Equals(Object obj)
{ {
Actor actorObj = obj as Actor; Actor actorObj = obj as Actor;
if (actorObj == null) if (actorObj == null)
@@ -508,7 +508,7 @@ namespace Meteor.Map.Actors
.Replace("Object", "Obj") .Replace("Object", "Obj")
.Replace("Retainer", "Rtn") .Replace("Retainer", "Rtn")
.Replace("Standard", "Std"); .Replace("Standard", "Std");
className = char.ToLowerInvariant(className[0]) + className.Substring(1); className = Char.ToLowerInvariant(className[0]) + className.Substring(1);
//Format Zone Name //Format Zone Name
string zoneName = zone.zoneName.Replace("Field", "Fld") string zoneName = zone.zoneName.Replace("Field", "Fld")
@@ -524,7 +524,7 @@ namespace Meteor.Map.Actors
//Check if "normal" //Check if "normal"
zoneName = zoneName.Remove(zoneName.Length - 1, 1) + "P"; zoneName = zoneName.Remove(zoneName.Length - 1, 1) + "P";
} }
zoneName = char.ToLowerInvariant(zoneName[0]) + zoneName.Substring(1); zoneName = Char.ToLowerInvariant(zoneName[0]) + zoneName.Substring(1);
try try
{ {
@@ -542,7 +542,7 @@ namespace Meteor.Map.Actors
if (zone is PrivateArea) if (zone is PrivateArea)
privLevel = ((PrivateArea)zone).GetPrivateAreaType(); privLevel = ((PrivateArea)zone).GetPrivateAreaType();
actorName = string.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel); actorName = String.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel);
} }
public bool SetWorkValue(Player player, string name, string uiFunc, object value) public bool SetWorkValue(Player player, string name, string uiFunc, object value)
@@ -553,8 +553,8 @@ namespace Meteor.Map.Actors
if (!(split[0].Equals("work") || split[0].Equals("charaWork") || split[0].Equals("playerWork") || split[0].Equals("npcWork"))) if (!(split[0].Equals("work") || split[0].Equals("charaWork") || split[0].Equals("playerWork") || split[0].Equals("npcWork")))
return false; return false;
object parentObj = null; Object parentObj = null;
object curObj = this; Object curObj = this;
for (int i = 0; i < split.Length; i++) for (int i = 0; i < split.Length; i++)
{ {
//For arrays //For arrays
@@ -759,7 +759,7 @@ namespace Meteor.Map.Actors
{ {
if (target == null) if (target == null)
{ {
Program.Log.Error(string.Format("[{0} {1}] FindRandomPointAroundTarget: no target found!", this.actorId, this.customDisplayName)); Program.Log.Error(String.Format("[{0} {1}] FindRandomPointAroundTarget: no target found!", this.actorId, this.customDisplayName));
return GetPosAsVector3(); return GetPosAsVector3();
} }
return FindRandomPoint(target.positionX, target.positionY, target.positionZ, minRadius, maxRadius); return FindRandomPoint(target.positionX, target.positionY, target.positionZ, minRadius, maxRadius);

View File

@@ -48,7 +48,7 @@ namespace Meteor.Map.Actors
protected int halfWidth, halfHeight; protected int halfWidth, halfHeight;
private Dictionary<uint, Director> currentDirectors = new Dictionary<uint, Director>(); private Dictionary<uint, Director> currentDirectors = new Dictionary<uint, Director>();
private object directorLock = new object(); private Object directorLock = new Object();
private uint directorIdCount = 0; private uint directorIdCount = 0;
protected Director mWeatherDirector; protected Director mWeatherDirector;
@@ -77,7 +77,7 @@ namespace Meteor.Map.Actors
this.displayNameId = 0; this.displayNameId = 0;
this.customDisplayName = "_areaMaster"; this.customDisplayName = "_areaMaster";
this.actorName = string.Format("_areaMaster@{0:X5}", id << 8); this.actorName = String.Format("_areaMaster@{0:X5}", id << 8);
this.classPath = classPath; this.classPath = classPath;
this.className = classPath.Substring(classPath.LastIndexOf("/") + 1); this.className = classPath.Substring(classPath.LastIndexOf("/") + 1);
@@ -611,7 +611,7 @@ namespace Meteor.Map.Actors
public Director CreateGuildleveDirector(uint glid, byte difficulty, Player owner, params object[] args) public Director CreateGuildleveDirector(uint glid, byte difficulty, Player owner, params object[] args)
{ {
string directorScriptPath = ""; String directorScriptPath = "";
uint type = Server.GetGuildleveGamedata(glid).plateId; uint type = Server.GetGuildleveGamedata(glid).plateId;
@@ -677,11 +677,6 @@ namespace Meteor.Map.Actors
return null; return null;
} }
public ushort GetCurrentMusic()
{
return bgmDay;
}
public override void Update(DateTime tick) public override void Update(DateTime tick)
{ {
lock (mActorList) lock (mActorList)
@@ -696,5 +691,6 @@ namespace Meteor.Map.Actors
} }
} }
} }
} }
} }

View File

@@ -32,7 +32,7 @@ namespace Meteor.Map.actors.area
private Director currentDirector; private Director currentDirector;
private bool isContentFinished = false; private bool isContentFinished = false;
public static PrivateAreaContent CreateContentArea(string scriptPath) public static PrivateAreaContent CreateContentArea(String scriptPath)
{ {
return null; return null;
} }

View File

@@ -33,14 +33,14 @@ namespace Meteor.Map.actors.area
{ {
Dictionary<string, Dictionary<uint, PrivateArea>> privateAreas = new Dictionary<string, Dictionary<uint, PrivateArea>>(); Dictionary<string, Dictionary<uint, PrivateArea>> privateAreas = new Dictionary<string, Dictionary<uint, PrivateArea>>();
Dictionary<string, List<PrivateAreaContent>> contentAreas = new Dictionary<string, List<PrivateAreaContent>>(); Dictionary<string, List<PrivateAreaContent>> contentAreas = new Dictionary<string, List<PrivateAreaContent>>();
object contentAreasLock = new object(); Object contentAreasLock = new Object();
public SharpNav.TiledNavMesh tiledNavMesh; public SharpNav.TiledNavMesh tiledNavMesh;
public SharpNav.NavMeshQuery navMeshQuery; public SharpNav.NavMeshQuery navMeshQuery;
public long pathCalls; public Int64 pathCalls;
public long prevPathCalls = 0; public Int64 prevPathCalls = 0;
public long pathCallTime; public Int64 pathCallTime;
public Zone(uint id, string zoneName, ushort regionId, string classPath, ushort bgmDay, ushort bgmNight, ushort bgmBattle, bool isIsolated, bool isInn, bool canRideChocobo, bool canStealth, bool isInstanceRaid, bool loadNavMesh = false) public Zone(uint id, string zoneName, ushort regionId, string classPath, ushort bgmDay, ushort bgmNight, ushort bgmBattle, bool isIsolated, bool isInn, bool canRideChocobo, bool canStealth, bool isInstanceRaid, bool loadNavMesh = false)
: base(id, zoneName, regionId, classPath, bgmDay, bgmNight, bgmBattle, isIsolated, isInn, canRideChocobo, canStealth, isInstanceRaid) : base(id, zoneName, regionId, classPath, bgmDay, bgmNight, bgmBattle, isIsolated, isInn, canRideChocobo, canStealth, isInstanceRaid)

View File

@@ -152,7 +152,7 @@ namespace Meteor.Map.Actors
public uint extraUint; public uint extraUint;
public float extraFloat; public float extraFloat;
protected Dictionary<string, ulong> tempVars = new Dictionary<string, ulong>(); protected Dictionary<string, UInt64> tempVars = new Dictionary<string, UInt64>();
//Inventory //Inventory
protected Dictionary<ushort, ItemPackage> itemPackages = new Dictionary<ushort, ItemPackage>(); protected Dictionary<ushort, ItemPackage> itemPackages = new Dictionary<ushort, ItemPackage>();
@@ -227,8 +227,8 @@ namespace Meteor.Map.Actors
{ {
if (!effect.GetHidden()) if (!effect.GetHidden())
{ {
propPacketUtil.AddProperty(string.Format("charaWork.statusShownTime[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.statusShownTime[{0}]", i));
propPacketUtil.AddProperty(string.Format("charaWork.statusShownTime[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.statusShownTime[{0}]", i));
i++; i++;
} }
} }
@@ -908,9 +908,9 @@ namespace Meteor.Map.Actors
AddTP((int)Math.Ceiling(tpModifier * action.amount)); AddTP((int)Math.Ceiling(tpModifier * action.amount));
} }
public ulong GetTempVar(string name) public UInt64 GetTempVar(string name)
{ {
ulong retVal = 0; UInt64 retVal = 0;
if (tempVars.TryGetValue(name, out retVal)) if (tempVars.TryGetValue(name, out retVal))
return retVal; return retVal;
return 0; return 0;
@@ -923,7 +923,7 @@ namespace Meteor.Map.Actors
tempVars[name] = val; tempVars[name] = val;
} }
public void SetTempVar(string name, ulong val) public void SetTempVar(string name, UInt64 val)
{ {
if (tempVars.ContainsKey(name)) if (tempVars.ContainsKey(name))
tempVars[name] = val; tempVars[name] = val;
@@ -994,7 +994,7 @@ namespace Meteor.Map.Actors
{ {
shouldSend = true; shouldSend = true;
charaWork.battleTemp.timingCommandFlag[i] = false; charaWork.battleTemp.timingCommandFlag[i] = false;
propPacketUtil.AddProperty(string.Format("charaWork.battleTemp.timingCommandFlag[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.timingCommandFlag[{0}]", i));
} }
} }
@@ -1025,7 +1025,7 @@ namespace Meteor.Map.Actors
if (this is Player) if (this is Player)
{ {
var propPacketUtil = new ActorPropertyPacketUtil("charaWork/timingCommand", this); var propPacketUtil = new ActorPropertyPacketUtil("charaWork/timingCommand", this);
propPacketUtil.AddProperty(string.Format("charaWork.battleTemp.timingCommandFlag[{0}]", procId)); propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.timingCommandFlag[{0}]", procId));
((Player)this).QueuePackets(propPacketUtil.Done()); ((Player)this).QueuePackets(propPacketUtil.Done());
} }
} }
@@ -1182,35 +1182,6 @@ namespace Meteor.Map.Actors
return targetFind.GetTargets(); return targetFind.GetTargets();
} }
public void GraphicChange(uint slot, uint graphicId)
{
appearanceIds[slot] = graphicId;
}
public void GraphicChange(uint slot, uint weapId, uint equipId, uint variantId, uint colorId)
{
uint mixedVariantId;
if (weapId == 0)
mixedVariantId = ((variantId & 0x1F) << 5) | colorId;
else
mixedVariantId = variantId;
uint graphicId =
(weapId & 0x3FF) << 20 |
(equipId & 0x3FF) << 10 |
(mixedVariantId & 0x3FF);
appearanceIds[slot] = graphicId;
}
public void SendAppearance()
{
zone.BroadcastPacketAroundActor(this, CreateAppearancePacket());
}
#region Inventory #region Inventory
public void SendItemPackage(Player player, uint id) public void SendItemPackage(Player player, uint id)
{ {

View File

@@ -26,7 +26,7 @@ namespace Meteor.Map.actors.chara
//These will need to be redone at some point. remember to update tables in db. //These will need to be redone at some point. remember to update tables in db.
//Consider using text_paramname sheet. that matches up with the stats on armor, but some things will need special handling //Consider using text_paramname sheet. that matches up with the stats on armor, but some things will need special handling
//Also, 0-35 should probably match with up BattleTemp //Also, 0-35 should probably match with up BattleTemp
enum Modifier : uint enum Modifier : UInt32
{ {
//These line up with ParamNames starting at 15001 and appear on gear //These line up with ParamNames starting at 15001 and appear on gear
//Health //Health

View File

@@ -27,9 +27,9 @@ namespace Meteor.Map.actors.chara
class ModifierListEntry class ModifierListEntry
{ {
public uint id; public uint id;
public long value; public Int64 value;
public ModifierListEntry(uint id, long value) public ModifierListEntry(uint id, Int64 value)
{ {
this.id = id; this.id = id;
this.value = value; this.value = value;
@@ -47,13 +47,13 @@ namespace Meteor.Map.actors.chara
mobModList = new Dictionary<uint, ModifierListEntry>(); mobModList = new Dictionary<uint, ModifierListEntry>();
} }
public void AddModifier(uint id, long val, bool isMobMod) public void AddModifier(uint id, Int64 val, bool isMobMod)
{ {
var list = isMobMod ? mobModList : modList; var list = isMobMod ? mobModList : modList;
list.Add(id, new ModifierListEntry(id, val)); list.Add(id, new ModifierListEntry(id, val));
} }
public void SetModifier(uint id, long val, bool isMobMod) public void SetModifier(uint id, Int64 val, bool isMobMod)
{ {
var list = isMobMod ? mobModList : modList; var list = isMobMod ? mobModList : modList;
if (list.ContainsKey(id)) if (list.ContainsKey(id))
@@ -62,7 +62,7 @@ namespace Meteor.Map.actors.chara
list.Add(id, new ModifierListEntry(id, val)); list.Add(id, new ModifierListEntry(id, val));
} }
public long GetModifier(uint id, bool isMobMod) public Int64 GetModifier(uint id, bool isMobMod)
{ {
ModifierListEntry retVal; ModifierListEntry retVal;
var list = isMobMod ? mobModList : modList; var list = isMobMod ? mobModList : modList;

View File

@@ -83,7 +83,7 @@ namespace Meteor.Map.Actors
public ModifierList genusMods; public ModifierList genusMods;
public ModifierList spawnMods; public ModifierList spawnMods;
protected Dictionary<MobModifier, long> mobModifiers = new Dictionary<MobModifier, long>(); protected Dictionary<MobModifier, Int64> mobModifiers = new Dictionary<MobModifier, Int64>();
public BattleNpc(int actorNumber, ActorClass actorClass, string uniqueId, Area spawnedArea, float posX, float posY, float posZ, float rot, public BattleNpc(int actorNumber, ActorClass actorClass, string uniqueId, Area spawnedArea, float posX, float posY, float posZ, float rot,
ushort actorState, uint animationId, string customDisplayName) ushort actorState, uint animationId, string customDisplayName)
@@ -320,7 +320,7 @@ namespace Meteor.Map.Actors
} }
else else
{ {
var err = string.Format("[{0}][{1}] {2} {3} {4} {5} tried to die ded", actorId, GetUniqueId(), positionX, positionY, positionZ, GetZone().GetName()); var err = String.Format("[{0}][{1}] {2} {3} {4} {5} tried to die ded", actorId, GetUniqueId(), positionX, positionY, positionZ, GetZone().GetName());
Program.Log.Error(err); Program.Log.Error(err);
//throw new Exception(err); //throw new Exception(err);
} }
@@ -434,20 +434,20 @@ namespace Meteor.Map.Actors
this.bnpcId = id; this.bnpcId = id;
} }
public long GetMobMod(MobModifier mobMod) public Int64 GetMobMod(MobModifier mobMod)
{ {
return GetMobMod((uint)mobMod); return GetMobMod((uint)mobMod);
} }
public long GetMobMod(uint mobModId) public Int64 GetMobMod(uint mobModId)
{ {
long res; Int64 res;
if (mobModifiers.TryGetValue((MobModifier)mobModId, out res)) if (mobModifiers.TryGetValue((MobModifier)mobModId, out res))
return res; return res;
return 0; return 0;
} }
public void SetMobMod(uint mobModId, long val) public void SetMobMod(uint mobModId, Int64 val)
{ {
if (mobModifiers.ContainsKey((MobModifier)mobModId)) if (mobModifiers.ContainsKey((MobModifier)mobModId))
mobModifiers[(MobModifier)mobModId] = val; mobModifiers[(MobModifier)mobModId] = val;

View File

@@ -81,7 +81,7 @@ namespace Meteor.Map.Actors
LoadNpcAppearance(actorClass.actorClassId); LoadNpcAppearance(actorClass.actorClassId);
className = actorClass.classPath.Substring(actorClass.classPath.LastIndexOf("/") + 1); className = actorClass.classPath.Substring(actorClass.classPath.LastIndexOf("/") + 1);
this.classPath = string.Format("{0}/{1}", actorClass.classPath.Substring(0, actorClass.classPath.LastIndexOf('/')).ToLower(), className); this.classPath = String.Format("{0}/{1}", actorClass.classPath.Substring(0, actorClass.classPath.LastIndexOf('/')).ToLower(), className);
charaWork.battleSave.potencial = 1.0f; charaWork.battleSave.potencial = 1.0f;
@@ -109,8 +109,8 @@ namespace Meteor.Map.Actors
isMapObj = false; isMapObj = false;
else else
{ {
layout = (uint)(int)lParams[4].value; layout = (uint)(Int32)lParams[4].value;
instance = (uint)(int)lParams[5].value; instance = (uint)(Int32)lParams[5].value;
isStatic = true; isStatic = true;
} }
} }
@@ -236,7 +236,7 @@ namespace Meteor.Map.Actors
for (int i = 0; i < charaWork.property.Length; i++) for (int i = 0; i < charaWork.property.Length; i++)
{ {
if (charaWork.property[i] != 0) if (charaWork.property[i] != 0)
propPacketUtil.AddProperty(string.Format("charaWork.property[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.property[{0}]", i));
} }
//Parameters //Parameters
@@ -261,14 +261,14 @@ namespace Meteor.Map.Actors
for (int i = 0; i < charaWork.statusShownTime.Length; i++) for (int i = 0; i < charaWork.statusShownTime.Length; i++)
{ {
if (charaWork.statusShownTime[i] != 0) if (charaWork.statusShownTime[i] != 0)
propPacketUtil.AddProperty(string.Format("charaWork.statusShownTime[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.statusShownTime[{0}]", i));
} }
//General Parameters //General Parameters
for (int i = 3; i < charaWork.battleTemp.generalParameter.Length; i++) for (int i = 3; i < charaWork.battleTemp.generalParameter.Length; i++)
{ {
if (charaWork.battleTemp.generalParameter[i] != 0) if (charaWork.battleTemp.generalParameter[i] != 0)
propPacketUtil.AddProperty(string.Format("charaWork.battleTemp.generalParameter[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.generalParameter[{0}]", i));
} }
propPacketUtil.AddProperty("npcWork.hateType"); propPacketUtil.AddProperty("npcWork.hateType");
@@ -302,7 +302,7 @@ namespace Meteor.Map.Actors
public void LoadNpcAppearance(uint id) public void LoadNpcAppearance(uint id)
{ {
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {

View File

@@ -39,7 +39,7 @@ namespace Meteor.Map.actors.chara.npc
{ {
this.retainerId = retainerId; this.retainerId = retainerId;
this.ownerPlayer = player; this.ownerPlayer = player;
this.actorName = string.Format("_rtnre{0:x7}", actorId); this.actorName = String.Format("_rtnre{0:x7}", actorId);
itemPackages[ItemPackage.NORMAL] = new ItemPackage(this, MAXSIZE_INVENTORY_NORMAL, ItemPackage.NORMAL); itemPackages[ItemPackage.NORMAL] = new ItemPackage(this, MAXSIZE_INVENTORY_NORMAL, ItemPackage.NORMAL);
itemPackages[ItemPackage.CURRENCY_CRYSTALS] = new ItemPackage(this, MAXSIZE_INVENTORY_CURRANCY, ItemPackage.CURRENCY_CRYSTALS); itemPackages[ItemPackage.CURRENCY_CRYSTALS] = new ItemPackage(this, MAXSIZE_INVENTORY_CURRANCY, ItemPackage.CURRENCY_CRYSTALS);

View File

@@ -46,7 +46,6 @@ using Meteor.Map.packets.send.actor.battle;
using Meteor.Map.packets.receive.events; using Meteor.Map.packets.receive.events;
using static Meteor.Map.LuaUtils; using static Meteor.Map.LuaUtils;
using Meteor.Map.packets.send.actor.events; using Meteor.Map.packets.send.actor.events;
using Meteor.Map.DataObjects;
namespace Meteor.Map.Actors namespace Meteor.Map.Actors
{ {
@@ -147,7 +146,7 @@ namespace Meteor.Map.Actors
//Quest Actors (MUST MATCH playerWork.questScenario/questGuildleve) //Quest Actors (MUST MATCH playerWork.questScenario/questGuildleve)
public Quest[] questScenario = new Quest[16]; public Quest[] questScenario = new Quest[16];
public Quest[] questGuildleve = new Quest[8]; public uint[] questGuildleve = new uint[8];
//Aetheryte //Aetheryte
public uint homepoint = 0; public uint homepoint = 0;
@@ -162,10 +161,6 @@ namespace Meteor.Map.Actors
public Retainer currentSpawnedRetainer = null; public Retainer currentSpawnedRetainer = null;
public bool sentRetainerSpawn = false; public bool sentRetainerSpawn = false;
//Crafting
public List<Recipe> recentRecipes = new List<Recipe>();
public List<Recipe> awardedRecipes = new List<Recipe>();
private List<Director> ownedDirectors = new List<Director>(); private List<Director> ownedDirectors = new List<Director>();
private Director loginInitDirector = null; private Director loginInitDirector = null;
@@ -178,7 +173,7 @@ namespace Meteor.Map.Actors
public Player(Session cp, uint actorID) : base(actorID) public Player(Session cp, uint actorID) : base(actorID)
{ {
playerSession = cp; playerSession = cp;
actorName = string.Format("_pc{0:00000000}", actorID); actorName = String.Format("_pc{0:00000000}", actorID);
className = "Player"; className = "Player";
moveSpeeds[0] = SetActorSpeedPacket.DEFAULT_STOP; moveSpeeds[0] = SetActorSpeedPacket.DEFAULT_STOP;
@@ -276,22 +271,9 @@ namespace Meteor.Map.Actors
Database.LoadPlayerCharacter(this); Database.LoadPlayerCharacter(this);
lastPlayTimeUpdate = Utils.UnixTimeStampUTC(); lastPlayTimeUpdate = Utils.UnixTimeStampUTC();
SetSpecialCommands(charaWork.parameterSave.state_mainSkill[0]);
this.aiContainer = new AIContainer(this, new PlayerController(this), null, new TargetFind(this)); this.aiContainer = new AIContainer(this, new PlayerController(this), null, new TargetFind(this));
allegiance = CharacterTargetingAllegiance.Player; allegiance = CharacterTargetingAllegiance.Player;
CalculateBaseStats(); CalculateBaseStats();
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(36));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(37));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(38));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(39));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(40));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(41));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(42));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(43));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(2));
AddRecentRecipe(Server.ResolveRecipe().GetRecipeByID(3));
} }
public List<SubPacket> Create0x132Packets() public List<SubPacket> Create0x132Packets()
@@ -420,7 +402,7 @@ namespace Meteor.Map.Actors
for (int i = 0; i < charaWork.property.Length; i++) for (int i = 0; i < charaWork.property.Length; i++)
{ {
if (charaWork.property[i] != 0) if (charaWork.property[i] != 0)
propPacketUtil.AddProperty(string.Format("charaWork.property[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.property[{0}]", i));
} }
//Parameters //Parameters
@@ -436,21 +418,21 @@ namespace Meteor.Map.Actors
for (int i = 0; i < charaWork.statusShownTime.Length; i++) for (int i = 0; i < charaWork.statusShownTime.Length; i++)
{ {
if (charaWork.statusShownTime[i] != 0) if (charaWork.statusShownTime[i] != 0)
propPacketUtil.AddProperty(string.Format("charaWork.statusShownTime[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.statusShownTime[{0}]", i));
} }
//General Parameters //General Parameters
for (int i = 3; i < charaWork.battleTemp.generalParameter.Length; i++) for (int i = 3; i < charaWork.battleTemp.generalParameter.Length; i++)
{ {
if (charaWork.battleTemp.generalParameter[i] != 0) if (charaWork.battleTemp.generalParameter[i] != 0)
propPacketUtil.AddProperty(string.Format("charaWork.battleTemp.generalParameter[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.generalParameter[{0}]", i));
} }
propPacketUtil.AddProperty("charaWork.battleTemp.castGauge_speed[0]"); propPacketUtil.AddProperty("charaWork.battleTemp.castGauge_speed[0]");
propPacketUtil.AddProperty("charaWork.battleTemp.castGauge_speed[1]"); propPacketUtil.AddProperty("charaWork.battleTemp.castGauge_speed[1]");
//Battle Save Skillpoint //Battle Save Skillpoint
propPacketUtil.AddProperty(string.Format("charaWork.battleSave.skillPoint[{0}]", charaWork.parameterSave.state_mainSkill[0] - 1)); propPacketUtil.AddProperty(String.Format("charaWork.battleSave.skillPoint[{0}]", charaWork.parameterSave.state_mainSkill[0] - 1));
//Commands //Commands
propPacketUtil.AddProperty("charaWork.commandBorder"); propPacketUtil.AddProperty("charaWork.commandBorder");
@@ -461,12 +443,12 @@ namespace Meteor.Map.Actors
{ {
if (charaWork.command[i] != 0) if (charaWork.command[i] != 0)
{ {
propPacketUtil.AddProperty(string.Format("charaWork.command[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.command[{0}]", i));
//Recast Timers //Recast Timers
if (i >= charaWork.commandBorder) if (i >= charaWork.commandBorder)
{ {
propPacketUtil.AddProperty(string.Format("charaWork.parameterTemp.maxCommandRecastTime[{0}]", i - charaWork.commandBorder)); propPacketUtil.AddProperty(String.Format("charaWork.parameterTemp.maxCommandRecastTime[{0}]", i - charaWork.commandBorder));
propPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", i - charaWork.commandBorder)); propPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", i - charaWork.commandBorder));
} }
} }
} }
@@ -475,32 +457,32 @@ namespace Meteor.Map.Actors
{ {
charaWork.commandCategory[i] = 1; charaWork.commandCategory[i] = 1;
if (charaWork.commandCategory[i] != 0) if (charaWork.commandCategory[i] != 0)
propPacketUtil.AddProperty(string.Format("charaWork.commandCategory[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.commandCategory[{0}]", i));
} }
for (int i = 0; i < charaWork.commandAcquired.Length; i++) for (int i = 0; i < charaWork.commandAcquired.Length; i++)
{ {
if (charaWork.commandAcquired[i] != false) if (charaWork.commandAcquired[i] != false)
propPacketUtil.AddProperty(string.Format("charaWork.commandAcquired[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.commandAcquired[{0}]", i));
} }
for (int i = 0; i < charaWork.additionalCommandAcquired.Length; i++) for (int i = 0; i < charaWork.additionalCommandAcquired.Length; i++)
{ {
if (charaWork.additionalCommandAcquired[i] != false) if (charaWork.additionalCommandAcquired[i] != false)
propPacketUtil.AddProperty(string.Format("charaWork.additionalCommandAcquired[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.additionalCommandAcquired[{0}]", i));
} }
for (int i = 0; i < charaWork.parameterSave.commandSlot_compatibility.Length; i++) for (int i = 0; i < charaWork.parameterSave.commandSlot_compatibility.Length; i++)
{ {
charaWork.parameterSave.commandSlot_compatibility[i] = true; charaWork.parameterSave.commandSlot_compatibility[i] = true;
if (charaWork.parameterSave.commandSlot_compatibility[i]) if (charaWork.parameterSave.commandSlot_compatibility[i])
propPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", i));
} }
for (int i = 0; i < charaWork.parameterSave.commandSlot_recastTime.Length; i++) for (int i = 0; i < charaWork.parameterSave.commandSlot_recastTime.Length; i++)
{ {
if (charaWork.parameterSave.commandSlot_recastTime[i] != 0) if (charaWork.parameterSave.commandSlot_recastTime[i] != 0)
propPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", i));
} }
//System //System
@@ -523,25 +505,25 @@ namespace Meteor.Map.Actors
for (int i = 0; i < playerWork.questScenario.Length; i++) for (int i = 0; i < playerWork.questScenario.Length; i++)
{ {
if (playerWork.questScenario[i] != 0) if (playerWork.questScenario[i] != 0)
propPacketUtil.AddProperty(string.Format("playerWork.questScenario[{0}]", i)); propPacketUtil.AddProperty(String.Format("playerWork.questScenario[{0}]", i));
} }
//Guildleve - Local //Guildleve - Local
for (int i = 0; i < playerWork.questGuildleve.Length; i++) for (int i = 0; i < playerWork.questGuildleve.Length; i++)
{ {
if (playerWork.questGuildleve[i] != 0) if (playerWork.questGuildleve[i] != 0)
propPacketUtil.AddProperty(string.Format("playerWork.questGuildleve[{0}]", i)); propPacketUtil.AddProperty(String.Format("playerWork.questGuildleve[{0}]", i));
} }
//Guildleve - Regional //Guildleve - Regional
for (int i = 0; i < work.guildleveId.Length; i++) for (int i = 0; i < work.guildleveId.Length; i++)
{ {
if (work.guildleveId[i] != 0) if (work.guildleveId[i] != 0)
propPacketUtil.AddProperty(string.Format("work.guildleveId[{0}]", i)); propPacketUtil.AddProperty(String.Format("work.guildleveId[{0}]", i));
if (work.guildleveDone[i] != false) if (work.guildleveDone[i] != false)
propPacketUtil.AddProperty(string.Format("work.guildleveDone[{0}]", i)); propPacketUtil.AddProperty(String.Format("work.guildleveDone[{0}]", i));
if (work.guildleveChecked[i] != false) if (work.guildleveChecked[i] != false)
propPacketUtil.AddProperty(string.Format("work.guildleveChecked[{0}]", i)); propPacketUtil.AddProperty(String.Format("work.guildleveChecked[{0}]", i));
} }
//Bazaar //Bazaar
@@ -559,9 +541,9 @@ namespace Meteor.Map.Actors
for (int i = 0; i < playerWork.npcLinkshellChatCalling.Length; i++) for (int i = 0; i < playerWork.npcLinkshellChatCalling.Length; i++)
{ {
if (playerWork.npcLinkshellChatCalling[i] != false) if (playerWork.npcLinkshellChatCalling[i] != false)
propPacketUtil.AddProperty(string.Format("playerWork.npcLinkshellChatCalling[{0}]", i)); propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatCalling[{0}]", i));
if (playerWork.npcLinkshellChatExtra[i] != false) if (playerWork.npcLinkshellChatExtra[i] != false)
propPacketUtil.AddProperty(string.Format("playerWork.npcLinkshellChatExtra[{0}]", i)); propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatExtra[{0}]", i));
} }
propPacketUtil.AddProperty("playerWork.restBonusExpRate"); propPacketUtil.AddProperty("playerWork.restBonusExpRate");
@@ -578,7 +560,7 @@ namespace Meteor.Map.Actors
public void SendSeamlessZoneInPackets() public void SendSeamlessZoneInPackets()
{ {
QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.GetCurrentMusic(), SetMusicPacket.EFFECT_FADEIN)); QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.bgmDay, SetMusicPacket.EFFECT_FADEIN));
QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1)); QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1));
} }
@@ -601,7 +583,7 @@ namespace Meteor.Map.Actors
} }
} }
else else
QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.GetCurrentMusic(), 0x01)); //Zone QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.bgmDay, 0x01)); //Zone
QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1)); QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1));
@@ -824,6 +806,11 @@ namespace Meteor.Map.Actors
Database.SavePlayerStatusEffects(this); Database.SavePlayerStatusEffects(this);
} }
public Area GetZone()
{
return zone;
}
public void SendMessage(uint logType, string sender, string message) public void SendMessage(uint logType, string sender, string message)
{ {
QueuePacket(SendMessagePacket.BuildPacket(actorId, logType, sender, message)); QueuePacket(SendMessagePacket.BuildPacket(actorId, logType, sender, message));
@@ -908,12 +895,6 @@ namespace Meteor.Map.Actors
QueuePacket(SetMusicPacket.BuildPacket(actorId, musicId, 1)); QueuePacket(SetMusicPacket.BuildPacket(actorId, musicId, 1));
} }
public void ResetMusic()
{
if (zone != null)
QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.GetCurrentMusic(), 1));
}
public void SendMountAppearance() public void SendMountAppearance()
{ {
if (mountState == 1) if (mountState == 1)
@@ -978,6 +959,29 @@ namespace Meteor.Map.Actors
//zone.BroadcastPacketAroundActor(this, worldMasterMessage); //zone.BroadcastPacketAroundActor(this, worldMasterMessage);
} }
public void GraphicChange(uint slot, uint graphicId)
{
appearanceIds[slot] = graphicId;
}
public void GraphicChange(uint slot, uint weapId, uint equipId, uint variantId, uint colorId)
{
uint mixedVariantId;
if (weapId == 0)
mixedVariantId = ((variantId & 0x1F) << 5) | colorId;
else
mixedVariantId = variantId;
uint graphicId =
(weapId & 0x3FF) << 20 |
(equipId & 0x3FF) << 10 |
(mixedVariantId & 0x3FF);
appearanceIds[slot] = graphicId;
}
public void GraphicChange(int slot, InventoryItem invItem) public void GraphicChange(int slot, InventoryItem invItem)
{ {
@@ -1039,6 +1043,11 @@ namespace Meteor.Map.Actors
BroadcastPacket(CreateAppearancePacket(), true); BroadcastPacket(CreateAppearancePacket(), true);
} }
public void SendAppearance()
{
BroadcastPacket(CreateAppearancePacket(), true);
}
public void SendCharaExpInfo() public void SendCharaExpInfo()
{ {
if (lastStep == 0) if (lastStep == 0)
@@ -1184,7 +1193,7 @@ namespace Meteor.Map.Actors
propertyBuilder.NewTarget("playerWork/expBonus"); propertyBuilder.NewTarget("playerWork/expBonus");
propertyBuilder.AddProperty("playerWork.restBonusExpRate"); propertyBuilder.AddProperty("playerWork.restBonusExpRate");
propertyBuilder.NewTarget("charaWork/battleStateForSelf"); propertyBuilder.NewTarget("charaWork/battleStateForSelf");
propertyBuilder.AddProperty(string.Format("charaWork.battleSave.skillPoint[{0}]", classId - 1)); propertyBuilder.AddProperty(String.Format("charaWork.battleSave.skillPoint[{0}]", classId - 1));
Database.LoadHotbar(this); Database.LoadHotbar(this);
var time = Utils.UnixTimeStampUTC(); var time = Utils.UnixTimeStampUTC();
@@ -1196,7 +1205,6 @@ namespace Meteor.Map.Actors
} }
} }
SetSpecialCommands(charaWork.parameterSave.state_mainSkill[0]);
UpdateHotbar(); UpdateHotbar();
List<SubPacket> packets = propertyBuilder.Done(); List<SubPacket> packets = propertyBuilder.Done();
@@ -1208,49 +1216,12 @@ namespace Meteor.Map.Actors
RecalculateStats(); RecalculateStats();
} }
private void SetSpecialCommands(byte classId)
{
//Added special commands for crafter/gatherer
charaWork.command[16] = 0;
charaWork.command[17] = 0;
if (classId >= 29 && classId <= 36)
{
charaWork.command[16] = 0xA0F00000 | 22001; //Synthesize
}
else if (classId == 39) //Miner
{
charaWork.command[16] = 0xA0F00000 | 22002; //Mine
charaWork.command[17] = 0xA0F00000 | 22006; //Quarry
}
else if (classId == 40) //Botanist
{
charaWork.command[16] = 0xA0F00000 | 22003; //Log
charaWork.command[17] = 0xA0F00000 | 22007; //Harvest
}
else if (classId == 41) //Fisher
{
charaWork.command[16] = 0xA0F00000 | 22004; //Fish
charaWork.command[17] = 0xA0F00000 | 22008; //Spearfish
}
else if (classId == 42) //Shepherd
{
charaWork.command[16] = 0xA0F00000 | 22005; //Herd
charaWork.command[17] = 0xA0F00000 | 22009; //Herd 2
}
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/command", this);
propertyBuilder.AddProperty(string.Format("charaWork.command[{0}]", 16));
propertyBuilder.AddProperty(string.Format("charaWork.commandCategory[{0}]", 17));
List<SubPacket> packets = propertyBuilder.Done();
QueuePackets(packets);
}
public void UpdateClassLevel(byte classId, short level) public void UpdateClassLevel(byte classId, short level)
{ {
Database.PlayerCharacterUpdateClassLevel(this, classId, level); Database.PlayerCharacterUpdateClassLevel(this, classId, level);
charaWork.battleSave.skillLevel[classId - 1] = level; charaWork.battleSave.skillLevel[classId - 1] = level;
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/stateForAll", this); ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/stateForAll", this);
propertyBuilder.AddProperty(string.Format("charaWork.battleSave.skillLevel[{0}]", classId-1)); propertyBuilder.AddProperty(String.Format("charaWork.battleSave.skillLevel[{0}]", classId-1));
List<SubPacket> packets = propertyBuilder.Done(); List<SubPacket> packets = propertyBuilder.Done();
QueuePackets(packets); QueuePackets(packets);
} }
@@ -1392,16 +1363,6 @@ namespace Meteor.Map.Actors
return -1; return -1;
} }
public int GetFreeQuestGuildleveSlot()
{
for (int i = 0; i < questGuildleve.Length; i++)
{
if (questGuildleve[i] == null)
return i;
}
return -1;
}
public int GetFreeGuildleveSlot() public int GetFreeGuildleveSlot()
{ {
@@ -1486,60 +1447,36 @@ namespace Meteor.Map.Actors
} }
} }
} }
public void AddQuest(string name, bool isSilent = false)
{
Actor actor = Server.GetStaticActors(name);
AddQuestInternal(actor as Quest, isSilent);
}
public void AddQuest(uint id, bool isSilent = false) public void AddQuest(uint id, bool isSilent = false)
{ {
Actor actor = Server.GetStaticActors((0xA0F00000 | id)); Actor actor = Server.GetStaticActors((0xA0F00000 | id));
AddQuestInternal(actor as Quest, isSilent); AddQuest(actor.actorName, isSilent);
} }
public void AddQuestGuildleve(uint id, byte difficulty) public void AddQuest(string name, bool isSilent = false)
{ {
Quest staticQuest = (Quest) Server.GetStaticActors((0xA0F00000 | id)); Actor actor = Server.GetStaticActors(name);
if (staticQuest == null)
if (actor == null)
return; return;
PassiveGuildleve newQuest = new PassiveGuildleve(staticQuest, this, difficulty); uint id = actor.actorId;
int freeSlot = GetFreeQuestGuildleveSlot();
if (freeSlot == -1)
return;
playerWork.questGuildleve[freeSlot] = newQuest.actorId;
questGuildleve[freeSlot] = newQuest;
Database.SaveQuest(this, newQuest);
SendQuestGuildleveClientUpdate(freeSlot);
}
private void AddQuestInternal(Quest staticQuest, bool isSilent = false)
{
if (staticQuest == null)
return;
Scenario newQuest = new Scenario(staticQuest, this, null, 0, 0);
int freeSlot = GetFreeQuestSlot(); int freeSlot = GetFreeQuestSlot();
if (freeSlot == -1) if (freeSlot == -1)
return; return;
playerWork.questScenario[freeSlot] = newQuest.actorId; playerWork.questScenario[freeSlot] = id;
questScenario[freeSlot] = newQuest; questScenario[freeSlot] = new Quest(this, playerWork.questScenario[freeSlot], name, null, 0, 0);
Database.SaveQuest(this, questScenario[freeSlot]);
Database.SaveQuest(this, newQuest);
SendQuestClientUpdate(freeSlot); SendQuestClientUpdate(freeSlot);
if (!isSilent) if (!isSilent)
{ {
SendGameMessage(Server.GetWorldManager().GetActor(), 25224, 0x20, (object)questScenario[freeSlot].GetQuestId()); SendGameMessage(Server.GetWorldManager().GetActor(), 25224, 0x20, (object)questScenario[freeSlot].GetQuestId());
(questScenario[freeSlot] as Scenario).NextPhase(0); questScenario[freeSlot].NextPhase(0);
} }
} }
@@ -1604,9 +1541,9 @@ namespace Meteor.Map.Actors
{ {
if (questScenario[i] != null && questScenario[i].GetQuestId() == oldId) if (questScenario[i] != null && questScenario[i].GetQuestId() == oldId)
{ {
Quest quest = Server.GetStaticActors((0xA0F00000 | newId)) as Quest; Actor actor = Server.GetStaticActors((0xA0F00000 | newId));
playerWork.questScenario[i] = (0xA0F00000 | newId); playerWork.questScenario[i] = (0xA0F00000 | newId);
questScenario[i] = new Scenario(quest, this, null, 0, 0); questScenario[i] = new Quest(this, playerWork.questScenario[i], actor.actorName, null, 0, 0);
Database.SaveQuest(this, questScenario[i]); Database.SaveQuest(this, questScenario[i]);
SendQuestClientUpdate(i); SendQuestClientUpdate(i);
break; break;
@@ -1661,16 +1598,6 @@ namespace Meteor.Map.Actors
return null; return null;
} }
public Quest GetQuestGuildleve(uint id)
{
for (int i = 0; i < questGuildleve.Length; i++)
{
if (questGuildleve[i] != null && questGuildleve[i].actorId == (0xA0F00000 | id))
return questGuildleve[i];
}
return null;
}
public bool HasQuest(string name) public bool HasQuest(string name)
{ {
@@ -1694,17 +1621,6 @@ namespace Meteor.Map.Actors
return false; return false;
} }
public bool HasQuestGuildleve(uint id)
{
for (int i = 0; i < questGuildleve.Length; i++)
{
if (questGuildleve[i] != null && questGuildleve[i].actorId == (0xA0F00000 | id))
return true;
}
return false;
}
public bool HasGuildleve(uint id) public bool HasGuildleve(uint id)
{ {
for (int i = 0; i < work.guildleveId.Length; i++) for (int i = 0; i < work.guildleveId.Length; i++)
@@ -1727,17 +1643,6 @@ namespace Meteor.Map.Actors
return -1; return -1;
} }
public int GetQuestGuildleveSlot(uint id)
{
for (int i = 0; i < questGuildleve.Length; i++)
{
if (questGuildleve[i] != null && questGuildleve[i].actorId == (0xA0F00000 | id))
return i;
}
return -1;
}
public void SetNpcLS(uint npcLSId, uint state) public void SetNpcLS(uint npcLSId, uint state)
{ {
bool isCalling, isExtra; bool isCalling, isExtra;
@@ -1774,36 +1679,30 @@ namespace Meteor.Map.Actors
Database.SaveNpcLS(this, npcLSId, isCalling, isExtra); Database.SaveNpcLS(this, npcLSId, isCalling, isExtra);
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/npcLinkshellChat", this); ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/npcLinkshellChat", this);
propPacketUtil.AddProperty(string.Format("playerWork.npcLinkshellChatExtra[{0}]", npcLSId)); propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatExtra[{0}]", npcLSId));
propPacketUtil.AddProperty(string.Format("playerWork.npcLinkshellChatCalling[{0}]", npcLSId)); propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatCalling[{0}]", npcLSId));
QueuePackets(propPacketUtil.Done()); QueuePackets(propPacketUtil.Done());
} }
private void SendQuestClientUpdate(int slot) private void SendQuestClientUpdate(int slot)
{ {
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/journal", this); ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/journal", this);
propPacketUtil.AddProperty(string.Format("playerWork.questScenario[{0}]", slot)); propPacketUtil.AddProperty(String.Format("playerWork.questScenario[{0}]", slot));
QueuePackets(propPacketUtil.Done());
}
private void SendQuestGuildleveClientUpdate(int slot)
{
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/journal", this);
propPacketUtil.AddProperty(string.Format("playerWork.questGuildleve[{0}]", slot));
QueuePackets(propPacketUtil.Done()); QueuePackets(propPacketUtil.Done());
} }
private void SendGuildleveClientUpdate(int slot) private void SendGuildleveClientUpdate(int slot)
{ {
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("work/guildleve", this); ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("work/guildleve", this);
propPacketUtil.AddProperty(string.Format("work.guildleveId[{0}]", slot)); propPacketUtil.AddProperty(String.Format("work.guildleveId[{0}]", slot));
QueuePackets(propPacketUtil.Done()); QueuePackets(propPacketUtil.Done());
} }
private void SendGuildleveMarkClientUpdate(int slot) private void SendGuildleveMarkClientUpdate(int slot)
{ {
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("work/guildleve", this); ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("work/guildleve", this);
propPacketUtil.AddProperty(string.Format("work.guildleveDone[{0}]", slot)); propPacketUtil.AddProperty(String.Format("work.guildleveDone[{0}]", slot));
propPacketUtil.AddProperty(string.Format("work.guildleveChecked[{0}]", slot)); propPacketUtil.AddProperty(String.Format("work.guildleveChecked[{0}]", slot));
QueuePackets(propPacketUtil.Done()); QueuePackets(propPacketUtil.Done());
} }
@@ -2136,34 +2035,9 @@ namespace Meteor.Map.Actors
} }
} }
public void AddRecentRecipe(Recipe recipe)
{
recentRecipes.Remove(recipe);
if (recentRecipes.Count > 8)
recentRecipes.RemoveAt(7);
recentRecipes.Add(recipe);
}
public List<Recipe> GetRecentRecipes()
{
return recentRecipes;
}
public void AddAwardedRecipe(Recipe recipe)
{
awardedRecipes.Remove(recipe);
if (awardedRecipes.Count > 8)
awardedRecipes.RemoveAt(7);
awardedRecipes.Add(recipe);
}
public List<Recipe> GetAwardedRecipes()
{
return awardedRecipes;
}
public override void Update(DateTime tick) public override void Update(DateTime tick)
{ {
// Chocobo Rental Expirey // Chocobo Rental Expirey
if (rentalExpireTime != 0) if (rentalExpireTime != 0)
{ {
@@ -2174,7 +2048,7 @@ namespace Meteor.Map.Actors
{ {
rentalExpireTime = 0; rentalExpireTime = 0;
rentalMinLeft = 0; rentalMinLeft = 0;
ResetMusic(); ChangeMusic(GetZone().bgmDay);
SetMountState(0); SetMountState(0);
ChangeSpeed(0.0f, 2.0f, 5.0f, 5.0f); ChangeSpeed(0.0f, 2.0f, 5.0f, 5.0f);
ChangeState(0); ChangeState(0);
@@ -2228,7 +2102,7 @@ namespace Meteor.Map.Actors
if (GetMod(i) != charaWork.battleTemp.generalParameter[i]) if (GetMod(i) != charaWork.battleTemp.generalParameter[i])
{ {
charaWork.battleTemp.generalParameter[i] = (short)GetMod(i); charaWork.battleTemp.generalParameter[i] = (short)GetMod(i);
propPacketUtil.AddProperty(string.Format("charaWork.battleTemp.generalParameter[{0}]", i)); propPacketUtil.AddProperty(String.Format("charaWork.battleTemp.generalParameter[{0}]", i));
} }
} }
@@ -2275,8 +2149,8 @@ namespace Meteor.Map.Actors
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("charaWork/command", this); ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("charaWork/command", this);
foreach (ushort slot in slotsToUpdate) foreach (ushort slot in slotsToUpdate)
{ {
propPacketUtil.AddProperty(string.Format("charaWork.command[{0}]", slot)); propPacketUtil.AddProperty(String.Format("charaWork.command[{0}]", slot));
propPacketUtil.AddProperty(string.Format("charaWork.commandCategory[{0}]", slot)); propPacketUtil.AddProperty(String.Format("charaWork.commandCategory[{0}]", slot));
} }
propPacketUtil.NewTarget("charaWork/commandDetailForSelf"); propPacketUtil.NewTarget("charaWork/commandDetailForSelf");
@@ -2284,7 +2158,7 @@ namespace Meteor.Map.Actors
foreach (ushort slot in slotsToUpdate) foreach (ushort slot in slotsToUpdate)
{ {
charaWork.parameterSave.commandSlot_compatibility[slot - charaWork.commandBorder] = charaWork.command[slot] != 0; charaWork.parameterSave.commandSlot_compatibility[slot - charaWork.commandBorder] = charaWork.command[slot] != 0;
propPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", slot - charaWork.commandBorder)); propPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", slot - charaWork.commandBorder));
} }
QueuePackets(propPacketUtil.Done()); QueuePackets(propPacketUtil.Done());
@@ -2298,8 +2172,8 @@ namespace Meteor.Map.Actors
foreach (ushort slot in slotsToUpdate) foreach (ushort slot in slotsToUpdate)
{ {
recastPacketUtil.AddProperty(string.Format("charaWork.parameterTemp.maxCommandRecastTime[{0}]", slot - charaWork.commandBorder)); recastPacketUtil.AddProperty(String.Format("charaWork.parameterTemp.maxCommandRecastTime[{0}]", slot - charaWork.commandBorder));
recastPacketUtil.AddProperty(string.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", slot - charaWork.commandBorder)); recastPacketUtil.AddProperty(String.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", slot - charaWork.commandBorder));
} }
QueuePackets(recastPacketUtil.Done()); QueuePackets(recastPacketUtil.Done());
@@ -2721,7 +2595,7 @@ namespace Meteor.Map.Actors
charaWork.battleSave.skillPoint[classId - 1] = 0; charaWork.battleSave.skillPoint[classId - 1] = 0;
//send new level //send new level
ActorPropertyPacketUtil levelPropertyPacket = new ActorPropertyPacketUtil("charaWork/stateForAll", this); ActorPropertyPacketUtil levelPropertyPacket = new ActorPropertyPacketUtil("charaWork/stateForAll", this);
levelPropertyPacket.AddProperty(string.Format("charaWork.battleSave.skillLevel[{0}]", classId - 1)); levelPropertyPacket.AddProperty(String.Format("charaWork.battleSave.skillLevel[{0}]", classId - 1));
levelPropertyPacket.AddProperty("charaWork.parameterSave.state_mainSkillLevel"); levelPropertyPacket.AddProperty("charaWork.parameterSave.state_mainSkillLevel");
QueuePackets(levelPropertyPacket.Done()); QueuePackets(levelPropertyPacket.Done());
@@ -2732,7 +2606,7 @@ namespace Meteor.Map.Actors
charaWork.battleSave.skillPoint[classId - 1] = Math.Min(charaWork.battleSave.skillPoint[classId - 1] + exp, MAXEXP[GetLevel() - 1]); charaWork.battleSave.skillPoint[classId - 1] = Math.Min(charaWork.battleSave.skillPoint[classId - 1] + exp, MAXEXP[GetLevel() - 1]);
ActorPropertyPacketUtil expPropertyPacket = new ActorPropertyPacketUtil("charaWork/battleStateForSelf", this); ActorPropertyPacketUtil expPropertyPacket = new ActorPropertyPacketUtil("charaWork/battleStateForSelf", this);
expPropertyPacket.AddProperty(string.Format("charaWork.battleSave.skillPoint[{0}]", classId - 1)); expPropertyPacket.AddProperty(String.Format("charaWork.battleSave.skillPoint[{0}]", classId - 1));
QueuePackets(expPropertyPacket.Done()); QueuePackets(expPropertyPacket.Done());
Database.SetExp(this, classId, charaWork.battleSave.skillPoint[classId - 1]); Database.SetExp(this, classId, charaWork.battleSave.skillPoint[classId - 1]);

View File

@@ -239,7 +239,7 @@ namespace Meteor.Map.actors.director
//Format Class Name //Format Class Name
string className = this.className; string className = this.className;
className = char.ToLowerInvariant(className[0]) + className.Substring(1); className = Char.ToLowerInvariant(className[0]) + className.Substring(1);
//Format Zone Name //Format Zone Name
string zoneName = zone.zoneName.Replace("Field", "Fld") string zoneName = zone.zoneName.Replace("Field", "Fld")
@@ -255,7 +255,7 @@ namespace Meteor.Map.actors.director
//Check if "normal" //Check if "normal"
zoneName = zoneName.Remove(zoneName.Length - 1, 1) + "P"; zoneName = zoneName.Remove(zoneName.Length - 1, 1) + "P";
} }
zoneName = char.ToLowerInvariant(zoneName[0]) + zoneName.Substring(1); zoneName = Char.ToLowerInvariant(zoneName[0]) + zoneName.Substring(1);
try try
{ {
@@ -273,7 +273,7 @@ namespace Meteor.Map.actors.director
if (zone is PrivateArea) if (zone is PrivateArea)
privLevel = ((PrivateArea)zone).GetPrivateAreaType(); privLevel = ((PrivateArea)zone).GetPrivateAreaType();
actorName = string.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel); actorName = String.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel);
} }
public string GetScriptPath() public string GetScriptPath()
@@ -283,7 +283,7 @@ namespace Meteor.Map.actors.director
private void LoadLuaScript() private void LoadLuaScript()
{ {
string luaPath = string.Format(LuaEngine.FILEPATH_DIRECTORS, GetScriptPath()); string luaPath = String.Format(LuaEngine.FILEPATH_DIRECTORS, GetScriptPath());
directorScript = LuaEngine.LoadScript(luaPath); directorScript = LuaEngine.LoadScript(luaPath);
if (directorScript == null) if (directorScript == null)
Program.Log.Error("Could not find script for director {0}.", GetName()); Program.Log.Error("Could not find script for director {0}.", GetName());
@@ -293,7 +293,7 @@ namespace Meteor.Map.actors.director
{ {
if (directorScript != null) if (directorScript != null)
{ {
directorScript = LuaEngine.LoadScript(string.Format(LuaEngine.FILEPATH_DIRECTORS, directorScriptPath)); directorScript = LuaEngine.LoadScript(String.Format(LuaEngine.FILEPATH_DIRECTORS, directorScriptPath));
if (!directorScript.Globals.Get(funcName).IsNil()) if (!directorScript.Globals.Get(funcName).IsNil())
{ {
DynValue result = directorScript.Call(directorScript.Globals[funcName], args); DynValue result = directorScript.Call(directorScript.Globals[funcName], args);

View File

@@ -137,7 +137,7 @@ namespace Meteor.Map.actors.director
if (wasCompleted) if (wasCompleted)
{ {
Npc aetheryteNode = zone.SpawnActor(1200040, string.Format("{0}:warpExit", guildleveOwner.actorName), guildleveOwner.positionX, guildleveOwner.positionY, guildleveOwner.positionZ); Npc aetheryteNode = zone.SpawnActor(1200040, String.Format("{0}:warpExit", guildleveOwner.actorName), guildleveOwner.positionX, guildleveOwner.positionY, guildleveOwner.positionZ);
AddMember(aetheryteNode); AddMember(aetheryteNode);
foreach (Actor a in GetPlayerMembers()) foreach (Actor a in GetPlayerMembers())
@@ -168,7 +168,7 @@ namespace Meteor.Map.actors.director
foreach (Actor p in GetPlayerMembers()) foreach (Actor p in GetPlayerMembers())
{ {
Player player = (Player)p; Player player = (Player)p;
player.ResetMusic(); player.ChangeMusic(player.GetZone().bgmDay);
} }
} }
@@ -210,7 +210,7 @@ namespace Meteor.Map.actors.director
{ {
guildleveWork.aimNumNow[index] = value; guildleveWork.aimNumNow[index] = value;
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/infoVariable", this); ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/infoVariable", this);
propertyBuilder.AddProperty(string.Format("guildleveWork.aimNumNow[{0}]", index)); propertyBuilder.AddProperty(String.Format("guildleveWork.aimNumNow[{0}]", index));
SendPacketsToPlayers(propertyBuilder.Done()); SendPacketsToPlayers(propertyBuilder.Done());
} }
@@ -218,7 +218,7 @@ namespace Meteor.Map.actors.director
{ {
guildleveWork.uiState[index] = value; guildleveWork.uiState[index] = value;
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/infoVariable", this); ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/infoVariable", this);
propertyBuilder.AddProperty(string.Format("guildleveWork.uiState[{0}]", index)); propertyBuilder.AddProperty(String.Format("guildleveWork.uiState[{0}]", index));
SendPacketsToPlayers(propertyBuilder.Done()); SendPacketsToPlayers(propertyBuilder.Done());
} }
@@ -228,9 +228,9 @@ namespace Meteor.Map.actors.director
guildleveWork.markerY[markerIndex] = y; guildleveWork.markerY[markerIndex] = y;
guildleveWork.markerZ[markerIndex] = z; guildleveWork.markerZ[markerIndex] = z;
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/marker", this); ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/marker", this);
propertyBuilder.AddProperty(string.Format("guildleveWork.markerX[{0}]", markerIndex)); propertyBuilder.AddProperty(String.Format("guildleveWork.markerX[{0}]", markerIndex));
propertyBuilder.AddProperty(string.Format("guildleveWork.markerY[{0}]", markerIndex)); propertyBuilder.AddProperty(String.Format("guildleveWork.markerY[{0}]", markerIndex));
propertyBuilder.AddProperty(string.Format("guildleveWork.markerZ[{0}]", markerIndex)); propertyBuilder.AddProperty(String.Format("guildleveWork.markerZ[{0}]", markerIndex));
SendPacketsToPlayers(propertyBuilder.Done()); SendPacketsToPlayers(propertyBuilder.Done());
} }

View File

@@ -1,146 +0,0 @@
/*
===========================================================================
Copyright (C) 2015-2019 Project Meteor Dev Team
This file is part of Project Meteor Server.
Project Meteor Server is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Project Meteor Server is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
===========================================================================
*/
using Meteor.Map.dataobjects;
using Meteor.Map.DataObjects;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
namespace Meteor.Map.Actors
{
class PassiveGuildleve : Quest
{
private Recipe targetRecipe;
private byte currentDifficulty;
private short currentCrafted;
private short currentAttempt;
private bool hasMaterials;
private PassiveGuildleveData passiveGLData;
public PassiveGuildleve(Quest staticQuest, Player owner, byte currentDifficulty)
: base(staticQuest, owner)
{
passiveGLData = Server.GetPassiveGLGamedata(GetQuestId());
targetRecipe = Server.ResolveRecipe().GetRecipeByItemID(passiveGLData.objectiveItemId[currentDifficulty]);
this.currentDifficulty = currentDifficulty;
currentAttempt = 0;
currentCrafted = 0;
hasMaterials = false;
}
public PassiveGuildleve(Quest staticQuest, Player owner, string questDataJson) : base(staticQuest, owner)
{
passiveGLData = Server.GetPassiveGLGamedata(GetQuestId());
Dictionary<string, object> questData = null;
if (questDataJson != null)
questData = JsonConvert.DeserializeObject<Dictionary<string, object>>(questDataJson);
if (questData == null)
questData = new Dictionary<string, object>();
currentDifficulty = questData.ContainsKey("currentDifficulty") ? (byte)Convert.ToByte(questData["currentDifficulty"]) : (byte)0;
currentAttempt = questData.ContainsKey("currentAttempt") ? (short)Convert.ToInt16(questData["currentAttempt"]) : (short)0;
currentCrafted = questData.ContainsKey("currentCrafted") ? (short)Convert.ToInt16(questData["currentCrafted"]) : (short)0;
hasMaterials = questData.ContainsKey("hasMaterials") ? (bool)questData["hasMaterials"] : false;
targetRecipe = Server.ResolveRecipe().GetRecipeByItemID(passiveGLData.objectiveItemId[currentDifficulty]);
}
public void CraftSuccess()
{
currentCrafted += (short) targetRecipe.resultQuantity;
currentAttempt++;
}
public void CraftFail()
{
currentAttempt++;
}
public Recipe GetRecipe()
{
return targetRecipe;
}
public int GetObjectiveQuantity()
{
return passiveGLData.objectiveQuantity[currentDifficulty];
}
public int getCurrentCrafted()
{
return currentCrafted;
}
public int GetRemainingMaterials()
{
return passiveGLData.numberOfAttempts[currentDifficulty] - currentAttempt;
}
public int GetCurrentAttempt()
{
return currentAttempt;
}
public int GetMaxAttempts()
{
return passiveGLData.numberOfAttempts[currentDifficulty];
}
public byte GetCurrentDifficulty()
{
return currentDifficulty;
}
public bool HasMaterials()
{
return hasMaterials;
}
public PassiveGuildleveData GetPassiveGLData()
{
return passiveGLData;
}
public override void SaveData()
{
Database.SaveQuest(owner, this);
}
public override string GetSerializedQuestData()
{
Dictionary<string, object> questData = new Dictionary<string, object>
{
{ "currentDifficulty", currentDifficulty },
{ "currentAttempt", currentAttempt },
{ "currentCrafted", currentCrafted },
{ "hasMaterials", hasMaterials }
};
return JsonConvert.SerializeObject(questData, Formatting.Indented);
}
}
}

View File

@@ -20,7 +20,6 @@ along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
*/ */
using Meteor.Map.lua; using Meteor.Map.lua;
using MySql.Data.MySqlClient;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@@ -29,7 +28,10 @@ namespace Meteor.Map.Actors
{ {
class Quest : Actor class Quest : Actor
{ {
protected Player owner; private Player owner;
private uint currentPhase = 0;
private uint questFlags = 0;
private Dictionary<string, Object> questData = new Dictionary<string, object>();
public Quest(uint actorID, string name) public Quest(uint actorID, string name)
: base(actorID) : base(actorID)
@@ -37,10 +39,29 @@ namespace Meteor.Map.Actors
actorName = name; actorName = name;
} }
public Quest(Quest staticQuest, Player owner) : base(staticQuest.actorId) public Quest(Player owner, uint actorID, string name, string questDataJson, uint questFlags, uint currentPhase)
: base(actorID)
{ {
this.owner = owner; this.owner = owner;
actorName = staticQuest.actorName; actorName = name;
this.questFlags = questFlags;
if (questDataJson != null)
this.questData = JsonConvert.DeserializeObject<Dictionary<string, Object>>(questDataJson);
else
questData = null;
if (questData == null)
questData = new Dictionary<string, object>();
this.currentPhase = currentPhase;
}
public void SetQuestData(string dataName, object data)
{
questData[dataName] = data;
//Inform update
} }
public uint GetQuestId() public uint GetQuestId()
@@ -48,8 +69,81 @@ namespace Meteor.Map.Actors
return actorId & 0xFFFFF; return actorId & 0xFFFFF;
} }
public virtual void SaveData() { } public object GetQuestData(string dataName)
public virtual string GetSerializedQuestData() { return null; } {
if (questData.ContainsKey(dataName))
return questData[dataName];
else
return null;
}
public void ClearQuestData()
{
questData.Clear();
}
public void ClearQuestFlags()
{
questFlags = 0;
}
public void SetQuestFlag(int bitIndex, bool value)
{
if (bitIndex >= 32)
{
Program.Log.Error("Tried to access bit flag >= 32 for questId: {0}", actorId);
return;
}
int mask = 1 << bitIndex;
if (value)
questFlags |= (uint)(1 << bitIndex);
else
questFlags &= (uint)~(1 << bitIndex);
DoCompletionCheck();
}
public bool GetQuestFlag(int bitIndex)
{
if (bitIndex >= 32)
{
Program.Log.Error("Tried to access bit flag >= 32 for questId: {0}", actorId);
return false;
}
else
return (questFlags & (1 << bitIndex)) == (1 << bitIndex);
}
public uint GetPhase()
{
return currentPhase;
}
public void NextPhase(uint phaseNumber)
{
currentPhase = phaseNumber;
owner.SendGameMessage(Server.GetWorldManager().GetActor(), 25116, 0x20, (object)GetQuestId());
SaveData();
DoCompletionCheck();
}
public uint GetQuestFlags()
{
return questFlags;
}
public string GetSerializedQuestData()
{
return JsonConvert.SerializeObject(questData, Formatting.Indented);
}
public void SaveData()
{
Database.SaveQuest(owner, this);
}
public void DoCompletionCheck() public void DoCompletionCheck()
{ {
@@ -67,45 +161,5 @@ namespace Meteor.Map.Actors
owner.SendGameMessage(owner, Server.GetWorldManager().GetActor(), 25236, 0x20, (object)GetQuestId()); owner.SendGameMessage(owner, Server.GetWorldManager().GetActor(), 25236, 0x20, (object)GetQuestId());
} }
public static Quest LoadQuestDB(Player player, MySqlDataReader reader)
{
uint questID = 0xA0F00000 | reader.GetUInt32("questId");
Quest staticQuest = Server.GetStaticActors(questID) as Quest;
string questData = null;
if (!reader.IsDBNull(reader.GetOrdinal("questData")))
questData = reader.GetString("questData");
else
questData = "{}";
if (staticQuest.IsScenario())
{
uint questFlags = 0;
uint currentPhase = 0;
if (!reader.IsDBNull(reader.GetOrdinal("questFlags")))
questFlags = reader.GetUInt32("questFlags");
if (!reader.IsDBNull(reader.GetOrdinal("currentPhase")))
currentPhase = reader.GetUInt32("currentPhase");
return new Scenario(staticQuest, player, questData, questFlags, currentPhase);
}
else if (staticQuest.IsCraftPassiveGuildleve())
{
return new PassiveGuildleve(staticQuest, player, questData);
}
throw new NotImplementedException("Unknown quest type added");
}
public bool IsScenario()
{
return !IsCraftPassiveGuildleve();
}
public bool IsCraftPassiveGuildleve()
{
return GetQuestId() > 120000 && GetQuestId() < 121024;
}
} }
} }

View File

@@ -1,140 +0,0 @@
/*
===========================================================================
Copyright (C) 2015-2019 Project Meteor Dev Team
This file is part of Project Meteor Server.
Project Meteor Server is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Project Meteor Server is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
===========================================================================
*/
using Meteor.Map.lua;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
namespace Meteor.Map.Actors
{
class Scenario : Quest
{
private uint currentPhase = 0;
private uint questFlags = 0;
private Dictionary<string, object> questData = new Dictionary<string, object>();
public Scenario(uint actorID, string name)
: base(actorID, name)
{
actorName = name;
}
public Scenario(Quest staticQuest, Player owner, string questDataJson, uint questFlags, uint currentPhase)
: base(staticQuest, owner)
{
this.questFlags = questFlags;
if (questDataJson != null)
this.questData = JsonConvert.DeserializeObject<Dictionary<string, object>>(questDataJson);
else
questData = null;
if (questData == null)
questData = new Dictionary<string, object>();
this.currentPhase = currentPhase;
}
public void SetQuestData(string dataName, object data)
{
questData[dataName] = data;
//Inform update
}
public object GetQuestData(string dataName)
{
if (questData.ContainsKey(dataName))
return questData[dataName];
else
return null;
}
public void ClearQuestData()
{
questData.Clear();
}
public void ClearQuestFlags()
{
questFlags = 0;
}
public void SetQuestFlag(int bitIndex, bool value)
{
if (bitIndex >= 32)
{
Program.Log.Error("Tried to access bit flag >= 32 for questId: {0}", actorId);
return;
}
int mask = 1 << bitIndex;
if (value)
questFlags |= (uint)(1 << bitIndex);
else
questFlags &= (uint)~(1 << bitIndex);
DoCompletionCheck();
}
public bool GetQuestFlag(int bitIndex)
{
if (bitIndex >= 32)
{
Program.Log.Error("Tried to access bit flag >= 32 for questId: {0}", actorId);
return false;
}
else
return (questFlags & (1 << bitIndex)) == (1 << bitIndex);
}
public uint GetPhase()
{
return currentPhase;
}
public void NextPhase(uint phaseNumber)
{
currentPhase = phaseNumber;
owner.SendGameMessage(Server.GetWorldManager().GetActor(), 25116, 0x20, (object)GetQuestId());
SaveData();
DoCompletionCheck();
}
public uint GetQuestFlags()
{
return questFlags;
}
public override string GetSerializedQuestData()
{
return JsonConvert.SerializeObject(questData, Formatting.Indented);
}
public override void SaveData()
{
Database.SaveQuest(owner, this);
}
}
}

View File

@@ -59,8 +59,8 @@ namespace Meteor.Map.Actors
try try
{ {
byte byteIn = binReader.ReadByte(); byte byteIn = binReader.ReadByte();
byte byteOut = (byte)(byteIn ^ 0x73); byte byteOut = (Byte)(byteIn ^ 0x73);
binWriter.Write((byte)byteOut); binWriter.Write((Byte)byteOut);
} }
catch (EndOfStreamException) { break; } catch (EndOfStreamException) { break; }
} }

View File

@@ -1,20 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup> </startup>
<system.data>
<DbProviderFactories>
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
<runtime> <runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" /> <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly> </dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
</configuration> </configuration>

View File

@@ -1,92 +0,0 @@
/*
===========================================================================
Copyright (C) 2015-2019 Project Meteor Dev Team
This file is part of Project Meteor Server.
Project Meteor Server is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Project Meteor Server is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
===========================================================================
*/
using MySql.Data.MySqlClient;
namespace Meteor.Map.dataobjects
{
class PassiveGuildleveData
{
public readonly uint id;
public readonly uint plateId;
public readonly uint borderId;
public readonly uint recommendedClass;
public readonly uint issuingLocation;
public readonly uint leveLocation;
public readonly uint deliveryDisplayName;
public readonly int[] objectiveItemId;
public readonly int[] objectiveQuantity;
public readonly int[] rewardItemId;
public readonly int[] rewardQuantity;
public readonly int[] numberOfAttempts;
public readonly int[] recommendedLevel;
public PassiveGuildleveData(MySqlDataReader reader)
{
id = reader.GetUInt32("id");
plateId = reader.GetUInt32("plateId");
borderId = reader.GetUInt32("borderId");
recommendedClass = reader.GetUInt32("recommendedClass");
issuingLocation = reader.GetUInt32("issuingLocation");
leveLocation = reader.GetUInt32("guildleveLocation");
deliveryDisplayName = reader.GetUInt32("deliveryDisplayName");
objectiveItemId = new int[4];
objectiveQuantity = new int[4];
rewardItemId = new int[4];
rewardQuantity = new int[4];
numberOfAttempts = new int[4];
recommendedLevel = new int[4];
objectiveItemId[0] = reader.GetInt32("objectiveItemId1");
objectiveItemId[1] = reader.GetInt32("objectiveItemId2");
objectiveItemId[2] = reader.GetInt32("objectiveItemId3");
objectiveItemId[3] = reader.GetInt32("objectiveItemId4");;
objectiveQuantity[0] = reader.GetInt32("objectiveQuantity1");
objectiveQuantity[1] = reader.GetInt32("objectiveQuantity2");
objectiveQuantity[2] = reader.GetInt32("objectiveQuantity3");
objectiveQuantity[3] = reader.GetInt32("objectiveQuantity4");
rewardItemId[0] = reader.GetInt32("rewardItemId1");
rewardItemId[1] = reader.GetInt32("rewardItemId2");
rewardItemId[2] = reader.GetInt32("rewardItemId3");
rewardItemId[3] = reader.GetInt32("rewardItemId4");
rewardQuantity[0] = reader.GetInt32("rewardQuantity1");
rewardQuantity[1] = reader.GetInt32("rewardQuantity2");
rewardQuantity[2] = reader.GetInt32("rewardQuantity3");
rewardQuantity[3] = reader.GetInt32("rewardQuantity4");
numberOfAttempts[0] = reader.GetInt32("numberOfAttempts1");
numberOfAttempts[1] = reader.GetInt32("numberOfAttempts2");
numberOfAttempts[2] = reader.GetInt32("numberOfAttempts3");
numberOfAttempts[3] = reader.GetInt32("numberOfAttempts4");
recommendedLevel[0] = reader.GetInt32("recommendedLevel1");
recommendedLevel[1] = reader.GetInt32("recommendedLevel2");
recommendedLevel[2] = reader.GetInt32("recommendedLevel3");
recommendedLevel[3] = reader.GetInt32("recommendedLevel4");
}
}
}

View File

@@ -1,36 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Meteor.Map.DataObjects
{
class Recipe
{
public readonly uint id;
public readonly uint resultItemID;
public readonly uint resultQuantity;
public readonly uint[] materials;
public readonly byte[] allowedCrafters;
public readonly uint crystalId1;
public readonly uint crystalId2;
public readonly uint crystalQuantity1;
public readonly uint crystalQuantity2;
public readonly byte tier;
public Recipe(uint id, uint resultItemID, uint resultQuantity, uint[] materials, uint crystalId1, uint crystalQuantity1, uint crystalId2, uint crystalQuantity2, byte[] allowedCrafters, byte tier)
{
this.id = id;
this.resultItemID = resultItemID;
this.resultQuantity = resultQuantity;
this.materials = materials;
this.allowedCrafters = allowedCrafters;
this.crystalId1 = crystalId1;
this.crystalId2 = crystalId2;
this.crystalQuantity1 = crystalQuantity1;
this.crystalQuantity2 = crystalQuantity2;
this.tier = tier;
}
}
}

View File

@@ -1,94 +0,0 @@
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Linq;
using MoonSharp.Interpreter;
namespace Meteor.Map.DataObjects
{
class RecipeResolver
{
Dictionary<uint, Recipe> recipeList;
Dictionary<string, List<Recipe>> matsToRecipes;
private RecipeResolver(Dictionary<uint, Recipe> recipeList, Dictionary<string, List<Recipe>> matsToRecipes)
{
this.recipeList = recipeList;
this.matsToRecipes = matsToRecipes;
}
public static RecipeResolver Init()
{
var recipeList = new Dictionary<uint, Recipe>();
var matToRecipes = new Dictionary<string, List<Recipe>>();
Database.GetRecipeGamedata(recipeList, matToRecipes);
return new RecipeResolver(recipeList, matToRecipes);
}
public List<Recipe> GetRecipeFromMats(uint mat1 = 0, uint mat2 = 0, uint mat3 = 0, uint mat4 = 0, uint mat5 = 0, uint mat6 = 0, uint mat7 = 0, uint mat8 = 0)
{
uint[] mats = new uint[8];
mats[0] = mat1;
mats[1] = mat2;
mats[2] = mat3;
mats[3] = mat4;
mats[4] = mat5;
mats[5] = mat6;
mats[6] = mat7;
mats[7] = mat8;
byte[] result = new byte[8 * sizeof(int)];
Buffer.BlockCopy(mats, 0, result, 0, result.Length);
string hash;
using (MD5 md5 = MD5.Create())
{
hash = BitConverter.ToString(md5.ComputeHash(result));
}
if (matsToRecipes.ContainsKey(hash))
return matsToRecipes[hash];
else
return null;
}
public Recipe GetRecipeByItemID(int objectiveItemID)
{
return recipeList.Where(recipe => recipe.Value.resultItemID == objectiveItemID).FirstOrDefault().Value;
}
public DynValue RecipesToItemIdTable(List<Recipe> recipeList)
{
DynValue[] itemIDs = new DynValue[8];
for (int i = 0; i < 8; i++)
itemIDs[i] = recipeList != null && i < recipeList.Count ? DynValue.NewNumber(recipeList[i].resultItemID) : DynValue.NewNil();
return DynValue.NewTable(new Table(new Script(), itemIDs));
}
public DynValue RecipeToMatIdTable(Recipe recipe)
{
DynValue[] itemIDs = new DynValue[8];
for (int i = 0; i < 8; i++)
itemIDs[i] = DynValue.NewNumber(recipe.materials[i]);
return DynValue.NewTable(new Table(new Script(), itemIDs));
}
public Recipe GetRecipeByID(uint recipeID)
{
if (recipeID == 0)
return null;
if (recipeList.ContainsKey(recipeID))
return recipeList[recipeID];
else
return null;
}
public int GetNumRecipes()
{
return recipeList.Count;
}
}
}

View File

@@ -33,8 +33,6 @@ using Meteor.Map.packets.receive.supportdesk;
using Meteor.Map.actors.chara.npc; using Meteor.Map.actors.chara.npc;
using Meteor.Map.actors.chara.ai; using Meteor.Map.actors.chara.ai;
using Meteor.Map.packets.send.actor.battle; using Meteor.Map.packets.send.actor.battle;
using Meteor.Map.DataObjects;
using System.Security.Cryptography;
namespace Meteor.Map namespace Meteor.Map
{ {
@@ -42,10 +40,10 @@ namespace Meteor.Map
class Database class Database
{ {
public static uint GetUserIdFromSession(string sessionId) public static uint GetUserIdFromSession(String sessionId)
{ {
uint id = 0; uint id = 0;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -74,7 +72,7 @@ namespace Meteor.Map
public static Dictionary<uint, ItemData> GetItemGamedata() public static Dictionary<uint, ItemData> GetItemGamedata()
{ {
using (var conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (var conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
Dictionary<uint, ItemData> gamedataItems = new Dictionary<uint, ItemData>(); Dictionary<uint, ItemData> gamedataItems = new Dictionary<uint, ItemData>();
@@ -131,7 +129,7 @@ namespace Meteor.Map
public static Dictionary<uint, GuildleveData> GetGuildleveGamedata() public static Dictionary<uint, GuildleveData> GetGuildleveGamedata()
{ {
using (var conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (var conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
Dictionary<uint, GuildleveData> gamedataGuildleves = new Dictionary<uint, GuildleveData>(); Dictionary<uint, GuildleveData> gamedataGuildleves = new Dictionary<uint, GuildleveData>();
@@ -151,6 +149,7 @@ namespace Meteor.Map
{ {
while (reader.Read()) while (reader.Read())
{ {
uint id = reader.GetUInt32("id");
GuildleveData guildleve = new GuildleveData(reader); GuildleveData guildleve = new GuildleveData(reader);
gamedataGuildleves.Add(guildleve.id, guildleve); gamedataGuildleves.Add(guildleve.id, guildleve);
} }
@@ -169,144 +168,12 @@ namespace Meteor.Map
} }
} }
public static Dictionary<uint, PassiveGuildleveData> GetPassiveGuildleveGamedata()
{
using (var conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{
Dictionary<uint, PassiveGuildleveData> gamedataPassiveGuildleves = new Dictionary<uint, PassiveGuildleveData>();
try
{
conn.Open();
string query = @"
SELECT
*
FROM gamedata_passivegl_craft
";
MySqlCommand cmd = new MySqlCommand(query, conn);
using (MySqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
PassiveGuildleveData passiveGL = new PassiveGuildleveData(reader);
gamedataPassiveGuildleves.Add(passiveGL.id, passiveGL);
}
}
}
catch (MySqlException e)
{
Program.Log.Error(e.ToString());
}
finally
{
conn.Dispose();
}
return gamedataPassiveGuildleves;
}
}
public static bool GetRecipeGamedata(Dictionary<uint, Recipe> recipeList, Dictionary<string, List<Recipe>> matToRecipe)
{
using (var conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{
try
{
conn.Open();
string query = @"
SELECT
id,
craftedItem,
craftedQuantity,
crystal0ID,
crystal0Quantity,
crystal1ID,
crystal1Quantity,
material0,
material1,
material2,
material3,
material4,
material5,
material6,
material7
FROM gamedata_recipes
ORDER BY craftedItem ASC
";
MySqlCommand cmd = new MySqlCommand(query, conn);
using (MySqlDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
uint recipeID = reader.GetUInt32("id");
uint craftedItem = reader.GetUInt32("craftedItem");
uint craftedQuantity = reader.GetUInt32("craftedQuantity");
uint crystal0ID = reader.GetUInt32("crystal0ID");
uint crystal0Quantity = reader.GetUInt32("crystal0Quantity");
uint crystal1ID = reader.GetUInt32("crystal1ID");
uint crystal1Quantity = reader.GetUInt32("crystal1Quantity");
uint[] mats = new uint[8];
mats[0] = reader.GetUInt32("material0");
mats[1] = reader.GetUInt32("material1");
mats[2] = reader.GetUInt32("material2");
mats[3] = reader.GetUInt32("material3");
mats[4] = reader.GetUInt32("material4");
mats[5] = reader.GetUInt32("material5");
mats[6] = reader.GetUInt32("material6");
mats[7] = reader.GetUInt32("material7");
//Hash for the Mat -> Recipe Dictionary
byte[] result = new byte[8 * sizeof(int)];
Buffer.BlockCopy(mats, 0, result, 0, result.Length);
string hash;
using (MD5 md5 = MD5.Create())
{
hash = BitConverter.ToString(md5.ComputeHash(result));
}
if (!matToRecipe.ContainsKey(hash))
matToRecipe.Add(hash, new List<Recipe>());
//Create obj
Recipe recipe = new Recipe(recipeID, craftedItem, craftedQuantity, mats, crystal0ID, crystal0Quantity, crystal1ID, crystal1Quantity, new byte[] { }, 1);
//Add to both Dictionaries
recipeList.Add(recipeID, recipe);
matToRecipe[hash].Add(recipe);
}
}
}
catch (MySqlException e)
{
Program.Log.Error(e.ToString());
return false;
}
finally
{
conn.Dispose();
}
return true;
}
}
public static void SavePlayerAppearance(Player player) public static void SavePlayerAppearance(Player player)
{ {
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -364,7 +231,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -400,7 +267,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -450,7 +317,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -484,7 +351,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -532,7 +399,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -551,13 +418,9 @@ namespace Meteor.Map
cmd.Parameters.AddWithValue("@charaId", player.actorId); cmd.Parameters.AddWithValue("@charaId", player.actorId);
cmd.Parameters.AddWithValue("@slot", slot); cmd.Parameters.AddWithValue("@slot", slot);
cmd.Parameters.AddWithValue("@questId", 0xFFFFF & quest.actorId); cmd.Parameters.AddWithValue("@questId", 0xFFFFF & quest.actorId);
cmd.Parameters.AddWithValue("@phase", quest.GetPhase());
cmd.Parameters.AddWithValue("@questData", quest.GetSerializedQuestData()); cmd.Parameters.AddWithValue("@questData", quest.GetSerializedQuestData());
cmd.Parameters.AddWithValue("@questFlags", quest.GetQuestFlags());
if (quest.IsScenario())
{
cmd.Parameters.AddWithValue("@phase", (quest as Scenario).GetPhase());
cmd.Parameters.AddWithValue("@questFlags", (quest as Scenario).GetQuestFlags());
}
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
@@ -577,7 +440,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -613,7 +476,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -653,7 +516,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -686,7 +549,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -719,7 +582,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -753,7 +616,7 @@ namespace Meteor.Map
public static bool IsQuestCompleted(Player player, uint questId) public static bool IsQuestCompleted(Player player, uint questId)
{ {
bool isCompleted = false; bool isCompleted = false;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -780,7 +643,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1199,9 +1062,26 @@ namespace Meteor.Map
while (reader.Read()) while (reader.Read())
{ {
int index = reader.GetUInt16(0); int index = reader.GetUInt16(0);
Quest quest = Quest.LoadQuestDB(player, reader); player.playerWork.questScenario[index] = 0xA0F00000 | reader.GetUInt32(1);
player.questScenario[index] = quest; string questData = null;
player.playerWork.questScenario[index] = quest.actorId; uint questFlags = 0;
uint currentPhase = 0;
if (!reader.IsDBNull(2))
questData = reader.GetString(2);
else
questData = "{}";
if (!reader.IsDBNull(3))
questFlags = reader.GetUInt32(3);
else
questFlags = 0;
if (!reader.IsDBNull(4))
currentPhase = reader.GetUInt32(4);
string questName = Server.GetStaticActors(player.playerWork.questScenario[index]).actorName;
player.questScenario[index] = new Quest(player, player.playerWork.questScenario[index], questName, questData, questFlags, currentPhase);
} }
} }
@@ -1210,7 +1090,6 @@ namespace Meteor.Map
SELECT SELECT
slot, slot,
questId, questId,
questData,
abandoned, abandoned,
completed completed
FROM characters_quest_guildleve_local WHERE characterId = @charId"; FROM characters_quest_guildleve_local WHERE characterId = @charId";
@@ -1222,9 +1101,7 @@ namespace Meteor.Map
while (reader.Read()) while (reader.Read())
{ {
int index = reader.GetUInt16(0); int index = reader.GetUInt16(0);
Quest quest = Quest.LoadQuestDB(player, reader); player.playerWork.questGuildleve[index] = 0xA0F00000 | reader.GetUInt32(1);
player.questGuildleve[index] = quest;
player.playerWork.questGuildleve[index] = quest.actorId;
} }
} }
@@ -1295,7 +1172,7 @@ namespace Meteor.Map
{ {
InventoryItem[] equipment = new InventoryItem[player.GetEquipment().GetCapacity()]; InventoryItem[] equipment = new InventoryItem[player.GetEquipment().GetCapacity()];
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1339,7 +1216,7 @@ namespace Meteor.Map
public static void EquipItem(Player player, ushort equipSlot, ulong uniqueItemId) public static void EquipItem(Player player, ushort equipSlot, ulong uniqueItemId)
{ {
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1376,7 +1253,7 @@ namespace Meteor.Map
public static void UnequipItem(Player player, ushort equipSlot) public static void UnequipItem(Player player, ushort equipSlot)
{ {
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1411,7 +1288,7 @@ namespace Meteor.Map
if (commandId > 0) if (commandId > 0)
{ {
using (MySqlConnection conn = new MySqlConnection( using (MySqlConnection conn = new MySqlConnection(
string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}",
ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_HOST,
ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_PORT,
ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_NAME,
@@ -1456,7 +1333,7 @@ namespace Meteor.Map
public static void UnequipAbility(Player player, ushort hotbarSlot) public static void UnequipAbility(Player player, ushort hotbarSlot)
{ {
using (MySqlConnection conn = new MySqlConnection( using (MySqlConnection conn = new MySqlConnection(
string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}",
ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_HOST,
ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_PORT,
ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_NAME,
@@ -1496,7 +1373,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1547,7 +1424,7 @@ namespace Meteor.Map
{ {
ushort slot = 0; ushort slot = 0;
using (MySqlConnection conn = new MySqlConnection( using (MySqlConnection conn = new MySqlConnection(
string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}",
ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_HOST,
ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_PORT,
ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_NAME,
@@ -1599,7 +1476,7 @@ namespace Meteor.Map
{ {
List<InventoryItem> items = new List<InventoryItem>(); List<InventoryItem> items = new List<InventoryItem>();
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1679,7 +1556,7 @@ namespace Meteor.Map
{ {
InventoryItem insertedItem = null; InventoryItem insertedItem = null;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1732,7 +1609,7 @@ namespace Meteor.Map
public static void AddItem(Character owner, InventoryItem addedItem, ushort itemPackage, ushort slot) public static void AddItem(Character owner, InventoryItem addedItem, ushort itemPackage, ushort slot)
{ {
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1767,7 +1644,7 @@ namespace Meteor.Map
public static void RemoveItem(Character owner, ulong serverItemId) public static void RemoveItem(Character owner, ulong serverItemId)
{ {
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}; Allow User Variables=True", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}; Allow User Variables=True", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1797,7 +1674,7 @@ namespace Meteor.Map
public static void UpdateItemPositions(List<InventoryItem> updated) public static void UpdateItemPositions(List<InventoryItem> updated)
{ {
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1839,7 +1716,7 @@ namespace Meteor.Map
public static void SetQuantity(ulong serverItemId, int quantity) public static void SetQuantity(ulong serverItemId, int quantity)
{ {
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1871,7 +1748,7 @@ namespace Meteor.Map
public static void SetDealingInfo(InventoryItem item) public static void SetDealingInfo(InventoryItem item)
{ {
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1900,7 +1777,7 @@ namespace Meteor.Map
public static void ClearDealingInfo(InventoryItem item) public static void ClearDealingInfo(InventoryItem item)
{ {
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1930,7 +1807,7 @@ namespace Meteor.Map
public static SubPacket GetLatestAchievements(Player player) public static SubPacket GetLatestAchievements(Player player)
{ {
uint[] latestAchievements = new uint[5]; uint[] latestAchievements = new uint[5];
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -1972,7 +1849,7 @@ namespace Meteor.Map
{ {
SetCompletedAchievementsPacket cheevosPacket = new SetCompletedAchievementsPacket(); SetCompletedAchievementsPacket cheevosPacket = new SetCompletedAchievementsPacket();
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2017,7 +1894,7 @@ namespace Meteor.Map
public static SubPacket GetAchievementProgress(Player player, uint achievementId) public static SubPacket GetAchievementProgress(Player player, uint achievementId)
{ {
uint progress = 0, progressFlags = 0; uint progress = 0, progressFlags = 0;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2055,7 +1932,7 @@ namespace Meteor.Map
public static bool CreateLinkshell(Player player, string lsName, ushort lsCrest) public static bool CreateLinkshell(Player player, string lsName, ushort lsCrest)
{ {
bool success = false; bool success = false;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2095,7 +1972,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2135,7 +2012,7 @@ namespace Meteor.Map
MySqlCommand cmd; MySqlCommand cmd;
bool wasError = false; bool wasError = false;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2172,7 +2049,7 @@ namespace Meteor.Map
public static bool isTicketOpen(string playerName) public static bool isTicketOpen(string playerName)
{ {
bool isOpen = false; bool isOpen = false;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2213,7 +2090,7 @@ namespace Meteor.Map
public static void closeTicket(string playerName) public static void closeTicket(string playerName)
{ {
bool isOpen = false; bool isOpen = false;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2245,7 +2122,7 @@ namespace Meteor.Map
{ {
string[] faqs = null; string[] faqs = null;
List<string> raw = new List<string>(); List<string> raw = new List<string>();
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2288,7 +2165,7 @@ namespace Meteor.Map
public static string getFAQBody(uint slot, uint langCode = 1) public static string getFAQBody(uint slot, uint langCode = 1)
{ {
string body = string.Empty; string body = string.Empty;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2328,7 +2205,7 @@ namespace Meteor.Map
{ {
string[] issues = null; string[] issues = null;
List<string> raw = new List<string>(); List<string> raw = new List<string>();
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2369,7 +2246,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2407,7 +2284,7 @@ namespace Meteor.Map
string query; string query;
MySqlCommand cmd; MySqlCommand cmd;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2441,7 +2318,7 @@ namespace Meteor.Map
{ {
var effects = new Dictionary<uint, StatusEffect>(); var effects = new Dictionary<uint, StatusEffect>();
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2489,7 +2366,7 @@ namespace Meteor.Map
{ {
string[] faqs = null; string[] faqs = null;
List<string> raw = new List<string>(); List<string> raw = new List<string>();
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2536,7 +2413,7 @@ namespace Meteor.Map
public static void LoadGlobalBattleCommandList(Dictionary<ushort, BattleCommand> battleCommandDict, Dictionary<Tuple<byte, short>, List<ushort>> battleCommandIdByLevel) public static void LoadGlobalBattleCommandList(Dictionary<ushort, BattleCommand> battleCommandDict, Dictionary<Tuple<byte, short>, List<ushort>> battleCommandIdByLevel)
{ {
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2636,7 +2513,7 @@ namespace Meteor.Map
} }
} }
Program.Log.Info(string.Format("Loaded {0} battle commands.", count)); Program.Log.Info(String.Format("Loaded {0} battle commands.", count));
} }
catch (MySqlException e) catch (MySqlException e)
{ {
@@ -2651,7 +2528,7 @@ namespace Meteor.Map
public static void LoadGlobalBattleTraitList(Dictionary<ushort, BattleTrait> battleTraitDict, Dictionary<byte, List<ushort>> battleTraitJobDict) public static void LoadGlobalBattleTraitList(Dictionary<ushort, BattleTrait> battleTraitDict, Dictionary<byte, List<ushort>> battleTraitJobDict)
{ {
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2690,7 +2567,7 @@ namespace Meteor.Map
count++; count++;
} }
} }
Program.Log.Info(string.Format("Loaded {0} battle traits.", count)); Program.Log.Info(String.Format("Loaded {0} battle traits.", count));
} }
catch (MySqlException e) catch (MySqlException e)
{ {
@@ -2705,13 +2582,13 @@ namespace Meteor.Map
public static void SetExp(Player player, byte classId, int exp) public static void SetExp(Player player, byte classId, int exp)
{ {
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
conn.Open(); conn.Open();
var query = string.Format(@" var query = String.Format(@"
UPDATE characters_class_exp UPDATE characters_class_exp
SET SET
{0} = @exp {0} = @exp
@@ -2719,10 +2596,10 @@ namespace Meteor.Map
characterId = @characterId", CharacterUtils.GetClassNameForId(classId)); characterId = @characterId", CharacterUtils.GetClassNameForId(classId));
MySqlCommand cmd = new MySqlCommand(query, conn); MySqlCommand cmd = new MySqlCommand(query, conn);
cmd.Prepare();
cmd = new MySqlCommand(query, conn); cmd = new MySqlCommand(query, conn);
cmd.Parameters.AddWithValue("@characterId", player.actorId); cmd.Parameters.AddWithValue("@characterId", player.actorId);
cmd.Parameters.AddWithValue("@exp", exp); cmd.Parameters.AddWithValue("@exp", exp);
cmd.Prepare();
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
catch (MySqlException e) catch (MySqlException e)
@@ -2738,13 +2615,13 @@ namespace Meteor.Map
public static void SetLevel(Player player, byte classId, short level) public static void SetLevel(Player player, byte classId, short level)
{ {
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
conn.Open(); conn.Open();
var query = string.Format(@" var query = String.Format(@"
UPDATE characters_class_levels UPDATE characters_class_levels
SET SET
{0} = @lvl {0} = @lvl
@@ -2752,10 +2629,10 @@ namespace Meteor.Map
characterId = @characterId", CharacterUtils.GetClassNameForId(classId)); characterId = @characterId", CharacterUtils.GetClassNameForId(classId));
MySqlCommand cmd = new MySqlCommand(query, conn); MySqlCommand cmd = new MySqlCommand(query, conn);
cmd.Prepare();
cmd = new MySqlCommand(query, conn); cmd = new MySqlCommand(query, conn);
cmd.Parameters.AddWithValue("@characterId", player.actorId); cmd.Parameters.AddWithValue("@characterId", player.actorId);
cmd.Parameters.AddWithValue("@lvl", level); cmd.Parameters.AddWithValue("@lvl", level);
cmd.Prepare();
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
catch (MySqlException e) catch (MySqlException e)
@@ -2773,7 +2650,7 @@ namespace Meteor.Map
{ {
Retainer retainer = null; Retainer retainer = null;
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
@@ -2871,13 +2748,13 @@ namespace Meteor.Map
"fsh" "fsh"
}; };
using (MySqlConnection conn = new MySqlConnection(string.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
{ {
try try
{ {
conn.Open(); conn.Open();
query = string.Format(@" query = String.Format(@"
UPDATE characters_class_levels UPDATE characters_class_levels
SET SET
{0}=@level {0}=@level

View File

@@ -37,7 +37,6 @@ using Meteor.Map.actors.area;
using System.Threading; using System.Threading;
using Meteor.Map.actors.chara.ai; using Meteor.Map.actors.chara.ai;
using Meteor.Map.actors.chara.ai.controllers; using Meteor.Map.actors.chara.ai.controllers;
using Meteor.Map.DataObjects;
namespace Meteor.Map.lua namespace Meteor.Map.lua
{ {
@@ -143,7 +142,7 @@ namespace Meteor.Map.lua
} }
catch (ScriptRuntimeException e) catch (ScriptRuntimeException e)
{ {
LuaEngine.SendError(player, string.Format("OnEventUpdated: {0}", e.DecoratedMessage)); LuaEngine.SendError(player, String.Format("OnEventUpdated: {0}", e.DecoratedMessage));
player.EndEvent(); player.EndEvent();
} }
} }
@@ -170,7 +169,7 @@ namespace Meteor.Map.lua
{ {
// todo: this is probably unnecessary as im not sure there were pets for players // todo: this is probably unnecessary as im not sure there were pets for players
if (!(actor.aiContainer.GetController<PetController>()?.GetPetMaster() is Player)) if (!(actor.aiContainer.GetController<PetController>()?.GetPetMaster() is Player))
path = string.Format("./scripts/unique/{0}/{1}/{2}.lua", actor.zone.zoneName, actor is BattleNpc ? "Monster" : "PopulaceStandard", ((Npc)actor).GetUniqueId()); path = String.Format("./scripts/unique/{0}/{1}/{2}.lua", actor.zone.zoneName, actor is BattleNpc ? "Monster" : "PopulaceStandard", ((Npc)actor).GetUniqueId());
} }
// dont wanna throw an error if file doesnt exist // dont wanna throw an error if file doesnt exist
if (File.Exists(path)) if (File.Exists(path))
@@ -358,7 +357,7 @@ namespace Meteor.Map.lua
{ {
if (target is Player) if (target is Player)
{ {
return string.Format(FILEPATH_PLAYER); return String.Format(FILEPATH_PLAYER);
} }
else if (target is Npc) else if (target is Npc)
{ {
@@ -366,25 +365,25 @@ namespace Meteor.Map.lua
} }
else if (target is Command) else if (target is Command)
{ {
return string.Format(FILEPATH_COMMANDS, target.GetName()); return String.Format(FILEPATH_COMMANDS, target.GetName());
} }
else if (target is Director) else if (target is Director)
{ {
return string.Format(FILEPATH_DIRECTORS, ((Director)target).GetScriptPath()); return String.Format(FILEPATH_DIRECTORS, ((Director)target).GetScriptPath());
} }
else if (target is PrivateAreaContent) else if (target is PrivateAreaContent)
{ {
return string.Format(FILEPATH_CONTENT, ((PrivateAreaContent)target).GetPrivateAreaName()); return String.Format(FILEPATH_CONTENT, ((PrivateAreaContent)target).GetPrivateAreaName());
} }
else if (target is Area) else if (target is Area)
{ {
return string.Format(FILEPATH_ZONE, ((Area)target).zoneName); return String.Format(FILEPATH_ZONE, ((Area)target).zoneName);
} }
else if (target is Quest) else if (target is Quest)
{ {
string initial = ((Quest)target).actorName.Substring(0, 3); string initial = ((Quest)target).actorName.Substring(0, 3);
string questName = ((Quest)target).actorName; string questName = ((Quest)target).actorName;
return string.Format(FILEPATH_QUEST, initial, questName); return String.Format(FILEPATH_QUEST, initial, questName);
} }
else else
return ""; return "";
@@ -410,18 +409,18 @@ namespace Meteor.Map.lua
Area area = target.zone; Area area = target.zone;
if (area is PrivateArea) if (area is PrivateArea)
{ {
if (File.Exists(string.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId()))) if (File.Exists(String.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId())))
child = LuaEngine.LoadScript(string.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId())); child = LuaEngine.LoadScript(String.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId()));
} }
else else
{ {
if (File.Exists(string.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId()))) if (File.Exists(String.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId())))
child = LuaEngine.LoadScript(string.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId())); child = LuaEngine.LoadScript(String.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId()));
} }
if (parent == null && child == null) if (parent == null && child == null)
{ {
LuaEngine.SendError(player, string.Format("ERROR: Could not find script for actor {0}.", target.GetName())); LuaEngine.SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName()));
} }
//Run Script //Run Script
@@ -458,18 +457,18 @@ namespace Meteor.Map.lua
Area area = target.zone; Area area = target.zone;
if (area is PrivateArea) if (area is PrivateArea)
{ {
if (File.Exists(string.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId()))) if (File.Exists(String.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId())))
child = LuaEngine.LoadScript(string.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId())); child = LuaEngine.LoadScript(String.Format("./scripts/unique/{0}/privatearea/{1}_{2}/{3}/{4}.lua", area.zoneName, ((PrivateArea)area).GetPrivateAreaName(), ((PrivateArea)area).GetPrivateAreaType(), target.className, target.GetUniqueId()));
} }
else else
{ {
if (File.Exists(string.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId()))) if (File.Exists(String.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId())))
child = LuaEngine.LoadScript(string.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId())); child = LuaEngine.LoadScript(String.Format("./scripts/unique/{0}/{1}/{2}.lua", area.zoneName, target.className, target.GetUniqueId()));
} }
if (parent == null && child == null) if (parent == null && child == null)
{ {
LuaEngine.SendError(player, string.Format("Could not find script for actor {0}.", target.GetName())); LuaEngine.SendError(player, String.Format("Could not find script for actor {0}.", target.GetName()));
return; return;
} }
@@ -525,13 +524,13 @@ namespace Meteor.Map.lua
else else
{ {
if (!optional) if (!optional)
SendError(player, string.Format("Could not find function '{0}' for actor {1}.", funcName, target.GetName())); SendError(player, String.Format("Could not find function '{0}' for actor {1}.", funcName, target.GetName()));
} }
} }
else else
{ {
if (!optional) if (!optional)
SendError(player, string.Format("Could not find script for actor {0}.", target.GetName())); SendError(player, String.Format("Could not find script for actor {0}.", target.GetName()));
} }
return null; return null;
} }
@@ -589,13 +588,13 @@ namespace Meteor.Map.lua
else else
{ {
if (!optional) if (!optional)
SendError(player, string.Format("Could not find function '{0}' for actor {1}.", funcName, target.GetName())); SendError(player, String.Format("Could not find function '{0}' for actor {1}.", funcName, target.GetName()));
} }
} }
else else
{ {
if (!(target is Area) && !optional) if (!(target is Area) && !optional)
SendError(player, string.Format("Could not find script for actor {0}.", target.GetName())); SendError(player, String.Format("Could not find script for actor {0}.", target.GetName()));
} }
} }
@@ -616,7 +615,7 @@ namespace Meteor.Map.lua
} }
catch (ScriptRuntimeException e) catch (ScriptRuntimeException e)
{ {
LuaEngine.SendError(player, string.Format("OnEventStarted: {0}", e.DecoratedMessage)); LuaEngine.SendError(player, String.Format("OnEventStarted: {0}", e.DecoratedMessage));
player.EndEvent(); player.EndEvent();
} }
} }
@@ -660,7 +659,7 @@ namespace Meteor.Map.lua
} }
#region RunGMCommand #region RunGMCommand
public static void RunGMCommand(Player player, string cmd, string[] param, bool help = false) public static void RunGMCommand(Player player, String cmd, string[] param, bool help = false)
{ {
bool playerNull = player == null; bool playerNull = player == null;
@@ -676,7 +675,7 @@ namespace Meteor.Map.lua
player = Server.GetWorldManager().GetPCInWorld(param[1] + " " + param[2]); player = Server.GetWorldManager().GetPCInWorld(param[1] + " " + param[2]);
// load from scripts/commands/gm/ directory // load from scripts/commands/gm/ directory
var path = string.Format("./scripts/commands/gm/{0}.lua", cmd.ToLower()); var path = String.Format("./scripts/commands/gm/{0}.lua", cmd.ToLower());
// check if the file exists // check if the file exists
if (File.Exists(path)) if (File.Exists(path))
@@ -747,7 +746,7 @@ namespace Meteor.Map.lua
// i hate to do this, but cant think of a better way to keep !help // i hate to do this, but cant think of a better way to keep !help
else if (help) else if (help)
{ {
player.SendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, string.Format("[Commands] [{0}]", cmd), description); player.SendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, String.Format("[Commands] [{0}]", cmd), description);
return; return;
} }
} }
@@ -851,8 +850,6 @@ namespace Meteor.Map.lua
script.Globals["GetWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor; script.Globals["GetWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
script.Globals["GetItemGamedata"] = (Func<uint, ItemData>)Server.GetItemGamedata; script.Globals["GetItemGamedata"] = (Func<uint, ItemData>)Server.GetItemGamedata;
script.Globals["GetGuildleveGamedata"] = (Func<uint, GuildleveData>)Server.GetGuildleveGamedata; script.Globals["GetGuildleveGamedata"] = (Func<uint, GuildleveData>)Server.GetGuildleveGamedata;
script.Globals["GetPassiveGLGamedata"] = (Func<uint, PassiveGuildleveData>)Server.GetPassiveGLGamedata;
script.Globals["GetRecipeResolver"] = (Func<RecipeResolver>)Server.ResolveRecipe;
script.Globals["GetLuaInstance"] = (Func<LuaEngine>)LuaEngine.GetInstance; script.Globals["GetLuaInstance"] = (Func<LuaEngine>)LuaEngine.GetInstance;
script.Options.DebugPrint = s => { Program.Log.Debug(s); }; script.Options.DebugPrint = s => { Program.Log.Debug(s); };

View File

@@ -26,9 +26,9 @@ namespace Meteor.Map.lua
class LuaParam class LuaParam
{ {
public int typeID; public int typeID;
public object value; public Object value;
public LuaParam(int type, object value) public LuaParam(int type, Object value)
{ {
this.typeID = type; this.typeID = type;
this.value = value; this.value = value;

View File

@@ -25,7 +25,6 @@ using Meteor.Map.lua;
using MoonSharp.Interpreter; using MoonSharp.Interpreter;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Text; using System.Text;
@@ -33,41 +32,42 @@ namespace Meteor.Map
{ {
class LuaUtils class LuaUtils
{ {
public class ItemRefParam public class ItemRefParam
{ {
public uint actorId; public uint actorId;
public ushort slot; public byte unknown;
public byte slot;
public byte itemPackage; public byte itemPackage;
public ItemRefParam(uint actorId, ushort slot, byte itemPackage) public ItemRefParam(uint actorId, byte unknown, byte slot, byte itemPackage)
{ {
this.actorId = actorId; this.actorId = actorId;
this.unknown = unknown;
this.slot = slot; this.slot = slot;
this.itemPackage = itemPackage; this.itemPackage = itemPackage;
} }
} }
public class MultiItemRefParam public class ItemOfferParam
{ {
public readonly uint actorId; public uint actorId;
public readonly ushort[] itemSlots; public ushort offerSlot;
public readonly byte[] itemPackages; public byte offerPackageId;
public readonly int numItems; public byte unknown1;
public ushort seekSlot;
public byte seekPackageId;
public byte unknown2;
public MultiItemRefParam(uint actorId, ushort[] itemSlots, byte[] itemPackages) public ItemOfferParam(uint actorId, ushort offerSlot, byte offerPackageId, byte unknown1, ushort seekSlot, byte seekPackageId, byte unknown2)
{ {
this.actorId = actorId; this.actorId = actorId;
this.itemSlots = itemSlots; this.offerSlot = offerSlot;
this.itemPackages = itemPackages; this.offerPackageId = offerPackageId;
this.numItems = itemSlots.Length; this.unknown1 = unknown1;
} this.seekSlot = seekSlot;
this.seekPackageId = seekPackageId;
public MultiItemRefParam(uint actorId, ushort itemSlot, byte itemPackage) this.unknown2 = unknown2;
{
this.actorId = actorId;
this.itemSlots = new ushort[] { itemSlot };
this.itemPackages = new byte[] { itemPackage };
numItems = 1;
} }
} }
@@ -126,37 +126,23 @@ namespace Meteor.Map
break; break;
case 0x7: //Item Reference to Inventory Spot case 0x7: //Item Reference to Inventory Spot
{ {
uint actorId = Utils.SwapEndian(reader.ReadUInt32()); uint type7ActorId = Utils.SwapEndian(reader.ReadUInt32());
ushort slot = Utils.SwapEndian(reader.ReadUInt16()); byte type7Unknown = reader.ReadByte();
byte itemPackage = reader.ReadByte(); byte type7Slot = reader.ReadByte();
value = new MultiItemRefParam(actorId, slot, itemPackage); byte type7InventoryType = reader.ReadByte();
value = new ItemRefParam(type7ActorId, type7Unknown, type7Slot, type7InventoryType);
} }
break; break;
case 0x8: //Multi Item Reference to Inventory Spot case 0x8: //Used for offering
{ {
long currentPosition = reader.BaseStream.Position - 1;
uint actorId = Utils.SwapEndian(reader.ReadUInt32()); uint actorId = Utils.SwapEndian(reader.ReadUInt32());
ushort itemSlot0 = Utils.SwapEndian(reader.ReadUInt16()); ushort rewardSlot = Utils.SwapEndian(reader.ReadUInt16());
byte packageId0 = reader.ReadByte(); byte rewardPackageId = reader.ReadByte();
byte unk1 = reader.ReadByte(); //Always 0x2?
byte numberOfEntries = reader.ReadByte(); ushort seekSlot = Utils.SwapEndian(reader.ReadUInt16());
byte seekPackageId = reader.ReadByte();
ushort[] itemSlots = new ushort[numberOfEntries]; byte unk2 = reader.ReadByte(); //Always 0xD?
byte[] packageIds = new byte[numberOfEntries]; value = new ItemOfferParam(actorId, rewardSlot, rewardPackageId, unk1, seekSlot, seekPackageId, unk2);
itemSlots[0] = itemSlot0;
packageIds[0] = packageId0;
for (int i = 1; i < numberOfEntries; i++)
{
itemSlots[i] = Utils.SwapEndian(reader.ReadUInt16());
packageIds[i] = reader.ReadByte();
}
byte byteSize = reader.ReadByte();
reader.BaseStream.Seek(currentPosition + byteSize, SeekOrigin.Begin);
value = new MultiItemRefParam(actorId, itemSlots, packageIds);
} }
break; break;
case 0x9: //Two Longs (only storing first one) case 0x9: //Two Longs (only storing first one)
@@ -172,13 +158,19 @@ namespace Meteor.Map
isDone = true; isDone = true;
continue; continue;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentException("Unknown lua param...");
} }
if (isDone) if (isDone)
break; break;
if (value != null) //Special case cause fuck Type8
if (value != null && value is ItemOfferParam)
{
luaParams.Add(new LuaParam(code, value));
luaParams.Add(new LuaParam(0x5, null)); //This is to clean up the seek script as it fucks with the args.
}
else if (value != null)
luaParams.Add(new LuaParam(code, value)); luaParams.Add(new LuaParam(code, value));
else if (wasNil) else if (wasNil)
luaParams.Add(new LuaParam(code, value)); luaParams.Add(new LuaParam(code, value));
@@ -233,41 +225,23 @@ namespace Meteor.Map
case 0x6: //Actor (By Id) case 0x6: //Actor (By Id)
value = Utils.SwapEndian(reader.ReadUInt32()); value = Utils.SwapEndian(reader.ReadUInt32());
break; break;
case 0x7: //Item Reference case 0x7: //Weird one used for inventory
{ uint type7ActorId = Utils.SwapEndian(reader.ReadUInt32());
uint actorId = Utils.SwapEndian(reader.ReadUInt32()); byte type7Unknown = reader.ReadByte();
ushort slot = Utils.SwapEndian(reader.ReadUInt16()); byte type7Slot = reader.ReadByte();
byte itemPackage = reader.ReadByte(); byte type7InventoryType = reader.ReadByte();
value = new ItemRefParam(actorId, slot, itemPackage); value = new ItemRefParam(type7ActorId, type7Unknown, type7Slot, type7InventoryType);
break; break;
} case 0x8:
case 0x8: //Multi Item Reference
{
long currentPosition = reader.BaseStream.Position - 1;
uint actorId = Utils.SwapEndian(reader.ReadUInt32()); uint actorId = Utils.SwapEndian(reader.ReadUInt32());
ushort itemSlot0 = Utils.SwapEndian(reader.ReadUInt16()); ushort rewardSlot = Utils.SwapEndian(reader.ReadUInt16());
byte packageId0 = reader.ReadByte(); byte rewardPackageId = reader.ReadByte();
byte unk1 = reader.ReadByte(); //Always 0x2?
byte numberOfEntries = reader.ReadByte(); ushort seekSlot = Utils.SwapEndian(reader.ReadUInt16());
byte seekPackageId = reader.ReadByte();
ushort[] itemSlots = new ushort[numberOfEntries]; byte unk2 = reader.ReadByte(); //Always 0xD?
byte[] packageIds = new byte[numberOfEntries]; value = new ItemOfferParam(actorId, rewardSlot, rewardPackageId, unk1, seekSlot, seekPackageId, unk2);
itemSlots[0] = itemSlot0;
packageIds[0] = packageId0;
for (int i = 1; i < numberOfEntries; i++)
{
itemSlots[i] = Utils.SwapEndian(reader.ReadUInt16());
packageIds[i] = reader.ReadByte();
}
byte byteSize = reader.ReadByte();
reader.BaseStream.Seek(currentPosition + byteSize, SeekOrigin.Begin);
value = new MultiItemRefParam(actorId, itemSlots, packageIds);
break; break;
}
case 0x9: //Two Longs (only storing first one) case 0x9: //Two Longs (only storing first one)
value = new Type9Param(Utils.SwapEndian(reader.ReadUInt64()), Utils.SwapEndian(reader.ReadUInt64())); value = new Type9Param(Utils.SwapEndian(reader.ReadUInt64()), Utils.SwapEndian(reader.ReadUInt64()));
break; break;
@@ -287,7 +261,12 @@ namespace Meteor.Map
if (isDone) if (isDone)
break; break;
if (value != null) if (value != null && value is ItemOfferParam)
{
luaParams.Add(new LuaParam(code, value));
luaParams.Add(new LuaParam(0x5, null)); //This is to clean up the seek script as it fucks with the args.
}
else if (value != null)
luaParams.Add(new LuaParam(code, value)); luaParams.Add(new LuaParam(code, value));
else if (wasNil) else if (wasNil)
luaParams.Add(new LuaParam(code, value)); luaParams.Add(new LuaParam(code, value));
@@ -308,22 +287,22 @@ namespace Meteor.Map
foreach (LuaParam l in luaParams) foreach (LuaParam l in luaParams)
{ {
if (l.typeID == 0x1) if (l.typeID == 0x1)
writer.Write((byte)0); writer.Write((Byte)0);
else else
writer.Write((byte)l.typeID); writer.Write((Byte)l.typeID);
switch (l.typeID) switch (l.typeID)
{ {
case 0x0: //Int32 case 0x0: //Int32
writer.Write((int)Utils.SwapEndian((int)l.value)); writer.Write((Int32)Utils.SwapEndian((Int32)l.value));
break; break;
case 0x1: //Int32 case 0x1: //Int32
writer.Write((uint)Utils.SwapEndian((uint)l.value)); writer.Write((UInt32)Utils.SwapEndian((UInt32)l.value));
break; break;
case 0x2: //Null Termed String case 0x2: //Null Termed String
string sv = (string)l.value; string sv = (string)l.value;
writer.Write(Encoding.ASCII.GetBytes(sv), 0, Encoding.ASCII.GetByteCount(sv)); writer.Write(Encoding.ASCII.GetBytes(sv), 0, Encoding.ASCII.GetByteCount(sv));
writer.Write((byte)0); writer.Write((Byte)0);
break; break;
case 0x3: //Boolean True case 0x3: //Boolean True
break; break;
@@ -332,23 +311,21 @@ namespace Meteor.Map
case 0x5: //Nil case 0x5: //Nil
break; break;
case 0x6: //Actor (By Id) case 0x6: //Actor (By Id)
writer.Write((uint)Utils.SwapEndian((uint)l.value)); writer.Write((UInt32)Utils.SwapEndian((UInt32)l.value));
break; break;
case 0x7: //Weird one used for inventory case 0x7: //Weird one used for inventory
ItemRefParam type7 = (ItemRefParam)l.value; ItemRefParam type7 = (ItemRefParam)l.value;
writer.Write((uint)Utils.SwapEndian((uint)type7.actorId)); writer.Write((UInt32)Utils.SwapEndian((UInt32)type7.actorId));
writer.Write((ushort)type7.slot); writer.Write((Byte)type7.unknown);
writer.Write((byte)type7.itemPackage); writer.Write((Byte)type7.slot);
break; writer.Write((Byte)type7.itemPackage);
case 0x8:
//TODO: Fill it out even if not used
break; break;
case 0x9: //Two Longs (only storing first one) case 0x9: //Two Longs (only storing first one)
writer.Write((ulong)Utils.SwapEndian(((Type9Param)l.value).item1)); writer.Write((UInt64)Utils.SwapEndian(((Type9Param)l.value).item1));
writer.Write((ulong)Utils.SwapEndian(((Type9Param)l.value).item2)); writer.Write((UInt64)Utils.SwapEndian(((Type9Param)l.value).item2));
break; break;
case 0xC: //Byte case 0xC: //Byte
writer.Write((byte)l.value); writer.Write((Byte)l.value);
break; break;
case 0x1B: //Short? case 0x1B: //Short?
break; break;
@@ -357,7 +334,7 @@ namespace Meteor.Map
} }
} }
writer.Write((byte)0xF); writer.Write((Byte)0xF);
} }
public static List<LuaParam> CreateLuaParamList(DynValue fromScript) public static List<LuaParam> CreateLuaParamList(DynValue fromScript)
@@ -440,7 +417,7 @@ namespace Meteor.Map
{ {
luaParams.Add(new LuaParam(0x1, (uint)o)); luaParams.Add(new LuaParam(0x1, (uint)o));
} }
else if (o is double) else if (o is Double)
{ {
if (((double)o) % 1 == 0) if (((double)o) % 1 == 0)
luaParams.Add(new LuaParam(0x0, (int)(double)o)); luaParams.Add(new LuaParam(0x0, (int)(double)o));
@@ -468,9 +445,9 @@ namespace Meteor.Map
{ {
luaParams.Add(new LuaParam(0x7, (ItemRefParam)o)); luaParams.Add(new LuaParam(0x7, (ItemRefParam)o));
} }
else if (o is MultiItemRefParam) else if (o is ItemOfferParam)
{ {
luaParams.Add(new LuaParam(0x8, (MultiItemRefParam)o)); luaParams.Add(new LuaParam(0x8, (ItemOfferParam)o));
} }
else if (o is Type9Param) else if (o is Type9Param)
{ {
@@ -504,13 +481,13 @@ namespace Meteor.Map
switch (lParams[i].typeID) switch (lParams[i].typeID)
{ {
case 0x0: //Int32 case 0x0: //Int32
dumpString += string.Format("0x{0:X}", (int)lParams[i].value); dumpString += String.Format("0x{0:X}", (int)lParams[i].value);
break; break;
case 0x1: //Int32 case 0x1: //Int32
dumpString += string.Format("0x{0:X}", (uint)lParams[i].value); dumpString += String.Format("0x{0:X}", (uint)lParams[i].value);
break; break;
case 0x2: //Null Termed String case 0x2: //Null Termed String
dumpString += string.Format("\"{0}\"", (string)lParams[i].value); dumpString += String.Format("\"{0}\"", (string)lParams[i].value);
break; break;
case 0x3: //Boolean True case 0x3: //Boolean True
dumpString += "true"; dumpString += "true";
@@ -518,39 +495,29 @@ namespace Meteor.Map
case 0x4: //Boolean False case 0x4: //Boolean False
dumpString += "false"; dumpString += "false";
break; break;
case 0x5: //Null case 0x5: //NULL???
dumpString += "nil"; dumpString += "nil";
break; break;
case 0x6: //Actor (By Id) case 0x6: //Actor (By Id)
dumpString += string.Format("0x{0:X}", (uint)lParams[i].value); dumpString += String.Format("0x{0:X}", (uint)lParams[i].value);
break; break;
case 0x7: //Single Item Reference case 0x7: //Weird one used for inventory
ItemRefParam type7Param = ((ItemRefParam)lParams[i].value); ItemRefParam type7Param = ((ItemRefParam)lParams[i].value);
dumpString += string.Format("Item Ref: (0x{0:X}, 0x{1:X}, 0x{2:X})", type7Param.actorId, type7Param.slot, type7Param.itemPackage); dumpString += String.Format("Type7 Param: (0x{0:X}, 0x{1:X}, 0x{2:X}, 0x{3:X})", type7Param.actorId, type7Param.unknown, type7Param.slot, type7Param.itemPackage);
break; break;
case 0x8: //Multi Item Reference case 0x8: //Weird one used for inventory
MultiItemRefParam multiItemRef = ((MultiItemRefParam)lParams[i].value); ItemOfferParam itemOfferParam = ((ItemOfferParam)lParams[i].value);
string array = ""; dumpString += String.Format("Type8 Param: (0x{0:X}, 0x{1:X}, 0x{2:X}, 0x{3:X}, 0x{4:X}, 0x{5:X}, 0x{6:X})", itemOfferParam.actorId, itemOfferParam.offerSlot, itemOfferParam.offerPackageId, itemOfferParam.unknown1, itemOfferParam.seekSlot, itemOfferParam.seekPackageId, itemOfferParam.unknown2);
for (int j = 0; j < multiItemRef.itemSlots.Length; j++)
{
if (j + 1 != multiItemRef.itemSlots.Length)
array += string.Format("[0x{0:X}, 0x{1:X}], ", multiItemRef.itemSlots[j], multiItemRef.itemPackages[j]);
else
array += string.Format("[0x{0:X}, 0x{1:X}]", multiItemRef.itemSlots[j], multiItemRef.itemPackages[j]);
}
dumpString += string.Format("Item Ref: (0x{0:X}, [{1}])", multiItemRef.actorId, array);
break; break;
case 0x9: //Long (+ 8 bytes ignored) case 0x9: //Long (+ 8 bytes ignored)
Type9Param type9Param = ((Type9Param)lParams[i].value); Type9Param type9Param = ((Type9Param)lParams[i].value);
dumpString += string.Format("Type9 Param: (0x{0:X}, 0x{1:X})", type9Param.item1, type9Param.item2); dumpString += String.Format("Type9 Param: (0x{0:X}, 0x{1:X})", type9Param.item1, type9Param.item2);
break; break;
case 0xC: //Byte case 0xC: //Byte
dumpString += string.Format("0x{0:X}", (byte)lParams[i].value); dumpString += String.Format("0x{0:X}", (byte)lParams[i].value);
break; break;
case 0x1B: //Short? case 0x1B: //Short?
dumpString += string.Format("0x{0:X}", (ushort)lParams[i].value); dumpString += String.Format("0x{0:X}", (ushort)lParams[i].value);
break; break;
case 0xF: //End case 0xF: //End
break; break;

View File

@@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Meteor.Map</RootNamespace> <RootNamespace>Meteor.Map</RootNamespace>
<AssemblyName>Map Server</AssemblyName> <AssemblyName>Map Server</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>1d22ec4a</NuGetPackageImportStamp> <NuGetPackageImportStamp>1d22ec4a</NuGetPackageImportStamp>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
@@ -63,16 +63,30 @@
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Cyotek.Collections.Generic.CircularBuffer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=58daa28b0b2de221, processorArchitecture=MSIL"> <Reference Include="Cyotek.Collections.Generic.CircularBuffer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=58daa28b0b2de221, processorArchitecture=MSIL">
<HintPath>..\packages\Cyotek.CircularBuffer.1.0.0.0\lib\net20\Cyotek.Collections.Generic.CircularBuffer.dll</HintPath> <HintPath>..\packages\Cyotek.CircularBuffer.1.0.0.0\lib\net20\Cyotek.Collections.Generic.CircularBuffer.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
</Reference>
<Reference Include="MoonSharp.Interpreter"> <Reference Include="MoonSharp.Interpreter">
<HintPath>..\packages\MoonSharp.1.2.1.0\lib\net40-client\MoonSharp.Interpreter.dll</HintPath> <HintPath>..\packages\MoonSharp.1.2.1.0\lib\net40-client\MoonSharp.Interpreter.dll</HintPath>
</Reference> </Reference>
<Reference Include="MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL"> <Reference Include="MySql.Data, Version=8.0.31.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll</HintPath> <HintPath>..\packages\MySql.Data.8.0.31\lib\net452\MySql.Data.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@@ -86,10 +100,24 @@
<HintPath>navmesh\SharpNav.dll</HintPath> <HintPath>navmesh\SharpNav.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" /> <Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" /> <Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" /> <Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" /> <Reference Include="System.Transactions" />
@@ -98,6 +126,9 @@
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="ZstdNet, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.8.0.31\lib\net452\ZstdNet.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Actors\Area\PrivateArea.cs" /> <Compile Include="Actors\Area\PrivateArea.cs" />
@@ -164,15 +195,10 @@
<Compile Include="Actors\Group\Work\PartyWork.cs" /> <Compile Include="Actors\Group\Work\PartyWork.cs" />
<Compile Include="Actors\Group\Work\RelationWork.cs" /> <Compile Include="Actors\Group\Work\RelationWork.cs" />
<Compile Include="Actors\Judge\Judge.cs" /> <Compile Include="Actors\Judge\Judge.cs" />
<Compile Include="Actors\Quest\Scenario.cs" />
<Compile Include="Actors\Quest\PassiveGuildleve.cs" />
<Compile Include="Actors\Quest\Quest.cs" /> <Compile Include="Actors\Quest\Quest.cs" />
<Compile Include="Actors\StaticActors.cs" /> <Compile Include="Actors\StaticActors.cs" />
<Compile Include="Actors\World\WorldMaster.cs" /> <Compile Include="Actors\World\WorldMaster.cs" />
<Compile Include="DataObjects\PassiveGuildleveData.cs" />
<Compile Include="DataObjects\GuildleveData.cs" /> <Compile Include="DataObjects\GuildleveData.cs" />
<Compile Include="DataObjects\Recipe.cs" />
<Compile Include="DataObjects\RecipeResolver.cs" />
<Compile Include="DataObjects\TradeTransaction.cs" /> <Compile Include="DataObjects\TradeTransaction.cs" />
<Compile Include="DataObjects\ZoneConnection.cs" /> <Compile Include="DataObjects\ZoneConnection.cs" />
<Compile Include="CommandProcessor.cs" /> <Compile Include="CommandProcessor.cs" />

View File

@@ -19,7 +19,7 @@ namespace Meteor.Map.Properties {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources { public class Resources {

View File

@@ -27,7 +27,6 @@ using Meteor.Map.dataobjects;
using Meteor.Common; using Meteor.Common;
using Meteor.Map.Actors; using Meteor.Map.Actors;
using Meteor.Map.DataObjects;
namespace Meteor.Map namespace Meteor.Map
{ {
@@ -48,16 +47,12 @@ namespace Meteor.Map
private static CommandProcessor mCommandProcessor = new CommandProcessor(); private static CommandProcessor mCommandProcessor = new CommandProcessor();
private static ZoneConnection mWorldConnection = new ZoneConnection(); private static ZoneConnection mWorldConnection = new ZoneConnection();
private static WorldManager mWorldManager; private static WorldManager mWorldManager;
private static Dictionary<uint, ItemData> mGamedataItems;
private static Dictionary<uint, GuildleveData> mGamedataGuildleves;
private static StaticActors mStaticActors; private static StaticActors mStaticActors;
private PacketProcessor mProcessor; private PacketProcessor mProcessor;
//Game Data
private static Dictionary<uint, ItemData> gamedataItems;
private static Dictionary<uint, GuildleveData> gamedataGuildleves;
private static Dictionary<uint, PassiveGuildleveData> gamedataPassiveGL;
private static RecipeResolver gamedataRecipeResolver;
public Server() public Server()
{ {
mSelf = this; mSelf = this;
@@ -67,14 +62,10 @@ namespace Meteor.Map
{ {
mStaticActors = new StaticActors(STATIC_ACTORS_PATH); mStaticActors = new StaticActors(STATIC_ACTORS_PATH);
gamedataItems = Database.GetItemGamedata(); mGamedataItems = Database.GetItemGamedata();
Program.Log.Info("Loaded {0} items.", gamedataItems.Count); Program.Log.Info("Loaded {0} items.", mGamedataItems.Count);
gamedataGuildleves = Database.GetGuildleveGamedata(); mGamedataGuildleves = Database.GetGuildleveGamedata();
Program.Log.Info("Loaded {0} guildleves.", gamedataGuildleves.Count); Program.Log.Info("Loaded {0} guildleves.", mGamedataGuildleves.Count);
gamedataPassiveGL = Database.GetPassiveGuildleveGamedata();
Program.Log.Info("Loaded {0} passive (local) guildleves.", gamedataPassiveGL.Count);
gamedataRecipeResolver = RecipeResolver.Init();
Program.Log.Info("Loaded {0} crafting recipes.", gamedataRecipeResolver.GetNumRecipes());
mWorldManager = new WorldManager(this); mWorldManager = new WorldManager(this);
mWorldManager.LoadZoneList(); mWorldManager.LoadZoneList();
@@ -308,7 +299,7 @@ namespace Meteor.Map
public static Dictionary<uint, ItemData> GetGamedataItems() public static Dictionary<uint, ItemData> GetGamedataItems()
{ {
return gamedataItems; return mGamedataItems;
} }
public static Actor GetStaticActors(uint id) public static Actor GetStaticActors(uint id)
@@ -323,31 +314,19 @@ namespace Meteor.Map
public static ItemData GetItemGamedata(uint id) public static ItemData GetItemGamedata(uint id)
{ {
if (gamedataItems.ContainsKey(id)) if (mGamedataItems.ContainsKey(id))
return gamedataItems[id]; return mGamedataItems[id];
else else
return null; return null;
} }
public static GuildleveData GetGuildleveGamedata(uint id) public static GuildleveData GetGuildleveGamedata(uint id)
{ {
if (gamedataGuildleves.ContainsKey(id)) if (mGamedataGuildleves.ContainsKey(id))
return gamedataGuildleves[id]; return mGamedataGuildleves[id];
else else
return null; return null;
} }
public static PassiveGuildleveData GetPassiveGLGamedata(uint id)
{
if (gamedataPassiveGL.ContainsKey(id))
return gamedataPassiveGL[id];
else
return null;
}
public static RecipeResolver ResolveRecipe()
{
return gamedataRecipeResolver;
}
} }
} }

View File

@@ -68,7 +68,7 @@ namespace Meteor.Map.utils
return faceInfo; return faceInfo;
} }
public static uint GetTribeModel(byte tribe) public static UInt32 GetTribeModel(byte tribe)
{ {
switch (tribe) switch (tribe)
{ {

View File

@@ -51,8 +51,6 @@ namespace Meteor.Map.utils
cmd.Parameters.AddWithValue("@id", 100); cmd.Parameters.AddWithValue("@id", 100);
cmd.Parameters.AddWithValue("@placename", ""); cmd.Parameters.AddWithValue("@placename", "");
cmd.Prepare();
Dictionary<uint, string> placenames = new Dictionary<uint, string>(); Dictionary<uint, string> placenames = new Dictionary<uint, string>();
string line2; string line2;
@@ -101,6 +99,7 @@ namespace Meteor.Map.utils
cmd.Parameters["@placename"].Value = placenames[pId]; cmd.Parameters["@placename"].Value = placenames[pId];
Program.Log.Debug("Wrote: {0}", id); Program.Log.Debug("Wrote: {0}", id);
cmd.Prepare();
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
@@ -134,8 +133,6 @@ namespace Meteor.Map.utils
cmd.Parameters.AddWithValue("@id", 100); cmd.Parameters.AddWithValue("@id", 100);
cmd.Parameters.AddWithValue("@displayNameId", 100); cmd.Parameters.AddWithValue("@displayNameId", 100);
cmd.Prepare();
string line, line2; string line, line2;
Regex csvSplit = new Regex("(?:^|,)(\"(?:[^\"]+|\"\")*\"|[^,]*)", RegexOptions.Compiled); Regex csvSplit = new Regex("(?:^|,)(\"(?:[^\"]+|\"\")*\"|[^,]*)", RegexOptions.Compiled);
System.IO.StreamReader file = new System.IO.StreamReader("D:\\Coding\\FFXIV Related\\FFXIV Tool\\2012.09.19.0001.decode.csv\\actorclass.csv"); System.IO.StreamReader file = new System.IO.StreamReader("D:\\Coding\\FFXIV Related\\FFXIV Tool\\2012.09.19.0001.decode.csv\\actorclass.csv");
@@ -159,6 +156,7 @@ namespace Meteor.Map.utils
cmd.Parameters["@displayNameId"].Value = nameId; cmd.Parameters["@displayNameId"].Value = nameId;
Program.Log.Debug("Wrote: {0} : {1}", id, nameId); Program.Log.Debug("Wrote: {0} : {1}", id, nameId);
cmd.Prepare();
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
@@ -198,8 +196,6 @@ namespace Meteor.Map.utils
for (int i = 0; i < NUMFIELDS; i++) for (int i = 0; i < NUMFIELDS; i++)
cmd.Parameters.AddWithValue("@v" + i, 100); cmd.Parameters.AddWithValue("@v" + i, 100);
cmd.Prepare();
string line; string line;
Regex csvSplit = new Regex("(?:^|,)(\"(?:[^\"]+|\"\")*\"|[^,]*)", RegexOptions.Compiled); Regex csvSplit = new Regex("(?:^|,)(\"(?:[^\"]+|\"\")*\"|[^,]*)", RegexOptions.Compiled);
//System.IO.StreamReader file = new System.IO.StreamReader("D:\\Coding\\FFXIV Related\\FFXIV Tool\\2012.09.19.0001.decode.csv\\actorclass.csv"); //System.IO.StreamReader file = new System.IO.StreamReader("D:\\Coding\\FFXIV Related\\FFXIV Tool\\2012.09.19.0001.decode.csv\\actorclass.csv");
@@ -225,6 +221,7 @@ namespace Meteor.Map.utils
cmd.Parameters["@id"].Value = id; cmd.Parameters["@id"].Value = id;
Program.Log.Debug("Wrote: {0}", id); Program.Log.Debug("Wrote: {0}", id);
cmd.Prepare();
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
} }
@@ -260,7 +257,6 @@ namespace Meteor.Map.utils
cmd.Parameters.AddWithValue("@name", "Battle"); cmd.Parameters.AddWithValue("@name", "Battle");
cmd.Parameters.AddWithValue("@otherId", 0); cmd.Parameters.AddWithValue("@otherId", 0);
cmd.Parameters.AddWithValue("@rewardPoints", 0); cmd.Parameters.AddWithValue("@rewardPoints", 0);
cmd.Prepare();
int otherId = 1; int otherId = 1;
string line, line2; string line, line2;
@@ -314,6 +310,7 @@ namespace Meteor.Map.utils
cmd.Parameters["@name"].Value = name; cmd.Parameters["@name"].Value = name;
cmd.Parameters["@otherId"].Value = otherId; cmd.Parameters["@otherId"].Value = otherId;
cmd.Parameters["@rewardPoints"].Value = points; cmd.Parameters["@rewardPoints"].Value = points;
cmd.Prepare();
cmd.ExecuteNonQuery(); cmd.ExecuteNonQuery();
otherId++; otherId++;

View File

@@ -1,9 +1,18 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Cyotek.CircularBuffer" version="1.0.0.0" targetFramework="net45" /> <package id="Cyotek.CircularBuffer" version="1.0.0.0" targetFramework="net45" />
<package id="Google.Protobuf" version="3.19.4" targetFramework="net472" />
<package id="K4os.Compression.LZ4" version="1.2.6" targetFramework="net472" />
<package id="K4os.Compression.LZ4.Streams" version="1.2.6" targetFramework="net472" />
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net472" />
<package id="Microsoft.Net.Compilers" version="2.0.0-beta3" targetFramework="net45" developmentDependency="true" /> <package id="Microsoft.Net.Compilers" version="2.0.0-beta3" targetFramework="net45" developmentDependency="true" />
<package id="MoonSharp" version="1.2.1.0" targetFramework="net45" /> <package id="MoonSharp" version="1.2.1.0" targetFramework="net45" />
<package id="MySql.Data" version="6.9.8" targetFramework="net45" /> <package id="MySql.Data" version="8.0.31" targetFramework="net472" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net451" /> <package id="Newtonsoft.Json" version="9.0.1" targetFramework="net451" />
<package id="NLog" version="4.5.0" targetFramework="net451" /> <package id="NLog" version="4.5.0" targetFramework="net451" />
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" />
</packages> </packages>

View File

@@ -7,7 +7,7 @@ If you wish to discuss and help please join the Discord server.
**Discord Server Invite** **Discord Server Invite**
https://discord.gg/0ynLxiEl0zWhpKOW https://discord.gg/fBmGkSZbaD
Pull Requests Pull Requests
======== ========

View File

@@ -1,11 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<configuration> <configuration>
<startup> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup> </startup>
<system.data>
<DbProviderFactories> <runtime>
<remove invariant="MySql.Data.MySqlClient"/> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/> <dependentAssembly>
</DbProviderFactories> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
</system.data></configuration> <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Meteor.World</RootNamespace> <RootNamespace>Meteor.World</RootNamespace>
<AssemblyName>World Server</AssemblyName> <AssemblyName>World Server</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion> <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects> <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
@@ -69,21 +69,50 @@
<Prefer32Bit>true</Prefer32Bit> <Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
<HintPath>..\packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Cyotek.Collections.Generic.CircularBuffer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=58daa28b0b2de221, processorArchitecture=MSIL"> <Reference Include="Cyotek.Collections.Generic.CircularBuffer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=58daa28b0b2de221, processorArchitecture=MSIL">
<HintPath>..\packages\Cyotek.CircularBuffer.1.0.0.0\lib\net20\Cyotek.Collections.Generic.CircularBuffer.dll</HintPath> <HintPath>..\packages\Cyotek.CircularBuffer.1.0.0.0\lib\net20\Cyotek.Collections.Generic.CircularBuffer.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="MySql.Data, Version=6.9.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL"> <Reference Include="Google.Protobuf, Version=3.19.4.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.6.9.8\lib\net45\MySql.Data.dll</HintPath> <HintPath>..\packages\Google.Protobuf.3.19.4\lib\net45\Google.Protobuf.dll</HintPath>
<Private>True</Private> </Reference>
<Reference Include="K4os.Compression.LZ4, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.1.2.6\lib\net46\K4os.Compression.LZ4.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.6.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.2.6\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
</Reference>
<Reference Include="MySql.Data, Version=8.0.31.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.8.0.31\lib\net452\MySql.Data.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.5.0\lib\net45\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.5.0\lib\net45\NLog.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.IO.Compression" /> <Reference Include="System.IO.Compression" />
<Reference Include="System.Management" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" /> <Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" /> <Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" /> <Reference Include="System.Transactions" />
@@ -93,6 +122,9 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="ZstdNet, Version=1.4.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
<HintPath>..\packages\MySql.Data.8.0.31\lib\net452\ZstdNet.dll</HintPath>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Actor\Group\Work\ContentWork.cs" /> <Compile Include="Actor\Group\Work\ContentWork.cs" />

View File

@@ -1,6 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="Cyotek.CircularBuffer" version="1.0.0.0" targetFramework="net452" /> <package id="Cyotek.CircularBuffer" version="1.0.0.0" targetFramework="net452" />
<package id="MySql.Data" version="6.9.8" targetFramework="net452" /> <package id="Google.Protobuf" version="3.19.4" targetFramework="net472" />
<package id="K4os.Compression.LZ4" version="1.2.6" targetFramework="net472" />
<package id="K4os.Compression.LZ4.Streams" version="1.2.6" targetFramework="net472" />
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net472" />
<package id="MySql.Data" version="8.0.31" targetFramework="net472" />
<package id="NLog" version="4.5.0" targetFramework="net451" /> <package id="NLog" version="4.5.0" targetFramework="net451" />
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net472" />
<package id="System.Buffers" version="4.5.1" targetFramework="net472" />
<package id="System.Memory" version="4.5.4" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net472" />
</packages> </packages>