[EA] Guild Invitation Dialog

First of all, this is my first release Topic… i want to thanks you all for the work you do with this engine…

Im member of this forum since 2010 and i started a game just a pair weeks ago…

I will start to release some of my sources…

Sry for bad english… Lets Start!

Required Tutorial: [EO 2.0/3.0] Guilds

What This code Do?

Screen will explain it 100%.

Note:

Maybe i dont do the tut as well… i can forget any code, i will try to do it as well i can…

If you got error, please tell me where and ill try to resolve!

Server Side:

Find SGuildAdminSwitchTab on Public Enum ServerPackets - modEnumerations and add after:


SGuildInvite 'Guild

Find in modServerTCP


Sub SendTrade(ByVal index As Long, ByVal tradeTarget As Long)

Dim Buffer As clsBuffer

Set Buffer = New clsBuffer

Buffer.WriteLong STrade

Buffer.WriteLong tradeTarget

Buffer.WriteString Trim$(GetPlayerName(tradeTarget))

SendDataTo index, Buffer.ToArray()

Set Buffer = Nothing

End Sub

add after:


Sub SendGuildInvite(ByVal GName As String, ByVal GInviterName As String, ByVal guildTarget As Long)

Dim Buffer As clsBuffer

Set Buffer = New clsBuffer

Buffer.WriteLong SGuildInvite

Buffer.WriteString GName

Buffer.WriteString GInviterName

SendDataTo guildTarget, Buffer.ToArray()

Set Buffer = Nothing

End Sub

In modGuild find:


PlayerMsg index, Player(Inviter_Index).Name & " has invited you to join the guild " & GuildData(GuildSlot).Guild_Name & "!", Green

PlayerMsg index, "Type /guild accept within the next 2 Minutes to join.", Green

PlayerMsg index, "Type /guild decline to remove the offer.", Green

and replace with:


SendGuildInvite GuildData(GuildSlot).Guild_Name, Player(Inviter_Index).Name, index

Client Side:

Find SGuildAdminSwitchTab on Public Enum ServerPackets - modEnumerations and add after:


SGuildInvite 'Guild

Find in modHandleData


HandleDataSub(SAdminGuild) = GetAddress(AddressOf HandleAdminGuild) 'Guild

Add after:


HandleDataSub(SGuildInvite) = GetAddress(AddressOf HandleGuildInvite) 'Guild

In modGuild add at the bottom or elsewhere you want:


Public Sub HandleGuildInvite(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)

Dim Buffer As clsBuffer

Dim GName As String

Dim GInvName As String

' If debug mode, handle error then exit out

If Options.Debug = 1 Then On Error GoTo errorhandler

Set Buffer = New clsBuffer

Buffer.WriteBytes Data()

GName = Buffer.ReadString

GInvName = Buffer.ReadString

Dialogue "Invitacion al Guild", GInvName & " te ha invitado a su clan." & vbNewLine & "Nombre del Clan: " & GName & vbNewLine & _

			 " Deseas unirte?", DIALOGUE_TYPE_GUILDINVITE, True

' Error handler

Exit Sub

errorhandler:

HandleError "HandleAdminGuild", "modGuild", Err.Number, Err.Description, Err.Source, Err.HelpContext

Err.Clear

End Sub

Find in modConstants:


Public Const DIALOGUE_TYPE_PARTY As Byte = 3

Add after:


Public Const DIALOGUE_TYPE_GUILDINVITE As Byte = 4

Find in modGameLogic:


Case DIALOGUE_TYPE_PARTY

			 SendAcceptParty

Add after:


Case DIALOGUE_TYPE_GUILDINVITE

			 SendAcceptGuildInvite

in Same sub a few lines down find:


Case DIALOGUE_TYPE_PARTY

			 SendDeclineParty

and add after:


Case DIALOGUE_TYPE_GUILDINVITE

			 SendDeclineGuildInvite

in modClientTCP add at botton or where you prefer:


Sub SendAcceptGuildInvite()

Call GuildCommand(6, "")

End Sub

Sub SendDeclineGuildInvite()

Call GuildCommand(7, "")

End Sub

¡DONE!

Thanks you all for read and add the script!!

If you can optimize, do better code, modify it for get a better function, do it and show us all!

Was it useful for you? - Like This!

Working on: Buff Icons

Show Buff Icon by Type: 100%

Show Buff TimeLeft: 100%

GUI: -

Draw the max 10 Buff on screen: 100%

Ideas?

Screen: Click Here

–—

Greetings

Ranslsad

Nice. Also it would be a good thing if the guild invite message was changed back to english.

Thanks… here you got the message on english:

Client Side:

Find:

Dialogue "Invitacion al Guild", GInvName & " te ha invitado a su clan." & vbNewLine & "Nombre del Clan: " & GName & vbNewLine & _

			 " Deseas unirte?", DIALOGUE_TYPE_GUILDINVITE, True

Replace with:


Dialogue "Guild Invitation", GInvName & " has invited you to his guild." & vbNewLine & "Guild Name: " & GName & vbNewLine & _

			 " want to Join?", DIALOGUE_TYPE_GUILDINVITE, True

Did you tested the code?

Greetings

Ranslsad

I didn’t try it out. Just whiffed through it quickly. But I don’t see why anything has to go wrong. And for the translation of the message, many ppl will most probs ask for it.

Log in to reply