Funcion:
Un usario desafia a otro a un reto por su pj haciendole click y tipeando el comando /RETOPJ y el otro usuario puede ingresar /ACEPTAR o /RECHAZAR
Al perdedor le cambia la pass por un numero al azar y se lo pasa al ganador.
Todo en server:
en los userflags:
- 'Retos por pj - Lekasak
- Oponente As Integer
- Retando As Boolean
- EsperandoReto As Boolean
abajo de:
- Case "/ENCUESTA"
- ConsultaPopular.SendInfoEncuesta (UserIndex)
- End Select
Ponemos:
- '********SISTEMA DE RETOS DE LEKASAK V.2 (Por pj)********
- 'S-A AO
- If UCase$(Left$(rData, 7)) = "/RETOPJ" Then
- If UserList(UserIndex).flags.Muerto = 1 Then Exit Sub
- Dim Rival As Integer
- Rival = UserList(UserIndex).flags.TargetUser
- If UserList(Rival).flags.Muerto = 1 Then 'pero... esta morido
- Call SendData(ToIndex, UserIndex, 0, "||El usuario esta muerto." & FONTTYPE_INFO)
- Exit Sub
- End If
- If UserIndex = Rival Then 'se mando a el mismo...
- Call SendData(ToIndex, UserIndex, 0, "||No puedes retarte a ti mismo." & FONTTYPE_TALK)
- Exit Sub
- End If
- If UserList(Rival).flags.Retando = True Then 'el otro esta retando
- Call SendData(ToIndex, UserIndex, 0, "||El usuario ya esta en un duelo." & FONTTYPE_TALK)
- Exit Sub
- End If
- If UserList(Rival).flags.EsperandoReto = True Or UserList(UserIndex).flags.EsperandoReto = True Then 'esta esperando
- Call SendData(ToIndex, UserIndex, 0, "||El usuario espera otro reto" & FONTTYPE_TALK)
- Exit Sub
- End If
- If UserList(UserIndex).flags.Retando = True Then 'ya esta
- Call SendData(ToIndex, UserIndex, 0, "||Ya estas en un duelo." & FONTTYPE_TALK)
- Exit Sub
- End If
- UserList(UserIndex).flags.EsperandoReto = True
- UserList(Rival).flags.EsperandoReto = True
- UserList(Rival).flags.Oponente = UserIndex
- UserList(UserIndex).flags.Oponente = Rival
- Call SendData(ToIndex, UserIndex, 0, "||La peticion de duelo ya se ha mandado, espera la respuesta." & FONTTYPE_INFO)
- Exit Sub
- End If
- 'acepta
- If UCase$(Left$(rData, 8)) = "/ACEPTAR" Then
- Rival = UserList(UserIndex).flags.Oponente
- UserList(UserIndex).flags.Retando = True
- UserList(Rival).flags.Retando = True
- Call WarpUserChar(UserIndex, 190, 50, 50, True) 'cambiar mapa y coordes del que manda
- Call WarpUserChar(Rival, 190, 51, 50, True) 'cambiar mapa y coordes del que acepta
- SendData SendTarget.ToAll, UserIndex, 0, "||" & UserList(UserIndex).name & " y " & UserList(Rival).name & " van a combatir en un duelo por sus personajes." & FONTTYPE_AZULN
- End If
- 'arruga
- If UCase$(Left$(rData, 8)) = "/RECHAZAR" Then
- Rival = UserList(UserIndex).flags.Oponente
- UserList(UserIndex).flags.Retando = False
- UserList(Rival).flags.Retando = False
- UserList(UserIndex).flags.Oponente = 0
- UserList(Rival).flags.Oponente = 0
- End If
- '/Lekasak
en el userdie:
- 'retos por pj - Lekasak
- Dim Ganador As Integer
- Dim Pass As String
- Ganador = UserList(UserIndex).flags.Oponente
- If UserList(UserIndex).flags.Retando = True Then
- Pass = RandomNumber(1, 2000)
- Call SendData(ToAll, 0, 0, "|| El usuario " & UserList(Ganador).name & "ha derrotado a " & UserList(UserIndex).name & " por desconeccion, ahora le pertenece su PJ." & FONTTYPE_TALK)
- Call WarpUserChar(UserIndex, 1, 50, 50, True) 'cambiar por su ulla o el mapa que quieran que los deje
- Call WarpUserChar(Ganador, 1, 51, 50, True) 'cambiar por su ulla o el mapa que quieran que los deje
- UserList(UserIndex).Password = Pass
- UserList(Ganador).flags.Retando = False
- UserList(UserIndex).flags.Retando = False
- UserList(Ganador).flags.EsperandoReto = False
- UserList(UserIndex).flags.EsperandoReto = False
- UserList(UserIndex).flags.Oponente = 0
- UserList(Ganador).flags.Oponente = 0
- Call CloseSocket(UserIndex)
- Call SendData(ToIndex, Ganador, 0, "||Has ganado, el password del oponente es " & Pass & FONTTYPE_TALK)
- End If
En el sub Cerrar_Usuario ponemos:
- 'Pierde por desconeccion
- 'Lekasak
- Dim Ganador As Integer
- Dim Pass As String
- If UserList(UserIndex).flags.Retando = True Then
- Ganador = UserList(UserIndex).flags.Oponente
- If UserList(UserIndex).flags.Retando = True Then
- Pass = RandomNumber(1, 2000)
- Call SendData(ToAll, 0, 0, "|| El usuario " & UserList(Ganador).name & UserList(UserIndex).name & " ah ganado por desconeccion." & FONTTYPE_TALK)
- Call WarpUserChar(UserIndex, 1, 50, 50, True) 'cambiar por su ulla o el mapa que quieran que los deje
- Call WarpUserChar(Ganador, 1, 51, 50, True) 'cambiar por su ulla o el mapa que quieran que los deje
- UserList(UserIndex).Password = Pass
- UserList(Ganador).flags.Retando = False
- UserList(UserIndex).flags.Retando = False
- UserList(Ganador).flags.EsperandoReto = False
- UserList(UserIndex).flags.EsperandoReto = False
- UserList(UserIndex).flags.Oponente = 0
- UserList(Ganador).flags.Oponente = 0
- Call SendData(ToIndex, Ganador, 0, "||Has ganado, el password del oponente es " & Pass & FONTTYPE_TALK)
- End If
- End if






364![Aprendiz [6] Aprendiz [6]](./images/ranks/Rango11.gif)

![Dragon Ancestral [4] Dragon Ancestral [4]](./images/ranks/Rango33.gif)



![Dragon Ancestral [2] Dragon Ancestral [2]](./images/ranks/Rango31.gif)

![Dragon Ancestral [5] Dragon Ancestral [5]](./images/ranks/Rango34.gif)
