First thing, add this to the bottom of the "Public Enum ServerPackets":
Code:
SBloodSplatter
Now add this in modTypes:
Code:
Public TempTile() As TempTileRec
Type BloodRec
Active As Boolean
x As Long
y As Long
Pic As Long
Timer As Currency
End Type
Type TempMapRec
Blood(1 To 50) As BloodRec
End Type
Now under:
Code:
ReDim MapCache(1 To MAX_MAPS) As String
Add this:
Code:
ReDim TempTile(1 To MAX_MAPS) As TempTileRec
Find this:
Code:
Public Sub PlayerWarp(ByVal Index As Long, ByVal MapNum As Long, ByVal x As Long, ByVal y As Long)
Dim OldMap As Long
Dim LoopI As Long
' Check for subscript out of range
If Not IsPlaying(Index) Or MapNum <= 0 Or MapNum > MAX_MAPS Then Exit Sub
Add this under it:
Code:
'sending the blood splatter packet without any data will tell the client to clear
SendDataTo Index, SBloodSplatter & END_CHAR
For LoopI = 1 To UBound(TempMap(MapNum).Blood)
If TempMap(MapNum).Blood(LoopI).Active Then
With TempMap(MapNum).Blood(LoopI)
SendDataTo Index, SBloodSplatter & SEP_CHAR & LoopI & SEP_CHAR & .Active & SEP_CHAR & .x & SEP_CHAR & .y & SEP_CHAR & .Pic & END_CHAR
End With
End If
Next
Add this Random function to modGameLogic or whatever:
Code:
Function Random(Lowerbound As Integer, Upperbound As Integer) As Integer
Random = Int((Upperbound - Lowerbound + 1) * Rnd) + Lowerbound
End Function
Now add this Sub in modGameLogic or wherever:
Code:
Public Sub SendBlood(ByVal Map As Long, ByVal Target As Long, ByVal TargetType As Long)
Dim LoopI As Long
' 50% chance blood spawns
'If Random(1, 2) = 2 Then
For LoopI = 1 To UBound(TempMap(Map).Blood)
If Not TempMap(Map).Blood(LoopI).Active Then
With TempMap(Map).Blood(LoopI)
.Pic = Random(0, 5)
If TargetType = TARGET_TYPE_NPC Then
If Random(1, 2) = 1 Then
.x = (MapNpc(Map, Target).x * 32) + Random(0, 20)
Else
.x = (MapNpc(Map, Target).x * 32) - Random(0, 20)
End If
If Random(1, 2) = 2 Then
.y = (MapNpc(Map, Target).y * 32) + Random(0, 20)
Else
.y = (MapNpc(Map, Target).y * 32) - Random(0, 20)
End If
ElseIf TargetType = TARGET_TYPE_PLAYER Then
If IsPlaying(Target) Then
If Random(1, 2) = 1 Then
.x = (GetPlayerX(Target) * 32) + Random(0, 20)
Else
.x = (GetPlayerX(Target) * 32) - Random(0, 20)
End If
If Random(1, 2) = 2 Then
.y = (GetPlayerY(Target) * 32) + Random(0, 20)
Else
.y = (GetPlayerY(Target) * 32) - Random(0, 20)
End If
End If
End If
.Timer = GetTickCountNew + 30000
.Active = True
SendDataToMap Map, SBloodSplatter & SEP_CHAR & LoopI & SEP_CHAR & .Active & SEP_CHAR & .x & SEP_CHAR & .y & SEP_CHAR & .Pic & END_CHAR
End With
Exit For
End If
Next
'End If
End Sub
Now find this in Sub AttackNpc:
Code:
' Check for weapon
n = 0
If GetPlayerEquipmentSlot(Attacker, Weapon) > 0 Then
n = GetPlayerInvItemNum(Attacker, GetPlayerEquipmentSlot(Attacker, Weapon))
End If
Under add this:
Code:
SendBlood GetPlayerMap(Attacker), MapNpcNum, TARGET_TYPE_NPC
Find this in Sub AttackPlayer:
Code:
' reduce dur. on victims equipment
Call DamageEquipment(Victim, Armor)
Call DamageEquipment(Victim, Helmet)
Under add:
Code:
SendBlood GetPlayerMap(Victim), Victim, TARGET_TYPE_PLAYER
Find:
Code:
Do While ServerOnline
Tick = GetTickCountNew
Under add:
Code:
For x = 1 To MAX_MAPS
For y = 1 To UBound(TempMap(x).Blood)
If TempMap(x).Blood(y).Active Then
With TempMap(x).Blood(y)
If .Timer < GetTickCountNew Then
.Pic = 0
.x = 0
.y = 0
.Active = False
SendDataToMap x, SBloodSplatter & SEP_CHAR & y & SEP_CHAR & .Active & SEP_CHAR & .x & SEP_CHAR & .y & SEP_CHAR & .Pic & END_CHAR
End If
End With
End If
Next
Next