Advertisement
PabloEduardo

Party

Jul 3rd, 2022 (edited)
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.97 KB | None | 0 0
  1. import:
  2. com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent
  3. com.alessiodp.parties.api.events.bukkit.player.BukkitPartiesPlayerPostJoinEvent
  4. com.alessiodp.parties.api.events.bukkit.party.BukkitPartiesPartyPreCreateEvent
  5. com.alessiodp.parties.api.events.bukkit.party.BukkitPartiesPartyPostCreateEvent
  6. com.alessiodp.parties.api.events.bukkit.party.BukkitPartiesPartyPostDeleteEvent
  7. com.alessiodp.parties.api.events.bukkit.player.BukkitPartiesPlayerPostLeaveEvent
  8. on post create party:
  9. crear(event-commandsender, "%event-party%")
  10. on player pre join party:
  11. entrar(event-commandsender, "%event-party%")
  12. on player pre leave party:
  13. salir(event-commandsender, "%event-party%")
  14. function salir(p: player, par: text):
  15. remove {_p} from {Partys.Party2.%{_par}%.list::*}
  16. function crear(p: player, par: text):
  17. set {Partys.Party2.%{_par}%.list::1} to {_p}
  18. add 1 to {Array.%{_par}%}
  19. function entrar(p: player, par: text):
  20. add 1 to {Array.%{_par}%}
  21. set {Partys.Party2.%{_par}%.list::%{Array.%{_par}%}%} to {_p}
  22. on quit:
  23. if player is in party:
  24. salir(player, "%party of player%")
  25. on death:
  26. if victim is in world "kamuidefi":
  27. if victim is in party:
  28. wait 1 second
  29. make victim run command "/party leave" as op
  30. salir(victim, "%party of victim%")
  31.  
  32. #command /vert:
  33. # trigger:
  34. # send "&bMiembros: &f%{Partys.Party2.%party of player%.list::*}%"
  35. #command /verM:
  36. # trigger:
  37. # send "%{Partys.Party2.%player%.list::*}%"
  38. # delete {Partys.Party2.%player%.list::*}
  39. # delete {Array.%player%}
  40.  
  41. command /expmob [<number>] [<player>] [<text>]:
  42. executable by: console
  43. trigger:
  44. if arg-2 is in party:
  45. send "&aExp ganada de la Party:" to arg-2
  46. loop {Partys.Party2.%party of arg-2%.list::*}:
  47. if loop-variable is online:
  48. add loop-variable to {_Conectado::*}
  49. else:
  50. add loop-variable to {_desconectado::*}
  51. loop {_Conectado::*}:
  52. if distance between arg-2 and loop-variable is smaller than 60:
  53. add loop-variable to {_Distancia::*}
  54. loop {_Distancia::*}:
  55. if arg 3 is "M":
  56. add arg-1 to {xp::%loop-variable%}
  57. set {_c.%loop-variable%} to arg-1
  58. send "&a+ %{_c.%loop-variable%}% &7- &6%loop-variable%" to loop-variable
  59. else:
  60. add arg-1 * {lvlmultipler::%loop-variable%} to {xp::%loop-variable%}
  61. set {_c.%loop-variable%} to arg-1 * {lvlmultipler::%loop-variable%}
  62. send "&a+ %{_c.%loop-variable%}% &7- &6%loop-variable%" to loop-variable
  63. if {nivel::%loop-variable%} is 100:
  64. continue
  65. else:
  66. if {xp::%loop-variable%} is greater than {xpnext::%loop-variable%}:
  67. set {xp::%loop-variable%} to {xp::%loop-variable%} - {xpnext::%loop-variable%}
  68. add 1 to {nivel::%loop-variable%}
  69. add 1 to {Puntosm::%loop-variable%} #Editar
  70. send title "" with subtitle "&9&lSUBISTE AL NIVEL &a%{nivel::%loop-variable%}%" to loop-variable for 3 seconds
  71. if {nivel::%loop-variable%} is between 1 and 10:
  72. add 100 to {xpnext::%loop-variable%}
  73. if {nivel::%loop-variable%} is between 11 and 20:
  74. add 200 to {xpnext::%loop-variable%}
  75. if {nivel::%loop-variable%} is between 21 and 30:
  76. add 500 to {xpnext::%loop-variable%}
  77. if {nivel::%loop-variable%} is between 31 and 40:
  78. add 750 to {xpnext::%loop-variable%}
  79. if {nivel::%loop-variable%} is between 41 and 50:
  80. add 1000 to {xpnext::%loop-variable%}
  81. if {nivel::%loop-variable%} is between 51 and 60:
  82. add 1500 to {xpnext::%loop-variable%}
  83. if {nivel::%loop-variable%} is between 61 and 70:
  84. add 2000 to {xpnext::%loop-variable%}
  85. if {nivel::%loop-variable%} is between 71 and 80:
  86. add 2500 to {xpnext::%loop-variable%}
  87. if {nivel::%loop-variable%} is between 81 and 90:
  88. add 4000 to {xpnext::%loop-variable%}
  89. if {nivel::%loop-variable%} is between 91 and 100:
  90. add 6000 to {xpnext::%loop-variable%}
  91. set {_query} to "UPDATE usuarios SET puntosm = ""%{puntosm::%loop-variable%}%"", nivel = ""%{nivel::%loop-variable%}%"", xp = ""%{xp::%loop-variable%}%"", xpnext = ""%{xpnext::%loop-variable%}%"", niveltimer = ""%{lvltimer::%loop-variable%}%"", nivelmultipler = ""%{lvlmultipler::%loop-variable%}%"" WHERE NOMBRE = ""%loop-variable%"""
  92. execute unsafe {_query} in {-sql}
  93. else:
  94. if {nivel::%arg-2%} is 100:
  95. stop
  96. else:
  97. if arg 3 is "M":
  98. add arg-1 to {xp::%arg-2%}
  99. set {_Exp} to arg-1
  100. send "&a+ %{_Exp}%" to arg-2
  101. else:
  102. add arg-1 * {lvlmultipler::%arg-2%} to {xp::%arg-2%}
  103. set {_Exp} to arg-1 * {lvlmultipler::%arg-2%}
  104. send "&a+ %{_Exp}%" to arg-2
  105. if {xp::%arg-2%} is greater than {xpnext::%arg-2%}:
  106. set {xp::%arg-2%} to {xp::%arg-2%} - {xpnext::%arg-2%}
  107. add 1 to {nivel::%arg-2%}
  108. add 1 to {Puntosm::%arg-2%} #Editar
  109. send title "" with subtitle "&9&lSUBISTE AL NIVEL &a%{nivel::%arg-2%}%" to arg-2 for 3 seconds
  110. if {nivel::%arg-2%} is between 1 and 10:
  111. add 100 to {xpnext::%arg-2%}
  112. if {nivel::%arg-2%} is between 11 and 20:
  113. add 200 to {xpnext::%arg-2%}
  114. if {nivel::%arg-2%} is between 21 and 30:
  115. add 500 to {xpnext::%arg-2%}
  116. if {nivel::%arg-2%} is between 31 and 40:
  117. add 750 to {xpnext::%arg-2%}
  118. if {nivel::%arg-2%} is between 41 and 50:
  119. add 1000 to {xpnext::%arg-2%}
  120. if {nivel::%arg-2%} is between 51 and 60:
  121. add 1500 to {xpnext::%arg-2%}
  122. if {nivel::%arg-2%} is between 61 and 70:
  123. add 2000 to {xpnext::%arg-2%}
  124. if {nivel::%arg-2%} is between 71 and 80:
  125. add 2500 to {xpnext::%arg-2%}
  126. if {nivel::%arg-2%} is between 81 and 90:
  127. add 4000 to {xpnext::%arg-2%}
  128. if {nivel::%arg-2%} is between 91 and 100:
  129. add 6000 to {xpnext::%arg-2%}
  130. set {_query} to "UPDATE usuarios SET puntosm = ""%{puntosm::%arg-2%}%"", nivel = ""%{nivel::%arg-2%}%"", xp = ""%{xp::%arg-2%}%"", xpnext = ""%{xpnext::%arg-2%}%"", niveltimer = ""%{lvltimer::%arg-2%}%"", nivelmultipler = ""%{lvlmultipler::%arg-2%}%"" WHERE uuid = ""%arg-2's uuid%"""
  131. execute unsafe {_query} in {-sql}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement