Descrição
Após dropar algum item, ele só será visivel para você e não para os outros jogadores, apenas depois de um certo tempo os outros jogadores poderão ver o item dropado.
Client~Side
modDirectDraw7
Procure por:
- Código:
' if it's not us then don't render
If MapItem(itemnum).playerName <> vbNullString Then
If MapItem(itemnum).playerName <> Trim$(GetPlayerName(MyIndex)) Then Exit Sub
End If
Apague
modHandleData
Procure por:
- Código:
.playerName = Buffer.ReadString
Apague
Procure por:
- Código:
.playerName = Buffer.ReadString
Apague
Server~Side
modDataBase
Mude a Sub ClearMapItem para:
- Código:
Sub ClearMapItem(ByVal index As Long, ByVal mapNum As Long)
Call ZeroMemory(ByVal VarPtr(MapItem(mapNum, index)), LenB(MapItem(mapNum, index)))
MapItem(mapNum, index).Num = 0
MapItem(mapNum, index).Value = 0
MapItem(mapNum, index).x = 0
MapItem(mapNum, index).y = 0
MapItem(mapNum, index).canDespawn = False
MapItem(mapNum, index).despawnTimer = 0
End Sub
modGameLogic
Procure por:
- Código:
MapItem(mapNum, i).playerName = playerName
MapItem(mapNum, i).playerTimer = GetTickCount + ITEM_SPAWN_TIME
Apague
modServerTcp
Procure por:
- Código:
Buffer.WriteString MapItem(mapNum, i).playerName
Apague
Procure por:
- Código:
Buffer.WriteString MapItem(mapNum, i).playerName
Apague
Procure por:
- Código:
Buffer.WriteString MapItem(mapNum, index).playerName
modServerLoop
Procure por:
- Código:
' items appearing to everyone
For i = 1 To MAX_MAP_ITEMS
If MapItem(mapNum, i).Num > 0 Then
If MapItem(mapNum, i).playerName <> vbNullString Then
' make item public?
If MapItem(mapNum, i).playerTimer < GetTickCount Then
' make it public
MapItem(mapNum, i).playerName = vbNullString
MapItem(mapNum, i).playerTimer = 0
' send updates to everyone
SendMapItemsToAll mapNum
End If
' despawn item?
If MapItem(mapNum, i).canDespawn Then
If MapItem(mapNum, i).despawnTimer < GetTickCount Then
' despawn it
ClearMapItem i, mapNum
' send updates to everyone
SendMapItemsToAll mapNum
End If
End If
End If
End If
Next
Mude para:
- Código:
' items appearing to everyone
For i = 1 To MAX_MAP_ITEMS
If MapItem(mapNum, i).Num > 0 Then
' despawn item?
If MapItem(mapNum, i).canDespawn Then
If MapItem(mapNum, i).despawnTimer < GetTickCount Then
' despawn it
ClearMapItem i, mapNum
' send updates to everyone
SendMapItemsToAll mapNum
End If
End If
End If
Next
modPlayer
Apague a Function CanPlayerPickupItem.
Procure por:
- Código:
MapItem(GetPlayerMap(index), i).playerName = Trim$(GetPlayerName(index))
MapItem(GetPlayerMap(index), i).playerTimer = GetTickCount + ITEM_SPAWN_TIME
Apague
Mude a Sub PlayerMapGetItem para:
- Código:
Sub PlayerMapGetItem(ByVal index As Long)
Dim i As Long
Dim n As Long
Dim mapNum As Long
Dim Msg As String
If Not IsPlaying(index) Then Exit Sub
mapNum = GetPlayerMap(index)
For i = 1 To MAX_MAP_ITEMS
' See if theres even an item here
If (MapItem(mapNum, i).Num > 0) And (MapItem(mapNum, i).Num <= MAX_ITEMS) Then
' Check if item is at the same location as the player
If (MapItem(mapNum, i).x = GetPlayerX(index)) Then
If (MapItem(mapNum, i).y = GetPlayerY(index)) Then
' Find open slot
n = FindOpenInvSlot(index, MapItem(mapNum, i).Num)
' Open slot available?
If n <> 0 Then
' Set item in players inventor
Call SetPlayerInvItemNum(index, n, MapItem(mapNum, i).Num)
If Item(GetPlayerInvItemNum(index, n)).Type = ITEM_TYPE_CURRENCY Then
Call SetPlayerInvItemValue(index, n, GetPlayerInvItemValue(index, n) + MapItem(mapNum, i).Value)
Msg = MapItem(mapNum, i).Value & " " & Trim$(Item(GetPlayerInvItemNum(index, n)).Name)
Else
Call SetPlayerInvItemValue(index, n, 0)
Msg = Trim$(Item(GetPlayerInvItemNum(index, n)).Name)
End If
' Erase item from the map
ClearMapItem i, mapNum
Call SendInventoryUpdate(index, n)
Call SpawnItemSlot(i, 0, 0, GetPlayerMap(index), 0, 0)
SendActionMsg GetPlayerMap(index), Msg, White, 1, (GetPlayerX(index) * 32), (GetPlayerY(index) * 32)
Call CheckTasks(index, QUEST_TYPE_GOGATHER, GetItemNum(Trim$(Item(GetPlayerInvItemNum(index, n)).Name)))
Exit For
Else
Call PlayerMsg(index, "Your inventory is full.", BrightRed)
Exit For
End If
End If
End If
End If
Next
End Sub
modTypes
Mude a Type MapItemRec para:
- Código:
Private Type MapItemRec
Num As Long
Value As Long
x As Byte
y As Byte
' despawn
canDespawn As Boolean
despawnTimer As Long
End Type
Créditos
Ricardo
Ricardo