Todo sobre AO
 
ÍndiceFAQBuscarMiembrosGrupos de UsuariosRegistrarseConectarse

Comparte | 
 

 Eleccion de cabezas al crear pj

Ver el tema anterior Ver el tema siguiente Ir abajo 
AutorMensaje
Agus
Admin


Mensajes : 69
Fecha de inscripción : 01/07/2008

MensajeTema: Eleccion de cabezas al crear pj   Lun Ago 25, 2008 1:32 am

CLIENTE
1-Creamos un modulo que tenga esto:
Citación :

Option Explicit

Public MiCuerpo As Integer, MiCabeza As Integer

Private Sub DrawGrafico(Grh As Grh, ByVal x As Byte, ByVal Y As Byte)

Dim r2 As RECT, auxr As RECT
Dim iGrhIndex As Integer

If Grh.GrhIndex <= 0 Then Exit Sub

iGrhIndex = GrhData(Grh.GrhIndex).Frames(Grh.FrameCounter)

With r2
.Left = GrhData(iGrhIndex).sX
.Top = GrhData(iGrhIndex).sY
.Right = .Left + GrhData(iGrhIndex).pixelWidth
.Bottom = .Top + GrhData(iGrhIndex).pixelHeight
End With

With auxr
.Left = 0
.Top = 0
.Right = 50
.Bottom = 65
End With

BackBufferSurface.BltFast x, Y, SurfaceDB.Surface(GrhData(iGrhIndex).FileNum), r2, DDBLTFAST_SRCCOLORKEY Or DDBLTFAST_WAIT
Call BackBufferSurface.BltToDC(frmCrearPersonaje.PlayerView.hdc, auxr, auxr)

End Sub

Sub DibujarCPJ(ByVal MyBody As Integer, ByVal MyHead As Integer)

Dim Grh As Grh
Dim Pos As Integer
Dim r2 As RECT

With r2
.Left = 0
.Top = 0
.Right = 50
.Bottom = 65
End With

BackBufferSurface.BltColorFill r2, vbBlack

Grh = BodyData(MyBody).Walk(3)
Call DrawGrafico(Grh, 12, 15)

Pos = BodyData(MyBody).HeadOffset.Y + GrhData(GrhData(Grh.GrhIndex).Frames(1)).pixelHeight
Grh = HeadData(MyHead).Head(3)
Call DrawGrafico(Grh, 17, Pos)

frmCrearPersonaje.PlayerView.Refresh

End Sub

Sub DameOpciones()

Dim i As Integer

If frmCrearPersonaje.lstGenero.listIndex < 0 Or frmCrearPersonaje.lstRaza.listIndex < 0 Then
frmCrearPersonaje.cabeza.Enabled = False
ElseIf frmCrearPersonaje.lstGenero.listIndex <> -1 And frmCrearPersonaje.lstRaza.listIndex <> -1 Then
frmCrearPersonaje.cabeza.Enabled = True
End If

frmCrearPersonaje.cabeza.Clear

Select Case frmCrearPersonaje.lstGenero.List(frmCrearPersonaje.lstGenero.listIndex)
Case "Hombre"
Select Case frmCrearPersonaje.lstRaza.List(frmCrearPersonaje.lstRaza.listIndex)
Case "Humano"
For i = 1 To 30
frmCrearPersonaje.cabeza.AddItem i
Next i
MiCuerpo = 1
Case "Elfo"
For i = 101 To 113
If i = 113 Then i = 201
frmCrearPersonaje.cabeza.AddItem i
Next i
MiCuerpo = 2
Case "Elfo Oscuro"
For i = 202 To 209
frmCrearPersonaje.cabeza.AddItem i
Next i
MiCuerpo = 3
Case "Enano"
For i = 301 To 305
frmCrearPersonaje.cabeza.AddItem i
Next i
MiCuerpo = 52
Case "Gnomo"
For i = 401 To 406
frmCrearPersonaje.cabeza.AddItem i
Next i
MiCuerpo = 52
Case Else
UserHead = 1
MiCuerpo = 1
End Select
Case "Mujer"
Select Case frmCrearPersonaje.lstRaza.List(frmCrearPersonaje.lstRaza.listIndex)
Case "Humano"
For i = 70 To 76
frmCrearPersonaje.cabeza.AddItem i
Next i
MiCuerpo = 1
Case "Elfo"
For i = 170 To 176
frmCrearPersonaje.cabeza.AddItem i
Next i
MiCuerpo = 2
Case "Elfo Oscuro"
For i = 270 To 280
frmCrearPersonaje.cabeza.AddItem i
Next i
MiCuerpo = 3
Case "Gnomo"
For i = 470 To 474
frmCrearPersonaje.cabeza.AddItem i
Next i
MiCuerpo = 52
Case "Enano"
UserHead = RandomNumber(1, 3) + 369
MiCuerpo = 52
Case Else
frmCrearPersonaje.cabeza.AddItem "70"
MiCuerpo = 1
End Select
End Select

frmCrearPersonaje.PlayerView.Cls

End Sub
2- Vamos al frmCrearPersonaje y agregamos un picturebox con las siguientes propiedades:
Citación :

Name = "PlayerView"
AutoRedraw = "True"
Height = 65
Width = 50

3- Dentro del frmCrearPersonaje creamos un ComboBox con la propiedad Name = "cabeza"
4- Agregamos esto al final del codigo del frmCrearPersonaje :
Citación :

Private Sub cabeza_Click()
MiCabeza = Val(cabeza.List(cabeza.listIndex))
Call DibujarCPJ(MiCuerpo, MiCabeza)
End Sub

Private Sub lstGenero_Click()
Call DameOpciones
End Sub

Private Sub lstRaza_Click()
Call DameOpciones
End Sub
4- Buscamos esta linea:
Citación :

& "," & UserHogar & "," & Versiones(1) & "," & Versiones(2) & "," & Versiones(3) & "," & Versiones(4) & "," & Versiones(5) & "," & Versiones(6) & "," & Versiones(7) & "," & valcode & MD5HushYo)
Y la reemplazamos por esta:
Citación :

& "," & UserHogar & "," & Versiones(1) & "," & Versiones(2) & "," & Versiones(3) & "," & Versiones(4) & "," & Versiones(5) & "," & Versiones(6) & "," & Versiones(7) & "," & valcode & "," & micabeza & MD5HushYo)
SERVIDOR
1- Reemplazamos esta linea:
Citación :

Call ConnectNewUser(UserIndex, ReadField(1, rData, 44), ReadField(2, rData, 44), ReadField(4, rData, 44), ReadField(5, rData, 44), ReadField(6, rData, 44), ReadField(7, rData, 44), _
ReadField(8, rData, 44), ReadField(9, rData, 44), ReadField(10, rData, 44), ReadField(11, rData, 44), ReadField(12, rData, 44), ReadField(13, rData, 44), _
ReadField(14, rData, 44), ReadField(15, rData, 44), ReadField(16, rData, 44), ReadField(17, rData, 44), ReadField(18, rData, 44), ReadField(19, rData, 44), _
ReadField(20, rData, 44), ReadField(21, rData, 44), ReadField(22, rData, 44), ReadField(23, rData, 44), ReadField(24, rData, 44), ReadField(25, rData, 44), _
ReadField(26, rData, 44), ReadField(27, rData, 44), ReadField(28, rData, 44), ReadField(29, rData, 44))
Por esta:
Citación :

Call ConnectNewUser(UserIndex, ReadField(1, rData, 44), ReadField(2, rData, 44), ReadField(4, rData, 44), ReadField(5, rData, 44), ReadField(6, rData, 44), ReadField(7, rData, 44), _
ReadField(8, rData, 44), ReadField(9, rData, 44), ReadField(10, rData, 44), ReadField(11, rData, 44), ReadField(12, rData, 44), ReadField(13, rData, 44), _
ReadField(14, rData, 44), ReadField(15, rData, 44), ReadField(16, rData, 44), ReadField(17, rData, 44), ReadField(18, rData, 44), ReadField(19, rData, 44), _
ReadField(20, rData, 44), ReadField(21, rData, 44), ReadField(22, rData, 44), ReadField(23, rData, 44), ReadField(24, rData, 44), ReadField(25, rData, 44), _
ReadField(26, rData, 44), ReadField(27, rData, 44), ReadField(28, rData, 44), ReadField(29, rData, 44), ReadField(38, rData, 44))
2- Buscamos esta linea:
Citación :

Call DarCuerpoYCabeza(UserList(UserIndex).Char.Body, UserList(UserIndex).Char.Head, UserList(UserIndex).Raza, UserList(UserIndex).Genero)
y debajo colocamos:
Citación :

UserList(UserIndex).Char.Head = Head
3- Buscamos esta linea:
Citación :

Sub ConnectNewUser(UserIndex As Integer, name As String, PassWord As String, UserRaza As String, UserSexo As String, UserClase As String, _
US1 As String, US2 As String, US3 As String, US4 As String, US5 As String, _
US6 As String, US7 As String, US8 As String, US9 As String, US10 As String, _
US11 As String, US12 As String, US13 As String, US14 As String, US15 As String, _
US16 As String, US17 As String, US18 As String, US19 As String, US20 As String, _
US21 As String, UserEmail As String, Hogar As String)
Y reemplazamos por:
Citación :

Sub ConnectNewUser(UserIndex As Integer, name As String, PassWord As String, UserRaza As String, UserSexo As String, UserClase As String, _
US1 As String, US2 As String, US3 As String, US4 As String, US5 As String, _
US6 As String, US7 As String, US8 As String, US9 As String, US10 As String, _
US11 As String, US12 As String, US13 As String, US14 As String, US15 As String, _
US16 As String, US17 As String, US18 As String, US19 As String, US20 As String, _
US21 As String, UserEmail As String, Hogar As String, Head As Integer)
Volver arriba Ir abajo
Ver perfil de usuario http://recompilacionao.forosactivos.com
 
Eleccion de cabezas al crear pj
Ver el tema anterior Ver el tema siguiente Volver arriba 
Página 1 de 1.
 Temas similares
-
» traducción manual SDK a español- crear mapas, repaints etc
» crear grupo facebook
» [Tutorial] Crear una Cinemática
» Ayuda a crear mazo Azul dekeo descarte
» Ayuda para crear un mazo azul de control

Permisos de este foro:No puedes responder a temas en este foro.
 :: Argentum Online :: jijijijijiij-
Cambiar a: