Fixed Guild Alliances + minor Guild rework

All Guild Alliances system is now functional. Tweaked guilds in order to
sync MapleGuildCharacter objects that were supposed to be the same when
being accessed from both MapleGuild and MapleCharacter classes.
This commit is contained in:
ronancpl
2017-05-26 01:21:54 -03:00
parent a636f63114
commit 702c69897b
16 changed files with 260 additions and 127 deletions

View File

@@ -5891,7 +5891,6 @@ public class MaplePacketCreator {
mplew.writeInt(mgc.isOnline() ? 1 : 0);
mplew.writeInt(guild.getSignature());
mplew.writeInt(mgc.getAllianceRank());
System.out.println("alliance rank found " + mgc.getAllianceRank());
}
mplew.writeInt(guild.getCapacity());
mplew.writeShort(guild.getLogoBG());
@@ -5914,7 +5913,7 @@ public class MaplePacketCreator {
mplew.writeMapleAsciiString(alliance.getRankTitle(i));
}
mplew.write(alliance.getGuilds().size());
mplew.writeInt(2); // probably capacity
mplew.writeInt(alliance.getCapacity()); // probably capacity
for (Integer guild : alliance.getGuilds()) {
mplew.writeInt(guild);
}
@@ -5922,7 +5921,7 @@ public class MaplePacketCreator {
return mplew.getPacket();
}
public static byte[] makeNewAlliance(MapleAlliance alliance, MapleClient c) {
public static byte[] updateAllianceInfo(MapleAlliance alliance, MapleClient c) {
final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.writeShort(SendOpcode.ALLIANCE_OPERATION.getValue());
mplew.write(0x0F);
@@ -5935,10 +5934,10 @@ public class MaplePacketCreator {
for (Integer guild : alliance.getGuilds()) {
mplew.writeInt(guild);
}
mplew.writeInt(2); // probably capacity
mplew.writeInt(alliance.getCapacity()); // probably capacity
mplew.writeShort(0);
for (Integer guildd : alliance.getGuilds()) {
getGuildInfo(mplew, Server.getInstance().getGuild(guildd, c.getWorld(), c.getPlayer().getMGC()));
getGuildInfo(mplew, Server.getInstance().getGuild(guildd, c.getWorld(), c.getPlayer()));
}
return mplew.getPacket();
}
@@ -5967,7 +5966,7 @@ public class MaplePacketCreator {
for (Integer guild : alliance.getGuilds()) {
mplew.writeInt(guild);
}
mplew.writeInt(2);
mplew.writeInt(alliance.getCapacity());
mplew.writeMapleAsciiString(alliance.getNotice());
mplew.writeInt(newGuild);
getGuildInfo(mplew, Server.getInstance().getGuild(newGuild, c.getWorld(), null));
@@ -6030,7 +6029,7 @@ public class MaplePacketCreator {
for (Integer guild : alliance.getGuilds()) {
mplew.writeInt(guild);
}
mplew.writeInt(2);
mplew.writeInt(alliance.getCapacity());
mplew.writeMapleAsciiString(alliance.getNotice());
mplew.writeInt(expelledGuild);
getGuildInfo(mplew, Server.getInstance().getGuild(expelledGuild, c.getWorld(), null));