diff --git a/Codigo/Declares.bas b/Codigo/Declares.bas index 2a768737..3a01cc58 100644 --- a/Codigo/Declares.bas +++ b/Codigo/Declares.bas @@ -1295,10 +1295,9 @@ Public Enum e_TrapEffect End Enum Public Enum e_TripState - eNixToForgat = 1 eForgatToNix + eNixToArghal eArghalToForgat - eForgatToArghal End Enum Public Type t_Transport @@ -2983,7 +2982,9 @@ Public Renacimiento As t_WorldPos Public NixDock As t_Transport Public ForgatDock As t_Transport Public ArghalDock As t_Transport -Public BarcoNavegando As t_Transport +Public BarcoNavegandoForgatNix As t_Transport +Public BarcoNavegandoNixArghal As t_Transport +Public BarcoNavegandoArghalForgat As t_Transport Public TotalMapasCiudades() As String Public Ayuda As New cCola diff --git a/Codigo/FileIO.bas b/Codigo/FileIO.bas index d6ba6b44..bff61092 100644 --- a/Codigo/FileIO.bas +++ b/Codigo/FileIO.bas @@ -2563,17 +2563,43 @@ Sub CargarCiudades() .y = val(Lector.GetValue("Renacimiento", "Y")) End With - With BarcoNavegando - .Map = val(Lector.GetValue("BarcoNavegando", "Mapa")) - .StartX = val(Lector.GetValue("BarcoNavegando", "StartX")) - .StartY = val(Lector.GetValue("BarcoNavegando", "StartY")) - .EndX = val(Lector.GetValue("BarcoNavegando", "EndX")) - .EndY = val(Lector.GetValue("BarcoNavegando", "EndY")) - .DestX = val(Lector.GetValue("BarcoNavegando", "DestX")) - .DestY = val(Lector.GetValue("BarcoNavegando", "DestY")) - .DockX = val(Lector.GetValue("BarcoNavegando", "DockX")) - .DockY = val(Lector.GetValue("BarcoNavegando", "DockY")) - .RequiredPassID = val(Lector.GetValue("BarcoNavegando", "RequiredPassID")) + With BarcoNavegandoForgatNix + .Map = val(Lector.GetValue("BarcoNavegandoForgatNix", "Mapa")) + .startX = val(Lector.GetValue("BarcoNavegandoForgatNix", "StartX")) + .startY = val(Lector.GetValue("BarcoNavegandoForgatNix", "StartY")) + .EndX = val(Lector.GetValue("BarcoNavegandoForgatNix", "EndX")) + .EndY = val(Lector.GetValue("BarcoNavegandoForgatNix", "EndY")) + .DestX = val(Lector.GetValue("BarcoNavegandoForgatNix", "DestX")) + .DestY = val(Lector.GetValue("BarcoNavegandoForgatNix", "DestY")) + .DockX = val(Lector.GetValue("BarcoNavegandoForgatNix", "DockX")) + .DockY = val(Lector.GetValue("BarcoNavegandoForgatNix", "DockY")) + .RequiredPassID = val(Lector.GetValue("BarcoNavegandoForgatNix", "RequiredPassID")) + End With + + With BarcoNavegandoNixArghal + .Map = val(Lector.GetValue("BarcoNavegandoNixArghal", "Mapa")) + .startX = val(Lector.GetValue("BarcoNavegandoNixArghal", "StartX")) + .startY = val(Lector.GetValue("BarcoNavegandoNixArghal", "StartY")) + .EndX = val(Lector.GetValue("BarcoNavegandoNixArghal", "EndX")) + .EndY = val(Lector.GetValue("BarcoNavegandoNixArghal", "EndY")) + .DestX = val(Lector.GetValue("BarcoNavegandoNixArghal", "DestX")) + .DestY = val(Lector.GetValue("BarcoNavegandoNixArghal", "DestY")) + .DockX = val(Lector.GetValue("BarcoNavegandoNixArghal", "DockX")) + .DockY = val(Lector.GetValue("BarcoNavegandoNixArghal", "DockY")) + .RequiredPassID = val(Lector.GetValue("BarcoNavegandoNixArghal", "RequiredPassID")) + End With + + With BarcoNavegandoArghalForgat + .Map = val(Lector.GetValue("BarcoNavegandoArghalForgat", "Mapa")) + .startX = val(Lector.GetValue("BarcoNavegandoArghalForgat", "StartX")) + .startY = val(Lector.GetValue("BarcoNavegandoArghalForgat", "StartY")) + .EndX = val(Lector.GetValue("BarcoNavegandoArghalForgat", "EndX")) + .EndY = val(Lector.GetValue("BarcoNavegandoArghalForgat", "EndY")) + .DestX = val(Lector.GetValue("BarcoNavegandoArghalForgat", "DestX")) + .DestY = val(Lector.GetValue("BarcoNavegandoArghalForgat", "DestY")) + .DockX = val(Lector.GetValue("BarcoNavegandoArghalForgat", "DockX")) + .DockY = val(Lector.GetValue("BarcoNavegandoArghalForgat", "DockY")) + .RequiredPassID = val(Lector.GetValue("BarcoNavegandoArghalForgat", "RequiredPassID")) End With With ForgatDock @@ -2586,7 +2612,7 @@ Sub CargarCiudades() .DestY = val(Lector.GetValue("ForgatDock", "DestY")) .DockX = val(Lector.GetValue("ForgatDock", "DockX")) .DockY = val(Lector.GetValue("ForgatDock", "DockY")) - .RequiredPassID = val(Lector.GetValue("BarcoNavegando", "RequiredPassID")) + .RequiredPassID = val(Lector.GetValue("BarcoNavegandoForgatNix", "RequiredPassID")) End With With NixDock @@ -2599,7 +2625,7 @@ Sub CargarCiudades() .DestY = val(Lector.GetValue("NixDock", "DestY")) .DockX = val(Lector.GetValue("NixDock", "DockX")) .DockY = val(Lector.GetValue("NixDock", "DockY")) - .RequiredPassID = val(Lector.GetValue("BarcoNavegando", "RequiredPassID")) + .RequiredPassID = val(Lector.GetValue("BarcoNavegandoNixArghal", "RequiredPassID")) End With With ArghalDock @@ -2612,7 +2638,7 @@ Sub CargarCiudades() .DestY = val(Lector.GetValue("ArghalDock", "DestY")) .DockX = val(Lector.GetValue("ArghalDock", "DockX")) .DockY = val(Lector.GetValue("ArghalDock", "DockY")) - .RequiredPassID = val(Lector.GetValue("BarcoNavegando", "RequiredPassID")) + .RequiredPassID = val(Lector.GetValue("BarcoNavegandoArghalForgat", "RequiredPassID")) End With diff --git a/Codigo/General.bas b/Codigo/General.bas index 33a434a2..556c2f7a 100644 --- a/Codigo/General.bas +++ b/Codigo/General.bas @@ -705,7 +705,9 @@ Sub Main() .tControlHechizos.Interval = 60000 If IsFeatureEnabled("ShipTravelEnabled") Then .TimerBarco.Enabled = True - MapInfo(BarcoNavegando.map).ForceUpdate = True + MapInfo(BarcoNavegandoForgatNix.Map).ForceUpdate = True + MapInfo(BarcoNavegandoNixArghal.Map).ForceUpdate = True + MapInfo(BarcoNavegandoArghalForgat.Map).ForceUpdate = True End If diff --git a/Codigo/LocaleDef.bas b/Codigo/LocaleDef.bas index 8d05c5f4..9fd73167 100644 --- a/Codigo/LocaleDef.bas +++ b/Codigo/LocaleDef.bas @@ -115,7 +115,10 @@ Public Const MsgNavalBattleRewardBroadcast = 486 Public Const MsgBoardcastInscriptionPrice = 487 Public Const MsgMatchComplete = 488 Public Const MsgInvalidPassword = 489 -Public Const MsgThanksForTravelArghal = 490 +Public Const MsgPassArghal = 490 +Public Const MsgThanksForTravelArghal = 491 + + Public Function GetRequiredWeaponLocaleId(ByVal WeaponType As e_WeaponType) As Integer Select Case WeaponType diff --git a/Codigo/frmMain.frm b/Codigo/frmMain.frm index ab10df96..3f15763a 100644 --- a/Codigo/frmMain.frm +++ b/Codigo/frmMain.frm @@ -895,7 +895,9 @@ End Sub Private Sub TimerBarco_Timer() Dim PerformanceTimer As Long Call PerformanceTestStart(PerformanceTimer) - Call UpdateDock + Call UpdateBarcoForgatNix + Call UpdateBarcoNixArghal + Call UpdateBarcoArghalForgat Call MsnEnbarque(ForgatDock) Call MsnEnbarque(ArghalDock) Call MsnEnbarque(NixDock) @@ -906,7 +908,9 @@ Private Function GetPassSlot(ByVal UserIndex As Integer) As Integer Dim i As Integer With UserList(UserIndex) For i = 1 To UBound(.invent.Object) - If .invent.Object(i).objIndex = BarcoNavegando.RequiredPassID Then + + ' Le saco el item requerido de Forgat a Nix, que es igual que de Nix a Arghal y de Arghal a Forgat + If .invent.Object(i).ObjIndex = BarcoNavegandoForgatNix.RequiredPassID Then GetPassSlot = i Exit Function End If @@ -937,111 +941,195 @@ Private Sub MsnEnbarque(ByRef ShipInfo As t_Transport) SendToMap_Err: 112 Call TraceError(Err.Number, Err.Description, "modSendData.SendToMap", Erl) End Sub -Private Sub UpdateDock() +Private Sub UpdateBarcoForgatNix() Dim TileX, TileY As Integer Dim user As Integer Dim PassFound As Boolean Dim PassSlot As Integer - ' Verificar si el barco está en un muelle - If MapData(BarcoNavegando.map, BarcoNavegando.DockX, BarcoNavegando.DockY).npcIndex = 0 Then - BarcoNavegando.IsSailing = True - Exit Sub - End If + ' Modificado por Shugar 5/6/24 + ' Viaje de Forgat a Nix - ' Si el barco no está navegando, no hay nada que hacer - If Not BarcoNavegando.IsSailing Then + ' Verificar si el barco está en un muelle: + ' Para ver si está en el muelle o no, miramos hay un NpcIndex en Map DockX DockY del mapa BarcoNavegando. + ' Ese Npc solía ser un muelle, y se usa de referencia para saber si el barco partió o sigue quieto. + ' Si no hay NPC ahí es que el barco está navegando, por lo tanto no hay movimiento de pasajeros. + + If MapData(BarcoNavegandoForgatNix.Map, BarcoNavegandoForgatNix.DockX, BarcoNavegandoForgatNix.DockY).NpcIndex = 0 Then Exit Sub End If + + + ' Desembarcar: bajamos del barco a los usuarios que llegan a Nix + + ' Para cada tile en el área del barco + For TileX = BarcoNavegandoForgatNix.startX To BarcoNavegandoForgatNix.EndX + For TileY = BarcoNavegandoForgatNix.startY To BarcoNavegandoForgatNix.EndY + + ' Si hay un usuario en el tile del barco + user = MapData(BarcoNavegandoForgatNix.Map, TileX, TileY).UserIndex + If user > 0 Then + + ' Enviar usuario a Nix + Call WarpToLegalPos(user, NixDock.Map, NixDock.DestX, NixDock.DestY, True) + Call WriteLocaleMsg(user, MsgThanksForTravelNix, e_FontTypeNames.FONTTYPE_GUILD) + + End If + Next TileY + Next TileX + + ' Embarcacar: subimos al barco a los usuarios que salen de Forgat - ' Marcar que el barco no está navegando más - BarcoNavegando.IsSailing = False - - ' Para cada azulejo en el área del barco - For TileX = BarcoNavegando.startX To BarcoNavegando.EndX - For TileY = BarcoNavegando.startY To BarcoNavegando.EndY - user = MapData(BarcoNavegando.map, TileX, TileY).UserIndex - ' Si hay un usuario en el azulejo + ' Para cada tile en el área del muelle de Forgat + For TileX = ForgatDock.startX To ForgatDock.EndX + For TileY = ForgatDock.startY To ForgatDock.EndY + + ' Si hay un usuario en el tile del muelle + user = MapData(ForgatDock.Map, TileX, TileY).UserIndex If user > 0 Then - ' Dependiendo del destino actual del barco - If BarcoNavegando.CurrenDest = e_TripState.eForgatToNix Then - ' Enviar al usuario a Nix - Call WarpToLegalPos(user, NixDock.map, NixDock.DestX, NixDock.DestY, True) - Call WriteLocaleMsg(user, MsgThanksForTravelNix, e_FontTypeNames.FONTTYPE_GUILD) - ElseIf BarcoNavegando.CurrenDest = e_TripState.eForgatToArghal Then - ' Enviar al usuario a Nix - Call WarpToLegalPos(user, ArghalDock.Map, ArghalDock.DestX, ArghalDock.DestY, True) - Call WriteLocaleMsg(user, MsgThanksForTravelArghal, e_FontTypeNames.FONTTYPE_GUILD) + + ' Sacarle el pasaje y moverlo al barco navegando + PassSlot = GetPassSlot(user) + If PassSlot > 0 Then + Call WriteLocaleMsg(user, MsgPassForgat, e_FontTypeNames.FONTTYPE_GUILD) + Call QuitarUserInvItem(user, PassSlot, 1) + Call UpdateUserInv(False, user, PassSlot) + Call WarpToLegalPos(user, BarcoNavegandoForgatNix.Map, BarcoNavegandoForgatNix.DestX, BarcoNavegandoForgatNix.DestY, True) Else - Call WarpToLegalPos(user, ForgatDock.map, ForgatDock.DestX, ForgatDock.DestY, True) - Call WriteLocaleMsg(user, MsgThanksForTravelForgat, e_FontTypeNames.FONTTYPE_GUILD) + Call WriteLocaleMsg(user, MsgInvalidPass, e_FontTypeNames.FONTTYPE_GUILD) End If End If Next TileY Next TileX + +End Sub + + +Private Sub UpdateBarcoNixArghal() + + Dim TileX, TileY As Integer + Dim user As Integer + Dim PassFound As Boolean + Dim PassSlot As Integer - ' Verificar el destino actual del barco y procesar el muelle correspondiente - If BarcoNavegando.CurrenDest = e_TripState.eForgatToNix Then - For TileX = NixDock.startX To NixDock.EndX - For TileY = NixDock.startY To NixDock.EndY - user = MapData(NixDock.map, TileX, TileY).UserIndex - If user > 0 Then - PassSlot = GetPassSlot(user) - If PassSlot > 0 Then - Call WriteLocaleMsg(user, MsgPassNix, e_FontTypeNames.FONTTYPE_GUILD) - Call QuitarUserInvItem(user, PassSlot, 1) - Call UpdateUserInv(False, user, PassSlot) - Call WarpToLegalPos(user, BarcoNavegando.map, BarcoNavegando.DestX, BarcoNavegando.DestY, True) - Else - Call WriteLocaleMsg(user, MsgInvalidPass, e_FontTypeNames.FONTTYPE_GUILD) - End If - End If - Next TileY - Next TileX - BarcoNavegando.CurrenDest = e_TripState.eNixToForgat + ' Modificado por Shugar 5/6/24 + ' Viaje de Nix a Arghal - For TileX = ArghalDock.startX To ArghalDock.EndX - For TileY = ArghalDock.startY To ArghalDock.EndY - user = MapData(ArghalDock.Map, TileX, TileY).UserIndex - If user > 0 Then - PassSlot = GetPassSlot(user) - If PassSlot > 0 Then - Call WriteLocaleMsg(user, MsgPassNix, e_FontTypeNames.FONTTYPE_GUILD) - Call QuitarUserInvItem(user, PassSlot, 1) - Call UpdateUserInv(False, user, PassSlot) - Call WarpToLegalPos(user, BarcoNavegando.Map, BarcoNavegando.DestX, BarcoNavegando.DestY, True) - Else - Call WriteLocaleMsg(user, MsgInvalidPass, e_FontTypeNames.FONTTYPE_GUILD) - End If - End If - Next TileY - Next TileX - BarcoNavegando.CurrenDest = e_TripState.eArghalToForgat + ' Verificar si el barco está en un muelle: + ' Para ver si está en el muelle o no, miramos hay un NpcIndex en Map DockX DockY del mapa BarcoNavegando. + ' Ese Npc solía ser un muelle, y se usa de referencia para saber si el barco partió o sigue quieto. + ' Si no hay NPC ahí es que el barco está navegando, por lo tanto no hay movimiento de pasajeros. + + If MapData(BarcoNavegandoNixArghal.Map, BarcoNavegandoNixArghal.DockX, BarcoNavegandoNixArghal.DockY).NpcIndex = 0 Then + Exit Sub + End If + + ' Desembarcar: bajamos del barco a los usuarios que llegan a Arghal + + ' Para cada tile en el área del barco + For TileX = BarcoNavegandoNixArghal.startX To BarcoNavegandoNixArghal.EndX + For TileY = BarcoNavegandoNixArghal.startY To BarcoNavegandoNixArghal.EndY - Else - For TileX = ForgatDock.startX To ForgatDock.EndX - For TileY = ForgatDock.startY To ForgatDock.EndY - user = MapData(ForgatDock.map, TileX, TileY).UserIndex - If user > 0 Then - PassSlot = GetPassSlot(user) - If PassSlot > 0 Then - Call WriteLocaleMsg(user, MsgPassForgat, e_FontTypeNames.FONTTYPE_GUILD) - Call QuitarUserInvItem(user, PassSlot, 1) - Call UpdateUserInv(False, user, PassSlot) - Call WarpToLegalPos(user, BarcoNavegando.map, BarcoNavegando.DestX, BarcoNavegando.DestY, True) - Else - Call WriteLocaleMsg(user, MsgInvalidPass, e_FontTypeNames.FONTTYPE_GUILD) - End If + ' Si hay un usuario en el tile del barco + user = MapData(BarcoNavegandoNixArghal.Map, TileX, TileY).UserIndex + If user > 0 Then + + ' Enviar al usuario a Arghal + Call WarpToLegalPos(user, ArghalDock.Map, ArghalDock.DestX, ArghalDock.DestY, True) + Call WriteLocaleMsg(user, MsgThanksForTravelArghal, e_FontTypeNames.FONTTYPE_GUILD) + + End If + Next TileY + Next TileX + + ' Embarcacar: subimos al barco a los usuarios que salen de Nix + + ' Para cada tile en el área del muelle de Nix + For TileX = NixDock.startX To NixDock.EndX + For TileY = NixDock.startY To NixDock.EndY + + ' Si hay un usuario en el tile del muelle + user = MapData(NixDock.Map, TileX, TileY).UserIndex + If user > 0 Then + + ' Sacarle el pasaje y moverlo al barco navegando + PassSlot = GetPassSlot(user) + If PassSlot > 0 Then + Call WriteLocaleMsg(user, MsgPassNix, e_FontTypeNames.FONTTYPE_GUILD) + Call QuitarUserInvItem(user, PassSlot, 1) + Call UpdateUserInv(False, user, PassSlot) + Call WarpToLegalPos(user, BarcoNavegandoNixArghal.Map, BarcoNavegandoNixArghal.DestX, BarcoNavegandoNixArghal.DestY, True) + Else + Call WriteLocaleMsg(user, MsgInvalidPass, e_FontTypeNames.FONTTYPE_GUILD) End If - Next TileY - Next TileX + End If + Next TileY + Next TileX - BarcoNavegando.CurrenDest = e_TripState.eForgatToNix +End Sub + +Private Sub UpdateBarcoArghalForgat() + Dim TileX, TileY As Integer + Dim user As Integer + Dim PassFound As Boolean + Dim PassSlot As Integer + + ' Modificado por Shugar 5/6/24 + ' Viaje de Arghal a Forgat + + ' Verificar si el barco está en un muelle: + ' Para ver si está en el muelle o no, miramos hay un NpcIndex en Map DockX DockY del mapa BarcoNavegando. + ' Ese Npc solía ser un muelle, y se usa de referencia para saber si el barco partió o sigue quieto. + ' Si no hay NPC ahí es que el barco está navegando, por lo tanto no hay movimiento de pasajeros. + If MapData(BarcoNavegandoArghalForgat.Map, BarcoNavegandoArghalForgat.DockX, BarcoNavegandoArghalForgat.DockY).NpcIndex = 0 Then + Exit Sub End If - + + ' Desembarcar: bajamos del barco a los usuarios que llegan a Forgat + + ' Para cada tile en el área del barco + For TileX = BarcoNavegandoArghalForgat.startX To BarcoNavegandoArghalForgat.EndX + For TileY = BarcoNavegandoArghalForgat.startY To BarcoNavegandoArghalForgat.EndY + + ' Si hay un usuario en el tile del barco + user = MapData(BarcoNavegandoArghalForgat.Map, TileX, TileY).UserIndex + If user > 0 Then + + ' Enviar al usuario a Forgat + Call WarpToLegalPos(user, ForgatDock.Map, ForgatDock.DestX, ForgatDock.DestY, True) + Call WriteLocaleMsg(user, MsgThanksForTravelForgat, e_FontTypeNames.FONTTYPE_GUILD) + + End If + Next TileY + Next TileX + + + ' Embarcacar: subimos al barco a los usuarios que salen de Arghal + + ' Para cada tile en el área del muelle de Arghal + For TileX = ArghalDock.startX To ArghalDock.EndX + For TileY = ArghalDock.startY To ArghalDock.EndY + + ' Si hay un usuario en el tile del muelle + user = MapData(ArghalDock.Map, TileX, TileY).UserIndex + If user > 0 Then + + ' Sacarle el pasaje y moverlo al barco navegando + PassSlot = GetPassSlot(user) + If PassSlot > 0 Then + Call WriteLocaleMsg(user, MsgPassArghal, e_FontTypeNames.FONTTYPE_GUILD) + Call QuitarUserInvItem(user, PassSlot, 1) + Call UpdateUserInv(False, user, PassSlot) + Call WarpToLegalPos(user, BarcoNavegandoArghalForgat.Map, BarcoNavegandoArghalForgat.DestX, BarcoNavegandoArghalForgat.DestY, True) + Else + Call WriteLocaleMsg(user, MsgInvalidPass, e_FontTypeNames.FONTTYPE_GUILD) + End If + End If + Next TileY + Next TileX End Sub