[Hells] Arvore de Habilidades 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.

[Hells] Arvore de Habilidades

+5
MasterOp
Valentine
Profane ~
Dexter
GalaxyHells
9 participantes

Página 1 de 2 1, 2  Seguinte

Ir para baixo

[Hells] Arvore de Habilidades Empty [Hells] Arvore de Habilidades

Mensagem por GalaxyHells Seg Ago 27, 2018 8:17 pm

Antes de qualquer coisa baixe essa frmHabilidades e ponha no client.
(https://mega.nz/#!rUgXALya!ie8rgCpVG_stm9aQIxd5hqWE1lPZe2bFs8CH9FgqoZ0)

Client e Server - Side

Procure por Playerrec e no final antes de End Type Adicione:

Código:
'Habilidades
    AdcStr As Byte
    AdcInt As Byte
    AdcWill As Byte
    AdcEnd As Byte
    AdcAgi As Byte
    SkillPoint As Byte



No modConstants procure por:

Código:
Public Const MAX_PARTY_MEMBERS As Long = 4



Em baixo Adicione:

Código:
'Habilidades/ By Hells
Public Const MAX_ADCSTR_LEVEL As Long = 10
Public Const MAX_ADCINT_LEVEL As Long = 10
Public Const MAX_ADCWILL_LEVEL As Long = 10
Public Const MAX_ADCEND_LEVEL As Long = 10
Public Const MAX_ADCAGI_LEVEL As Long = 10
Public Const MAX_SKILLPOINT As Long = 50
'Habilidades\


No modEnumerations procure por

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



Acima disso adicione: 

Código:
CAdcHabilidade


Client - Side (Somente)

No modHandleData, na sub HandlePlayerData procure por:

Código:
' Check if the player is the client player


Em cima adicione:
Código:
Player(i).AdcStr = Buffer.ReadByte
    Player(i).AdcInt = Buffer.ReadByte
    Player(i).AdcInt = Buffer.ReadByte
    Player(i).AdcWill = Buffer.ReadByte
    Player(i).AdcEnd = Buffer.ReadByte
    Player(i).AdcAgi = Buffer.ReadByte
    Player(i).SkillPoint = Buffer.ReadByte



No final do modGameLogic adicione:

Código:
Public Sub ProcessAdcHabilidade(ByVal Habilidades As Byte)
Dim Habilidade As Long    'Vai Guardar o Valor da Habilidade

    'Hora de Brincar.
    Select Case Habilidades 'Numero da Habilidade a qual Clicando no botão 3 irá processar a Adição
        Case 1  'Strenght
            Habilidade = 1 'Numero da Habilidade a qual Clicando no botão Strenght irá processar a Adição
        Case 2  'Intelligence
            Habilidade = 2 'Numero da Habilidade a qual Clicando no botão Intelligence irá processar a Adição
        Case 3  'Willpower
            Habilidade = 3 'Numero da Habilidade a qual Clicando no botão Willpower irá processar a Adição
        Case 4  'Endurance
            Habilidade = 4 'Numero da Habilidade a qual Clicando no botão Endurance irá processar a Adição
        Case 5  'Agility
            Habilidade = 5 'Numero da Habilidade a qual Clicando no botão Agility irá processar a Adição
        Case Else
            Habilidade = 0
    End Select
    
    'Enviar pedido de Adição, porém analisando antes os limites!!!
    'Caso Exista (Não seja zero ou menor), e também não seja maior que o limite então ~
    If Habilidade > 0 And Habilidade <= 5 Then
        Call RequestAdcHabilidade(Habilidade)    'Enviará o pedido de adição na habilidade
    End If

End Sub



No final de modClientTCP adicione:

Código:
Public Sub RequestAdcHabilidade(ByVal Habilidade As Long)
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 CAdcHabilidade        'Enumeração do Pacote!
    Buffer.WriteLong Habilidade            'Numero da Habilidade que saiu lá do Processamento
    
    SendData Buffer.ToArray()
    Set Buffer = Nothing
    
    ' Error handler
    Exit Sub
errorhandler:
    HandleError "RequestAdcHabilidade", "modClientTCP", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Sub

End Sub

Na frmMain, em qualquer lugar adicione um CommandButton com as propriedades:
Name: cmdAbrirHabilidades
Nome: Habilidades

De dois cliques nele e adicione:
frmHabilidades.visible = not frmHabilidades.visible

Client terminado

Server - Side

no modDatabase, na Sub AddChar procure por:

Código:
Player(Index).Class = ClassNum

Abaixo adicione:

Código:
'Habilidades/ ByHells
        Player(Index).AdcStr = 0 'Com Quantos Str ele vai iniciar
        Player(Index).AdcInt = 0 'Com Quantos Int ele vai iniciar
        Player(Index).AdcWill = 0 'Com Quantos Will ele vai iniciar
        Player(Index).AdcEnd = 0 'Com Quantos End ele vai iniciar
        Player(Index).AdcAgi = 0 'Com Quantos Agi ele vai iniciar
        Player(Index).SkillPoint = 0 'Com Quantos SkillPoint ele vai iniciar
        'Habilidades\

no modHandleData, na Public Sub InitMessages() adicione antes do end sub:

Código:
'Habilidade by Hells
    HandleDataSub(CAdcHabilidade) = GetAddress(AddressOf HandleAdcHabilidade)


no final do modHandleData adicione:
Código:
'Processamento do Pacote de Adição, vindo do Client.
Private Sub HandleAdcHabilidade(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim Habilidade As Long
Dim Buffer As clsBuffer

    Set Buffer = New clsBuffer
    Buffer.WriteBytes Data()
    
    Habilidade = Buffer.ReadLong      'Alargada a Leitura - Numero da Habilidade que veio do Client
    
    'Passar nos Limites do Servidor:
    If Habilidade <= 0 Or Habilidade > 5 Then Exit Sub 'Exitar se for causar um Script out of Range
    'O Numero é viavel, então vamos trabalhar ele.
    If Index <= 0 Or Index > MAX_PLAYERS Then Exit Sub 'Esse jogador existe?
    Set Buffer = Nothing 'Encerrado o Pacote;
    If GetPlayerSkillPoint(Index) >= 1 Then 'Ele tem skillpoints suficientes?
    
    'Enviar a adição
    Select Case Habilidade
        Case 1
            Player(Index).AdcStr = Player(Index).AdcStr + 1 'Adiciona 1 ponto na Habilidade Strenght
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Strenght!", Green
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1
            SendPlayerData Index
        Case 2
            Player(Index).AdcInt = Player(Index).AdcInt + 1 'Adiciona 1 ponto na Habilidade Intelligence
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Intelligence!", Green
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1
            SendPlayerData Index
        Case 3
            Player(Index).AdcWill = Player(Index).AdcWill + 1 'Adiciona 1 ponto na Habilidade Willpower
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Willpower!", Green
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1
            SendPlayerData Index
        Case 4
            Player(Index).AdcEnd = Player(Index).AdcEnd + 1 'Adiciona 1 ponto na Habilidade Endurance
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Endurance!", Green
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1
            SendPlayerData Index
        Case 5
            Player(Index).AdcAgi = Player(Index).AdcAgi + 1 'Adiciona 1 ponto na Habilidade Agility
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Agility!", Green
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1
            SendPlayerData Index
        Case Else
            PlayerMsg Index, "Não existe erra habilidade meu consagrado ;c!", Red 'Não tem uma Habilidade com esse numero então ele avisa o player...
    End Select
    End If
End Sub


no modServerTCP, na sub Function PlayerData procure por:

Código:
PlayerData = Buffer.ToArray()
    Set Buffer = Nothing

Em cima adicione: 
Código:
'Habilidade by Hells
    Buffer.WriteByte Player(Index).AdcStr
    Buffer.WriteByte Player(Index).AdcInt
    Buffer.WriteByte Player(Index).AdcWill
    Buffer.WriteByte Player(Index).AdcEnd
    Buffer.WriteByte Player(Index).AdcAgi
    Buffer.WriteByte Player(Index).SkillPoint


no modPlayer procure por:

Código:
Sub SetPlayerPOINTS(ByVal Index As Long, ByVal POINTS As Long)
    If POINTS <= 0 Then POINTS = 0
    Player(Index).POINTS = POINTS
End Sub



em baixo adicione:

Código:
'Habilidades/ By Hells
Function GetPlayerAdcStr(ByVal Index As Long) As Long

    If Index > MAX_PLAYERS Then Exit Function
    GetPlayerAdcStr = Player(Index).AdcStr
End Function

Function SetPlayerAdcStr(ByVal Index As Integer, ByVal AdcStr As Long) As Boolean
    SetPlayerAdcStr = False
    If AdcStr > MAX_ADCSTR_LEVEL Then Exit Function
    Player(Index).AdcStr = AdcStr
    SetPlayerAdcStr = True
End Function

Function GetPlayerAdcInt(ByVal Index As Long) As Long

    If Index > MAX_PLAYERS Then Exit Function
    GetPlayerAdcInt = Player(Index).AdcInt
End Function

Function SetPlayerAdcInt(ByVal Index As Integer, ByVal AdcInt As Long) As Boolean
    SetPlayerAdcInt = False
    If AdcInt > MAX_ADCINT_LEVEL Then Exit Function
    Player(Index).AdcInt = AdcInt
    SetPlayerAdcInt = True
End Function

Function GetPlayerAdcWill(ByVal Index As Long) As Long

    If Index > MAX_PLAYERS Then Exit Function
    GetPlayerAdcWill = Player(Index).AdcWill
End Function

Function SetPlayerAdcWill(ByVal Index As Integer, ByVal AdcWill As Long) As Boolean
    SetPlayerAdcWill = False
    If AdcWill > MAX_ADCWILL_LEVEL Then Exit Function
    Player(Index).AdcWill = AdcWill
    SetPlayerAdcWill = True
End Function

Function GetPlayerAdcEnd(ByVal Index As Long) As Long

    If Index > MAX_PLAYERS Then Exit Function
    GetPlayerAdcEnd = Player(Index).AdcEnd
End Function

Function SetPlayerAdcEnd(ByVal Index As Integer, ByVal AdcEnd As Long) As Boolean
    SetPlayerAdcEnd = False
    If AdcEnd > MAX_ADCEND_LEVEL Then Exit Function
    Player(Index).AdcEnd = AdcEnd
    SetPlayerAdcEnd = True
End Function

Function GetPlayerAdcAgi(ByVal Index As Long) As Long

    If Index > MAX_PLAYERS Then Exit Function
    GetPlayerAdcAgi = Player(Index).AdcAgi
End Function

Function SetPlayerAdcAgi(ByVal Index As Integer, ByVal AdcAgi As Long) As Boolean
    SetPlayerAdcAgi = False
    If AdcAgi > MAX_ADCAGI_LEVEL Then Exit Function
    Player(Index).AdcAgi = AdcAgi
    SetPlayerAdcAgi = True
End Function

Function GetPlayerSkillPoint(ByVal Index As Long) As Long

    If Index > MAX_PLAYERS Then Exit Function
    GetPlayerSkillPoint = Player(Index).SkillPoint
End Function

Function SetPlayerSkillPoint(ByVal Index As Integer, ByVal SkillPoint As Long) As Boolean
    SetPlayerSkillPoint = False
    If SkillPoint > MAX_SKILLPOINT Then Exit Function
    Player(Index).SkillPoint = SkillPoint
    SetPlayerSkillPoint = True
End Function
'Habilidades\

No modPlayer, na sub Sub CheckPlayerLevelUp procure por:

Código:
Call SetPlayerExp(Index, expRollover)

abaixo adicione:

Código:
Call AddSkillPoint(Index)
No final do modGameLogic adicione:

Código:
Function AddSkillPoint(ByVal Index As Long)

If Not Player(Index).SkillPoint > 50 Then
    If GetPlayerLevel(Index) = 1 Or 2 Or 3 Or 4 Or 5 Or 6 Or 7 Or 8 Or 9 Or 10 Then 'Os leveis que o jogador vai ganhar skillpoint
        Player(Index).SkillPoint = Player(Index).SkillPoint + 1 'Quantos SkillPoint ele vai ganhar
        SendPlayerData Index
    End If
End If

End Function


Uffa, Sistema Feito *-* Nem demorou tanto assim né?
A maior parte do codigo ta explicado, então basta ler pra 
saber oque fazer.

Aqui vai uns extras

Você talvez tenha percebido q só estamos adicionando valores ao jogador né?
Ou seja, falta fazer esses valores influenciarem no ataque, vida, mana etc do jogador.
Essa é uma parte que é bem pessoal, porem vou dar uns exemplos pra você.

No Server - Side

No modCombat procure por Function GetPlayerDamage, em baixo de 

Código:
Dim weaponNum As Long 

adicione:
Código:
Dim AdcDano As Currency

AdcDefesa = 1 + Player(Index).AdcStr / 50

Abaixo de:

Código:
GetPlayerDamage = 0.085 * 5 * GetPlayerStat(Index, Strength) * Item(weaponNum).Data2 + (GetPlayerLevel(Index) / 5)


Adicione:

Código:
GetPlayerDamage = GetPlayerDamage * AdcDano

Abaixo de:

Código:
GetPlayerDamage = 0.085 * 5 * GetPlayerStat(Index, Strength) + (GetPlayerLevel(Index) / 5)


Adicione: 

Código:
GetPlayerDamage = GetPlayerDamage * AdcDano

Oq é isso?  Oq acabamos de fazer?

Bem aqui:
Dim AdcDano As Currency

Nós declaramos q a variavel AdcDano é uma Currency

Aqui: 
AdcDano= 1 + Player(Index).AdcStr / 50

Nós declaramos q o valor de AdcDano vai ser 1 + Quantidade de Pontos do jogador em Strenght / 50

Aqui:
GetPlayerDamage = GetPlayerDamage * AdcDano

Nós aumentamos uma portentagem do dano, essa porcentagem pode ser até 50% ou seja, se o jogador tiver 10 pontos na habilidade Strenght o GetPlayerDamage será 50% a mais. Se o GetPlayerDamage era 100 ele ficara 150

Basta usar esses valores onde o quiser alterar. Não farei isso pois é meio pessoal, varia de projeto para projeto, mas você agora sabe fazer isso ;D.

Qualquer duvida/erro é so comentar aqui.

Creditos: 
GalaxyHells
Profane (Roubei partes do codigos hehe)


Última edição por GalaxyHells em Sáb Set 01, 2018 9:19 pm, editado 6 vez(es)

_________________
[Hells] Arvore de Habilidades 90yel0
GalaxyHells
GalaxyHells
Ocasional
Ocasional

Mensagens : 196
Créditos : 22

Ficha do personagem
Nível: 1
Experiência:
[Hells] Arvore de Habilidades Left_bar_bleue0/0[Hells] Arvore de Habilidades Empty_bar_bleue  (0/0)
Vida:
[Hells] Arvore de Habilidades Left_bar_bleue30/30[Hells] Arvore de Habilidades Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[Hells] Arvore de Habilidades Empty Re: [Hells] Arvore de Habilidades

Mensagem por Dexter Seg Ago 27, 2018 9:52 pm

Muito bom! Posta uma fotinha só pra alegrar mais o post  Very Happy
Dexter
Dexter
Semi-Experiente
Semi-Experiente

Mensagens : 90
Créditos : 13

Ficha do personagem
Nível: 1
Experiência:
[Hells] Arvore de Habilidades Left_bar_bleue0/50[Hells] Arvore de Habilidades Empty_bar_bleue  (0/50)
Vida:
[Hells] Arvore de Habilidades Left_bar_bleue30/30[Hells] Arvore de Habilidades Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[Hells] Arvore de Habilidades Empty Re: [Hells] Arvore de Habilidades

Mensagem por Profane ~ Seg Ago 27, 2018 11:15 pm

Dexter escreveu:Muito bom! Posta uma fotinha só pra alegrar mais o post  Very Happy

Você ta querendo um Nude dele é safado? ufm >
Muito bom Hells! Vejo que enfim depois de 3/4 anos o vb ta entrando na sua cabeça (talvez d,d)

Well, atente apenas a isso aqui:

Código:
'Processamento do Pacote de Adição, vindo do Client.[size=12][/size]
Private Sub HandleAdcHabilidade(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)[size=12][/size]
Dim Habilidade As Long[size=12][/size]
Dim Buffer As clsBuffer[size=12][/size]
[size=12][/size]
    Set Buffer = New clsBuffer[size=12][/size]
    Buffer.WriteBytes Data()[size=12][/size]
    [size=12][/size]
    Habilidade = Buffer.ReadLong      'Alargada a Leitura - Numero da Habilidade que veio do Client[size=12][/size]
    [size=12][/size]
    'Passar nos Limites do Servidor:[size=12][/size]
    If Habilidade <= 0 Or Habilidade > 5 Then Exit Sub 'Exitar se for causar um Script out of Range[size=12][/size]
    'O Numero é viavel, então vamos trabalhar ele.[size=12][/size]
    If Index <= 0 Or Index > MAX_PLAYERS Then Exit Sub 'Esse jogador existe?[size=12][/size]
    If GetPlayerSkillPoint(Index) >= 1 Then 'Ele tem skillpoints suficientes?[size=12][/size]
[size=12][/size]
    Set Buffer = Nothing 'Encerrado o Pacote;[size=12][/size]
    [size=12][/size]
    'Enviar a adição[size=12][/size]
    Select Case Habilidade[size=12][/size]
        Case 1[size=12][/size]
            Player(Index).AdcStr = Player(Index).AdcStr + 1 'Adiciona 1 ponto na Habilidade Strenght[size=12][/size]
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Strenght!", Green[size=12][/size]
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1[size=12][/size]
            SendPlayerData Index[size=12][/size]
        Case 2[size=12][/size]
            Player(Index).AdcInt = Player(Index).AdcInt + 1 'Adiciona 1 ponto na Habilidade Intelligence[size=12][/size]
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Intelligence!", Green[size=12][/size]
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1[size=12][/size]
            SendPlayerData Index[size=12][/size]
        Case 3[size=12][/size]
            Player(Index).AdcWill = Player(Index).AdcWill + 1 'Adiciona 1 ponto na Habilidade Willpower[size=12][/size]
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Willpower!", Green[size=12][/size]
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1[size=12][/size]
            SendPlayerData Index[size=12][/size]
        Case 4[size=12][/size]
            Player(Index).AdcEnd = Player(Index).AdcEnd + 1 'Adiciona 1 ponto na Habilidade Endurance[size=12][/size]
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Endurance!", Green[size=12][/size]
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1[size=12][/size]
            SendPlayerData Index[size=12][/size]
        Case 5[size=12][/size]
            Player(Index).AdcAgi = Player(Index).AdcAgi + 1 'Adiciona 1 ponto na Habilidade Agility[size=12][/size]
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Agility!", Green[size=12][/size]
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1[size=12][/size]
            SendPlayerData Index[size=12][/size]
        Case Else[size=12][/size]
            PlayerMsg Index, "Não existe erra habilidade meu consagrado ;c!", Red 'Não tem uma Habilidade com esse numero então ele avisa o player...[size=12][/size]
    End Select[size=12][/size]
    End If[size=12][/size]
End Sub

Existe um If do GetPlayerSkillPoint analisando se o player tem pontos, e abaixo dele a limpeza da memoria do Pacote que é recepcionado.

Código:
If GetPlayerSkillPoint(Index) >= 1 Then 'Ele tem skillpoints suficientes?[size=12][/size]
[size=12][/size]
    Set Buffer = Nothing 'Encerrado o Pacote;

Inverta, coloque o Set Buffer = Not's para cima.

Isso vai garantir a limpeza do Buffer e não vai lhe acarretar problemas.

Att

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

Mensagens : 818
Créditos : 130

Ir para o topo Ir para baixo

[Hells] Arvore de Habilidades Empty Re: [Hells] Arvore de Habilidades

Mensagem por GalaxyHells Seg Ago 27, 2018 11:25 pm

Profane ~ escreveu:
Dexter escreveu:Muito bom! Posta uma fotinha só pra alegrar mais o post  Very Happy

Você ta querendo um Nude dele é safado? ufm >
Muito bom Hells! Vejo que enfim depois de 3/4 anos o vb ta entrando na sua cabeça (talvez d,d)

Well, atente apenas a isso aqui:

Código:
'Processamento do Pacote de Adição, vindo do Client.[size=12][/size]
Private Sub HandleAdcHabilidade(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)[size=12][/size]
Dim Habilidade As Long[size=12][/size]
Dim Buffer As clsBuffer[size=12][/size]
[size=12][/size]
    Set Buffer = New clsBuffer[size=12][/size]
    Buffer.WriteBytes Data()[size=12][/size]
    [size=12][/size]
    Habilidade = Buffer.ReadLong      'Alargada a Leitura - Numero da Habilidade que veio do Client[size=12][/size]
    [size=12][/size]
    'Passar nos Limites do Servidor:[size=12][/size]
    If Habilidade <= 0 Or Habilidade > 5 Then Exit Sub 'Exitar se for causar um Script out of Range[size=12][/size]
    'O Numero é viavel, então vamos trabalhar ele.[size=12][/size]
    If Index <= 0 Or Index > MAX_PLAYERS Then Exit Sub 'Esse jogador existe?[size=12][/size]
    If GetPlayerSkillPoint(Index) >= 1 Then 'Ele tem skillpoints suficientes?[size=12][/size]
[size=12][/size]
    Set Buffer = Nothing 'Encerrado o Pacote;[size=12][/size]
    [size=12][/size]
    'Enviar a adição[size=12][/size]
    Select Case Habilidade[size=12][/size]
        Case 1[size=12][/size]
            Player(Index).AdcStr = Player(Index).AdcStr + 1 'Adiciona 1 ponto na Habilidade Strenght[size=12][/size]
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Strenght!", Green[size=12][/size]
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1[size=12][/size]
            SendPlayerData Index[size=12][/size]
        Case 2[size=12][/size]
            Player(Index).AdcInt = Player(Index).AdcInt + 1 'Adiciona 1 ponto na Habilidade Intelligence[size=12][/size]
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Intelligence!", Green[size=12][/size]
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1[size=12][/size]
            SendPlayerData Index[size=12][/size]
        Case 3[size=12][/size]
            Player(Index).AdcWill = Player(Index).AdcWill + 1 'Adiciona 1 ponto na Habilidade Willpower[size=12][/size]
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Willpower!", Green[size=12][/size]
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1[size=12][/size]
            SendPlayerData Index[size=12][/size]
        Case 4[size=12][/size]
            Player(Index).AdcEnd = Player(Index).AdcEnd + 1 'Adiciona 1 ponto na Habilidade Endurance[size=12][/size]
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Endurance!", Green[size=12][/size]
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1[size=12][/size]
            SendPlayerData Index[size=12][/size]
        Case 5[size=12][/size]
            Player(Index).AdcAgi = Player(Index).AdcAgi + 1 'Adiciona 1 ponto na Habilidade Agility[size=12][/size]
            PlayerMsg Index, "Adicionado 1 ponto na Habilidade Agility!", Green[size=12][/size]
            Player(Index).SkillPoint = GetPlayerSkillPoint(Index) - 1[size=12][/size]
            SendPlayerData Index[size=12][/size]
        Case Else[size=12][/size]
            PlayerMsg Index, "Não existe erra habilidade meu consagrado ;c!", Red 'Não tem uma Habilidade com esse numero então ele avisa o player...[size=12][/size]
    End Select[size=12][/size]
    End If[size=12][/size]
End Sub

Existe um If do GetPlayerSkillPoint analisando se o player tem pontos, e abaixo dele a limpeza da memoria do Pacote que é recepcionado.

Código:
If GetPlayerSkillPoint(Index) >= 1 Then 'Ele tem skillpoints suficientes?[size=12][/size]
[size=12][/size]
    Set Buffer = Nothing 'Encerrado o Pacote;

Inverta, coloque o Set Buffer = Not's para cima.

Isso vai garantir a limpeza do Buffer e não vai lhe acarretar problemas.

Att

Opa, vlw por avisar. Editei <3

_________________
[Hells] Arvore de Habilidades 90yel0
GalaxyHells
GalaxyHells
Ocasional
Ocasional

Mensagens : 196
Créditos : 22

Ficha do personagem
Nível: 1
Experiência:
[Hells] Arvore de Habilidades Left_bar_bleue0/0[Hells] Arvore de Habilidades Empty_bar_bleue  (0/0)
Vida:
[Hells] Arvore de Habilidades Left_bar_bleue30/30[Hells] Arvore de Habilidades Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[Hells] Arvore de Habilidades Empty Re: [Hells] Arvore de Habilidades

Mensagem por Valentine Ter Ago 28, 2018 7:47 am

Show, em.

+ 1 crédito.
Valentine
Valentine
Administrador
Administrador

Medalhas : [Hells] Arvore de Habilidades ZgLkiRU
Mensagens : 5336
Créditos : 1163

https://www.aldeiarpg.com/

Ir para o topo Ir para baixo

[Hells] Arvore de Habilidades Empty Re: [Hells] Arvore de Habilidades

Mensagem por MasterOp Sex Nov 09, 2018 11:11 pm



Client - Side (Somente)

No modHandleData, na sub HandlePlayerData procure por:

Código:
' Check if the player is the client player


Em cima adicione:
Código:
Player(i).AdcStr = Buffer.ReadByte
    Player(i).AdcInt = Buffer.ReadByte
    Player(i).AdcInt = Buffer.ReadByte
    Player(i).AdcWill = Buffer.ReadByte
    Player(i).AdcEnd = Buffer.ReadByte
    Player(i).AdcAgi = Buffer.ReadByte
    Player(i).SkillPoint = Buffer.ReadByte

Olá amigo essa parte aqui está com o código duplicado "Player(i).AdcInt = Buffer.ReadByte", trazendo o erro de não receber pontos e adicionar automaticamente na agilidade ao upar de level.

_________________
Um tiro e 20 mortes.......-Desnecessário
MasterOp
MasterOp
Iniciante
Iniciante

Mensagens : 72
Créditos : 4

Ficha do personagem
Nível: 1
Experiência:
[Hells] Arvore de Habilidades Left_bar_bleue0/50[Hells] Arvore de Habilidades Empty_bar_bleue  (0/50)
Vida:
[Hells] Arvore de Habilidades Left_bar_bleue30/30[Hells] Arvore de Habilidades Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[Hells] Arvore de Habilidades Empty Goxtei !

Mensagem por Mega Maker Seg Mar 04, 2019 11:09 am

Muito bom ! Ajudou bastante !
Mega Maker
Mega Maker
Novato
Novato

Mensagens : 11
Créditos : 0

Ficha do personagem
Nível: 1
Experiência:
[Hells] Arvore de Habilidades Left_bar_bleue0/0[Hells] Arvore de Habilidades Empty_bar_bleue  (0/0)
Vida:
[Hells] Arvore de Habilidades Left_bar_bleue30/30[Hells] Arvore de Habilidades Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[Hells] Arvore de Habilidades Empty Re: [Hells] Arvore de Habilidades

Mensagem por Kenshiro Seg Mar 04, 2019 1:43 pm

Muito Bom Hells, mas creio que dava pra melhorar na parte do Player, adicionou muitas variáveis pra cada atributo. Poderia usar Array como os Stats do Jogador.
+1
Kenshiro
Kenshiro
Lenda
Lenda

Mensagens : 178
Créditos : 22

Ficha do personagem
Nível: 1
Experiência:
[Hells] Arvore de Habilidades Left_bar_bleue2/50[Hells] Arvore de Habilidades Empty_bar_bleue  (2/50)
Vida:
[Hells] Arvore de Habilidades Left_bar_bleue30/30[Hells] Arvore de Habilidades Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[Hells] Arvore de Habilidades Empty Re: [Hells] Arvore de Habilidades

Mensagem por GalaxyHells Ter Mar 05, 2019 10:55 am

Kenshiro escreveu:Muito Bom Hells, mas creio que dava pra melhorar na parte do Player, adicionou muitas variáveis pra cada atributo. Poderia usar Array como os Stats do Jogador.
+1
Sim, eu notei isso dps que eu fiz, mas não queria atualizar o tutorial. Inclusive aprendi algumas coias com o dragonick que deixam mais leve o tutorial.

_________________
[Hells] Arvore de Habilidades 90yel0
GalaxyHells
GalaxyHells
Ocasional
Ocasional

Mensagens : 196
Créditos : 22

Ficha do personagem
Nível: 1
Experiência:
[Hells] Arvore de Habilidades Left_bar_bleue0/0[Hells] Arvore de Habilidades Empty_bar_bleue  (0/0)
Vida:
[Hells] Arvore de Habilidades Left_bar_bleue30/30[Hells] Arvore de Habilidades Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[Hells] Arvore de Habilidades Empty Re: [Hells] Arvore de Habilidades

Mensagem por DragonicK Ter Mar 05, 2019 11:01 am

Aprendeu nada, sai fora. Não te ensine nada.
DragonicK
DragonicK
Experiente
Experiente

Mensagens : 542
Créditos : 81

Ficha do personagem
Nível: 1
Experiência:
[Hells] Arvore de Habilidades Left_bar_bleue0/0[Hells] Arvore de Habilidades Empty_bar_bleue  (0/0)
Vida:
[Hells] Arvore de Habilidades Left_bar_bleue30/30[Hells] Arvore de Habilidades Empty_bar_bleue  (30/30)

Ir para o topo Ir para baixo

[Hells] Arvore de Habilidades Empty Re: [Hells] Arvore de Habilidades

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