Files
SlimeToken.sk
Code
1 352
SlimeToken.sk
# ========================================================
# MOB TOKEN SMP - SLIME TOKEN ENGINE
# Requires: Skript, SkBee, and a Minecraft version with slime particles
# Place in plugins/Skript/scripts/ and run: /sk reload SlimeToken
# ========================================================
options:
token-name: &aSlime Token
prefix: &a&lSLIME &8ยป &r
function getSlimeToken() :: item:
set {_item} to echo shard named "{@token-name}"
set lore of {_item} to " ", "&eโ &lPASSIVES &eโ", " &8โ &bPermanent Haste I", " &8โ &bPermanent Speed I", " &8โ &bImmune to &cfall damage", " &8โ &b5%% chance to fully &aabsorb &bincoming damage", " ", "&dโ &lABILITIES &dโ", "&7(Left Click) &8(110s cooldown)", " &8โ &bBounce 3 times, dealing damage on every landing", " &8โ &bYour final bounce knocks enemies away", " ", "&7(Right Click) &8(80s cooldown)", " &8โ &bEngorge: shrink down, then grow when hit", " &8โ &bRight click again to end the ability", " ", "&dโ &lULTIMATE ABILITY &dโ", "&7(Offhand / F Key) &8(90s cooldown)", " &8โ &bStick nearby enemies to the ground for 7 seconds"
return {_item}
function slimeParticles(at: location, amount: number):
play {_amount} of slime particles at {_at}
function slimeCircle(center: location, radius: number):
set {_angle} to 0
loop 36 times:
set {_point} to {_center}
set {_x-offset} to (cosine of {_angle}) * {_radius}
set {_z-offset} to (sine of {_angle}) * {_radius}
add {_x-offset} to x-coordinate of {_point}
add 0.2 to y-coordinate of {_point}
add {_z-offset} to z-coordinate of {_point}
slimeParticles({_point}, 4)
add 10 to {_angle}
function dealTrueDamage(attacker: player, victim: living entity, hearts: number):
if {_victim} is {_attacker}:
stop
if {mobtoken::trust::%{_attacker}'s uuid%::*} contains uuid of {_victim}:
stop
set {_damage} to {_hearts} * 2
set {_health} to health of {_victim}
if {_health} - {_damage} <= 0:
damage {_victim} by 1000
else:
set health of {_victim} to {_health} - {_damage}
play sound "entity.player.hurt" at {_victim}
function slimeSlam(p: player, radius: number, damage-hearts: number, knockback: number, lift: number):
slimeParticles(location of {_p}, 30)
play sound "entity.slime.squish" at {_p}
loop all living entities in radius {_radius} around {_p}:
if loop-entity is not {_p}:
dealTrueDamage({_p}, loop-entity, {_damage-hearts})
set {_direction} to vector from {_p} to loop-entity
set y of {_direction} to {_lift}
set velocity of loop-entity to {_direction} * {_knockback}
function useSlimeAbility1(p: player):
set {_uuid} to {_p}'s uuid
if {cd::slime1::%{_uuid}%} is set:
set {_elapsed} to difference between {cd::slime1::%{_uuid}%} and now
if {_elapsed} is less than 110 seconds:
set {_remaining} to 110 seconds - {_elapsed}
send "{@prefix}&cBounce is on cooldown for %{_remaining}%." to {_p}
stop
set {cd::slime1::%{_uuid}%} to now
loop 3 times:
set {_bounce} to loop-number
send "{@prefix}&a&lBOUNCE %{_bounce}%&a/3!" to {_p}
if {_bounce} is 1:
push {_p} upwards at speed 0.8
push {_p} forwards at speed 0.7
else if {_bounce} is 2:
push {_p} upwards at speed 0.9
push {_p} forwards at speed 0.8
else:
push {_p} upwards at speed 1.3
push {_p} forwards at speed 1.1
play sound "entity.slime.jump" at {_p}
slimeParticles(location of {_p}, 18)
wait 3 ticks
set {_landed} to false
loop 100 times:
wait 1 tick
slimeParticles(location of {_p}, 2)
if {_p} is on ground:
set {_landed} to true
stop loop
if {_landed} is false:
stop
if {_bounce} is 3:
slimeSlam({_p}, 5, 2, 1.8, 0.5)
send "{@prefix}&a&lFINAL BOUNCE SLAM UNLEASHED!" to {_p}
else:
slimeSlam({_p}, 3, 1, 1.2, 0.3)
wait 5 ticks
function useSlimeAbility2(p: player):
set {_uuid} to {_p}'s uuid
if {engorge::active::%{_uuid}%} is true:
endEngorge({_p})
stop
if {cd::slime2::%{_uuid}%} is set:
set {_elapsed} to difference between {cd::slime2::%{_uuid}%} and now
if {_elapsed} is less than 80 seconds:
set {_remaining} to 80 seconds - {_elapsed}
send "{@prefix}&cEngorge is on cooldown for %{_remaining}%." to {_p}
stop
set {cd::slime2::%{_uuid}%} to now
set {engorge::active::%{_uuid}%} to true
set {engorge::scale::%{_uuid}%} to 0.5
set {engorge::last-hit::%{_uuid}%} to now
set generic scale attribute of {_p} to 0.5
slimeParticles(location of {_p}, 25)
play sound "entity.slime.squish" at {_p}
send "{@prefix}&a&lENGORGE ACTIVATED! &7Right click again to end it." to {_p}
while {engorge::active::%{_uuid}%} is true:
wait 10 ticks
if difference between {engorge::last-hit::%{_uuid}%} and now is greater than 20 seconds:
endEngorge({_p})
stop
function endEngorge(p: player):
set {_uuid} to {_p}'s uuid
delete {engorge::active::%{_uuid}%}
set {_scale} to {engorge::scale::%{_uuid}%}
set generic scale attribute of {_p} to 1
slimeParticles(location of {_p}, 25)
if {_scale} is less than or equal to 1:
apply speed 2 to {_p} for 8 seconds
apply regeneration 2 to {_p} for 8 seconds
play sound "entity.player.levelup" at {_p}
send "{@prefix}&a&lENGORGE ENDED: &fSpeed II and Regeneration II granted!" to {_p}
else:
play sound "entity.generic.explode" at {_p}
slimeParticles(location of {_p}, 50)
loop all living entities in radius 6 around {_p}:
if loop-entity is not {_p}:
dealTrueDamage({_p}, loop-entity, 4)
set {_direction} to vector from {_p} to loop-entity
set y of {_direction} to 0.6
set velocity of loop-entity to {_direction} * 1.8
send "{@prefix}&a&lENGORGE SLAM UNLEASHED!" to {_p}
delete {engorge::scale::%{_uuid}%}
delete {engorge::last-hit::%{_uuid}%}
function useSlimeUltimate(p: player):
set {_uuid} to {_p}'s uuid
if {cd::slimeUlt::%{_uuid}%} is set:
set {_elapsed} to difference between {cd::slimeUlt::%{_uuid}%} and now
if {_elapsed} is less than 90 seconds:
set {_remaining} to 90 seconds - {_elapsed}
send "{@prefix}&cUltimate is on cooldown for %{_remaining}%." to {_p}
stop
set {cd::slimeUlt::%{_uuid}%} to now
send "{@prefix}&d&lSTICKY ZONE UNLEASHED &7(10-block radius)!" to {_p}
play sound "block.slime_block.place" at {_p}
loop 7 times:
slimeCircle(location of {_p}, 10)
slimeParticles(location of {_p}, 25)
loop all living entities in radius 10 around {_p}:
if loop-entity is not {_p}:
if {mobtoken::trust::%{_uuid}%::*} does not contain uuid of loop-entity:
apply slowness 1 to loop-entity for 2 seconds
apply jump boost 250 to loop-entity for 2 seconds
slimeParticles(location of loop-entity, 8)
wait 1 second
# ========================================================
# COMMANDS
# ========================================================
command /mobtoken [<text>] [<text>]:
trigger:
if arg-1 is "start":