henry900326

Untitled

Feb 2nd, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.01 KB | None | 0 0
  1. on damage:
  2. if victim's name contains "Lv":
  3. if victim isn't a player:
  4. set {_uncolorname} to uncolored name of victim
  5. if {怪物防禦::%{_uncolorname}%} is set:
  6. if {怪物防禦::%{_uncolorname}%} is smaller than or equal to damage*2:
  7. set damage to damage - {怪物防禦::%{_uncolorname}%} * 0.5
  8. stop
  9. else:
  10. set damage to 0.5
  11. stop
  12. on damage:
  13. if attacker is a player:
  14. if victim isn't a player:
  15. if victim's name contains "Lv":
  16. set {_UUID} to UUID of victim
  17. set "怪物生命" to "%victim's max health%" in yaml file "Monsters/%{_UUID}%.yml"#儲存怪物最大生命
  18. set {_NewDamage} to damage
  19. set {_NewDamage} to {_NewDamage} parsed as integer
  20. set {_DamageList} to single value "%attacker%" get of "Monsters/%{_UUID}%.yml"#獲取傷害表
  21. set {_DamageList} to {_DamageList} parsed as integer
  22. set {_DamageList} to "%{_DamageList} + {_NewDamage}%" parsed as integer
  23. send "%{_DamageList}%" to attacker
  24. set "%attacker%" to "%{_DamageList}%" in yaml file "Monsters/%{_UUID}%.yml"#儲存傷害表
  25.  
  26.  
  27. on death:
  28. if attacker is a player:
  29. if victim isn't a player:
  30. if victim's name contains "Lv":
  31. set {_name} to name of victim#下面全部範圍內 name of victim取代成 {_name}
  32. set {_UUID} to UUID of victim#下面全部範圍內 name of victim取代成 {_name}
  33. set {_uncolorname} to uncolored name of victim
  34. loop 1000 times:
  35. if {_uncolorname} contains "%1000 - loop-number%":
  36. set {_lvl} to 1000 - loop-number
  37. exit loop
  38. loop all players:
  39. set {_gettotal} to single value "%loop-player%" get of "Monsters/%{_UUID}%.yml"
  40. set {_gettotal} to {_gettotal} parsed as integer
  41. set {_gettotal2} to single value "怪物生命" get of "Monsters/%{_UUID}%.yml"
  42. set {_gettotal2} to {_gettotal2} parsed as integer
  43. set {_how} to {_gettotal} / {_gettotal2}
  44. if {_name} don't contain "boss":
  45. if {_gettotal} is more than or equal to 0.1:
  46. set {_how} to 1
  47. if {組隊系統::%loop-player%} isn't set:
  48. send "%{_gettotal}%" to loop-player
  49. if {_how} is more than or equal to 1:
  50. set {_how} to 1
  51. if {_how} isn't smaller than or equal to 0:
  52. set {_a} to loop-player
  53. set {_double} to 1 + {玩家資料.%{_a}%::經驗卷倍率}
  54. if {玩家資料.%{_a}%::VIP} is set:
  55. set {_double} to {_double} + 0.3
  56. add round({經驗怪物::%{_uncolorname}%} * {_double} * {_how}) to {玩家資料.%{_a}%::目前經驗值}
  57. set {_did} to {玩家資料.%{_a}%::等級} + 12
  58. send "&a【系統】 &a&l獲得經驗值 %round({經驗怪物::%{_uncolorname}%} * {_double} * {_how})%。" to {_a}
  59. else if {組隊系統::%loop-player%} is set:
  60. set {_a} to loop-player
  61. set {_double} to 1 + {玩家資料.%{_a}%::經驗卷}
  62. if {玩家資料.%{_a}%::VIP} is set:
  63. set {_double} to {_double} + 0.3
  64. add round({經驗怪物::%{_uncolorname}%} * {_double} * {_how}) to {玩家資料.%{_a}%::目前經驗值}
  65. set {_did} to {玩家資料.%{_a}%::等級} + 12
  66. send "&a【系統】 &a&l獲得經驗值 %round({經驗怪物::%{_uncolorname}%} * {_double} * {_how})%。" to {_a}
  67. set {_ok} to 0
  68. loop {組隊系統::%loop-player%::*}:
  69. set {_online} to loop-index parsed as offlineplayer
  70. if {_online} is online:
  71. add 1 to {_ok}
  72. set {_ok} to {_ok} / 2
  73. loop {組隊系統::%loop-player%::*}:
  74. set {_online} to loop-index parsed as offlineplayer
  75. if {_online} is online:
  76. set {_a} to {_online}
  77. set {_did} to {玩家資料.%{_a}%::等級} + 12
  78. if {_did} is smaller than or equal to {_lvl}:
  79. send "&a【系統】 &a&l獲得經驗值 0。&7&l(等級低過%{_name}%&7&l無法獲得經驗)" to {_a}
  80. #send "&a【系統】 &a&l獲得經驗值 0。&7&l(等級低過%{_name}%&7&l無法獲得經驗)" to {_a}
  81. else:
  82. set {_double} to 0.5 + {玩家資料.%{_a}%::經驗卷倍率}
  83. if {玩家資料.%{_a}%::VIP} is set:
  84. set {_double} to {_double} + 0.15
  85. set {_omga} to round({經驗怪物::%{_uncolorname}%} * {_double} / {_maths})
  86. add {_omga} to {玩家資料.%{_a}%::now}
  87. send "&a【系統】 &a&l獲得經驗值 %{_omga}%。" to {_a}
  88. #send "&a【系統】 &a&l獲得經驗值 %round(({經驗怪物::%{_uncolorname}%} * {_double} / {_maths} - round({經驗怪物::%{_uncolorname}%} * {_double} / {_maths} * 0.08)) * {_how})%。" to {_a}
  89. if {_gettotal} is more than or equal to {_gettotal2}:
  90. set {_gettotal} to {_gettotal} - {_gettotal2}
  91. else:
  92. set {_gettotal} to 0
  93. delete app "Monsters/%{_UUID}%.yml"
  94. command /armorset [<text>] [<number>]:
  95. trigger:
  96. if player doesn't have permission "op.oao":
  97. stop trigger
  98. if arg-1 is set:
  99. if arg-2 is set:
  100. set {怪物防禦::%arg-1%} to arg-2
  101. send "&f已&9設置&f該怪物防禦力"
  102. else if {怪物防禦::%arg-1%} is set:
  103. delete {經驗怪物::%arg-1%}
  104. send "&f已&c移除&f該怪物防禦力"
  105. else if arg-1 isn't set:
  106. loop {怪物防禦::*}:
  107. send "%loop-index% - %loop-value%"
  108. send "&a你要用 /armorset 怪物名稱 防禦力 ——來設定防禦力"
  109. send "只要怪物名字有你起的名字,就會有防禦力。"
  110. command /expset [<text>] [<number>]:
  111. trigger:
  112. if player doesn't have permission "op.oao":
  113. execute console command "/warn %player% 該玩家使用管理員指令因此警告一隻。"
  114. stop trigger
  115. if arg-1 is set:
  116. if arg-2 is set:
  117. set {經驗怪物::%arg-1%} to arg-2
  118. send "&f已&9設置&f該怪物額外經驗"
  119. else if {經驗怪物::%arg-1%} is set:
  120. delete {經驗怪物::%arg-1%}
  121. send "&f已&c移除&f該怪物額外經驗"
  122. else if arg-1 isn't set:
  123. loop {經驗怪物::*}:
  124. send "%loop-index% - %loop-value%"
  125. send "&a你要用 /expset 怪物名稱 可獲得經驗值 ——來設定經驗"
  126. send "只要怪物名字有你起的名字,就會獲得額外設置的經驗。"
Advertisement
Add Comment
Please, Sign In to add comment