Advertisement
Guest User

Untitled

a guest
Dec 15th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.10 KB | None | 0 0
  1. on damage:
  2. if attacker is a player:
  3. if victim is a player:
  4. if {玩家資料.%victim%::等級} isn't set:
  5. cancel event
  6. stop
  7. set {_check} to 5
  8. set {_lore::*} to uncolored lore of attacker's tool split at "||"
  9. loop {_lore::*}:
  10. if {_lore::%loop-index%} contains "職業限制" or "職業需求":
  11. set {_nameofattackertool.%attacker%} to {_lore::%loop-index%}
  12. set {_check} to 0
  13. exit loop
  14. loop {職業::*}:
  15. if "%{_nameofattackertool.%attacker%}%" contains "%loop-value%":
  16. if {玩家資料.%attacker%::職業} is "%loop-value%":
  17. set {_check} to 1
  18. if {_check} is 0:
  19. send "職業不吻合武器需求" to attacker
  20. set damage to 0
  21. cancel event
  22. stop
  23. if {玩家資料.%attacker%::爆擊率} is set:
  24. set {_幾率.%attacker%} to {玩家資料.%attacker%::爆擊率} / 100 + {飾品狀態.%attacker%::爆擊率}
  25. Chance of {_幾率.%attacker%}:
  26. set {_omg} to damage * 1.65 + 0.01 * {飾品狀態.%attacker%::爆擊倍率} * damage
  27. set damage to {_omg}
  28. play raw sound "mob.irongolem.hit" at attacker with pitch 1 volume 0.5
  29. # play raw sound "mob.zombie.metal" at attacker with pitch 1 volume 0.5
  30. # play raw sound "mob.zombie.remedy" at attacker with pitch 1 volume 0.5
  31. if victim isn't a player:
  32. if name of victim contains "lv":
  33. set {_uncolorname} to uncolored name of victim
  34. if file "Monsters/%{_uncolorname}%.yml" doesn't exists:
  35. create file "Monsters/%{_uncolorname}%.yml"
  36. set "血量最大" to "%victim's max health * 2%" in yaml file "Monsters/%{_uncolorname}%.yml"
  37. if {%name of victim%::*} is set:
  38. delete {%name of victim%::*}
  39. delete {%name of victim%}
  40. set {_seehow} to round(damage * 2)
  41. if name of attacker's tool contains "«×»":
  42. set {_lore::*} to uncolored lore of attacker's tool split at "||"
  43. loop {_lore::*}:
  44. if {_lore::%loop-index%} contains "攻擊傷害":
  45. replace all "攻擊傷害" and " " with "" in {_lore::%loop-index%}
  46. set {_aaaaaa} to {_lore::%loop-index%}
  47. if {_lore::%loop-index%} contain "+":
  48. loop 5000 times:
  49. set {_search} to first loop-number characters of {_aaaaaa}
  50. if {_search} contains "+":
  51. replace "+" with "" in {_aaaaaa}
  52. set {_目前耐久} to first (loop-number - 1) characters of {_aaaaaa}
  53. set {_最大耐久} to subtext of {_aaaaaa} from characters loop-number to length of {_aaaaaa}
  54. exit loop
  55. set {_最大耐久} to {_最大耐久} parsed as integer
  56. set {_目前耐久} to {_目前耐久} parsed as integer
  57. set {_lore::%loop-index%} to {_最大耐久} + {_目前耐久}
  58. set {_lore::%loop-index%} to {_lore::%loop-index%} parsed as integer
  59. set {_seehow} to {_lore::%loop-index%} + {_seehow}
  60. exit loop
  61. if {_seehow} is more than or equal to (victim's max health * 2):
  62. set {_seehow} to victim's max health * 2
  63. set {_atk} to "%name of attacker%"
  64. replace all "_" with "啊" in {_atk}
  65. set {_omgomgomg} to 0
  66. if {組隊系統::%{_atk}%} is set:
  67. set {_attacker} to "%{_atk}%"
  68. set {_gettotal} to single value "%{_attacker}%" get of "Monsters/%{_uncolorname}%.yml"
  69. set {_gettotal} to {_gettotal} parsed as integer
  70. set {_gettotal} to {_seehow} + {_gettotal}
  71. set "%{_attacker}%" to "%{_gettotal}%" in yaml file "Monsters/%{_uncolorname}%.yml"
  72. set {_omgomgomg} to 1
  73. if {_omgomgomg} is 0:
  74. loop {組隊系統::*}:
  75. set {_name} to loop-index
  76. if {_omgomgomg} is 0:
  77. if {組隊系統.%{_name}%::%{_atk}%} is set:
  78. set {_attacker} to "%{_name}%"
  79. set {_gettotal} to single value "%{_attacker}%" get of "Monsters/%{_uncolorname}%.yml"
  80. set {_gettotal} to {_gettotal} parsed as integer
  81. set {_gettotal} to {_seehow} + {_gettotal}
  82. set "%{_attacker}%" to "%{_gettotal}%" in yaml file "Monsters/%{_uncolorname}%.yml"
  83. set {_omgomgomg} to 1
  84. if {_omgomgomg} is 0:
  85. set {_gettotal} to single value "%{_atk}%" get of "Monsters/%{_uncolorname}%.yml"
  86. set {_gettotal} to {_gettotal} parsed as integer
  87. add {_seehow} to {_gettotal}
  88. set "%attacker%" to "%{_gettotal}%" in yaml file "Monsters/%{_uncolorname}%.yml"
  89. set {_omgomgomg} to 1
  90. on death:
  91. if attacker is a player:
  92. if victim isn't a player:
  93. if name of victim contains "lv":
  94. set {_name} to name of victim#下面全部範圍內 name of victim取代成 {_name}
  95. set {_uncolorname} to uncolored name of victim
  96. set {_loc} to attacker
  97. loop 25000 times:
  98. if {_uncolorname} contains "%25000 - loop-number%":
  99. set {_lvl} to 25000 - loop-number
  100. exit loop
  101. set {_maxhp} to single value "血量最大" get of "Monsters/%{_uncolorname}%.yml"
  102. set {_maxhp} to {_maxhp} parsed as integer
  103. wait 1 ticks
  104. loop {在綫玩家::*}:
  105. clear {_gettotal.%loop-value%}
  106. set {_check} to "%loop-value%"
  107. replace all "啊" with "_" in {_check}
  108. set {_gettotal.%loop-value%} to single value "%{_check}%" get of "Monsters/%{_uncolorname}%.yml"
  109. set {_gettotal.%loop-value%} to {_gettotal.%loop-value%} parsed as integer
  110. set {_how} to {_gettotal.%loop-value%} / {_maxhp}
  111. if {_name} don't contain "boss":
  112. if {_how} is more than or equal to 0.1:
  113. set {_how} to 1
  114. if {組隊系統::%loop-value%} is set:
  115. if {_how} is more than or equal to 0.1:
  116. set {_ok} to 0
  117. loop {組隊系統.%loop-value%::*}:
  118. set {_online} to loop-index-2 parsed as offlineplayer
  119. if {_online} is online:
  120. add 1 to {_ok}
  121. set {_ok} to {_ok} / 2
  122. loop {組隊系統.%loop-value%::*}:
  123. set {_online} to loop-index-2 parsed as offlineplayer
  124. if {_online} is online:
  125. set {_a} to loop-index-2 parsed as player
  126. set {_did} to {玩家資料.%{_a}%::等級} + 12
  127. if {_did} is smaller than or equal to {_lvl}:
  128. send "&a【系統】 &a&l獲得經驗值 0。&7&l(等級低過%{_name}%&7&l無法獲得經驗)" to {_a}
  129. #send "&a【系統】 &a&l獲得經驗值 0。&7&l(等級低過%{_name}%&7&l無法獲得經驗)" to {_a}
  130. else:
  131. set {_double} to 0.5 + {玩家資料.%{_a}%::經驗卷}
  132. if {組隊系統::%{_a}%} is set:
  133. add 0.2 to {_double}
  134. if {玩家資料.%{_a}%::VIP} is set:
  135. set {_double} to {_double} + 0.15
  136. set {_omga} to round({經驗怪物::%{_uncolorname}%} * {_double} / {_ok})
  137. add {_omga} to {玩家資料.%{_a}%::now}
  138. send "&a【系統】 &a&l獲得經驗值 %{_omga}%。" to {_a}
  139. #send "&a【系統】 &a&l獲得經驗值 %round(({經驗怪物::%{_uncolorname}%} * {_double} / {_maths} - round({經驗怪物::%{_uncolorname}%} * {_double} / {_maths} * 0.08)) * {_how})%。" to {_a}
  140. if {_gettotal.%loop-value%} is more than or equal to {_maxhp}:
  141. set {_gettotal.%loop-value%} to {_gettotal.%loop-value%} - {_maxhp}
  142. else:
  143. set {_gettotal.%loop-value%} to 0
  144. set "%loop-value%" to "%{_gettotal.%loop-value%}%" in yaml file "Monsters/%{_uncolorname}%.yml"
  145. else if {_how} isn't smaller than or equal to 0:
  146. set {_a} to loop-value
  147. set {_double} to 1 + {玩家資料.%{_a}%::經驗卷}
  148. if {玩家資料.%{_a}%::VIP} is set:
  149. set {_double} to {_double} + 0.3
  150. add round({經驗怪物::%{_uncolorname}%} * {_double} * {_how}) to {玩家資料.%{_a}%::now}
  151. set {_did} to {玩家資料.%{_a}%::等級} + 12
  152. send "&a【系統】 &a&l獲得經驗值 %round({經驗怪物::%{_uncolorname}%} * {_double} * {_how})%。" to {_a}
  153. if {_gettotal.%loop-value%} is more than or equal to {_maxhp}:
  154. set {_gettotal.%loop-value%} to {_gettotal.%loop-value%} - {_maxhp}
  155. else:
  156. set {_gettotal.%loop-value%} to 0
  157. set "%loop-value%" to "%{_gettotal.%loop-value%}%" in yaml file "Monsters/%{_uncolorname}%.yml"
  158. on join:
  159. set {_pl} to "%player%" parsed as offlineplayer
  160. wait 10 seconds
  161. if {_pl} is online:
  162. add {_pl} to {在綫玩家::*}
  163. on quit:
  164. set {_pl} to "%player%" parsed as offlineplayer
  165. remove {_pl} from {在綫玩家::*}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement