Skip to content

Commit

Permalink
Merge pull request #524 from Wyr0X/fix-invi-2
Browse files Browse the repository at this point in the history
Fix invi 2
  • Loading branch information
RecoX authored Mar 6, 2024
2 parents 0656d3e + 7f9fc79 commit e586f75
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 63 deletions.
1 change: 1 addition & 0 deletions Codigo/Declares.bas
Original file line number Diff line number Diff line change
Expand Up @@ -2135,6 +2135,7 @@ Public Type t_UserCounters

timeChat As Integer
timeFx As Integer
timeGuildChat As Integer

IdleCount As Integer
AttackCounter As Integer
Expand Down
4 changes: 2 additions & 2 deletions Codigo/GameLogic.bas
Original file line number Diff line number Diff line change
Expand Up @@ -2061,7 +2061,7 @@ Public Sub ResucitarOCurar(ByVal UserIndex As Integer)

Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessagePlayWave(20, UserList(UserIndex).Pos.X, UserList(UserIndex).Pos.Y))

UserList(UserIndex).Counters.timeFx = 2
UserList(UserIndex).Counters.timeFx = 3
Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageCreateFX(UserList(UserIndex).Char.charindex, 35, 1, UserList(UserIndex).Pos.X, UserList(UserIndex).Pos.Y))


Expand All @@ -2072,7 +2072,7 @@ Public Sub ResucitarOCurar(ByVal UserIndex As Integer)

Call WriteUpdateHP(UserIndex)

UserList(UserIndex).Counters.timeFx = 2
UserList(UserIndex).Counters.timeFx = 3
Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessageCreateFX(UserList(UserIndex).Char.charindex, 9, 1, UserList(UserIndex).Pos.X, UserList(UserIndex).Pos.Y))
Call SendData(SendTarget.ToPCArea, UserIndex, PrepareMessagePlayWave(18, UserList(UserIndex).Pos.X, UserList(UserIndex).Pos.Y))

Expand Down
7 changes: 5 additions & 2 deletions Codigo/General.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1511,7 +1511,7 @@ Public Sub EfectoVeneno(ByVal UserIndex As Integer)
106 With UserList(UserIndex)
'Call WriteConsoleMsg(UserIndex, "Estás envenenado, si no te curas morirás.", e_FontTypeNames.FONTTYPE_VENENO)
108 Call WriteLocaleMsg(UserIndex, "47", e_FontTypeNames.FONTTYPE_VENENO)
UserList(userindex).Counters.timeFx = 2
UserList(userindex).Counters.timeFx = 3
110 Call SendData(SendTarget.ToPCAliveArea, userindex, PrepareMessageParticleFX(.Char.charindex, e_ParticulasIndex.Envenena, 30, False, , UserList(userindex).Pos.X, UserList(userindex).Pos.y))
112 .Counters.Veneno = 0
' El veneno saca un porcentaje de vida random.
Expand Down Expand Up @@ -1542,7 +1542,7 @@ Public Sub EfectoIncineramiento(ByVal UserIndex As Integer)
102 If .Counters.Incineracion Mod (IntervaloIncineracion \ 5) = 0 Then
' "Te estás incinerando, si no te curas morirás.
104 Call WriteLocaleMsg(UserIndex, "392", e_FontTypeNames.FONTTYPE_FIGHT)
UserList(userindex).Counters.timeFx = 2
UserList(userindex).Counters.timeFx = 3
106 Damage = RandomNumber(35, 45)
108 Call SendData(SendTarget.ToPCAliveArea, UserIndex, PrepareMessageCreateFX(.Char.charindex, 73, 0, .pos.x, .pos.y))
112 If .ChatCombate = 1 Then
Expand Down Expand Up @@ -1775,6 +1775,9 @@ Sub PasarSegundo()
.Counters.timeFx = .Counters.timeFx - 1
End If

If .Counters.timeGuildChat > 0 Then
.Counters.timeGuildChat = .Counters.timeGuildChat - 1
End If

116 If .flags.Silenciado = 1 Then
118 .flags.SegundosPasados = .flags.SegundosPasados + 1
Expand Down
14 changes: 7 additions & 7 deletions Codigo/InvUsuario.bas
Original file line number Diff line number Diff line change
Expand Up @@ -2195,7 +2195,7 @@ Sub UseInvItem(ByVal UserIndex As Integer, ByVal Slot As Byte, ByVal ByClick As
444 Call ChangeUserChar(UserIndex, .Char.body, CabezaFinal, .Char.Heading, .Char.WeaponAnim, .Char.ShieldAnim, .Char.CascoAnim, .Char.CartAnim)
'Quitamos del inv el item

UserList(UserIndex).Counters.timeFx = 2
UserList(UserIndex).Counters.timeFx = 3
446 Call SendData(SendTarget.ToPCAliveArea, UserIndex, PrepareMessageCreateFX(.Char.charindex, 102, 0, UserList(UserIndex).Pos.X, UserList(UserIndex).Pos.Y))

448 If CabezaActual <> CabezaFinal Then
Expand Down Expand Up @@ -2275,7 +2275,7 @@ Sub UseInvItem(ByVal UserIndex As Integer, ByVal Slot As Byte, ByVal ByClick As
520 .OrigChar.Head = CabezaFinal
522 Call ChangeUserChar(UserIndex, .Char.body, CabezaFinal, .Char.Heading, .Char.WeaponAnim, .Char.ShieldAnim, .Char.CascoAnim, .Char.CartAnim)
'Quitamos del inv el item
UserList(UserIndex).Counters.timeFx = 2
UserList(UserIndex).Counters.timeFx = 3
524 Call SendData(SendTarget.ToPCAliveArea, UserIndex, PrepareMessageCreateFX(.Char.charindex, 102, 0, UserList(UserIndex).Pos.X, UserList(UserIndex).Pos.Y))
526 Call QuitarUserInvItem(UserIndex, Slot, 1)

Expand Down Expand Up @@ -2525,7 +2525,7 @@ Sub UseInvItem(ByVal UserIndex As Integer, ByVal Slot As Byte, ByVal ByClick As

'Quitamos del inv el item
876 If CabezaActual <> CabezaFinal Then
UserList(UserIndex).Counters.timeFx = 2
UserList(UserIndex).Counters.timeFx = 3
878 Call SendData(SendTarget.ToPCAliveArea, UserIndex, PrepareMessageCreateFX(.Char.charindex, 102, 0, UserList(UserIndex).Pos.X, UserList(UserIndex).Pos.Y))
880 Call SendData(SendTarget.toPCAliveArea, UserIndex, PrepareMessagePlayWave(obj.Snd1, .Pos.X, .Pos.y))
882 Call QuitarUserInvItem(UserIndex, Slot, 1)
Expand Down Expand Up @@ -2559,7 +2559,7 @@ Sub UseInvItem(ByVal UserIndex As Integer, ByVal Slot As Byte, ByVal ByClick As
904 If sobrechar = 1 Then
906 Call SendData(SendTarget.toPCAliveArea, UserIndex, PrepareMessageParticleFXToFloor(.Pos.X, .Pos.y, Particula, Tiempo))
Else
UserList(UserIndex).Counters.timeFx = 2
UserList(UserIndex).Counters.timeFx = 3
908 Call SendData(SendTarget.ToPCAliveArea, UserIndex, PrepareMessageParticleFX(.Char.charindex, Particula, Tiempo, False, , UserList(UserIndex).Pos.X, UserList(UserIndex).Pos.Y))
End If

Expand Down Expand Up @@ -2703,7 +2703,7 @@ Sub UseInvItem(ByVal UserIndex As Integer, ByVal Slot As Byte, ByVal ByClick As
End If

1018 If obj.CreaFX <> 0 Then
UserList(UserIndex).Counters.timeFx = 2
UserList(UserIndex).Counters.timeFx = 3
1020 Call SendData(SendTarget.ToPCAliveArea, UserIndex, PrepareMessageCreateFX(.Char.charindex, obj.CreaFX, 0, UserList(UserIndex).Pos.X, UserList(UserIndex).Pos.Y))
End If

Expand Down Expand Up @@ -3580,7 +3580,7 @@ Public Sub UseArpon(ByVal UserIndex As Integer)
Dim Damage As Integer
Damage = GetUserDamageWithItem(UserIndex, ObjIndex, 0)
If TargetRef.RefType = eUser Then
UserList(TargetRef.ArrayIndex).Counters.timeFx = 2
UserList(TargetRef.ArrayIndex).Counters.timeFx = 3
Call RemoveUserInvisibility(UserIndex)
Call SendData(SendTarget.ToPCAliveArea, TargetRef.ArrayIndex, PrepareMessageCreateFX(UserList(TargetRef.ArrayIndex).Char.charindex, FXSANGRE, 0, UserList(TargetRef.ArrayIndex).pos.x, UserList(TargetRef.ArrayIndex).pos.y))
Call SendData(SendTarget.ToPCAliveArea, TargetRef.ArrayIndex, PrepareMessagePlayWave(SND_IMPACTO, UserList(TargetRef.ArrayIndex).pos.x, UserList(TargetRef.ArrayIndex).pos.y))
Expand Down Expand Up @@ -3620,7 +3620,7 @@ Public Sub UseHandCannon(ByVal UserIndex As Integer, ByVal TileX As Integer, ByV
Dim Tiempo As Long
Particula = val(ReadField(1, ObjData(ObjIndex).CreaParticula, Asc(":")))
Tiempo = val(ReadField(2, ObjData(ObjIndex).CreaParticula, Asc(":")))
UserList(UserIndex).Counters.timeFx = 2
UserList(UserIndex).Counters.timeFx = 3
Call SendData(SendTarget.ToPCAliveArea, UserIndex, PrepareMessageParticleFX(UserList(UserIndex).Char.charindex, Particula, Tiempo, False, , UserList(UserIndex).pos.x, UserList(UserIndex).pos.y))
Call SendData(SendTarget.ToPCAliveArea, UserIndex, PrepareCreateProjectile(.pos.x, .pos.y, TileX, TileY, ObjData(ObjIndex).ProjectileType))
Call CreateDelayedBlast(UserIndex, eUser, .pos.Map, TileX, TileY, ObjData(ObjIndex).ApplyEffectId, ObjIndex)
Expand Down
38 changes: 18 additions & 20 deletions Codigo/Modulo_UsUaRiOs.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1278,7 +1278,7 @@ Sub CheckUserLevel(ByVal UserIndex As Integer)

'Store it!
'Call Statistics.UserLevelUp(UserIndex)
UserList(userindex).Counters.timeFx = 2
UserList(userindex).Counters.timeFx = 3
110 Call SendData(SendTarget.ToPCAliveArea, userindex, PrepareMessageCreateFX(.Char.charindex, 106, 0, .Pos.X, .Pos.y))
112 Call SendData(SendTarget.ToPCAliveArea, UserIndex, PrepareMessagePlayWave(SND_NIVEL, .Pos.X, .Pos.y))
114 Call WriteLocaleMsg(UserIndex, "186", e_FontTypeNames.FONTTYPE_INFO)
Expand Down Expand Up @@ -1547,23 +1547,21 @@ Function MoveUserChar(ByVal UserIndex As Integer, ByVal nHeading As e_Heading) A
If .flags.invisible + .flags.Oculto > 0 And .flags.Navegando = 0 Then
For LoopC = 1 To ConnGroups(UserList(UserIndex).pos.Map).CountEntrys
tempIndex = ConnGroups(UserList(UserIndex).pos.Map).UserEntrys(LoopC)
If tempIndex <> UserIndex Then
If UserList(tempIndex).AreasInfo.AreaReciveX And UserList(UserIndex).AreasInfo.AreaPerteneceX Then 'Esta en el area?
If UserList(tempIndex).AreasInfo.AreaReciveY And UserList(UserIndex).AreasInfo.AreaPerteneceY Then
If UserList(tempIndex).ConnectionDetails.ConnIDValida Then
If UserList(tempIndex).flags.Muerto = 0 Or MapInfo(UserList(tempIndex).pos.Map).Seguro = 1 Then
If .GuildIndex = 0 Or .GuildIndex <> UserList(tempIndex).GuildIndex Or modGuilds.NivelDeClan(.GuildIndex) < 6 Then
If .Counters.timeFx + .Counters.timeChat = 0 Then
If Distancia(nPos, UserList(tempIndex).Pos) > DISTANCIA_ENVIO_DATOS Then
'Mandamos los pasos para los pjs q estan lejos para que simule que caminen.
'Mando tambien el char para q lo borre
Call WritePlayWaveStep(tempIndex, .Char.CharIndex, _
MapData(nPos.map, nPos.X, nPos.Y).Graphic(1), MapData(nPos.map, nPos.X, nPos.Y).Graphic(2), _
Distance(nPos.X, nPos.Y, UserList(tempIndex).Pos.X, UserList(tempIndex).Pos.Y), _
Sgn(nPos.X - UserList(tempIndex).Pos.X), .flags.stepToggle)
Else
Call WritePosUpdateChar(tempIndex, nPos.X, nPos.Y, .Char.CharIndex)
End If
If tempIndex <> UserIndex And Not EsGM(tempIndex) Then
If Abs(nPos.X - UserList(tempIndex).pos.X) <= RANGO_VISION_X And Abs(nPos.Y - UserList(tempIndex).pos.Y) <= RANGO_VISION_Y Then
If UserList(tempIndex).ConnectionDetails.ConnIDValida Then
If UserList(tempIndex).flags.Muerto = 0 Or MapInfo(UserList(tempIndex).pos.map).Seguro = 1 Then
If Not CheckGuildSend(UserList(UserIndex), UserList(tempIndex)) Then
If .Counters.timeFx + .Counters.timeChat = 0 Then
If Distancia(nPos, UserList(tempIndex).pos) > DISTANCIA_ENVIO_DATOS Then
'Mandamos los pasos para los pjs q estan lejos para que simule que caminen.
'Mando tambien el char para q lo borre
Call WritePlayWaveStep(tempIndex, .Char.charindex, _
MapData(nPos.map, nPos.X, nPos.Y).Graphic(1), MapData(nPos.map, nPos.X, nPos.Y).Graphic(2), _
Distance(nPos.X, nPos.Y, UserList(tempIndex).pos.X, UserList(tempIndex).pos.Y), _
Sgn(nPos.X - UserList(tempIndex).pos.X), .flags.stepToggle)
Else
Call WritePosUpdateChar(tempIndex, nPos.X, nPos.Y, .Char.charindex)
End If
End If
End If
Expand All @@ -1579,7 +1577,7 @@ Function MoveUserChar(ByVal UserIndex As Integer, ByVal nHeading As e_Heading) A
For X = nPos.X - DISTANCIA_ENVIO_DATOS To nPos.X + DISTANCIA_ENVIO_DATOS
For y = nPos.y - DISTANCIA_ENVIO_DATOS To nPos.y + DISTANCIA_ENVIO_DATOS
tempIndex = MapData(.Pos.map, X, y).UserIndex
If tempIndex > 0 And tempIndex <> UserIndex Then
If tempIndex > 0 And tempIndex <> UserIndex And Not EsGM(tempIndex) Then
If UserList(tempIndex).flags.invisible + UserList(tempIndex).flags.Oculto > 0 And UserList(tempIndex).flags.Navegando = 0 And (.GuildIndex = 0 Or .GuildIndex <> UserList(tempIndex).GuildIndex Or modGuilds.NivelDeClan(.GuildIndex) < 6) Then
Call WritePosUpdateChar(UserIndex, X, y, UserList(tempIndex).Char.charindex)
End If
Expand Down Expand Up @@ -2603,7 +2601,7 @@ Sub WarpUserChar(ByVal UserIndex As Integer, _

206 If FX Then 'FX
208 Call SendData(SendTarget.ToPCAliveArea, UserIndex, PrepareMessagePlayWave(SND_WARP, X, y))
UserList(userindex).Counters.timeFx = 2
UserList(userindex).Counters.timeFx = 3
210 Call SendData(SendTarget.ToPCAliveArea, userindex, PrepareMessageCreateFX(.Char.charindex, e_FXIDs.FXWARP, 0, .Pos.X, .Pos.y))
End If

Expand Down
Loading

0 comments on commit e586f75

Please sign in to comment.