Advertisement
Guest User

Untitled

a guest
Aug 11th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Sub ObtenerExito(ByVal ExpGanada As Long, ByVal Mapa As Integer, X As Integer, Y As Integer)
  2. '***************************************************
  3. 'Author: Unknown
  4. 'Last Modification: 07/04/08
  5. 'Last Modification By: Marco Vanotti (MarKoxX)
  6. ' - 09/29/07 New formula for calculating the experience point of each user
  7. ' - 09/29/07 Experience is round to the biggest number less than that number
  8. ' - 09/29/07 Now experience is a real-number
  9. ' - 04/04/08 Ahora antes de calcular la experiencia a X usuario se fija si ese usuario existe (MarKoxX)
  10. ' - 07/04/08 New formula to calculate Experience for each user. (MarKoxX)
  11. '***************************************************
  12. 'Se produjo un evento que da experiencia en la wp referenciada
  13.  
  14.     Dim i As Integer
  15.     Dim UI As Integer
  16.     Dim expThisUser As Double
  17.  
  18. 1   On Error GoTo ObtenerExito_Error
  19.  
  20.     ' ++ Fix asqueroso feo pero bueno xd
  21. 2   If (p_expTotal >= Get_ExpLvl(46)) Then
  22. 3       UI = p_members(1).UserIndex
  23. 4       If UI > 0 Then
  24. 5           Call WriteConsoleMsg(UI, "Has exedido el limite de exp en party. La party se ha disuelto.", FontTypeNames.FONTTYPE_PARTY)
  25. 6           Call SaleMiembro(UI)
  26. 7           Exit Sub
  27. 8       End If
  28. 9   End If
  29.  
  30. 10  p_expTotal = p_expTotal + ExpGanada
  31.  
  32. 11  For i = 1 To PARTY_MAXMEMBERS
  33. 12      UI = p_members(i).UserIndex
  34. 13      If UI > 0 Then
  35.            
  36.             ' ++ Si estoy solo en la party.
  37. 14          If p_members(i).bPorcentaje = 100 Then
  38. 15              expThisUser = ExpGanada
  39. 16          Else
  40. 17              expThisUser = Porcentaje(ExpGanada, p_members(i).bPorcentaje)
  41. 18          End If
  42.  
  43. 19          If Mapa = UserList(UI).Pos.Map And UserList(UI).flags.Muerto = 0 Then
  44. 20              If Distance(UserList(UI).Pos.X, UserList(UI).Pos.Y, X, Y) <= PARTY_MAXDISTANCIA Then
  45. 21                  p_members(i).Experiencia = p_members(i).Experiencia + expThisUser
  46. 22                  If p_members(i).Experiencia < 0 Then
  47. 23                      p_members(i).Experiencia = 0
  48. 24                  End If
  49. 25                  If PARTY_EXPERIENCIAPORGOLPE Then
  50. 26                      UserList(UI).Stats.Exp = UserList(UI).Stats.Exp + Fix(expThisUser)
  51. 27                      If UserList(UI).Stats.Exp > MAXEXP Then _
  52.                            UserList(UI).Stats.Exp = MAXEXP
  53. 28                      Call CheckUserLevel(UI)
  54. 29                      Call WriteUpdateUserStats(UI)
  55. 30                  End If
  56. 31              End If
  57. 32          End If
  58. 33      End If
  59. 34  Next i
  60.  
  61. 35  Exit Sub
  62.  
  63. ObtenerExito_Error:
  64.  
  65. 36  Call LogError("Error " & Err.Number & " (" & Err.description & ") in procedure ObtenerExito of Módulo de clase clsParty" & Erl & ".")
  66.  
  67. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement