Files
tokioitems.sk
Code
1 340
tokioitems.sk
# TokioCustomItem
# Place this file in plugins/Skript/scripts/
# Reload with: /sk reload tokioitems
options:
menu-name: &8Tokio Custom Items
prefix: &6[TokioItems]&r
function tokioItem(id: text) :: item:
if {_id} is "dragon_claw":
set {_item} to diamond sword named "&cDragon Claw"
set lore of {_item} to "&7Deals bonus fire damage.", "&7Chance to slow enemies.", "&0tokioid:dragon_claw"
else if {_id} is "fallen_scythe":
set {_item} to netherite sword named "&8Fallen Scythe"
set lore of {_item} to "&7Has a chance to steal health", "&7from enemies on hit.", "&0tokioid:fallen_scythe"
else if {_id} is "titan_hammer":
set {_item} to netherite axe named "&6Titan Hammer"
set lore of {_item} to "&7Knocks enemies away.", "&7Deals crushing bonus damage.", "&0tokioid:titan_hammer"
else if {_id} is "shadow_dagger":
set {_item} to iron sword named "&5Shadow Dagger"
set lore of {_item} to "&7Sneak while attacking from behind", "&7to become temporarily invisible.", "&0tokioid:shadow_dagger"
else if {_id} is "ice_whisper":
set {_item} to bow named "&bIce Whisper"
set lore of {_item} to "&7Freezes enemies briefly", "&7when they are struck.", "&0tokioid:ice_whisper"
else if {_id} is "storm_spear":
set {_item} to trident named "&9Storm Spear"
set lore of {_item} to "&7Summons lightning during storms.", "&0tokioid:storm_spear"
else if {_id} is "guardian_helmet":
set {_item} to diamond helmet named "&aGuardian Helmet"
set lore of {_item} to "&7Grants night vision.", "&7Grants constant water breathing.", "&0tokioid:guardian_helmet"
else if {_id} is "platemail":
set {_item} to diamond chestplate named "&fPlatemail"
set lore of {_item} to "&7Reduces explosion damage by half.", "&7Reduces fall damage by half.", "&0tokioid:platemail"
else if {_id} is "wind_boots":
set {_item} to leather boots named "&fWind Boots"
set lore of {_item} to "&7Allows higher jumps.", "&7Reduces fall damage.", "&0tokioid:wind_boots"
else if {_id} is "phoenix_shield":
set {_item} to shield named "&cPhoenix Shield"
set lore of {_item} to "&7Prevents death once every 3 minutes.", "&7Restores a portion of your health.", "&0tokioid:phoenix_shield"
else if {_id} is "deflection_charm":
set {_item} to amethyst shard named "&dDeflection Charm"
set lore of {_item} to "&7Has a chance to reflect arrows", "&7back at their shooter.", "&0tokioid:deflection_charm"
else if {_id} is "stealth_cloak":
set {_item} to leather chestplate named "&8Stealth Cloak"
set lore of {_item} to "&7Makes you invisible while", "&7standing in darkness.", "&0tokioid:stealth_cloak"
else if {_id} is "veinminer_pro":
set {_item} to diamond pickaxe named "&bVeinMiner Pro"
set lore of {_item} to "&7Breaks nearby connected ores", "&7when mining a vein.", "&0tokioid:veinminer_pro"
else if {_id} is "lumber_axe":
set {_item} to diamond axe named "&6Lumber Axe"
set lore of {_item} to "&7Chops the whole tree", "&7from bottom to top.", "&0tokioid:lumber_axe"
else if {_id} is "soul_harvester":
set {_item} to golden hoe named "&5Soul Harvester"
set lore of {_item} to "&7Converts mob and player XP", "&7into Soul Essence bottles.", "&0tokioid:soul_harvester"
else if {_id} is "oasis_heart":
set {_item} to heart of the sea named "&bOasis Heart"
set lore of {_item} to "&7Slowly restores hunger", "&7and health while carried.", "&0tokioid:oasis_heart"
else if {_id} is "rune_of_recall":
set {_item} to lodestone named "&dRune of Recall"
set lore of {_item} to "&7Sneak-right-click to set a point.", "&7Right-click again to return there.", "&0tokioid:rune_of_recall"
else if {_id} is "void_pouch":
set {_item} to shulker box named "&5Void Pouch"
set lore of {_item} to "&7Automatically stores picked-up items.", "&7Use /pouch to view its contents.", "&0tokioid:void_pouch"
else if {_id} is "chrono_prism":
set {_item} to clock named "&eChrono Prism"
set lore of {_item} to "&7Right-click for speed and haste.", "&7Ability cooldown: 30 seconds.", "&0tokioid:chrono_prism"
else if {_id} is "berserker_ring":
set {_item} to gold nugget named "&4Berserker Ring"
set lore of {_item} to "&7Deals bonus damage while", "&7you are below half health.", "&0tokioid:berserker_ring"
return {_item}
function giveTokioItem(p: player, id: text):
set {_item} to tokioItem({_id})
if {_item} is set:
give {_item} to {_p}
function hasTokioItem(p: player, id: text) :: boolean:
loop all items in {_p}'s inventory:
if lore of loop-item contains "tokioid:%{_id}%":
return true
return false
function hasTokioArmor(p: player, id: text) :: boolean:
if lore of {_p}'s helmet contains "tokioid:%{_id}%":
return true
if lore of {_p}'s chestplate contains "tokioid:%{_id}%":
return true
if lore of {_p}'s leggings contains "tokioid:%{_id}%":
return true
if lore of {_p}'s boots contains "tokioid:%{_id}%":
return true
return false
on script load:
set {tokioitems::slot::0} to "dragon_claw"
set {tokioitems::slot::1} to "fallen_scythe"
set {tokioitems::slot::2} to "titan_hammer"
set {tokioitems::slot::3} to "shadow_dagger"
set {tokioitems::slot::4} to "ice_whisper"
set {tokioitems::slot::5} to "storm_spear"
set {tokioitems::slot::6} to "guardian_helmet"
set {tokioitems::slot::7} to "platemail"
set {tokioitems::slot::8} to "wind_boots"
set {tokioitems::slot::9} to "phoenix_shield"
set {tokioitems::slot::10} to "deflection_charm"
set {tokioitems::slot::11} to "stealth_cloak"
set {tokioitems::slot::12} to "veinminer_pro"
set {tokioitems::slot::13} to "lumber_axe"
set {tokioitems::slot::14} to "soul_harvester"
set {tokioitems::slot::15} to "oasis_heart"
set {tokioitems::slot::16} to "rune_of_recall"
set {tokioitems::slot::17} to "void_pouch"
set {tokioitems::slot::18} to "chrono_prism"
set {tokioitems::slot::19} to "berserker_ring"
command /tokioitems:
trigger:
set {_menu} to chest inventory with 3 rows named "{@menu-name}"
loop 20 times:
set {_slot} to loop-number - 1
set slot {_slot} of {_menu} to tokioItem({tokioitems::slot::%{_slot}%})
open {_menu} to player
send "{@prefix} &7Select an item to receive it." to player
command /tokioitem <text> <player>:
permission: tokioitems.admin
permission message: &cYou do not have permission to use this command.
trigger:
set {_valid} to false
loop 20 times:
set {_slot} to loop-number - 1
if arg-1 is {tokioitems::slot::%{_slot}%}:
set {_valid} to true
if {_valid} is false:
send "{@prefix} &cUnknown item ID." to player
stop
giveTokioItem(arg-2, arg-1)
send "{@prefix} &aGave &e%arg-1% &ato &e%arg-2%&a." to player
on inventory click:
if name of event-inventory is "{@menu-name}":
cancel event
if {tokioitems::slot::%clicked slot%} is set:
giveTokioItem(player, {tokioitems::slot::%clicked slot%})
send "{@prefix} &aYou received a custom item." to player
on inventory drag:
if name of event-inventory is "{@menu-name}":
cancel event
on damage:
if attacker is a player:
if lore of attacker's tool contains "tokioid:dragon_claw":
add 2 to damage
set fire ticks of victim to 80
chance of 20%:
apply slowness 1 to victim for 3 seconds
if lore of attacker's tool contains "tokioid:fallen_scythe":
chance of 25%:
heal attacker by 2
send "&5The Fallen Scythe stole health from your enemy." to attacker
if lore of attacker's tool contains "tokioid:titan_hammer":
add 3 to damage
push victim away from attacker at speed 1
if lore of attacker's tool contains "tokioid:shadow_dagger":
if attacker is sneaking:
apply invisibility 1 to attacker for 4 seconds
if lore of attacker's tool contains "tokioid:storm_spear":
if world of victim is thundering:
strike lightning effect at victim
if hasTokioItem(attacker, "berserker_ring") is true:
if health of attacker <= max health of attacker / 2:
add 2 to damage
if victim is a player:
if damage cause is explosion:
if hasTokioArmor(victim, "platemail") is true:
set damage to damage / 2
if damage cause is entity explosion:
if hasTokioArmor(victim, "platemail") is true:
set damage to damage / 2
if damage cause is fall:
if hasTokioArmor(victim, "platemail") is true:
set damage to damage / 2
if hasTokioArmor(victim, "wind_boots") is true:
set damage to damage / 2
if attacker is an arrow:
if shooter of attacker is a player:
if hasTokioItem(shooter of attacker, "deflection_charm") is true:
chance of 20%:
cancel event
damage shooter of attacker by damage