Convidado Convidado
| Assunto: Transformação por imagem Dom 06 Nov 2011, 10:04 | |
| 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:
- Citação :
- 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 |
|
Convidado Convidado
| Assunto: Re: Transformação por imagem Qua 15 Fev 2012, 14:30 | |
| Ae Ricardo Eu fiz do jeitim que ta aii mais ele n ta dando pra Trasn Olha - Código:
-
|
|