[Guide] Party-Function 4 VB
Add this to your "modGameServer.bas":
Code:
Case "76FF" 'Form Party
Handle_Party_Form index, sData
Case "7535" ' Delete Party
Handle_Party_Delete index, sData
Case "73DC" 'Edit Party
Handle_Party_Edit index, sData
and soon:
Code:
Case "7588" 'Show Partylist
Handle_Party_ShowList index, sData
Now the functions:
Player froms party
Code:
Public Function Handle_Party_Form(index As Integer, data As String)
PartyCount = PartyCount + 1 'Increase the PartyNr.
PlayerData(index).PartyNr = WordFromInteger(PartyCount)
PlayerData(index).PartyOwner = True
PartyExist(PartyCount) = True
fData = "FFB6" & "0000"
fData = fData & "01"
fData = fData & WordFromInteger(PartyCount) & "0000"
fData = fData & "00000000"
fData = fData & Mid(data, 17, 2) 'Values for Exp-share/distrib. and "Only-master-invite"
fData = fData & Mid(data, 19, 2) 'PartyType (Hunting, Quest, Thief or Trade)
fData = fData & Mid(data, 21, 2) 'Min lvl
fData = fData & Mid(data, 23, 2) 'Max lvl
fData = fData & Mid(data, 25, 4) 'Len of Party title
fData = fData & Mid(data, 29, Len(data) - 24) 'Party title
pLen = (Len(fData) -
/ 2
fData = WordFromInteger(pLen) & fData
For i = 1 To UBound(PlayerData)
If PlayerData(i).Ingame = True Then
frmMain.GameSocket(i).SendData cv_StringFromHex(fData)
End If
Next i
End Function
Player deletes Party:
Code:
Public Function Handle_Party_Delete(index As Integer, data As String)
PlayerData(index).PartyOwner = False
PartyExist(IntegerFromWord(Mid(data, 1, 4))) = False
fData = "35B5" & "0000"
fData = fData & "01"
fData = fData & Mid(data, 1, 4) & "0000" 'PartyNr.
pLen = (Len(fData) -
/ 2
fData = WordFromInteger(pLen) & fData
For i = 1 To UBound(PlayerData)
If PlayerData(i).Ingame = True Then
frmMain.GameSocket(i).SendData cv_StringFromHex(fData)
End If
Next i
End Function
Player changes his partyentry:
Code:
Public Function Handle_Party_Edit(index As Integer, data As String)
fData = "DCB3" & "0000"
fData = fData & "01"
fData = fData & Mid(data, 1, 4) & "0000" 'PartyNr
fData = fData & "00000000"
fData = fData & Mid(data, 17, 2) 'Values for Exp-share/distrib. and "Only-master-invite"
fData = fData & Mid(data, 19, 2) 'PartyType (Hunting, Quest, Thief or Trade)
fData = fData & Mid(data, 21, 2) 'Min lvl
fData = fData & Mid(data, 23, 2) 'Max lvl
fData = fData & Mid(data, 25, 4) 'Len of Party title
fData = fData & Mid(data, 29, Len(data) - 24) 'Party name
pLen = (Len(fData) -
/ 2
fData = WordFromInteger(pLen) & fData
For i = 1 To UBound(PlayerData)
If PlayerData(i).Ingame = True Then
frmMain.GameSocket(i).SendData cv_StringFromHex(fData)
End If
Next i
End Function