Arena RPG Maker
Olá, visitante!
Seja bem-vindo ao fórum Arena RPG Maker, caso queira aprender sobre criação de jogos, está no fórum certo. Esperamos que possa aprender tanto quanto possa nos ensinar aqui.

Atenciosamente,
Equipe Arena RPG Maker.
Arena RPG Maker
Olá, visitante!
Seja bem-vindo ao fórum Arena RPG Maker, caso queira aprender sobre criação de jogos, está no fórum certo. Esperamos que possa aprender tanto quanto possa nos ensinar aqui.

Atenciosamente,
Equipe Arena RPG Maker.
Arena RPG Maker

Estamos de volta o/ ... Ou não.Eu amo a -Dark
Doações para o fórum abertas, clique aqui e saiba mais.
Últimos assuntos
» Ainda temos gente aqui?
itens - Correção - Drop de itens EmptyQui 25 Nov 2021, 14:04 por Halt

» [Dúvida] Como tirar a porcentagem de esquiva
itens - Correção - Drop de itens EmptySex 19 Nov 2021, 17:14 por Halt

» Pokémon Genesis Online! (PGO)
itens - Correção - Drop de itens EmptyQua 05 Jul 2017, 18:08 por Lexar

» Tileset Converter to MV
itens - Correção - Drop de itens EmptySex 12 maio 2017, 14:07 por Douggi

» Pack Resources, Sprites e etc
itens - Correção - Drop de itens EmptyQua 23 Dez 2015, 12:30 por raydengv

» Download RPG Maker 2003 + RTP em português
itens - Correção - Drop de itens EmptyTer 22 Dez 2015, 11:14 por ::KimMax::

» Fantasy Art Online
itens - Correção - Drop de itens EmptyDom 18 Out 2015, 18:42 por daviih123

» Você vai ter medo do Nerve gear?
itens - Correção - Drop de itens EmptySáb 25 Jul 2015, 17:02 por Kirito-kun

» O Barato é louco
itens - Correção - Drop de itens EmptySáb 27 Jun 2015, 16:26 por Halt

» Download RPG Maker 2000 + RTP em português
itens - Correção - Drop de itens EmptyQui 21 maio 2015, 20:28 por Wismael


Você não está conectado. Conecte-se ou registre-se

Ver o tópico anterior Ver o tópico seguinte Ir para baixo  Mensagem [Página 1 de 1]

1Tutorial Correção - Drop de itens Sex 04 Jan 2013, 14:15

Halt

Halt
Administrador
Administrador
Ricardo escreveu:
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

https://arenarpgmaker.forumeiros.com

Ver o tópico anterior Ver o tópico seguinte Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos