Files
exhausted.sk
MoneyEvents.sk
Code
2 659
MoneyEvents.sk
# MoneyEvents.sk
# Place in plugins/Skript/scripts/
# Reload with: /sk reload MoneyEvents
options:
exhausted-bossbar: moneysmp:exhausted
happyhour-bossbar: moneysmp:happyhour
leaves-bossbar: moneysmp:leaves
vulnerable-bossbar: moneysmp:vulnerable
on script load:
delete {exhausted.seconds}
delete {exhausted.minutes}
delete {exhausted.displayseconds}
delete {happyhour.seconds}
delete {happyhour.minutes}
delete {happyhour.displayseconds}
delete {leavedrops.seconds}
delete {leavedrops.minutes}
delete {leavedrops.displayseconds}
delete {vulnerable.seconds}
delete {vulnerable.minutes}
delete {vulnerable.displayseconds}
delete {protectvip.active}
loop all players:
remove slowness from loop-player
execute console command "effect clear %loop-player% minecraft:hero_of_the_village"
set max health of loop-player to 10
set health of loop-player to 10
execute console command "bossbar remove {@exhausted-bossbar}"
execute console command "bossbar remove {@happyhour-bossbar}"
execute console command "bossbar remove {@leaves-bossbar}"
execute console command "bossbar remove {@vulnerable-bossbar}"
command /moneyevent [<text>]:
permission: moneysmp.events
permission message: &cYou do not have permission to view the event commands.
trigger:
if arg-1 is not set:
set {_show-help} to true
else if arg-1 is "help":
set {_show-help} to true
if {_show-help} is true:
send "&8&m----------------------------------------" to player
send "&6&lMoney Events Commands" to player
send "&e/exhausted <start|stop> &7- Slowness event" to player
send "&e/happyhour <start|stop> &7- Hero of the Village and bonus gold drops" to player
send "&e/leavedrops <start|stop> &7- Oak leaf rewards for 1 hour" to player
send "&e/vulnerable <start|stop> &7- Reduce maximum health" to player
send "&e/protectvip <start|stop> &7- Protect VIP event" to player
send "&e/vip <set|remove|list> [player] &7- Manage VIP players" to player
send "&8&m----------------------------------------" to player
else:
send "&cUsage: /moneyevent help" to player
# EXHAUSTED EVENT
command /exhausted <text>:
permission: moneysmp.exhausted
permission message: &cYou do not have permission to use this command.
trigger:
if arg-1 is "start":
if {exhausted.seconds} is set:
send "&cExhausted is already active." to player
stop
set {exhausted.seconds} to 3600
set {exhausted.minutes} to 60
set {exhausted.displayseconds} to 0
execute console command "bossbar remove {@exhausted-bossbar}"
execute console command "bossbar add {@exhausted-bossbar} Exhausted - Time Remaining: 60m 00s"
execute console command "bossbar set {@exhausted-bossbar} color blue"
execute console command "bossbar set {@exhausted-bossbar} style progress"
execute console command "bossbar set {@exhausted-bossbar} max 3600"
execute console command "bossbar set {@exhausted-bossbar} value 3600"
execute console command "bossbar set {@exhausted-bossbar} players @a"
execute console command "bossbar set {@exhausted-bossbar} visible true"
loop all players:
apply slowness 1 to loop-player for 2 seconds
send "&d&lExhausted &fhas started for 1 hour." to all players
stop
if arg-1 is "stop":
if {exhausted.seconds} is not set:
send "&cExhausted is not active." to player
stop
delete {exhausted.seconds}
delete {exhausted.minutes}
delete {exhausted.displayseconds}
loop all players:
remove slowness from loop-player
execute console command "bossbar remove {@exhausted-bossbar}"
send "&d&lExhausted &fhas been stopped." to all players
stop
send "&cUsage: /exhausted <start|stop>" to player
# HAPPY HOUR EVENT
# Hero of the Village III is reapplied every second for three seconds.
# Gold ore has a chance to drop bonus golden apples or a gold block.
command /happyhour <text>:
permission: moneysmp.happyhour
permission message: &cYou do not have permission to use this command.
trigger:
if arg-1 is "start":
if {happyhour.seconds} is set:
send "&cHappy Hour is already active." to player
stop
set {happyhour.seconds} to 3600
set {happyhour.minutes} to 60
set {happyhour.displayseconds} to 0
execute console command "bossbar remove {@happyhour-bossbar}"
execute console command "bossbar add {@happyhour-bossbar} Happy Hour - Time Remaining: 60m 00s"
execute console command "bossbar set {@happyhour-bossbar} color green"
execute console command "bossbar set {@happyhour-bossbar} style progress"
execute console command "bossbar set {@happyhour-bossbar} max 3600"
execute console command "bossbar set {@happyhour-bossbar} value 3600"
execute console command "bossbar set {@happyhour-bossbar} players @a"
execute console command "bossbar set {@happyhour-bossbar} visible true"
loop all players:
apply hero of the village 2 to loop-player for 3 seconds
send "&a&lHappy Hour &fhas started for 1 hour." to all players
stop
if arg-1 is "stop":
if {happyhour.seconds} is not set:
send "&cHappy Hour is not active." to player
stop
delete {happyhour.seconds}
delete {happyhour.minutes}
delete {happyhour.displayseconds}
loop all players:
remove hero of the village from loop-player
execute console command "bossbar remove {@happyhour-bossbar}"
send "&c&lHappy Hour &fhas been stopped." to all players
stop
send "&cUsage: /happyhour <start|stop>" to player
on break of gold ore or deepslate gold ore:
if {happyhour.seconds} is not set:
stop
if {happyhour.seconds} <= 0:
stop
if player's tool is enchanted with silk touch:
stop
chance of 10%:
drop 5 golden apples at location of event-block
chance of 2%:
drop 1 gold block at location of event-block
# OAK LEAF DROPS EVENT
command /leavedrops <text>:
permission: moneysmp.leavedrops
permission message: &cYou do not have permission to use this command.
trigger:
if arg-1 is "start":
if {leavedrops.seconds} is set:
send "&cOak leaf drops are already active." to player
stop
set {leavedrops.seconds} to 3600
set {leavedrops.minutes} to 60
set {leavedrops.displayseconds} to 0
execute console command "bossbar remove {@leaves-bossbar}"
execute console command "bossbar add {@leaves-bossbar} Oak Leaf Drops - Time Remaining: 60m 00s"
execute console command "bossbar set {@leaves-bossbar} color yellow"
execute console command "bossbar set {@leaves-bossbar} style progress"
execute console command "bossbar set {@leaves-bossbar} max 3600"
execute console command "bossbar set {@leaves-bossbar} value 3600"
execute console command "bossbar set {@leaves-bossbar} players @a"
execute console command "bossbar set {@leaves-bossbar} visible true"