Browse Source

remove siege minion

combat-2
FatBoy-DOTC 1 year ago
parent
commit
60ca3f9c34
  1. 4
      src/engine/devcmd/cmds/PurgeObjectsCmd.java
  2. 4
      src/engine/devcmd/cmds/RemoveObjectCmd.java
  3. 7
      src/engine/net/client/handlers/MinionTrainingMsgHandler.java
  4. 2
      src/engine/net/client/msg/ManageNPCMsg.java
  5. 4
      src/engine/objects/Mob.java
  6. 4
      src/engine/objects/NPC.java

4
src/engine/devcmd/cmds/PurgeObjectsCmd.java

@ -59,7 +59,7 @@ public class PurgeObjectsCmd extends AbstractDevCmd {
if (npc != null) { if (npc != null) {
for (Mob mob : npc.getSiegeMinionMap().keySet()) { for (Mob mob : npc.siegeMinionMap.keySet()) {
WorldGrid.RemoveWorldObject(mob); WorldGrid.RemoveWorldObject(mob);
WorldGrid.removeObject(mob, pc); WorldGrid.removeObject(mob, pc);
//Mob.getRespawnMap().remove(mob); //Mob.getRespawnMap().remove(mob);
@ -151,7 +151,7 @@ public class PurgeObjectsCmd extends AbstractDevCmd {
if (npc != null) { if (npc != null) {
for (Mob mob : npc.getSiegeMinionMap().keySet()) { for (Mob mob : npc.siegeMinionMap.keySet()) {
WorldGrid.RemoveWorldObject(mob); WorldGrid.RemoveWorldObject(mob);
WorldGrid.removeObject(mob, pc); WorldGrid.removeObject(mob, pc);
//Mob.getRespawnMap().remove(mob); //Mob.getRespawnMap().remove(mob);

4
src/engine/devcmd/cmds/RemoveObjectCmd.java

@ -154,7 +154,7 @@ public class RemoveObjectCmd extends AbstractDevCmd {
mobA = (Mob) ac; mobA = (Mob) ac;
if (npc != null) { if (npc != null) {
for (Mob mob : npc.getSiegeMinionMap().keySet()) { for (Mob mob : npc.siegeMinionMap.keySet()) {
WorldGrid.RemoveWorldObject(mob); WorldGrid.RemoveWorldObject(mob);
WorldGrid.removeObject(mob, pc); WorldGrid.removeObject(mob, pc);
//Mob.getRespawnMap().remove(mob); //Mob.getRespawnMap().remove(mob);
@ -209,7 +209,7 @@ public class RemoveObjectCmd extends AbstractDevCmd {
if (npc.building != null) if (npc.building != null)
npc.building.getHirelings().remove(npc); npc.building.getHirelings().remove(npc);
for (Mob mob : npc.getSiegeMinionMap().keySet()) { for (Mob mob : npc.siegeMinionMap.keySet()) {
WorldGrid.RemoveWorldObject(mob); WorldGrid.RemoveWorldObject(mob);
WorldGrid.removeObject(mob, pc); WorldGrid.removeObject(mob, pc);
if (mob.getParentZone() != null) if (mob.getParentZone() != null)

7
src/engine/net/client/handlers/MinionTrainingMsgHandler.java

@ -41,7 +41,6 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
if (player == null) if (player == null)
return true; return true;
if (minionMsg.getNpcType() == Enum.GameObjectType.NPC.ordinal()) { if (minionMsg.getNpcType() == Enum.GameObjectType.NPC.ordinal()) {
NPC npc = NPC.getFromCache(minionMsg.getNpcID()); NPC npc = NPC.getFromCache(minionMsg.getNpcID());
@ -62,10 +61,10 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
Mob toRemove = Mob.getFromCache(minionMsg.getUUID()); Mob toRemove = Mob.getFromCache(minionMsg.getUUID());
if (!npc.getSiegeMinionMap().containsKey(toRemove)) if (!npc.siegeMinionMap.containsKey(toRemove))
return true; return true;
npc.getSiegeMinionMap().remove(toRemove); npc.siegeMinionMap.remove(toRemove);
WorldGrid.RemoveWorldObject(toRemove); WorldGrid.RemoveWorldObject(toRemove);
@ -118,7 +117,7 @@ public class MinionTrainingMsgHandler extends AbstractClientMsgHandler {
if (npc.getContractID() == 842) if (npc.getContractID() == 842)
maxSlots = 1; maxSlots = 1;
if (npc.getSiegeMinionMap().size() == maxSlots) if (npc.siegeMinionMap.size() == maxSlots)
return true; return true;
int mobBase; int mobBase;

2
src/engine/net/client/msg/ManageNPCMsg.java

@ -343,7 +343,7 @@ public class ManageNPCMsg extends ClientNetMsg {
writer.putInt(0); //runemaster list writer.putInt(0); //runemaster list
//artillery captain list //artillery captain list
ConcurrentHashMap<Mob, Integer> siegeMinions = npc.getSiegeMinionMap(); ConcurrentHashMap<Mob, Integer> siegeMinions = npc.siegeMinionMap;
writer.putInt(1 + siegeMinions.size()); writer.putInt(1 + siegeMinions.size());
serializeBulwarkList(writer, 1); //Trebuchet serializeBulwarkList(writer, 1); //Trebuchet
//serializeBulwarkList(writer, 2); //Ballista //serializeBulwarkList(writer, 2); //Ballista

4
src/engine/objects/Mob.java

@ -528,8 +528,8 @@ public class Mob extends AbstractIntelligenceAgent {
siegeMinion.setLoc(siegeMinion.bindLoc); siegeMinion.setLoc(siegeMinion.bindLoc);
siegeMinion.despawn(); siegeMinion.despawn();
int slot = artyCaptain.getSiegeMinionMap().size() + 1; int slot = artyCaptain.siegeMinionMap.size() + 1;
artyCaptain.getSiegeMinionMap().put(siegeMinion, slot); artyCaptain.siegeMinionMap.put(siegeMinion, slot);
return siegeMinion; return siegeMinion;
} }

4
src/engine/objects/NPC.java

@ -1103,10 +1103,6 @@ public class NPC extends AbstractCharacter {
return (int) time; return (int) time;
} }
public ConcurrentHashMap<Mob, Integer> getSiegeMinionMap() {
return siegeMinionMap;
}
public boolean remove() { public boolean remove() {
Building building; Building building;

Loading…
Cancel
Save