Link to EO2.0 [Here](http://www.eclipseorigins.com/community/index.php?/topic/104386-eclipse-origins-v2-beta/). **Bugs** **[1.Important Bug Fix (Link)](http://www.touchofdeathforums.com/community/index.php?/topic/124848-eo-2030-guilds/page__st__60#entry809002)** 1* 1- This bug fix is now included in the tutorial, it is still here for those who may not have seen this bug fix and still is using the affected version. If your using Eclipse Origins 3.0 make sure you skip the 3 steps(They are Marked) that are now found [HERE](http://www.touchofdeathforums.com/community/index.php?/topic/124848-eo-2030-guilds/page__st__180#entry835804) **Additions** 1.Special thanks to **[Deathbeam](http://www.touchofdeathforums.com/community/index.php?/user/54531-deathbeam/)** for **visual menu addition**! [Thread Link](http://www.touchofdeathforums.com/community/index.php?/topic/126795-eo-guild-menu-update/) 2\. Special thanks to **[Sherwin](http://www.touchofdeathforums.com/community/index.php?/user/75020-sherwin/)** for **Level Required on guild creation**! [Thread Link](http://www.touchofdeathforums.com/community/index.php?/topic/129257-all-version-level-required-on-creating-guild/) 3\. **Cost for guild creation**. [Thread Link](http://www.touchofdeathforums.com/community/index.php?/topic/124848-eo-2030-guilds/page__st__60#entry808765) 4\. Special thanks to **[GoldSide](http://www.touchofdeathforums.com/community/index.php?/user/65994-goldside/)** for **Random Guild Logos**! [Thread Link](http://www.touchofdeathforums.com/community/index.php?/topic/131561-eo-30random-logo-guild-systemv02/#entry876954) 5\. Special thanks to **[ranslsad](http://www.touchofdeathforums.com/community/index.php?/user/59762-ranslsad/)** for **[EA] Guild Invitation Dialog** [Thread Link](http://www.touchofdeathforums.com/community/index.php?/topic/132753-ea-guild-invitation-dialog/) 6. **Duplicate Guild Name Check**(Because I forgot it in the release) [Thread Link](http://www.eclipseorigins.com/community/index.php?/topic/124848-eo-2030-guilds/?p=904482) After seeing many requests for a stable guild system I decided to take it on as my first feature for eclipse. You can try out a pre-compiled version here:[attachment=69:GuildCompiled.zip] Some highlight features: _Invites_- When a player sends an invite to another player, they will have 2 minutes to accept/decline or it will auto decline players can only have 1 invite at a time. _Founder_- There can only be 1 founder at a time in a guild they can't be kicked and can't have restricted privileges(Can do anything period). You may transfer the founder status to another player with the /founder (name) command. _Guild Ranks_- Each guild can have its own guild ranks(custom names), each guild also has its own set of guild permission(see below). _Guild Permission_- Guild leaders can set what each rank can do, these include: Open Admin Panel, Edit Options/Ranks/Users, Recruit Users, Kick Users. _Guild name over head_ **Guild Commands:** _Make Guild: /guild make To transfer founder status use /guild founder (name) Invite to Guild: /guild invite (name) Leave Guild: /guild leave Open Guild Admin: /guild admin Guild kick: /guild kick (name) Guild disband: /guild disband yes View Guild: /guild view (online/all/offline) ^Default is online, example: /guild view would display all online users. You can talk in guild chat with: ;Message_ Please keep all help/bug reports to this topic, I will look into every single post and do my best to help you. Post in this topic before you PM me, if you don't get a responce within a few days than feel free to PM me. **Download GuildFiles.zip, and follow these steps if your are installing this!** [attachment=16:GuildFiles.zip] Server 1.Place modGuild.bas from the server_files directory into server/src 2.Inside VB6 right click where it displays all the files -> Add -> Module 3.Inside the popup click the existing tab -> Select the src folder -> Select modGuild.bas Client 1.Place modGuild.bas from the client_files directory into client/src 2.Place the 2 frmGuildAdmin files from the client_files directory into client/src 3.Inside VB6 right click where it displays all the files -> Add -> Module 4.Inside the popup click the existing tab -> Select the src folder -> Select modGuild.bas 5.Inside VB6 right click where it displays all the files -> Add -> Form 6.Inside the popup click the existing tab -> Select the src folder -> Select frmGuildAdmin.frm **If a step lists a specific location, this means that it might be confusing to try searching for them.** **!STOP!- Make a backup before you start!** ****************************************************************************** **SERVER** FIND: ``` Call SetStatus("Clearing animations...") Call ClearAnimations ``` UNDER ADD: ``` Call SetStatus("Clearing guilds...") Call ClearGuilds ``` –------------------------------------------------------------ FIND: ``` ChkDir App.Path & "\Data\", "spells" ``` UNDER ADD: ``` ChkDir App.Path & "\Data\", "guilds" ``` –------------------------------------------------------------ FIND: ``` HandleDataSub(CPartyLeave) = GetAddress(AddressOf HandlePartyLeave) ``` UNDER ADD: ``` HandleDataSub(CSayGuild) = GetAddress(AddressOf HandleGuildMsg) HandleDataSub(CGuildCommand) = GetAddress(AddressOf HandleGuildCommands) HandleDataSub(CSaveGuild) = GetAddress(AddressOf HandleGuildSave) ``` –------------------------------------------------------------ FIND(Find in Function PlayerData): ``` Buffer.WriteLong GetPlayerX(index) Buffer.WriteLong GetPlayerY(index) Buffer.WriteLong GetPlayerDir(index) Buffer.WriteLong GetPlayerAccess(index) Buffer.WriteLong GetPlayerPK(index) For i = 1 To Stats.Stat_Count - 1 Buffer.WriteLong GetPlayerStat(index, i) Next ``` UNDER ADD: ``` If Player(index).GuildFileId > 0 Then If TempPlayer(index).tmpGuildSlot > 0 Then Buffer.WriteByte 1 Buffer.WriteString GuildData(TempPlayer(index).tmpGuildSlot).Guild_Name End If Else Buffer.WriteByte 0 End If ``` –------------------------------------------------------------ FIND: ``` ' General Name As String * ACCOUNT_LENGTH poontang As Byte Class As Long Sprite As Long Level As Byte exp As Long Access As Byte PK As Byte ``` UNDER ADD: ``` GuildFileId As Long GuildMemberId As Long ``` –----------------------------------------------------------- FIND: ``` Public Type TempPlayerRec ``` UNDER ADD: ``` tmpGuildSlot As Long tmpGuildInviteSlot As Long tmpGuildInviteTimer As Long tmpGuildInviteId As Long ``` –------------------------------------------------------------ FIND: ``` ' Checks to save players every 5 minutes - Can be tweaked If Tick > LastUpdateSavePlayers Then UpdateSavePlayers LastUpdateSavePlayers = GetTickCount + 300000 End If ``` UNDER ADD: ``` 'Handles Guild Invites For i = 1 To Player_HighIndex If IsPlaying(i) Then If TempPlayer(i).tmpGuildInviteSlot > 0 Then If Tick > TempPlayer(i).tmpGuildInviteTimer Then If GuildData(TempPlayer(i).tmpGuildInviteSlot).In_Use = True Then PlayerMsg i, "Time ran out to join " & GuildData(TempPlayer(i).tmpGuildInviteSlot).Guild_Name & ".", BrightRed TempPlayer(i).tmpGuildInviteSlot = 0 TempPlayer(i).tmpGuildInviteTimer = 0 Else 'Just remove this guild has been unloaded TempPlayer(i).tmpGuildInviteSlot = 0 TempPlayer(i).tmpGuildInviteTimer = 0 End If End If End If End If Next i ``` –------------------------------------------------------------ FIND(Find in modEnumerations): ``` SPartyInvite SPartyUpdate SPartyVitals ``` UNDER ADD: ``` SSendGuild SAdminGuild SGuildAdminSwitchTab ``` –------------------------------------------------------------ FIND(Find in modEnumerations): ``` CDeclineParty CPartyLeave ``` UNDER ADD: ``` CGuildCommand CSayGuild CSaveGuild CRequestGuildAdminTabSwitch ``` –------------------------------------------------------------ FIND: ``` ' Send welcome messages Call SendWelcome(index) ``` UNDER ADD: ``` 'Do all the guild start up checks Call GuildLoginCheck(index) ``` –------------------------------------------------------------ FIND(Find in sub LeftGame): ``` ' leave party. Party_PlayerLeave index ``` UNDER ADD: ``` If Player(index).GuildFileId > 0 Then 'Set player online flag off GuildData(TempPlayer(index).tmpGuildSlot).Guild_Members(Player(index).GuildMemberId).Online = False Call CheckUnloadGuild(TempPlayer(index).tmpGuildSlot) End If ``` –------------------------------------------------------------ FIND: ``` ' Check if the master charlist file exists for checking duplicate names, and if it doesnt make it If Not FileExist("data\accounts\charlist.txt") Then F = FreeFile Open App.Path & "\data\accounts\charlist.txt" For Output As #F Close #F End If ``` UNDER ADD: ``` Call Set_Default_Guild_Ranks ``` –------------------------------------------------------------- FIND: ``` ChkDir App.Path & "\Data\", "spells" ``` UNDER Add: ``` ChkDir App.Path & "\Data\", "guilds" ``` **CLIENT** FIND: ``` Public Sub DrawPlayerName(ByVal Index As Long) Dim TextX As Long Dim TextY As Long Dim color As Long Dim Name As String ``` UNDER ADD: ``` Dim Text2X As Long Dim Text2Y As Long Dim GuildString As String ``` –------------------------------------------------------------ (Using EO 3.0? [Click Here](http://www.touchofdeathforums.com/community/index.php?/topic/124848-eo-2030-guilds/page__st__180#entry835804) and skip these steps ) (This step works for eo2.0/2.3 ) FIND: ``` Name = Trim$(Player(Index).Name) ' calc pos TextX = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(Name))) ``` UNDER ADD: ``` GuildString = Player(Index).GuildName Text2X = ConvertMapX(GetPlayerX(Index) * PIC_X) + Player(Index).XOffset + (PIC_X \ 2) - getWidth(TexthDC, (Trim$(GuildString))) ``` –------------------------------------------------------------ (Using EO 3.0? [Click Here](http://www.touchofdeathforums.com/community/index.php?/topic/124848-eo-2030-guilds/page__st__180#entry835804) and skip these steps ) (This step works for eo2.0/2.3 ) FIND: ``` If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16 Else ' Determine location for text TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16 End If ``` **REPLACE WITH:** ``` If GetPlayerSprite(Index) < 1 Or GetPlayerSprite(Index) > NumCharacters Then TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - 16 Text2Y = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset Else ' Determine location for text TextY = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 16 Text2Y = ConvertMapY(GetPlayerY(Index) * PIC_Y) + Player(Index).YOffset - (DDSD_Character(GetPlayerSprite(Index)).lHeight / 4) + 4 End If ``` –------------------------------------------------------------ (Using EO 3.0? [Click Here](http://www.touchofdeathforums.com/community/index.php?/topic/124848-eo-2030-guilds/page__st__180#entry835804) and skip these steps ) (This step works for eo2.0/2.3 ) FIND: ``` ' Draw name Call DrawText(TexthDC, TextX, TextY, Name, color) ``` UNDER ADD: ``` If Not Player(Index).GuildName = vbNullString Then Call DrawText(TexthDC, Text2X, Text2Y, GuildString, color) End If ``` –------------------------------------------------------------ FIND: ``` ' Vitals Vital(1 To Vitals.Vital_Count - 1) As Long MaxVital(1 To Vitals.Vital_Count - 1) As Long ' Stats Stat(1 To Stats.Stat_Count - 1) As Byte POINTS As Long ' Worn equipment Equipment(1 To Equipment.Equipment_Count - 1) As Long ' Position Map As Long x As Byte y As Byte Dir As Byte ' Client use only XOffset As Integer YOffset As Integer Moving As Byte Attacking As Byte AttackTimer As Long MapGetTimer As Long Step As Byte ``` UNDER ADD: ``` GuildName As String ``` –------------------------------------------------------------ FIND(Find in modEnumerations): ``` STradeRequest SPartyInvite SPartyUpdate SPartyVitals ``` UNDER ADD: ``` SSendGuild SAdminGuild SGuildAdminSwitchTab ``` –------------------------------------------------------------ FIND(Find in modEnumerations): ``` CPartyRequest CAcceptParty CDeclineParty CPartyLeave ``` UNDER ADD: ``` CGuildCommand CSayGuild CSaveGuild CRequestGuildAdminTabSwitch ``` –------------------------------------------------------------ FIND: ``` HandleDataSub(SPartyUpdate) = GetAddress(AddressOf HandlePartyUpdate) HandleDataSub(SPartyVitals) = GetAddress(AddressOf HandlePartyVitals) ``` UNDER ADD: ``` HandleDataSub(SSendGuild) = GetAddress(AddressOf HandleSendGuild) HandleDataSub(SAdminGuild) = GetAddress(AddressOf HandleAdminGuild) ``` –------------------------------------------------------------ FIND: ``` Call SetPlayerDir(i, Buffer.ReadLong) Call SetPlayerAccess(i, Buffer.ReadLong) Call SetPlayerPK(i, Buffer.ReadLong) For x = 1 To Stats.Stat_Count - 1 SetPlayerStat i, x, Buffer.ReadLong Next ``` UNDER ADD: ``` If Buffer.ReadByte = 1 Then Player(i).GuildName = Buffer.ReadString Else Player(i).GuildName = vbNullString End If ``` –------------------------------------------------------------ FIND: ``` If LenB(ChatText) = 0 Then Exit Sub MyText = LCase$(ChatText) ' Handle when the player presses the return key If KeyAscii = vbKeyReturn Then ``` UNDER ADD: ``` 'Guild Message If Left$(ChatText, 1) = ";" Then ChatText = Mid$(ChatText, 2, Len(ChatText) - 1) If Len(ChatText) > 0 Then Call GuildMsg(ChatText) End If MyText = vbNullString frmMain.txtMyChat.text = vbNullString Exit Sub End If ``` –------------------------------------------------------------ FNID: ``` Case "/help" Call AddText("Social Commands:", HelpColor) Call AddText("'msghere = Broadcast Message", HelpColor) Call AddText("-msghere = Emote Message", HelpColor) Call AddText("!namehere msghere = Player Message", HelpColor) Call AddText("Available Commands: /info, /who, /fps, /fpslock", HelpColor) ``` UNDER ADD: ``` Case "/guild" If UBound(Command) < 1 Then Call AddText("Guild Commands:", HelpColor) Call AddText("Make Guild: /guild make (GuildName)", HelpColor) Call AddText("To transfer founder status use /guild founder (name)", HelpColor) Call AddText("Invite to Guild: /guild invite (name)", HelpColor) Call AddText("Leave Guild: /guild leave", HelpColor) Call AddText("Open Guild Admin: /guild admin", HelpColor) Call AddText("Guild kick: /guild kick (name)", HelpColor) Call AddText("Guild disband: /guild disband yes", HelpColor) Call AddText("View Guild: /guild view (online/all/offline)", HelpColor) Call AddText("^Default is online, example: /guild view would display all online users.", HelpColor) Call AddText("You can talk in guild chat with: ;Message ", HelpColor) GoTo Continue End If Select Case Command(1) Case "make" If UBound(Command) = 2 Then Call GuildCommand(1, Command(2)) Else Call AddText("Must have a name, use format /guild make (name)", BrightRed) End If Case "invite" If UBound(Command) = 2 Then Call GuildCommand(2, Command(2)) Else Call AddText("Must select user, use format /guild invite (name)", BrightRed) End If Case "leave" Call GuildCommand(3, "") Case "admin" Call GuildCommand(4, "") Case "view" If UBound(Command) = 2 Then Call GuildCommand(5, Command(2)) Else Call GuildCommand(5, "") End If Case "accept" Call GuildCommand(6, "") Case "decline" Call GuildCommand(7, "") Case "founder" If UBound(Command) = 2 Then Call GuildCommand(8, Command(2)) Else Call AddText("Must select user, use format /guild founder (name)", BrightRed) End If Case "kick" If UBound(Command) = 2 Then Call GuildCommand(9, Command(2)) Else Call AddText("Must select user, use format /guild kick (name)", BrightRed) End If Case "disband" If UBound(Command) = 2 Then If LCase(Command(2)) = LCase("yes") Then Call GuildCommand(10, "") Else Call AddText("Type like /guild disband yes (This is to help prevent an accident!)", BrightRed) End If Else Call AddText("Type like /guild disband yes (This is to help prevent an accident!)", BrightRed) End If End Select ``` **Delete any accounts made before you installed this!** **(Requested by Captain Obvious)** [attachment=16:GuildFiles.zip] [attachment=69:GuildCompiled.zip]