forked from MagicBane/Server
Removed Fidality garbage. Fixed mobs in buildings.
This commit is contained in:
@@ -456,8 +456,6 @@ public class InfoCmd extends AbstractDevCmd {
|
|||||||
output += newline;
|
output += newline;
|
||||||
output += "Speed : " + targetMob.getSpeed();
|
output += "Speed : " + targetMob.getSpeed();
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "Fidelity ID: " + targetMob.getFidalityID();
|
|
||||||
output += newline;
|
|
||||||
output += "EquipSet: " + targetMob.getEquipmentSetID();
|
output += "EquipSet: " + targetMob.getEquipmentSetID();
|
||||||
output += newline;
|
output += newline;
|
||||||
output += "Parent Zone LoadNum : " + targetMob.getParentZone().getLoadNum();
|
output += "Parent Zone LoadNum : " + targetMob.getParentZone().getLoadNum();
|
||||||
|
|||||||
@@ -1130,15 +1130,12 @@ public class ClientMessagePump implements NetMsgHandler {
|
|||||||
//Take equipment off mob
|
//Take equipment off mob
|
||||||
if (tar.getObjectType() == GameObjectType.Mob && itemRet != null){
|
if (tar.getObjectType() == GameObjectType.Mob && itemRet != null){
|
||||||
Mob mobTarget = (Mob)tar;
|
Mob mobTarget = (Mob)tar;
|
||||||
if (mobTarget.getFidalityID() != 0){
|
|
||||||
if (item != null && item.getObjectType() == GameObjectType.MobLoot){
|
if (item != null && item.getObjectType() == GameObjectType.MobLoot){
|
||||||
int fidelityEquipID = ((MobLoot)item).getFidelityEquipID();
|
|
||||||
|
|
||||||
if (fidelityEquipID != 0){
|
|
||||||
for (MobEquipment equip: mobTarget.getEquip().values()){
|
for (MobEquipment equip: mobTarget.getEquip().values()){
|
||||||
if (equip.getObjectUUID() == fidelityEquipID){
|
|
||||||
TransferItemFromEquipToInventoryMsg back = new TransferItemFromEquipToInventoryMsg(mobTarget, equip.getSlot());
|
|
||||||
|
|
||||||
|
TransferItemFromEquipToInventoryMsg back = new TransferItemFromEquipToInventoryMsg(mobTarget, equip.getSlot());
|
||||||
DispatchMessage.dispatchMsgToInterestArea(mobTarget, back, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false);
|
DispatchMessage.dispatchMsgToInterestArea(mobTarget, back, DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false);
|
||||||
|
|
||||||
LootMsg lootMsg = new LootMsg(0,0,tar.getObjectType().ordinal(), tar.getObjectUUID(), equip);
|
LootMsg lootMsg = new LootMsg(0,0,tar.getObjectType().ordinal(), tar.getObjectUUID(), equip);
|
||||||
@@ -1146,23 +1143,13 @@ public class ClientMessagePump implements NetMsgHandler {
|
|||||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.SECONDARY);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
else if (targetType == GameObjectType.Corpse.ordinal()) {
|
else if (targetType == GameObjectType.Corpse.ordinal()) {
|
||||||
corpse = Corpse.getCorpse(targetID);
|
corpse = Corpse.getCorpse(targetID);
|
||||||
if (corpse == null)
|
if (corpse == null)
|
||||||
|
|||||||
+23
-79
@@ -105,7 +105,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
private DeferredPowerJob weaponPower;
|
private DeferredPowerJob weaponPower;
|
||||||
private DateTime upgradeDateTime = null;
|
private DateTime upgradeDateTime = null;
|
||||||
private boolean lootSync = false;
|
private boolean lootSync = false;
|
||||||
private int fidalityID = 0;
|
|
||||||
private int equipmentSetID = 0;
|
private int equipmentSetID = 0;
|
||||||
public int runeSetID = 0;
|
public int runeSetID = 0;
|
||||||
public int bootySetID = 0;
|
public int bootySetID = 0;
|
||||||
@@ -257,12 +256,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
int guildID = rs.getInt("mob_guildUID");
|
int guildID = rs.getInt("mob_guildUID");
|
||||||
|
|
||||||
|
|
||||||
if (this.fidalityID != 0) {
|
if (this.building != null)
|
||||||
if (this.building != null)
|
|
||||||
this.guild = this.building.getGuild();
|
|
||||||
else
|
|
||||||
this.guild = Guild.getGuild(guildID);
|
|
||||||
} else if (this.building != null)
|
|
||||||
this.guild = this.building.getGuild();
|
this.guild = this.building.getGuild();
|
||||||
else
|
else
|
||||||
this.guild = Guild.getGuild(guildID);
|
this.guild = Guild.getGuild(guildID);
|
||||||
@@ -294,9 +288,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
|
|
||||||
this.setParentZone(ZoneManager.getZoneByUUID(this.parentZoneID));
|
this.setParentZone(ZoneManager.getZoneByUUID(this.parentZoneID));
|
||||||
|
|
||||||
|
|
||||||
this.fidalityID = rs.getInt("fidalityID");
|
|
||||||
|
|
||||||
this.equipmentSetID = rs.getInt("equipmentSet");
|
this.equipmentSetID = rs.getInt("equipmentSet");
|
||||||
this.runeSetID = rs.getInt("runeSet");
|
this.runeSetID = rs.getInt("runeSet");
|
||||||
this.bootySetID = rs.getInt("bootySet");
|
this.bootySetID = rs.getInt("bootySet");
|
||||||
@@ -306,8 +297,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
|
|
||||||
this.lootSet = (rs.getInt("lootSet"));
|
this.lootSet = (rs.getInt("lootSet"));
|
||||||
|
|
||||||
if (this.fidalityID != 0)
|
this.nameOverride = rs.getString("mob_name");
|
||||||
this.nameOverride = rs.getString("mob_name");
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error(currentID + "");
|
Logger.error(currentID + "");
|
||||||
@@ -780,58 +770,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
mob.upgradeDateTime = upgradeDateTime;
|
mob.upgradeDateTime = upgradeDateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Vector3fImmutable GetSpawnRadiusLocation(Mob mob) {
|
|
||||||
|
|
||||||
Vector3fImmutable returnLoc = Vector3fImmutable.ZERO;
|
|
||||||
|
|
||||||
if (mob.fidalityID != 0 && mob.building != null) {
|
|
||||||
|
|
||||||
|
|
||||||
Vector3fImmutable spawnRadiusLoc = Vector3fImmutable.getRandomPointInCircle(mob.localLoc, mob.spawnRadius);
|
|
||||||
|
|
||||||
Vector3fImmutable buildingWorldLoc = ZoneManager.convertLocalToWorld(mob.building, spawnRadiusLoc);
|
|
||||||
|
|
||||||
return buildingWorldLoc;
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
boolean run = true;
|
|
||||||
|
|
||||||
while (run) {
|
|
||||||
Vector3fImmutable localLoc = new Vector3fImmutable(mob.statLat + mob.parentZone.absX, mob.statAlt + mob.parentZone.absY, mob.statLon + mob.parentZone.absZ);
|
|
||||||
Vector3fImmutable spawnRadiusLoc = Vector3fImmutable.getRandomPointInCircle(localLoc, mob.spawnRadius);
|
|
||||||
|
|
||||||
//not a roaming mob, just return the random loc.
|
|
||||||
if (mob.spawnRadius < 12000)
|
|
||||||
return spawnRadiusLoc;
|
|
||||||
|
|
||||||
Zone spawnZone = ZoneManager.findSmallestZone(spawnRadiusLoc);
|
|
||||||
//dont spawn roaming mobs in npc cities
|
|
||||||
if (spawnZone.isNPCCity())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
//dont spawn roaming mobs in player cities.
|
|
||||||
if (spawnZone.isPlayerCity())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
//don't spawn mobs in water.
|
|
||||||
if (HeightMap.isLocUnderwater(spawnRadiusLoc))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
run = false;
|
|
||||||
|
|
||||||
return spawnRadiusLoc;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//shouldn't ever get here.
|
|
||||||
|
|
||||||
return returnLoc;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void clearStatic() {
|
private void clearStatic() {
|
||||||
|
|
||||||
if (this.parentZone != null)
|
if (this.parentZone != null)
|
||||||
@@ -872,7 +810,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
this.level = 1;
|
this.level = 1;
|
||||||
|
|
||||||
//add this npc to building
|
//add this npc to building
|
||||||
if (this.building != null && this.loadID != 0 && this.fidalityID == 0) {
|
if (this.building != null && this.loadID != 0 && building.getBlueprintUUID() != 0) {
|
||||||
|
|
||||||
int maxSlots;
|
int maxSlots;
|
||||||
maxSlots = building.getBlueprint().getSlotsForRank(this.building.getRank());
|
maxSlots = building.getBlueprint().getSlotsForRank(this.building.getRank());
|
||||||
@@ -1003,16 +941,29 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
|
|
||||||
public void setParentZone(Zone zone) {
|
public void setParentZone(Zone zone) {
|
||||||
|
|
||||||
if (this.parentZone == null) {
|
if (this.parentZone == null){
|
||||||
zone.zoneMobSet.add(this);
|
zone.zoneMobSet.add(this);
|
||||||
this.parentZone = zone;
|
this.parentZone = zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.bindLoc = Mob.GetSpawnRadiusLocation(this);
|
|
||||||
this.lastBindLoc = bindLoc;
|
if ( this.building != null) {
|
||||||
this.setLoc(bindLoc);
|
|
||||||
this.stopMovement(bindLoc);
|
Vector3fImmutable localLoc = new Vector3fImmutable(this.statLat,this.statAlt,this.statLon);
|
||||||
}
|
Vector3fImmutable buildingWorldLoc = ZoneManager.convertLocalToWorld(this.building, localLoc);
|
||||||
|
this.setBindLoc(buildingWorldLoc);
|
||||||
|
this.setLoc(buildingWorldLoc);
|
||||||
|
this.endLoc = buildingWorldLoc;
|
||||||
|
this.stopMovement(endLoc);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Vector3fImmutable localLoc = new Vector3fImmutable(this.statLat + zone.absX, this.statAlt + zone.absY, this.statLon + zone.absZ);
|
||||||
|
this.setBindLoc(localLoc);
|
||||||
|
this.setLoc(localLoc);
|
||||||
|
this.endLoc = localLoc;
|
||||||
|
this.stopMovement(endLoc);
|
||||||
|
}
|
||||||
|
|
||||||
public int getParentZoneID() {
|
public int getParentZoneID() {
|
||||||
|
|
||||||
@@ -1371,10 +1322,7 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
this.combatTarget = null;
|
this.combatTarget = null;
|
||||||
this.isAlive.set(true);
|
this.isAlive.set(true);
|
||||||
|
|
||||||
if (!this.isSiege)
|
this.lastBindLoc = this.bindLoc;
|
||||||
this.lastBindLoc = Mob.GetSpawnRadiusLocation(this);
|
|
||||||
else
|
|
||||||
this.lastBindLoc = this.bindLoc;
|
|
||||||
this.bindLoc = this.lastBindLoc;
|
this.bindLoc = this.lastBindLoc;
|
||||||
this.setLoc(this.lastBindLoc);
|
this.setLoc(this.lastBindLoc);
|
||||||
this.stopMovement(this.lastBindLoc);
|
this.stopMovement(this.lastBindLoc);
|
||||||
@@ -2510,10 +2458,6 @@ public class Mob extends AbstractIntelligenceAgent {
|
|||||||
this.lootSync = lootSync;
|
this.lootSync = lootSync;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getFidalityID() {
|
|
||||||
return fidalityID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HashMap<Integer, MobEquipment> getEquip() {
|
public HashMap<Integer, MobEquipment> getEquip() {
|
||||||
return equip;
|
return equip;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user