Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- x: -568
- y: 64
- z: -9
- world: "miniwarpvpgame"
- prefix: &c競技場 >>
- on enable:
- set {pvpgame::loc} to location({@x}, {@y}, {@z}, world({@world}))
- on disable:
- delete {pvpgame::loc}
- delete {pvpgame::waiting}
- on quit:
- {pvpgame::waiting} is set
- {pvpgame::waiting} is player
- delete {pvpgame::waiting}
- on join:
- if {pvpgame::%player%::joined} is set:
- send "{@prefix} &e由於決鬥過程中伺服器重啟,決鬥已經取消"
- send "{@prefix} &e物品已發還"
- loadinv(player)
- delete {pvpgame::%player%::joined}
- function saveinv(p: player):
- set {_slot} to 0
- loop 36 times:
- set {pvpgame::%{_p}%::inv::%{_slot}%} to slot {_slot} of {_p}'s inventory
- add 1 to {_slot}
- set {pvpgame::%{_p}%::helmet} to {_p}'s helmet
- set {pvpgame::%{_p}%::chestplate} to {_p}'s chestplate
- set {pvpgame::%{_p}%::leggings} to {_p}'s leggings
- set {pvpgame::%{_p}%::boots} to {_p}'s boots
- function loadinv(p: player):
- set {_slot} to 0
- loop 36 times:
- set slot {_slot} of {_p}'s inventory to {pvpgame::%{_p}%::inv::%{_slot}%}
- add 1 to {_slot}
- set {_p}'s helmet to {pvpgame::%{_p}%::helmet}
- set {_p}'s chestplate to {pvpgame::%{_p}%::chestplate}
- set {_p}'s leggings to {pvpgame::%{_p}%::leggings}
- set {_p}'s boots to {pvpgame::%{_p}%::boots}
- command /pvp:
- trigger:
- if {pvpgame::%player%::joined} is set:
- send "{@prefix} &e你已經處於戰鬥中"
- stop
- if {pvpgame::used} is set:
- send "{@prefix} &e已經有玩家處於決鬥中,請稍候"
- stop
- if {pvpgame::waiting} is player:
- send "{@prefix} &e對決等待配對中..."
- stop
- if {pvpgame::waiting} is not set:
- set {pvpgame::waiting} to player
- send "{@prefix} &e對決等待配對中... 你可以邀請朋友輸入 /pvp 與你一起對決"
- stop
- else:
- #match begin
- set {_p1} to {pvpgame::waiting}
- delete {pvpgame::waiting}
- set {_p2} to player
- set {pvpgame::p1} to {_p1}
- set {pvpgame::p2} to {_p2}
- send "{@prefix} &e對決配對完畢! 即將在 3秒後傳送到競技場..." to {_p1}
- send "{@prefix} &e對決配對完畢! 即將在 3秒後傳送到競技場..." to {_p2}
- wait 3 seconds
- saveinv({_p1})
- saveinv({_p2})
- clear {_p1}'s inventory
- clear {_p2}'s inventory
- set {_helmet} to iron helmet of protection 2
- set {_chestplate} to iron chestplate of protection 2
- set {_leggings} to iron leggings of protection 2
- set {_boots} to iron boots of protection 2
- set {_weapon} to iron sword of fire aspect 1
- set {_food} to 64 cooked fish
- set {_p1}'s helmet to {_helmet}
- set {_p1}'s chestplate to {_chestplate}
- set {_p1}'s leggings to {_leggings}
- set {_p1}'s boots to {_boots}
- give {_p1} {_weapon}
- give {_p1} {_food}
- set {_p2}'s helmet to {_helmet}
- set {_p2}'s chestplate to {_chestplate}
- set {_p2}'s leggings to {_leggings}
- set {_p2}'s boots to {_boots}
- give {_p2} {_weapon}
- give {_p2} {_food}
- teleport {_p1} to {pvpgame::loc}
- teleport {_p2} to {pvpgame::loc}
- send "{@prefix} &e對決開始!" to {_p1}
- send "{@prefix} &e對決開始!" to {_p2}
- set {pvpgame::%{_p1}%::joined} to true
- set {pvpgame::%{_p2}%::joined} to true
- on death:
- {pvpgame::%victim%::joined} is set
- #attacker is player
- set {_gg} to null
- if "%{pvpgame::p1}%" is "%victim%":
- set {_gg} to {pvpgame::p2}
- else:
- set {_gg} to {pvpgame::p1}
- give {_gg} 2 brick named "&6&l競技場積分" with lore "&e在競技場戰勝後取得的獎勵||&e可換取不同的獎勵"
- set {_found} to false
- loop all items in victim's inventory:
- loop-item's name is "&6&l競技場積分"
- set {_found} to true
- if {_found} is true:
- remove 1 brick named "&6&l競技場積分" with lore "&e在競技場戰勝後取得的獎勵||&e可換取不同的獎勵" from player
- send "{@prefix} 由於戰敗,你被扣除了 1個競技場積分" to victim
- else:
- send "{@prefix} 由於戰敗,且你沒有任何積分,所以你沒有被扣除任何積分" to victim
- send "{@prefix} 你成功殺死對方了! 積分 &a&l+2" to {_gg}
- make victim execute command "/spawn"
- make {_gg} execute command "/spawn"
- clear victim's inventory
- clear {_gg}'s inventory
- loadinv({_gg})
- loadinv(victim)
- #remove 1 brick named "&6&l競技場積分" with lore "&e在競技場戰勝後取得的獎勵||&e可換取不同的獎勵" from player
- delete {pvpgame::%player%::joined}
- delete {pvpgame::%{_gg}%::joined}
- on mor.inventory click:
- if name of event-item contains "競技場積分":
- if "%type of event-inventory%" is not "player inventory":
- cancel event
- send "&c你不可以對積分進行此類動作!" to event-player
- else if name of cursor item of player contains "競技場積分":
- if "%type of event-inventory%" is not "player inventory":
- cancel event
- send "&c你不可以對積分進行此類動作!" to event-player
- on drop:
- if name of event-item contains "競技場積分":
- cancel event
- send "&c你不可以對積分進行此類動作!" to event-player
Advertisement
Add Comment
Please, Sign In to add comment