GS-Zone

DeathMatch Automático Ir al Indice

Moderadores: Moderadores de Argentum, Especialistas de Argentum, Especialistas de Programación

26

Nota » 05 Ene 2012 16:30

Ya vi varios sistemas de Deathmatch automáticos pero no se si ya existe otro igual a este. Les digo cuales son las características:

-Se puede configurar, duración de la etapa de inscripción, duración del DM, si se caen o no los items, el precio de entrada, si todos los personajes se ven iguales (para evitar teams), los cupos y el mapa.
-Hay etapa de inscripción, avisa 10 segundos antes con cuenta regresiva.
-Luego de la etapa de inscripción si hay gente suficiente los lleva al mapa, y el DM empieza con una cuenta regresiva.
-Cuando se caen los items, todos los objetos de los que van perdiendo se acumulan en un mapa especial. Cuando termina el DM el ganador tiene unos minutos en el mapa con un banquero para agarrar su premio :P.

Una muestra:

Imagen
Imagen
Imagen
Imagen
Imagen


Imagen Primero tienen agregar el control de eventos automáticos


DeathMatch Automático

  • Cliente
  • Server

    • En el Private Enum JuegosPacketID agregamos:

      1.    'USERS
      2.     DM                      '/DM
      3.     SalirDM                 '/SALIRDM


      Es mejor si copiamos el enum del Cliente para evitar problemas

    • En el Sub HandleAutoEvento buscamos:

      1.        If HayEvento Then
      2.             WriteConsoleMsg UserIndex, "AutoEventos> Hay un evento en este momento, espera a que finalize.", FontTypeNames.FONTTYPE_GM


      y Abajo ponemos:

      1.        ElseIf AeOn = 2 Then 'EL 2 LO CAMBIAN POR EL NÚMERO QUE LES DIJE ANTES!
      2.             Call SendData(ToAdmins, UserIndex, PrepareMessageConsoleMsg("AutoEventos> " & .name & " inició un Deathmatch.", FontTypeNames.FONTTYPE_GM))
      3.             HayEvento = True
      4.             modDeathMatch.Iniciar


    • En el Public Sub LoadAutoEventos() antes de:

      1.    UltimoEvento = Ninguno
      2.     EventoActual = Ninguno


      Agregamos:

      1.    modJuegoTeleps.tMinutos = val(GetVar(App.Path & "\AutoEvents.ini", "TELEPS", "Tiempo"))
      2.    
      3.     modDeathMatch.DMPrecio = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Precio"))
      4.     modDeathMatch.MinutosDM = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Tiempo"))
      5.     modDeathMatch.MinutosInscripcion = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Inscripcion"))
      6.     modDeathMatch.MaxPlayers = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Cupos"))
      7.     modDeathMatch.dmIguales = (val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Iguales")) = 1)
      8.     modDeathMatch.dmSeCaen = (val(GetVar(App.Path & "\AutoEvents.ini", "DM", "SeCaen")) = 1)
      9.    
      10.     modDeathMatch.dmPos.map = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Map"))
      11.     modDeathMatch.dmPos.X = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "X"))
      12.     modDeathMatch.dmPos.Y = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Y"))
      13.  
      14.     modDeathMatch.dmItemPos.map = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "ItemsMap"))
      15.     modDeathMatch.dmItemPos.X = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "ItemsX"))
      16.     modDeathMatch.dmItemPos.Y = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "ItemsY"))


    • Abajo de Public Sub MinutoAutoEventos() agregamos:

      1. If HayDM Then modDeathMatch.DMPasaMinuto


    • En el Sub PasarSegundo agregamos:

      1. If HayDM Then modDeathMatch.DMPasaSegundo


    • En el módulo modAutoEventos en el Public Enum eEvento, antes del End Enum agreguen:



    • En el módulo Protocol agregamos:

      1. '
      2. ' Handles the "DM" message.
      3. '
      4. ' @param    userIndex The index of the user sending the message.
      5.  
      6. Private Sub HandleDM(ByVal UserIndex As Integer)
      7.     If UserList(UserIndex).incomingData.length < 1 Then
      8.         Err.Raise UserList(UserIndex).incomingData.NotEnoughDataErrCode
      9.         Exit Sub
      10.     End If
      11.    
      12.     With UserList(UserIndex)
      13.         'Remove packet ID
      14.         Call .incomingData.ReadByte
      15.         modDeathMatch.MandoDM UserIndex
      16.     End With
      17. End Sub
      18.  
      19. '
      20. ' Handles the "SalirDM" message.
      21. '
      22. ' @param    userIndex The index of the user sending the message.
      23.  
      24. Private Sub HandleSalirDM(ByVal UserIndex As Integer)
      25.     If UserList(UserIndex).incomingData.length < 1 Then
      26.         Err.Raise UserList(UserIndex).incomingData.NotEnoughDataErrCode
      27.         Exit Sub
      28.     End If
      29.    
      30.     With UserList(UserIndex)
      31.         'Remove packet ID
      32.         Call .incomingData.ReadByte
      33.         If Not HayDM Then
      34.             WriteConsoleMsg UserIndex, "No hay ningun deathmatch", FontTypeNames.FONTTYPE_INFO
      35.             Exit Sub
      36.         End If
      37.         If Not (dmPlayers.Existe(.name)) Then
      38.             WriteConsoleMsg UserIndex, "No estás participando!", FontTypeNames.FONTTYPE_INFO
      39.             Exit Sub
      40.         End If
      41.         modDeathMatch.DMSeRetira UserIndex
      42.     End With
      43. End Sub


    • En el Sub HandleIncommingData buscamos:

      1. Case ClientPacketID.Juegos
      2.             UserList(UserIndex).incomingData.ReadByte
      3.             Select Case UserList(UserIndex).incomingData.PeekByte()


      y abajo ponemos:

      1.                Case JuegosPacketID.DM              '/DM
      2.                     Call HandleDM(UserIndex)
      3.                
      4.                 Case JuegosPacketID.SalirDM         '/SALIRDM
      5.                     Call HandleSalirDM(UserIndex)


    • Creamos un nuevo módulo y lo llamamos modDeathMatch con lo siguiente:
      1. Option Explicit
      2.  
      3. Public Enum dmEstado
      4.     EsperandoInscripcion
      5.     Inscripcion
      6.     Jugando
      7.     JuntandoPremio
      8. End Enum
      9.  
      10. Public EstDM As dmEstado
      11.  
      12. Public HayDM As Boolean
      13. Public dmPos As WorldPos
      14. Public dmItemPos As WorldPos
      15. Public dmPlayers As New cCola
      16. Public MinutosInscripcion As Byte
      17. Public MinutosDM As Byte, dMinutos As Integer
      18. Public DMPrecio As Long, MaxPlayers As Integer
      19. Public Premio As Integer
      20. Public CuentaDM As Integer
      21. Public dmIguales As Boolean
      22. Public dmSeCaen As Boolean
      23. Private dmBanquero As Integer
      24. Dim DMGanador As Integer
      25.  
      26. Public Sub Iniciar()
      27.     EventoActual = DeathMatch
      28.     'MapInfo(dmPos.map).Pk = False
      29.     Call SendData(ToAll, 0, PrepareMessageConsoleMsg("AutoEvento>¡¡DeathMatch!!", FontTypeNames.FONTTYPE_AUTOEVENTOS))
      30.     If dmSeCaen Then
      31.         Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Se caen los items. Inscripción: " & DMPrecio, FontTypeNames.FONTTYPE_AUTOEVENTOS))
      32.     End If
      33.     Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>En 1 minuto se abren las inscripciones, preparense", FontTypeNames.FONTTYPE_AUTOEVENTOS))
      34.     EstDM = EsperandoInscripcion
      35.     dMinutos = 1
      36.     HayDM = True
      37.     DMGanador = 0
      38.     dmPlayers.Reset
      39.     If dmSeCaen Then
      40.         dmBanquero = SpawnNpc(24, dmItemPos, False, False)
      41.     End If
      42. End Sub
      43.  
      44. Public Sub DMPasaMinuto()
      45. Dim X As Byte, Y As Byte, usrInd As Integer
      46.     Select Case EstDM
      47.         Case dmEstado.EsperandoInscripcion
      48.             dMinutos = dMinutos - 1
      49.             If dMinutos <= 0 Then
      50.                 Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Manden /DM en 10 segundos.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
      51.                 CuentaDM = 11
      52.             End If
      53.         Case dmEstado.Inscripcion
      54.             dMinutos = dMinutos - 1
      55.             If dMinutos <= 1 Then
      56.                 If dmPlayers.Longitud <= 1 Then
      57.                     Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch> No se llegó al mínimo de participantes.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
      58.                     HayDM = False
      59.                     HayEvento = False
      60.                     UltimoEvento = DeathMatch
      61.                     EventoActual = Ninguno
      62.                     For X = 1 To dmPlayers.Longitud
      63.                         usrInd = NameIndex(mid(dmPlayers.VerElemento(X), 10, Len(dmPlayers.VerElemento(X))))
      64.                         UserList(usrInd).Stats.GLD = UserList(usrInd).Stats.GLD + DMPrecio
      65.                         If UserList(usrInd).Stats.GLD > MAXORO Then _
      66.                             UserList(usrInd).Stats.GLD = MAXORO
      67.                     Next X
      68.                     dmPlayers.Reset
      69.                     QuitarNPC dmBanquero
      70.                 Else
      71.                     DMComienza
      72.                 End If
      73.             Else
      74.                 Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch> Quedan " & dMinutos & " minutos para inscribirse.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
      75.             End If
      76.         Case dmEstado.Jugando
      77.             dMinutos = dMinutos - 1
      78.             If dMinutos <= 0 Then
      79.                 DMTodosUlla
      80.                 Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch> No hubo ganador.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
      81.                 QuitarNPC dmBanquero
      82.             ElseIf dMinutos < 3 Then
      83.                 Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch> Quedan " & dMinutos & " minutos.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
      84.             End If
      85.         Case dmEstado.JuntandoPremio
      86.             dMinutos = dMinutos - 1
      87.             If dMinutos <= 0 Then
      88.                 Call WarpUserChar(DMGanador, 1, 50, 50, True)
      89.                 dmPlayers.Reset
      90.                 QuitarNPC dmBanquero
      91.                 Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Limpiando...", FontTypeNames.FONTTYPE_AUTOEVENTOS))
      92.                 For Y = YMinMapSize To YMaxMapSize
      93.                     For X = XMinMapSize To XMaxMapSize
      94.                         If MapData(dmItemPos.map, X, Y).ObjInfo.ObjIndex > 0 And MapData(dmItemPos.map, X, Y).Blocked = 0 Then
      95.                             If ItemNoEsDeMapa(MapData(dmItemPos.map, X, Y).ObjInfo.ObjIndex) Then Call EraseObj(10000, dmItemPos.map, X, Y)
      96.                         End If
      97.                     Next X
      98.                 Next Y
      99.                 Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>OK", FontTypeNames.FONTTYPE_AUTOEVENTOS))
      100.                 HayDM = False
      101.                 HayEvento = False
      102.             Else
      103.                 Call WriteConsoleMsg(DMGanador, "DeathMatch>Te quedan " & dMinutos & " minutos.", FontTypeNames.FONTTYPE_AUTOEVENTOS)
      104.             End If
      105.     End Select
      106. End Sub
      107.  
      108. Public Sub DMPasaSegundo()
      109. If HayDM And CuentaDM > 0 Then
      110.     CuentaDM = CuentaDM - 1
      111.     If CuentaDM = 0 Then
      112.         Select Case modDeathMatch.EstDM
      113.             Case dmEstado.EsperandoInscripcion
      114.                 Call SendData(ToAll, 0, PrepareMessageConsoleMsg("Deathmatch> Manden /DM!!!", FontTypeNames.FONTTYPE_FIGHT))
      115.                 modDeathMatch.EstDM = Inscripcion
      116.                 dMinutos = MinutosInscripcion
      117.             Case dmEstado.Jugando
      118.                 Call SendData(ToAll, 0, PrepareMessageConsoleMsg("Deathmatch>YAAAA!!!", FontTypeNames.FONTTYPE_FIGHT))
      119.                 'MapInfo(dmPos.map).Pk = True
      120.             End Select
      121.     Else
      122.         Call SendData(ToAll, 0, PrepareMessageConsoleMsg("Deathmatch> " & CuentaDM & "...", FontTypeNames.FONTTYPE_TALK))
      123.     End If
      124. End If
      125. End Sub
      126.  
      127. Public Function DMPuedeAtacar(ByVal attackerIndex As Integer, ByVal VictimIndex As Integer) As Boolean
      128. If EstDM = Jugando Then
      129.     If dmPlayers.Existe(UserList(attackerIndex).name) And dmPlayers.Existe(UserList(VictimIndex).name) Then
      130.         DMPuedeAtacar = (CuentaDM <= 0)
      131.     Else
      132.         DMPuedeAtacar = True
      133.     End If
      134. Else
      135.     DMPuedeAtacar = True
      136. End If
      137. End Function
      138.  
      139. Public Function DMEstaJugando(ByVal UserIndex As Integer) As Boolean
      140. If EstDM = Jugando Then
      141.     If dmPlayers.Existe(UserList(UserIndex).name) Then
      142.         DMEstaJugando = True
      143.     Else
      144.         DMEstaJugando = False
      145.     End If
      146. Else
      147.     DMEstaJugando = False
      148. End If
      149. End Function
      150.  
      151. Public Sub DMComienza()
      152. Dim a As Integer, X As Integer, Y As Integer, UI As Integer
      153. For a = 1 To dmPlayers.Longitud
      154.     X = dmPos.X
      155.     Y = dmPos.Y
      156.     UI = NameIndex(mid(dmPlayers.VerElemento(a), 10, Len(dmPlayers.VerElemento(a))))
      157.     FindLegalPos UI, dmPos.map, X, Y
      158.        
      159.     If dmIguales Then
      160.         UserList(UI).showName = False
      161.         With UserList(UI)
      162.             .CharMimetizado.body = .Char.body
      163.             .CharMimetizado.Head = .Char.Head
      164.             .CharMimetizado.CascoAnim = .Char.CascoAnim
      165.             .CharMimetizado.ShieldAnim = .Char.ShieldAnim
      166.             .CharMimetizado.WeaponAnim = .Char.WeaponAnim
      167.             .flags.Mimetizado = 1
      168.             .Char.body = 255
      169.             .Char.Head = 501
      170.             .Char.CascoAnim = 0
      171.             .Char.ShieldAnim = 0
      172.             .Char.WeaponAnim = 0
      173.             Call ChangeUserChar(UI, .Char.body, .Char.Head, .Char.heading, .Char.WeaponAnim, .Char.ShieldAnim, .Char.CascoAnim)
      174.         End With
      175.     End If
      176.        
      177.     WarpUserChar UI, dmPos.map, X, Y, True
      178.     'Revivimos si es necesario
      179.     If UserList(UI).flags.Muerto = 1 Then
      180.         Call RevivirUsuario(UI)
      181.     End If
      182.    
      183.     If (UserList(UI).flags.invisible = 1) Or (UserList(UI).flags.Oculto = 1) Then
      184.         If UserList(UI).flags.Oculto = 1 Then
      185.             UserList(UI).Counters.TiempoOculto = 0
      186.             UserList(UI).flags.Oculto = 0
      187.             Call SetInvisible(UI, UserList(UI).Char.CharIndex, False)
      188.         Else
      189.             UserList(UI).Counters.Invisibilidad = 0
      190.             UserList(UI).flags.invisible = 0
      191.             Call SetInvisible(UI, UserList(UI).Char.CharIndex, False)
      192.         End If
      193.     End If
      194. Next a
      195. Call SendData(ToAll, 0, PrepareMessageConsoleMsg("Deathmatch>Empieza en...", FontTypeNames.FONTTYPE_TALK))
      196. Premio = dmPlayers.Longitud
      197. modDeathMatch.EstDM = Jugando
      198. dMinutos = 20
      199. CuentaDM = 5
      200. End Sub
      201.  
      202. Public Sub MandoDM(ByVal UserIndex As Integer)
      203. With UserList(UserIndex)
      204.     If Not HayDM Then
      205.         WriteConsoleMsg UserIndex, "No hay ningun deathmatch", FontTypeNames.FONTTYPE_INFO
      206.         Exit Sub
      207.     End If
      208.     If dmPlayers.Existe(.name) Then
      209.         WriteConsoleMsg UserIndex, "Ya estás participando!", FontTypeNames.FONTTYPE_INFO
      210.         Exit Sub
      211.     End If
      212.     Select Case EstDM
      213.         Case dmEstado.EsperandoInscripcion
      214.             WriteConsoleMsg UserIndex, "Todavía no se abrieron las inscripciones", FontTypeNames.FONTTYPE_INFO
      215.             Exit Sub
      216.         Case dmEstado.Inscripcion
      217.  
      218.         Case dmEstado.Jugando
      219.             WriteConsoleMsg UserIndex, "El DeathMatch ya empezó", FontTypeNames.FONTTYPE_INFO
      220.             Exit Sub
      221.     End Select
      222.     If .flags.Muerto = 1 Then
      223.         Call WriteConsoleMsg(UserIndex, "¡¡Estas muerto!!", FontTypeNames.FONTTYPE_INFO)
      224.         Exit Sub
      225.     End If
      226.     If .Stats.GLD < DMPrecio Then
      227.         WriteConsoleMsg UserIndex, "No tienes suficiente oro. La inscripción cuesta " & DMPrecio, FontTypeNames.FONTTYPE_INFO
      228.         Exit Sub
      229.     End If
      230.     If .Counters.Pena > 0 Then
      231.         WriteConsoleMsg UserIndex, "No puedes participar desde la carcel.", FontTypeNames.FONTTYPE_INFO
      232.         Exit Sub
      233.     End If
      234.     If dmPlayers.Longitud >= 20 Then
      235.         WriteConsoleMsg UserIndex, "No quedan mas lugares", FontTypeNames.FONTTYPE_INFO
      236.         Exit Sub
      237.     End If
      238.     .Stats.GLD = .Stats.GLD - 50000
      239.     Call WriteUpdateUserStats(UserIndex)
      240.     dmPlayers.Push .name
      241.     WriteConsoleMsg UserIndex, "Deathmatch> Para salir /SALIRDM, si sales antes de que empieze se te devolvera el 80% de las inscripción", FontTypeNames.FONTTYPE_AUTOEVENTOS
      242.     If dmPlayers.Longitud >= 20 Then
      243.         DMComienza
      244.     Else
      245.         Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Quedan " & 20 - dmPlayers.Longitud & " lugares.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
      246.     End If
      247. End With
      248. End Sub
      249.  
      250. Public Sub DMSeRetira(ByVal UserIndex As Integer)
      251. Dim X As Byte, Y As Byte
      252.     If dmPlayers.Existe(UserList(UserIndex).name) Then
      253.         Select Case EstDM
      254.             Case dmEstado.Inscripcion
      255.                 WriteConsoleMsg UserIndex, "DeathMatch> Has salido se te devolvio el 80% de la Inscripción.", FontTypeNames.FONTTYPE_AUTOEVENTOS
      256.                 UserList(UserIndex).Stats.GLD = UserList(UserIndex).Stats.GLD + (DMPrecio * 0.8)
      257.                 If UserList(UserIndex).Stats.GLD > MAXORO Then _
      258.                     UserList(UserIndex).Stats.GLD = MAXORO
      259.                 Call WriteUpdateUserStats(UserIndex)
      260.                 dmPlayers.Quitar (UserList(UserIndex).name)
      261.                 Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Quedan " & 20 - dmPlayers.Longitud & " lugares.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
      262.  
      263.             Case dmEstado.Jugando
      264.                 WriteConsoleMsg UserIndex, "DeathMatch> Has salido.", FontTypeNames.FONTTYPE_AUTOEVENTOS
      265.                 WarpUserChar UserIndex, 1, 50, 50, True
      266.                 dmPlayers.Quitar (UserList(UserIndex).name)
      267.                 If dmPlayers.Longitud = 1 Then
      268.                     DMGana NameIndex(mid(dmPlayers.VerElemento(1), 10, Len(dmPlayers.VerElemento(1))))
      269.                 End If
      270.                 If dmIguales Then
      271.                     With UserList(UserIndex)
      272.                     If .flags.Mimetizado = 1 Then
      273.                         .Char.body = .CharMimetizado.body
      274.                         .Char.Head = .CharMimetizado.Head
      275.                         .Char.CascoAnim = .CharMimetizado.CascoAnim
      276.                         .Char.ShieldAnim = .CharMimetizado.ShieldAnim
      277.                         .Char.WeaponAnim = .CharMimetizado.WeaponAnim
      278.                         .Counters.Mimetismo = 0
      279.                         .flags.Mimetizado = 0
      280.                     End If
      281.                     .showName = True
      282.                     End With
      283.                 End If
      284.             Case dmEstado.JuntandoPremio
      285.                 Call WarpUserChar(DMGanador, 1, 58, 45, True)
      286.                 dmPlayers.Reset
      287.                 Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Limpiando...", FontTypeNames.FONTTYPE_AUTOEVENTOS))
      288.                 For Y = YMinMapSize To YMaxMapSize
      289.                     For X = XMinMapSize To XMaxMapSize
      290.                         If MapData(dmItemPos.map, X, Y).ObjInfo.ObjIndex > 0 And MapData(dmItemPos.map, X, Y).Blocked = 0 Then
      291.                             If ItemNoEsDeMapa(MapData(dmItemPos.map, X, Y).ObjInfo.ObjIndex) Then Call EraseObj(10000, dmItemPos.map, X, Y)
      292.                         End If
      293.                     Next X
      294.                 Next Y
      295.                 QuitarNPC dmBanquero
      296.                 Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>OK", FontTypeNames.FONTTYPE_AUTOEVENTOS))
      297.                 HayDM = False
      298.                 HayEvento = False
      299.            End Select
      300.     End If
      301. End Sub
      302.  
      303. Public Sub DMMuere(ByVal UserIndex As Integer)
      304.     If dmPlayers.Existe(UserList(UserIndex).name) Then
      305.         If EstDM = Jugando Then
      306.             WriteConsoleMsg UserIndex, "DeathMatch> Has muerto.", FontTypeNames.FONTTYPE_AUTOEVENTOS
      307.             If dmIguales Then
      308.                 UserList(UserIndex).showName = True
      309.             End If
      310.             If dmSeCaen Then
      311.                 DMTirarTodo UserIndex
      312.             End If
      313.             WarpUserChar UserIndex, 1, 58, 45, True
      314.             dmPlayers.Quitar (UserList(UserIndex).name)
      315.            
      316.             If dmPlayers.Longitud = 1 Then
      317.                 DMGana NameIndex(mid(dmPlayers.VerElemento(1), 10, Len(dmPlayers.VerElemento(1))))
      318.             End If
      319.         End If
      320.     End If
      321. End Sub
      322.  
      323. Public Sub DMConecta(ByVal UserIndex As Integer)
      324.     If EstDM = Inscripcion Then
      325.         WriteConsoleMsg UserIndex, "DeathMatch> Para entrar /DM. Quedan " & 20 - dmPlayers.Longitud & " lugares.", FontTypeNames.FONTTYPE_AUTOEVENTOS
      326.     ElseIf EstDM = EsperandoInscripcion Then
      327.         WriteConsoleMsg UserIndex, "DeathMatch> Preparate, en " & dMinutos & " se abren las inscripciones.", FontTypeNames.FONTTYPE_AUTOEVENTOS
      328.     End If
      329. End Sub
      330.  
      331. Public Sub DMGana(ByVal UserIndex As Integer)
      332. Dim a As Byte
      333. With UserList(UserIndex)
      334.     If dmPlayers.Existe(.name) Then
      335.         Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Fin del DM. Gandor: " & .name, FontTypeNames.FONTTYPE_AUTOEVENTOS))
      336.        
      337.         If dmIguales Then
      338.             If .flags.Mimetizado = 1 Then
      339.                 .Char.body = .CharMimetizado.body
      340.                 .Char.Head = .CharMimetizado.Head
      341.                 .Char.CascoAnim = .CharMimetizado.CascoAnim
      342.                 .Char.ShieldAnim = .CharMimetizado.ShieldAnim
      343.                 .Char.WeaponAnim = .CharMimetizado.WeaponAnim
      344.                 .Counters.Mimetismo = 0
      345.                 .flags.Mimetizado = 0
      346.             End If
      347.             .showName = True
      348.         End If
      349.        
      350.         Call WarpUserChar(UserIndex, dmItemPos.map, dmItemPos.X, dmItemPos.Y - 1, True)
      351.         UserList(UserIndex).Stats.GLD = UserList(UserIndex).Stats.GLD + (Premio * 50000)
      352.         If UserList(UserIndex).Stats.GLD > MAXORO Then _
      353.             UserList(UserIndex).Stats.GLD = MAXORO
      354.         Call WriteUpdateUserStats(UserIndex)
      355.         Call WriteConsoleMsg(UserIndex, "DeathMatch> Has ganado " & Premio * 50000 & " monedas de oro.", FontTypeNames.FONTTYPE_AUTOEVENTOS)
      356.         If dmSeCaen Then
      357.             Call WriteConsoleMsg(UserIndex, "DeathMatch> Tienes 3 minutos para agarrar tu botin. Cuando termines /SALIRDM.", FontTypeNames.FONTTYPE_AUTOEVENTOS)
      358.             EstDM = JuntandoPremio
      359.             DMGanador = UserIndex
      360.             dMinutos = 3
      361.         Else
      362.             Call WarpUserChar(UserIndex, 1, 50, 50, True)
      363.             dmPlayers.Reset
      364.             HayDM = False
      365.             HayEvento = False
      366.         End If
      367.     End If
      368. End With
      369. End Sub
      370.  
      371. Public Sub DMTodosUlla()
      372. Dim a As Integer, X As Integer, Y As Integer
      373. HayDM = False
      374. HayEvento = False
      375. UltimoEvento = DeathMatch
      376. EventoActual = Ninguno
      377. For a = 1 To dmPlayers.Longitud
      378.     X = 58
      379.     Y = 45
      380.     If dmIguales Then
      381.         With UserList(NameIndex(mid(dmPlayers.VerElemento(a), 10, Len(dmPlayers.VerElemento(a)))))
      382.         If .flags.Mimetizado = 1 Then
      383.             .Char.body = .CharMimetizado.body
      384.             .Char.Head = .CharMimetizado.Head
      385.             .Char.CascoAnim = .CharMimetizado.CascoAnim
      386.             .Char.ShieldAnim = .CharMimetizado.ShieldAnim
      387.             .Char.WeaponAnim = .CharMimetizado.WeaponAnim
      388.             .Counters.Mimetismo = 0
      389.             .flags.Mimetizado = 0
      390.         End If
      391.         .showName = True
      392.         End With
      393.     End If
      394.     FindLegalPos NameIndex(mid(dmPlayers.VerElemento(a), 10, Len(dmPlayers.VerElemento(a)))), 1, X, Y
      395.     WarpUserChar NameIndex(mid(dmPlayers.VerElemento(a), 10, Len(dmPlayers.VerElemento(a)))), 1, X, Y, True
      396. Next a
      397. dmPlayers.Reset
      398. End Sub
      399.  
      400. Sub DMTirarTodo(ByVal UserIndex As Integer)
      401.     Dim i As Byte
      402.     Dim NuevaPos As WorldPos
      403.     Dim MiObj As Obj
      404.     Dim ItemIndex As Integer
      405.    
      406.     For i = 1 To MAX_INVENTORY_SLOTS
      407.         ItemIndex = UserList(UserIndex).Invent.Object(i).ObjIndex
      408.         If ItemIndex > 0 Then
      409.              If ItemSeCae(ItemIndex) Then
      410.                 NuevaPos.X = 0
      411.                 NuevaPos.Y = 0
      412.                 'Creo el Obj
      413.                 MiObj.amount = UserList(UserIndex).Invent.Object(i).amount
      414.                 MiObj.ObjIndex = ItemIndex
      415.                 'Pablo (ToxicWaste) 24/01/2007
      416.                 'Si es pirata y usa un Galeón entonces no explota los items. (en el agua)
      417.                 If UserList(UserIndex).clase = eClass.Pirat And UserList(UserIndex).Invent.BarcoObjIndex = 476 Then
      418.                     Tilelibre dmItemPos, NuevaPos, MiObj, False, True
      419.                 Else
      420.                     Tilelibre dmItemPos, NuevaPos, MiObj, True, True
      421.                 End If
      422.                
      423.                 If NuevaPos.X <> 0 And NuevaPos.Y <> 0 Then
      424.                     Call DropObj(UserIndex, i, MAX_INVENTORY_OBJS, NuevaPos.map, NuevaPos.X, NuevaPos.Y)
      425.                 End If
      426.                 Call WriteVar(CharPath & UserList(UserIndex).name & ".chr", "Inventory", "Obj" & i, UserList(UserIndex).Invent.Object(i).ObjIndex & "-" & UserList(UserIndex).Invent.Object(i).amount & "-" & UserList(UserIndex).Invent.Object(i).Equipped)
      427.              End If
      428.         End If
      429.     Next i
      430. End Sub


    • Buscamos:
      1. Public Sub EfectoMimetismo(ByVal UserIndex As Integer)
      2. '******************************************************
      3. 'Author: Unknown
      4. 'Last Update: 04/11/2008 (NicoNZ)
      5. '
      6. '******************************************************
      7.     Dim Barco As ObjData

      y Abajo ponemos:
      1.    If modDeathMatch.HayDM And modDeathMatch.dmIguales Then
      2.         If modDeathMatch.dmPlayers.Existe(UserList(UserIndex).name) And modDeathMatch.EstDM = Jugando Then
      3.             Exit Sub
      4.         End If
      5.     End If


    • En el Sub UserDie buscamos:

      1.        If (TriggerZonaPelea(UserIndex, UserIndex) <> eTrigger6.TRIGGER6_PERMITE) And .Pos.map <> 68 Then
      2.             ' << Si es newbie no pierde el inventario >>
      3.             If Not EsNewbie(UserIndex) Or criminal(UserIndex) Then
      4.                 Call TirarTodo(UserIndex)
      5.             Else
      6.                 Call TirarTodosLosItemsNoNewbies(UserIndex)
      7.             End If
      8.         End If


      y Arriba ponemos:

      1. If HayDM Then modDeathMatch.DMMuere UserIndex


    • En el Sub ConnectUser en algún lado o abajo de:
      1. If LenB(tStr) <> 0 Then
      2.     Call WriteShowMessageBox(UserIndex, "Tu solicitud de ingreso al clan ha sido rechazada. El clan te explica que: " & tStr)
      3. End If


      Ponemos:
      1. If HayDM Then modDeathMatch.DMConecta UserIndex

    • En el Sub CloseUser buscamos:

      1. UserList(UserIndex).flags.AtacadoPorNpc = 0
      2. UserList(UserIndex).flags.NPCAtacado = 0


      y Abajo ponemos:

      1. If HayDM Then modDeathMatch.DMSeRetira UserIndex


    • Buscamos:

      1. Public Sub DoOcultarse(ByVal UserIndex As Integer)
      2. 'Pablo (ToxicWaste): No olvidar agregar IntervaloOculto=500 al Server.ini.
      3. 'Modifique la fórmula y ahora anda bien.
      4. On Error GoTo Errhandler
      5.  
      6. Dim Suerte As Double
      7. Dim res As Integer
      8. Dim Skill As Integer


      y Abajo ponemos:

      1. If modDeathMatch.HayDM Then
      2.     If modDeathMatch.EstDM = Jugando Then
      3.         If modDeathMatch.dmPlayers.Existe(UserList(UserIndex).name) Then
      4.             Exit Sub
      5.         End If
      6.     End If
      7. End If


    • Buscamos:
      1. Dim H As Integer, tU As Integer
      2. H = UserList(UserIndex).Stats.UserHechizos(UserList(UserIndex).flags.Hechizo)
      3. tU = UserList(UserIndex).flags.TargetUser
      4.  
      5.  
      6. If Hechizos(H).Invisibilidad = 1 Then


      y Abajo ponemos:

      1.    If modDeathMatch.HayDM Then
      2.         If modDeathMatch.EstDM = Jugando Then
      3.             If modDeathMatch.dmPlayers.Existe(UserList(tU).name) Then
      4.                 Exit Sub
      5.             End If
      6.         End If
      7.     End If

    • En la Public Function PuedeAtacar buscamos:
      1.    'No podes atacar a alguien muerto
      2.     If UserList(VictimIndex).flags.Muerto = 1 Then
      3.         Call WriteConsoleMsg(attackerIndex, "No podés atacar a un espiritu", FontTypeNames.FONTTYPE_INFO)
      4.         PuedeAtacar = False
      5.         Exit Function
      6.     End If


      y Abajo ponemos:

      1.    If modDeathMatch.HayDM Then
      2.         If Not modDeathMatch.DMPuedeAtacar(attackerIndex, VictimIndex) Then
      3.             Call WriteConsoleMsg(attackerIndex, "No podés atacar todavía", FontTypeNames.FONTTYPE_INFO)
      4.             PuedeAtacar = False
      5.             Exit Function
      6.         End If
      7.     End If


    • En el HandleTalk abajo de:

      1.        'I see you....
      2.         If .flags.Oculto > 0 Then
      3.             .flags.Oculto = 0
      4.             .Counters.TiempoOculto = 0
      5.             If .flags.invisible = 0 Then
      6.                 Call UsUaRiOs.SetInvisible(UserIndex, UserList(UserIndex).Char.CharIndex, False)
      7.                 'Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageSetInvisible(.Char.CharIndex, False))
      8.                     Call WriteConsoleMsg(UserIndex, "¡Has vuelto a ser visible!", FontTypeNames.FONTTYPE_INFO)
      9.                 End If
      10.             End If

      Ponemos:
      1.        If modDeathMatch.HayDM And modDeathMatch.dmIguales Then
      2.             If modDeathMatch.dmPlayers.Existe(UserList(UserIndex).name) And modDeathMatch.EstDM = Jugando Then
      3.                 Call .incomingData.CopyBuffer(buffer)
      4.                 Exit Sub
      5.             End If
      6.         End If


      Hacemos los mismo en el HandleYell

    • Abajo de:

      1.                    '[Consejeros & GMs]
      2.                     If .flags.Privilegios And (PlayerType.Consejero Or PlayerType.SemiDios) Then
      3.                         Call LogGM(.name, "Le dijo a '" & UserList(targetUserIndex).name & "' " & chat)
      4.                     End If


      Ponemos:
      1.                    If modDeathMatch.HayDM And modDeathMatch.dmIguales Then
      2.                         If modDeathMatch.dmPlayers.Existe(UserList(UserIndex).name) And modDeathMatch.EstDM = Jugando Then
      3.                             Call .incomingData.CopyBuffer(buffer)
      4.                             Exit Sub
      5.                         End If
      6.                     End If


    • Buscamos:
      1.                If .flags.Oculto = 1 Then
      2.                     '[CDT 17-02-2004]
      3.                     If Not .flags.UltimoMensaje = 2 Then
      4.                         Call WriteConsoleMsg(UserIndex, "Ya estás oculto.", FontTypeNames.FONTTYPE_INFO)
      5.                         .flags.UltimoMensaje = 2
      6.                     End If
      7.                     '[/CDT]
      8.                     Exit Sub
      9.                 End If


      y Abajo ponemos:
      1.                If modDeathMatch.HayDM Then
      2.                     If modDeathMatch.DMEstaJugando(UserIndex) Then
      3.                         Exit Sub
      4.                     End If
      5.                 End If


    • En el Sub HandleGuildMessage abajo de:



      Ponemos:
      1.        If modDeathMatch.HayDM And modDeathMatch.dmIguales Then
      2.             If modDeathMatch.dmPlayers.Existe(UserList(UserIndex).name) And modDeathMatch.EstDM = Jugando Then
      3.                 Call .incomingData.CopyBuffer(buffer)
      4.                 Exit Sub
      5.             End If
      6.         End If


      Hacemos los mismo en el HandlePartyMessage

    • En el AutoEventos.ini agregamos:
      1. [DM]
      2. Precio=50000
      3. Tiempo=30
      4. Inscripcion=1
      5. Cupos=20
      6. Iguales=1
      7. SeCaen=1
      8.  
      9. Map=68
      10. X=59
      11. Y=59
      12.  
      13. ItemsMap=69
      14. ItemsX=51
      15. ItemsY=54
      16.  


      Precio: Costo de inscripción.
      Tiempo: Duración del dm en Minutos.
      Inscripcion: Duración de la inscripción en Minutos.
      Cupos: Cantidad de participantes posibles.
      Iguales: 1: Todos se ven iguales 0: Normal

      Cuando Iguales está en 1 hace esto:
      • Todos se ven iguales
      • No se ven los Nicks
      • No se puede hablar de ninguna forma

      SeCaen: 1: Se caen 0: NO se pierden los items

      Map;Y;Y: Mapa donde se hace el DM

      ItemsMap;ItemsX;ItemsY: Mapa donde se juntan los items (Tiene que ser como el de la muestra, el Banquero se pone SOLO en al pos 50 50)
Como cambiar el MinutoAutoEventos

Otro tipo de Evento =$ :

Creo que no me faltó nada, es un poco largo pero anda bien :P.
Si quieren tiren ideas para otros eventos que se puedan automatizar.
Última edición por TwIsT el 07 Ene 2012 14:47, editado 1 vez en total
Este mensaje ha obtenido 5 Monedas de Oro.


"I'm the avatar, you gotta deal with it"
467
Destructor de Mentes [11]
Registrado: 5 Años de membresía!
Mensajes: 1021
Aportes: 2
Premios: 1
Embajador (1)

Nota » 05 Ene 2012 16:43

ajajajaajjaaj qe lindo , muy lindo (Y)

LyRan escribió:Buenos Dias amigos y programadores de Gs Zone, Me gustaria pedirle la amabilidad de una ayuda con un cliente editado para mi Ao casero, Osea me explico, yo juego Ao con varios amigos y ellos todos usan cheat y no me gusta eso me gustaria que alguien me ayudara a crear un cliente editado con auto poteo de ambas potas a la ves ya sea que se alla gastado Mana lanzando algun hechis y comienze a potear solo hasta estar completamente el Mana, igual para la salud y poteo rapido para ambos.
mAnco programEr
799
Oraculo [5]
Registrado: Años de membresíaAños de membresía
Ubicación: Bolivia
Mensajes: 2299
Aportes: 109

Nota » 05 Ene 2012 17:46

Sarpado TwIsT



Saludos !

Imagen
378
Destructor de Mentes [3]
Registrado: Años de membresía
Ubicación: Mar Del Plata
Mensajes: 634
Aportes: 9

Nota » 05 Ene 2012 18:46

jakjak Realmente TwIsT que buenos Th que armas, Muy buen Aportee

Imagen
Maestro del Gremio de Ladrones
758
Dragon Ancestral [1]
Registrado: Años de membresía
Ubicación: Polinesia
Mensajes: 2462
Aportes: 9
Premios: 1
Embajador (1)

Nota » 05 Ene 2012 20:44

Como se te ocurre regalar semejante cosa u,u .-

Honrada sea aquella guitarra que puede llegar a hablar, y glorificado sea aquel hombre que le enseña.
Aventurero Argentum
262
Destructor de Mentes [6]
Registrado: Años de membresíaAños de membresíaAños de membresía
Mensajes: 774
Aportes: 16

Nota » 06 Ene 2012 12:34

Agushh escribió:Como se te ocurre regalar semejante cosa u,u .-


Lo tenía sin usar :P, espero que alguien lo use.

"I'm the avatar, you gotta deal with it"
467
Destructor de Mentes [11]
Registrado: 5 Años de membresía!
Mensajes: 1021
Aportes: 2
Premios: 1
Embajador (1)

Nota » 06 Ene 2012 12:44

hermoso Agg (baba) , Pero Funciona en 13.0? tambien el control de eventos? gracias

Imagen
Tribal Peliculas
540
Oraculo [3]
Registrado: Años de membresíaAños de membresía
Ubicación: Colombia
Mensajes: 1551
Aportes: 4

Nota » 06 Ene 2012 13:36

-.AnDy.- escribió:hermoso Agg (baba) , Pero Funciona en 13.0? tambien el control de eventos? gracias


Debería andar en cualquier versión posterior, aunque no lo probé en 13.0.
Vos ponelo y si tenés algún problema preguntame :P.

"I'm the avatar, you gotta deal with it"
467
Destructor de Mentes [11]
Registrado: 5 Años de membresía!
Mensajes: 1021
Aportes: 2
Premios: 1
Embajador (1)

Nota » 06 Ene 2012 14:00

Cada dia mas me asombro de las cosas sarpadas que programan muy lindo ;O
Sarpado post

Imagen
Usuario Registrado
383
Aprendiz [1]
Registrado: Años de membresía
Mensajes: 224

Nota » 06 Ene 2012 14:07

Increible Twist, super lindo y muy bueno (:.

Saludos!

Imagen

Imagen

TE AMO SKYFUN SOS MI FANNNNNNNNNNNNNNNNNNNNN
HAO Staff
409
Dragon Ancestral [2]
Registrado: Años de membresía
Ubicación: Buenos Aires
Mensajes: 2745
Aportes: 28
Premios: 1
Embajador (1)

Nota » 06 Ene 2012 21:43

che chavon que sarpado , muy muy bueno ahora lo pruebo EN 13.0 cruzo los dedos ojala que funque

[Consejero De Frikis]
88
Aprendiz [1]
Registrado: Septiembre 2011
Ubicación: variable no definida
Mensajes: 235

Nota » 06 Ene 2012 23:58

Buen aporte, todo configurable xD, yo tengo algo parecido que hice en narnia.

Saludos ^^

Imagen
Imagen
Staff Zeiked-Games
641
Dragon Ancestral [3]
Registrado: Años de membresíaAños de membresía
Ubicación: Castelar
Mensajes: 3414
Aportes: 66
Premios: 3
Usuario omnipresente (1) Embajador (2)

Nota » 07 Ene 2012 01:47

Buen aporte

Imagen
@lautamarino
531
Oraculo [5]
Registrado: Octubre 2011
Mensajes: 2034
Aportes: 46
Premios: 1
Embajador (1)

Nota » 07 Ene 2012 02:56

Muy bueno, como tenia Destruction ao :D (va tiene).
Aguante River Plate ! ! !
909
Moderador
Registrado: Años de membresíaAños de membresíaAños de membresía
Ubicación: Villa adelina, Vicente Lopez.
Mensajes: 14427
Aportes: 305
Premios: 10
Señor Moderador (3) Señor Reglamento (1) Aportes (2) Embajador (3) Detector de Bugs (1)

Nota » 07 Ene 2012 05:40

Buen aporte

Holis
ADM 2013
561
Dragon Ancestral [3]
Registrado: Años de membresíaAños de membresía
Ubicación: Argentina
Mensajes: 3111
Aportes: 9

Siguiente

Volver a AO 0.12.x

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 0 invitados