[Guide] Unique "Spawn/Kill"-Notice Function
Add this to your modGamerServer.bas:
Code:
Public Function WriteUniqueComment(Kill As Boolean, PlayerName As String, MobID As String)
fData = "5830"
fData = fData & "0000"
If Kill = True Then
'Kill = True means, Unique got killed
fData = fData & "06"
Else
'Kill = False means, Unique spawned
fData = fData & "05"
End if
fData = fData & WordFromInteger(MobID)
fData = fData & "0000"
If Kill = True Then
'we need the name of the player who killed the unique
fData = fData & WordFromInteger(Len(PlayerName))
fData = fData & cv_HexFromString(PlayerName)
End if
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
Examples how to use this:
Code:
Privat Sub YourButton_Click()
WriteUniqueComment False, 0, 2002 'Will result "Isyutaru has appeard in Karakoram"
'False = A Unique SPAWN,
'0 = No PlayerName needed on spawn ;-)
'2002 = MonsterID (Isyutaru)
End Sub
Code:
Privat Sub Your2ndButton_Click()
WriteUniqueComment True, TestName, 1954 'Will result "[TestName] killed [Tigergirl from Tigermountain]"
'True = A Unique KILL,
'TestName = PlayerName shown in the Message
'1954 = MonsterID (Tigergirl)
End Sub
If u use a REAL UniqueID like 2002 for Isy, the Client will add the information "[...from Katakoram]" automatically!!!.
If you write a "normal" ID like 1933 (Mangyang) the message will be "[<PlayerName>] killed [Mangyang]"