Guild Contract v6x +

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Member alonesin is offline
    MemberRank
    Mar 2011 Join Date
    93Posts

    idea Guild Contract v6x +

    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?


  2. #2
    I'm overrated. Fraysa is offline
    MemberRank
    Apr 2008 Join Date
    4,891Posts

    Re: Guild Contract v6x +

    Do you mean that part when every member in the party has to accept when you form a new guild? Oh yeah, it's no surprise that these things aren't a part of Odin-based sources.

    Afaik it was never released, but maybe @Eric can shed some light.

  3. #3
    Account Upgraded | Title Enabled! br1337 is offline
    MemberRank
    Apr 2015 Join Date
    295Posts

    Re: Guild Contract v6x +

    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.

  4. #4
    Moderator Eric is offline
    ModeratorRank
    Jan 2010 Join Date
    DEV CityLocation
    3,188Posts

    Re: Guild Contract v6x +

    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!

  5. #5
    Master of lurking Kimberly is offline
    ModeratorRank
    Jul 2012 Join Date
    The NetherlandsLocation
    1,092Posts

    Re: Guild Contract v6x +

    We use it as seen on this video: https://youtu.be/lHG6eVQzlIM?t=1m39s

    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

  6. #6
    Omega sunnyboy is offline
    MemberRank
    Mar 2010 Join Date
    6,109Posts

    Re: Guild Contract v6x +

    I coded it also GMS like.



    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.

  7. #7
    Member alonesin is offline
    MemberRank
    Mar 2011 Join Date
    93Posts

    Re: Guild Contract v6x +

    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?

  8. #8
    Master of lurking Kimberly is offline
    ModeratorRank
    Jul 2012 Join Date
    The NetherlandsLocation
    1,092Posts

    Re: Guild Contract v6x +

    Quote Originally Posted by alonesin View Post
    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.

  9. #9
    Member alonesin is offline
    MemberRank
    Mar 2011 Join Date
    93Posts

    Re: Guild Contract v6x +

    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 by alonesin; 30-03-17 at 06:00 PM.

  10. #10
    Omega sunnyboy is offline
    MemberRank
    Mar 2010 Join Date
    6,109Posts

    Re: Guild Contract v6x +

    Quote Originally Posted by alonesin View Post
    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 Code:
                    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

  11. #11
    Member alonesin is offline
    MemberRank
    Mar 2011 Join Date
    93Posts

    Re: Guild Contract v6x +

    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?

  12. #12
    Omega sunnyboy is offline
    MemberRank
    Mar 2010 Join Date
    6,109Posts

    Re: Guild Contract v6x +

    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

  13. #13
    Member alonesin is offline
    MemberRank
    Mar 2011 Join Date
    93Posts

    Re: Guild Contract v6x +

    Quote Originally Posted by sunnyboy View Post
    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!

  14. #14
    Member alonesin is offline
    MemberRank
    Mar 2011 Join Date
    93Posts

    Re: Guild Contract v6x +

    @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!

  15. #15
    Omega sunnyboy is offline
    MemberRank
    Mar 2010 Join Date
    6,109Posts

    Re: Guild Contract v6x +

    Quote Originally Posted by alonesin View Post
    @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



Page 1 of 2 12 LastLast

Advertisement