Skip to content

Commit

Permalink
Fix IA Npcs
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinTrionfetti committed Jul 10, 2021
1 parent 7d35021 commit dee8e03
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Codigo/General.bas
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ Sub Main()
114 Call InicializarConstantes

116 frmCargando.Show
LastCountUsersOnline = 100
LastCountUsersOnline = -1
'Call PlayWaveAPI(App.Path & "\wav\harp3.wav")

118 frmMain.Caption = frmMain.Caption & " V." & App.Major & "." & App.Minor & "." & App.Revision
Expand Down
7 changes: 2 additions & 5 deletions Codigo/MODULO_NPCs.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1171,8 +1171,6 @@ Function OpenNPC(ByVal NpcNumber As Integer, _
'166 .QuestNumber = val(Leer.GetValue("NPC" & NpcNumber, "QuestNumber"))




186 .PoderAtaque = val(Leer.GetValue("NPC" & NpcNumber, "PoderAtaque"))
188 .PoderEvasion = val(Leer.GetValue("NPC" & NpcNumber, "PoderEvasion"))

Expand All @@ -1187,6 +1185,7 @@ Function OpenNPC(ByVal NpcNumber As Integer, _

200 .IntervaloAtaque = val(Leer.GetValue("NPC" & NpcNumber, "IntervaloAtaque"))
202 .IntervaloMovimiento = val(Leer.GetValue("NPC" & NpcNumber, "IntervaloMovimiento"))

204 .IntervaloLanzarHechizo = val(Leer.GetValue("NPC" & NpcNumber, "IntervaloLanzarHechizo"))

206 .Contadores.IntervaloRespawn = val(Leer.GetValue("NPC" & NpcNumber, "IntervaloRespawn"))
Expand All @@ -1206,12 +1205,10 @@ Function OpenNPC(ByVal NpcNumber As Integer, _

222 If .IntervaloLanzarHechizo = 0 Then
224 .IntervaloLanzarHechizo = 8000

End If

226 If .IntervaloAtaque = 0 Then
228 .IntervaloAtaque = 2000

End If

230 .Stats.MaxHp = val(Leer.GetValue("NPC" & NpcNumber, "MaxHP"))
Expand Down Expand Up @@ -1370,7 +1367,7 @@ Function OpenNPC(ByVal NpcNumber As Integer, _
396 If .pathFindingInfo.RangoVision = 0 Then .pathFindingInfo.RangoVision = RANGO_VISION_X

398 .pathFindingInfo.Inteligencia = val(Leer.GetValue("NPC" & NpcNumber, "Inteligencia"))
400 If .pathFindingInfo.Inteligencia = 0 Then .pathFindingInfo.Inteligencia = 30
400 If .pathFindingInfo.Inteligencia = 0 Then .pathFindingInfo.Inteligencia = 0

402 ReDim .pathFindingInfo.Path(1 To .pathFindingInfo.Inteligencia + RANGO_VISION_X * 3)

Expand Down
17 changes: 13 additions & 4 deletions Codigo/frmMain.frm
Original file line number Diff line number Diff line change
Expand Up @@ -832,9 +832,18 @@ Handler:
End Sub

Private Sub T_UsersOnline_Timer()

On Error GoTo T_UsersOnline_Err

If LastCountUsersOnline <> NumUsers Then
Call MostrarNumUsers
End If

Exit Sub

T_UsersOnline_Err:
106 Call RegistrarError(Err.Number, Err.Description, "General.T_UsersOnline", Erl)

End Sub

' WyroX: Comprobamos cada 10 segundos, porque no es necesaria tanta precisión
Expand Down Expand Up @@ -1831,7 +1840,7 @@ Private Sub TIMER_AI_Timer()

'Barrin 29/9/03
If Not haciendoBK And Not EnPausa Then

'Update NPCs
For NpcIndex = 1 To LastNPC

Expand All @@ -1858,8 +1867,8 @@ Private Sub TIMER_AI_Timer()
If .flags.Inmovilizado > 0 Then Call EfectoInmovilizadoNpc(NpcIndex)

If Mapa > 0 Then
'Emancu: Vamos a probar si el server se degrada moviendo TODOS los npc, con o sin users.
'If MapInfo(Mapa).NumUsers > 0 Or NpcList(NpcIndex).NPCtype = eNPCType.GuardiaNpc Then
'Emancu: Vamos a probar si el server se degrada moviendo TODOS los npc, con o sin users. HarThaoS / WyroX: Si, se degrada.

This comment has been minimized.

Copy link
@emancu

emancu Jul 10, 2021

Contributor

😂 Genial tu comentario.
Voy a pensar como podemos hacer q la IA funcione parecido pero sin laggear

If MapInfo(Mapa).NumUsers > 0 Or NpcList(NpcIndex).NPCtype = eNPCType.GuardiaNpc Then

If IntervaloPermiteMoverse(NpcIndex) Then

Expand All @@ -1875,7 +1884,7 @@ Private Sub TIMER_AI_Timer()

End If

'End If
End If

End If

Expand Down

0 comments on commit dee8e03

Please sign in to comment.