Advertisement
LHemon412

nMarriage.sk

Sep 17th, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.72 KB | None | 0 0
  1. options:
  2. prefix: &d婚姻系統 &d>>
  3.  
  4. born_time_sec: 10800
  5.  
  6. training_time_sec: 86400
  7.  
  8. on rightclick on player:
  9. type of player's tool is air
  10. sneaking state of player is true
  11. if metadata "NPC" of clicked entity is not set:
  12. open chest with 4 rows named "&e玩家互動菜單 - &a%clicked entity%" to player
  13. loop integers from 0 to 35:
  14. set slot loop-value of player's current inventory to black glass named "&f"
  15. set slot 4 of player's current inventory to skull of clicked entity named "&a&l%clicked entity%"
  16. set slot 19 of player's current inventory to rose bushes named "&c婚姻系統" with lore "&7>> &a求婚||&7>> &a離婚||&7更多操作..."
  17. set slot 21 of player's current inventory to emerald named "&a交易系統" with lore "&7>> &a按我向對方發出交易邀請"
  18.  
  19. command /maccept:
  20. trigger:
  21. if {婚姻暫存.%player%::邀約玩家} is set:
  22. set {_hus} to {婚姻暫存.%player%::邀約玩家}
  23. set {_husP} to "%{_hus}%" parsed as player
  24. set {玩家資料.%player%::伴侶} to {_hus}
  25. set {玩家資料.%{_hus}%::伴侶} to "%player%"
  26. delete {婚姻暫存.%{_hus}%::求婚對象}
  27. delete {婚姻暫存.%{_hus}%::求婚時間}
  28. delete {婚姻暫存.%player%::邀約玩家}
  29. send "{@prefix} &e您接受了 &a%{_hus}% &e的求婚! 恭喜!"
  30. send "{@prefix} &a%player% &e接受了您的求婚! 恭喜!" to {_husP}
  31. broadcast "{@prefix} &a%player% &e跟 &a%{_hus}% &e結婚了!!! 恭喜他們吧!"
  32. else:
  33. send "{@prefix} &e別幻想了,根本沒有人跟你求婚"
  34.  
  35. command /mrefuse:
  36. trigger:
  37. if {婚姻暫存.%player%::邀約玩家} is set:
  38. set {_hus} to {婚姻暫存.%player%::邀約玩家}
  39. set {_husP} to "%{_hus}%" parsed as player
  40. delete {婚姻暫存.%{_hus}%::求婚對象}
  41. delete {婚姻暫存.%{_hus}%::求婚時間}
  42. delete {婚姻暫存.%player%::邀約玩家}
  43. send "{@prefix} &e您拒絕了 &a%{_hus}% &e的求婚,對方哭着跑走了"
  44. send "{@prefix} &a%player% &e拒絕了您的求婚" to {_husP}
  45. else:
  46. send "{@prefix} &e別幻想了,根本沒有人跟你求婚"
  47.  
  48. on join:
  49. if {婚姻暫存.%player%::求婚對象} is set:
  50. set {_tar} to {婚姻暫存.%player%::求婚對象}
  51. delete {婚姻暫存.%player%::求婚對象}
  52. delete {婚姻暫存.%player%::求婚時間}
  53. delete {婚姻暫存.%{_tar}%::邀約玩家}
  54.  
  55. on inventory click:
  56. if name of player's current inventory contains "玩家互動菜單 -":
  57. cancel event
  58. set {_playerID} to uncoloured name of player's current inventory
  59. replace all "玩家互動菜單 - " with "" in {_playerID}
  60. if name of clicked item is "&c婚姻系統":
  61. close player's inventory
  62. open chest with 4 rows named "&e婚姻系統 - &a%{_playerID}%" to player
  63. loop integers from 0 to 35:
  64. set slot loop-value of player's current inventory to black glass named "&f"
  65. set slot 4 of player's current inventory to skull of {_playerID} parsed as player named "&a&l%{_playerID}%"
  66. if {玩家資料.%{_playerID}%::伴侶} is "無":
  67. if {玩家資料.%player%::伴侶} is "無":
  68. if {婚姻暫存.%player%::求婚對象} is not set:
  69. if {婚姻暫存.%{_playerID}%::邀約玩家} is not set:
  70. set slot 19 of player's current inventory to red poppy named "&e求婚" with lore "&a按我向對方求婚"
  71. else:
  72. set slot 19 of player's current inventory to red poppy named "&e求婚" with lore "&c對方已經被其他人求婚了||&c等等再來吧"
  73. else:
  74. set slot 19 of player's current inventory to red poppy named "&e求婚" with lore "&c您已經向某人求婚了!"
  75. else:
  76. set slot 19 of player's current inventory to red poppy named "&e求婚" with lore "&c您已經有伴侶了!"
  77. else:
  78. set slot 19 of player's current inventory to red poppy named "&e求婚" with lore "&c對方已經有伴侶了!"
  79. if {玩家資料.%{_playerID}%::伴侶} is player:
  80. set slot 25 of player's current inventory to dead bush named "&e離婚" with lore "&a按我與對方離婚"
  81. else:
  82. set slot 25 of player's current inventory to dead bush named "&e離婚" with lore "&c你不是對方的伴侶!"
  83. else if name of clicked item is "&a交易系統":
  84. close player's inventory
  85. execute player command "/trade %{_playerID}%"
  86. else if name of player's current inventory contains "&e婚姻系統 -":
  87. cancel event
  88. set {_playerID} to uncoloured name of player's current inventory
  89. replace all "婚姻系統 - " with "" in {_playerID}
  90. if name of clicked item is "&e求婚":
  91. if lore of clicked item contains "&a按我向對方求婚":
  92. close player's inventory
  93. set {_player} to {_playerID} parsed as player
  94. set {婚姻暫存.%player%::求婚對象} to {_player}
  95. set {婚姻暫存.%player%::求婚時間} to date now as unix
  96. set {婚姻暫存.%{_playerID}%::邀約玩家} to player
  97. send "{@prefix} &e您向 &a%{_player}% &e求婚了! 請耐心等待對方的答覆"
  98. send "{@prefix} &a%player% &e向您求婚了! 您有 30 秒時間考慮: 輸入 &a/maccept &e以接受,輸入 &a/mrefuse &e以拒絕" to {_player}
  99. wait 30 seconds
  100. if {婚姻暫存.%player%::求婚對象} is set:
  101. delete {婚姻暫存.%player%::求婚對象}
  102. delete {婚姻暫存.%player%::求婚時間}
  103. delete {婚姻暫存.%{_playerID}%::邀約玩家}
  104. send "{@prefix} &e30 秒過了 &a%{_player}% &e還沒答應您,下次再努力吧!!"
  105. send "{@prefix} &e30 秒過了您還沒對 &a%player% &e的求婚作出回應,對方哭着跑走了" to {_player}
  106. else if name of clicked item is "&e離婚":
  107. if lore of clicked item contains "&a按我與對方離婚":
  108. close player's inventory
  109. set {_player} to {_playerID} parsed as player
  110. set {玩家資料.%player%::伴侶} to "無"
  111. set {玩家資料.%{_player}%::伴侶} to "無"
  112. send "{@prefix} &e你已與 &a%{_player}% &e離婚"
  113. send "{@prefix} &a%player% &e跟你離婚了" to {_player}
  114. broadcast "{@prefix} &a%player% &e跟 &a%{_player}% &e離婚了! &7(群眾: YES!!!)"
  115.  
  116. on rightclick:
  117. if name of player's tool is "&e強制離婚文件":
  118. if {玩家資料.%player%::伴侶} is not "無":
  119. remove 1 from item amount of player's tool
  120. set {_hus} to {玩家資料.%player%::伴侶}
  121. set {玩家資料.%player%::伴侶} to "無"
  122. set {玩家資料.%{_hus}%::伴侶} to "無"
  123. send "{@prefix} &e您使用了 &a強制離婚文件 &e與對方離婚"
  124. if {_hus} is online:
  125. send "{@prefix} &a%player% &e使用了 &a強制離婚文件 &e與您離婚" to {_hus}
  126. broadcast "{@prefix} &a%player% &e使用 &a強制離婚文件 &e跟 &a%{_hus}% &e離婚了! &7(群眾: YES!!!)"
  127. else:
  128. send "{@prefix} &e你根本沒有伴侶,不要自我安慰了"
  129.  
  130. #Kiss#
  131.  
  132. function negative(n: number) :: number:
  133. if {_n} is smaller than 0:
  134. set {_re} to absolute value of {_n}
  135. else:
  136. set {_re} to 0 - {_n}
  137. return {_re}
  138.  
  139. function oppositeFace(d: direction) :: direction:
  140. if {_d} is north:
  141. return south
  142. else if {_d} is north east:
  143. return south west
  144. else if {_d} is east:
  145. return west
  146. else if {_d} is south east:
  147. return north west
  148. else if {_d} is south:
  149. return north
  150. else if {_d} is south west:
  151. return north east
  152. else if {_d} is west:
  153. return east
  154. else if {_d} is north west:
  155. return south east
  156. else if {_d} is below:
  157. return above
  158. else if {_d} is above:
  159. return below
  160.  
  161. function getBabyAge(p: player) :: integer:
  162. return floor((date now as unix - {繁殖系統.%{_p}%::孩子出生時間}) / 51840)
  163.  
  164. on rightclick on player:
  165. #sneaking state of player is true
  166. "%name of clicked entity%" is "%{玩家資料.%player%::伴侶}%"
  167. set {_target} to "%name of clicked entity%" parsed as player
  168. set {_playerface} to player's facing
  169. set {_fffface} to clicked entity's facing
  170. oppositeFace({_playerface}) is {_fffface}
  171. set {_playerloc} to player's location
  172. set {_fffloc} to clicked entity's location
  173. distance between {_playerloc} and {_fffloc} is smaller than 2.5
  174. set {_targetX} to negative((x-coord of {_playerloc} - x-coord of {_fffloc}) / 2)
  175. set {_targetY} to negative((y-coord of {_playerloc} - y-coord of {_fffloc}) / 2) + 1
  176. set {_targetZ} to negative((z-coord of {_playerloc} - z-coord of {_fffloc}) / 2)
  177. add {_targetX} to x-coord of {_playerloc}
  178. add {_targetY} to y-coord of {_playerloc}
  179. add {_targetZ} to z-coord of {_playerloc}
  180. drawDot count 3, particle "heart", XYZ 0.1, 0.1, 0.1, center {_playerloc}, visibleRange 32, pulseDelay 2, keepFor 0.3 seconds
  181.  
  182.  
  183. on command:
  184. player is op
  185. command is "lemonhome"
  186. cancel event
  187. teleport player to location(105, 3, 75, world("RPG"))
  188.  
  189. # Gayau :P
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement