mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-26 04:18:22 +02:00
Implemented actor instancing, as well as automatic name generation for NPCs.
This commit is contained in:
parent
541456bd8e
commit
62ed9b22f1
12 changed files with 278 additions and 82 deletions
|
@ -23,11 +23,9 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
|
||||
public NpcWork npcWork = new NpcWork();
|
||||
|
||||
public Npc(uint id, string actorName, uint zoneId, float posX, float posY, float posZ, float rot, ushort actorState, uint animationId, uint displayNameId, string customDisplayName, string className)
|
||||
: base(id)
|
||||
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)
|
||||
: base((4 << 28 | zoneId << 19 | (uint)actorNumber))
|
||||
{
|
||||
this.actorName = actorName;
|
||||
this.actorClassId = id;
|
||||
this.positionX = posX;
|
||||
this.positionY = posY;
|
||||
this.positionZ = posZ;
|
||||
|
@ -39,8 +37,11 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
this.customDisplayName = customDisplayName;
|
||||
|
||||
this.zoneId = zoneId;
|
||||
this.zone = Server.GetWorldManager().GetZone(zoneId);
|
||||
|
||||
loadNpcTemplate(id);
|
||||
loadNpcAppearance(classId);
|
||||
|
||||
className = classPath.Substring(classPath.LastIndexOf("/")+1);
|
||||
|
||||
charaWork.battleSave.potencial = 1.0f;
|
||||
|
||||
|
@ -61,6 +62,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
|
||||
charaWork.property[3] = 1;
|
||||
charaWork.property[4] = 1;
|
||||
|
||||
generateActorName((int)actorNumber);
|
||||
}
|
||||
|
||||
public SubPacket createAddActorPacket(uint playerActorId)
|
||||
|
@ -156,7 +159,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return actorClassId;
|
||||
}
|
||||
|
||||
public void loadNpcTemplate(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)))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue