diff --git a/mychanges_ptbr.txt b/mychanges_ptbr.txt
index 96280cc0c1..4d411b2540 100644
--- a/mychanges_ptbr.txt
+++ b/mychanges_ptbr.txt
@@ -246,4 +246,8 @@ Consertado quest-evento Dollhouse.
23 - 24 Maio 2017,
Revamp na DB referente às Alliances.
-Solução parcial ao problema das Guild Alliances. Pode-se criar uma, sair, expulsar e trocar ranks de jogadores.
\ No newline at end of file
+Solução parcial ao problema das Guild Alliances. Pode-se criar uma, sair, expulsar e trocar ranks de jogadores.
+
+25 Maio 2017,
+Solução final ao problema das Guild Alliances. Todas as funcionalidades implementadas.
+Registros de objetos MapleGuildCharacter agora esta sincronizado entre MapleCharacter's e MapleGuild's.
\ No newline at end of file
diff --git a/nbproject/private/private.xml b/nbproject/private/private.xml
index 1252af1b6b..6d8d3ad834 100644
--- a/nbproject/private/private.xml
+++ b/nbproject/private/private.xml
@@ -1,18 +1,16 @@
-
+
+
+ src/tools/MaplePacketCreator.java
+
+
+ 5939
+
+
+
+
-
- file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/channel/handlers/AllianceOperationHandler.java
- file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleGuild.java
- file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleAlliance.java
- file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/guild/MapleGuildCharacter.java
- file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/Server.java
- file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/world/World.java
- file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/scripting/npc/NPCConversationManager.java
- file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/client/MapleCharacter.java
- file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/net/server/handlers/login/GuestLoginHandler.java
- file:/C:/Nexon/MapleSolaxia/MapleSolaxiaV2/src/tools/MaplePacketCreator.java
-
+
diff --git a/scripts/npc/world0/2010009.js b/scripts/npc/world0/2010009.js
index de3d358424..4ba70595bb 100644
--- a/scripts/npc/world0/2010009.js
+++ b/scripts/npc/world0/2010009.js
@@ -47,11 +47,6 @@ function action(mode, type, selection) {
cm.dispose();
return;
}
- if(!cm.isLeader()) {
- cm.sendNext("Hello there! I'm #bLenario#k. If you want to form a guild, please tell your party leader to talk to me. He/She will be assigned as the Leader of the Guild Union.");
- cm.dispose();
- return;
- }
cm.sendSimple("Hello there! I'm #bLenario#k.\r\n#b#L0#Can you please tell me what Guild Union is all about?#l\r\n#L1#How do I make a Guild Union?#l\r\n#L2#I want to make a Guild Union.#l\r\n#L3#I want to add more guilds for the Guild Union.#l\r\n#L4#I want to break up the Guild Union.#l");
}
@@ -64,6 +59,11 @@ function action(mode, type, selection) {
cm.sendNext("To make a Guild Union, two and only two Guild Masters need to be in a party and both must be present on this room on the same channel. The leader of this party will be assigned as the Guild Union Master.");
cm.dispose();
} else if(selection == 2) {
+ if(!cm.isLeader()) {
+ cm.sendNext("If you want to form a guild union, please tell your party leader to talk to me. He/She will be assigned as the Leader of the Guild Union.");
+ cm.dispose();
+ return;
+ }
if(cm.getPlayer().getGuild().getAllianceId() > 0) {
cm.sendOk("You can not create a Guild Union while your guild is already registered in another.");
cm.dispose();
@@ -111,6 +111,7 @@ function action(mode, type, selection) {
cm.upgradeAlliance();
cm.gainMeso(-increaseCost);
cm.sendOk("Your alliance can now accept one more guild.");
+ cm.dispose();
} else if (choice == 4) {
if (cm.getPlayer().getGuild() == null || cm.getPlayer().getGuild().getAllianceId() <= 0) {
cm.sendNext("You cannot disband a non-existant Guild Union.");
@@ -131,7 +132,7 @@ function action(mode, type, selection) {
choice = 2;
} else {
if (cm.createAlliance(guildName) == null)
- cm.sendOk("Please check if you and the other one guild leader in your party are both here on this room right now. No other guild leaders should be present with you 2 on this process.");
+ cm.sendOk("Please check if you and the other one guild leader in your party are both here on this room right now, and make sure both guilds are currently unregistered on unions. No other guild leaders should be present with you 2 on this process.");
else {
cm.gainMeso(-allianceCost);
cm.sendOk("You have successfully formed a Guild Union.");
diff --git a/sql/db_database.sql b/sql/db_database.sql
index bd8b8e4e70..69176c2346 100644
--- a/sql/db_database.sql
+++ b/sql/db_database.sql
@@ -50,8 +50,14 @@ CREATE TABLE IF NOT EXISTS `accounts` (
CREATE TABLE IF NOT EXISTS `alliance` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(13) NOT NULL,
- `notice` varchar(128) NOT NULL DEFAULT '',
`capacity` int(10) unsigned NOT NULL DEFAULT '2',
+ `notice` varchar(20) NOT NULL DEFAULT '',
+
+ `rank1` varchar(11) NOT NULL DEFAULT '',
+ `rank2` varchar(11) NOT NULL DEFAULT '',
+ `rank3` varchar(11) NOT NULL DEFAULT '',
+ `rank4` varchar(11) NOT NULL DEFAULT '',
+ `rank5` varchar(11) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
diff --git a/src/client/MapleCharacter.java b/src/client/MapleCharacter.java
index 4b7092fd4c..f16b2199d7 100644
--- a/src/client/MapleCharacter.java
+++ b/src/client/MapleCharacter.java
@@ -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) {
diff --git a/src/client/MapleClient.java b/src/client/MapleClient.java
index 4b71878196..42b9b45ea6 100644
--- a/src/client/MapleClient.java
+++ b/src/client/MapleClient.java
@@ -821,7 +821,7 @@ public class MapleClient {
}
if (guild != null) {
final Server server = Server.getInstance();
- server.setGuildMemberOnline(chrg, false, player.getClient().getChannel());
+ server.setGuildMemberOnline(player, false, player.getClient().getChannel());
player.getClient().announce(MaplePacketCreator.showGuildInfo(player));
}
if (party != null) {
diff --git a/src/net/server/Server.java b/src/net/server/Server.java
index fa24e67c88..d30ecb7847 100644
--- a/src/net/server/Server.java
+++ b/src/net/server/Server.java
@@ -69,12 +69,12 @@ public class Server implements Runnable {
private IoAcceptor acceptor;
private List