Removed the state and custom name columns from the enpc table. Renamed server_spawn_locations to server_eventnpc_spawn_locations. Renamed animationId to motionPack.

This commit is contained in:
Filip Maj 2022-02-13 19:24:09 -05:00
parent cfe6ef2e5e
commit 9097e557ed
6 changed files with 1101 additions and 1090 deletions

View File

@ -517,7 +517,7 @@ namespace Meteor.Map.Actors
if (actorClass == null) if (actorClass == null)
return; return;
Npc npc = new Npc(mActorList.Count + 1, actorClass, location.uniqueId, this, location.x, location.y, location.z, location.rot, location.state, location.animId, null); Npc npc = new Npc(mActorList.Count + 1, actorClass, location.uniqueId, this, location.x, location.y, location.z, location.rot, 0, location.motionPack, null);
npc.LoadEventConditions(actorClass.eventConditions); npc.LoadEventConditions(actorClass.eventConditions);

View File

@ -32,10 +32,9 @@ namespace Meteor.Map.actors.area
public float y; public float y;
public float z; public float z;
public float rot; public float rot;
public ushort state; public uint motionPack;
public uint animId;
public SpawnLocation(uint classId, string uniqueId, uint zoneId, string privAreaName, int privAreaLevel, float x, float y, float z, float rot, ushort state, uint animId) public SpawnLocation(uint classId, string uniqueId, uint zoneId, string privAreaName, int privAreaLevel, float x, float y, float z, float rot, uint animId)
{ {
this.classId = classId; this.classId = classId;
this.uniqueId = uniqueId; this.uniqueId = uniqueId;
@ -46,8 +45,7 @@ namespace Meteor.Map.actors.area
this.y = y; this.y = y;
this.z = z; this.z = z;
this.rot = rot; this.rot = rot;
this.state = state; this.motionPack = animId;
this.animId = animId;
} }
} }
} }

View File

@ -14,6 +14,21 @@
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>1d22ec4a</NuGetPackageImportStamp> <NuGetPackageImportStamp>1d22ec4a</NuGetPackageImportStamp>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -417,7 +432,13 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup /> <ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Common Class Lib\Common Class Lib.csproj"> <ProjectReference Include="..\Common Class Lib\Common Class Lib.csproj">
<Project>{3a3d6626-c820-4c18-8c81-64811424f20e}</Project> <Project>{3a3d6626-c820-4c18-8c81-64811424f20e}</Project>
@ -430,8 +451,8 @@
</PostBuildEvent> </PostBuildEvent>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<PreBuildEvent> <PreBuildEvent>if exist "$(TargetPath).locked" del "$(TargetPath).locked"
</PreBuildEvent> if exist "$(TargetPath)" if not exist "$(TargetPath).locked" move "$(TargetPath)" "$(TargetPath).locked"</PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>

View File

@ -71,7 +71,7 @@ namespace Meteor.Map
mWorldManager.LoadZoneList(); mWorldManager.LoadZoneList();
mWorldManager.LoadSeamlessBoundryList(); mWorldManager.LoadSeamlessBoundryList();
mWorldManager.LoadActorClasses(); mWorldManager.LoadActorClasses();
mWorldManager.LoadSpawnLocations(); mWorldManager.LoadENPCs();
mWorldManager.LoadBattleNpcs(); mWorldManager.LoadBattleNpcs();
mWorldManager.LoadStatusEffects(); mWorldManager.LoadStatusEffects();
mWorldManager.LoadBattleCommands(); mWorldManager.LoadBattleCommands();

View File

@ -315,7 +315,7 @@ namespace Meteor.Map
Program.Log.Info(String.Format("Loaded {0} actor classes.", count)); Program.Log.Info(String.Format("Loaded {0} actor classes.", count));
} }
public void LoadSpawnLocations() public void LoadENPCs()
{ {
int count = 0; int count = 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)))
@ -335,10 +335,8 @@ namespace Meteor.Map
positionY, positionY,
positionZ, positionZ,
rotation, rotation,
actorState, motionPack
animationId, FROM server_eventnpc_spawn_locations
customDisplayName
FROM server_spawn_locations
"; ";
MySqlCommand cmd = new MySqlCommand(query, conn); MySqlCommand cmd = new MySqlCommand(query, conn);
@ -357,9 +355,6 @@ namespace Meteor.Map
if (zone == null) if (zone == null)
continue; continue;
string customName = null;
if (!reader.IsDBNull(11))
customName = reader.GetString("customDisplayName");
string uniqueId = reader.GetString("uniqueId"); string uniqueId = reader.GetString("uniqueId");
string privAreaName = reader.GetString("privateAreaName"); string privAreaName = reader.GetString("privateAreaName");
int privAreaType = reader.GetInt32("privateAreaLevel"); int privAreaType = reader.GetInt32("privateAreaLevel");
@ -367,10 +362,9 @@ namespace Meteor.Map
float y = reader.GetFloat("positionY"); float y = reader.GetFloat("positionY");
float z = reader.GetFloat("positionZ"); float z = reader.GetFloat("positionZ");
float rot = reader.GetFloat("rotation"); float rot = reader.GetFloat("rotation");
ushort state = reader.GetUInt16("actorState"); uint motionPack = reader.GetUInt32("motionPack");
uint animId = reader.GetUInt32("animationId");
SpawnLocation spawn = new SpawnLocation(classId, uniqueId, zoneId, privAreaName, privAreaType, x, y, z, rot, state, animId); SpawnLocation spawn = new SpawnLocation(classId, uniqueId, zoneId, privAreaName, privAreaType, x, y, z, rot, motionPack);
zone.AddSpawnLocation(spawn); zone.AddSpawnLocation(spawn);
@ -387,7 +381,7 @@ namespace Meteor.Map
} }
} }
Program.Log.Info(String.Format("Loaded {0} spawn(s).", count)); Program.Log.Info(String.Format("Loaded {0} ENPC(s).", count));
} }
public void LoadBattleNpcs() public void LoadBattleNpcs()
@ -492,7 +486,7 @@ namespace Meteor.Map
} }
} }
} }
Program.Log.Info("Loaded {0} monsters.", count); Program.Log.Info("Loaded {0} BNPC(s).", count);
} }
catch (MySqlException e) catch (MySqlException e)
{ {