[EO3.0]Aprimoramento de Equipamentos Hitskin_logo Hitskin.com

Isto é uma pré-visualização de um tema em Hitskin.com
Instalar o temaVoltar para a ficha do tema

Aldeia RPG
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

[EO3.0]Aprimoramento de Equipamentos

+2
Profane ~
Dooolly
6 participantes

Página 1 de 2 1, 2  Seguinte

Ir para baixo

[EO3.0]Aprimoramento de Equipamentos Empty [EO3.0]Aprimoramento de Equipamentos

Mensagem por Dooolly Qua Nov 15, 2017 10:16 pm


TUTORIAL NÃO ESTÁ 100%, PRECISO QUE TESTEM PARA VER SE ESQUECI ALGO, É UM TUTORIAL EXTENSO, JÁ FUNCIONA, PORÉM FALTA ALGUNS SIMPLES DETALHES, PRECISO QUE TESTEM!


APRIMORAMENTO DE EQUIPAMENTOS

Descrição:
Como em muitos dos grandes MMO que conheço, os equipamentos possuem um tipo de aprimoramento, isso permite que o jogo se mantenha com constantes objetivos, já que alcançar o nível máximo de aprimoramento leva um pouco de tempo. O sistema funciona da seguinte forma, haverá um NPC em que ao interagir com o jogador, uma janela será aberta com um sequência de slots para por os itens do sistema, nesses slots serão colocador o equipamento a ser aprimorado, o item de aprimoramento, e alguns itens que aumentem a chance do aprimoramento(Esses são opcionais), ao confirmar o servidor irá processar e tentar aprimorar o item. Não determinei muito bem o que os aprimoramentos ajudariam, não nesse tutorial, vou fazer isso com a ajuda de vocês, como por exemplo em meu projeto, na arma eu aumentei a chance de critico a cada level de aprimoramento. Mas isso vai de projeto em projeto, então vamos ao tutorial.

_______________________________________________________

Server~Side | Client~Side
Aqui ficarão as modificações que será feitas tando no cliente como no servidor!

Primeiro iremos alterar a estrutura dos itens em relação ao jogador, para isso vamos alterar a estrutura do inventário do jogador.
Em modTypes, procurem por Public Type PlayerInvRec
Irá encontrar algo parecido com isso:

Código:
Public Type PlayerInvRec
    Num As Long
    Value As Long
End Type


Então, antes de End Type, iremos adicionar:

Código:
Combine As Byte


Também iremos alterar a estrutura dos equipamentos que o jogador utiliza, porém ela só recebe tipo Long, então vamos criar um novo tipo para os equipamentos.
Ainda em modTypes, acima de Private Type PlayerRec adicione:

Código:
Private Type EquipmentRec
    ItemNum As Long
    Combine As Byte
End Type


Esse será a nova estrutura dos equipamentos, então precisamos informar isso ao jogador!
Dentro de Private Type PlayerRec, procure por:

Código:
Equipment(1 To Equipment.Equipment_Count - 1) As Long


Altere para:

Código:
Equipment(1 To Equipment.Equipment_Count - 1) As EquipmentRec

Agora o jogador entenderá que não terá apenas o identificado do item, mas também seu nível de aprimoramento!

Agora iremos alterar e adicionar algumas funções básicas do interagem com essas estruturas.
Em modPlayer, vamos procurar por Function GetPlayerEquipment, e alterar toda essa função por:

Código:
Function GetPlayerEquipment(ByVal Index As Long, ByVal EquipmentSlot As Equipment) As Long
    ' Verificar se o indice do jogador está dentro dos limites
    If Index <= 0 Or Index > MAX_PLAYERS Then Exit Function
    
    ' Verificar se o slot do equipamento não é nulo ou ultrapassa os limites
    If EquipmentSlot <= 0 Or EquipmentSlot >= Equipment_Count Then Exit Function
    
    ' Retornar o identificador do equipamento
    GetPlayerEquipment = Player(Index).Equipment(EquipmentSlot).ItemNum
End Function


Ainda em modPlayer, vamo alterar a Sub SetPlayerEquipment por:

Código:
Sub SetPlayerEquipment(ByVal Index As Long, ByVal invNum As Long, ByVal EquipmentSlot As Equipment)
    ' Definir o equipamento no slot determinado
    Player(Index).Equipment(EquipmentSlot).ItemNum = invNum
End Sub


Pronto, agora todas as estruturas estão compatíveis com as funções.

Agora vamos mexer em algo que merece total atenção, iremos adicionar os pacotes que serão transferidos de durante a conexão. Então cuidado!

Em modEnumerations, vamos procurar por:

Código:
' Make sure SMSG_COUNT is below everything else
    SMSG_COUNT


Acima disso, iremos adicionar o seguinte:

Código:
' Pacote de aprimoramento
    SSendBlacksmith


Ainda emmodEnumerations, vamos procurar por:

Código:
' Make sure CMSG_COUNT is below everything else
    CMSG_COUNT


Acima disso, iremos adicionar o seguinte:

Código:
' Pacote de aprimoramento
    CRequestBlacksmith
    CSendCombine


Em modConstants, procure por:

Código:
Public Const TILE_TYPE_SLIDE As Byte = 14


Abaixo adicione:

Código:
Public Const TILE_TYPE_BLACKSMITH As Byte = 15


Ainda em modConstants, procure por:

Código:
Public Const ITEM_TYPE_SPELL As Byte = 8


Abaixo adicione:

Código:
Public Const ITEM_TYPE_PRECIOUS As Byte = 9
Public Const ITEM_TYPE_STONE As Byte = 10


* NÃO ESQUEÇA DE QUE TODAS ESSAS ETAPAS ANTERIORES DEVERÃO SER FEITAS TANTO NO CLIENTE COMO NO SERVIDOR!

_______________________________________________________

Server~Side
Agora iremos trabalhar apenas no servidor.

Precisamos adicionar algumas coisas temporárias a estrutura do jogador, onde serão armazenados os itens da janela de aprimoramento aberta.
Então em modTypes, procure por Public Type TempPlayerRec, dentro adicione:

Código:
' Blacksmith
    BS_Item As PlayerInvRec
    BS_Precious As Long
    BS_Stone1 As Long
    BS_Stone2 As Long
    BS_Stone3 As Long
    BS_Percent As Byte


Em modConstants, no final do modulo adicione:

Código:
Public Const MAX_ITEM_LEVEL As Byte = 10


Iremos adicionar as funções que serão ativadas pelo cliente.
Em modHandleData, procure por Public Sub InitMessages() e não final do método adicione o seguinte:

Código:
' Sistema de Craft
    HandleDataSub(CRequestBlacksmith) = GetAddress(AddressOf HandleRequestBlacksmith)
    HandleDataSub(CSendCombine) = GetAddress(AddressOf HandleRequestCombine)


Adicionamos os tópicos ao servidor, agora iremos adicionar seus métodos.
Ainda em modHandleData, no final do modulo adicione:

Código:
' +======================================+
' +====== By: Dooolly ===================+
Sub HandleRequestBlacksmith(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    Dim Buffer As clsBuffer
    
    Set Buffer = New clsBuffer
    Buffer.WriteBytes Data()
    
    TempPlayer(Index).BS_Item.Num = Buffer.ReadLong
    TempPlayer(Index).BS_Item.Combine = Buffer.ReadByte
    TempPlayer(Index).BS_Precious = Buffer.ReadLong
    TempPlayer(Index).BS_Stone1 = Buffer.ReadLong
    TempPlayer(Index).BS_Stone2 = Buffer.ReadLong
    TempPlayer(Index).BS_Stone3 = Buffer.ReadLong
    
    Set Buffer = Nothing
    
    With TempPlayer(Index)
        ' Checar se o item já tá no ultimo nivel
        If .BS_Item.Combine >= MAX_ITEM_LEVEL Then
           PlayerMsg Index, "Esse item já está no nivel máximo.", BrightRed
           .BS_Item.Num = 0
           .BS_Item.Combine = 0
        End If
        
        ' Item a ser Aperfeiçoado
        If .BS_Item.Num > 0 Then
           Select Case Item(.BS_Item.Num).Type
              Case ITEM_TYPE_WEAPON, ITEM_TYPE_ARMOR, ITEM_TYPE_HELMET, ITEM_TYPE_SHIELD
                 ' Deixa em branco
              Case Else
                 PlayerMsg Index, "Esse item não pode ser aperfeiçoado.", BrightRed
                 .BS_Item.Num = 0
                 .BS_Item.Combine = 0
           End Select
        End If
        
        ' Item de Aperfeiçoamento
        If .BS_Precious > 0 Then
           If Item(.BS_Precious).Type <> ITEM_TYPE_PRECIOUS Then
              PlayerMsg Index, "Apenas itens de aperfeiçoamento.", BrightRed
              .BS_Precious = 0
           End If
        End If
        
        ' Item de Aperfeiçoamento
        If .BS_Stone1 > 0 Then
           If Item(.BS_Stone1).Type <> ITEM_TYPE_STONE Then
              PlayerMsg Index, "Apenas pedras preciosas.", BrightRed
              .BS_Stone1 = 0
           End If
        End If
        
        ' Item de Aperfeiçoamento
        If .BS_Stone2 > 0 Then
           If Item(.BS_Stone2).Type <> ITEM_TYPE_STONE Then
              PlayerMsg Index, "Apenas pedras preciosas.", BrightRed
              .BS_Stone2 = 0
           End If
        End If
        
        ' Item de Aperfeiçoamento
        If .BS_Stone3 > 0 Then
           If Item(.BS_Stone3).Type <> ITEM_TYPE_STONE Then
              PlayerMsg Index, "Apenas pedras preciosas.", BrightRed
              .BS_Stone3 = 0
           End If
        End If
        
        Call SendBlacksmith(Index, .BS_Item.Num, .BS_Item.Combine, .BS_Precious, .BS_Stone1, .BS_Stone2, .BS_Stone3)
    End With
End Sub

' +======================================+
' +====== By: Dooolly ===================+
Sub HandleRequestCombine(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    Dim Result As Byte
    Dim tmpPercent As Byte
    Dim i As Long
    
    If TempPlayer(Index).BS_Item.Num > 0 Then
        If TempPlayer(Index).BS_Precious > 0 Then
            tmpPercent = 100 / TempPlayer(Index).BS_Percent
            Result = rand(1, tmpPercent)
            
            If Result = 1 Then
               For i = 1 To MAX_INV
                   If GetPlayerInvItemNum(Index, i) = TempPlayer(Index).BS_Item.Num Then
                      If GetPlayerInvItemCombine(Index, i) = TempPlayer(Index).BS_Item.Combine Then
                         SetPlayerInvItemCombine Index, i, GetPlayerInvItemCombine(Index, i) + 1
                         Call SendInventory(Index)
                         Result = GetPlayerInvItemCombine(Index, i)

                         If Result > 6 Then
                             GlobalMsg "[RUMORES]: " & GetPlayerName(Index) & " acabou de aprimorar " & Trim(CheckGrammar(Item(TempPlayer(Index).BS_Item.Num).Name)) & " para +" & Result, BrightRed
                         End If
              
                         PlayerMsg Index, "Aprimoramento feito com sucesso!", Orange
                         AddLog GetPlayerName(Index) & " combinou o item " & Item(TempPlayer(Index).BS_Item.Num).Name & "(" & TempPlayer(Index).BS_Item.Num & ") para +" & Result, GetPlayerName(Index) & ".log"
                         TakeInvItem Index, TempPlayer(Index).BS_Precious, 0

                         If TempPlayer(Index).BS_Stone1 > 0 Then TakeInvItem Index, TempPlayer(Index).BS_Stone1, 0
                         If TempPlayer(Index).BS_Stone2 > 0 Then TakeInvItem Index, TempPlayer(Index).BS_Stone2, 0
                         If TempPlayer(Index).BS_Stone3 > 0 Then TakeInvItem Index, TempPlayer(Index).BS_Stone3, 0
                        
                         If Result = 10 Then
                            TempPlayer(Index).BS_Item.Num = 0
                            TempPlayer(Index).BS_Item.Combine = 0
                         Else
                            TempPlayer(Index).BS_Item.Combine = Result
                         End If
                         TempPlayer(Index).BS_Precious = 0
                         TempPlayer(Index).BS_Stone1 = 0
                         TempPlayer(Index).BS_Stone2 = 0
                         TempPlayer(Index).BS_Stone3 = 0
                         TempPlayer(Index).BS_Item.Value = 0
                         SendBlacksmith Index, TempPlayer(Index).BS_Item.Num, Result, 0, 0, 0, 0
                      End If
                   End If
               Next
            Else
               AddLog GetPlayerName(Index) & " tentou combinar o item " & Item(TempPlayer(Index).BS_Item.Num).Name & "(" & TempPlayer(Index).BS_Item.Num & ") para +" & TempPlayer(Index).BS_Item.Combine + 1, GetPlayerName(Index) & ".log"
               PlayerMsg Index, "Falha ao tentar aprimorar item!", BrightRed
               TakeInvItem Index, TempPlayer(Index).BS_Precious, 0
              
               If TempPlayer(Index).BS_Stone1 > 0 Then TakeInvItem Index, TempPlayer(Index).BS_Stone1, 0
               If TempPlayer(Index).BS_Stone2 > 0 Then TakeInvItem Index, TempPlayer(Index).BS_Stone2, 0
               If TempPlayer(Index).BS_Stone3 > 0 Then TakeInvItem Index, TempPlayer(Index).BS_Stone3, 0
              
               TempPlayer(Index).BS_Precious = 0
               TempPlayer(Index).BS_Stone1 = 0
               TempPlayer(Index).BS_Stone2 = 0
               TempPlayer(Index).BS_Stone3 = 0
               TempPlayer(Index).BS_Item.Value = TempPlayer(Index).BS_Item.Value + 1
               SendBlacksmith Index, TempPlayer(Index).BS_Item.Num, TempPlayer(Index).BS_Item.Combine, 0, 0, 0, 0
            End If
        Else
            PlayerMsg Index, "Necessário de um item precioso para aprimorar.", BrightRed
        End If
    Else
       PlayerMsg Index, "Necessário adicionar o item que deseja aprimorar.", BrightRed
    End If
End Sub


Agora iremos adicionar os métodos que o servidor irá enviar ao cliente.
Em modServerTCP, no final do modulo adicione:

Código:
' +======================================+
' +====== By: Dooolly ===================+
Sub SendBlacksmith(ByVal Index As Long, iNum As Long, iCom As Byte, iPrecious As Long, Stone1 As Long, Stone2 As Long, Stone3 As Long)
    Dim Buffer As clsBuffer

    Set Buffer = New clsBuffer
    Buffer.WriteLong SSendBlacksmith
    
    Buffer.WriteLong iNum
    Buffer.WriteByte iCom
    Buffer.WriteLong iPrecious
    Buffer.WriteLong Stone1
    Buffer.WriteLong Stone2
    Buffer.WriteLong Stone3
        
    With TempPlayer(Index)
        Select Case iCom
           Case 0
            .BS_Percent = 100
           Case 1
            .BS_Percent = 90 + .BS_Item.Value
           Case 2
            .BS_Percent = 80 + .BS_Item.Value
           Case 3
            .BS_Percent = 70 + .BS_Item.Value
           Case 4
            .BS_Percent = 50 + .BS_Item.Value
           Case 5
            .BS_Percent = 30 + .BS_Item.Value
           Case 6
            .BS_Percent = 15 + .BS_Item.Value
           Case 7
            .BS_Percent = 10 + .BS_Item.Value
           Case 8
            .BS_Percent = 5 + .BS_Item.Value
           Case 9
            .BS_Percent = 1 + .BS_Item.Value
        End Select
        
        If .BS_Stone1 > 0 Then
          .BS_Percent = .BS_Percent + Item(Stone1).Data1
        End If
        
        If .BS_Stone2 > 0 Then
          .BS_Percent = .BS_Percent + Item(Stone2).Data1
        End If
        
        If .BS_Stone3 > 0 Then
          .BS_Percent = .BS_Percent + Item(Stone3).Data1
        End If
        
        If .BS_Percent > 100 Then .BS_Percent = 100
        If .BS_Percent < 1 Then .BS_Percent = 1
        
        Buffer.WriteByte .BS_Percent
    End With
    
    SendDataTo Index, Buffer.ToArray()
    Set Buffer = Nothing
End Sub


Em modPlayer, procure por Sub PlayerMove, onde tem:

Código:
' Slide
        If .Type = TILE_TYPE_SLIDE Then
            ForcePlayerMove Index, MOVING_WALKING, GetPlayerDir(Index)
            Moved = YES
        End If


Abaixo adicione:

Código:
' Enviar blacksmith
        If .Type = TILE_TYPE_BLACKSMITH Then
            Call SendBlacksmith(Index, 0, 0, 0, 0, 0, 0)
            Moved = YES
        End If


Em modPlayer, procure por Public Function GetPlayerStat, altere toda função por:

Código:
Public Function GetPlayerStat(ByVal Index As Long, ByVal stat As Stats) As Long
    Dim x As Long, i As Long
    If Index > MAX_PLAYERS Then Exit Function
    
    x = Player(Index).stat(stat)
    
    For i = 1 To Equipment.Equipment_Count - 1
        If GetPlayerEquipment(Index, i) > 0 Then
            If Item(GetPlayerEquipment(Index, i)).Add_Stat(stat) > 0 Then
                x = x + Item(GetPlayerEquipment(Index, i)).Add_Stat(stat)
            End If
        End If
    Next
    
    GetPlayerStat = x
End Function


Agora no final de modPlayer, iremos adicionar o seguinte:


Código:
' +======================================+
' +====== By: Dooolly ===================+
Function GetPlayerEquipmentCombine(ByVal Index As Long, ByVal EquipmentSlot As Equipment) As Byte
    ' Verificar se o indice do jogador está dentro dos limites
    If Index > MAX_PLAYERS Then Exit Function
    
    ' Verificar se o slot do equipamento não é nulo ou ultrapassa os limites
    If EquipmentSlot = 0 Then Exit Function
    
    ' Retornar o nivel de aprimoramento do equipamento
    GetPlayerEquipmentCombine = Player(Index).Equipment(EquipmentSlot).Combine
End Function

' +======================================+
' +====== By: Dooolly ===================+
Sub SetPlayerEquipmentCombine(ByVal Index As Long, ByVal levelNum As Byte, ByVal EquipmentSlot As Equipment)
    ' Definir o equipamento no slot determinado
    Player(Index).Equipment(EquipmentSlot).Combine = levelNum
End Sub

' +======================================+
' +====== By: Dooolly ===================+
Function GetPlayerInvItemCombine(ByVal Index As Long, ByVal invSlot As Long) As Byte
    ' Verificar se o indice do jogador está dentro dos limites
    If Index <= 0 Or Index > MAX_PLAYERS Then Exit Function
    
    ' Verificar se o slot do equipamento não é nulo ou ultrapassa os limites
    If invSlot <= 0 Or invSlot >= MAX_INV Then Exit Function
    
    ' Retornar o nivel de aprimoramento do item
    GetPlayerInvItemCombine = Player(Index).Inv(invSlot).Combine
End Function

' +======================================+
' +====== By: Dooolly ===================+
Sub SetPlayerInvItemCombine(ByVal Index As Long, ByVal invSlot As Long, ByVal ItemCombine As Long)
    ' Definir o nivel de aprimoramento do item no inventário
    Player(Index).Inv(invSlot).Combine = ItemCombine
End Sub

Em modServerTCP, procure por Sub SendInventory, onde tem:

Código:
Buffer.WriteLong GetPlayerInvItemValue(Index, i)


Abaixo adicione:

Código:
Buffer.WriteByte GetPlayerInvItemCombine(Index, i)


Ainda em modServerTCP, procure por Sub SendInventoryUpdate, onde tem:

Código:
Buffer.WriteLong GetPlayerInvItemValue(Index, invSlot)


Abaixo adicione:

Código:
Buffer.WriteByte GetPlayerInvItemCombine(Index, invSlot)


* SERVIDOR ESTÁ PRONTO, NÃO ESQUEÇA DE APAGAR TODAS AS CONTAS ANTES DE INICIAR O SERVIDOR

_______________________________________________________

Client~Side
Agora iremos trabalhar somente no cliente!

Vamos adicionar primeiro um Option na frmEditor_Map
Option - Propriedades
Name: optBlacksmith
Caption: Blacksmith

[EO3.0]Aprimoramento de Equipamentos Untitl11

Agora em modGameEditors, procure por Public Sub MapEditorMouseDown, e onde estiver:

Código:
' slide
                If frmEditor_Map.optSlide.Value Then
                    .Type = TILE_TYPE_SLIDE
                    .Data1 = MapEditorSlideDir
                    .Data2 = 0
                    .Data3 = 0
                End If


Abaixo adicione:

Código:
' blacksmith
                If frmEditor_Map.optBlacksmith.Value Then
                    .Type = TILE_TYPE_BLACKSMITH
                    .Data1 = 0
                    .Data2 = 0
                    .Data3 = 0
                End If


Em modText, procure por Public Function BltMapAttributes, e onde tem:

Código:
Case TILE_TYPE_SLIDE
                                RenderText Font_Default, "S", tx, ty, BrightCyan, 0


Logo abaixo adicione:

Código:
Case TILE_TYPE_BLACKSMITH
                                RenderText Font_Default, "BS", tx, ty, BrightCyan


Iremos adicionar novos tipos de itens a lista do editor.
Em frmEditor_Map, na cmbType, na propriedade List adicione:
Precious
Stone


Dê um duplo clique em cmbType, e adicione o seguinte:

Código:
If (cmbType.ListIndex = ITEM_TYPE_STONE) Then
        fraStone.Visible = True
    Else
        fraStone.Visible = False
    End If


Ainda em frmEditor_Map, adicione uma Frame
Frame - Propriedades
Name: fraStone
Caption: Pedra de Porcentagem
Visible: False

Dentro do fraStone, adicione uma Scroll:
Scroll - Propriedades
Name: scrlPercent
Min: 1
Max: 100

Dê um duplo clique na scrlPercent, e adicione:

Código:
' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    lblPercent.Caption = scrlPercent.Value & "%"
    Item(EditorIndex).Data1 = scrlPercent.Value
    
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "scrlPercent_Change", "frmEditor_Item", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub


Ainda dentro do fraStone, adicione uma Label
Label - Propriedades
Name: lblPercent
Caption: 0%

Agora iremos criar os objetos na frmMain!

Crie uma Picture Box em qualquer lugar, pode dá um duplo clique na ferramenta que elá será adicionada.
Picture - Propriedades
Name: picBlacksmith
Appearance: 0 - Flat
BorderStyle: 0 - None
Width: 304
Height: 255
Left: 95
Top: 95
Visible: false

Dentro dessa Picture Box adicione uma Label:
Label - Propriedades
Name: lblPrice
Caption: 0g
BackStyle: 0 - Transparent
Top: 2120
Left: 1970
Width: 620
Height: 220
Alingment: 2 - Center
ForeColor: &H00FFFFFF&

Dentro dessa Picture Box adicione outra Label:
Label - Propriedades
Name: lblNextPlus
Caption: Estado atual é +0
BackStyle: 0 - Transparent
Top: 3100
Left: 1130
Width: 2305
Height: 255
Alingment: 2 - Center
ForeColor: &H00FFFFFF&

Dentro dessa Picture Box adicione outra Label:
Label - Propriedades
Name: lblNextPorcent
Caption: 100% para +1
BackStyle: 0 - Transparent
Top: 3400
Left: 1130
Width: 2305
Height: 255
Alingment: 2 - Center
ForeColor: &H00FFFFFF&

Agora iremos adicionar o botão.
Dentro dessa Picture Box adicione uma Image:
Image - Propriedades
Name: imgPlus
Top: 1015
Left: 1590
Width: 1375
Height: 390

Deve ficar algo parecido com isto:
[EO3.0]Aprimoramento de Equipamentos Untitl10

Salve esse imagem na pasta do jogo, em data files\graphics\gui\main, e salve com o nome blacksmith:
[EO3.0]Aprimoramento de Equipamentos Blacks10

Agora dê um duplo clique na imgPlus, e adicione:

Código:
' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    Call SendCombine
    
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "imgPlus_Click", "frmMain", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub


Pronto, agora em modClientTCP, no final do modulo adicione:

Código:
Sub SendBlacksmithData()
    Dim Buffer As clsBuffer

    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler
    
    Set Buffer = New clsBuffer
    Buffer.WriteLong CRequestBlacksmith
    Buffer.WriteLong BS_Item.Num
    Buffer.WriteByte BS_Item.Combine
    Buffer.WriteLong BS_Precious
    Buffer.WriteLong BS_Stone1
    Buffer.WriteLong BS_Stone2
    Buffer.WriteLong BS_Stone3
    SendData Buffer.ToArray()
    Set Buffer = Nothing

    ' Error handler
    Exit Sub
errorhandler:
    HandleError "SendBlacksmithData", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub

Sub SendCombine()
    Dim Buffer As clsBuffer

    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler
    
    If BS_Item.Num > 0 Then
        If BS_Precious > 0 Then
            Set Buffer = New clsBuffer
            Buffer.WriteLong CSendCombine

            SendData Buffer.ToArray()
            Set Buffer = Nothing
        Else
            AddText "Necessário de um item precioso para aprimorar.", BrightRed
        End If
    Else
       AddText "Necessário adicionar o item que deseja aprimorar.", BrightRed
    End If
    
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "SendCombine", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub


Agora no final de modDatabase, iremos adicionar o seguinte:


Código:
' +======================================+
' +====== By: Dooolly ===================+
Function GetPlayerEquipmentCombine(ByVal Index As Long, ByVal EquipmentSlot As Equipment) As Byte
    ' Verificar se o indice do jogador está dentro dos limites
    If Index > MAX_PLAYERS Then Exit Function
    
    ' Verificar se o slot do equipamento não é nulo ou ultrapassa os limites
    If EquipmentSlot = 0 Then Exit Function
    
    ' Retornar o nivel de aprimoramento do equipamento
    GetPlayerEquipmentCombine = Player(Index).Equipment(EquipmentSlot).Combine
End Function

' +======================================+
' +====== By: Dooolly ===================+
Sub SetPlayerEquipmentCombine(ByVal Index As Long, ByVal levelNum As Byte, ByVal EquipmentSlot As Equipment)
    ' Definir o equipamento no slot determinado
    Player(Index).Equipment(EquipmentSlot).Combine = levelNum
End Sub

' +======================================+
' +====== By: Dooolly ===================+
Function GetPlayerInvItemCombine(ByVal Index As Long, ByVal invSlot As Long) As Byte
    ' Verificar se o indice do jogador está dentro dos limites
    If Index <= 0 Or Index > MAX_PLAYERS Then Exit Function
    
    ' Verificar se o slot do equipamento não é nulo ou ultrapassa os limites
    If invSlot <= 0 Or invSlot >= MAX_INV Then Exit Function
    
    ' Retornar o nivel de aprimoramento do item
    GetPlayerInvItemCombine = PlayerInv(invSlot).Combine
End Function

' +======================================+
' +====== By: Dooolly ===================+
Sub SetPlayerInvItemCombine(ByVal Index As Long, ByVal invSlot As Long, ByVal ItemCombine As Long)
    ' Definir o nivel de aprimoramento do item no inventário
    PlayerInv(invSlot).Combine = ItemCombine
End Sub



Em modClienteTCP, procure por Sub SendSpawnItem, altere para:

Código:
Sub SendSpawnItem(ByVal tmpItem As Long, ByVal tmpAmount As Long, ByVal tmpCombine As Byte)
Dim Buffer As clsBuffer

    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler
    
    Set Buffer = New clsBuffer
    Buffer.WriteLong CSpawnItem
    Buffer.WriteLong tmpItem
    Buffer.WriteLong tmpAmount
    Buffer.WriteByte tmpCombine
    SendData Buffer.ToArray()
    Set Buffer = Nothing
    
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "SendSpawnItem", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub


Procure por Private Sub cmdASpawn_Click(), e altere para:

Código:
Private Sub cmdASpawn_Click()
    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    If GetPlayerAccess(MyIndex) < ADMIN_CREATOR Then
        
        Exit Sub
    End If
    
    SendSpawnItem scrlAItem.Value, scrlAAmount.Value, 0
    
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "cmdASpawn_Click", "frmAdmin", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub


Em modHandleData, procure por Sub HandlePlayerInv, onde tem:

Código:
Call SetPlayerInvItemValue(MyIndex, i, Buffer.ReadLong)


Abaixo adicione:

Código:
Call SetPlayerInvItemCombine(MyIndex, i, Buffer.ReadByte)


Ainda em modHandleData, procure por Sub HandlePlayerInvUpdate, onde tem:

Código:
Call SetPlayerInvItemValue(MyIndex, N, Buffer.ReadLong)


Abaixo adicione:

Código:
Call SetPlayerInvItemCombine(MyIndex, N, Buffer.ReadByte)


Agora em modGlobals, no final do modulo adicione:

Código:
' Blacksmith
Public BS_Item As PlayerInvRec
Public BS_Precious As Long
Public BS_Stone1 As Long
Public BS_Stone2 As Long
Public BS_Stone3 As Long
public InBlacksmith as Boolean


Em modGameLogic, procure por Function CanMove() As Boolean, e abaixo de:

Código:
' not in bank
    If InBank Then
        InBank = False
        frmMain.picBank.Visible = False
    End If


Adicione:

Código:
If frmMain.picBlacksmith.Visible Then
        InBlacksmith = False
        frmMain.picCover.Visible = False
        frmMain.picBlacksmith.Visible = False
    End If


Em frmMain, procure por Private Sub picInventory_DblClick() encontre:

Código:
' in bank?
        If InBank Then
            If Item(GetPlayerInvItemNum(MyIndex, invNum)).Type = ITEM_TYPE_CURRENCY Then
                CurrencyMenu = 2 ' deposit
                lblCurrency.Caption = "How many do you want to deposit?"
                tmpCurrencyItem = invNum
                txtCurrency.text = vbNullString
                picCurrency.Visible = True
                txtCurrency.SetFocus
                Exit Sub
            End If
                
            Call DepositItem(invNum, 0)
            Exit Sub
        End If


Acima adicione:

Código:
' in blacksmith?
        If InBlacksmith Then
            If Item(GetPlayerInvItemNum(MyIndex, invNum)).Type = ITEM_TYPE_STONE Then
                If (BS_Stone1 <= 0) Then
                    BS_Stone1 = GetPlayerInvItemNum(MyIndex, invNum)
                    Call SendBlacksmithData
                    Exit Sub
                End If
                
                If (BS_Stone2 <= 0) Then
                    BS_Stone2 = GetPlayerInvItemNum(MyIndex, invNum)
                    Call SendBlacksmithData
                    Exit Sub
                End If
                
                If (BS_Stone3 <= 0) Then
                    BS_Stone3 = GetPlayerInvItemNum(MyIndex, invNum)
                    Call SendBlacksmithData
                    Exit Sub
                End If
                
                ' sair da função
                Exit Sub
            End If
            
            If Item(GetPlayerInvItemNum(MyIndex, invNum)).Type = ITEM_TYPE_PRECIOUS Then
                If (BS_Precious <= 0) Then
                    BS_Precious = GetPlayerInvItemNum(MyIndex, invNum)
                    Call SendBlacksmithData
                    Exit Sub
                End If
                
                ' sair da função
                Exit Sub
            End If
            
            If Item(GetPlayerInvItemNum(MyIndex, invNum)).Type >= ITEM_TYPE_WEAPON And Item(GetPlayerInvItemNum(MyIndex, invNum)).Type <= ITEM_TYPE_SHIELD Then
                If (BS_Item.Num <= 0) Then
                    BS_Item.Num = GetPlayerInvItemNum(MyIndex, invNum)
                    BS_Item.Combine = GetPlayerInvItemCombine(MyIndex, invNum)
                    Call SendBlacksmithData
                    Exit Sub
                End If
                
                ' sair da função
                Exit Sub
            End If
        End If


Ainda em frmMain, procure por Private Sub picInventory_MouseDown, onde tem:

Código:
If InBank Or InShop Then Exit Sub


Altere para:

Código:
If InBank Or InShop Or InBlacksmith Then Exit Sub


Em modGeneral, procure por Public Sub loadGUI, onde tem:

Código:
frmMain.picHotbar.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\hotbar.jpg")


Abaixo adicione:

Código:
frmMain.picBlacksmith.Picture = LoadPicture(App.Path & "\data files\graphics\gui\main\blacksmith.jpg")


Em modGraphics, no final do modulo adicione:

Código:
Sub DrawBlacksmith()
Dim Rec As RECT, Rec_Pos As RECT, srcRect As D3DRECT, destRect As D3DRECT

    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    If BS_Item.Num > 0 Then
       With srcRect
           .x1 = 136
           .x2 = 32 + .x1
           .y1 = 103
           .y2 = 32 + .y1
       End With
    
       Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(219, 240, 255, 255), 1#, 0
       Direct3D_Device.BeginScene
    
       RenderTexture Tex_Item(Item(BS_Item.Num).Pic), 136, 103, 0, 0, 32, 32, 32, 32
    
       Direct3D_Device.EndScene
       Direct3D_Device.Present srcRect, srcRect, frmMain.picBlacksmith.hwnd, ByVal (0)
    End If
    
    If BS_Precious > 0 Then
       With srcRect
           .x1 = 136
           .x2 = 32 + .x1
           .y1 = 30
           .y2 = 32 + .y1
       End With
    
       Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(219, 240, 255, 255), 1#, 0
       Direct3D_Device.BeginScene
    
       RenderTexture Tex_Item(Item(BS_Precious).Pic), 136, 30, 0, 0, 32, 32, 32, 32
    
       Direct3D_Device.EndScene
       Direct3D_Device.Present srcRect, srcRect, frmMain.picBlacksmith.hwnd, ByVal (0)
    End If
    
    If BS_Stone1 > 0 Then
       With srcRect
           .x1 = 75
           .x2 = 32 + .x1
           .y1 = 103
           .y2 = 32 + .y1
       End With
    
       Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(219, 240, 255, 255), 1#, 0
       Direct3D_Device.BeginScene
    
       If BS_Stone1 > 0 Then RenderTexture Tex_Item(Item(BS_Stone1).Pic), 75, 103, 0, 0, 32, 32, 32, 32
    
       Direct3D_Device.EndScene
       Direct3D_Device.Present srcRect, srcRect, frmMain.picBlacksmith.hwnd, ByVal (0)
    End If
    
    If BS_Stone2 > 0 Then
       With srcRect
           .x1 = 197
           .x2 = 32 + .x1
           .y1 = 103
           .y2 = 32 + .y1
       End With
    
       Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(219, 240, 255, 255), 1#, 0
       Direct3D_Device.BeginScene
    
       If BS_Stone2 > 0 Then RenderTexture Tex_Item(Item(BS_Stone2).Pic), 197, 103, 0, 0, 32, 32, 32, 32
    
       Direct3D_Device.EndScene
       Direct3D_Device.Present srcRect, srcRect, frmMain.picBlacksmith.hwnd, ByVal (0)
    End If
    
    If BS_Stone3 > 0 Then
       With srcRect
           .x1 = 136
           .x2 = 32 + .x1
           .y1 = 164
           .y2 = 32 + .y1
       End With
    
       Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(219, 240, 255, 255), 1#, 0
       Direct3D_Device.BeginScene
      
       If BS_Stone3 > 0 Then RenderTexture Tex_Item(Item(BS_Stone3).Pic), 136, 164, 0, 0, 32, 32, 32, 32
    
       Direct3D_Device.EndScene
       Direct3D_Device.Present srcRect, srcRect, frmMain.picBlacksmith.hwnd, ByVal (0)
    End If
    
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "DrawBlacksmith", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub


Iremos adicionar as funções que serão ativadas pelo servidor.
Em modHandleData, procure por Public Sub InitMessages() e não final do método adicione o seguinte:

Código:
' Sistema de Craft
    HandleDataSub(SSendBlacksmith) = GetAddress(AddressOf HandleBlacksmithData)


Ainda em modHandleData, no final do modulo, adicione:

Código:
Private Sub HandleBlacksmithData(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
    Dim Buffer As clsBuffer, i As Long
    Dim Percent As Byte

    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler
    
    Set Buffer = New clsBuffer
    Buffer.WriteBytes Data()
    
    BS_Item.Num = Buffer.ReadLong
    BS_Item.Combine = Buffer.ReadByte
    BS_Precious = Buffer.ReadLong
    BS_Stone1 = Buffer.ReadLong
    BS_Stone2 = Buffer.ReadLong
    BS_Stone3 = Buffer.ReadLong
    Percent = Buffer.ReadByte
    
    Set Buffer = Nothing
    
    frmMain.lblNextPlus = "Estado atual é +" & BS_Item.Combine
    frmMain.lblNextPorcent = Percent & "% para +" & BS_Item.Combine + 1
    
    InBlacksmith = True
    frmMain.picCover.Visible = True
    frmMain.picBlacksmith.Visible = True
    frmMain.picBlacksmith.Refresh
    
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "HandleBlacksmithData", "modHandleData", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub
End Sub


Em breve atualizações e adaptações para outras engines!


Última edição por Dooolly em Qua Nov 29, 2017 11:36 pm, editado 1 vez(es)
Dooolly
Dooolly
Colaborador
Colaborador

Medalhas : [EO3.0]Aprimoramento de Equipamentos Trophy12
Mensagens : 1227
Créditos : 153

Ficha do personagem
Nível: 1
Experiência:
[EO3.0]Aprimoramento de Equipamentos Left_bar_bleue0/0[EO3.0]Aprimoramento de Equipamentos Empty_bar_bleue  (0/0)
Vida:
[EO3.0]Aprimoramento de Equipamentos Left_bar_bleue30/30[EO3.0]Aprimoramento de Equipamentos Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[EO3.0]Aprimoramento de Equipamentos Empty Re: [EO3.0]Aprimoramento de Equipamentos

Mensagem por Profane ~ Qua Nov 15, 2017 11:10 pm

Grande de Delicioso. 

Espero que saibam usar tal possibilidade que é imensa.
Lembro a anos atrás numa madrugada a gente discutindo sobre isso no TV e montando essas bases nas minhas engine mais old's UASHuhsa.

Muito bom dolly, voltando a movimentar a area da EO e com algo que tem um aproveitamento tão sumo.

_________________
"Mistress of shattered hopes and forever broken dreams"
Profane ~
Profane ~
Colaborador
Colaborador

Mensagens : 818
Créditos : 130

Ir para o topo Ir para baixo

[EO3.0]Aprimoramento de Equipamentos Empty Re: [EO3.0]Aprimoramento de Equipamentos

Mensagem por Valentine Qui Nov 16, 2017 7:24 am

Que delícia e.e

Boa, Dooolly.

+ 1 crédito
Valentine
Valentine
Administrador
Administrador

Medalhas : [EO3.0]Aprimoramento de Equipamentos ZgLkiRU
Mensagens : 5336
Créditos : 1163

https://www.aldeiarpg.com/

Ir para o topo Ir para baixo

[EO3.0]Aprimoramento de Equipamentos Empty Re: [EO3.0]Aprimoramento de Equipamentos

Mensagem por silipinho Seg Nov 27, 2017 5:45 pm

Na 2.0 não pega sem modificar ne?
silipinho
silipinho
Semi-Experiente
Semi-Experiente

Mensagens : 97
Créditos : 14

Ir para o topo Ir para baixo

[EO3.0]Aprimoramento de Equipamentos Empty Re: [EO3.0]Aprimoramento de Equipamentos

Mensagem por Dooolly Seg Nov 27, 2017 11:29 pm

silipinho escreveu:Na 2.0 não pega sem modificar ne?
Teria que modificar apenas a parte da renderização dos ícones na picture.

PS: Caso queira fazer isso, coloca o sistema na EO2.0, e me informa uma maneira de nos comunicarmos. Assim faremos juntos as modificações.
Dooolly
Dooolly
Colaborador
Colaborador

Medalhas : [EO3.0]Aprimoramento de Equipamentos Trophy12
Mensagens : 1227
Créditos : 153

Ficha do personagem
Nível: 1
Experiência:
[EO3.0]Aprimoramento de Equipamentos Left_bar_bleue0/0[EO3.0]Aprimoramento de Equipamentos Empty_bar_bleue  (0/0)
Vida:
[EO3.0]Aprimoramento de Equipamentos Left_bar_bleue30/30[EO3.0]Aprimoramento de Equipamentos Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[EO3.0]Aprimoramento de Equipamentos Empty Re: [EO3.0]Aprimoramento de Equipamentos

Mensagem por Dexter Ter Nov 28, 2017 8:48 am

Basta altera isso:

Código:
Sub DrawBlacksmith()[size=12][/size]
Dim Rec As RECT, Rec_Pos As RECT, srcRect As D3DRECT, destRect As D3DRECT[size=12][/size]
[size=12][/size]
    ' If debug mode, handle error then exit out[size=12][/size]
    If Options.Debug = 1 Then On Error GoTo errorhandler[size=12][/size]
[size=12][/size]
    If BS_Item.Num > 0 Then[size=12][/size]
       With srcRect[size=12][/size]
           .x1 = 136[size=12][/size]
           .x2 = 32 + .x1[size=12][/size]
           .y1 = 103[size=12][/size]
           .y2 = 32 + .y1[size=12][/size]
       End With[size=12][/size]
    [size=12][/size]
       Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(219, 240, 255, 255), 1#, 0[size=12][/size]
       Direct3D_Device.BeginScene[size=12][/size]
    [size=12][/size]
       RenderTexture Tex_Item(Item(BS_Item.Num).Pic), 136, 103, 0, 0, 32, 32, 32, 32[size=12][/size]
    [size=12][/size]
       Direct3D_Device.EndScene[size=12][/size]
       Direct3D_Device.Present srcRect, srcRect, frmMain.picBlacksmith.hwnd, ByVal (0)[size=12][/size]
    End If[size=12][/size]
    [size=12][/size]
    If BS_Precious > 0 Then[size=12][/size]
       With srcRect[size=12][/size]
           .x1 = 136[size=12][/size]
           .x2 = 32 + .x1[size=12][/size]
           .y1 = 30[size=12][/size]
           .y2 = 32 + .y1[size=12][/size]
       End With[size=12][/size]
    [size=12][/size]
       Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(219, 240, 255, 255), 1#, 0[size=12][/size]
       Direct3D_Device.BeginScene[size=12][/size]
    [size=12][/size]
       RenderTexture Tex_Item(Item(BS_Precious).Pic), 136, 30, 0, 0, 32, 32, 32, 32[size=12][/size]
    [size=12][/size]
       Direct3D_Device.EndScene[size=12][/size]
       Direct3D_Device.Present srcRect, srcRect, frmMain.picBlacksmith.hwnd, ByVal (0)[size=12][/size]
    End If[size=12][/size]
    [size=12][/size]
    If BS_Stone1 > 0 Then[size=12][/size]
       With srcRect[size=12][/size]
           .x1 = 75[size=12][/size]
           .x2 = 32 + .x1[size=12][/size]
           .y1 = 103[size=12][/size]
           .y2 = 32 + .y1[size=12][/size]
       End With[size=12][/size]
    [size=12][/size]
       Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(219, 240, 255, 255), 1#, 0[size=12][/size]
       Direct3D_Device.BeginScene[size=12][/size]
    [size=12][/size]
       If BS_Stone1 > 0 Then RenderTexture Tex_Item(Item(BS_Stone1).Pic), 75, 103, 0, 0, 32, 32, 32, 32[size=12][/size]
    [size=12][/size]
       Direct3D_Device.EndScene[size=12][/size]
       Direct3D_Device.Present srcRect, srcRect, frmMain.picBlacksmith.hwnd, ByVal (0)[size=12][/size]
    End If[size=12][/size]
    [size=12][/size]
    If BS_Stone2 > 0 Then[size=12][/size]
       With srcRect[size=12][/size]
           .x1 = 197[size=12][/size]
           .x2 = 32 + .x1[size=12][/size]
           .y1 = 103[size=12][/size]
           .y2 = 32 + .y1[size=12][/size]
       End With[size=12][/size]
    [size=12][/size]
       Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(219, 240, 255, 255), 1#, 0[size=12][/size]
       Direct3D_Device.BeginScene[size=12][/size]
    [size=12][/size]
       If BS_Stone2 > 0 Then RenderTexture Tex_Item(Item(BS_Stone2).Pic), 197, 103, 0, 0, 32, 32, 32, 32[size=12][/size]
    [size=12][/size]
       Direct3D_Device.EndScene[size=12][/size]
       Direct3D_Device.Present srcRect, srcRect, frmMain.picBlacksmith.hwnd, ByVal (0)[size=12][/size]
    End If[size=12][/size]
    [size=12][/size]
    If BS_Stone3 > 0 Then[size=12][/size]
       With srcRect[size=12][/size]
           .x1 = 136[size=12][/size]
           .x2 = 32 + .x1[size=12][/size]
           .y1 = 164[size=12][/size]
           .y2 = 32 + .y1[size=12][/size]
       End With[size=12][/size]
    [size=12][/size]
       Direct3D_Device.Clear 0, ByVal 0, D3DCLEAR_TARGET, D3DColorRGBA(219, 240, 255, 255), 1#, 0[size=12][/size]
       Direct3D_Device.BeginScene[size=12][/size]
       [size=12][/size]
       If BS_Stone3 > 0 Then RenderTexture Tex_Item(Item(BS_Stone3).Pic), 136, 164, 0, 0, 32, 32, 32, 32[size=12][/size]
    [size=12][/size]
       Direct3D_Device.EndScene[size=12][/size]
       Direct3D_Device.Present srcRect, srcRect, frmMain.picBlacksmith.hwnd, ByVal (0)[size=12][/size]
    End If[size=12][/size]
    [size=12][/size]
    ' Error handler[size=12][/size]
    Exit Sub[size=12][/size]
errorhandler:[size=12][/size]
    HandleError "DrawBlacksmith", "modGraphics", Err.Number, Err.Description, Err.Source, Err.HelpContext[size=12][/size]
    Err.Clear[size=12][/size]
    Exit Sub[size=12][/size]
End Sub

Dooolly, você nao poderia fazer essa alteração e colocar como opção para o pessoal aqui não ?
Dexter
Dexter
Semi-Experiente
Semi-Experiente

Mensagens : 90
Créditos : 13

Ficha do personagem
Nível: 1
Experiência:
[EO3.0]Aprimoramento de Equipamentos Left_bar_bleue0/50[EO3.0]Aprimoramento de Equipamentos Empty_bar_bleue  (0/50)
Vida:
[EO3.0]Aprimoramento de Equipamentos Left_bar_bleue30/30[EO3.0]Aprimoramento de Equipamentos Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[EO3.0]Aprimoramento de Equipamentos Empty Re: [EO3.0]Aprimoramento de Equipamentos

Mensagem por Dexter Qua Nov 29, 2017 9:52 pm

Dooolly está apresentando o seguinte erro:

[EO3.0]Aprimoramento de Equipamentos Erro11
Dexter
Dexter
Semi-Experiente
Semi-Experiente

Mensagens : 90
Créditos : 13

Ficha do personagem
Nível: 1
Experiência:
[EO3.0]Aprimoramento de Equipamentos Left_bar_bleue0/50[EO3.0]Aprimoramento de Equipamentos Empty_bar_bleue  (0/50)
Vida:
[EO3.0]Aprimoramento de Equipamentos Left_bar_bleue30/30[EO3.0]Aprimoramento de Equipamentos Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[EO3.0]Aprimoramento de Equipamentos Empty Re: [EO3.0]Aprimoramento de Equipamentos

Mensagem por Dooolly Qua Nov 29, 2017 11:28 pm

Dexter escreveu:Dooolly está apresentando o seguinte erro:

[EO3.0]Aprimoramento de Equipamentos Erro11
Desculpa, Não notei que no cliente esses metodos são diferentes do servidor!

Arrumando!
Código:
' +======================================+
' +====== By: Dooolly ===================+
Function GetPlayerInvItemCombine(ByVal Index As Long, ByVal invSlot As Long) As Byte
    ' Verificar se o indice do jogador está dentro dos limites
    If Index <= 0 Or Index > MAX_PLAYERS Then Exit Function
   
    ' Verificar se o slot do equipamento não é nulo ou ultrapassa os limites
    If invSlot <= 0 Or invSlot >= MAX_INV Then Exit Function
   
    ' Retornar o nivel de aprimoramento do item
    GetPlayerInvItemCombine = PlayerInv(invSlot).Combine
End Function

' +======================================+
' +====== By: Dooolly ===================+
Sub SetPlayerInvItemCombine(ByVal Index As Long, ByVal invSlot As Long, ByVal ItemCombine As Long)
    ' Definir o nivel de aprimoramento do item no inventário
    PlayerInv(invSlot).Combine = ItemCombine
End Sub
Dooolly
Dooolly
Colaborador
Colaborador

Medalhas : [EO3.0]Aprimoramento de Equipamentos Trophy12
Mensagens : 1227
Créditos : 153

Ficha do personagem
Nível: 1
Experiência:
[EO3.0]Aprimoramento de Equipamentos Left_bar_bleue0/0[EO3.0]Aprimoramento de Equipamentos Empty_bar_bleue  (0/0)
Vida:
[EO3.0]Aprimoramento de Equipamentos Left_bar_bleue30/30[EO3.0]Aprimoramento de Equipamentos Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[EO3.0]Aprimoramento de Equipamentos Empty Re: [EO3.0]Aprimoramento de Equipamentos

Mensagem por silipinho Qua Nov 29, 2017 11:49 pm

Dooolly escreveu:
silipinho escreveu:Na 2.0 não pega sem modificar ne?
Teria que modificar apenas a parte da renderização dos ícones na picture.

PS: Caso queira fazer isso, coloca o sistema na EO2.0, e me informa uma maneira de nos comunicarmos. Assim faremos juntos as modificações.
 Blz eu to fazendo umas modificações no projeto primeiro, assim que chegar nessa parte te falo!
silipinho
silipinho
Semi-Experiente
Semi-Experiente

Mensagens : 97
Créditos : 14

Ir para o topo Ir para baixo

[EO3.0]Aprimoramento de Equipamentos Empty Re: [EO3.0]Aprimoramento de Equipamentos

Mensagem por Dexter Qui Nov 30, 2017 8:04 pm

Dooolly escreveu:
Dexter escreveu:Dooolly está apresentando o seguinte erro:

[EO3.0]Aprimoramento de Equipamentos Erro11
Desculpa, Não notei que no cliente esses metodos são diferentes do servidor!

Arrumando!
Código:
' +======================================+
' +====== By: Dooolly ===================+
Function GetPlayerInvItemCombine(ByVal Index As Long, ByVal invSlot As Long) As Byte
    ' Verificar se o indice do jogador está dentro dos limites
    If Index <= 0 Or Index > MAX_PLAYERS Then Exit Function
    
    ' Verificar se o slot do equipamento não é nulo ou ultrapassa os limites
    If invSlot <= 0 Or invSlot >= MAX_INV Then Exit Function
    
    ' Retornar o nivel de aprimoramento do item
    GetPlayerInvItemCombine = PlayerInv(invSlot).Combine
End Function

' +======================================+
' +====== By: Dooolly ===================+
Sub SetPlayerInvItemCombine(ByVal Index As Long, ByVal invSlot As Long, ByVal ItemCombine As Long)
    ' Definir o nivel de aprimoramento do item no inventário
    PlayerInv(invSlot).Combine = ItemCombine
End Sub
Achei outro problema, quando abre o aprimoramento não abre o inventario junto, ai você vai la e clica para abrir o inventario, porem você não consegue mexer nos itens do inventario apenas dropar.
E encontrei esse erro também.
[EO3.0]Aprimoramento de Equipamentos Erro12
Dexter
Dexter
Semi-Experiente
Semi-Experiente

Mensagens : 90
Créditos : 13

Ficha do personagem
Nível: 1
Experiência:
[EO3.0]Aprimoramento de Equipamentos Left_bar_bleue0/50[EO3.0]Aprimoramento de Equipamentos Empty_bar_bleue  (0/50)
Vida:
[EO3.0]Aprimoramento de Equipamentos Left_bar_bleue30/30[EO3.0]Aprimoramento de Equipamentos Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[EO3.0]Aprimoramento de Equipamentos Empty Re: [EO3.0]Aprimoramento de Equipamentos

Mensagem por Conteúdo patrocinado


Conteúdo patrocinado


Ir para o topo Ir para baixo

Página 1 de 2 1, 2  Seguinte

Ir para o topo

- Tópicos semelhantes

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