Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #0.2.4
- options:
- config-loc: plugins/ThePIT/config.yml
- messages-loc: plugins/ThePIT/messages.yml
- sb-loc: plugins/ThePIT/scoreboard.yml
- titles-loc: plugins/ThePIT/titles.yml
- on script load:
- set {_&} to "&"
- if yaml value "chat-enable" from file "{@config-loc}" is not set:
- set yaml value "chat-enable" from file "{@config-loc}" to "true"
- if yaml value "bungeecord" from file "{@config-loc}" is not set:
- set yaml value "bungeecord" from file "{@config-loc}" to "false"
- if yaml value "chat-format" from file "{@config-loc}" is not set:
- set yaml value "chat-format" from file "{@config-loc}" to "%{_&}%7[%{_&}%e[level]%{_&}%7] [player] %{_&}%8%{_&}%l- %{_&}%7[message]"
- if yaml value "SHOP-ID" from file "{@config-loc}" is not set:
- set yaml value "SHOP-ID" from file "{@config-loc}" to 0
- if yaml value "UPGRADE-ID" from file "{@config-loc}" is not set:
- set yaml value "UPGRADE-ID" from file "{@config-loc}" to 1
- if yaml value "USE-PRESSURE-PLATE" from file "{@config-loc}" is not set:
- set yaml value "USE-PRESSURE-PLATE" from file "{@config-loc}" to "true"
- if yaml value "LEVE-UP-SOUND" from file "{@config-loc}" is not set:
- set yaml value "LEVE-UP-SOUND" from file "{@config-loc}" to "LEVEL_UP"
- if yaml value "KILL-SOUND" from file "{@config-loc}" is not set:
- set yaml value "KILL-SOUND" from file "{@config-loc}" to "ORB_PICKUP"
- if yaml list "ENABLED-WORLDS" from file "{@config-loc}" is not set:
- add "world" to yaml list "ENABLED-WORLDS" from file "{@config-loc}"
- add "thepit" to yaml list "ENABLED-WORLDS" from file "{@config-loc}"
- if yaml value "KILL-XP" from file "{@config-loc}" is not set:
- set yaml value "KILL-XP" from file "{@config-loc}" to 15
- if yaml value "KILL-GOLD" from file "{@config-loc}" is not set:
- set yaml value "KILL-GOLD" from file "{@config-loc}" to 10
- if yaml value "ASSIST-XP" from file "{@config-loc}" is not set:
- set yaml value "ASSIST-XP" from file "{@config-loc}" to 10
- if yaml value "ENDER_CHEST-NEED-LEVEL" from file "{@config-loc}" is not set:
- set yaml value "ENDER_CHEST-NEED-LEVEL" from file "{@config-loc}" to 50
- if yaml value "ASSIST-GOLD" from file "{@config-loc}" is not set:
- set yaml value "ASSIST-GOLD" from file "{@config-loc}" to 5
- if yaml value "prefix" from file "{@messages-loc}" is not set:
- set yaml value "prefix" from file "{@messages-loc}" to "%{_&}%e%{_&}%lTHE PIT %{_&}%8%{_&}%l- %{_&}%7"
- if yaml value "kill-message" from file "{@messages-loc}" is not set:
- set yaml value "kill-message" from file "{@messages-loc}" to "%{_&}%aKILL! %{_&}%7on [%{_&}%e[level]%{_&}%7] [victim] %{_&}%b%{_&}%l+[xp]XP %{_&}%6%{_&}%l+[gold]"
- if yaml value "assist-message" from file "{@messages-loc}" is not set:
- set yaml value "assist-message" from file "{@messages-loc}" to "%{_&}%aASSIST! %{_&}%7on [%{_&}%e[level]%{_&}%7] [player] %{_&}%b%{_&}%l+[xp]XP %{_&}%6%{_&}%l+[gold]"
- if yaml value "kill-streak" from file "{@messages-loc}" is not set:
- set yaml value "kill-streak" from file "{@messages-loc}" to "%{_&}%c%{_&}%lSTREAK! %{_&}%7of %{_&}%c[streak] %{_&}%7by [level] [player]"
- if yaml value "level-up" from file "{@messages-loc}" is not set:
- set yaml value "level-up" from file "{@messages-loc}" to "%{_&}%3%{_&}%lLEVEL UP! %{_&}%7[%{_&}%e[level]%{_&}%7]"
- if yaml value "ENDER_CHEST-NEED-LEVEL-MSG" from file "{@messages-loc}" is not set:
- set yaml value "ENDER_CHEST-NEED-LEVEL-MSG" from file "{@messages-loc}" to "%{_&}%cYou need level [level] to use ender chest!"
- if yaml value "item-purchase" from file "{@messages-loc}" is not set:
- set yaml value "item-purchase" from file "{@messages-loc}" to "%{_&}%aPURCHASE! %{_&}%6[item]"
- if yaml value "perk-purchase" from file "{@messages-loc}" is not set:
- set yaml value "perk-purchase" from file "{@messages-loc}" to "%{_&}%aPURCHASED PERK!"
- if yaml value "perk-selected" from file "{@messages-loc}" is not set:
- set yaml value "perk-selected" from file "{@messages-loc}" to "%{_&}%c%{_&}%lSELECTED PERK"
- if yaml value "no-gold" from file "{@messages-loc}" is not set:
- set yaml value "no-gold" from file "{@messages-loc}" to "%{_&}%c%{_&}%lNOT ENOUGHT GOLD!"
- if yaml value "in-game" from file "{@messages-loc}" is not set:
- set yaml value "in-game" from file "{@messages-loc}" to "%{_&}%aYou are in game."
- if yaml value "not-in-game" from file "{@messages-loc}" is not set:
- set yaml value "not-in-game" from file "{@messages-loc}" to "%{_&}%c%{_&}%lYou are not in game."
- if yaml value "in-fight-status" from file "{@messages-loc}" is not set:
- set yaml value "in-fight-status" from file "{@messages-loc}" to "%{_&}%3%{_&}%lYou are in %{_&}%cFighting %{_&}%3status."
- if yaml value "level-up-title" from file "{@titles-loc}" is not set:
- set yaml value "level-up-title" from file "{@titles-loc}" to "%{_&}%b%{_&}%lLEVEL UP!"
- if yaml value "level-up-subtitle" from file "{@titles-loc}" is not set:
- set yaml value "level-up-subtitle" from file "{@titles-loc}" to "%{_&}%7[%{_&}%e[old]%{_&}%7] %{_&}%3%{_&}%l-> %{_&}%7[%{_&}%e[new]%{_&}%7]"
- if yaml value "death-title" from file "{@titles-loc}" is not set:
- set yaml value "death-title" from file "{@titles-loc}" to "%{_&}%c%{_&}%lYOU DIED"
- if yaml value "death-subtitle" from file "{@titles-loc}" is not set:
- set yaml value "death-subtitle" from file "{@titles-loc}" to "%{_&}%e"
- if yaml value "website" from file "{@sb-loc}" is not set:
- set yaml value "website" from file "{@sb-loc}" to "%{_&}%eMC.SERVER.ORG"
- delete {THEPIT::*}
- set {THEPIT::CONFIG::CHAT} to yaml value "chat-enable" from file "{@config-loc}"
- set {THEPIT::CONFIG::CHAT-FORMAT} to yaml value "chat-format" from file "{@config-loc}"
- set {THEPIT::CONFIG::BUNGEECORD} to yaml value "bungeecord" from file "{@config-loc}"
- set {THEPIT::CONFIG::SHOP-ID} to yaml value "SHOP-ID" from file "{@config-loc}"
- set {THEPIT::CONFIG::UPGRADE-ID} to yaml value "UPGRADE-ID" from file "{@config-loc}"
- set {THEPIT::CONFIG::PRESSURE-PLATE} to yaml value "USE-PRESSURE-PLATE" from file "{@config-loc}"
- set {THEPIT::CONFIG::LEVE-UP-SOUND} to yaml value "LEVE-UP-SOUND" from file "{@config-loc}"
- set {THEPIT::CONFIG::KILL-SOUND} to yaml value "KILL-SOUND" from file "{@config-loc}"
- set {THEPIT::CONFIG::ENABLED-WORLDS::*} to yaml list "ENABLED-WORLDS" from file "{@config-loc}"
- set {THEPIT::CONFIG::ENDER_CHEST-NEED-LEVEL} to yaml value "ENDER_CHEST-NEED-LEVEL" from file "{@config-loc}"
- set {THEPIT::CONFIG::KILL-XP} to yaml value "KILL-XP" from file "{@config-loc}"
- set {THEPIT::CONFIG::KILL-GOLD} to yaml value "KILL-GOLD" from file "{@config-loc}"
- set {THEPIT::CONFIG::ASSIST-XP} to yaml value "ASSIST-XP" from file "{@config-loc}"
- set {THEPIT::CONFIG::ASSIST-GOLD} to yaml value "ASSIST-GOLD" from file "{@config-loc}"
- set {THEPIT::MESSAGES::PREFIX} to yaml value "prefix" from file "{@messages-loc}"
- set {THEPIT::MESSAGES::KILL} to yaml value "kill-message" from file "{@messages-loc}"
- set {THEPIT::MESSAGES::ASSIST} to yaml value "assist-message" from file "{@messages-loc}"
- set {THEPIT::MESSAGES::STREAK} to yaml value "kill-streak" from file "{@messages-loc}"
- set {THEPIT::MESSAGES::LEVEL-UP} to yaml value "level-up" from file "{@messages-loc}"
- set {THEPIT::MESSAGES::ITEM-PURCHASE} to yaml value "item-purchase" from file "{@messages-loc}"
- set {THEPIT::MESSAGES::PERK-PURCHASE} to yaml value "perk-purchase" from file "{@messages-loc}"
- set {THEPIT::MESSAGES::SELECTED-PERK} to yaml value "perk-selected" from file "{@messages-loc}"
- set {THEPIT::MESSAGES::NO-GOLD} to yaml value "no-gold" from file "{@messages-loc}"
- set {THEPIT::MESSAGES::IN-GAME} to yaml value "in-game" from file "{@messages-loc}"
- set {THEPIT::MESSAGES::NOT-IN-GAME} to yaml value "not-in-game" from file "{@messages-loc}"
- set {THEPIT::MESSAGES::YOU-ARE-IN-FIGHT} to yaml value "in-fight-status" from file "{@messages-loc}"
- set {THEPIT::MESSAGES::ENDER_CHEST-NEED-LEVEL-MSG} to yaml value "ENDER_CHEST-NEED-LEVEL-MSG" from file "{@messages-loc}"
- set {THEPIT::TITLES::LEVEL-UP-TITLE} to yaml value "level-up-title" from file "{@titles-loc}"
- set {THEPIT::TITLES::LEVEL-UP-SUBTITLE} to yaml value "level-up-subtitle" from file "{@titles-loc}"
- set {THEPIT::TITLES::DEATH-TITLE} to yaml value "death-title" from file "{@titles-loc}"
- set {THEPIT::TITLES::DEATH-SUBTITLE} to yaml value "death-subtitle" from file "{@titles-loc}"
- set {THEPIT::SB::WEBSITE} to yaml value "website" from file "{@sb-loc}"
- function pit_join(p: player):
- set {_uuid} to uuid of {_p}
- set {pit.%{_uuid}%.state} to "ingame"
- teleport {_p} to {pit.spawn}
- if {pit.%{_uuid}%.level} is not set:
- set {pit.%{_uuid}%.level} to 1
- if {pit.%{_uuid}%.xp} is not set:
- set {pit.%{_uuid}%.xp} to 0
- if {pit.%{_uuid}%.xp-need} is not set:
- set {pit.%{_uuid}%.xp-need} to 100
- if {pit.%{_uuid}%.gold} is not set:
- set {pit.%{_uuid}%.gold} to 0
- set {pit.%{_uuid}%.streak} to 0
- set {pit.%{_uuid}%.status} to "&aIdling"
- pit_clear({_p})
- pit_updatetag({_p})
- pit_equip({_p})
- function pit_leave(p: player):
- set {_uuid} to uuid of {_p}
- delete stylish scoreboard "PIT-%{_p}%"
- delete {pit.%{_uuid}%.streak}
- delete {pit.%{_uuid}%.state}
- delete {pit.%{_uuid}%.damage::*}
- pit_clear({_p})
- make console execute command "nte player %{_p}% clear"
- teleport {_p} to {pit.leave}
- function pit_clear(p: player):
- clear {_p}'s inventory
- clear {_p}'s level
- remove all effects from {_p}
- on join:
- if {THEPIT::CONFIG::BUNGEECORD} is "true":
- pit_join(player)
- stop
- else:
- stop
- command /pit [<text>] [<player>] [<integer>]:
- trigger:
- if arg-1 is "join":
- if {pit.%uuid of player%.state} is not set:
- pit_join(player)
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::IN-GAME}%"
- stop
- if arg-1 is "leave":
- if {THEPIT::CONFIG::BUNGEECORD} is "false":
- if {pit.%uuid of player%.state} is "ingame":
- pit_leave(player)
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NOT-IN-GAME}%"
- stop
- else:
- stop
- if arg-1 is "setgold":
- if player has permission "PIT.SETGOLD":
- if arg-2 is set:
- if arg-3 is set:
- set {pit.%uuid of arg-2%.gold} to arg-3
- send "%colored {THEPIT::MESSAGES::PREFIX}% &7Setted &b%arg-2%&b's &6&lGold &7have been set to &c%arg-3%"
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% &7Specify a number"
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% &7Specify a player"
- stop
- if arg-1 is "addgold":
- if player has permission "PIT.ADDGOLD":
- if arg-2 is set:
- if arg-3 is set:
- add arg-3 to {pit.%uuid of arg-2%.gold}
- send "%colored {THEPIT::MESSAGES::PREFIX}% &7You added &6&l%arg-3% Gold &7to &c%arg-2%&b's &6&lGold"
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% &7Specify a number"
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% &7Specify a player"
- stop
- if arg-1 is "setlevel":
- if player has permission "PIT.SETLEVEL":
- if arg-2 is set:
- if arg-3 is set:
- if {pit.%uuid of arg-2%.level} is set:
- set {pit.%uuid of arg-2%.level} to arg-3
- set {pit.%uuid of arg-2%.xp} to 0
- set {pit.%uuid of arg-2%.xp-need} to 100*{pit.%uuid of arg-2%.level}
- pit_updatetag(arg-2)
- send "%colored {THEPIT::MESSAGES::PREFIX}% &7Setted &b%arg-2%&b's &bLevel &7have been set to &c%arg-3%"
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% &c%arg-2% &anever played"
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% &7Specify a number"
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% &7Specify a player"
- stop
- if arg-1 is "spawn":
- if {pit.%uuid of player%.state} is "ingame":
- if {pit.%uuid of player%.status} is "&aIdling":
- remove all golden_apple from player
- remove all heads from player
- teleport player to {pit.spawn}
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::YOU-ARE-IN-FIGHT}%"
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NOT-IN-GAME}%"
- stop
- if arg-1 is "setspawn":
- if player has permission "PIT.ADMIN":
- set {pit.spawn} to player's location
- send "%colored {THEPIT::MESSAGES::PREFIX}% &cSpawn Set"
- stop
- if arg-1 is "setshop":
- if player has permission "PIT.ADMIN":
- if citizen id of target entity is set:
- set {THEPIT::CONFIG::SHOP-ID} to citizen id of target entity
- set yaml value "SHOP-ID" from file "{@config-loc}" to citizen id of target entity
- send "%colored {THEPIT::MESSAGES::PREFIX}% &cShop Set"
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% &aYou have to look at npc when you execute this command"
- stop
- if arg-1 is "editmode":
- if player has permission "PIT.EDITMODE":
- if {THEPIT::CONFIG::BUNGEECORD} is "true":
- delete {pit.%uuid of player%.state}
- send "%colored {THEPIT::MESSAGES::PREFIX}% &cYou are now able to build."
- else:
- stop
- if arg-1 is "setleave":
- if player has permission "PIT.ADMIN":
- set {pit.leave} to location of player
- send "%colored {THEPIT::MESSAGES::PREFIX}% &cLeave location set"
- if arg-1 is "setupgrade":
- if player has permission "PIT.ADMIN":
- if citizen id of target entity is set:
- set {THEPIT::CONFIG::UPGRADE-ID} to citizen id of target entity
- set yaml value "UPGRADE-ID" from file "{@config-loc}" to citizen id of target entity
- send "%colored {THEPIT::MESSAGES::PREFIX}% &cShop Set"
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% &aYou have to look at npc when you execute this command"
- stop
- else:
- send "&3&l● &7&l------------------------------ &3&l●"
- send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7Join"
- send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7Spawn"
- send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7Leave"
- if player has permission "PIT.ADMIN":
- send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7SetGold <PLAYER> <NUMBER>"
- send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7SetLevel <PLAYER> <NUMBER>"
- if {THEPIT::CONFIG::BUNGEECORD} is "true":
- send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7EditMode"
- send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7SetSpawn"
- send "%colored {THEPIT::MESSAGES::PREFIX}% &8&l● &7SetLeave"
- send "&3&l● &7&l------------------------------ &3&l●"
- stop
- else:
- stop
- on command:
- if {pit.%uuid of player%.state} is "ingame":
- if "%full command%" is "spawn":
- cancel event
- make player execute command "pit spawn"
- on quit:
- pit_leave(player)
- stop
- on pressure plate:
- if {pit.%uuid of player%.state} is "ingame":
- if {THEPIT::CONFIG::PRESSURE-PLATE} is "true":
- cancel event
- push the player upwards at speed 0.4
- push the player forwards at speed 1.2
- else:
- stop
- else:
- stop
- every second:
- loop all players:
- if {pit.%uuid of loop-player%.state} is "ingame":
- if stylish scoreboard "PIT-%loop-player%" does not exist:
- create new stylish scoreboard named "PIT-%loop-player%"
- loop 11 times:
- create a new id based score "PIT-%loop-player%Slot%loop-number%" with text "&%loop-number%" slot loop-number for stylish scoreboard "PIT-%loop-player%"
- set {_need} to {pit.%uuid of loop-player%.xp-need}-{pit.%uuid of loop-player%.xp}
- set stylish scoreboard of loop-player to "PIT-%loop-player%"
- set title of stylish scoreboard "PIT-%loop-player%" to "&e&lTHE PIT"
- set the text of id "PIT-%loop-player%Slot11" to "&7%now%"
- set the text of id "PIT-%loop-player%Slot10" to "&1&e"
- set the text of id "PIT-%loop-player%Slot9" to "&7Level &7[&e%{pit.%uuid of loop-player%.level}%&7]"
- set the text of id "PIT-%loop-player%Slot8" to "&7Needed XP: &b%{_need}%"
- set the text of id "PIT-%loop-player%Slot7" to "&2&9"
- set the text of id "PIT-%loop-player%Slot6" to "&7Gold: &6&l%{pit.%uuid of loop-player%.gold}%"
- set the text of id "PIT-%loop-player%Slot5" to "&3&9"
- set the text of id "PIT-%loop-player%Slot4" to "&7Status: %{pit.%uuid of loop-player%.status}%"
- set the text of id "PIT-%loop-player%Slot3" to "&7Streaks: &a%{pit.%uuid of loop-player%.streak}%"
- set the text of id "PIT-%loop-player%Slot2" to "&4&9"
- set the text of id "PIT-%loop-player%Slot1" to "%colored {THEPIT::SB::WEBSITE}%"
- else if {pit.%uuid of loop-player%.state} is "inevent":
- if stylish scoreboard "PIT-%loop-player%" does not exist:
- create new stylish scoreboard named "PIT-%loop-player%"
- loop 11 times:
- create a new id based score "PIT-%loop-player%Slot%loop-number%" with text "&%loop-number%" slot loop-number for stylish scoreboard "PIT-%loop-player%"
- set {_need} to {pit.%uuid of loop-player%.xp-need}-{pit.%uuid of loop-player%.xp}
- set stylish scoreboard of loop-player to "PIT-%loop-player%"
- set title of stylish scoreboard "PIT-%loop-player%" to "&e&lTHE PIT"
- set the text of id "PIT-%loop-player%Slot11" to "&7%now%"
- set the text of id "PIT-%loop-player%Slot10" to "&1&e"
- set the text of id "PIT-%loop-player%Slot9" to "&7Level &7[&e%{pit.%uuid of loop-player%.level}%&7]"
- set the text of id "PIT-%loop-player%Slot8" to "&7Needed XP: &b%{_need}%"
- set the text of id "PIT-%loop-player%Slot7" to "&2&9"
- set the text of id "PIT-%loop-player%Slot6" to "&7Gold: &6&l%{pit.%uuid of loop-player%.gold}%"
- set the text of id "PIT-%loop-player%Slot5" to "&3&9"
- set the text of id "PIT-%loop-player%Slot4" to "&7Status: &5Event %"
- set the text of id "PIT-%loop-player%Slot3" to "&7Made by: &aSukum_Decha"
- set the text of id "PIT-%loop-player%Slot2" to "&4&9"
- set the text of id "PIT-%loop-player%Slot1" to "%colored {THEPIT::SB::WEBSITE}%"
- on damage of player:
- if {pit.%uuid of victim%.state} is "ingame":
- if damage cause is fall:
- cancel event
- if damage cause is void:
- cancel event
- kill victim
- if "%damage cause%" is "projectile":
- if {pit.%uuid of attacker%.perk::slot-1} or {pit.%uuid of attacker%.perk::slot-2} is "ENDLESS-QUIVER":
- give 3 arrows to attacker
- if attacker is player:
- if attacker is not victim:
- wait 1 tick
- loop 20 times:
- set {_health.%loop-integer%.%victim%} to "&7❤"
- loop-integer is greater than max health of victim
- set {_health.%loop-integer%.%victim%} to ""
- loop rounded health of victim times:
- set {_health.%loop-integer%.%victim%} to "&4❤"
- set action bar of attacker to coloured "%{_health.1.%victim%}%%{_health.2.%victim%}%%{_health.3.%victim%}%%{_health.4.%victim%}%%{_health.5.%victim%}%%{_health.6.%victim%}%%{_health.7.%victim%}%%{_health.8.%victim%}%%{_health.9.%victim%}%%{_health.10.%victim%}%%{_health.11.%victim%}%%{_health.12.%victim%}%%{_health.13.%victim%}%%{_health.14.%victim%}%%{_health.15.%victim%}%%{_health.16.%victim%}%%{_health.17.%victim%}%%{_health.18.%victim%}%%{_health.19.%victim%}%%{_health.20.%victim%}%"
- set {_sec.%uuid of victim%} to 10
- set {_sec.%uuid of attacker%} to 10
- if {pit.%uuid of victim%.status} is "&aIdling":
- set {pit.%uuid of victim%.status} to "&cFighting"
- while {pit.%uuid of victim%.status} is "&cFighting":
- remove 1 from {_sec.%uuid of victim%}
- wait 1 seconds
- if {_sec.%uuid of victim%} is 0:
- set {pit.%uuid of victim%.status} to "&aIdling"
- if {pit.%uuid of attacker%.status} is "&aIdling":
- set {pit.%uuid of attacker%.status} to "&cFighting"
- while {pit.%uuid of attacker%.status} is "&cFighting":
- remove 1 from {_sec.%uuid of attacker%}
- wait 1 seconds
- if {_sec.%uuid of attacker%} is 0:
- set {pit.%uuid of attacker%.status} to "&aIdling"
- set {_dmg} to damage
- add rounded {_dmg} to {pit.%uuid of victim%.damage::%uuid of attacker%}
- if {pit.%uuid of victim%.damage::%uuid of attacker%} > 10:
- set metadata value "ASSIST" of victim to attacker
- delete {pit.%uuid of victim%.damage::%uuid of attacker%}
- while {_sec.assist.%uuid of victim%} > 1:
- remove 1 from {_sec.assist.%uuid of victim%}
- wait 1 seconds
- {_sec.assist.%uuid of victim%} = 1:
- delete metadata value "ASSIST" of victim
- else:
- stop
- function pit_give_gp(p: player):
- set {_uuid} to uuid of {_p}
- if {pit.%{_uuid}%.perk::slot-1} or {pit.%{_uuid}%.perk::slot-2} = "GOLDEN-HEADS":
- if number of head in {_p}'s inventory = 0 or 1:
- give skull of "StackedGold" parsed as offline player named "&6&lGolden Head" to {_p}
- else:
- if number of golden_apple in {_p}'s inventory = 0 or 1:
- give 1 golden_apple to {_p}
- on death of player:
- if {pit.%uuid of victim%.state} is "ingame":
- set death message to ""
- teleport victim to {pit.spawn}
- clear drops
- if metadata value "ASSIST" of victim is set:
- set {_G} to metadata value "ASSIST" of victim
- if {_G} is not attacker:
- set {_k} to {THEPIT::MESSAGES::ASSIST}
- set {_uuid} to uuid of {_G}
- replace all "[player]" in {_k} with "%victim%"
- replace all "[level]" in {_k} with "%{pit.%{_uuid}%.level}%"
- replace all "[gold]" in {_k} with "%{THEPIT::CONFIG::ASSIST-GOLD}%"
- replace all "[xp]" in {_k} with "%{THEPIT::CONFIG::ASSIST-XP}%"
- add {THEPIT::CONFIG::ASSIST-GOLD} to {pit.%{_uuid}%.gold}
- add {THEPIT::CONFIG::ASSIST-XP} to {pit.%{_uuid}%.xp}
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_k}%" to {_G}
- add 1 to {pit.%uuid of attacker%.streak}
- add {THEPIT::CONFIG::KILL-GOLD} to {pit.%uuid of attacker%.gold}
- add {THEPIT::CONFIG::KILL-XP} to {pit.%uuid of attacker%.xp}
- set {pit.%uuid of victim%.streak} to 0
- if {pit.%uuid of attacker%.streak} = 5 or 10 or 15 or 25 or 30 or 35 or 40 or 45 or 50:
- set {_x} to {THEPIT::MESSAGES::STREAK}
- replace all "[streak]" in {_x} with "%{pit.%uuid of attacker%.streak}%"
- replace all "[level]" in {_x} with "%{pit.%uuid of attacker%.level}%"
- replace all "[player]" in {_x} with "%attacker's displayname%"
- loop all players in attacker's world:
- if {pit.%uuid of loop-player%.state} is "ingame":
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to loop-player
- set {_x} to {THEPIT::MESSAGES::KILL}
- replace all "[level]" in {_x} with "%{pit.%uuid of victim%.level}%"
- replace all "[victim]" in {_x} with "%victim's displayname%"
- replace all "[gold]" in {_x} with "%{THEPIT::CONFIG::KILL-GOLD}%"
- replace all "[xp]" in {_x} with "%{THEPIT::CONFIG::KILL-XP}%"
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to attacker
- bw_play_sound(attacker, {THEPIT::CONFIG::KILL-SOUND})
- pit_give_gp(attacker)
- pit_check_level(attacker)
- send victim title "%colored {THEPIT::TITLES::DEATH-TITLE}%" with subtitle "%colored {THEPIT::TITLES::DEATH-SUBTITLE}%" for 1 seconds
- wait 0.2 seconds
- force victim to respawn
- wait 0.2 seconds
- teleport victim to {pit.spawn}
- pit_updatetag(victim)
- pit_equip(victim)
- set {pit.%uuid of victim%.status} to "&aIdling"
- set action bar of attacker to coloured "&7&l%victim% &a&lKILL"
- else:
- stop
- on right click with head:
- if {pit.%uuid of player%.state} is "ingame":
- if name of event-item is "&6&lGolden Head":
- if {pit.%uuid of player%.perk::slot-1} or {pit.%uuid of player%.perk::slot-2} = "GOLDEN-HEADS":
- cancel event
- remove regeneration from player
- remove absorption from player
- apply regeneration 2 to the player for 5 seconds
- apply absorption 1 to the player for 120 seconds
- remove event-item from player
- else:
- stop
- else:
- stop
- else:
- stop
- on right click on ender_chest:
- if {pit.%uuid of player%.state} is "ingame":
- if {pit.%uuid of player%.level} < {THEPIT::CONFIG::ENDER_CHEST-NEED-LEVEL}:
- cancel event
- set {_x} to {THEPIT::MESSAGES::ENDER_CHEST-NEED-LEVEL-MSG}
- replace all "[level]" in {_x} with "%{THEPIT::CONFIG::ENDER_CHEST-NEED-LEVEL}%"
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%"
- function pit_check_level(p: player):
- set {_uuid} to uuid of {_p}
- if {pit.%{_uuid}%.xp} >= {pit.%{_uuid}%.xp-need}:
- remove {pit.%{_uuid}%.xp-need} from {pit.%{_uuid}%.xp}
- set {_old} to {pit.%{_uuid}%.level}
- add 1 to {pit.%{_uuid}%.level}
- pit_updatetag({_p})
- set {_x} to {THEPIT::MESSAGES::LEVEL-UP}
- replace all "[level]" with "%{pit.%{_uuid}%.level}%" in {_x}
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to {_p}
- set {_x} to {THEPIT::TITLES::LEVEL-UP-TITLE}
- set {_y} to {THEPIT::TITLES::LEVEL-UP-SUBTITLE}
- replace all "[old]" with "%{_old}%" in {_x}
- replace all "[old]" with "%{_old}%" in {_y}
- replace all "[new]" with "%{pit.%{_uuid}%.level}%" in {_x}
- replace all "[new]" with "%{pit.%{_uuid}%.level}%" in {_y}
- send {_p} title "%colored {_x}%" with subtitle "%colored {_y}%" for 3 seconds
- bw_play_sound({_p}, {THEPIT::CONFIG::LEVE-UP-SOUND})
- set {_p}'s level to {pit.%{_uuid}%.level}
- if {pit.%{_uuid}%.level} > 1:
- set {pit.%{_uuid}%.xp-need} to 100*{pit.%{_uuid}%.level}
- stop
- else:
- add 100 to {pit.%{_uuid}%.xp-need}
- stop
- function bw_play_sound(p: player, sound: text):
- play sound "%{_sound}%" to {_p} with volume 100 and pitch 100
- function pit_perk_shop(p: player, slot: integer):
- set {_uuid} to uuid of {_p}
- open virtual chest inventory with size 3 named "Chose a Perk" to {_p}
- make a gui slot 10 of {_p} with gold block named "&cGolden Heads" with lore "||&7Golden apples you earn turn into &6Golden Heads||||&8&l- &7COST: &6&l500||" to run:
- if {pit.%{_uuid}%.perk::golden-heads} is not set:
- if {pit.%{_uuid}%.gold} >= 500:
- set {pit.%{_uuid}%.perk::golden-heads} to true
- set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "GOLDEN-HEADS"
- remove 500 from {pit.%{_uuid}%.gold}
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::PERK-PURCHASE}%"
- pit_upgrades_shop({_p})
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"
- stop
- else:
- set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "GOLDEN-HEADS"
- pit_upgrades_shop({_p})
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::SELECTED-PERK}%"
- stop
- make a gui slot 12 of {_p} with fishing rod named "&cFishing rod" with lore "||&7Spawn with a fishing rod||||&8&l- &7COST: &6&l1000||" to run:
- if {pit.%{_uuid}%.perk::fishing-rod} is not set:
- if {pit.%{_uuid}%.gold} >= 1000:
- set {pit.%{_uuid}%.perk::fishing-rod} to true
- set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "FISHING-ROD"
- remove 1000 from {pit.%{_uuid}%.gold}
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::PERK-PURCHASE}%"
- pit_upgrades_shop({_p})
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"
- stop
- else:
- set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "FISHING-ROD"
- pit_upgrades_shop({_p})
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::SELECTED-PERK}%"
- stop
- make a gui slot 14 of {_p} with lava bucket named "&cLava Bucket" with lore "||&7Spawn with a lava bucket||||&8&l- &7COST: &6&l1000||" to run:
- if {pit.%{_uuid}%.perk::lava-bucket} is not set:
- if {pit.%{_uuid}%.gold} >= 1000:
- set {pit.%{_uuid}%.perk::lava-bucket} to true
- set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "LAVA-BUCKET"
- remove 1000 from {pit.%{_uuid}%.gold}
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::PERK-PURCHASE}%"
- pit_upgrades_shop({_p})
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"
- stop
- else:
- set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "LAVA-BUCKET"
- pit_upgrades_shop({_p})
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::SELECTED-PERK}%"
- stop
- make a gui slot 16 of {_p} with bow named "&cEndless Quiver" with lore "||&7Get 3 arrows on arrow hit||||&8&l- &7COST: &6&l2000||" to run:
- if {pit.%{_uuid}%.perk::endless-quiver} is not set:
- if {pit.%{_uuid}%.gold} >= 2000:
- set {pit.%{_uuid}%.perk::endless-quiver} to true
- set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "ENDLESS-QUIVER"
- remove 2000 from {pit.%{_uuid}%.gold}
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::PERK-PURCHASE}%"
- pit_upgrades_shop({_p})
- stop
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"
- stop
- else:
- set {pit.%{_uuid}%.perk::slot-%{_slot}%} to "ENDLESS-QUIVER"
- pit_upgrades_shop({_p})
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::SELECTED-PERK}%"
- stop
- function pit_upgrades_shop(p: player):
- set {_uuid} to uuid of {_p}
- open virtual chest inventory with size 5 named "Permanent upgrades" to {_p}
- wait 1 ticks
- if {pit.%{_uuid}%.perk::slot-1} is not set:
- make a gui slot 12 of {_p} with diamond block named "&aPERK SLOT ##1" with lore "||&7Select a perk to fill this slot||||&eClick to chose perk!||" to run function pit_perk_shop({_p}, 1)
- if {pit.%{_uuid}%.perk::slot-2} is not set:
- make a gui slot 14 of {_p} with diamond block named "&aPERK SLOT ##2" with lore "||&7Select a perk to fill this slot||||&eClick to chose perk!||" to run function pit_perk_shop({_p}, 2)
- if {pit.%{_uuid}%.perk::slot-1} is set:
- if {pit.%{_uuid}%.perk::slot-1} = "GOLDEN-HEADS":
- make a gui slot 12 of {_p} with gold block named "&ePERK SLOT &3##1 &7- &6&lGOLDEN HEADS" to run function pit_perk_shop({_p}, 1)
- if {pit.%{_uuid}%.perk::slot-1} = "FISHING-ROD":
- make a gui slot 12 of {_p} with fishing rod named "&ePERK SLOT &3##1 &7- &9&lFISHING ROD" to run function pit_perk_shop({_p}, 1)
- if {pit.%{_uuid}%.perk::slot-1} = "LAVA-BUCKET":
- make a gui slot 12 of {_p} with lava bucket named "&ePERK SLOT &3##1 &7- &9&lLAVA BUCKET" to run function pit_perk_shop({_p}, 1)
- if {pit.%{_uuid}%.perk::slot-1} = "ENDLESS-QUIVER":
- make a gui slot 12 of {_p} with bow named "&ePERK SLOT &3##2 &7- &9&lENDLESS QUIVER" to run function pit_perk_shop({_p}, 1)
- if {pit.%{_uuid}%.perk::slot-2} is set:
- if {pit.%{_uuid}%.perk::slot-2} = "GOLDEN-HEADS":
- make a gui slot 14 of {_p} with gold block named "&ePERK SLOT &3##2 &7- &6&lGOLDEN HEADS" to run function pit_perk_shop({_p}, 2)
- if {pit.%{_uuid}%.perk::slot-2} = "FISHING-ROD":
- make a gui slot 14 of {_p} with fishing rod named "&ePERK SLOT &3##2 &7- &9&lFISHING ROD" to run function pit_perk_shop({_p}, 2)
- if {pit.%{_uuid}%.perk::slot-2} = "LAVA-BUCKET":
- make a gui slot 14 of {_p} with lava bucket named "&ePERK SLOT &3##2 &7- &9&lLAVA BUCKET" to run function pit_perk_shop({_p}, 2)
- if {pit.%{_uuid}%.perk::slot-2} = "ENDLESS-QUIVER":
- make a gui slot 14 of {_p} with bow named "&ePERK SLOT &3##2 &7- &9&lENDLESS QUIVER" to run function pit_perk_shop({_p}, 2)
- function pit_items_shop(p: player):
- open virtual chest inventory with size 3 named "Non-permanent items" to {_p}
- wait 1 ticks
- make a gui slot 10 of {_p} with diamond_sword named "&e&lDIAMOND SWORD" with lore "||&8&l- &7LOST ON DEATH||||&8&l- &7COST: &6&l100" to run:
- set {_uuid} to uuid of {_p}
- if {pit.%{_uuid}%.gold} >= 100:
- remove 100 from {pit.%{_uuid}%.gold}
- give 1 diamond_sword to {_p}
- set {_item} to "DIAMOND SWORD"
- set {_x} to {THEPIT::MESSAGES::ITEM-PURCHASE}
- replace all "[item]" with "%{_item}%" in {_x}
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to {_p}
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"
- make a gui slot 11 of {_p} with 8 obsidian named "&e&lOBSIDIAN" with lore "||&8&l- &7REMAINS FOR 120 SECONDS||||&8&l- &7LOST ON DEATH||||&8&l- &7COST: &6&l40" to run:
- set {_uuid} to uuid of {_p}
- if {pit.%{_uuid}%.gold} >= 40:
- remove 100 from {pit.%{_uuid}%.gold}
- give 8 obsidian to {_p}
- set {_item} to "OBSIDIAN"
- set {_x} to {THEPIT::MESSAGES::ITEM-PURCHASE}
- replace all "[item]" with "%{_item}%" in {_x}
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to {_p}
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"
- make a gui slot 15 of {_p} with diamond_chestplate named "&e&lDIAMOND CHESTPLATE" with lore "||&8&l- &7AUTO EQUIP ON BUY||||&8&l- &7LOST ON DEATH||||&8&l- &7COST: &6&l250" to run:
- set {_uuid} to uuid of {_p}
- if {pit.%{_uuid}%.gold} >= 250:
- remove 100 from {pit.%{_uuid}%.gold}
- set {_p}'s chestplate to diamond_chestplate
- set {_item} to "DIAMOND CHESTPLATE"
- set {_x} to {THEPIT::MESSAGES::ITEM-PURCHASE}
- replace all "[item]" with "%{_item}%" in {_x}
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to {_p}
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"
- make a gui slot 16 of {_p} with diamond_boots named "&e&lDIAMOND BOOTS" with lore "||&8&l- &7AUTO EQUIP ON BUY||||&8&l- &7LOST ON DEATH||||&8&l- &7COST: &6&l150" to run:
- set {_uuid} to uuid of {_p}
- if {pit.%{_uuid}%.gold} >= 150:
- remove 100 from {pit.%{_uuid}%.gold}
- set {_p}'s boots to diamond_boots
- set {_item} to "DIAMOND BOOTS"
- set {_x} to {THEPIT::MESSAGES::ITEM-PURCHASE}
- replace all "[item]" with "%{_item}%" in {_x}
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {_x}%" to {_p}
- else:
- send "%colored {THEPIT::MESSAGES::PREFIX}% %colored {THEPIT::MESSAGES::NO-GOLD}%"
- on plaece:
- if {pit.%uuid of player%.state} is "ingame":
- if event-block is obsidian:
- wait 120 seconds
- set event-block to air
- if event-block is lava:
- wait 2 seconds
- set event-block to air
- else:
- cancel event
- else:
- stop
- on block flow:
- if event-block is lava:
- loop {THEPIT::CONFIG::ENABLED-WORLDS::*}:
- if event-world is loop-value:
- cancel event
- on breeak:
- if {pit.%uuid of player%.state} is "ingame":
- cancel event
- else:
- stop
- on drop:
- if {pit.%uuid of player%.state} is "ingame":
- cancel event
- else:
- stop
- on hunger bar change:
- if {pit.%uuid of player%.state} is "ingame":
- cancel event
- set player's hunger to 20
- on right click on entity:
- if {pit.%uuid of player%.state} is "ingame":
- if citizen id of event-entity is {THEPIT::CONFIG::SHOP-ID}:
- pit_items_shop(player)
- if citizen id of event-entity is {THEPIT::CONFIG::UPGRADE-ID}:
- pit_upgrades_shop(player)
- else:
- stop
- function pit_updatetag(p: player):
- set {_uuid} to uuid of {_p}
- make console execute command "nte player %{_p}% prefix &7[&e%{pit.%{_uuid}%.level}%&7] &7"
- function pit_equip(p: player):
- set {_uuid} to uuid of {_p}
- set {_p}'s level to {pit.%{_uuid}%.level}
- set slot 0 of {_p} to unbreakable iron_sword
- set slot 1 of {_p} to unbreakable bow
- if {pit.%{_uuid}%.perk::slot-1} or {pit.%{_uuid}%.perk::slot-2} = "FISHING-ROD":
- set slot 2 of {_p} to unbreakable fishing rod
- if {pit.%{_uuid}%.perk::slot-2} or {pit.%{_uuid}%.perk::slot-1} = "LAVA-BUCKET":
- set slot 3 of {_p} to lava bucket
- set slot 8 of {_p} to 30 arrows
- wait 0.5 seconds
- set {_p}'s helmet to unbreakable chain_helmet
- set {_p}'s chestplate to unbreakable chain_chestplate
- set {_p}'s leggings to unbreakable iron_leggings
- set {_p}'s boots to unbreakable iron_boots
- on join:
- set join message to ""
- on quit:
- set quit message to ""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement