NPC/Mob slotting work.
This commit is contained in:
@@ -548,6 +548,7 @@ public enum BuildingManager {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (contract.getContractID() == 910) {
|
if (contract.getContractID() == 910) {
|
||||||
|
|
||||||
//guard dog
|
//guard dog
|
||||||
mob = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), true, zone, building, contract.getContractID(), pirateName, rank);
|
mob = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), true, zone, building, contract.getContractID(), pirateName, rank);
|
||||||
|
|
||||||
@@ -558,6 +559,7 @@ public enum BuildingManager {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
npc = NPC.createNPC(pirateName, contract.getObjectUUID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), false, zone, (short) rank, building);
|
npc = NPC.createNPC(pirateName, contract.getObjectUUID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), false, zone, (short) rank, building);
|
||||||
|
|
||||||
if (npc == null)
|
if (npc == null)
|
||||||
|
|||||||
@@ -569,14 +569,22 @@ public class NPC extends AbstractCharacter {
|
|||||||
|
|
||||||
npcWithoutID.setLevel(level);
|
npcWithoutID.setLevel(level);
|
||||||
|
|
||||||
if (npcWithoutID.mobBase == null) {
|
if (npcWithoutID.mobBase == null)
|
||||||
return null;
|
return null;
|
||||||
}
|
|
||||||
if (parent != null) {
|
// Parent zone is required by dbhandler. Can likely
|
||||||
npcWithoutID.setRelPos(parent, spawn.x - parent.absX, spawn.y - parent.absY, spawn.z - parent.absZ);
|
// refactor that out and just use the id.
|
||||||
}
|
|
||||||
npcWithoutID.setLoc(new Vector3fImmutable(npcWithoutID.statLat,npcWithoutID.statAlt,npcWithoutID.statLon));
|
npcWithoutID.parentZone = parent;
|
||||||
|
npcWithoutID.parentZoneID = parent.getObjectUUID();
|
||||||
|
|
||||||
|
// NPC in a Building derives position from slot
|
||||||
|
|
||||||
|
if (npcWithoutID.building != null)
|
||||||
|
npcWithoutID.bindLoc = Vector3fImmutable.ZERO;
|
||||||
|
|
||||||
NPC npc;
|
NPC npc;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
npc = DbManager.NPCQueries.ADD_NPC(npcWithoutID, isMob);
|
npc = DbManager.NPCQueries.ADD_NPC(npcWithoutID, isMob);
|
||||||
npc.setObjectTypeMask(MBServerStatics.MASK_NPC);
|
npc.setObjectTypeMask(MBServerStatics.MASK_NPC);
|
||||||
@@ -585,7 +593,6 @@ public class NPC extends AbstractCharacter {
|
|||||||
npc = null;
|
npc = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return npc;
|
return npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user