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

@@ -1961,7 +1961,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
public int getAllianceRank() {
return this.allianceRank;
return allianceRank;
}
public int getAllowWarpToId() {
@@ -2200,7 +2200,7 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
public MapleGuild getGuild() {
try {
return Server.getInstance().getGuild(getGuildId(), getWorld(), null);
return Server.getInstance().getGuild(getGuildId(), getWorld(), this);
} catch (Exception ex) {
ex.printStackTrace();
return null;
@@ -2445,6 +2445,10 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
public MapleGuildCharacter getMGC() {
return mgc;
}
public void setMGC(MapleGuildCharacter mgc) {
this.mgc = mgc;
}
public MaplePartyCharacter getMPC() {
if (mpc == null) {
@@ -2549,6 +2553,16 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
return list;
}
public boolean isPartyMember(MapleCharacter chr) {
for(MapleCharacter mpc: getPartyMembers()) {
if(mpc.getId() == chr.getId()) {
return true;
}
}
return false;
}
public MaplePlayerShop getPlayerShop() {
return playerShop;
@@ -4160,10 +4174,6 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
}
}
public void resetMGC(MapleGuildCharacter mgc) {
this.mgc = mgc;
}
public synchronized void saveCooldowns() {
if (getAllCooldowns().size() > 0) {
try {
@@ -4636,9 +4646,6 @@ public class MapleCharacter extends AbstractAnimatedMapleMapObject {
public void setAllianceRank(int rank) {
allianceRank = rank;
if (mgc != null) {
mgc.setAllianceRank(rank);
}
}
public void setAllowWarpToId(int id) {