Bem vindo visitante.
Caso ainda não tenha uma conta,pedimos para que crie uma,assim você terá acesso a todos os links e imagens disponíveis no fórum.
Bem vindo visitante.
Caso ainda não tenha uma conta,pedimos para que crie uma,assim você terá acesso a todos os links e imagens disponíveis no fórum.

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

Transformação por imagem

Ir para baixo  Mensagem [Página 1 de 1]

1Transformação por imagem Empty Transformação por imagem Sex Fev 17, 2012 12:55 pm

Ricardo

Ricardo
Moderador Local
Moderador Local

Começando

Va na pasta data files\graphics\ e crie uma nova pasta chamada imagens e dentro dela adicione 2 fotos uma com nome "normal" e outra com nome "trans", sem aspas

Client~Side

Na frmMain crie 2 picture box com as configurações:

Picture1

Name: picNormal

Picture2

Name: picTrans


Dentro da picNormal adicione:

Código:
    Call SendNormal


E dentro da picTrans adicione:

Código:
    Call SendTrans


E agora no final do modClientTcp adicione:

Código:
Public Sub SendNormal()
    Dim Buffer As clsBuffer
    Set Buffer = New clsBuffer
   
    Buffer.WriteLong CNormal
   
    SendData Buffer.ToArray()
    Set Buffer = Nothing
End Sub

Public Sub SendTrans()
    Dim Buffer As clsBuffer
    Set Buffer = New clsBuffer
   
    Buffer.WriteLong CTrans
   
    SendData Buffer.ToArray()
    Set Buffer = Nothing
End Sub


Em modEnumerations ache:

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


E em cima adicione:

Código:
    CNormal
    CTrans


Agora procure por:

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


E acima adicione:

Código:
    SImagens


Procure por:

Código:
    HandleDataSub(SPartyVitals) = GetAddress(AddressOf HandlePartyVitals)


E abaixo adicione:

Código:
    HandleDataSub(SImagens) = GetAddress(AddressOf HandleImagens)


Agora no final do modHandleData adicione:

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

    If GetPlayerClass(Index) = 1 Then
        frmMain.picNormal.Picture = LoadPicture(App.Path & "\data files\graphics\imagens\normal.bmp")
        frmMain.picTrans.Picture = LoadPicture(App.Path & "\data files\graphics\imagens\trans.bmp")
    ElseIf GetPlayerClass(Index) = 2 Then
        ' Aqui é se vocÊ quiser pro mais classes
    End If

    Set Buffer = Nothing
End Sub


Serve~Side

Procure por:

Código:
    HandleDataSub(CPartyLeave) = GetAddress(AddressOf HandlePartyLeave)


E abaixo adicione:

Código:
    HandleDataSub(CNormal) = GetAddress(AddressOf HandleNormal)
    HandleDataSub(CTrans) = GetAddress(AddressOf HandleTrans
)

E no final do modHandleData adicione:

Código:
Sub HandleNormal(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim Buffer As clsBuffer
   
    If GetPlayerSprite(Index) = 2 Then
        If GetPlayerClass(Index) = 1 Then
            Call SetPlayerSprite(Index, 1)
            Call SetPlayerStat(Index, Stats.Strength, GetPlayerRawStat(Index, Stats.Strength) - 1)
            Call SetPlayerStat(Index, Stats.Endurance, GetPlayerRawStat(Index, Stats.Endurance) - 1)
        End If
    End If
   
    Set Buffer = Nothing
End Sub

Sub HandleTrans(ByVal Index As Long, ByRef Data() As Byte, ByVal StartAddr As Long, ByVal ExtraVar As Long)
Dim Buffer As clsBuffer
   
    If GetPlayerSprite(Index) = 1 Then
        If GetPlayerClass(Index) = 1 Then
            Call SetPlayerSprite(Index, 2)
            Call SetPlayerStat(Index, Stats.Strength, GetPlayerRawStat(Index, Stats.Strength) + 1)
            Call SetPlayerStat(Index, Stats.Endurance, GetPlayerRawStat(Index, Stats.Endurance) + 1)
        End If
    End If
   
    Set Buffer = Nothing
End Sub


Em modEnumerations ache:

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


E em cima adicione:

Código:
    CNormal
    CTrans


Agora procure por:

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


E acima adicione:

SImagens

E no final do modServeTcp adicione:

Código:
Sub SendImagens(ByVal Index As Long)
Dim Buffer As clsBuffer
   
    Set Buffer = New clsBuffer
    Buffer.WriteLong SImagens
   
    SendDataToMap GetPlayerMap(Index), Buffer.ToArray()
    Set Buffer = Nothing
End Sub


Procure por:

Código:
    Call SendHotbar(Index)


E abaixo adicione:

Código:
    Call SendImagens(Index)


Creditos:

Ricardo

Ir para o topo  Mensagem [Página 1 de 1]

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