Files
legendary_creatures.sk
Code
1 427
legendary_creatures.sk
# Legendary Creatures
# Place this file in plugins/Skript/scripts/ and run: /sk reload legendary_creatures
options:
woodsman-name: &2&lThe Woodsman
prospector-name: &6&lThe Prospector
hunter-name: &7&lThe Hunter
lumber-lord-name: &a&lThe Lumber Lord
shepherd-name: &f&lThe Shepherd
stonemason-name: &8&lThe Stonemason
sailor-name: &9&lThe Sailor
beekeeper-name: &e&lThe Beekeeper
fisherman-name: &b&lThe Fisherman
farmer-name: &6&lThe Farmer
miner-name: &8&lThe Miner
gravekeeper-name: &0&lThe Gravekeeper
pyromancer-name: &c&lThe Pyromancer
shadow-name: &5&lThe Shadow
dragon-slayer-name: &4&lThe Dragon Slayer
axe-head-name: &6&lSplintered Axe Head
core-name: &f&lProspector's Core
pelt-name: &a&lHunter's Pelt
sapling-name: &2&lHeartwood Sapling
crook-name: &e&lShepherd's Crook
chisel-name: &7&lMaster's Chisel
sextant-name: &b&lCaptain's Sextant
honeycomb-name: &6&lRoyal Honeycomb
bobber-name: &9&lLucky Bobber
seed-name: &e&lGolden Seed
coal-name: &8&lDeepcore Coal
key-name: &f&lGrave Key
ember-name: &c&lEverflame Ember
pearl-name: &5&lShadow Pearl
tooth-name: &4&lDragon's Tooth
function dyedLeather(armor: itemtype, shade: color) :: item:
set {_armor} to {_armor}
set color of {_armor} to {_shade}
return {_armor}
function makeRelic(relicType: text) :: item:
if {_relicType} is "woodsman":
set {_relic} to iron nugget
set name of {_relic} to "{@axe-head-name}"
set lore of {_relic} to "&7A fragment of an ancient woodsman's axe." and "&8Off-Hand: &aLogs have a 50% chance to drop double."
return {_relic}
if {_relicType} is "prospector":
set {_relic} to raw iron
set name of {_relic} to "{@core-name}"
set lore of {_relic} to "&7Still warm from years beneath the earth." and "&8Off-Hand: &aOres have a 50% chance to drop double."
return {_relic}
if {_relicType} is "hunter":
set {_relic} to rabbit hide
set name of {_relic} to "{@pelt-name}"
set lore of {_relic} to "&7Taken from the greatest hunter to roam these lands." and "&8Off-Hand: &aAnimals have a 20% chance to drop double meat."
return {_relic}
if {_relicType} is "lumber-lord":
set {_relic} to oak sapling
set name of {_relic} to "{@sapling-name}"
set lore of {_relic} to "&7The first seed of an ancient forest." and "&8Off-Hand: &aLeaves always drop at least one sapling."
return {_relic}
if {_relicType} is "shepherd":
set {_relic} to lead
set name of {_relic} to "{@crook-name}"
set lore of {_relic} to "&7Its owner watched over every flock." and "&8Off-Hand: &aSheep shear for 1-2 extra wool."
return {_relic}
if {_relicType} is "stonemason":
set {_relic} to brick
set name of {_relic} to "{@chisel-name}"
set lore of {_relic} to "&7Worn smooth by countless years of carving stone." and "&8Off-Hand: &aStone and Deepslate have a 50% chance to drop an extra block."
return {_relic}
if {_relicType} is "sailor":
set {_relic} to prismarine shard
set name of {_relic} to "{@sextant-name}"
set lore of {_relic} to "&7It always points toward open water." and "&8Off-Hand: &aGain a slight speed boost while swimming."
return {_relic}
if {_relicType} is "beekeeper":
set {_relic} to honeycomb
set name of {_relic} to "{@honeycomb-name}"
set lore of {_relic} to "&7Sweet enough to calm an angry hive." and "&8Off-Hand: &aBee nests have a 50% chance to produce an extra honeycomb."
return {_relic}
if {_relicType} is "fisherman":
set {_relic} to nautilus shell
set name of {_relic} to "{@bobber-name}"
set lore of {_relic} to "&7It never seems to sink." and "&8Off-Hand: &aFish caught have a 25% chance to give an extra fish."
return {_relic}
if {_relicType} is "farmer":
set {_relic} to wheat seeds
set name of {_relic} to "{@seed-name}"
set lore of {_relic} to "&7A harvest blessed by forgotten hands." and "&8Off-Hand: &aFully grown crops have a 25% chance to drop double."
return {_relic}
if {_relicType} is "miner":
set {_relic} to coal
set name of {_relic} to "{@coal-name}"
set lore of {_relic} to "&7It burns longer than ordinary coal." and "&8Off-Hand: &aMining stone has a 10% chance to restore 1 hunger."
return {_relic}
if {_relicType} is "gravekeeper":
set {_relic} to bone
set name of {_relic} to "{@key-name}"
set lore of {_relic} to "&7It once guarded the forgotten dead." and "&8Off-Hand: &aZombies and Skeletons have a 20% chance to drop double loot."
return {_relic}
if {_relicType} is "pyromancer":
set {_relic} to blaze powder
set name of {_relic} to "{@ember-name}"
set lore of {_relic} to "&7It never truly cools." and "&8Off-Hand: &aImmune to campfire and magma block damage."
return {_relic}
if {_relicType} is "shadow":
set {_relic} to ender pearl
set name of {_relic} to "{@pearl-name}"
set lore of {_relic} to "&7It flickers between worlds." and "&8Off-Hand: &aEnder Pearls deal no teleport damage."
return {_relic}
if {_relicType} is "dragon-slayer":
set {_relic} to bone
set name of {_relic} to "{@tooth-name}"
set lore of {_relic} to "&7Proof that dragons once feared mankind." and "&8Off-Hand: &aDeal 10% more damage to the Ender Dragon."
return {_relic}
function hasRelic(holder: player, relicType: text) :: boolean:
if {_relicType} is "woodsman" and name of offhand item of {_holder} is "{@axe-head-name}":
return true
if {_relicType} is "prospector" and name of offhand item of {_holder} is "{@core-name}":
return true
if {_relicType} is "hunter" and name of offhand item of {_holder} is "{@pelt-name}":
return true
if {_relicType} is "lumber-lord" and name of offhand item of {_holder} is "{@sapling-name}":
return true
if {_relicType} is "shepherd" and name of offhand item of {_holder} is "{@crook-name}":
return true
if {_relicType} is "stonemason" and name of offhand item of {_holder} is "{@chisel-name}":
return true
if {_relicType} is "sailor" and name of offhand item of {_holder} is "{@sextant-name}":
return true
if {_relicType} is "beekeeper" and name of offhand item of {_holder} is "{@honeycomb-name}":
return true
if {_relicType} is "fisherman" and name of offhand item of {_holder} is "{@bobber-name}":
return true
if {_relicType} is "farmer" and name of offhand item of {_holder} is "{@seed-name}":
return true
if {_relicType} is "miner" and name of offhand item of {_holder} is "{@coal-name}":
return true
if {_relicType} is "gravekeeper" and name of offhand item of {_holder} is "{@key-name}":
return true
if {_relicType} is "pyromancer" and name of offhand item of {_holder} is "{@ember-name}":
return true
if {_relicType} is "shadow" and name of offhand item of {_holder} is "{@pearl-name}":
return true
if {_relicType} is "dragon-slayer" and name of offhand item of {_holder} is "{@tooth-name}":
return true
return false
# Natural and spawner mob spawns can become legendary creatures.
on spawn:
if event-entity is a vindicator:
set {_roll} to random integer between 1 and 2500
if {_roll} is 1:
set name of event-entity to "{@woodsman-name}"
set tool of event-entity to iron axe
set helmet of event-entity to leather helmet
set chestplate of event-entity to dyedLeather(leather chestplate, dark green)
else if {_roll} is 2:
set name of event-entity to "{@shepherd-name}"
set tool of event-entity to air
stop
if event-entity is a zombie:
set {_roll} to random integer between 1 and 30000
if {_roll} <= 6:
set name of event-entity to "{@prospector-name}"
set tool of event-entity to iron pickaxe
set helmet of event-entity to golden helmet
set chestplate of event-entity to dyedLeather(leather chestplate, brown)
else if {_roll} <= 11:
set name of event-entity to "{@miner-name}"
set tool of event-entity to iron pickaxe
set helmet of event-entity to iron helmet
stop
if event-entity is a skeleton:
set {_roll} to random integer between 1 and 10000
if {_roll} <= 4:
set name of event-entity to "{@hunter-name}"
set {_bow} to bow
enchant {_bow} with power 1
set tool of event-entity to {_bow}
set helmet of event-entity to dyedLeather(leather helmet, dark gray)