henry900326

Untitled

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