CREAMPAN0408

Untitled

Jan 21st, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. 黒曜石の上に載っている金床を武器強化専用金床に置き換えるSK
  2. 使い方
  3. ①金床に強化したい剣を持って右クリック。
  4. ②強化素材である木炭か石炭を手に持って金床を右クリック。
  5. ③手に何も持たずに金床をクリックすると武器が強化されて戻ってくる。
  6. 木炭は攻撃力+3% 石炭は攻撃力+5%となっておりますが故よろです
  7.  
  8. on rightclick on anvil:
  9. block under the event-block is obsidian block
  10. cancel event
  11. if player's tool is sword:
  12. if {tool.%player%} is set:
  13. message "<pink>既に剣がセットされています"
  14. stop
  15. set {tool.%player%} to player's tool
  16. delete player's tool
  17. else if player's tool is a charcoal or a coal item:
  18. if {tool.%player%} is not set:
  19. message "<pink>剣がセットされていません"
  20. stop
  21. if lore of {tool.%player%} doesn't contain "-AttackBonus:":
  22. if lore of {tool.%player%} is "":
  23. set lore of {tool.%player%} to "-AttackBonus:0%%"
  24. else:
  25. set lore of {tool.%player%} to "%lore of {tool.%player%}%||-AttackBonus:0%%"
  26. if player's tool is a charcoal:
  27. set {_up} to 3
  28. else if player's tool is a coal item:
  29. set {_up} to 5
  30. remove 1 of player's tool from player
  31. while true:
  32. add 1 to {_line}
  33. set {_lore} to line {_line} of lore of {tool.%player%}
  34. if {_lore} is not set:
  35. exit 2 sections
  36. add {_lore} to {_lore::*}
  37. delete {_lore}
  38. loop {_lore::*}:
  39. add 1 to {_inx}
  40. if the first index of "-AttackBonus:" in loop-value is not -1:
  41. set {_number} to (subtext of loop-value from 14 to length of loop-value) parsed as number
  42. add {_up} to {_number}
  43. set line {_inx} of lore of {tool.%player%} to "-AttackBonus:%{_number}%"
  44. message "<red>強化後→-AttackBonus:%{_number}%"
  45. else if player's tool is air block:
  46. give {tool.%player%} to player
  47. delete {tool.%player%}
  48. else:
  49. if {tool.%player%} is set:
  50. message "<pink>既に剣がセットされています"
  51. stop
  52. message "<pink>剣以外は強化できません"
  53.  
  54. on damage:
  55. {AttackBonus.%attacker%} is set
  56. set damage to damage * (100+{AttackBonus.%attacker%})/100
  57.  
  58. on tool change:
  59. delete {AttackBonus.%player%}
  60. lore of player's tool is set
  61. while true:
  62. add 1 to {_line}
  63. set {_lore} to line {_line} of lore of player's tool
  64. if {_lore} is not set:
  65. exit 2 sections
  66. add {_lore} to {_lore::*}
  67. delete {_lore}
  68. loop {_lore::*}:
  69. add 1 to {_inx}
  70. if the first index of "-AttackBonus:" in loop-value is not -1:
  71. set {_number} to (subtext of loop-value from 14 to length of loop-value) parsed as number
  72. set {AttackBonus.%player%} to {_number}
  73. if {AttackBonus.%player%} is set:
  74. message "<lime>攻撃力ボーナス:%{AttackBonus.%player%}%%%"
Add Comment
Please, Sign In to add comment