GrimoN

Statistics

Jun 8th, 2015
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.13 KB | None | 0 0
  1. command /Statistics [<text>] [<text>]:
  2. aliases: statystyki, stats
  3. executable by: players
  4. trigger:
  5. if arg 1 is not set:
  6. if player don't have permission "statistics.choose" or "statistics.*":
  7. send "%{Stats::Messages::No-Perm}%"
  8. stop
  9. set {_Str} to single value "Str" get of "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  10. set {_Hp} to single value "Hp" get of "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  11. set {_Dex} to single value "Dex" get of "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  12. set {_Points} to single value "Points" get of "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  13. open chest with 1 rows named "Statistics" to player
  14. wait 3 ticks
  15. format slot 3 of player with diamond sword named "&cSila" with lore "&fDodaje %{Stats::Config::Str-Bonus}% do obrazen." to close then run "skills str %player%"
  16. format slot 4 of player with golden apple:1 named "&4Zdrowie" with lore "&fDodaje %{Stats::Config::HP-Bonus}% do zdrowia." to close then run "skills hp %player%"
  17. format slot 5 of player with feather named "&aZrecznosc" with lore "&fDodaje %{Stats::Config::Dex-Chance-Bonus}% do szansy na unik." to close then run "skills dex %player%"
  18. format slot 8 of player with book named "&bStatystyki" with lore "&cSila - &6%{_Str}%&f.||&4Zdrowie - &6%{_Hp}%&f.||&aZrecznosc - &6%{_Dex}%&f.||&bPunkty do rozdania - &2%{_Points}%&f." to close
  19. stop
  20. if arg 1 is "config":
  21. if arg 2 isn't set:
  22. send "Prawidlowe uzycie /Statystyki Config Default"
  23. stop
  24. if arg 2 isn't "default":
  25. send "Prawidlowe uzycie /Statystyki Config Default"
  26. stop
  27. if player don't have permission "statistics.config.default" or "statistics.config.*" or "statistics.*":
  28. send "%{Stats::Messages::No-Perm}%"
  29. stop
  30. send "Resetowanie pliku Config.yml..."
  31. df "plugins/Skript/scripts/Statistics/Config.yml"
  32. wait 2 ticks
  33. create file "plugins/Skript/scripts/Statistics/Config.yml"
  34. download from "http://pastebin.com/raw.php?i=AWNpphyN" to "plugins/Skript/scripts/Statistics/Config.yml"
  35. send "Zresetowano."
  36. stop
  37. if arg 1 is "messages":
  38. if arg 2 isn't set:
  39. send "Prawidlowe uzycie /Statystyki Messages Default"
  40. stop
  41. if arg 2 isn't "default":
  42. send "Prawidlowe uzycie /Statystyki Messages Default"
  43. stop
  44. if player don't have permission "statistics.messages.default" or "statistics.messages.*" or "statistics.*":
  45. send "%{Stats::Messages::No-Perm}%"
  46. stop
  47. df "plugins/Skript/scripts/Statistics/Messages.yml"
  48. wait 2 ticks
  49. create file "plugins/Skript/scripts/Statistics/Messages.yml"
  50. send "Resetowanie pliku Messages.yml..."
  51. download from "http://pastebin.com/raw.php?i=gEyH9CHg" to "plugins/Skript/scripts/Statistics/Messages.yml"
  52. send "Zresetowano."
  53. stop
  54. if arg 1 is "reload":
  55. if player don't have permission "statistics.reload" or "statistics.*":
  56. send "%{Stats::Messages::No-Perm}%"
  57. stop
  58. send "Ladowanie %script%.sk..."
  59. execute console command "sk disable %script%.sk"
  60. wait 3 seconds
  61. execute console command "sk enable %script%.sk"
  62. send "Zaladowano %script%.sk..."
  63. stop
  64.  
  65.  
  66. command /skills [<text>] [<player>]:
  67. executable by: console
  68. trigger:
  69. wait 1 ticks
  70. set {_p} to arg 2
  71. set {_Points} to single value "Points" get of "plugins/Skript/scripts/Statistics/Players/%{_p}%.yml" parsed as integer
  72. set {_Max-One} to single value "Max-One-Stat" get of "plugins/Skript/scripts/Statistics/Config.yml" parsed as integer
  73. if {_Points} is smaller or equal to 0:
  74. send "%{Stats::Messages::No-Points}%" to {_p}
  75. stop
  76. if arg 1 is "str":
  77. set {_Str} to single value "Str" get of "plugins/Skript/scripts/Statistics/Players/%{_p}%.yml" parsed as integer
  78. if {_Str} is greater or equal to {_Max-One}:
  79. send "%{Stats::Messages::Max-Stat-Message}%" to {_p}
  80. stop
  81. add 1 to {_Str}
  82. remove 1 from {_Points}
  83. set yaml value "Str" from "Statistics/Players/%{_p}%.yml" to "%{_Str}%"
  84. set yaml value "Points" from "Statistics/Players/%{_p}%.yml" to "%{_Points}%"
  85. send "%{Stats::Messages::Str-Add}%" to {_p}
  86. stop
  87. if arg 1 is "dex":
  88. set {_Dex} to single value "Dex" get of "plugins/Skript/scripts/Statistics/Players/%{_p}%.yml" parsed as integer
  89. if {_Dex} is greater or equal to {_Max-One}:
  90. send "%{Stats::Messages::Max-Stat-Message}%" to {_p}
  91. stop
  92. add 1 to {_Dex}
  93. remove 1 from {_Points}
  94. set yaml value "Dex" from "Statistics/Players/%{_p}%.yml" to "%{_Dex}%"
  95. set yaml value "Points" from "Statistics/Players/%{_p}%.yml" to "%{_Points}%"
  96. send "%{Stats::Messages::Dex-Add}%" to {_p}
  97. stop
  98. if arg 1 is "hp":
  99. set {_Hp} to single value "Hp" get of "plugins/Skript/scripts/Statistics/Players/%{_p}%.yml" parsed as integer
  100. if {_Hp} is greater or equal to {_Max-One}:
  101. send "%{Stats::Messages::Max-Stat-Message}%" to {_p}
  102. stop
  103. add 1 to {_Hp}
  104. remove 1 from {_Points}
  105. set yaml value "Hp" from "Statistics/Players/%{_p}%.yml" to "%{_Hp}%"
  106. set yaml value "Points" from "Statistics/Players/%{_p}%.yml" to "%{_Points}%"
  107. send "%{Stats::Messages::Hp-Add}%" to {_p}
  108. set the maximum health of {_p} to maximum health of {_p}+{Stats::Config::HP-Bonus}
  109. stop
  110. stop
  111. on load:
  112. if folder "plugins/Skript/scripts/Statistics" doesn't exists:
  113. create folder "plugins/Skript/scripts/Statistics"
  114. create folder "plugins/Skript/scripts/Statistics/Players"
  115. create file "plugins/Skript/scripts/Statistics/Config.yml"
  116. create file "plugins/Skript/scripts/Statistics/Messages.yml"
  117. set {_Config} to result of connect to "http://pastebin.com/raw.php?i=AWNpphyN"
  118. wf {_Config} to "plugins/Skript/scripts/Statistics/Config.yml"
  119. set {_Messages} to result of connect to "http://pastebin.com/raw.php?i=gEyH9CHg"
  120. wf {_Messages} to "plugins/Skript/scripts/Statistics/Messages.yml"
  121. if folder "plugins/Skript/scripts/Statistics/Players" doesn't exists:
  122. create folder "plugins/Skript/scripts/Statistics/Players"
  123. if file "plugins/Skript/scripts/Statistics/Config.yml" doesn't exists:
  124. create file "plugins/Skript/scripts/Statistics/Config.yml"
  125. download from "http://pastebin.com/raw.php?i=AWNpphyN" to "plugins/Skript/scripts/Statistics/Config.yml"
  126. if file "plugins/Skript/scripts/Statistics/Messages.yml" doesn't exists:
  127. create file "plugins/Skript/scripts/Statistics/Messages.yml"
  128. download from "http://pastebin.com/raw.php?i=gEyH9CHg" to "plugins/Skript/scripts/Statistics/Messages.yml"
  129.  
  130. set {Stats::Messages::No-Perm} to single value "No-Permissions" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  131. set {Stats::Messages::No-Points} to single value "No-Points" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  132. set {Stats::Messages::Str-Add} to single value "Str-Add" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  133. set {Stats::Messages::Dex-Add} to single value "Dex-Add" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  134. set {Stats::Messages::Hp-Add} to single value "Hp-Add" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  135. set {Stats::Messages::Miss-Message} to single value "Miss-Message" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  136. set {Stats::Messages::Get-Point} to single value "Get-Point" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  137. set {Stats::Messages::Max-Stat-Message} to single value "Max-Stat-Message" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  138. set {Stats::Config::Max-Points} to single value "Max-Points" get of "plugins/Skript/scripts/Statistics/Config.yml"
  139. set {Stats::Config::Max-One-Stat} to single value "Max-One-Stat" get of "plugins/Skript/scripts/Statistics/Config.yml"
  140. set {Stats::Config::Str-Bonus} to single value "Str-Bonus" get of "plugins/Skript/scripts/Statistics/Config.yml"
  141. set {Stats::Config::Dex-Chance-Bonus} to single value "Dex-Chance-Bonus" get of "plugins/Skript/scripts/Statistics/Config.yml"
  142. set {Stats::Config::HP-Bonus} to single value "HP-Bonus" get of "plugins/Skript/scripts/Statistics/Config.yml"
  143. set {Stats::Config::Point-Player-Chance} to single value "Point-Player-Chance" get of "plugins/Skript/scripts/Statistics/Config.yml"
  144. set {Stats::Config::Point-Entity-Chance} to single value "Point-Entity-Chance" get of "plugins/Skript/scripts/Statistics/Config.yml"
  145.  
  146. on join:
  147. if file "plugins/Skript/scripts/Statistics/Players/%player%.yml" doesn't exists:
  148. create file "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  149.  
  150. wf "Str: '0'" to "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  151. wf "Hp: '0'" to "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  152. wf "Dex: '0'" to "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  153. wf "Points: '10'" to "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  154.  
  155. on damage:
  156. if attacker is a player:
  157. set {_Str} to single value "Str" get of "plugins/Skript/scripts/Statistics/Players/%attacker%.yml" parsed as number
  158. set damage to damage + {_Str}*{Stats::Config::Str-Bonus} parsed as number
  159. if victim is a player:
  160. set {_Dex} to single value "Dex" get of "plugins/Skript/scripts/Statistics/Players/%victim%.yml" parsed as number
  161. set {_Dex} to {_Dex}*{Stats::Config::Dex-Chance-Bonus} parsed as number
  162. chance of {_Dex}%:
  163. set damage to 0
  164. send "%{Stats::Messages::Miss-Message}%" to victim
  165. stop
  166.  
  167. on death:
  168. if victim is a player:
  169. if attacker is a player:
  170. set {_Chance} to {Stats::Config::Point-Player-Chance} parsed as number
  171. chance of {_Chance}%:
  172. set {_Points} to single value "Points" get of "plugins/Skript/scripts/Statistics/Players/%attacker%.yml" parsed as number
  173. add 1 to {_Points}
  174. set yaml value "Points" from "Statistics/Players/%attacker%.yml" to "%{_Points}%"
  175. send "%{Stats::Messages::Get-Point}%" to attacker
  176. stop
  177. if victim isn't a player:
  178. if attacker is a player:
  179. set {_Chance} to {Stats::Config::Point-Entity-Chance} parsed as number
  180. chance of {_Chance}%:
  181. set {_Points} to single value "Points" get of "plugins/Skript/scripts/Statistics/Players/%attacker%.yml" parsed as number
  182. add 1 to {_Points}
  183. set yaml value "Points" from "Statistics/Players/%attacker%.yml" to "%{_Points}%"
  184. send "%{Stats::Messages::Get-Point}%" to attacker
  185. stop
  186. stop
Advertisement
Add Comment
Please, Sign In to add comment