From a9746b9a2b4ace8bcae631eb06e7d3fc2a0f9cd5 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Fri, 26 Apr 2024 20:07:26 -0500 Subject: [PATCH] add npc command --- src/engine/devcmd/cmds/AddNPCCmd.java | 8 +++++--- src/engine/objects/NPC.java | 7 +++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/engine/devcmd/cmds/AddNPCCmd.java b/src/engine/devcmd/cmds/AddNPCCmd.java index 2883a39f..8b717d53 100644 --- a/src/engine/devcmd/cmds/AddNPCCmd.java +++ b/src/engine/devcmd/cmds/AddNPCCmd.java @@ -86,13 +86,15 @@ public class AddNPCCmd extends AbstractDevCmd { loc = pc.loc; } created = NPC.createNPC(name, contractID, loc, guild, zone, (short)level, building); + created.bindLoc = loc; if(building != null) { - created.buildingUUID = building.getObjectUUID(); - created.building = building; - + created.buildingUUID = building.getObjectUUID(); + created.building = building; NPCManager.slotCharacterInBuilding(created); } created.setLoc(created.bindLoc); + created.updateDatabase(); + throwbackInfo(pc, "Created NPC with UUID: " + created.getObjectUUID()); } @Override diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 24f59898..0eeefd3d 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -470,8 +470,11 @@ public class NPC extends AbstractCharacter { newNPC.bindLoc = Vector3fImmutable.ZERO; newNPC.parentZoneUUID = parent.getObjectUUID(); - newNPC.guildUUID = guild.getObjectUUID(); - + if(guild == null){ + newNPC.guildUUID = Guild.getErrantGuild().getObjectUUID(); + }else { + newNPC.guildUUID = guild.getObjectUUID(); + } if (building == null) newNPC.buildingUUID = 0; else