Browse Source

remove siege minion

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

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

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

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

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

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

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

4
src/engine/objects/Mob.java

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

4
src/engine/objects/NPC.java

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

Loading…
Cancel
Save