¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.



 
ÍndiceÍndice  Últimas imágenesÚltimas imágenes  BuscarBuscar  RegistrarseRegistrarse  ConectarseConectarse  

 

 [aporte] comando /duelo

Ir abajo 
AutorMensaje
lekasak
Moderador AO
Moderador AO
lekasak


Mensajes : 28
Fecha de inscripción : 24/05/2011
Edad : 26
Localización : villa maipu

[aporte] comando /duelo Empty
MensajeTema: [aporte] comando /duelo   [aporte] comando /duelo EmptySáb Mayo 28, 2011 9:19 pm

El comando es el "/DUELO NICK CANTIDAD" (EJ: /duelo Pepe 100000) Para Aceptarlo (/Aceptar Pepe)

Empezamos

Buscamos:


Código:
Select Case UCase$(Left$(rData, 7))

Y abajo ponemos:


Código:
Case "/DUELO "
Dim oro As Long
oro = UserList(UserIndex).Stats.GLD
        rData = Right$(rData, Len(rData) - 7)
        tIndex = NameIndex(ReadField(1, rData, 32))
        Arg1 = ReadField(2, rData, 32)
       
    If tIndex <= 0 Then
        Call SendData(SendTarget.toindex, UserIndex, 0, "||Usuario Offline." & FONTTYPE_INFO)
        Exit Sub
            End If
           
    If UserList(UserIndex).flags.Dueleando = 1 Then
        Call SendData(SendTarget.toindex, UserIndex, 0, "||Ya estas peleando con otro usuario." & FONTTYPE_INFO)
            Exit Sub
                End If
               
    If UserList(tIndex).flags.Dueleando = 1 Then
        Call SendData(SendTarget.toindex, UserIndex, 0, "||Ya esta peleando con otro usuario." & FONTTYPE_INFO)
            Exit Sub
                End If
               
    If val(Arg1) < 100000 Then
        Call SendData(SendTarget.toindex, UserIndex, 0, "||No puedes duelear por menos de 100000 monedas de oro." & FONTTYPE_INFO)
        Exit Sub
            End If
           
    If UserList(tIndex).flags.LeOfrecieron = 1 Then
        Call SendData(SendTarget.toindex, UserIndex, 0, "||El usuario esta esperando otra invitacion de duelo." & FONTTYPE_INFO)
        Exit Sub
            End If
           
    If val(Arg1) > oro Then
        Call SendData(SendTarget.toindex, UserIndex, 0, "||No tienes esta cantidad de oro." & FONTTYPE_INFO)
    ElseIf val(Arg1) < 0 Then
        Call SendData(SendTarget.toindex, UserIndex, 0, "||No puedes pelear por cantidades negativas." & FONTTYPE_INFO)
    Else
        UserList(UserIndex).flags.Ofreciendo = 1
        UserList(tIndex).flags.LeOfrecieron = 1
        UserList(UserIndex).flags.PrecioDuelo = val(Arg1)
        UserList(tIndex).flags.PrecioDuelo = val(Arg1)
        Call SendData(SendTarget.toindex, UserIndex, 0, "||Le mandaste solicitud de duelo a " & UserList(tIndex).name & "." & FONTTYPE_INFO)
        Call SendData(SendTarget.toindex, tIndex, 0, "||" & UserList(UserIndex).name & ": Clase: " & UserList(UserIndex).Clase & ", Nivel:" & UserList(UserIndex).Stats.ELV & " quiere combatir en un duelo por:" & val(Arg1) & " monedas de oro. Si aceptas escribe /ACEPTAR " & UserList(UserIndex).name & FONTTYPE_INFO)
    End If
Exit Sub


Ahora buscamos:



Código:
Select Case UCase$(Left$(rData, 9))

Y abajo ponemos:



Código:
Case "/ACEPTAR "
rData = Right$(rData, Len(rData) - 9)
tIndex = NameIndex(rData)

    If tIndex <= 0 Then
        Call SendData(SendTarget.toindex, UserIndex, 0, "||Usuario Offline." & FONTTYPE_INFO)
        Exit Sub
        End If
       
    'If UserList(UserIndex).flags.LeOfrecieron = 0 Then
    '  Call SendData(SendTarget.ToIndex, UserIndex, 0, "||Nadie te ofrecio." & FONTTYPE_INFO)
      '      Exit Sub
      ' End If
       
Call SendData(SendTarget.ToAll, 0, 0, "||" & UserList(UserIndex).name & " y " & UserList(tIndex).name & " van a combatir en un duelo por " & UserList(tIndex).flags.PrecioDuelo & " monedas de oro." & FONTTYPE_INFO)

UserList(UserIndex).Stats.GLD = UserList(UserIndex).Stats.GLD - UserList(UserIndex).flags.PrecioDuelo
UserList(tIndex).Stats.GLD = UserList(tIndex).Stats.GLD - UserList(tIndex).flags.PrecioDuelo
UserList(UserIndex).flags.Dueleando = 1
UserList(tIndex).flags.Dueleando = 1

Call WarpUserChar(UserIndex, 1, 40, 40, True) 'mapa y posicion de duelo del participante 1
Call WarpUserChar(tIndex, 1, 41, 41, True) 'mapa y posicion de duelo del participante 2

'Call enviaroro(UserIndex)
'Call EnviarOro(tIndex)

   
Exit Sub

Buscamos:



Código:
If UserList(AttackerIndex).Stats.UsuariosMatados < 32000 Then _
    UserList(AttackerIndex).Stats.UsuariosMatados = UserList(AttackerIndex).Stats.UsuariosMatados + 1

Y abajo ponemos:



Código:
'duelo
If MapInfo(2).NumUsers = 1 Then 'PONER EL MAPA DE DUELOS
    Call SendData(SendTarget.ToAll, 0, 0, "||" & UserList(AttackerIndex).name & " gano el duelo contra " & UserList(VictimIndex).name & FONTTYPE_INFO)
        Call WarpUserChar(AttackerIndex, 1, 50, 50, True) 'MAPA DONDE SALEN CUANDO TERMINA EL DUELO
            Call WarpUserChar(VictimIndex, 1, 49, 50, True)' MAPA DONDE SALEN CUANDO TERMINA EL DUELO
                        UserList(AttackerIndex).Stats.GLD = UserList(AttackerIndex).Stats.GLD + UserList(AttackerIndex).flags.PrecioDuelo
                        UserList(AttackerIndex).Stats.GLD = UserList(AttackerIndex).Stats.GLD + UserList(AttackerIndex).flags.PrecioDuelo
            Call SendData(SendTarget.toindex, AttackerIndex, 0, "||Ganaste el duelo contra " & UserList(VictimIndex).name & "." & FONTTYPE_CONSEJO)
                        'duelo
            UserList(AttackerIndex).flags.Dueleando = 0
            UserList(VictimIndex).flags.Dueleando = 0
            UserList(AttackerIndex).flags.Ofreciendo = 0
            UserList(VictimIndex).flags.Ofreciendo = 0
            UserList(AttackerIndex).flags.PrecioDuelo = 0
            UserList(VictimIndex).flags.PrecioDuelo = 0
            UserList(AttackerIndex).flags.LeOfrecieron = 0
            UserList(VictimIndex).flags.LeOfrecieron = 0
            'Call EnviarOro(AttackerIndex)
            'Call EnviarOro(VictimIndex)
            End If

Buscamos:



Código:
Sub UserDie(ByVal UserIndex As Integer)

Y en ese sub buscamos:



Código:
UserList(UserIndex).flags.Muerto = 1

Y abajo ponemos:




Código:
If UserList(UserIndex).Pos.Map = 2 Then 'AQUI PONER EL MAPA DE DUELO!
Call WarpUserChar(UserIndex, 1, 61, 61, True) 'ACA PONER DONDE SALE UNA VES TERMINADO EL DUELO
Call SendData(toindex, UserIndex, 0, "||Has sido vencido debes abandonar la zona de duelos." & FONTTYPE_WARNING)
End If


Buscamos:



Código:
Public Type UserFlags
Y abajo ponemos:


Código:

'duelo
Ofreciendo As Integer
LeOfrecieron As Integer
Dueleando As Integer
PrecioDuelo As String
'DestinoDuelo As Integer

100% Funcional!
Volver arriba Ir abajo
 
[aporte] comando /duelo
Volver arriba 
Página 1 de 1.

Permisos de este foro:No puedes responder a temas en este foro.
 :: Talleres Servidores Argentum :: Programacion-
Cambiar a: