SpikeL Comunidad
Hola, bienvenido a SpikeL Foro.

Si eres nuevo, deves registrarte.

Si ya tienes una cuenta, deves ingresar.

¡Muchas gracias!

PD: Si te has registrado pero no puedes logear tienes que activar tu cuenta desde tu e-mail.


Unirse al foro, es rápido y fácil

SpikeL Comunidad
Hola, bienvenido a SpikeL Foro.

Si eres nuevo, deves registrarte.

Si ya tienes una cuenta, deves ingresar.

¡Muchas gracias!

PD: Si te has registrado pero no puedes logear tienes que activar tu cuenta desde tu e-mail.
SpikeL Comunidad
¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.

Sistema de cuentas

Ir abajo

Sistema de cuentas Empty Sistema de cuentas

Mensaje por santi55 Lun Dic 20, 2010 3:28 pm

CLIENTE

1- Empezaremos añadiendo estos Tres forms a nuestro proyecto:

[Tienes que estar registrado y conectado para ver este vínculo]



2- Buscamos en el Sub Form_Load() del frmMain:



Me.Left = 0
Me.Top = 0



Y debajo agregamos:



Unload frmConnect
Unload CreandoCuenta



3- Buscan estas 3 funciones:



Public Function CurServerPasRecPort() As Integer
Public Function CurServerIp() As String
Public Function CurServerPort() As Integer



Y las reemplazan esos tres por estos:


Public Function CurServerPasRecPort() As Integer
CurServerPasRecPort = "7667"
End Function

Public Function CurServerIp() As String
CurServerIp = "127.0.0.1"
End Function

Public Function CurServerPort() As Integer
CurServerPort = "7666"
End Function



Ahi configuran su IP y puerto ..

4- Remplazan la funcion CheckUserData por esta:



Function CheckUserData(ByVal checkemail As Boolean) As Boolean
Dim loopc As Long
Dim CharAscii As Integer

If checkemail And UserEmail = "" Then
MsgBox ("Dirección de email invalida")
Exit Function
End If

If UserPassword = "" Then
MsgBox ("Ingrese un password.")
Exit Function
End If

For loopc = 1 To Len(UserPassword)
CharAscii = Asc(mid$(UserPassword, loopc, 1))
If Not LegalCharacter(CharAscii) Then
MsgBox ("Password inválido. El caractér " & Chr$(CharAscii) & " no está permitido.")
Exit Function
End If
Next loopc

If Len(UserName) > 30 Then
MsgBox ("El nombre debe tener menos de 30 letras.")
Exit Function
End If

For loopc = 1 To Len(UserName)
CharAscii = Asc(mid$(UserName, loopc, 1))
If Not LegalCharacter(CharAscii) Then
MsgBox ("Nombre inválido. El caractér " & Chr$(CharAscii) & " no está permitido.")
Exit Function
End If
Next loopc

CheckUserData = True
End Function



5- Buscamos en el modulo Declaraciones:



Public UserName As String



Y debajo agregamos:



Public Cuenta As String
Public Password As String
Public NumPjs As byte

Public Type tPjsCuenta
Nombre As String
Pos As String
Clase As String
Status As String
Oro As Long
Muerto As Byte
Nivel As Byte
Head As Integer
Body As Integer
Arma As Byte
Escu As Byte
End Type

Public PjCuenta() As tPjsCuenta



6- Buscamos:



Select Case Left(sData, 6)



Y debajo agregamos:



Case "NUMPJS"
sData = Right$(sData, Len(sData) - 6)
NumPjs = Val(sData)

If NumPjs <= 0 Then
Form2.Label1.Visible = False
Form2.Picture1.Visible = False
Form2.Show
MsgBox "No tenes pjs, creá uno"
Exit Sub
End If

Form2.Label1.Visible = True
Form2.Picture1.Visible = True
Form2.Show

ReDim PjCuenta(1 To NumPjs)
Exit Sub



7- Al principio del Form_Load() del frmCrearPersonaje agregamos:



Private Sub Form_Load()



Y debajo agregamos:



Unload Form2



8- Buscamos Case "FINOK" y debajo ponemos:



Unload Form2



9- En el modulo TCP.bas, buscamos el Case "AS"y arriba agregamos:



Case "PJ"
sData = Right$(sData, Len(sData) - 2)
Dim Datos As String

For i = 1 To NumPjs
Dim NroDePj As Integer
Datos = ReadField(i, sData, Asc("~"))
NroDePj = Val(Left$(Datos, 1))

If NroDePj < 1 Then Exit Sub

Datos = Right$(Datos, Len(Datos) - 1) 'saco el nro
With PjCuenta(i)
.Nombre = ReadField(1, Datos, Asc(","))
.Pos = ReadField(2, Datos, Asc(","))
.Oro = ReadField(3, Datos, Asc(","))
.Muerto = ReadField(4, Datos, Asc(","))
.Clase = ReadField(5, Datos, Asc(","))
.Nivel = ReadField(6, Datos, Asc(","))
If ReadField(7, Datos, Asc(",")) <= 0 Then
.Status = "Criminal"
Else
.Status = "Ciudadano"
End If
.Head = ReadField(8, Datos, Asc(","))
.Body = ReadField(9, Datos, Asc(","))
.Escu = ReadField(10, Datos, Asc(","))
.Arma = ReadField(11, Datos, Asc(","))

'pongo en mayus la primer letra nomas
.Clase = Left$(.Clase, 1) & Right$(LCase$(.Clase), Len(.Clase) - 1)
.Nombre = Left$(.Nombre, 1) & Right$(LCase$(.Nombre), Len(.Nombre) - 1)
End With
Next i

For i = 1 To NumPjs
With Form2.Option1(i)
.Enabled = True
.Visible = True
.Caption = PjCuenta(i).Nombre
End With
Next i
Exit Sub



10- Buscamos el Case "VAL"y lo remplazamos todo el case hasta arriba del Case "BKW"por esto:



Case "VAL" ' >>>>> Validar Cliente :: VAL
Dim ValString As String
Rdata = Right$(Rdata, Len(Rdata) - 3)
bK = CLng(ReadField(1, Rdata, Asc(",")))
bRK = ReadField(2, Rdata, Asc(","))
ValString = ReadField(3, Rdata, Asc(","))
Call CargarCabezas

If EstadoLogin = BorrarPj Then
Call SendData("BORR" & frmBorrar.txtNombre.Text & "," & frmBorrar.txtPasswd.Text & "," & ValidarLoginMSG(CInt(Rdata)))
ElseIf EstadoLogin = LogCuenta Or EstadoLogin = adentrocuenta Or EstadoLogin = CrearNuevoPj Then
Call Login(ValidarLoginMSG(CInt(bRK)))
ElseIf EstadoLogin = Dados Then
frmCrearPersonaje.Show vbModal
End If
Exit Sub



11- Reemplazamos todo el Sub Login por este:



Sub Login(ByVal valcode As Integer)

If EstadoLogin = LogCuenta Then
SendData ("CLOGIN" & Cuenta & "," & UserPassword)
ElseIf EstadoLogin = adentrocuenta Then
SendData ("OLOGIN" & UserName)
ElseIf EstadoLogin = CrearNuevoPj Then
SendData ("NLOGIN" & frmCrearPersonaje.txtNombre & "," & UserPassword _
& "," & UserRaza & "," & UserSexo & "," & UserClase & "," & UserSkills(1) & "," & UserSkills(2) _
& "," & UserSkills(3) & "," & UserSkills(4) & "," & UserSkills(5) & "," & UserSkills(6) _
& "," & UserSkills(7) & "," & UserSkills(Cool & "," & UserSkills(9) & "," & UserSkills(10) _
& "," & UserSkills(11) & "," & UserSkills(12) & "," & UserSkills(13) & "," & UserSkills(14) _
& "," & UserSkills(15) & "," & UserSkills(16) & "," & UserSkills(17) & "," & UserSkills(18) _
& "," & UserSkills(19) & "," & UserSkills(20) & "," & UserSkills(21) & "," & UserEmail _
& "," & UserHogar & "," & Cuenta)
End If
End Sub



12- Reemplazamos todo el Sub Socket1_Connect() del frmMain por este:



Private Sub Socket1_Connect()

Second.Enabled = True
Call SendData("gIvEmEvAlcOde")

End Sub



13- Buscamos:



Public Enum E_MODO
Normal = 1
BorrarPj = 2
CrearNuevoPj = 3
Dados = 4
RecuperarPass = 5
End Enum



Y lo remplazamos por:



Public Enum E_MODO
LogCuenta = 1
BorrarPj = 2
CrearNuevoPj = 3
Dados = 4
RecuperarPass = 5
AdentroCuenta = 6
CrearCuenta = 7
End Enum



14- En el frmOldPersonaje buscamos EstadoLogin = Normaly remplazamos por:



EstadoLogin = AdentroCuenta



15- Reemplazamos todo el codigo del frmConnectpor este:



Option Explicit

Dim PasswordTexT As String

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 27 Then
frmCargando.Show
frmCargando.Refresh
AddtoRichTextBox frmCargando.status, "Cerrando Argentum Online.", 0, 0, 0, 1, 0, 1
Call SaveGameini
frmConnect.MousePointer = 1
frmMain.MousePointer = 1
prgRun = False
AddtoRichTextBox frmCargando.status, "Liberando recursos..."
frmCargando.Refresh
LiberarObjetosDX
AddtoRichTextBox frmCargando.status, "Hecho", 0, 0, 0, 1, 0, 1
AddtoRichTextBox frmCargando.status, "¡¡Gracias por jugar Argentum Online!!", 0, 0, 0, 1, 0, 1
frmCargando.Refresh
Call UnloadAllForms
End If
End Sub

Private Sub Form_Load()

EngineRun = False

Dim j
For Each j In Image1()
j.Tag = "0"
Next

End Sub

Private Sub Image1_Click(index As Integer)

Call Audio.PlayWave(SND_CLICK)

frmMain.Socket1.HostName = CurServerIp
frmMain.Socket1.RemotePort = CurServerPort

Select Case index
Case 0
EstadoLogin = CrearCuenta

If frmMain.Socket1.Connected Then
frmMain.Socket1.Disconnect
frmMain.Socket1.Cleanup
End If

frmMain.Socket1.Connect
Me.MousePointer = 11
DoEvents
CreandoCuenta.Show
Case 1
If frmMain.Socket1.Connected Then frmMain.Socket1.Disconnect
If frmConnect.MousePointer = 11 Then Exit Sub

Cuenta = NameTxt.Text
UserPassword = PasswordTxt

If CheckUserData(False) = True Then
EstadoLogin = LogCuenta
Me.MousePointer = 11
frmMain.Socket1.Connect
End If
End Select
Exit Sub
End Sub



IMPORTANTE:
Ahora, en el form, Borramos todo, y dejamos Image1(1), que será el boton de loguear cuenta,
y Image1(0), que seria la de Crear la cuenta, y después creamos dos TextBox, uno con
el nombre NameTxt, y el otro con el nombre PasswordTxT, aquí es donde introduciremos nuestro,
nombre, y pass, de la cuenta.


SERVIDOR

1- Buscamos Case "NLOGIN"y remplazamos todo el case hasta antes de End Select por esto:



Case "NCUENT"

rData = Right$(rData, Len(rData) - 6)

Dim NCuenta As String
Dim Passw As String
Dim Mail As String

'cuentas
NCuenta = ReadField(1, rData, Asc(","))
Passw = ReadField(2, rData, Asc(","))
Mail = ReadField(3, rData, Asc(","))

Call CrearCuenta(UserIndex, NCuenta, Passw, Mail)

Case "NLOGIN"
If PuedeCrearPersonajes = 0 Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRLa creacion de personajes en este servidor se ha deshabilitado.")
Call CloseSocket(UserIndex)
Exit Sub
End If

If ServerSoloGMs <> 0 Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRServidor restringido a administradores. Consulte la página oficial o el foro oficial para mas información.")
Call CloseSocket(UserIndex)
Exit Sub
End If

If aClon.MaxPersonajes(UserList(UserIndex).ip) Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRHas creado demasiados personajes.")
Call CloseSocket(UserIndex)
Exit Sub
End If

rData = Right$(rData, Len(rData) - 6)

Call ConnectNewUser(UserIndex, ReadField(1, rData, 44), ReadField(2, rData, 44), ReadField(3, 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(12, rData, 44), ReadField(13, 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))

Exit Sub
End Select



2- Buscamos:



Public IniPath As String



Y debajo agregamos:



Public CuentasPath As String



3- Buscamos:



IniPath = App.Path & ""



Y debajo agregamos:


CuentasPath = App.Path & "\Cuentas"



4- Reemplazamos todo el Case "OLOGIN" por este:



Case "OLOGIN"
rData = Right$(rData, Len(rData) - 6)

If Not AsciiValidos(ReadField(1, rData, 44)) Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRNombre invalido.")
Call CloseSocket(UserIndex, True)
Exit Sub
End If

If Not PersonajeExiste(ReadField(1, rData, 44)) Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERREl personaje no existe.")
Call CloseSocket(UserIndex, True)
Exit Sub
End If

If Not BANCheck(ReadField(1, rData, 44)) Then
Call ConnectCuenta(UserIndex, ReadField(1, rData, 44), ReadField(2, rData, 44))
Else
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRSe te ha prohibido la entrada a Argentum debido a tu mal comportamiento. Consulta en aocp.alkon.com.ar/est para ver el motivo de la prohibición.")
End If
Exit Sub

Case "CLOGIN"
rData = Right$(rData, Len(rData) - 6)

If Not AsciiValidos(ReadField(1, rData, 44)) Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRNombre invalido.")
Call CloseSocket(UserIndex, True)
Exit Sub
End If

If Not CuentaExiste(ReadField(1, rData, 44)) Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRLa cuenta no existe.")
Call CloseSocket(UserIndex, True)
Exit Sub
End If

Call ConnectCuenta(UserIndex, ReadField(1, rData, 44), ReadField(2, rData, 44))
Exit Sub

Case "~BORRA"
rData = Right$(rData, Len(rData) - 6)

Dim Cuenta As String, Archivo As String

Cuenta = UCase$(ReadField(2, rData, Asc(",")))
rData = ReadField(1, rData, Asc(","))
Archivo = CuentasPath & Cuenta & ".ct"

For i = 1 To val(GetVar(Archivo, "INIT", "NumPjs"))
If UCase$(GetVar(Archivo, "INIT", "PJ" & i)) = UCase$(rData) Then
Call WriteVar(Archivo, "INIT", "PJ" & i, "")
Call WriteVar(Archivo, "INIT", "NumPjs", val(GetVar(Archivo, "INIT", "NumPjs")) - 1)
BorrarUsuario (rData)
Exit For
End If
Next i
Exit Sub



5- Buscamos:



Public Function PersonajeExiste(ByVal name As String) As Boolean



y arriba agregamos:



Public Function CuentaExiste(ByVal Cuenta As String) As Boolean

CuentaExiste = FileExist(CuentasPath & UCase$(Cuenta) & ".ct", vbNormal)

End Function



6- Arriba del Sub ConnectNewUser agregamos:



Sub CrearCuenta(UserIndex As Integer, Nombre As String, Pass As String, Mail As String)

If Not AsciiValidos(Nombre) Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRNombre invalido.")
Exit Sub
End If

If FileExist(CuentasPath & UCase$(Nombre) & ".ct", vbNormal) = True Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRYa existe la cuenta.")
Exit Sub
End If

Call WriteVar(CuentasPath & UCase$(Nombre) & ".ct", "INIT", "Password", Pass)
Call WriteVar(CuentasPath & UCase$(Nombre) & ".ct", "INIT", "NumPjs", 0)
Call WriteVar(CuentasPath & UCase$(Nombre) & ".ct", "INIT", "Mail", Mail)

Call SendData(SendTarget.ToIndex, UserIndex, 0, "NumPjs")

End Sub

Sub ConnectCuenta(ByVal UserIndex As Integer, name As String, Password As String)

Dim NumPjs As Integer
Dim Nombre() As String
Dim Pos() As String
Dim Oro() As Long
Dim Muerto() As Byte
Dim Clase() As String
Dim Nivel() As String
Dim Status() As Integer
Dim Escu() As Byte
Dim Arma() As Byte
Dim Head() As Integer
Dim Body() As Integer
Dim ArchivoDeUser As String
Dim i As Integer
Dim cosa As String

'¿Existe la cuenta?
If Not CuentaExiste(name) Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRLa cuenta no existe.")
Call CloseSocket(UserIndex)
Exit Sub
End If

'¿Es el passwd valido?
If UCase$(Password) <> UCase$(GetVar(CuentasPath & UCase$(name) & ".ct", "INIT", "Password")) Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRPassword incorrecto.")
Call CloseSocket(UserIndex)
Exit Sub
End If

'Info
NumPjs = val(GetVar(CuentasPath & name & ".ct", "INIT", "NumPjs"))
Debug.Print NumPjs & " numpjs"

If NumPjs = 0 Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "NUMPJS0")
Exit Sub
End If

ReDim Nombre(1 To NumPjs)

Call SendData(SendTarget.ToIndex, UserIndex, 0, "NUMPJS" & NumPjs)

ArchivoDeUser = App.Path & "\charfile"

For i = 1 To NumPjs
Nombre(i) = GetVar(CuentasPath & name & ".ct", "INIT", "PJ" & i)
Pos(i) = GetVar(ArchivoDeUser & Nombre(i) & ".chr", "INIT", "Position")
Oro(i) = val(GetVar(ArchivoDeUser & Nombre(i) & ".chr", "STATS", "GLD"))
Muerto(i) = GetVar(ArchivoDeUser & Nombre(i) & ".chr", "FLAGS", "Muerto")
Clase(i) = GetVar(ArchivoDeUser & Nombre(i) & ".chr", "INIT", "Clase")
Nivel(i) = GetVar(ArchivoDeUser & Nombre(i) & ".chr", "STATS", "ELV")
Status(i) = GetVar(ArchivoDeUser & Nombre(i) & ".chr", "REP", "Promedio")
Head(i) = GetVar(ArchivoDeUser & Nombre(i) & ".chr", "INIT", "Head")
Body(i) = GetVar(ArchivoDeUser & Nombre(i) & ".chr", "INIT", "Body")
Arma(i) = GetVar(ArchivoDeUser & Nombre(i) & ".chr", "INIT", "Arma")
Escu(i) = GetVar(ArchivoDeUser & Nombre(i) & ".chr", "INIT", "Escudo")
Sleep 1
DoEvents
cosa = cosa & i & Nombre(i) & "," & Pos(i) & "," & Oro(i) & "," & Muerto(i) & "," & Clase(i) & "," & Nivel(i) & "," & Status(i) & "," & Head(i) & "," & Body(i) & ," & Escu(i) & "," & Arma(i) & "~"
Next i

DoEvents
Sleep 1

Call SendData(SendTarget.ToIndex, UserIndex, 0, "PJ" & cosa)

End Sub








7- Reemplazamos todo el Sub ConnectNewUser por este:


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, Cuenta As String)

If Not AsciiValidos(name) Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRNombre invalido.")
Exit Sub
End If

Dim LoopC As Integer
Dim totalskpts As Long
Dim NumeroPjs As Integer
Dim MiInt As Long

'¿Existe el personaje?
If FileExist(CharPath & UCase$(name) & ".chr", vbNormal) = True Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRYa existe el personaje.")
Exit Sub
End If

'Tiró los dados antes de llegar acá??
If UserList(UserIndex).Stats.UserAtributos(eAtributos.Fuerza) = 0 Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRDebe tirar los dados antes de poder crear un personaje.")
Exit Sub
End If

If val(GetVar(CuentasPath & Cuenta & ".ct", "INIT", "NumPjs")) >= 8 Then
Call SendData(SendTarget.ToIndex, UserIndex, 0, "ERRNo podes crear mas personajes desde esta cuenta, si queres otro, elimina alguno.")
Exit Sub
End If

UserList(UserIndex).flags.Muerto = 0
UserList(UserIndex).flags.Escondido = 0

UserList(UserIndex).name = name
UserList(UserIndex).Clase = UserClase
UserList(UserIndex).Raza = UserRaza
UserList(UserIndex).Genero = UserSexo
UserList(UserIndex).email = UserEmail
UserList(UserIndex).Hogar = Hogar

'Alineacion eliminada
UserList(UserIndex).NombreCuenta = Cuenta

NumeroPjs = val(GetVar(CuentasPath & Cuenta & ".ct", "INIT", "NumPjs"))

Call WriteVar(CuentasPath & UserList(UserIndex).NombreCuenta & ".ct", "INIT", "NumPjs", NumeroPjs + 1)
Call WriteVar(CuentasPath & UserList(UserIndex).NombreCuenta & ".ct", "INIT", "PJ" & NumeroPjs + 1, UserList(UserIndex).name)

Select Case UCase$(UserRaza)
Case "HUMANO"
UserList(UserIndex).Stats.UserAtributos(eAtributos.Fuerza) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Fuerza) + 1
UserList(UserIndex).Stats.UserAtributos(eAtributos.Agilidad) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Agilidad) + 1
UserList(UserIndex).Stats.UserAtributos(eAtributos.Constitucion) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Constitucion) + 2
Case "ELFO"
UserList(UserIndex).Stats.UserAtributos(eAtributos.Agilidad) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Agilidad) + 4
UserList(UserIndex).Stats.UserAtributos(eAtributos.Inteligencia) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Inteligencia) + 2
UserList(UserIndex).Stats.UserAtributos(eAtributos.Carisma) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Carisma) + 2
Case "ELFO OSCURO"
UserList(UserIndex).Stats.UserAtributos(eAtributos.Fuerza) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Fuerza) + 2
UserList(UserIndex).Stats.UserAtributos(eAtributos.Agilidad) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Agilidad) + 2
UserList(UserIndex).Stats.UserAtributos(eAtributos.Inteligencia) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Inteligencia) + 2
UserList(UserIndex).Stats.UserAtributos(eAtributos.Carisma) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Carisma) - 3
Case "ENANO"
UserList(UserIndex).Stats.UserAtributos(eAtributos.Fuerza) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Fuerza) + 3
UserList(UserIndex).Stats.UserAtributos(eAtributos.Constitucion) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Constitucion) + 3
UserList(UserIndex).Stats.UserAtributos(eAtributos.Inteligencia) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Inteligencia) - 6
UserList(UserIndex).Stats.UserAtributos(eAtributos.Agilidad) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Agilidad) - 1
UserList(UserIndex).Stats.UserAtributos(eAtributos.Carisma) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Carisma) - 2
Case "GNOMO"
UserList(UserIndex).Stats.UserAtributos(eAtributos.Fuerza) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Fuerza) - 4
UserList(UserIndex).Stats.UserAtributos(eAtributos.Inteligencia) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Inteligencia) + 3
UserList(UserIndex).Stats.UserAtributos(eAtributos.Agilidad) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Agilidad) + 3
UserList(UserIndex).Stats.UserAtributos(eAtributos.Carisma) = UserList(UserIndex).Stats.UserAtributos(eAtributos.Carisma) + 1
End Select

totalskpts = 0

UserList(UserIndex).Stats.UserSkills(1) = val(US1)
UserList(UserIndex).Stats.UserSkills(2) = val(US2)
UserList(UserIndex).Stats.UserSkills(3) = val(US3)
UserList(UserIndex).Stats.UserSkills(4) = val(US4)
UserList(UserIndex).Stats.UserSkills(5) = val(US5)
UserList(UserIndex).Stats.UserSkills(6) = val(US6)
UserList(UserIndex).Stats.UserSkills(7) = val(US7)
UserList(UserIndex).Stats.UserSkills(Cool = val(US8)
UserList(UserIndex).Stats.UserSkills(9) = val(US9)
UserList(UserIndex).Stats.UserSkills(10) = val(US10)
UserList(UserIndex).Stats.UserSkills(11) = val(US11)
UserList(UserIndex).Stats.UserSkills(12) = val(US12)
UserList(UserIndex).Stats.UserSkills(13) = val(US13)
UserList(UserIndex).Stats.UserSkills(14) = val(US14)
UserList(UserIndex).Stats.UserSkills(15) = val(US15)
UserList(UserIndex).Stats.UserSkills(16) = val(US16)
UserList(UserIndex).Stats.UserSkills(17) = val(US17)
UserList(UserIndex).Stats.UserSkills(18) = val(US18)
UserList(UserIndex).Stats.UserSkills(19) = val(US19)
UserList(UserIndex).Stats.UserSkills(20) = val(US20)
UserList(UserIndex).Stats.UserSkills(21) = val(US21)

For LoopC = 1 To NUMSKILLS
totalskpts = totalskpts + Abs(UserList(UserIndex).Stats.UserSkills(LoopC))
Next LoopC

If totalskpts > 10 Then
Call LogHackAttemp(UserList(UserIndex).name & " intento hackear los skills.")
Call BorrarUsuario(UserList(UserIndex).name)
Call CloseSocket(UserIndex)
Exit Sub
End If

UserList(UserIndex).Password = Password
UserList(UserIndex).Char.Heading = eHeading.SOUTH

Call DarCuerpoYCabeza(UserList(UserIndex).Char.Body, UserList(UserIndex).Char.Head, UserList(UserIndex).Raza, UserList(UserIndex).Genero)
UserList(UserIndex).OrigChar = UserList(UserIndex).Char

UserList(UserIndex).Char.WeaponAnim = NingunArma
UserList(UserIndex).Char.ShieldAnim = NingunEscudo
UserList(UserIndex).Char.CascoAnim = NingunCasco

UserList(UserIndex).Stats.MET = 1

MiInt = RandomNumber(1, UserList(UserIndex).Stats.UserAtributos(eAtributos.Constitucion) \ 3)

UserList(UserIndex).Stats.MaxHP = 15 + MiInt
UserList(UserIndex).Stats.MinHP = 15 + MiInt

MiInt = RandomNumber(1, UserList(UserIndex).Stats.UserAtributos(eAtributos.Agilidad) \ 6)
If MiInt = 1 Then MiInt = 2

UserList(UserIndex).Stats.MaxSta = 20 * MiInt
UserList(UserIndex).Stats.MinSta = 20 * MiInt
UserList(UserIndex).Stats.MaxAGU = 100
UserList(UserIndex).Stats.MinAGU = 100
UserList(UserIndex).Stats.MaxHam = 100
UserList(UserIndex).Stats.MinHam = 100

'<-----------------MANA----------------------->
If UCase$(UserClase) = "MAGO" Then
MiInt = RandomNumber(1, UserList(UserIndex).Stats.UserAtributos(eAtributos.Inteligencia)) / 3
UserList(UserIndex).Stats.MaxMAN = 100 + MiInt
UserList(UserIndex).Stats.MinMAN = 100 + MiInt
ElseIf UCase$(UserClase) = "CLERIGO" Or UCase$(UserClase) = "DRUIDA" Or UCase$(UserClase) = "BARDO" Or UCase$(UserClase) = "ASESINO" Then
MiInt = RandomNumber(1, UserList(UserIndex).Stats.UserAtributos(eAtributos.Inteligencia)) / 4
UserList(UserIndex).Stats.MaxMAN = 50
UserList(UserIndex).Stats.MinMAN = 50
Else
UserList(UserIndex).Stats.MaxMAN = 0
UserList(UserIndex).Stats.MinMAN = 0
End If

If UCase$(UserClase) = "MAGO" Or UCase$(UserClase) = "CLERIGO" Or _
UCase$(UserClase) = "DRUIDA" Or UCase$(UserClase) = "BARDO" Or _
UCase$(UserClase) = "ASESINO" Then
UserList(UserIndex).Stats.UserHechizos(1) = 2
End If

UserList(UserIndex).Stats.MaxHIT = 2
UserList(UserIndex).Stats.MinHIT = 1
UserList(UserIndex).Stats.GLD = 0
UserList(UserIndex).Stats.Exp = 0
UserList(UserIndex).Stats.ELU = 300
UserList(UserIndex).Stats.ELV = 1

'???????????????? INVENTARIO ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿
UserList(UserIndex).Invent.NroItems = 4

UserList(UserIndex).Invent.Object(1).ObjIndex = 467
UserList(UserIndex).Invent.Object(1).Amount = 100

UserList(UserIndex).Invent.Object(2).ObjIndex = 468
UserList(UserIndex).Invent.Object(2).Amount = 100

UserList(UserIndex).Invent.Object(3).ObjIndex = 460
UserList(UserIndex).Invent.Object(3).Amount = 1
UserList(UserIndex).Invent.Object(3).Equipped = 1

Select Case UserRaza
Case "Humano"
UserList(UserIndex).Invent.Object(4).ObjIndex = 463
Case "Elfo"
UserList(UserIndex).Invent.Object(4).ObjIndex = 464
Case "Elfo Oscuro"
UserList(UserIndex).Invent.Object(4).ObjIndex = 465
Case "Enano"
UserList(UserIndex).Invent.Object(4).ObjIndex = 466
Case "Gnomo"
UserList(UserIndex).Invent.Object(4).ObjIndex = 466
End Select

UserList(UserIndex).Invent.Object(4).Amount = 1
UserList(UserIndex).Invent.Object(4).Equipped = 1

UserList(UserIndex).Invent.ArmourEqpSlot = 4
UserList(UserIndex).Invent.ArmourEqpObjIndex = UserList(UserIndex).Invent.Object(4).ObjIndex
UserList(UserIndex).Invent.WeaponEqpObjIndex = UserList(UserIndex).Invent.Object(3).ObjIndex
UserList(UserIndex).Invent.WeaponEqpSlot = 3

Call SaveUser(UserIndex, CharPath & UCase$(name) & ".chr")

'Open User
Call ConnectUser(UserIndex, name, Password)

End Sub



8- Buscamos:



UserList(UserIndex).Char.Heading = CInt(UserFile.GetValue("INIT", "Heading"))



Y debajo agregamos:



UserList(UserIndex).NombreCuenta = UserFile.GetValue("INIT", "NombreCuenta")



9- Buscamos:



Call WriteVar(UserFile, "FACCIONES", "Reenlistadas", CStr(UserList(UserIndex).Faccion.Reenlistadas))



Y debajo agregamos:



Call WriteVar(CharPath & UserList(UserIndex).name & ".chr", "INIT", "NombreCuenta", UserList(UserIndex).NombreCuenta)



10- Buscamos:



Public Type User



Y debajo agregamos:



NombreCuenta As String


saludoss
santi55
santi55
Nivel 12
Nivel 12

Medallas
Sistema de cuentas Prensa1

Advertencias Advertencias : 1
Mensajes Mensajes : 156
Puntos Puntos : 49387
Reputación Reputación : 1
Fecha de inscripción Fecha de inscripción : 19/12/2010
País País : Argentina


Volver arriba Ir abajo

Volver arriba

- Temas similares

 
Permisos de este foro:
No puedes responder a temas en este foro.