-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
Una muestra:





DeathMatch Automático
- Cliente
- En el Private Enum JuegosPacketID agregamos:
- 'USERS
- DM '/DM
- SalirDM '/SALIRDM
- En el Sub ParseUserCommand buscamos:
- Case "/AUTOEVENTOS"
y Arriba agregamos:- Case "/DM"
- Call WriteDM
- Case "/SALIRDM"
- Call WriteSalirDM
- Luego buscamos:
- Call ShowConsoleMsg("Faltan parámetros. Utilice /AUTOEVENTOS NUM.")
- Call ShowConsoleMsg("0 - Desactivar Eventos Automáticos.")
- Call ShowConsoleMsg("1 - Activar Eventos Automáticos.")
Y abajo ponemos:- Call ShowConsoleMsg("2 - DeathMatch.")
El 2 lo pueden cambiar por el número que quieran que no se use en otro evento y LO VAMOS A USAR un poco mas adelante, no se lo olviden
. - En el módulo Protocol agregamos:
- ''
- ' Writes the "DM" message to the outgoing data buffer.
- Public Sub WriteDM()
- With outgoingData
- Call .WriteByte(ClientPacketID.Juegos)
- Call .WriteByte(JuegosPacketID.DM)
- End With
- End Sub
- ''
- ' Writes the "SalirDM" message to the outgoing data buffer.
- Public Sub WriteSalirDM()
- With outgoingData
- Call .WriteByte(ClientPacketID.Juegos)
- Call .WriteByte(JuegosPacketID.SalirDM)
- End With
- End Sub
- En el Private Enum JuegosPacketID agregamos:
- Server
- En el Private Enum JuegosPacketID agregamos:
- 'USERS
- DM '/DM
- SalirDM '/SALIRDM
Es mejor si copiamos el enum del Cliente para evitar problemas - En el Sub HandleAutoEvento buscamos:
- If HayEvento Then
- WriteConsoleMsg UserIndex, "AutoEventos> Hay un evento en este momento, espera a que finalize.", FontTypeNames.FONTTYPE_GM
y Abajo ponemos:- ElseIf AeOn = 2 Then 'EL 2 LO CAMBIAN POR EL NÚMERO QUE LES DIJE ANTES!
- Call SendData(ToAdmins, UserIndex, PrepareMessageConsoleMsg("AutoEventos> " & .name & " inició un Deathmatch.", FontTypeNames.FONTTYPE_GM))
- HayEvento = True
- modDeathMatch.Iniciar
- En el Public Sub LoadAutoEventos() antes de:
- UltimoEvento = Ninguno
- EventoActual = Ninguno
Agregamos:- modJuegoTeleps.tMinutos = val(GetVar(App.Path & "\AutoEvents.ini", "TELEPS", "Tiempo"))
- modDeathMatch.DMPrecio = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Precio"))
- modDeathMatch.MinutosDM = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Tiempo"))
- modDeathMatch.MinutosInscripcion = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Inscripcion"))
- modDeathMatch.MaxPlayers = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Cupos"))
- modDeathMatch.dmIguales = (val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Iguales")) = 1)
- modDeathMatch.dmSeCaen = (val(GetVar(App.Path & "\AutoEvents.ini", "DM", "SeCaen")) = 1)
- modDeathMatch.dmPos.map = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Map"))
- modDeathMatch.dmPos.X = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "X"))
- modDeathMatch.dmPos.Y = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "Y"))
- modDeathMatch.dmItemPos.map = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "ItemsMap"))
- modDeathMatch.dmItemPos.X = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "ItemsX"))
- modDeathMatch.dmItemPos.Y = val(GetVar(App.Path & "\AutoEvents.ini", "DM", "ItemsY"))
- Abajo de Public Sub MinutoAutoEventos() agregamos:
- If HayDM Then modDeathMatch.DMPasaMinuto
- En el Sub PasarSegundo agregamos:
- If HayDM Then modDeathMatch.DMPasaSegundo
- En el módulo modAutoEventos en el Public Enum eEvento, antes del End Enum agreguen:
- DeathMatch
- En el módulo Protocol agregamos:
- '
- ' Handles the "DM" message.
- '
- ' @param userIndex The index of the user sending the message.
- Private Sub HandleDM(ByVal UserIndex As Integer)
- If UserList(UserIndex).incomingData.length < 1 Then
- Err.Raise UserList(UserIndex).incomingData.NotEnoughDataErrCode
- Exit Sub
- End If
- With UserList(UserIndex)
- 'Remove packet ID
- Call .incomingData.ReadByte
- modDeathMatch.MandoDM UserIndex
- End With
- End Sub
- '
- ' Handles the "SalirDM" message.
- '
- ' @param userIndex The index of the user sending the message.
- Private Sub HandleSalirDM(ByVal UserIndex As Integer)
- If UserList(UserIndex).incomingData.length < 1 Then
- Err.Raise UserList(UserIndex).incomingData.NotEnoughDataErrCode
- Exit Sub
- End If
- With UserList(UserIndex)
- 'Remove packet ID
- Call .incomingData.ReadByte
- If Not HayDM Then
- WriteConsoleMsg UserIndex, "No hay ningun deathmatch", FontTypeNames.FONTTYPE_INFO
- Exit Sub
- End If
- If Not (dmPlayers.Existe(.name)) Then
- WriteConsoleMsg UserIndex, "No estás participando!", FontTypeNames.FONTTYPE_INFO
- Exit Sub
- End If
- modDeathMatch.DMSeRetira UserIndex
- End With
- End Sub
- En el Sub HandleIncommingData buscamos:
- Case ClientPacketID.Juegos
- UserList(UserIndex).incomingData.ReadByte
- Select Case UserList(UserIndex).incomingData.PeekByte()
y abajo ponemos:- Case JuegosPacketID.DM '/DM
- Call HandleDM(UserIndex)
- Case JuegosPacketID.SalirDM '/SALIRDM
- Call HandleSalirDM(UserIndex)
- Creamos un nuevo módulo y lo llamamos modDeathMatch con lo siguiente:
- Option Explicit
- Public Enum dmEstado
- EsperandoInscripcion
- Inscripcion
- Jugando
- JuntandoPremio
- End Enum
- Public EstDM As dmEstado
- Public HayDM As Boolean
- Public dmPos As WorldPos
- Public dmItemPos As WorldPos
- Public dmPlayers As New cCola
- Public MinutosInscripcion As Byte
- Public MinutosDM As Byte, dMinutos As Integer
- Public DMPrecio As Long, MaxPlayers As Integer
- Public Premio As Integer
- Public CuentaDM As Integer
- Public dmIguales As Boolean
- Public dmSeCaen As Boolean
- Private dmBanquero As Integer
- Dim DMGanador As Integer
- Public Sub Iniciar()
- EventoActual = DeathMatch
- 'MapInfo(dmPos.map).Pk = False
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("AutoEvento>¡¡DeathMatch!!", FontTypeNames.FONTTYPE_AUTOEVENTOS))
- If dmSeCaen Then
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Se caen los items. Inscripción: " & DMPrecio, FontTypeNames.FONTTYPE_AUTOEVENTOS))
- End If
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>En 1 minuto se abren las inscripciones, preparense", FontTypeNames.FONTTYPE_AUTOEVENTOS))
- EstDM = EsperandoInscripcion
- dMinutos = 1
- HayDM = True
- DMGanador = 0
- dmPlayers.Reset
- If dmSeCaen Then
- dmBanquero = SpawnNpc(24, dmItemPos, False, False)
- End If
- End Sub
- Public Sub DMPasaMinuto()
- Dim X As Byte, Y As Byte, usrInd As Integer
- Select Case EstDM
- Case dmEstado.EsperandoInscripcion
- dMinutos = dMinutos - 1
- If dMinutos <= 0 Then
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Manden /DM en 10 segundos.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
- CuentaDM = 11
- End If
- Case dmEstado.Inscripcion
- dMinutos = dMinutos - 1
- If dMinutos <= 1 Then
- If dmPlayers.Longitud <= 1 Then
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch> No se llegó al mínimo de participantes.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
- HayDM = False
- HayEvento = False
- UltimoEvento = DeathMatch
- EventoActual = Ninguno
- For X = 1 To dmPlayers.Longitud
- usrInd = NameIndex(mid(dmPlayers.VerElemento(X), 10, Len(dmPlayers.VerElemento(X))))
- UserList(usrInd).Stats.GLD = UserList(usrInd).Stats.GLD + DMPrecio
- If UserList(usrInd).Stats.GLD > MAXORO Then _
- UserList(usrInd).Stats.GLD = MAXORO
- Next X
- dmPlayers.Reset
- QuitarNPC dmBanquero
- Else
- DMComienza
- End If
- Else
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch> Quedan " & dMinutos & " minutos para inscribirse.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
- End If
- Case dmEstado.Jugando
- dMinutos = dMinutos - 1
- If dMinutos <= 0 Then
- DMTodosUlla
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch> No hubo ganador.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
- QuitarNPC dmBanquero
- ElseIf dMinutos < 3 Then
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch> Quedan " & dMinutos & " minutos.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
- End If
- Case dmEstado.JuntandoPremio
- dMinutos = dMinutos - 1
- If dMinutos <= 0 Then
- Call WarpUserChar(DMGanador, 1, 50, 50, True)
- dmPlayers.Reset
- QuitarNPC dmBanquero
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Limpiando...", FontTypeNames.FONTTYPE_AUTOEVENTOS))
- For Y = YMinMapSize To YMaxMapSize
- For X = XMinMapSize To XMaxMapSize
- If MapData(dmItemPos.map, X, Y).ObjInfo.ObjIndex > 0 And MapData(dmItemPos.map, X, Y).Blocked = 0 Then
- If ItemNoEsDeMapa(MapData(dmItemPos.map, X, Y).ObjInfo.ObjIndex) Then Call EraseObj(10000, dmItemPos.map, X, Y)
- End If
- Next X
- Next Y
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>OK", FontTypeNames.FONTTYPE_AUTOEVENTOS))
- HayDM = False
- HayEvento = False
- Else
- Call WriteConsoleMsg(DMGanador, "DeathMatch>Te quedan " & dMinutos & " minutos.", FontTypeNames.FONTTYPE_AUTOEVENTOS)
- End If
- End Select
- End Sub
- Public Sub DMPasaSegundo()
- If HayDM And CuentaDM > 0 Then
- CuentaDM = CuentaDM - 1
- If CuentaDM = 0 Then
- Select Case modDeathMatch.EstDM
- Case dmEstado.EsperandoInscripcion
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("Deathmatch> Manden /DM!!!", FontTypeNames.FONTTYPE_FIGHT))
- modDeathMatch.EstDM = Inscripcion
- dMinutos = MinutosInscripcion
- Case dmEstado.Jugando
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("Deathmatch>YAAAA!!!", FontTypeNames.FONTTYPE_FIGHT))
- 'MapInfo(dmPos.map).Pk = True
- End Select
- Else
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("Deathmatch> " & CuentaDM & "...", FontTypeNames.FONTTYPE_TALK))
- End If
- End If
- End Sub
- Public Function DMPuedeAtacar(ByVal attackerIndex As Integer, ByVal VictimIndex As Integer) As Boolean
- If EstDM = Jugando Then
- If dmPlayers.Existe(UserList(attackerIndex).name) And dmPlayers.Existe(UserList(VictimIndex).name) Then
- DMPuedeAtacar = (CuentaDM <= 0)
- Else
- DMPuedeAtacar = True
- End If
- Else
- DMPuedeAtacar = True
- End If
- End Function
- Public Function DMEstaJugando(ByVal UserIndex As Integer) As Boolean
- If EstDM = Jugando Then
- If dmPlayers.Existe(UserList(UserIndex).name) Then
- DMEstaJugando = True
- Else
- DMEstaJugando = False
- End If
- Else
- DMEstaJugando = False
- End If
- End Function
- Public Sub DMComienza()
- Dim a As Integer, X As Integer, Y As Integer, UI As Integer
- For a = 1 To dmPlayers.Longitud
- X = dmPos.X
- Y = dmPos.Y
- UI = NameIndex(mid(dmPlayers.VerElemento(a), 10, Len(dmPlayers.VerElemento(a))))
- FindLegalPos UI, dmPos.map, X, Y
- If dmIguales Then
- UserList(UI).showName = False
- With UserList(UI)
- .CharMimetizado.body = .Char.body
- .CharMimetizado.Head = .Char.Head
- .CharMimetizado.CascoAnim = .Char.CascoAnim
- .CharMimetizado.ShieldAnim = .Char.ShieldAnim
- .CharMimetizado.WeaponAnim = .Char.WeaponAnim
- .flags.Mimetizado = 1
- .Char.body = 255
- .Char.Head = 501
- .Char.CascoAnim = 0
- .Char.ShieldAnim = 0
- .Char.WeaponAnim = 0
- Call ChangeUserChar(UI, .Char.body, .Char.Head, .Char.heading, .Char.WeaponAnim, .Char.ShieldAnim, .Char.CascoAnim)
- End With
- End If
- WarpUserChar UI, dmPos.map, X, Y, True
- 'Revivimos si es necesario
- If UserList(UI).flags.Muerto = 1 Then
- Call RevivirUsuario(UI)
- End If
- If (UserList(UI).flags.invisible = 1) Or (UserList(UI).flags.Oculto = 1) Then
- If UserList(UI).flags.Oculto = 1 Then
- UserList(UI).Counters.TiempoOculto = 0
- UserList(UI).flags.Oculto = 0
- Call SetInvisible(UI, UserList(UI).Char.CharIndex, False)
- Else
- UserList(UI).Counters.Invisibilidad = 0
- UserList(UI).flags.invisible = 0
- Call SetInvisible(UI, UserList(UI).Char.CharIndex, False)
- End If
- End If
- Next a
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("Deathmatch>Empieza en...", FontTypeNames.FONTTYPE_TALK))
- Premio = dmPlayers.Longitud
- modDeathMatch.EstDM = Jugando
- dMinutos = 20
- CuentaDM = 5
- End Sub
- Public Sub MandoDM(ByVal UserIndex As Integer)
- With UserList(UserIndex)
- If Not HayDM Then
- WriteConsoleMsg UserIndex, "No hay ningun deathmatch", FontTypeNames.FONTTYPE_INFO
- Exit Sub
- End If
- If dmPlayers.Existe(.name) Then
- WriteConsoleMsg UserIndex, "Ya estás participando!", FontTypeNames.FONTTYPE_INFO
- Exit Sub
- End If
- Select Case EstDM
- Case dmEstado.EsperandoInscripcion
- WriteConsoleMsg UserIndex, "Todavía no se abrieron las inscripciones", FontTypeNames.FONTTYPE_INFO
- Exit Sub
- Case dmEstado.Inscripcion
- Case dmEstado.Jugando
- WriteConsoleMsg UserIndex, "El DeathMatch ya empezó", FontTypeNames.FONTTYPE_INFO
- Exit Sub
- End Select
- If .flags.Muerto = 1 Then
- Call WriteConsoleMsg(UserIndex, "¡¡Estas muerto!!", FontTypeNames.FONTTYPE_INFO)
- Exit Sub
- End If
- If .Stats.GLD < DMPrecio Then
- WriteConsoleMsg UserIndex, "No tienes suficiente oro. La inscripción cuesta " & DMPrecio, FontTypeNames.FONTTYPE_INFO
- Exit Sub
- End If
- If .Counters.Pena > 0 Then
- WriteConsoleMsg UserIndex, "No puedes participar desde la carcel.", FontTypeNames.FONTTYPE_INFO
- Exit Sub
- End If
- If dmPlayers.Longitud >= 20 Then
- WriteConsoleMsg UserIndex, "No quedan mas lugares", FontTypeNames.FONTTYPE_INFO
- Exit Sub
- End If
- .Stats.GLD = .Stats.GLD - 50000
- Call WriteUpdateUserStats(UserIndex)
- dmPlayers.Push .name
- WriteConsoleMsg UserIndex, "Deathmatch> Para salir /SALIRDM, si sales antes de que empieze se te devolvera el 80% de las inscripción", FontTypeNames.FONTTYPE_AUTOEVENTOS
- If dmPlayers.Longitud >= 20 Then
- DMComienza
- Else
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Quedan " & 20 - dmPlayers.Longitud & " lugares.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
- End If
- End With
- End Sub
- Public Sub DMSeRetira(ByVal UserIndex As Integer)
- Dim X As Byte, Y As Byte
- If dmPlayers.Existe(UserList(UserIndex).name) Then
- Select Case EstDM
- Case dmEstado.Inscripcion
- WriteConsoleMsg UserIndex, "DeathMatch> Has salido se te devolvio el 80% de la Inscripción.", FontTypeNames.FONTTYPE_AUTOEVENTOS
- UserList(UserIndex).Stats.GLD = UserList(UserIndex).Stats.GLD + (DMPrecio * 0.8)
- If UserList(UserIndex).Stats.GLD > MAXORO Then _
- UserList(UserIndex).Stats.GLD = MAXORO
- Call WriteUpdateUserStats(UserIndex)
- dmPlayers.Quitar (UserList(UserIndex).name)
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Quedan " & 20 - dmPlayers.Longitud & " lugares.", FontTypeNames.FONTTYPE_AUTOEVENTOS))
- Case dmEstado.Jugando
- WriteConsoleMsg UserIndex, "DeathMatch> Has salido.", FontTypeNames.FONTTYPE_AUTOEVENTOS
- WarpUserChar UserIndex, 1, 50, 50, True
- dmPlayers.Quitar (UserList(UserIndex).name)
- If dmPlayers.Longitud = 1 Then
- DMGana NameIndex(mid(dmPlayers.VerElemento(1), 10, Len(dmPlayers.VerElemento(1))))
- End If
- If dmIguales Then
- With UserList(UserIndex)
- If .flags.Mimetizado = 1 Then
- .Char.body = .CharMimetizado.body
- .Char.Head = .CharMimetizado.Head
- .Char.CascoAnim = .CharMimetizado.CascoAnim
- .Char.ShieldAnim = .CharMimetizado.ShieldAnim
- .Char.WeaponAnim = .CharMimetizado.WeaponAnim
- .Counters.Mimetismo = 0
- .flags.Mimetizado = 0
- End If
- .showName = True
- End With
- End If
- Case dmEstado.JuntandoPremio
- Call WarpUserChar(DMGanador, 1, 58, 45, True)
- dmPlayers.Reset
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Limpiando...", FontTypeNames.FONTTYPE_AUTOEVENTOS))
- For Y = YMinMapSize To YMaxMapSize
- For X = XMinMapSize To XMaxMapSize
- If MapData(dmItemPos.map, X, Y).ObjInfo.ObjIndex > 0 And MapData(dmItemPos.map, X, Y).Blocked = 0 Then
- If ItemNoEsDeMapa(MapData(dmItemPos.map, X, Y).ObjInfo.ObjIndex) Then Call EraseObj(10000, dmItemPos.map, X, Y)
- End If
- Next X
- Next Y
- QuitarNPC dmBanquero
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>OK", FontTypeNames.FONTTYPE_AUTOEVENTOS))
- HayDM = False
- HayEvento = False
- End Select
- End If
- End Sub
- Public Sub DMMuere(ByVal UserIndex As Integer)
- If dmPlayers.Existe(UserList(UserIndex).name) Then
- If EstDM = Jugando Then
- WriteConsoleMsg UserIndex, "DeathMatch> Has muerto.", FontTypeNames.FONTTYPE_AUTOEVENTOS
- If dmIguales Then
- UserList(UserIndex).showName = True
- End If
- If dmSeCaen Then
- DMTirarTodo UserIndex
- End If
- WarpUserChar UserIndex, 1, 58, 45, True
- dmPlayers.Quitar (UserList(UserIndex).name)
- If dmPlayers.Longitud = 1 Then
- DMGana NameIndex(mid(dmPlayers.VerElemento(1), 10, Len(dmPlayers.VerElemento(1))))
- End If
- End If
- End If
- End Sub
- Public Sub DMConecta(ByVal UserIndex As Integer)
- If EstDM = Inscripcion Then
- WriteConsoleMsg UserIndex, "DeathMatch> Para entrar /DM. Quedan " & 20 - dmPlayers.Longitud & " lugares.", FontTypeNames.FONTTYPE_AUTOEVENTOS
- ElseIf EstDM = EsperandoInscripcion Then
- WriteConsoleMsg UserIndex, "DeathMatch> Preparate, en " & dMinutos & " se abren las inscripciones.", FontTypeNames.FONTTYPE_AUTOEVENTOS
- End If
- End Sub
- Public Sub DMGana(ByVal UserIndex As Integer)
- Dim a As Byte
- With UserList(UserIndex)
- If dmPlayers.Existe(.name) Then
- Call SendData(ToAll, 0, PrepareMessageConsoleMsg("DeathMatch>Fin del DM. Gandor: " & .name, FontTypeNames.FONTTYPE_AUTOEVENTOS))
- If dmIguales Then
- If .flags.Mimetizado = 1 Then
- .Char.body = .CharMimetizado.body
- .Char.Head = .CharMimetizado.Head
- .Char.CascoAnim = .CharMimetizado.CascoAnim
- .Char.ShieldAnim = .CharMimetizado.ShieldAnim
- .Char.WeaponAnim = .CharMimetizado.WeaponAnim
- .Counters.Mimetismo = 0
- .flags.Mimetizado = 0
- End If
- .showName = True
- End If
- Call WarpUserChar(UserIndex, dmItemPos.map, dmItemPos.X, dmItemPos.Y - 1, True)
- UserList(UserIndex).Stats.GLD = UserList(UserIndex).Stats.GLD + (Premio * 50000)
- If UserList(UserIndex).Stats.GLD > MAXORO Then _
- UserList(UserIndex).Stats.GLD = MAXORO
- Call WriteUpdateUserStats(UserIndex)
- Call WriteConsoleMsg(UserIndex, "DeathMatch> Has ganado " & Premio * 50000 & " monedas de oro.", FontTypeNames.FONTTYPE_AUTOEVENTOS)
- If dmSeCaen Then
- Call WriteConsoleMsg(UserIndex, "DeathMatch> Tienes 3 minutos para agarrar tu botin. Cuando termines /SALIRDM.", FontTypeNames.FONTTYPE_AUTOEVENTOS)
- EstDM = JuntandoPremio
- DMGanador = UserIndex
- dMinutos = 3
- Else
- Call WarpUserChar(UserIndex, 1, 50, 50, True)
- dmPlayers.Reset
- HayDM = False
- HayEvento = False
- End If
- End If
- End With
- End Sub
- Public Sub DMTodosUlla()
- Dim a As Integer, X As Integer, Y As Integer
- HayDM = False
- HayEvento = False
- UltimoEvento = DeathMatch
- EventoActual = Ninguno
- For a = 1 To dmPlayers.Longitud
- X = 58
- Y = 45
- If dmIguales Then
- With UserList(NameIndex(mid(dmPlayers.VerElemento(a), 10, Len(dmPlayers.VerElemento(a)))))
- If .flags.Mimetizado = 1 Then
- .Char.body = .CharMimetizado.body
- .Char.Head = .CharMimetizado.Head
- .Char.CascoAnim = .CharMimetizado.CascoAnim
- .Char.ShieldAnim = .CharMimetizado.ShieldAnim
- .Char.WeaponAnim = .CharMimetizado.WeaponAnim
- .Counters.Mimetismo = 0
- .flags.Mimetizado = 0
- End If
- .showName = True
- End With
- End If
- FindLegalPos NameIndex(mid(dmPlayers.VerElemento(a), 10, Len(dmPlayers.VerElemento(a)))), 1, X, Y
- WarpUserChar NameIndex(mid(dmPlayers.VerElemento(a), 10, Len(dmPlayers.VerElemento(a)))), 1, X, Y, True
- Next a
- dmPlayers.Reset
- End Sub
- Sub DMTirarTodo(ByVal UserIndex As Integer)
- Dim i As Byte
- Dim NuevaPos As WorldPos
- Dim MiObj As Obj
- Dim ItemIndex As Integer
- For i = 1 To MAX_INVENTORY_SLOTS
- ItemIndex = UserList(UserIndex).Invent.Object(i).ObjIndex
- If ItemIndex > 0 Then
- If ItemSeCae(ItemIndex) Then
- NuevaPos.X = 0
- NuevaPos.Y = 0
- 'Creo el Obj
- MiObj.amount = UserList(UserIndex).Invent.Object(i).amount
- MiObj.ObjIndex = ItemIndex
- 'Pablo (ToxicWaste) 24/01/2007
- 'Si es pirata y usa un Galeón entonces no explota los items. (en el agua)
- If UserList(UserIndex).clase = eClass.Pirat And UserList(UserIndex).Invent.BarcoObjIndex = 476 Then
- Tilelibre dmItemPos, NuevaPos, MiObj, False, True
- Else
- Tilelibre dmItemPos, NuevaPos, MiObj, True, True
- End If
- If NuevaPos.X <> 0 And NuevaPos.Y <> 0 Then
- Call DropObj(UserIndex, i, MAX_INVENTORY_OBJS, NuevaPos.map, NuevaPos.X, NuevaPos.Y)
- End If
- 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)
- End If
- End If
- Next i
- End Sub
- Buscamos:
- Public Sub EfectoMimetismo(ByVal UserIndex As Integer)
- '******************************************************
- 'Author: Unknown
- 'Last Update: 04/11/2008 (NicoNZ)
- '
- '******************************************************
- Dim Barco As ObjData
y Abajo ponemos:- If modDeathMatch.HayDM And modDeathMatch.dmIguales Then
- If modDeathMatch.dmPlayers.Existe(UserList(UserIndex).name) And modDeathMatch.EstDM = Jugando Then
- Exit Sub
- End If
- End If
- En el Sub UserDie buscamos:
- If (TriggerZonaPelea(UserIndex, UserIndex) <> eTrigger6.TRIGGER6_PERMITE) And .Pos.map <> 68 Then
- ' << Si es newbie no pierde el inventario >>
- If Not EsNewbie(UserIndex) Or criminal(UserIndex) Then
- Call TirarTodo(UserIndex)
- Else
- Call TirarTodosLosItemsNoNewbies(UserIndex)
- End If
- End If
y Arriba ponemos:- If HayDM Then modDeathMatch.DMMuere UserIndex
- En el Sub ConnectUser en algún lado o abajo de:
- If LenB(tStr) <> 0 Then
- Call WriteShowMessageBox(UserIndex, "Tu solicitud de ingreso al clan ha sido rechazada. El clan te explica que: " & tStr)
- End If
Ponemos:- If HayDM Then modDeathMatch.DMConecta UserIndex
En el Sub CloseUser buscamos: - UserList(UserIndex).flags.AtacadoPorNpc = 0
- UserList(UserIndex).flags.NPCAtacado = 0
- If HayDM Then modDeathMatch.DMSeRetira UserIndex
- Buscamos:
- Public Sub DoOcultarse(ByVal UserIndex As Integer)
- 'Pablo (ToxicWaste): No olvidar agregar IntervaloOculto=500 al Server.ini.
- 'Modifique la fórmula y ahora anda bien.
- On Error GoTo Errhandler
- Dim Suerte As Double
- Dim res As Integer
- Dim Skill As Integer
y Abajo ponemos:- If modDeathMatch.HayDM Then
- If modDeathMatch.EstDM = Jugando Then
- If modDeathMatch.dmPlayers.Existe(UserList(UserIndex).name) Then
- Exit Sub
- End If
- End If
- End If
- Buscamos:
- Dim H As Integer, tU As Integer
- H = UserList(UserIndex).Stats.UserHechizos(UserList(UserIndex).flags.Hechizo)
- tU = UserList(UserIndex).flags.TargetUser
- If Hechizos(H).Invisibilidad = 1 Then
y Abajo ponemos:- If modDeathMatch.HayDM Then
- If modDeathMatch.EstDM = Jugando Then
- If modDeathMatch.dmPlayers.Existe(UserList(tU).name) Then
- Exit Sub
- End If
- End If
- End If
- En la Public Function PuedeAtacar buscamos:
- 'No podes atacar a alguien muerto
- If UserList(VictimIndex).flags.Muerto = 1 Then
- Call WriteConsoleMsg(attackerIndex, "No podés atacar a un espiritu", FontTypeNames.FONTTYPE_INFO)
- PuedeAtacar = False
- Exit Function
- End If
y Abajo ponemos:- If modDeathMatch.HayDM Then
- If Not modDeathMatch.DMPuedeAtacar(attackerIndex, VictimIndex) Then
- Call WriteConsoleMsg(attackerIndex, "No podés atacar todavía", FontTypeNames.FONTTYPE_INFO)
- PuedeAtacar = False
- Exit Function
- End If
- End If
- En el HandleTalk abajo de:
- 'I see you....
- If .flags.Oculto > 0 Then
- .flags.Oculto = 0
- .Counters.TiempoOculto = 0
- If .flags.invisible = 0 Then
- Call UsUaRiOs.SetInvisible(UserIndex, UserList(UserIndex).Char.CharIndex, False)
- 'Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageSetInvisible(.Char.CharIndex, False))
- Call WriteConsoleMsg(UserIndex, "¡Has vuelto a ser visible!", FontTypeNames.FONTTYPE_INFO)
- End If
- End If
Ponemos:- If modDeathMatch.HayDM And modDeathMatch.dmIguales Then
- If modDeathMatch.dmPlayers.Existe(UserList(UserIndex).name) And modDeathMatch.EstDM = Jugando Then
- Call .incomingData.CopyBuffer(buffer)
- Exit Sub
- End If
- End If
Hacemos los mismo en el HandleYell - Abajo de:
- '[Consejeros & GMs]
- If .flags.Privilegios And (PlayerType.Consejero Or PlayerType.SemiDios) Then
- Call LogGM(.name, "Le dijo a '" & UserList(targetUserIndex).name & "' " & chat)
- End If
Ponemos:- If modDeathMatch.HayDM And modDeathMatch.dmIguales Then
- If modDeathMatch.dmPlayers.Existe(UserList(UserIndex).name) And modDeathMatch.EstDM = Jugando Then
- Call .incomingData.CopyBuffer(buffer)
- Exit Sub
- End If
- End If
- Buscamos:
- If .flags.Oculto = 1 Then
- '[CDT 17-02-2004]
- If Not .flags.UltimoMensaje = 2 Then
- Call WriteConsoleMsg(UserIndex, "Ya estás oculto.", FontTypeNames.FONTTYPE_INFO)
- .flags.UltimoMensaje = 2
- End If
- '[/CDT]
- Exit Sub
- End If
y Abajo ponemos:- If modDeathMatch.HayDM Then
- If modDeathMatch.DMEstaJugando(UserIndex) Then
- Exit Sub
- End If
- End If
- En el Sub HandleGuildMessage abajo de:
- chat = buffer.ReadASCIIString()
Ponemos:- If modDeathMatch.HayDM And modDeathMatch.dmIguales Then
- If modDeathMatch.dmPlayers.Existe(UserList(UserIndex).name) And modDeathMatch.EstDM = Jugando Then
- Call .incomingData.CopyBuffer(buffer)
- Exit Sub
- End If
- End If
Hacemos los mismo en el HandlePartyMessage - En el AutoEventos.ini agregamos:
- [DM]
- Precio=50000
- Tiempo=30
- Inscripcion=1
- Cupos=20
- Iguales=1
- SeCaen=1
- Map=68
- X=59
- Y=59
- ItemsMap=69
- ItemsX=51
- ItemsY=54
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)
y Abajo ponemos:
Otro tipo de Evento
Creo que no me faltó nada, es un poco largo pero anda bien
Si quieren tiren ideas para otros eventos que se puedan automatizar.






467![Destructor de Mentes [11] Destructor de Mentes [11]](./images/ranks/Rango23.gif)
![Oraculo [5] Oraculo [5]](./images/ranks/Rango29.gif)

![Destructor de Mentes [3] Destructor de Mentes [3]](./images/ranks/Rango15.gif)


![Dragon Ancestral [1] Dragon Ancestral [1]](./images/ranks/Rango30.gif)
![Destructor de Mentes [6] Destructor de Mentes [6]](./images/ranks/Rango18.gif)

![Oraculo [3] Oraculo [3]](./images/ranks/Rango27.gif)

![Aprendiz [1] Aprendiz [1]](./images/ranks/Rango6.gif)



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



![Dragon Ancestral [3] Dragon Ancestral [3]](./images/ranks/Rango32.gif)


