Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- 'AUTOR: Toyz - Luciano
- 'FECHA: 17/12
- 'HORA: 23:50
- Private Const Rango_Puerta_X As Byte = 3
- Private Const Rango_Puerta_Y As Byte = 3
- Private Puertas As Integer
- Private Type tCerrarPuerta
- Posicion_NPC As WorldPos
- Posicion_Puerta As WorldPos
- Cerrada As Boolean
- Index As Integer
- End Type
- Private CerrarPuerta() As tCerrarPuerta
- Public Sub Cargar_IAPuertas()
- Dim Leer As clsIniReader, LoopC As Long
- Set Leer = New clsIniReader
- Call Leer.Initialize(App.Path & "\Dat\CerrarPuertas.dat")
- Puertas = CInt(Leer.GetValue("INIT", "Puertas"))
- ReDim CerrarPuerta(1 To Puertas) As tCerrarPuerta
- For LoopC = 1 To Puertas
- With CerrarPuerta(LoopC)
- .Index = CInt(Leer.GetValue("CerrarPuerta" & LoopC, "NPC_Index"))
- .Posicion_NPC.Map = CInt(ReadField(1, (Leer.GetValue("CerrarPuerta" & LoopC, "NPC_MAPA")), 45))
- .Posicion_NPC.X = CByte(ReadField(2, (Leer.GetValue("CerrarPuerta" & LoopC, "NPC_X")), 45))
- .Posicion_NPC.Y = CByte(ReadField(3, (Leer.GetValue("CerrarPuerta" & LoopC, "NPC_Y")), 45))
- .Posicion_Puerta.Map = CInt(ReadField(1, (Leer.GetValue("CerrarPuerta" & LoopC, "PUERTA_MAPA")), 45))
- .Posicion_Puerta.X = CByte(ReadField(2, (Leer.GetValue("CerrarPuerta" & LoopC, "PUERTA_X")), 45))
- .Posicion_Puerta.Y = CByte(ReadField(2, (Leer.GetValue("CerrarPuerta" & LoopC, "PUERTA_Y")), 45))
- End With
- Next LoopC
- End Sub
- Public Sub PuedeCerrar()
- Dim X As Byte, Y As Byte, LoopC As Long, LoopX As Long, LoopI As Long
- For LoopI = 1 To Puertas
- With CerrarPuerta(LoopI)
- If .Cerrada = True Then Exit Sub
- For LoopC = .Posicion_Puerta.X - Rango_Puerta_X To .Posicion_Puerta.X + Rango_Puerta_X
- For LoopX = .Posicion_Puerta.Y - Rango_Puerta_Y To .Posicion_Puerta.Y + Rango_Puerta_Y
- If MapData(.Posicion_Puerta.Map, LoopC, LoopX).UserIndex > 0 Then Exit Sub
- Next LoopX
- Next LoopC
- End With
- Call Cerrar_Puerta(LoopI)
- Next LoopI
- End Sub
- Private Sub Cerrar_Puerta(ByVal CerrarPuerta As Byte)
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement