Skip to content

Commit

Permalink
Merge pull request #366 from ao-org/add-sacred-cross-support
Browse files Browse the repository at this point in the history
add sacred cross support, fix transform heading direction bug
  • Loading branch information
RecoX authored Sep 4, 2023
2 parents 927da79 + 1e4fa97 commit 2a2f625
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 19 deletions.
2 changes: 2 additions & 0 deletions Codigo/Declares.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,9 @@ End Type

Public Enum e_ObjFlags
e_Bindable = 1
e_UseOnSafeAreaOnly = 2
End Enum

'Tipos de objetos
Public Type t_ObjData
Pino As Byte
Expand Down
1 change: 0 additions & 1 deletion Codigo/EffectOverTime/TransformEffect.cls
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ Private Sub TransformChacter()
NpcIndex = "NPC" & npcId
136 .Char.body = val(LeerNPCs.GetValue(NpcIndex, "Body"))
138 .Char.head = val(LeerNPCs.GetValue(NpcIndex, "Head"))
140 .Char.Heading = val(LeerNPCs.GetValue(NpcIndex, "Heading"))
142 .Char.BodyIdle = val(LeerNPCs.GetValue(NpcIndex, "BodyIdle"))
143 .Char.Ataque1 = val(LeerNPCs.GetValue(NpcIndex, "Ataque1"))
156 .Char.WeaponAnim = val(LeerNPCs.GetValue(NpcIndex, "Arma"))
Expand Down
10 changes: 5 additions & 5 deletions Codigo/FileIO.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,8 @@ Sub LoadOBJData()
.ImprovedMeleeHitChance = val(Leer.GetValue(ObjKey, "ImprovedMHit"))
.ApplyEffectId = val(Leer.GetValue(ObjKey, "ApplyEffectId"))
If val(Leer.GetValue(ObjKey, "Bindable")) > 0 Then Call SetMask(.ObjFlags, e_ObjFlags.e_Bindable)
If val(Leer.GetValue(ObjKey, "UseOnSafeAreaOnly")) > 0 Then Call SetMask(.ObjFlags, e_ObjFlags.e_UseOnSafeAreaOnly)

Dim i As Integer

162 Select Case .OBJType
Expand Down Expand Up @@ -1336,8 +1338,6 @@ Sub LoadOBJData()
216 .Proyectil = val(Leer.GetValue(ObjKey, "Proyectil"))
218 .Municion = val(Leer.GetValue(ObjKey, "Municiones"))
220 .Power = val(Leer.GetValue(ObjKey, "StaffPower"))
222 .MagicDamageBonus = val(Leer.GetValue(ObjKey, "MagicDamageBonus"))
224 .MagicAbsoluteBonus = val(Leer.GetValue(ObjKey, "MagicAbsoluteBonus"))
226 .Real = val(Leer.GetValue(ObjKey, "Real"))
228 .Caos = val(Leer.GetValue(ObjKey, "Caos"))
230 .EfectoMagico = val(Leer.GetValue(ObjKey, "efectomagico"))
Expand Down Expand Up @@ -1482,19 +1482,19 @@ Sub LoadOBJData()
.Proyectil = val(Leer.GetValue(ObjKey, "Proyectil"))

422 Case e_OBJType.otDañoMagico
424 .MagicDamageBonus = val(Leer.GetValue(ObjKey, "MagicDamageBonus"))
425 .MagicAbsoluteBonus = val(Leer.GetValue(ObjKey, "MagicAbsoluteBonus"))

426 .Revive = val(Leer.GetValue(ObjKey, "Revive")) <> 0

428 Case e_OBJType.otResistencia
430 .ResistenciaMagica = val(Leer.GetValue(ObjKey, "ResistenciaMagica"))


432 Case e_OBJType.otMinerales
434 .LingoteIndex = val(Leer.GetValue(ObjKey, "LingoteIndex"))
Case e_OBJType.otUsableOntarget
.EfectoMagico = val(Leer.GetValue(ObjKey, "efectomagico"))
End Select
424 .MagicDamageBonus = val(Leer.GetValue(ObjKey, "MagicDamageBonus"))
425 .MagicAbsoluteBonus = val(Leer.GetValue(ObjKey, "MagicAbsoluteBonus"))
235 .MagicPenetration = val(Leer.GetValue(ObjKey, "MagicPenetration"))
.EfectoMagico = val(Leer.GetValue(ObjKey, "EfectoMagico"))
.ProjectileType = val(Leer.GetValue(ObjKey, "ProjectileType"))
Expand Down
7 changes: 7 additions & 0 deletions Codigo/InvUsuario.bas
Original file line number Diff line number Diff line change
Expand Up @@ -1764,6 +1764,13 @@ Sub UseInvItem(ByVal UserIndex As Integer, ByVal Slot As Byte, ByVal ByClick As
104 obj = ObjData(.Invent.Object(Slot).ObjIndex)
Dim TimeSinceLastUse As Long: TimeSinceLastUse = GetTickCount() - .CdTimes(obj.cdType)
If TimeSinceLastUse < obj.Cooldown Then Exit Sub

If IsSet(obj.ObjFlags, e_ObjFlags.e_UseOnSafeAreaOnly) Then
If MapInfo(.pos.Map).Seguro = 0 Then
Call WriteConsoleMsg(UserIndex, "Solo podes usar este objeto en mapas seguros.", e_FontTypeNames.FONTTYPE_INFO)
Exit Sub
End If
End If

106 If obj.OBJType = e_OBJType.otWeapon Then
108 If obj.Proyectil = 1 Then
Expand Down
3 changes: 0 additions & 3 deletions Codigo/frmAdmin.frm
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,3 @@ Command3_Click_Err:

End Sub

Private Sub Form_Load()

End Sub
3 changes: 0 additions & 3 deletions Codigo/frmDbControl.frm
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,3 @@ Private Sub Command2_Click()
Call getData("select * from user")
End Sub

Private Sub DataGrid1_Click()

End Sub
22 changes: 15 additions & 7 deletions Codigo/modHechizos.bas
Original file line number Diff line number Diff line change
Expand Up @@ -2773,6 +2773,11 @@ Sub HechizoPropNPC(ByVal hIndex As Integer, ByVal npcIndex As Integer, ByVal Use
MagicPenetration = ObjData(UserList(UserIndex).invent.WeaponEqpObjIndex).MagicPenetration
Damage = Damage + ObjData(UserList(UserIndex).invent.WeaponEqpObjIndex).MagicAbsoluteBonus
End If
151 If UserList(UserIndex).invent.MagicoObjIndex > 0 Then
Damage = Damage + Porcentaje(Damage, ObjData(UserList(UserIndex).invent.MagicoObjIndex).MagicDamageBonus)
Damage = Damage + ObjData(UserList(UserIndex).invent.MagicoObjIndex).MagicAbsoluteBonus
MagicPenetration = MagicPenetration + ObjData(UserList(UserIndex).invent.MagicoObjIndex).MagicPenetration
End If
' Magic Damage ring
152 If UserList(UserIndex).invent.DañoMagicoEqpObjIndex > 0 Then
154 Damage = Damage + Porcentaje(Damage, ObjData(UserList(UserIndex).invent.DañoMagicoEqpObjIndex).MagicDamageBonus)
Expand Down Expand Up @@ -3337,6 +3342,11 @@ Sub HechizoPropUsuario(ByVal UserIndex As Integer, ByRef b As Boolean, ByRef IsA
PorcentajeRM = PorcentajeRM - ObjData(UserList(UserIndex).invent.WeaponEqpObjIndex).MagicPenetration
Damage = Damage + ObjData(UserList(UserIndex).invent.WeaponEqpObjIndex).MagicAbsoluteBonus
End If
410 If UserList(UserIndex).invent.MagicoObjIndex > 0 Then
412 Damage = Damage + Porcentaje(Damage, ObjData(UserList(UserIndex).invent.MagicoObjIndex).MagicDamageBonus)
Damage = Damage + ObjData(UserList(UserIndex).invent.MagicoObjIndex).MagicAbsoluteBonus
PorcentajeRM = PorcentajeRM - ObjData(UserList(UserIndex).invent.MagicoObjIndex).MagicPenetration
End If
418 If UserList(UserIndex).invent.DañoMagicoEqpObjIndex > 0 Then
420 Damage = Damage + Porcentaje(Damage, ObjData(UserList(UserIndex).invent.DañoMagicoEqpObjIndex).MagicDamageBonus)
Damage = Damage + ObjData(UserList(UserIndex).invent.DañoMagicoEqpObjIndex).MagicAbsoluteBonus
Expand Down Expand Up @@ -3491,21 +3501,17 @@ Sub HechizoCombinados(ByVal UserIndex As Integer, ByRef b As Boolean, ByRef IsAl
108 If Not PeleaSegura(UserIndex, tempChr) Then
110 If Status(tempChr) = 0 And Status(UserIndex) = 1 Or Status(tempChr) = 2 And Status(UserIndex) = 1 Then
112 If esArmada(UserIndex) Then
'Call WriteConsoleMsg(UserIndex, "Los Armadas no pueden ayudar a los Criminales", e_FontTypeNames.FONTTYPE_INFO)
114 Call WriteLocaleMsg(UserIndex, "379", e_FontTypeNames.FONTTYPE_INFO)
116 b = False
Exit Sub

End If

118 If UserList(UserIndex).flags.Seguro Then
'Call WriteConsoleMsg(UserIndex, "Para ayudar criminales debes sacarte el seguro ya que te volverás criminal como ellos", e_FontTypeNames.FONTTYPE_INFO)
120 Call WriteLocaleMsg(UserIndex, "378", e_FontTypeNames.FONTTYPE_INFO)
122 b = False
Exit Sub
Else

' Call DisNobAuBan(UserIndex, UserList(UserIndex).Reputacion.NobleRep * 0.5, 10000)
End If

End If
Expand All @@ -3516,9 +3522,6 @@ Sub HechizoCombinados(ByVal UserIndex As Integer, ByRef b As Boolean, ByRef IsAl
126 Damage = RandomNumber(Hechizos(h).MinAgilidad, Hechizos(h).MaxAgilidad)

128 UserList(tempChr).flags.DuracionEfecto = Hechizos(h).Duration
'UserList(tempChr).Stats.UserAtributos(e_Atributos.Agilidad) = UserList(tempChr).Stats.UserAtributos(e_Atributos.Agilidad) + daño
'If UserList(tempChr).Stats.UserAtributos(e_Atributos.Agilidad) > MinimoInt(MAXATRIBUTOS, UserList(tempChr).Stats.UserAtributosBackUP(Agilidad) * 2) Then _
UserList(tempChr).Stats.UserAtributos(e_Atributos.Agilidad) = MinimoInt(MAXATRIBUTOS, UserList(tempChr).Stats.UserAtributosBackUP(Agilidad) * 2)

130 UserList(tempChr).Stats.UserAtributos(e_Atributos.Agilidad) = MinimoInt(UserList(tempChr).Stats.UserAtributos(e_Atributos.Agilidad) + Damage, UserList(tempChr).Stats.UserAtributosBackUP(e_Atributos.Agilidad) * 2)

Expand Down Expand Up @@ -3655,6 +3658,11 @@ Sub HechizoCombinados(ByVal UserIndex As Integer, ByRef b As Boolean, ByRef IsAl
End If

' Magic ring bonus
283 If UserList(UserIndex).invent.MagicoObjIndex > 0 Then
Damage = Damage + Porcentaje(Damage, ObjData(UserList(UserIndex).invent.MagicoObjIndex).MagicDamageBonus)
Damage = Damage + ObjData(UserList(UserIndex).invent.MagicoObjIndex).MagicAbsoluteBonus
MR = MR - ObjData(UserList(UserIndex).invent.MagicoObjIndex).MagicPenetration
End If
284 If UserList(UserIndex).invent.DañoMagicoEqpObjIndex > 0 Then
286 Damage = Damage + Porcentaje(Damage, ObjData(UserList(UserIndex).invent.DañoMagicoEqpObjIndex).MagicDamageBonus)
Damage = Damage + ObjData(UserList(UserIndex).invent.DañoMagicoEqpObjIndex).MagicAbsoluteBonus
Expand Down

0 comments on commit 2a2f625

Please sign in to comment.