Added back loading defaulttalk npcs through script. Should speed up warps now! Added loading mapobj ifno through a db table, removing the need for unique scripts. Deleted ported mapobj scripts.

This commit is contained in:
Filip Maj 2022-03-03 19:34:33 -05:00
parent b773098abf
commit 2cb6a9f6bd
74 changed files with 49 additions and 267 deletions

View file

@ -335,8 +335,11 @@ namespace Meteor.Map
positionY,
positionZ,
rotation,
motionPack
FROM server_eventnpc_spawn_locations
motionPack,
layoutId,
instanceId
FROM server_eventnpc_spawn_locations
LEFT JOIN server_eventnpc_mapobj ON server_eventnpc_spawn_locations.id = server_eventnpc_mapobj.id
";
MySqlCommand cmd = new MySqlCommand(query, conn);
@ -363,8 +366,11 @@ namespace Meteor.Map
float z = reader.GetFloat("positionZ");
float rot = reader.GetFloat("rotation");
uint motionPack = reader.GetUInt32("motionPack");
SpawnLocation spawn = new SpawnLocation(classId, uniqueId, zoneId, privAreaName, privAreaType, x, y, z, rot, motionPack);
uint layoutId = !reader.IsDBNull(reader.GetOrdinal("layoutId")) ? reader.GetUInt32("layoutId") : 0;
uint instanceId = !reader.IsDBNull(reader.GetOrdinal("instanceId")) ? reader.GetUInt32("instanceId") : 0;
SpawnLocation spawn = new SpawnLocation(classId, uniqueId, zoneId, privAreaName, privAreaType, x, y, z, rot, motionPack, layoutId, instanceId);
zone.AddSpawnLocation(spawn);