forked from MagicBane/Server
Merge remote-tracking branch 'origin/bugfix-runesandbooties' into magicbox1.5
This commit is contained in:
@@ -450,7 +450,7 @@ public enum BuildingManager {
|
||||
|
||||
}
|
||||
|
||||
public static synchronized boolean addHireling(Building building, PlayerCharacter contractOwner, Vector3fImmutable NpcLoc, Zone zone, Contract NpcID, Item item) {
|
||||
public static synchronized boolean addHireling(Building building, PlayerCharacter contractOwner, Vector3fImmutable NpcLoc, Zone zone, Contract contractID, Item item) {
|
||||
|
||||
int rank = 1;
|
||||
|
||||
@@ -460,7 +460,7 @@ public enum BuildingManager {
|
||||
if (building.getBlueprint().getMaxSlots() == building.getHirelings().size())
|
||||
return false;
|
||||
|
||||
String pirateName = NPC.getPirateName(NpcID.getMobbaseID());
|
||||
String pirateName = NPC.getPirateName(contractID.getMobbaseID());
|
||||
|
||||
if (item.getChargesRemaining() > 0)
|
||||
rank = item.getChargesRemaining() * 10;
|
||||
@@ -469,9 +469,9 @@ public enum BuildingManager {
|
||||
Mob mob = null;
|
||||
NPC npc = null;
|
||||
|
||||
if (NPC.ISGuardCaptain(NpcID.getContractID())) {
|
||||
if (NPC.ISGuardCaptain(contractID.getContractID())) {
|
||||
|
||||
mob = Mob.createMob( NpcID.getMobbaseID(), NpcLoc, contractOwner.getGuild(), true, zone, building, NpcID.getContractID());
|
||||
mob = Mob.createMob( contractID.getMobbaseID(), NpcLoc, contractOwner.getGuild(), true, zone, building, contractID.getContractID());
|
||||
|
||||
if (mob == null)
|
||||
return false;
|
||||
@@ -479,26 +479,24 @@ public enum BuildingManager {
|
||||
mob.setRank(rank);
|
||||
mob.setPlayerGuard(true);
|
||||
mob.setParentZone(zone);
|
||||
return true;
|
||||
} else {
|
||||
npc = NPC.createNPC( pirateName, NpcID.getObjectUUID(), NpcLoc, contractOwner.getGuild(), false, zone, (short) rank, false, building);
|
||||
|
||||
if (npc == null)
|
||||
return false;
|
||||
|
||||
|
||||
npc.setBindLoc(NpcLoc.x - zone.getAbsX(), NpcLoc.y - zone.getAbsY(), NpcLoc.z - zone.getAbsZ());
|
||||
|
||||
npc.setBuilding(building);
|
||||
npc.setParentZone(zone);
|
||||
|
||||
if (NPC.GetNPCProfits(npc) == null)
|
||||
NPCProfits.CreateProfits(npc);
|
||||
|
||||
WorldGrid.addObject(npc, contractOwner);
|
||||
|
||||
return true;
|
||||
}
|
||||
npc = NPC.createNPC( pirateName, contractID.getObjectUUID(), NpcLoc, contractOwner.getGuild(), false, zone, (short) rank, false, building);
|
||||
|
||||
if (npc == null)
|
||||
return false;
|
||||
|
||||
npc.setBindLoc(NpcLoc.x - zone.getAbsX(), NpcLoc.y - zone.getAbsY(), NpcLoc.z - zone.getAbsZ());
|
||||
|
||||
npc.setBuilding(building);
|
||||
npc.setParentZone(zone);
|
||||
|
||||
if (NPC.GetNPCProfits(npc) == null)
|
||||
NPCProfits.CreateProfits(npc);
|
||||
|
||||
WorldGrid.addObject(npc, contractOwner);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean IsWallPiece(Building building) {
|
||||
|
||||
@@ -940,7 +940,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
||||
this.parentZone = zone;
|
||||
}
|
||||
|
||||
|
||||
if ( this.building != null) {
|
||||
|
||||
Vector3fImmutable localLoc = new Vector3fImmutable(this.statLat,this.statAlt,this.statLon);
|
||||
|
||||
@@ -348,15 +348,13 @@ public class NPC extends AbstractCharacter {
|
||||
this.setHealth(this.healthMax);
|
||||
this.mana.set(this.manaMax);
|
||||
this.stamina.set(this.staminaMax);
|
||||
//this.firstName = this.minionMobBase.getFirstName();
|
||||
//this.lastName = "";
|
||||
//this.level = (short)(this.minionMobBase.getLevel());
|
||||
}
|
||||
|
||||
//add this npc to building
|
||||
if (this.building != null && this.loadID != 0) {
|
||||
|
||||
if (building.getBlueprint() != null){
|
||||
if (this.building != null) {
|
||||
|
||||
if (building.getBlueprint() != null) {
|
||||
|
||||
int maxSlots;
|
||||
maxSlots = building.getBlueprint().getSlotsForRank(this.building.getRank());
|
||||
@@ -368,8 +366,7 @@ public class NPC extends AbstractCharacter {
|
||||
break;
|
||||
}
|
||||
}
|
||||
//npc created by an admin without a blueprint, just default max slot size to 10.
|
||||
}else{
|
||||
} else {
|
||||
|
||||
int maxSlots = 10;
|
||||
|
||||
@@ -1094,6 +1091,7 @@ public class NPC extends AbstractCharacter {
|
||||
// *** Refactor : this has a useInit flag that can be removed
|
||||
|
||||
public static NPC createNPC(String name, int contractID, Vector3fImmutable spawn, Guild guild, boolean isMob, Zone parent, short level, boolean useInit, Building building) {
|
||||
|
||||
NPC npcWithoutID = new NPC(name, (short) 0, (short) 0, (short) 0, (short) 0,
|
||||
(short) 0, (short) 1, 0, false, false, false, spawn, spawn, Vector3fImmutable.ZERO,
|
||||
(short) 1, (short) 1, (short) 1, guild, (byte) 0, 0, isMob, building, contractID, parent);
|
||||
|
||||
Reference in New Issue
Block a user