Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for black wolf in tailor #372

Merged
merged 2 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Codigo/CharacterPersistence.bas
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ Private Function db_load_house_key(ByRef user As t_User) As Boolean
End Function

Public Function GetCharacterName(ByVal UserId As Long) As String
Dim RS As ADODB.Recordset
Set RS = Query("select name from user where id=?", UserId)
If RS Is Nothing Then Exit Function
GetCharacterName = RS!name
On Error GoTo GetCharacterName_Err
Dim RS As ADODB.Recordset
100 Set RS = Query("select name from user where id=?", UserId)
morgolock marked this conversation as resolved.
Show resolved Hide resolved
102 If RS Is Nothing Then Exit Function
104 GetCharacterName = RS!name
Exit Function
GetCharacterName_Err:
Call LogDatabaseError("Error en GetCharacterName: " & UserId & ". " & Err.Number & " - " & Err.Description & ". Línea: " & Erl)
End Function

Public Function LoadCharacterBank(ByVal UserIndex As Integer) As Boolean
Expand Down
2 changes: 2 additions & 0 deletions Codigo/Declares.bas
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ Public Const Raices As Integer = 888 'OK
Public Const PieldeLobo As Integer = 414 'OK
Public Const PieldeOsoPardo As Integer = 415 'OK
Public Const PieldeOsoPolar As Integer = 416 'OK
Public Const PielLoboNegro As Integer = 1146
Public Const MaxNPCs As Integer = 10000
Public Const MAXCHARS As Integer = 10000
Public Const DAGA As Integer = 15 'OK
Expand Down Expand Up @@ -1631,6 +1632,7 @@ Public Type t_ObjData
PielLobo As Integer
PielOsoPardo As Integer
PielOsoPolaR As Integer
PielLoboNegro As Integer
SkMAGOria As Byte

Radio As Byte
Expand Down
1 change: 1 addition & 0 deletions Codigo/FileIO.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,7 @@ Sub LoadOBJData()
470 .PielLobo = val(Leer.GetValue(ObjKey, "PielLobo"))
472 .PielOsoPardo = val(Leer.GetValue(ObjKey, "PielOsoPardo"))
474 .PielOsoPolaR = val(Leer.GetValue(ObjKey, "PielOsoPolaR"))
475 .PielLoboNegro = val(Leer.GetValue(ObjKey, "PielLoboNegro"))
476 .SkMAGOria = val(Leer.GetValue(ObjKey, "SKSastreria"))

478 .LingH = val(Leer.GetValue(ObjKey, "LingH"))
Expand Down
13 changes: 5 additions & 8 deletions Codigo/InvUsuario.bas
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ Sub TirarOro(ByVal Cantidad As Long, ByVal UserIndex As Integer)
'23/01/2007 -> Pablo (ToxicWaste): Billetera invertida y explotar oro en el agua.
'***************************************************
On Error GoTo ErrHandler

Dim OriginalAmount As Long
OriginalAmount = Cantidad
100 With UserList(UserIndex)

' GM's (excepto Dioses y Admins) no pueden tirar oro
Expand Down Expand Up @@ -387,17 +388,13 @@ Sub TirarOro(ByVal Cantidad As Long, ByVal UserIndex As Integer)

Loop

' Si es GM, registramos lo q hizo incluso si es Horacio
' Si es GM, registramos lo q hizo
146 If EsGM(UserIndex) Then

148 If MiObj.ObjIndex = iORO Then
150 Call LogGM(.Name, "Tiro: " & PonerPuntos(Cantidad) & " monedas de oro.")

150 Call LogGM(.name, "Tiro: " & PonerPuntos(OriginalAmount) & " monedas de oro.")
Else
152 Call LogGM(.Name, "Tiro cantidad:" & PonerPuntos(Cantidad) & " Objeto:" & ObjData(MiObj.ObjIndex).Name)

152 Call LogGM(.name, "Tiro cantidad:" & PonerPuntos(OriginalAmount) & " Objeto:" & ObjData(MiObj.ObjIndex).name)
End If

End If

160 Call WriteUpdateGold(UserIndex)
Expand Down
27 changes: 15 additions & 12 deletions Codigo/Modulo_UsUaRiOs.bas
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,22 @@ Option Explicit
Private UserNameCache As New Dictionary

Public Function GetUserName(ByVal UserId As Long) As String
If UserId <= 0 Then
GetUserName = ""
Exit Function
End If
If UserNameCache.Exists(UserId) Then
GetUserName = UserNameCache.Item(UserId)
On Error GoTo GetUserName_Err
100 If UserId <= 0 Then
102 GetUserName = ""
Exit Function
End If
104 If UserNameCache.Exists(UserId) Then
106 GetUserName = UserNameCache.Item(UserId)
Exit Function
End If
Dim username As String
108 username = GetCharacterName(UserId)
110 Call RegisterUserName(UserId, username)
112 GetUserName = username
Exit Function
End If
Dim UserName As String
UserName = GetCharacterName(UserId)
Call RegisterUserName(UserId, UserName)
GetUserName = UserName
Exit Function
GetUserName_Err:
114 Call TraceError(Err.Number, Err.Description, "UserMod.GetUserName", Erl)
End Function

Public Sub RegisterUserName(ByVal UserId As Long, ByVal UserName As String)
Expand Down
64 changes: 32 additions & 32 deletions Codigo/Scenearios/NavalBoarding.cls
Original file line number Diff line number Diff line change
Expand Up @@ -109,39 +109,39 @@ Dim UserLoot As New Dictionary
Dim TeamCargo(1 To 2) As t_Cargo

Private Sub Class_Initialize()
On Error GoTo NavalBoarding_Initialize_Err:
Debug.Assert FileExist(DatPath & configPath)
Dim ScenarioIni As clsIniManager
Dim WpCount As Byte
Set ScenarioIni = New clsIniManager
Call ScenarioIni.Initialize(DatPath & configPath)
MapNumbers(0) = val(ScenarioIni.GetValue("INIT", "MapNumber1"))
MapNumbers(1) = val(ScenarioIni.GetValue("INIT", "MapNumber2"))
MaxTime = val(ScenarioIni.GetValue("INIT", "MaxTime"))
Team1SpawnX = val(ScenarioIni.GetValue("INIT", "Team1SpawnX"))
Team2SpawnX = val(ScenarioIni.GetValue("INIT", "Team2SpawnX"))
RespawnWp = val(ScenarioIni.GetValue("RESPAWN", "Waypoint"))
PlayerMinRespawnTime = val(ScenarioIni.GetValue("RESPAWN", "PlayerMinRespawnTime"))
RespawnInterval = val(ScenarioIni.GetValue("RESPAWN", "RespawnInterval"))
MaxTime = MaxTime * 1000
RespawnInterval = RespawnInterval * 1000
PlayerMinRespawnTime = PlayerMinRespawnTime * 1000
WpCount = val(ScenarioIni.GetValue("INIT", "WaypointCount"))
CaptianNpcId = val(ScenarioIni.GetValue("CaptainNpc", "NpcId"))
Call LoadTeamWeapoints(1, Team1Waypoints, WpCount, ScenarioIni)
Call LoadTeamWeapoints(2, Team2Waypoints, WpCount, ScenarioIni)
Call LoadForbidenItems(ScenarioIni)
Call LoadTileBlock(TileBlocks, ScenarioIni)
UpdateIndex = AddUpdateScenario(Me)
Call CustomScenarios.SetCustomScenario(MapNumbers(0), Me)
Call CustomScenarios.SetCustomScenario(MapNumbers(1), Me)
Call ConfigMapLobby
Call LoadNpcSpawnInfo(NpcSpawnList, ScenarioIni)
Call LoadTeamCargo(TeamCargo(1), 1, ScenarioIni)
Call LoadTeamCargo(TeamCargo(2), 2, ScenarioIni)
Exit Sub
On Error GoTo NavalBoarding_Initialize_Err:
100 Debug.Assert FileExist(DatPath & configPath)
Dim ScenarioIni As clsIniManager
Dim WpCount As Byte
102 Set ScenarioIni = New clsIniManager
104 Call ScenarioIni.Initialize(DatPath & configPath)
106 MapNumbers(0) = val(ScenarioIni.GetValue("INIT", "MapNumber1"))
108 MapNumbers(1) = val(ScenarioIni.GetValue("INIT", "MapNumber2"))
110 MaxTime = val(ScenarioIni.GetValue("INIT", "MaxTime"))
112 Team1SpawnX = val(ScenarioIni.GetValue("INIT", "Team1SpawnX"))
114 Team2SpawnX = val(ScenarioIni.GetValue("INIT", "Team2SpawnX"))
116 RespawnWp = val(ScenarioIni.GetValue("RESPAWN", "Waypoint"))
118 PlayerMinRespawnTime = val(ScenarioIni.GetValue("RESPAWN", "PlayerMinRespawnTime"))
120 RespawnInterval = val(ScenarioIni.GetValue("RESPAWN", "RespawnInterval"))
122 MaxTime = MaxTime * 1000
124 RespawnInterval = RespawnInterval * 1000
126 PlayerMinRespawnTime = PlayerMinRespawnTime * 1000
128 WpCount = val(ScenarioIni.GetValue("INIT", "WaypointCount"))
130 CaptianNpcId = val(ScenarioIni.GetValue("CaptainNpc", "NpcId"))
132 Call LoadTeamWeapoints(1, Team1Waypoints, WpCount, ScenarioIni)
134 Call LoadTeamWeapoints(2, Team2Waypoints, WpCount, ScenarioIni)
136 Call LoadForbidenItems(ScenarioIni)
138 Call LoadTileBlock(TileBlocks, ScenarioIni)
140 UpdateIndex = AddUpdateScenario(Me)
142 Call CustomScenarios.SetCustomScenario(MapNumbers(0), Me)
144 Call CustomScenarios.SetCustomScenario(MapNumbers(1), Me)
146 Call ConfigMapLobby
148 Call LoadNpcSpawnInfo(NpcSpawnList, ScenarioIni)
150 Call LoadTeamCargo(TeamCargo(1), 1, ScenarioIni)
152 Call LoadTeamCargo(TeamCargo(2), 2, ScenarioIni)
Exit Sub
NavalBoarding_Initialize_Err:
Call TraceError(Err.Number, Err.Description, "DeathMatch.Initialize ", Erl)
Call TraceError(Err.Number, Err.Description, "DeathMatch.Initialize ", Erl)
End Sub

Private Sub LoadTileBlock(ByRef Tiles() As t_TilePos, ScenearioIni As clsIniManager)
Expand Down
28 changes: 13 additions & 15 deletions Codigo/Trabajo.bas
Original file line number Diff line number Diff line change
Expand Up @@ -815,14 +815,13 @@ Sub SastreQuitarMateriales(ByVal UserIndex As Integer, ByVal ItemIndex As Intege
100 If ObjData(ItemIndex).PielLobo > 0 Then Call QuitarObjetos(PieldeLobo, ObjData(ItemIndex).PielLobo, UserIndex)
102 If ObjData(ItemIndex).PielOsoPardo > 0 Then Call QuitarObjetos(PieldeOsoPardo, ObjData(ItemIndex).PielOsoPardo, UserIndex)
104 If ObjData(ItemIndex).PielOsoPolaR > 0 Then Call QuitarObjetos(PieldeOsoPolar, ObjData(ItemIndex).PielOsoPolaR, UserIndex)
106 If ObjData(ItemIndex).PielLoboNegro > 0 Then Call QuitarObjetos(PielLoboNegro, ObjData(ItemIndex).PielLoboNegro, UserIndex)


Exit Sub

SastreQuitarMateriales_Err:
106 Call TraceError(Err.Number, Err.Description, "Trabajo.SastreQuitarMateriales", Erl)
108

Call TraceError(Err.Number, Err.Description, "Trabajo.SastreQuitarMateriales", Erl)
End Sub

Function CarpinteroTieneMateriales(ByVal UserIndex As Integer, ByVal ItemIndex As Integer, ByVal cantidad As Long) As Boolean
Expand Down Expand Up @@ -899,17 +898,14 @@ End Function
Function SastreTieneMateriales(ByVal UserIndex As Integer, ByVal ItemIndex As Integer) As Boolean

On Error GoTo SastreTieneMateriales_Err


100 If ObjData(ItemIndex).PielLobo > 0 Then
102 If Not TieneObjetos(PieldeLobo, ObjData(ItemIndex).PielLobo, UserIndex) Then
104 Call WriteConsoleMsg(UserIndex, "No tenes suficientes pieles de lobo.", e_FontTypeNames.FONTTYPE_INFO)
106 SastreTieneMateriales = False
108 Call WriteMacroTrabajoToggle(UserIndex, False)
Exit Function

End If

End If

110 If ObjData(ItemIndex).PielOsoPardo > 0 Then
Expand All @@ -918,9 +914,7 @@ Function SastreTieneMateriales(ByVal UserIndex As Integer, ByVal ItemIndex As In
116 SastreTieneMateriales = False
118 Call WriteMacroTrabajoToggle(UserIndex, False)
Exit Function

End If

End If

120 If ObjData(ItemIndex).PielOsoPolaR > 0 Then
Expand All @@ -929,20 +923,24 @@ Function SastreTieneMateriales(ByVal UserIndex As Integer, ByVal ItemIndex As In
126 SastreTieneMateriales = False
128 Call WriteMacroTrabajoToggle(UserIndex, False)
Exit Function

End If

End If

130 SastreTieneMateriales = True

130 If ObjData(ItemIndex).PielLoboNegro > 0 Then
132 If Not TieneObjetos(PielLoboNegro, ObjData(ItemIndex).PielLoboNegro, UserIndex) Then
134 Call WriteConsoleMsg(UserIndex, "No tenes suficientes pieles de lobo negro.", e_FontTypeNames.FONTTYPE_INFO)
136 SastreTieneMateriales = False
138 Call WriteMacroTrabajoToggle(UserIndex, False)
Exit Function
End If
End If
140 SastreTieneMateriales = True


Exit Function

SastreTieneMateriales_Err:
132 Call TraceError(Err.Number, Err.Description, "Trabajo.SastreTieneMateriales", Erl)
134

Call TraceError(Err.Number, Err.Description, "Trabajo.SastreTieneMateriales", Erl)
End Function

Function HerreroTieneMateriales(ByVal UserIndex As Integer, ByVal ItemIndex As Integer) As Boolean
Expand Down