Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Guild Contract v6x +

Status
Not open for further replies.
Newbie Spellweaver
Joined
Mar 7, 2011
Messages
62
Reaction score
0
For some time now I have been with the community and I have never found anything related to a guild contract, not even in moopledev. Is this a difficult setup? So they did not try to redo? Or, and something that is useless?

Or is there something similar that has been released public ? If none of these things have an answer, is there any way?
 
Skilled Illusionist
Joined
Apr 26, 2015
Messages
302
Reaction score
77
I don't know If there's a yes/no packet for this special case, but If theres not, it shouldnt be difficult to implement. You could even use the npc sayYesNo() packet.

What you could do is check how BMS scripts implement it and replicate or even use the same scripts implementing their scripting api, which shouldn't be that difficult.

I think Eric implemented all the BMS scripting API methods.

I'm on my way to implement it as well.
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Jan 18, 2010
Messages
3,109
Reaction score
1,139
My guess is that people just found the feature useless. In most private servers, people just make their own guilds, don't know if people would gather in 6 to make a guild like the good ol' days. This information is not public, and does not (to my knowledge, anyway) exist in any public source.

Here's how it works. The Guild Contract is a special byte (a mode) within the GuildResult packet called CreateGuildAgree (type 3):

Code:
public static OutPacket OnGuildResult(int nPartyID, String sMasterName, String sGuildName) {
	OutPacket oPacket = new OutPacket(LoopbackPacket.GuildResult, false);
	oPacket.Encode1(GuildResCode.CreateGuildAgree.getCode());
	oPacket.Encode4(nPartyID);
	oPacket.EncodeStr(sMasterName);
	oPacket.EncodeStr(sGuildName);
	return oPacket;
}

The process of how Nexon does it is they send a Create Guild window. You enter the guild name here and check if it can be used or not. If the guild name can be used and the user has clicked OK, you send that above packet with the name of the leader, their party ID, and the new name of the guild to all of the members in the party. Each of them will get the guild contract agreement popup. Then, there is a handler mode byte in your typical GuildRequest called CreateGuildAgree_Reply (type 30, structure is int dwCharacterID and byte bAgree). Nexon has an additional class which stores the agree count, and for each person that agrees it increments the agree counter and the answer counter. For anyone who disagrees, it only increases the answer counter. Once the last person has chose their answer, it either sends the packet of someone declining the contract, or it sends the success and creation of the guild. They store it in a class called GuildMake:

Code:
public class GuildMake {
    public int nAgreeCount;
    public int nAnswerCount;
    public String sGuildName;
    public long nSendPacketTime;
}

Oh, and they additionally log the time of the packet initially sent - if any user is left with no response to the contract after two minutes, then the guild's contract will automatically fail.

Hope this helps!
 
Upvote 0
Moderator
Staff member
Moderator
Joined
Jul 30, 2012
Messages
1,103
Reaction score
432
We use it as seen on this video:

But yeah would love more servers to use it. I think we are pretty much only pre-big-bang server that does.

Of course godly Eric shows the ways :p
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Mar 14, 2010
Messages
5,363
Reaction score
1,343
I coded it also GMS like.

alonesin - Guild Contract v6x + - RaGEZONE Forums


I guess it's neat, but you need 6 people to make a guild. r.i.p I'm pretty sure it was removed not too much later since I don't ever recall it in GMS

In a party of 6, leader enters name in NPC and it checks if the name is valid. If it's valid, sends SendAskAgreeMsg to the party for the contract to show up, clicking decline or accept would trigger the 0x1E (CreateGuildAgree_Reply), once all users accept, it will create the guild with all members, leader becomes guild master, other members get set to rank 3.
 
Upvote 0
Newbie Spellweaver
Joined
Mar 7, 2011
Messages
62
Reaction score
0
Thanks for the answers, it was all useful for me, I will try to code something similar!
Kimberly
Do you have this implemented in legends?
 
Upvote 0
Moderator
Staff member
Moderator
Joined
Jul 30, 2012
Messages
1,103
Reaction score
432
Thanks for the answers, it was all useful for me, I will try to code something similar!
Kimberly
Do you have this implemented in legends?

Yup as my linked video suggest by title =P

I don't think there's even a video around from actual GMS where someone recorded it, couldn't find it at least, which is most likely also why the guild contract system as a whole is so unknown to the most.
 
Upvote 0
Newbie Spellweaver
Joined
Mar 7, 2011
Messages
62
Reaction score
0
This seems to me a bit confusing, the packet asks for a guildid number, I'm still creating one ... I'll probably have to send a setGuild and if there is no setGuild (null) agreement.
But, anyway, I need to study even more calmly ...

___ edit
Kimberly or Eric

I have only two more doubts ... if you can help me.

1st - Can another group of people create a new guild while one is already responding? I can not remember how GMS worked.

2º - If the player leaves the group while some are still responding, does the NPC send some error message or is there a lock that blocks not leaving the group or something?
 
Last edited:
Upvote 0
Custom Title Activated
Loyal Member
Joined
Mar 14, 2010
Messages
5,363
Reaction score
1,343
This seems to me a bit confusing, the packet asks for a guildid number, I'm still creating one ... I'll probably have to send a setGuild and if there is no setGuild (null) agreement.
But, anyway, I need to study even more calmly ...

___ edit
Kimberly or Eric

I have only two more doubts ... if you can help me.

1st - Can another group of people create a new guild while one is already responding? I can not remember how GMS worked.

2º - If the player leaves the group while some are still responding, does the NPC send some error message or is there a lock that blocks not leaving the group or something?

SendAskAgreeMsg sends
PHP:
                op.EncodeHeader(SendOpcode.GuildResult.Get());
                op.Encode1(3);
                op.Encode4(nPartyID);
                op.EncodeStr(pUser.GetCharacterName()); // guild leader name
                op.EncodeStr(sGuildName);
and broadcasts it to the party

1) If two different parties are making a guild at the same time, should be fine

2) The handler part of "CreateGuildAgree_Reply" has a check for them being in a party, so if they leave the party and click accept or decline, it will do nothing
 
Upvote 0
Newbie Spellweaver
Joined
Mar 7, 2011
Messages
62
Reaction score
0
I tried to use the following code:
Code:
for (Player mc : party.getPartyMembers()) {
       if(mc.getParty().getLeader() != null || mc.getParty() != null) {
       mc.getClient().getSession().write(MaplePacketCreator.sendInviteGuildTest(party, gName, nameLeader, mc.getName() == nameLeader));
	 }
  }

And this too:
´
Code:
   public static MaplePacket sendInviteGuildTest(MapleParty party, String gName, String nameLeader, boolean isLeader) {
		MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();    
		mplew .writeShort(SendPacketOpcode.GUILD_OPERATION.getValue());
		mplew .write(0x03);
		if (!isLeader) {
			mplew .writeInt(party.getId());
			mplew .writeMapleAsciiString(nameLeader);
			mplew.writeMapleAsciiString(gName);
		}
The code works only for the leader of the party, for the others nothing happens. Is there any information missing?
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Mar 14, 2010
Messages
5,363
Reaction score
1,343
You don't need that if (!isLeader) { check.

All characters need to be in same party, sharing same party id (obv) and the packet should do the rest. Leader gets a notice and party members get contract like in the SS i posted above
 
Upvote 0
Newbie Spellweaver
Joined
Mar 7, 2011
Messages
62
Reaction score
0
You don't need that if (!isLeader) { check.

All characters need to be in same party, sharing same party id (obv) and the packet should do the rest. Leader gets a notice and party members get contract like in the SS i posted above

Could this check be causing the code to fail? Anyway I will test, thanks sunnyboy!
 
Upvote 0
Newbie Spellweaver
Joined
Mar 7, 2011
Messages
62
Reaction score
0
@sunnyboy
I continued my tests, but to no avail. I'm testing this with just 2 characters ... 1 creator and another party member, could that be the problem? Do I have to test with a total of 6 members in the party? Thank you!
 
Upvote 0
Custom Title Activated
Loyal Member
Joined
Mar 14, 2010
Messages
5,363
Reaction score
1,343
sunnyboy
I continued my tests, but to no avail. I'm testing this with just 2 characters ... 1 creator and another party member, could that be the problem? Do I have to test with a total of 6 members in the party? Thank you!

It doesn't matter if it's 6 or 4 or 3. The lowest you need is 2.

The packet needs to be sent by the party boss (leader), and it has to be broadcasted to every party member. If it isn't working, I can only assume ur parties are wack
 
Upvote 0
Newbie Spellweaver
Joined
Mar 7, 2011
Messages
62
Reaction score
0
It doesn't matter if it's 6 or 4 or 3. The lowest you need is 2.

The packet needs to be sent by the party boss (leader), and it has to be broadcasted to every party member. If it isn't working, I can only assume ur parties are wack


Thanks for the answer!

I've done some testing on other versions (v83 +) and it really worked fine, I believe you should have some information related to MaplePacketCreator. I'll review again, thank you!

--------
Update: Yes, it was MaplePacketCreator, thank you all! Eric - closed here.
 
Last edited:
Upvote 0
Status
Not open for further replies.
Back
Top