root/trunk/AE-go_GameServer/src/com/aionemu/gameserver/network/aion/clientpackets/CM_GROUP_DISTRIBUTION.java
| 967 | 993 | ||
|---|---|---|---|
21 | import com.aionemu.gameserver.model.gameobjects.player.Player; | 21 | import com.aionemu.gameserver.model.gameobjects.player.Player; |
22 | import com.aionemu.gameserver.model.group.PlayerGroup; | 22 | import com.aionemu.gameserver.model.group.PlayerGroup; |
23 | import com.aionemu.gameserver.network.aion.AionClientPacket; | 23 | import com.aionemu.gameserver.network.aion.AionClientPacket; |
24 | |||
25 | /** | 24 | /** |
26 | * @author Lyahim | 25 | * @author Lyahim |
27 | */ | 26 | */ |
28 | public class CM_GROUP_DISTRIBUTION extends AionClientPacket | 27 | public class CM_GROUP_DISTRIBUTION extends AionClientPacket |
29 | { | 28 | { |
30 | private int amount; | 29 | private int amount; |
31 | | 30 | |
32 | public CM_GROUP_DISTRIBUTION(int opcode) | 31 | public CM_GROUP_DISTRIBUTION(int opcode) |
33 | { | 32 | { |
34 | super(opcode); | 33 | super(opcode); |
... | ... | ||
53 | { | 52 | { |
54 | Player player = getConnection().getActivePlayer(); | 53 | Player player = getConnection().getActivePlayer(); |
55 | PlayerGroup pg = null; | 54 | PlayerGroup pg = null; |
56 | | 55 | |
57 | if(player != null) | 56 | if(player != null) |
58 | pg = player.getPlayerGroup(); | 57 | pg = player.getPlayerGroup(); |
59 | if(pg != null) | 58 | if(pg != null) |
60 | { | 59 | { |
61 | int rewardcount = pg.size() - 1; | 60 | int rewardcount = pg.size() - 1; |
62 | | 61 | |
63 | if(rewardcount <= amount) | 62 | if(rewardcount <= amount) |
64 | { | 63 | { |
65 | int reward = amount/rewardcount; | 64 | int reward = amount/rewardcount; |
66 | | 65 | |
67 | Iterator it = pg.getGroupMemberIterator(); | 66 | Iterator it = pg.getGroupMemberIterator(); |
68 | while(it.hasNext()) | 67 | while(it.hasNext()) |
69 | { | 68 | { |
70 | Player member = (Player)it.next(); | 69 | Player member = (Player)it.next(); |
71 | | 70 | |
72 | if(member.equals(player)) | 71 | if(member.equals(player)) |
73 | member.getInventory().decreaseKinah(amount); | 72 | member.getInventory().decreaseKinah(amount); |
74 | else | 73 | else |
Download diff