mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-02 19:42:05 -04:00
Child scripts now loaded by a uniqueId in the spawn table.
This commit is contained in:
parent
23b6ede128
commit
f0d4429f65
@ -244,6 +244,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
string query = @"
|
string query = @"
|
||||||
SELECT
|
SELECT
|
||||||
actorClassId,
|
actorClassId,
|
||||||
|
uniqueId,
|
||||||
zoneId,
|
zoneId,
|
||||||
privateAreaName,
|
privateAreaName,
|
||||||
privateAreaLevel,
|
privateAreaLevel,
|
||||||
@ -264,10 +265,11 @@ namespace FFXIVClassic_Map_Server
|
|||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
string customName = null;
|
string customName = null;
|
||||||
if (!reader.IsDBNull(10))
|
if (!reader.IsDBNull(11))
|
||||||
customName = reader.GetString("customDisplayName");
|
customName = reader.GetString("customDisplayName");
|
||||||
|
|
||||||
uint classId = reader.GetUInt32("actorClassId");
|
uint classId = reader.GetUInt32("actorClassId");
|
||||||
|
string uniqueId = reader.GetString("uniqueId");
|
||||||
uint zoneId = reader.GetUInt32("zoneId");
|
uint zoneId = reader.GetUInt32("zoneId");
|
||||||
string privAreaName = reader.GetString("privateAreaName");
|
string privAreaName = reader.GetString("privateAreaName");
|
||||||
uint privAreaLevel = reader.GetUInt32("privateAreaLevel");
|
uint privAreaLevel = reader.GetUInt32("privateAreaLevel");
|
||||||
@ -287,7 +289,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
if (zone == null)
|
if (zone == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SpawnLocation spawn = new SpawnLocation(classId, zoneId, privAreaName, privAreaLevel, x, y, z, rot, state, animId);
|
SpawnLocation spawn = new SpawnLocation(classId, uniqueId, zoneId, privAreaName, privAreaLevel, x, y, z, rot, state, animId);
|
||||||
|
|
||||||
zone.addSpawnLocation(spawn);
|
zone.addSpawnLocation(spawn);
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
if (actorClass == null)
|
if (actorClass == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Npc npc = new Npc(mActorList.Count + 1, actorClass.actorClassId, actorId, location.x, location.y, location.z, location.rot, location.state, location.animId, actorClass.displayNameId, null, actorClass.classPath);
|
Npc npc = new Npc(mActorList.Count + 1, actorClass.actorClassId, location.uniqueId, actorId, location.x, location.y, location.z, location.rot, location.state, location.animId, actorClass.displayNameId, null, actorClass.classPath);
|
||||||
npc.loadEventConditions(actorClass.eventConditions);
|
npc.loadEventConditions(actorClass.eventConditions);
|
||||||
|
|
||||||
addActorToZone(npc);
|
addActorToZone(npc);
|
||||||
|
@ -9,6 +9,7 @@ namespace FFXIVClassic_Map_Server.actors.area
|
|||||||
class SpawnLocation
|
class SpawnLocation
|
||||||
{
|
{
|
||||||
public uint classId;
|
public uint classId;
|
||||||
|
public string uniqueId;
|
||||||
public uint zoneId;
|
public uint zoneId;
|
||||||
public string privAreaName;
|
public string privAreaName;
|
||||||
public uint privAreaLevel;
|
public uint privAreaLevel;
|
||||||
@ -19,9 +20,10 @@ namespace FFXIVClassic_Map_Server.actors.area
|
|||||||
public ushort state;
|
public ushort state;
|
||||||
public uint animId;
|
public uint animId;
|
||||||
|
|
||||||
public SpawnLocation(uint classId, uint zoneId, string privAreaName, uint privAreaLevel, float x, float y, float z, float rot, ushort state, uint animId)
|
public SpawnLocation(uint classId, string uniqueId, uint zoneId, string privAreaName, uint privAreaLevel, float x, float y, float z, float rot, ushort state, uint animId)
|
||||||
{
|
{
|
||||||
this.classId = classId;
|
this.classId = classId;
|
||||||
|
this.uniqueId = uniqueId;
|
||||||
this.zoneId = zoneId;
|
this.zoneId = zoneId;
|
||||||
this.privAreaName = privAreaName;
|
this.privAreaName = privAreaName;
|
||||||
this.privAreaLevel = privAreaLevel;
|
this.privAreaLevel = privAreaLevel;
|
||||||
|
@ -22,12 +22,12 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
{
|
{
|
||||||
class Npc : Character
|
class Npc : Character
|
||||||
{
|
{
|
||||||
//private Script actorScript;
|
|
||||||
private uint actorClassId;
|
private uint actorClassId;
|
||||||
|
private string uniqueIdentifier;
|
||||||
|
|
||||||
public NpcWork npcWork = new NpcWork();
|
public NpcWork npcWork = new NpcWork();
|
||||||
|
|
||||||
public Npc(int actorNumber, uint classId, uint zoneId, float posX, float posY, float posZ, float rot, ushort actorState, uint animationId, uint displayNameId, string customDisplayName, string classPath)
|
public Npc(int actorNumber, uint classId, string uniqueId, uint zoneId, float posX, float posY, float posZ, float rot, ushort actorState, uint animationId, uint displayNameId, string customDisplayName, string classPath)
|
||||||
: base((4 << 28 | zoneId << 19 | (uint)actorNumber))
|
: base((4 << 28 | zoneId << 19 | (uint)actorNumber))
|
||||||
{
|
{
|
||||||
this.positionX = posX;
|
this.positionX = posX;
|
||||||
@ -39,6 +39,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
this.displayNameId = displayNameId;
|
this.displayNameId = displayNameId;
|
||||||
this.customDisplayName = customDisplayName;
|
this.customDisplayName = customDisplayName;
|
||||||
|
|
||||||
|
this.uniqueIdentifier = uniqueId;
|
||||||
|
|
||||||
this.zoneId = zoneId;
|
this.zoneId = zoneId;
|
||||||
this.zone = Server.GetWorldManager().GetZone(zoneId);
|
this.zone = Server.GetWorldManager().GetZone(zoneId);
|
||||||
|
|
||||||
@ -92,7 +94,17 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
{
|
{
|
||||||
classPath = "/Chara/Npc/Populace/PopulaceStandard";
|
classPath = "/Chara/Npc/Populace/PopulaceStandard";
|
||||||
className = "PopulaceStandard";
|
className = "PopulaceStandard";
|
||||||
lParams = LuaUtils.createLuaParamList(classPath, false, false, false, false, false, 0xF47F6, false, false, 0, 0);
|
lParams = LuaUtils.createLuaParamList(classPath, false, false, false, false, false, 0xF47F6, false, false, 0, 1, "TEST");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lParams.Insert(0, new LuaParam(2, classPath));
|
||||||
|
lParams.Insert(1, new LuaParam(4, 4));
|
||||||
|
lParams.Insert(2, new LuaParam(4, 4));
|
||||||
|
lParams.Insert(3, new LuaParam(4, 4));
|
||||||
|
lParams.Insert(4, new LuaParam(4, 4));
|
||||||
|
lParams.Insert(5, new LuaParam(4, 4));
|
||||||
|
lParams.Insert(6, new LuaParam(0, (int)actorClassId));
|
||||||
}
|
}
|
||||||
|
|
||||||
ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams).debugPrintSubPacket();
|
ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams).debugPrintSubPacket();
|
||||||
@ -287,8 +299,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
if (File.Exists("./scripts/base/" + classPath + ".lua"))
|
if (File.Exists("./scripts/base/" + classPath + ".lua"))
|
||||||
parent = LuaEngine.loadScript("./scripts/base/" + classPath + ".lua");
|
parent = LuaEngine.loadScript("./scripts/base/" + classPath + ".lua");
|
||||||
if (File.Exists(String.Format("./scripts/unique/{0}/{1}.{2}.lua", zone.zoneName, className, actorClassId)))
|
if (File.Exists(String.Format("./scripts/unique/{0}/{1}/{2}.lua", zone.zoneName, className, uniqueIdentifier)))
|
||||||
child = LuaEngine.loadScript(String.Format("./scripts/unique/{0}/{1}.{2}.lua", zone.zoneName, className, actorClassId));
|
child = LuaEngine.loadScript(String.Format("./scripts/unique/{0}/{1}/{2}.lua", zone.zoneName, className, uniqueIdentifier));
|
||||||
|
|
||||||
if (parent == null)
|
if (parent == null)
|
||||||
{
|
{
|
||||||
@ -315,8 +327,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
if (File.Exists("./scripts/base/" + classPath + ".lua"))
|
if (File.Exists("./scripts/base/" + classPath + ".lua"))
|
||||||
parent = LuaEngine.loadScript("./scripts/base/" + classPath + ".lua");
|
parent = LuaEngine.loadScript("./scripts/base/" + classPath + ".lua");
|
||||||
if (File.Exists(String.Format("./scripts/unique/{0}/{1}.{2}.lua", zone.zoneName, className, actorClassId)))
|
if (File.Exists(String.Format("./scripts/unique/{0}/{1}/{2}.lua", zone.zoneName, className, uniqueIdentifier)))
|
||||||
child = LuaEngine.loadScript(String.Format("./scripts/unique/{0}/{1}.{2}.lua", zone.zoneName, className, actorClassId));
|
child = LuaEngine.loadScript(String.Format("./scripts/unique/{0}/{1}/{2}.lua", zone.zoneName, className, uniqueIdentifier));
|
||||||
|
|
||||||
if (parent == null)
|
if (parent == null)
|
||||||
{
|
{
|
||||||
@ -351,8 +363,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
if (File.Exists("./scripts/base/" + classPath + ".lua"))
|
if (File.Exists("./scripts/base/" + classPath + ".lua"))
|
||||||
parent = LuaEngine.loadScript("./scripts/base/" + classPath + ".lua");
|
parent = LuaEngine.loadScript("./scripts/base/" + classPath + ".lua");
|
||||||
if (File.Exists(String.Format("./scripts/unique/{0}/{1}.{2}.lua", zone.zoneName, className, actorClassId)))
|
if (File.Exists(String.Format("./scripts/unique/{0}/{1}/{2}.lua", zone.zoneName, className, uniqueIdentifier)))
|
||||||
child = LuaEngine.loadScript(String.Format("./scripts/unique/{0}/{1}.{2}.lua", zone.zoneName, className, actorClassId));
|
child = LuaEngine.loadScript(String.Format("./scripts/unique/{0}/{1}/{2}.lua", zone.zoneName, className, uniqueIdentifier));
|
||||||
|
|
||||||
if (parent == null)
|
if (parent == null)
|
||||||
{
|
{
|
||||||
@ -385,8 +397,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
if (File.Exists("./scripts/base/" + classPath + ".lua"))
|
if (File.Exists("./scripts/base/" + classPath + ".lua"))
|
||||||
parent = LuaEngine.loadScript("./scripts/base/" + classPath + ".lua");
|
parent = LuaEngine.loadScript("./scripts/base/" + classPath + ".lua");
|
||||||
if (File.Exists(String.Format("./scripts/unique/{0}/{1}.{2}.lua", zone.zoneName, className, actorClassId)))
|
if (File.Exists(String.Format("./scripts/unique/{0}/{1}/{2}.lua", zone.zoneName, className, uniqueIdentifier)))
|
||||||
child = LuaEngine.loadScript(String.Format("./scripts/unique/{0}/{1}.{2}.lua", zone.zoneName, className, actorClassId));
|
child = LuaEngine.loadScript(String.Format("./scripts/unique/{0}/{1}/{2}.lua", zone.zoneName, className, uniqueIdentifier));
|
||||||
|
|
||||||
if (parent == null)
|
if (parent == null)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user