GrimoN

Untitled

Jun 9th, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.30 KB | None | 0 0
  1. on join:
  2. if file "plugins/Skript/scripts/Statistics/Players/%player%.yml" doesn't exists:
  3. create file "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  4.  
  5. wf "Str: '0'" to "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  6. wf "Hp: '0'" to "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  7. wf "Dex: '0'" to "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  8. wf "Points: '10'" to "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  9. on load:
  10. if folder "plugins/Skript/scripts/Statistics" doesn't exists:
  11. create folder "plugins/Skript/scripts/Statistics"
  12. create folder "plugins/Skript/scripts/Statistics/Players"
  13. create file "plugins/Skript/scripts/Statistics/Config.yml"
  14. create file "plugins/Skript/scripts/Statistics/Messages.yml"
  15. set {_Config} to result of connect to "http://pastebin.com/raw.php?i=AWNpphyN"
  16. wf {_Config} to "plugins/Skript/scripts/Statistics/Config.yml"
  17. set {_Messages} to result of connect to "http://pastebin.com/raw.php?i=gEyH9CHg"
  18. wf {_Messages} to "plugins/Skript/scripts/Statistics/Messages.yml"
  19. if folder "plugins/Skript/scripts/Statistics/Players" doesn't exists:
  20. create folder "plugins/Skript/scripts/Statistics/Players"
  21. if file "plugins/Skript/scripts/Statistics/Config.yml" doesn't exists:
  22. create file "plugins/Skript/scripts/Statistics/Config.yml"
  23. download from "http://pastebin.com/raw.php?i=AWNpphyN" to "plugins/Skript/scripts/Statistics/Config.yml"
  24. if file "plugins/Skript/scripts/Statistics/Messages.yml" doesn't exists:
  25. create file "plugins/Skript/scripts/Statistics/Messages.yml"
  26. download from "http://pastebin.com/raw.php?i=gEyH9CHg" to "plugins/Skript/scripts/Statistics/Messages.yml"
  27.  
  28. set {Stats::Messages::No-Perm} to single value "No-Permissions" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  29. set {Stats::Messages::No-Points} to single value "No-Points" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  30. set {Stats::Messages::Str-Add} to single value "Str-Add" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  31. set {Stats::Messages::Dex-Add} to single value "Dex-Add" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  32. set {Stats::Messages::Hp-Add} to single value "Hp-Add" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  33. set {Stats::Messages::Miss-Message} to single value "Miss-Message" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  34. set {Stats::Messages::Get-Point} to single value "Get-Point" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  35. set {Stats::Messages::Max-Stat-Message} to single value "Max-Stat-Message" get of "plugins/Skript/scripts/Statistics/Messages.yml"
  36. set {Stats::Config::Max-Points} to single value "Max-Points" get of "plugins/Skript/scripts/Statistics/Config.yml"
  37. set {Stats::Config::Max-One-Stat} to single value "Max-One-Stat" get of "plugins/Skript/scripts/Statistics/Config.yml"
  38. set {Stats::Config::Str-Bonus} to single value "Str-Bonus" get of "plugins/Skript/scripts/Statistics/Config.yml"
  39. set {Stats::Config::Dex-Chance-Bonus} to single value "Dex-Chance-Bonus" get of "plugins/Skript/scripts/Statistics/Config.yml"
  40. set {Stats::Config::HP-Bonus} to single value "HP-Bonus" get of "plugins/Skript/scripts/Statistics/Config.yml"
  41. set {Stats::Config::Point-Player-Chance} to single value "Point-Player-Chance" get of "plugins/Skript/scripts/Statistics/Config.yml"
  42. set {Stats::Config::Point-Entity-Chance} to single value "Point-Entity-Chance" get of "plugins/Skript/scripts/Statistics/Config.yml"
  43.  
  44. command /Statistics:
  45. aliases: statystyki, stats
  46. trigger:
  47. if player don't have permission "statistics":
  48. send "%{Stats::Messages::No-Perm}%"
  49. stop
  50. set {_Str} to single value "Str" get of "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  51. set {_Hp} to single value "Hp" get of "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  52. set {_Dex} to single value "Dex" get of "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  53. set {_Points} to single value "Points" get of "plugins/Skript/scripts/Statistics/Players/%player%.yml"
  54. open chest with 1 rows named "Statistics" to player
  55. wait 3 ticks
  56. 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%"
  57. 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%"
  58. 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%"
  59. 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
  60. stop
  61.  
  62.  
  63. command /skills [<text>] [<player>]:
  64. executable by: console
  65. trigger:
  66. wait 1 ticks
  67. set {_p} to arg 2
  68. set {_Points} to single value "Points" get of "plugins/Skript/scripts/Statistics/Players/%{_p}%.yml" parsed as integer
  69. set {_Max-One} to single value "Max-One-Stat" get of "plugins/Skript/scripts/Statistics/Config.yml" parsed as integer
  70. if {_Points} is smaller or equal to 0:
  71. send "%{Stats::Messages::No-Points}%" to {_p}
  72. stop
  73. if arg 1 is "str":
  74. set {_Str} to single value "Str" get of "plugins/Skript/scripts/Statistics/Players/%{_p}%.yml" parsed as integer
  75. if {_Str} is greater or equal to {_Max-One}:
  76. send "%{Stats::Messages::Max-Stat-Message}%" to {_p}
  77. stop
  78. add 1 to {_Str}
  79. remove 1 from {_Points}
  80. set yaml value "Str" from "Statistics/Players/%{_p}%.yml" to "%{_Str}%"
  81. set yaml value "Points" from "Statistics/Players/%{_p}%.yml" to "%{_Points}%"
  82. send "%{Stats::Messages::Str-Add}%" to {_p}
  83. stop
  84. if arg 1 is "dex":
  85. set {_Dex} to single value "Dex" get of "plugins/Skript/scripts/Statistics/Players/%{_p}%.yml" parsed as integer
  86. if {_Dex} is greater or equal to {_Max-One}:
  87. send "%{Stats::Messages::Max-Stat-Message}%" to {_p}
  88. stop
  89. add 1 to {_Dex}
  90. remove 1 from {_Points}
  91. set yaml value "Dex" from "Statistics/Players/%{_p}%.yml" to "%{_Dex}%"
  92. set yaml value "Points" from "Statistics/Players/%{_p}%.yml" to "%{_Points}%"
  93. send "%{Stats::Messages::Dex-Add}%" to {_p}
  94. stop
  95. if arg 1 is "hp":
  96. set {_Hp} to single value "Hp" get of "plugins/Skript/scripts/Statistics/Players/%{_p}%.yml" parsed as integer
  97. if {_Hp} is greater or equal to {_Max-One}:
  98. send "%{Stats::Messages::Max-Stat-Message}%" to {_p}
  99. stop
  100. add 1 to {_Hp}
  101. remove 1 from {_Points}
  102. set yaml value "Hp" from "Statistics/Players/%{_p}%.yml" to "%{_Hp}%"
  103. set yaml value "Points" from "Statistics/Players/%{_p}%.yml" to "%{_Points}%"
  104. send "%{Stats::Messages::Hp-Add}%" to {_p}
  105. set the maximum health of {_p} to maximum health of {_p}+{Stats::Config::HP-Bonus}
  106. stop
  107. stop
  108.  
  109. on damage:
  110. if attacker is a player:
  111. set {_Str} to single value "Str" get of "plugins/Skript/scripts/Statistics/Players/%attacker%.yml" parsed as integer
  112. set damage to damage + {_Str}*{Stats::Config::Str-Bonus}
  113. if victim is a player:
  114. set {_Dex} to single value "Dex" get of "plugins/Skript/scripts/Statistics/Players/%victim%.yml" parsed as integer
  115. set {_Dex} to {_Dex}*{Stats::Config::Dex-Chance-Bonus}
  116. broadcast "%{_Dex}%"
  117. chance of {_Dex}%:
  118. set damage to 0
  119. send "%{Stats::Messages::Miss-Message}%" to victim
  120. stop
  121.  
  122. on death:
  123. if victim is a player:
  124. if attacker is a player:
  125. set {_Chance} to {Stats::Config::Point-Player-Chance} parsed as number
  126. chance of {_Chance}%:
  127. set {_Points} to single value "Points" get of "plugins/Skript/scripts/Statistics/Players/%attacker%.yml" parsed as integer
  128. add 1 to {_Points}
  129. set yaml value "Points" from "Statistics/Players/%attacker%.yml" to "%{_Points}%"
  130. send "%{Stats::Messages::Get-Point}%" to attacker
  131. stop
  132. if victim isn't a player:
  133. if attacker is a player:
  134. set {_Chance} to {Stats::Config::Point-Entity-Chance} parsed as number
  135. chance of {_Chance}%:
  136. set {_Points} to single value "Points" get of "plugins/Skript/scripts/Statistics/Players/%attacker%.yml" parsed as integer
  137. add 1 to {_Points}
  138. set yaml value "Points" from "Statistics/Players/%attacker%.yml" to "%{_Points}%"
  139. send "%{Stats::Messages::Get-Point}%" to attacker
  140. stop
  141. stop
Advertisement
Add Comment
Please, Sign In to add comment