Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # +------------------------------------------------------+ #
- # | Version | #
- # +------------------------------------------------------+ #
- options:
- Version: 6.5
- # +------------------------------------------------------+ #
- # | Checks | #
- # +------------------------------------------------------+ #
- # Check for updates, create and fix config files on the script load and work as a fallback to disable the booster
- # if the server was offline when the booster gets expired
- on script enable:
- if yaml value "Updates.Update" from file "../../Booster/Config.yml" is not set:
- set yaml value "Updates.Update" from file "../../Booster/Config.yml" to "true"
- if yaml value "Updates.Version" from file "../../Booster/Config.yml" is not set:
- set yaml value "Updates.Version" from file "../../Booster/Config.yml" to "{@Version}"
- if yaml value "Updates.Version" from file "../../Booster/Config.yml" is not "{@Version}":
- set yaml value "Updates.Version" from file "../../Booster/Config.yml" to "{@Version}"
- if yaml value "Commands.Alias.Booster" from file "../../Booster/Config.yml" is not set:
- set yaml value "Commands.Alias.Booster" from file "../../Booster/Config.yml" to "mcMMoBooster"
- if yaml value "Commands.Alias.Thanks" from file "../../Booster/Config.yml" is not set:
- set yaml value "Commands.Alias.Thanks" from file "../../Booster/Config.yml" to "tip"
- if yaml value "Reload.Name" from file "../../Booster/Config.yml" is not set:
- set yaml value "Reload.Name" from file "../../Booster/Config.yml" to "Booster"
- if yaml value "Time.BoosterTime" from file "../../Booster/Config.yml" is not set:
- set yaml value "Time.BoosterTime" from file "../../Booster/Config.yml" to "1 hour"
- if yaml value "Time.ThanksCooldown" from file "../../Booster/Config.yml" is not set:
- set yaml value "Time.ThanksCooldown" from file "../../Booster/Config.yml" to "30 minutes"
- if yaml value "Permissions.Booster" from file "../../Booster/Config.yml" is not set:
- set yaml value "Permissions.Booster" from file "../../Booster/Config.yml" to "booster.booster"
- if yaml value "Permissions.Give" from file "../../Booster/Config.yml" is not set:
- set yaml value "Permissions.Give" from file "../../Booster/Config.yml" to "booster.give"
- if yaml value "Permissions.Cancel" from file "../../Booster/Config.yml" is not set:
- set yaml value "Permissions.Cancel" from file "../../Booster/Config.yml" to "booster.cancel"
- if yaml value "Permissions.Help" from file "../../Booster/Config.yml" is not set:
- set yaml value "Permissions.Help" from file "../../Booster/Config.yml" to "booster.help"
- if yaml value "Permissions.Reload" from file "../../Booster/Config.yml" is not set:
- set yaml value "Permissions.Reload" from file "../../Booster/Config.yml" to "booster.reload"
- if yaml value "Permissions.Version" from file "../../Booster/Config.yml" is not set:
- set yaml value "Permissions.Version" from file "../../Booster/Config.yml" to "booster.version"
- if yaml value "Permissions.Status" from file "../../Booster/Config.yml" is not set:
- set yaml value "Permissions.Status" from file "../../Booster/Config.yml" to "booster.status"
- if yaml value "Permissions.Thanks" from file "../../Booster/Config.yml" is not set:
- set yaml value "Permissions.Thanks" from file "../../Booster/Config.yml" to "booster.thanks"
- if yaml value "Permissions.Announce" from file "../../Booster/Config.yml" is not set:
- set yaml value "Permissions.Announce" from file "../../Booster/Config.yml" to "booster.announce"
- if yaml value "Permissions.Use" from file "../../Booster/Config.yml" is not set:
- set yaml value "Permissions.Use" from file "../../Booster/Config.yml" to "booster.use"
- if yaml value "Permissions.Update" from file "../../Booster/Config.yml" is not set:
- set yaml value "Permissions.Update" from file "../../Booster/Config.yml" to "booster.update"
- if yaml value "Booster.ItemID" from file "../../Booster/Config.yml" is not set:
- set yaml value "Booster.ItemID" from file "../../Booster/Config.yml" to "373:0"
- if yaml value "Booster.Name" from file "../../Booster/Config.yml" is not set:
- set yaml value "Booster.Name" from file "../../Booster/Config.yml" to "&4mcMMO Booster"
- if yaml value "Booster.Lore" from file "../../Booster/Config.yml" is not set:
- set yaml value "Booster.Lore" from file "../../Booster/Config.yml" to "&6Quad experience (60:0)||&f&k>> &dRight-click to activate &f&k<<"
- if yaml list "Activation.Activate" from file "../../Booster/Config.yml" is not set:
- add "/pex group default add mcmmo.perks.xp.quadruple" to yaml list "Activation.Activate" from file "../../Booster/Config.yml"
- add "/pex reload" to yaml list "Activation.Activate" from file "../../Booster/Config.yml"
- if yaml list "Activation.Deactivate" from file "../../Booster/Config.yml" is not set:
- add "/pex group default remove mcmmo.perks.xp.quadruple" to yaml list "Activation.Deactivate" from file "../../Booster/Config.yml"
- add "/pex reload" to yaml list "Activation.Deactivate" from file "../../Booster/Config.yml"
- if yaml list "Reward.Commands" from file "../../Booster/Config.yml" is not set:
- add "/eco give {Player} 100" to yaml list "Reward.Commands" from file "../../Booster/Config.yml"
- add "/tell {Player2} You thanked {Player}, and received a reward!" to yaml list "Reward.Commands" from file "../../Booster/Config.yml"
- add "/eco give {Player2} 10" to yaml list "Reward.Commands" from file "../../Booster/Config.yml"
- add "/tell {Player} {Player2} has thanked you, and you have received a reward!" to yaml list "Reward.Commands" from file "../../Booster/Config.yml"
- if yaml value "BoosterActivated" from file "../../Booster/Messages.yml" is not set:
- set yaml value "BoosterActivated" from file "../../Booster/Messages.yml" to "§a§l{Player} §6§lhas activated their mcMMO quad experience booster for 1 hour, type /thanks to thank them!"
- if yaml value "BoosterExpired" from file "../../Booster/Messages.yml" is not set:
- set yaml value "BoosterExpired" from file "../../Booster/Messages.yml" to "§a§l{Player}'s §4§lmcMMO quad experience booster has expired!"
- if yaml value "NoPermCommand" from file "../../Booster/Messages.yml" is not set:
- set yaml value "NoPermCommand" from file "../../Booster/Messages.yml" to "§4Error:§c You do not have permission to use this command!"
- if yaml value "NoPermBooster" from file "../../Booster/Messages.yml" is not set:
- set yaml value "NoPermBooster" from file "../../Booster/Messages.yml" to "§4Error:§c You do not have a permission to use a booster!"
- if yaml value "InvalidArgument" from file "../../Booster/Messages.yml" is not set:
- set yaml value "InvalidArgument" from file "../../Booster/Messages.yml" to "§4Error:§c Invalid argument!"
- if yaml value "GameMode" from file "../../Booster/Messages.yml" is not set:
- set yaml value "GameMode" from file "../../Booster/Messages.yml" to "§4You can not use a booster in this gamemode."
- if yaml value "Activate" from file "../../Booster/Messages.yml" is not set:
- set yaml value "Activate" from file "../../Booster/Messages.yml" to "§aYou have activated mcMMO quad experience booster for 1 hour!"
- if yaml value "ErrorActivated" from file "../../Booster/Messages.yml" is not set:
- set yaml value "ErrorActivated" from file "../../Booster/Messages.yml" to "§4You can not activate mcMMO quad experience booster, because there is an active booster!"
- if yaml value "ErrorCooldown" from file "../../Booster/Messages.yml" is not set:
- set yaml value "ErrorCooldown" from file "../../Booster/Messages.yml" to "§4You can use this command once every 30 minutes!"
- if yaml value "NoActiveBooster" from file "../../Booster/Messages.yml" is not set:
- set yaml value "NoActiveBooster" from file "../../Booster/Messages.yml" to "§4There is no active booster!"
- if yaml value "BoosterReceived" from file "../../Booster/Messages.yml" is not set:
- set yaml value "BoosterReceived" from file "../../Booster/Messages.yml" to "§aYou have received a booster!"
- if yaml value "BoosterSent" from file "../../Booster/Messages.yml" is not set:
- set yaml value "BoosterSent" from file "../../Booster/Messages.yml" to "§aYou have sent a booster to {Player}!"
- if yaml value "SelfThanks" from file "../../Booster/Messages.yml" is not set:
- set yaml value "SelfThanks" from file "../../Booster/Messages.yml" to "§4Sorry, you can not thank yourself!"
- if yaml value "ConsoleThanks" from file "../../Booster/Messages.yml" is not set:
- set yaml value "ConsoleThanks" from file "../../Booster/Messages.yml" to "§4Sorry, this command is only executable by players!"
- if yaml value "JoinActive" from file "../../Booster/Messages.yml" is not set:
- set yaml value "JoinActive" from file "../../Booster/Messages.yml" to "§a§l{Player} §6§lhas an active mcMMO quad experience booster, do /thanks to thank them!"
- if yaml value "CancelMSG" from file "../../Booster/Messages.yml" is not set:
- set yaml value "CancelMSG" from file "../../Booster/Messages.yml" to "§aYou have successfully canceled the current booster!"
- if yaml value "CurrentBooster" from file "../../Booster/Messages.yml" is not set:
- set yaml value "CurrentBooster" from file "../../Booster/Messages.yml" to "§aThere is an active booster!"
- if yaml value "CancelAnnounce" from file "../../Booster/Messages.yml" is not set:
- set yaml value "CancelAnnounce" from file "../../Booster/Messages.yml" to "§a§l{Player}'s §4§lmcMMO quad experience booster has been canceled by §a§l{Player2}§4§l!"
- if yaml value "BoosterActivateNotOnlineMSG" from file "../../Booster/Messages.yml" is not set:
- set yaml value "BoosterActivateNotOnlineMSG" from file "../../Booster/Messages.yml" to "§4Error:§c This player is not online."
- if yaml value "BoosterMSG" from file "../../Booster/Messages.yml" is not set:
- set yaml value "BoosterMSG" from file "../../Booster/Messages.yml" to "§6Do ""/booster help"" For help."
- if yaml value "BoosterGiveUsage" from file "../../Booster/Messages.yml" is not set:
- set yaml value "BoosterGiveUsage" from file "../../Booster/Messages.yml" to "§4Usage:§c /booster give <player>"
- if yaml value "BoosterStatusUsage" from file "../../Booster/Messages.yml" is not set:
- set yaml value "BoosterStatusUsage" from file "../../Booster/Messages.yml" to "§4Usage:§c /booster status"
- if yaml value "BoosterCancelUsage" from file "../../Booster/Messages.yml" is not set:
- set yaml value "BoosterCancelUsage" from file "../../Booster/Messages.yml" to "§4Usage:§c /booster cancel"
- if yaml value "BoosterVersionUsage" from file "../../Booster/Messages.yml" is not set:
- set yaml value "BoosterVersionUsage" from file "../../Booster/Messages.yml" to "§4Usage:§c /booster version"
- if yaml value "Version" from file "../../Booster/Messages.yml" is not set:
- set yaml value "Version" from file "../../Booster/Messages.yml" to "&amcMMO Booster version {Version} created by CodeRida."
- if yaml list "Help" from file "../../Booster/Messages.yml" is not set:
- add "&6&m------------------ &4mcMMO Booster help&6&m -----------------" to yaml list "Help" from file "../../Booster/Messages.yml"
- add "&f/booster help&7:&6 Print this help message." to yaml list "Help" from file "../../Booster/Messages.yml"
- add "&f/booster give <player>&7:&6 Give a booster to the player." to yaml list "Help" from file "../../Booster/Messages.yml"
- add "&f/booster cancel&7:&6 Cancel the active booster." to yaml list "Help" from file "../../Booster/Messages.yml"
- add "&f/booster reload&7:&6 Reload the booster script." to yaml list "Help" from file "../../Booster/Messages.yml"
- add "&f/booster version&7:&6 Check which version of mcMMO Booster you have." to yaml list "Help" from file "../../Booster/Messages.yml"
- add "&f/booster status&7:&6 Check if there is an active booster or not." to yaml list "Help" from file "../../Booster/Messages.yml"
- add "&f/booster activate <player>&7:&6 Activate a booster for a player" to yaml list "Help" from file "../../Booster/Messages.yml"
- add "&f/thanks&7:&6 Thank the person that has an active booster and receive a reward." to yaml list "Help" from file "../../Booster/Messages.yml"
- add "&6&m-----------------------------------------------------" to yaml list "Help" from file "../../Booster/Messages.yml"
- set {BoosterUpdateStatus} to yaml value "Updates.Update" from file "../../Booster/Config.yml"
- set {BoosterUpdateVersion} to yaml value "Updates.Version" from file "../../Booster/Config.yml"
- set {BoosterBoosterCommandAlias} to yaml value "Commands.Alias.Booster" from file "../../Booster/Config.yml"
- set {BoosterThanksCommandAlias} to yaml value "Commands.Alias.Thanks" from file "../../Booster/Config.yml"
- set {BoosterReloadName} to yaml value "Reload.Name" from file "../../Booster/Config.yml"
- set {BoosterBoosterTime} to yaml value "Time.BoosterTime" from file "../../Booster/Config.yml"
- set {BoosterThanksCooldown} to yaml value "Time.ThanksCooldown" from file "../../Booster/Config.yml"
- set {BoosterUsePerm} to yaml value "Permissions.Use" from file "../../Booster/Config.yml"
- set {BoosterBoosterMainCommand} to yaml value "Permissions.Booster" from file "../../Booster/Config.yml"
- set {BoosterGivePerm} to yaml value "Permissions.Give" from file "../../Booster/Config.yml"
- set {BoosterCancelPerm} to yaml value "Permissions.Cancel" from file "../../Booster/Config.yml"
- set {BoosterHelpPerm} to yaml value "Permissions.Help" from file "../../Booster/Config.yml"
- set {BoosterReloadPerm} to yaml value "Permissions.Reload" from file "../../Booster/Config.yml"
- set {BoosterStatusPerm} to yaml value "Permissions.Status" from file "../../Booster/Config.yml"
- set {BoosterVersionPerm} to yaml value "Permissions.Version" from file "../../Booster/Config.yml"
- set {BoosterActivatePerm} to yaml value "Permissions.Activate" from file "../../Booster/Config.yml"
- set {BoosterThanksPerm} to yaml value "Permissions.Thanks" from file "../../Booster/Config.yml"
- set {BoosterAnnouncePerm} to yaml value "Permissions.Announce" from file "../../Booster/Config.yml"
- set {BoosterUpdatePerm} to yaml value "Permissions.Update" from file "../../Booster/Config.yml"
- set {BoosterItemID} to yaml value "Booster.ItemID" from file "../../Booster/Config.yml"
- set {BoosterName} to yaml value "Booster.Name" from file "../../Booster/Config.yml"
- set {BoosterLore} to yaml value "Booster.Lore" from file "../../Booster/Config.yml"
- set {BoosterActivation::*} to yaml list "Activation.Activate" from file "../../Booster/Config.yml"
- set {BoosterDeactivation::*} to yaml list "Activation.Deactivate" from file "../../Booster/Config.yml"
- set {BoosterRewards::*} to yaml list "Reward.Commands" from file "../../Booster/Config.yml"
- set {BoosterActivated} to yaml value "BoosterActivated" from file "../../Booster/Messages.yml"
- set {BoosterExpired} to yaml value "BoosterExpired" from file "../../Booster/Messages.yml"
- set {BoosterNoPermCommand} to yaml value "NoPermCommand" from file "../../Booster/Messages.yml"
- set {NoPermBooster} to yaml value "NoPermBooster" from file "../../Booster/Messages.yml"
- set {BoosterInvalidArgument} to yaml value "InvalidArgument" from file "../../Booster/Messages.yml"
- set {BoosterNoGameMode} to yaml value "GameMode" from file "../../Booster/Messages.yml"
- set {BoosterActivate} to yaml value "Activate" from file "../../Booster/Messages.yml"
- set {BoosterErrorActivated} to yaml value "ErrorActivated" from file "../../Booster/Messages.yml"
- set {BoosterErrorCooldown} to yaml value "ErrorCooldown" from file "../../Booster/Messages.yml"
- set {NoActiveBooster} to yaml value "NoActiveBooster" from file "../../Booster/Messages.yml"
- set {BoosterReceived} to yaml value "BoosterReceived" from file "../../Booster/Messages.yml"
- set {BoosterSent} to yaml value "BoosterSent" from file "../../Booster/Messages.yml"
- set {BoosterSelfThanks} to yaml value "SelfThanks" from file "../../Booster/Messages.yml"
- set {BoosterConsoleThanks} to yaml value "ConsoleThanks" from file "../../Booster/Messages.yml"
- set {BoosterJoinActive} to yaml value "JoinActive" from file "../../Booster/Messages.yml"
- set {BoosterCancelMSG} to yaml value "CancelMSG" from file "../../Booster/Messages.yml"
- set {CurrentBooster} to yaml value "CurrentBooster" from file "../../Booster/Messages.yml"
- set {BoosterCancelAnnounce} to yaml value "CancelAnnounce" from file "../../Booster/Messages.yml"
- set {BoosterActivateNotOnlineMSG} to yaml value "BoosterActivateNotOnlineMSG" from file "../../Booster/Messages.yml"
- set {BoosterMSG} to yaml value "BoosterMSG" from file "../../Booster/Messages.yml"
- set {BoosterGiveUsage} to yaml value "BoosterGiveUsage" from file "../../Booster/Messages.yml"
- set {BoosterStatusUsage} to yaml value "BoosterStatusUsage" from file "../../Booster/Messages.yml"
- set {BoosterCancelUsage} to yaml value "BoosterCancelUsage" from file "../../Booster/Messages.yml"
- set {BoosterActivateUsage} to yaml value "BoosterActivateUsage" from file "../../Booster/Messages.yml"
- set {BoosterVersionUsage} to yaml value "BoosterVersionUsage" from file "../../Booster/Messages.yml"
- set {BoosterVersionMessage} to yaml value "Version" from file "../../Booster/Messages.yml"
- set {BoosterHelpMessages::*} to yaml list "Help" from file "../../Booster/Messages.yml"
- set {BoosterName} to colored {BoosterName}
- set {BoosterLore} to colored {BoosterLore}
- set {BoosterActivated} to colored {BoosterActivated}
- set {BoosterExpired} to colored {BoosterExpired}
- set {BoosterNoPermCommand} to colored {BoosterNoPermCommand}
- set {NoPermBooster} to colored {NoPermBooster}
- set {BoosterInvalidArgument} to colored {BoosterInvalidArgument}
- set {BoosterNoGameMode} to colored {BoosterNoGameMode}
- set {BoosterActivate} to colored {BoosterActivate}
- set {BoosterErrorActivated} to colored {BoosterErrorActivated}
- set {BoosterErrorCooldown} to colored {BoosterErrorCooldown}
- set {NoActiveBooster} to colored {NoActiveBooster}
- set {BoosterReceived} to colored {BoosterReceived}
- set {BoosterSent} to colored {BoosterSent}
- set {BoosterSelfThanks} to colored {BoosterSelfThanks}
- set {BoosterConsoleThanks} to colored {BoosterConsoleThanks}
- set {BoosterJoinActive} to colored {BoosterJoinActive}
- set {BoosterCancelMSG} to colored {BoosterCancelMSG}
- set {CurrentBooster} to colored {CurrentBooster}
- set {BoosterActivateNotOnlineMSG} to colored {BoosterActivateNotOnlineMSG}
- set {BoosterMSG} to colored {BoosterMSG}
- set {BoosterGiveUsage} to colored {BoosterGiveUsage}
- set {BoosterStatusUsage} to colored {BoosterStatusUsage}
- set {BoosterCancelUsage} to colored {BoosterCancelUsage}
- set {BoosterActivateUsage} to colored {BoosterActivateUsage}
- set {BoosterVersionUsage} to colored {BoosterVersionUsage}
- set {BoosterVersion} to colored {BoosterVersion}
- set {BoosterHelpMessages::*} to colored {BoosterHelpMessages::*}
- set {BoosterVersion} to colored {BoosterVersion}
- set {BoosterItemID} to {BoosterItemID} parsed as item type
- set {BoosterVersionMessage} to colored {BoosterVersionMessage}
- set {BoosterThanksCooldown} to {BoosterThanksCooldown} parsed as timespan
- set {BoosterBoosterTime} to {BoosterBoosterTime} parsed as timespan
- message "&a[mcMMoBooster] Loading mcMMO Booster %{BoosterUpdateVersion}%" to console
- message "&a[mcMMoBooster] Enabling mcMMO Booster %{BoosterUpdateVersion}%" to console
- message "&a[mcMMoBooster] mcMMO Booster %{BoosterUpdateVersion}% by CodeRida has been enabled" to console
- if {BoosterUpdateStatus} is "true":
- if text from "http://pastebin.com/raw/WTqrzKNV" is not "%{BoosterUpdateVersion}%":
- set {Booster::Version::Outdated} to true
- message "&a[mcMMoBooster] mcMMO booster has an update on" to console
- message "&a[mcMMoBooster] https://www.spigotmc.org/resources/16603/" to console
- else:
- message "&a[mcMMoBooster] You are running the latest version of mcMMO Booster" to console
- delete {Booster::Version::Outdated}
- if {Booster::Active::Status} is true:
- if difference between {Booster::Active::Time} and now is more than {BoosterBoosterTime}:
- if {BoosterDeactivation::1} is set:
- execute console command "%{BoosterDeactivation::1}%"
- if {BoosterDeactivation::2} is set:
- execute console command "%{BoosterDeactivation::2}%"
- if {BoosterDeactivation::3} is set:
- execute console command "%{BoosterDeactivation::3}%"
- if {BoosterDeactivation::4} is set:
- execute console command "%{BoosterDeactivation::4}%"
- if {BoosterDeactivation::5} is set:
- execute console command "%{BoosterDeactivation::5}%"
- if {BoosterDeactivation::6} is set:
- execute console command "%{BoosterDeactivation::6}%"
- if {BoosterDeactivation::7} is set:
- execute console command "%{BoosterDeactivation::7}%"
- if {BoosterDeactivation::8} is set:
- execute console command "%{BoosterDeactivation::8}%"
- if {BoosterDeactivation::9} is set:
- execute console command "%{BoosterDeactivation::9}%"
- if {BoosterDeactivation::10} is set:
- execute console command "%{BoosterDeactivation::10}%"
- loop all players:
- loop-player has the permission "%{BoosterAnnouncePerm}%":
- message "%{BoosterExpired}%" to loop-player
- delete {Booster::Owner::SelfThanks::%{Booster::Owner::Name}%}
- delete {Booster::Owner::Name}
- delete {Booster::Owner::DisplayName}
- delete {Booster::Cooldown::Thanks::*}
- delete {Booster::Active::Time}
- delete {Booster::Active::Status}
- else:
- stop
- else:
- stop
- # +------------------------------------------------------+ #
- # | Booster Item | #
- # +------------------------------------------------------+ #
- # Check for updates peridicly and disable the booster when its expired
- every 1 second:
- if {Booster::Active::Status} is true:
- if difference between {Booster::Active::Time} and now is more than {BoosterBoosterTime}:
- loop all players:
- loop-player has the permission "%{BoosterAnnouncePerm}%":
- replace all "{Player}" with "%{Booster::Owner::Name}%" in {BoosterExpired}
- replace all "{PlayerDisplayName}" with "%{Booster::Owner::DisplayName}%" in {BoosterExpired}
- message "%{BoosterExpired}%" to loop-player
- if {BoosterDeactivation::1} is set:
- execute console command "%{BoosterDeactivation::1}%"
- if {BoosterDeactivation::2} is set:
- execute console command "%{BoosterDeactivation::2}%"
- if {BoosterDeactivation::3} is set:
- execute console command "%{BoosterDeactivation::3}%"
- if {BoosterDeactivation::4} is set:
- execute console command "%{BoosterDeactivation::4}%"
- if {BoosterDeactivation::5} is set:
- execute console command "%{BoosterDeactivation::5}%"
- if {BoosterDeactivation::6} is set:
- execute console command "%{BoosterDeactivation::6}%"
- if {BoosterDeactivation::7} is set:
- execute console command "%{BoosterDeactivation::7}%"
- if {BoosterDeactivation::8} is set:
- execute console command "%{BoosterDeactivation::8}%"
- if {BoosterDeactivation::9} is set:
- execute console command "%{BoosterDeactivation::9}%"
- if {BoosterDeactivation::10} is set:
- execute console command "%{BoosterDeactivation::10}%"
- delete {Booster::Owner::SelfThanks::%{Booster::Owner::Name}%}
- delete {Booster::Owner::Name}
- delete {Booster::Owner::DisplayName}
- delete {Booster::Cooldown::Thanks::*}
- delete {Booster::Active::Time}
- delete {Booster::Active::Status}
- else:
- stop
- if {BoosterUpdateStatus} is "true":
- if text from "http://pastebin.com/raw/WTqrzKNV" is not "%{BoosterUpdateVersion}%":
- set {Booster::Version::Outdated} to true
- else:
- delete {Booster::Version::Outdated}
- stop
- else:
- stop
- # Work as a fallback to disable the booster if the server crash
- on script disable:
- message "&4[mcMMoBooster] Disabling mcMMO Booster %{BoosterUpdateVersion}%" to console
- message "&4[mcMMoBooster] mcMMO Booster %{BoosterUpdateVersion}% is now disabled" to console
- delete {BoosterUpdateStatus}
- delete {BoosterUpdateVersion}
- delete {BoosterBoosterCommandAlias}
- delete {BoosterThanksCommandAlias}
- delete {BoosterReloadName}
- delete {BoosterBoosterTime}
- delete {BoosterThanksCooldown}
- delete {BoosterUsePerm}
- delete {BoosterBoosterMainCommand}
- delete {BoosterGivePerm}
- delete {BoosterCancelPerm}
- delete {BoosterHelpPerm}
- delete {BoosterReloadPerm}
- delete {BoosterStatusPerm}
- delete {BoosterVersionPerm}
- delete {BoosterActivatePerm}
- delete {BoosterThanksPerm}
- delete {BoosterAnnouncePerm}
- delete {BoosterUpdatePerm}
- delete {BoosterItemID}
- delete {BoosterName}
- delete {BoosterLore}
- delete {BoosterActivation::*}
- delete {BoosterDeactivation::*}
- delete {BoosterRewards::*}
- delete {BoosterActivated}
- delete {BoosterExpired}
- delete {BoosterNoPermCommand}
- delete {NoPermBooster}
- delete {BoosterInvalidArgument}
- delete {BoosterNoGameMode}
- delete {BoosterActivate}
- delete {BoosterErrorActivated}
- delete {BoosterErrorCooldown}
- delete {NoActiveBooster}
- delete {BoosterReceived}
- delete {BoosterSent}
- delete {BoosterSelfThanks}
- delete {BoosterConsoleThanks}
- delete {BoosterJoinActive}
- delete {BoosterCancelMSG}
- delete {CurrentBooster}
- delete {BoosterCancelAnnounce}
- delete {BoosterActivateNotOnlineMSG}
- delete {BoosterMSG}
- delete {BoosterGiveUsage}
- delete {BoosterStatusUsage}
- delete {BoosterCancelUsage}
- delete {BoosterActivateUsage}
- delete {BoosterVersionUsage}
- delete {BoosterHelpMessages::*}
- delete {BoosterVersion}
- if {Booster::Active::Status} is true:
- if {BoosterDeactivation::1} is set:
- execute console command "%{BoosterDeactivation::1}%"
- if {BoosterDeactivation::2} is set:
- execute console command "%{BoosterDeactivation::2}%"
- if {BoosterDeactivation::3} is set:
- execute console command "%{BoosterDeactivation::3}%"
- if {BoosterDeactivation::4} is set:
- execute console command "%{BoosterDeactivation::4}%"
- if {BoosterDeactivation::5} is set:
- execute console command "%{BoosterDeactivation::5}%"
- if {BoosterDeactivation::6} is set:
- execute console command "%{BoosterDeactivation::6}%"
- if {BoosterDeactivation::7} is set:
- execute console command "%{BoosterDeactivation::7}%"
- if {BoosterDeactivation::8} is set:
- execute console command "%{BoosterDeactivation::8}%"
- if {BoosterDeactivation::9} is set:
- execute console command "%{BoosterDeactivation::9}%"
- if {BoosterDeactivation::10} is set:
- execute console command "%{BoosterDeactivation::10}%"
- if difference between {Booster::Active::Time} and now is more than {BoosterBoosterTime}:
- loop all players:
- loop-player has the permission "%{BoosterAnnouncePerm}%":
- message "%{BoosterExpired}%" to loop-player
- delete {Booster::Owner::SelfThanks::%{Booster::Owner::Name}%}
- delete {Booster::Owner::Name}
- delete {Booster::Owner::DisplayName}
- delete {Booster::Cooldown::Thanks::*}
- delete {Booster::Active::Time}
- delete {Booster::Active::Status}
- delete {Booster::Version::Outdated}
- else:
- stop
- else:
- delete {Booster::*}
- stop
- # +------------------------------------------------------+ #
- # | Join Event | #
- # +------------------------------------------------------+ #
- # Annouce if there is an active booster to the player having the right permission on join
- # And announce if there is an update to the server admins
- on join:
- if {Booster::Active::Status} is true:
- if player has permission "%{BoosterAnnouncePerm}%":
- replace all "{Player}" with "{Booster::Owner::Name}" in {BoosterJoinActive}
- replace all "{PlayerDisplayName}" with "{Booster::Owner::DisplayName}" in {BoosterJoinActive}
- message "%{BoosterJoinActive}%"
- if {BoosterUpdateStatus} is "true":
- if {Booster::Version::Outdated} is true:
- player has permission "%{BoosterUpdatePerm}%"
- message "&a[mcMMoBooster] mcMMO booster has an update on" to player
- message "&a[mcMMoBooster] https://www.spigotmc.org/resources/16603/" to player
- # +------------------------------------------------------+ #
- # | Commands | #
- # +------------------------------------------------------+ #
- # The command /thanks which is used to award the player that has activated the booster
- # and the player that have executed the thanks command
- command /thanks:
- description: thank the booster activator.
- usage: /thanks
- trigger:
- if player does not have permission "%{BoosterThanksPerm}%":
- message "%{BoosterNoPermCommand}%"
- stop
- if {Booster::Active::Status} is true:
- if sender is a player:
- set {_Sender} to sender's name
- set {_SenderDName} to sender's display name
- if {Booster::Owner::SelfThanks::%player%} is not set:
- if {Booster::Cooldown::Thanks::%player%} is not set:
- if {BoosterRewards::1} is set:
- replace all "{Player}" with "%{Booster::Owner::Name}%" in {BoosterRewards::1}
- replace all "{PlayerDisplayName}" with "%{Booster::Owner::DisplayName}%" in {BoosterRewards::1}
- replace all "{Player2}" with "%player%" in {BoosterRewards::1}
- replace all "{PlayerDisplayName2}" with "%player's displayname%" in {BoosterRewards::1}
- execute console command "%{BoosterRewards::1}%"
- if {BoosterRewards::2} is set:
- replace all "{Player}" with "%{Booster::Owner::Name}%" in {BoosterRewards::2}
- replace all "{PlayerDisplayName}" with "%{Booster::Owner::DisplayName}%" in {BoosterRewards::2}
- replace all "{Player2}" with "%player%" in {BoosterRewards::2}
- replace all "{PlayerDisplayName2}" with "%player's displayname%" in {BoosterRewards::2}
- execute console command "%{BoosterRewards::2}%"
- if {BoosterRewards::3} is set:
- replace all "{Player}" with "%{Booster::Owner::Name}%" in {BoosterRewards::3}
- replace all "{PlayerDisplayName}" with "%{Booster::Owner::DisplayName}%" in {BoosterRewards::3}
- replace all "{Player2}" with "%player%" in {BoosterRewards::3}
- replace all "{PlayerDisplayName2}" with "%player's displayname%" in {BoosterRewards::3}
- execute console command "%{BoosterRewards::3}%"
- if {BoosterRewards::4} is set:
- replace all "{Player}" with "%{Booster::Owner::Name}%" in {BoosterRewards::4}
- replace all "{PlayerDisplayName}" with "%{Booster::Owner::DisplayName}%" in {BoosterRewards::4}
- replace all "{Player2}" with "%player%" in {BoosterRewards::4}
- replace all "{PlayerDisplayName2}" with "%player's displayname%" in {BoosterRewards::4}
- execute console command "%{BoosterRewards::4}%"
- if {BoosterRewards::5} is set:
- replace all "{Player}" with "%{Booster::Owner::Name}%" in {BoosterRewards::5}
- replace all "{PlayerDisplayName}" with "%{Booster::Owner::DisplayName}%" in {BoosterRewards::5}
- replace all "{Player2}" with "%player%" in {BoosterRewards::5}
- replace all "{PlayerDisplayName2}" with "%player's displayname%" in {BoosterRewards::5}
- execute console command "%{BoosterRewards::5}%"
- if {BoosterRewards::6} is set:
- replace all "{Player}" with "%{Booster::Owner::Name}%" in {BoosterRewards::6}
- replace all "{PlayerDisplayName}" with "%{Booster::Owner::DisplayName}%" in {BoosterRewards::6}
- replace all "{Player2}" with "%player%" in {BoosterRewards::6}
- replace all "{PlayerDisplayName2}" with "%player's displayname%" in {BoosterRewards::6}
- execute console command "%{BoosterRewards::6}%"
- if {BoosterRewards::7} is set:
- replace all "{Player}" with "%{Booster::Owner::Name}%" in {BoosterRewards::7}
- replace all "{PlayerDisplayName}" with "%{Booster::Owner::DisplayName}%" in {BoosterRewards::7}
- replace all "{Player2}" with "%player%" in {BoosterRewards::7}
- replace all "{PlayerDisplayName2}" with "%player's displayname%" in {BoosterRewards::7}
- execute console command "%{BoosterRewards::7}%"
- if {BoosterRewards::8} is set:
- replace all "{Player}" with "%{Booster::Owner::Name}%" in {BoosterRewards::8}
- replace all "{PlayerDisplayName}" with "%{Booster::Owner::DisplayName}%" in {BoosterRewards::8}
- replace all "{Player2}" with "%player%" in {BoosterRewards::8}
- replace all "{PlayerDisplayName2}" with "%player's displayname%" in {BoosterRewards::8}
- execute console command "%{BoosterRewards::8}%"
- if {BoosterRewards::9} is set:
- replace all "{Player}" with "%{Booster::Owner::Name}%" in {BoosterRewards::9}
- replace all "{PlayerDisplayName}" with "%{Booster::Owner::DisplayName}%" in {BoosterRewards::9}
- replace all "{Player2}" with "%player%" in {BoosterRewards::9}
- replace all "{PlayerDisplayName2}" with "%player's displayname%" in {BoosterRewards::9}
- execute console command "%{BoosterRewards::9}%"
- if {BoosterRewards::10} is set:
- replace all "{Player}" with "%{Booster::Owner::Name}%" in {BoosterRewards::10}
- replace all "{PlayerDisplayName}" with "%{Booster::Owner::DisplayName}%" in {BoosterRewards::10}
- replace all "{Player2}" with "%player%" in {BoosterRewards::10}
- replace all "{PlayerDisplayName2}" with "%player's displayname%" in {BoosterRewards::10}
- execute console command "%{BoosterRewards::10}%"
- delete {_Sender}
- delete {_SenderDName}
- set {Booster::Cooldown::Thanks::%player%} to now
- else:
- if difference between {Booster::Cooldown::Thanks::%player%} and now is less than {BoosterThanksCooldown}:
- message "%{BoosterErrorCooldown}%"
- else:
- delete {Booster::Cooldown::Thanks::%player%}
- else:
- message "%{BoosterSelfThanks}%"
- if sender is not a player:
- message "%{BoosterConsoleThanks}%"
- else:
- message "%{NoActiveBooster}%"
- # The main command of this script
- command /booster [<text>] [<player>]:
- description: Main command for the mcMMO booster.
- usage: /booster <help:give:cancel:reload:status:version>
- trigger:
- if player does not have permission "%{BoosterBoosterMainCommand}%":
- message "%{BoosterNoPermCommand}%"
- stop
- if argument 1 is not set:
- message "%{BoosterMSG}%"
- if argument 1 is "help":
- if argument 2 is not set:
- if player does not have permission "%{BoosterHelpPerm}%":
- message "%{BoosterNoPermCommand}%"
- stop
- else:
- if {BoosterHelpMessages::1} is set:
- message "%{BoosterHelpMessages::1}%"
- if {BoosterHelpMessages::2} is set:
- message "%{BoosterHelpMessages::2}%"
- if {BoosterHelpMessages::3} is set:
- message "%{BoosterHelpMessages::3}%"
- if {BoosterHelpMessages::4} is set:
- message "%{BoosterHelpMessages::4}%"
- if {BoosterHelpMessages::5} is set:
- message "%{BoosterHelpMessages::5}%"
- if {BoosterHelpMessages::6} is set:
- message "%{BoosterHelpMessages::6}%"
- if {BoosterHelpMessages::7} is set:
- message "%{BoosterHelpMessages::7}%"
- if {BoosterHelpMessages::8} is set:
- message "%{BoosterHelpMessages::8}%"
- if {BoosterHelpMessages::9} is set:
- message "%{BoosterHelpMessages::9}%"
- if {BoosterHelpMessages::10} is set:
- message "%{BoosterHelpMessages::10}%"
- if {BoosterHelpMessages::11} is set:
- message "%{BoosterHelpMessages::11}%"
- if argument 2 is set:
- message "%{BoosterHelpUsage}%"
- if argument 1 is "reload":
- if sender is a player:
- if player has permission "%{BoosterReloadPerm}%":
- make player execute command "sk reload %{BoosterReloadName}%"
- else:
- message "%{BoosterNoPermCommand}%"
- else:
- execute console command "sk reload %{BoosterReloadName}%"
- if argument 1 is "give":
- if sender have permission "%{BoosterGivePerm}%":
- if argument 2 is set:
- set {_Booster::Give::Player} to argument 2
- set {_Booster::Give::PlayerDisplayName} to argument 2's display name
- message "%{BoosterReceived}%" to {_Booster::Give::Player}
- replace all "{Player}" with "%{_Booster::Give::Player}%" in {BoosterSent}
- replace all "{PlayerDisplayName}" with "%{_Booster::Give::PlayerDisplayName}%" in {BoosterSent}
- message "%{BoosterSent}%" to sender
- give {_Booster::Give::Player} 1 of {BoosterItemID} named "%{BoosterName}%" with lore "%{BoosterLore}%"
- wait 2 ticks
- delete {_Booster::Give::Player}
- else:
- message "%{BoosterGiveUsage}%"
- else:
- message "%{BoosterNoPermCommand}%"
- if argument 1 is "status":
- if argument 2 is set:
- message "%{BoosterStatusUsage}%"
- if argument 2 is not set:
- if player does not have permission "%{BoosterStatusPerm}%":
- message "%{BoosterNoPermCommand}%"
- else:
- if {Booster::Active::Status} is not set:
- message "%{NoActiveBooster}%"
- else:
- message "%{CurrentBooster}%"
- if argument 1 is "cancel":
- if player does not have permission "%{BoosterCancelPerm}%":
- message "%{BoosterNoPermCommand}%"
- else:
- if argument 2 is set:
- message "%{BoosterCancelUsage}%"
- if argument 2 is not set:
- if {Booster::Active::Status} is not set:
- message "%{NoActiveBooster}%"
- else:
- loop all players:
- loop-player has the permission "%{BoosterAnnouncePerm}%":
- if sender is a player:
- set {_Booster::Cancel::Name} to player's name
- set {_Booster::Cancel::DisplayName} to player's displayname
- if sender is not a player:
- set {_Booster::Cancel::Name} to "Console"
- set {_Booster::Cancel::DisplayName} to "Console"
- replace all "{Player}" with "%{Booster::Owner::Name}%" in {BoosterCancelAnnounce}
- replace all "{PlayerDisplayName}" with "%{Booster::Owner::DisplayName}%" in {BoosterCancelAnnounce}
- replace all "{Player2}" with "%{_Booster::Cancel::Name}%" in {BoosterCancelAnnounce}
- replace all "{Player2DisplayName}" with "%{_Booster::Cancel::DisplayName}%" in {BoosterCancelAnnounce}
- message "%{BoosterCancelAnnounce}%" to loop-player
- if {BoosterDeactivation::1} is set:
- execute console command "%{BoosterDeactivation::1}%"
- if {BoosterDeactivation::2} is set:
- execute console command "%{BoosterDeactivation::2}%"
- if {BoosterDeactivation::3} is set:
- execute console command "%{BoosterDeactivation::3}%"
- if {BoosterDeactivation::4} is set:
- execute console command "%{BoosterDeactivation::4}%"
- if {BoosterDeactivation::5} is set:
- execute console command "%{BoosterDeactivation::5}%"
- if {BoosterDeactivation::6} is set:
- execute console command "%{BoosterDeactivation::6}%"
- if {BoosterDeactivation::7} is set:
- execute console command "%{BoosterDeactivation::7}%"
- if {BoosterDeactivation::8} is set:
- execute console command "%{BoosterDeactivation::8}%"
- if {BoosterDeactivation::9} is set:
- execute console command "%{BoosterDeactivation::9}%"
- if {BoosterDeactivation::10} is set:
- execute console command "%{BoosterDeactivation::10}%"
- delete {Booster::Owner::SelfThanks::%{Booster::Owner::Name}%}
- delete {Booster::Owner::Name}
- delete {Booster::Owner::DisplayName}
- delete {Booster::Cooldown::Thanks::*}
- delete {Booster::Active::Time}
- delete {Booster::Active::Status}
- delete {_Booster::Cancel::Name}
- delete {_Booster::Cancel::DisplayName}
- message "%{BoosterCancelMSG}%" to sender
- if argument 1 is "version":
- if player does not have permission "%{BoosterVersionPerm}%":
- message "%{BoosterNoPermCommand}%"
- stop
- else:
- if argument 2 is set:
- message "%{BoosterVersionUsage}%"
- if argument 2 is not set:
- replace all "{Version}" with "{@Version}" in {BoosterVersionMessage}
- message "%{BoosterVersionMessage}%"
- else if text-argument is not "cancel", "version", "give", "status", "reload" or "help":
- message "%{BoosterInvalidArgument}%"
- # +------------------------------------------------------+ #
- # | Command Aliases | #
- # +------------------------------------------------------+ #
- on command:
- if "%command%" is "%{BoosterThanksCommandAlias}%":
- cancel event
- if "%arguments%" isn't "<none>":
- execute player command "thanks %arguments%"
- else:
- execute player command "thanks"
- if "%command%" is "%{BoosterBoosterCommandAlias}%":
- cancel event
- if "%arguments%" isn't "<none>":
- execute player command "booster %arguments%"
- else:
- execute player command "booster"
- # +------------------------------------------------------+ #
- # | Right Click Event | #
- # +------------------------------------------------------+ #
- # What to do when a player right click on a booster
- on rightclick:
- if player's tool is not {BoosterItemID} named "%{BoosterName}%" with lore "%{BoosterLore}%":
- stop
- if player's tool is {BoosterItemID} named "%{BoosterName}%" with lore "%{BoosterLore}%":
- if player does not have the permission "%{BoosterUsePerm}%":
- message "%{NoPermBooster}%"
- stop
- else:
- if player's gamemode is not survival:
- message "%{BoosterNoGameMode}%" to player
- stop
- else:
- if {Booster::Active::Status} is not set:
- cancel event
- set {Booster::Owner::Name} to player
- set {Booster::Owner::DisplayName} to player's displayname
- set {Booster::Owner::SelfThanks::%player%} to true
- message "%{BoosterActivate}%" to player
- loop all players:
- loop-player has the permission "%{BoosterAnnouncePerm}%":
- replace all "{Player}" with "%{Booster::Owner::Name}%" in {BoosterActivated}
- replace all "{PlayerDisplayName}" with "%{Booster::Owner::DisplayName}%" in {BoosterActivated}
- message "%{BoosterActivated}%" to loop-player
- set {Booster::Active::Status} to true
- set {Booster::Active::Time} to now
- if {BoosterActivation::1} is set:
- execute console command "%{BoosterActivation::1}%"
- if {BoosterActivation::2} is set:
- execute console command "%{BoosterActivation::2}%"
- if {BoosterActivation::3} is set:
- execute console command "%{BoosterActivation::3}%"
- if {BoosterActivation::4} is set:
- execute console command "%{BoosterActivation::4}%"
- if {BoosterActivation::5} is set:
- execute console command "%{BoosterActivation::5}%"
- if {BoosterActivation::6} is set:
- execute console command "%{BoosterActivation::6}%"
- if {BoosterActivation::7} is set:
- execute console command "%{BoosterActivation::7}%"
- if {BoosterActivation::8} is set:
- execute console command "%{BoosterActivation::8}%"
- if {BoosterActivation::9} is set:
- execute console command "%{BoosterActivation::9}%"
- if {BoosterActivation::10} is set:
- execute console command "%{BoosterActivation::10}%"
- set {BoosterPlayerTool} to player's tool
- remove 1 of tool named "%{BoosterName}%" with lore "%{BoosterLore}%" from player
- stop
- else:
- message "%{BoosterErrorActivated}%" to player
- cancel event
- stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement