Browse Source

More itembase refactor

combat-2
MagicBot 8 months ago
parent
commit
61bb7be6b1
  1. 12
      src/engine/gameManager/GroupManager.java

12
src/engine/gameManager/GroupManager.java

@ -303,12 +303,13 @@ public enum GroupManager { @@ -303,12 +303,13 @@ public enum GroupManager {
}
public static boolean goldSplit(PlayerCharacter pc, Item item, ClientConnection origin, AbstractWorldObject tar) {
if (item == null || pc == null || tar == null || item.getItemBase() == null) {
if (item == null || pc == null || tar == null) {
Logger.error("null something");
return false;
}
if (item.getItemBase().getUUID() != 7) //only split goldItem
if (!item.template.item_type.equals(Enum.ItemType.GOLD)) //only split goldItem
return false;
Group group = getGroup(pc);
@ -316,7 +317,6 @@ public enum GroupManager { @@ -316,7 +317,6 @@ public enum GroupManager {
if (group == null || !group.getSplitGold()) //make sure player is grouped and split is on
return false;
ArrayList<PlayerCharacter> playersSplit = new ArrayList<>();
//get group members
@ -331,8 +331,8 @@ public enum GroupManager { @@ -331,8 +331,8 @@ public enum GroupManager {
playersSplit.add(groupMember);
}
//make sure more than one group member in loot range
//make sure more then one group member in loot range
int size = playersSplit.size();
if (size < 2)
@ -358,8 +358,8 @@ public enum GroupManager { @@ -358,8 +358,8 @@ public enum GroupManager {
item.setNumOfItems(0);
} else
item.setNumOfItems(0);
for (PlayerCharacter splitPlayer : playersSplit) {
for (PlayerCharacter splitPlayer : playersSplit) {
int amt = (group.isGroupLead(splitPlayer)) ? (amount + dif) : amount;
if (amt > 0)
@ -368,7 +368,6 @@ public enum GroupManager { @@ -368,7 +368,6 @@ public enum GroupManager {
for (PlayerCharacter splitPlayer : playersSplit) {
UpdateGoldMsg ugm = new UpdateGoldMsg(splitPlayer);
ugm.configure();
@ -380,7 +379,6 @@ public enum GroupManager { @@ -380,7 +379,6 @@ public enum GroupManager {
updateTargetGold.configure();
DispatchMessage.dispatchMsgToInterestArea(tar, updateTargetGold, Enum.DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
// //TODO send group split message
String text = "Group Split: " + amount;
ChatManager.chatGroupInfo(pc, text);

Loading…
Cancel
Save