Files
asta-admin.sk
asta-origin.sk
Code
2 169
asta-origin.sk
options:
prefix: &8[&6Asta Origin&8]&r
strength-multiplier: 1.5
damage-reduction: 0.3
low-health-threshold: 6
determination-multiplier: 2.0
sword-name: &6Anti-Magic Sword
sword-lore: &7Nullifies all magic it touches
on script load:
send "{@prefix} Asta Origin system loaded!" to console
set {asta::origins::*} to ...
command /origin <text>:
trigger:
if arg-1 is "asta":
if {origin::%player%} is set:
send "{@prefix} &cYou already have an origin!"
stop
set {origin::%player%} to "asta"
execute player command "/asta-give-sword"
send "{@prefix} &aYou are now an Anti-Magic user like Asta!"
send "&7You have gained:"
send "&8• &6Enhanced melee damage"
send "&8• &6Immunity to magic effects"
send "&8• &6Physical damage reduction"
send "&8• &6Determination (power boost at low HP)"
send "&cYou have lost:"
send "&8• &4Ability to use enchantments"
send "&8• &4Ability to use potions"
send "&8• &4Ability to use magical items"
apply resistance 1 to player for 999999 days
stop
if arg-1 is "remove":
if {origin::%player%} is not set:
send "{@prefix} &cYou don't have an origin!"
stop
delete {origin::%player%}
send "{@prefix} &aYour origin has been removed!"
stop
send "{@prefix} &cUsage: /origin <asta|remove>"
command /asta-give-sword:
trigger:
if {origin::%player%} is not "asta":
send "{@prefix} &cOnly Asta origin users can use this!"
stop
give player 1 iron sword named "{@sword-name}" with lore "{@sword-lore}"
send "{@prefix} &aYou received your Anti-Magic Sword!"
on join:
if {origin::%player%} is "asta":
apply resistance 1 to player for 999999 days
on damage:
if {origin::%attacker%} is "asta":
if attacker is holding a sword:
set {_base} to damage
set damage to {_base} * {@strength-multiplier}
if health of attacker <= {@low-health-threshold}:
set damage to damage * {@determination-multiplier}
send action bar "&6⚡ DETERMINATION ACTIVATED! ⚡" to attacker
if {origin::%victim%} is "asta":
set {_reduction} to damage * {@damage-reduction}
remove {_reduction} from damage
on player consuming potion:
if {origin::%player%} is "asta":
cancel event
send "{@prefix} &cYour anti-magic body rejects potions!" to player
on craft:
if {origin::%player%} is "asta":
if event-item is enchanted:
cancel event
send "{@prefix} &cYou cannot create enchanted items!" to player
on enchant:
if {origin::%player%} is "asta":
cancel event
send "{@prefix} &cYour anti-magic prevents enchanting!" to player
on pickup of enchanted item:
if {origin::%player%} is "asta":
cancel event
send action bar "&cAnti-magic rejects this enchanted item!" to player
on right click:
if {origin::%player%} is "asta":
if player's tool is ender pearl:
cancel event
send action bar "&cAnti-magic prevents ender pearl usage!" to player
if player's tool is potion:
cancel event
send action bar "&cAnti-magic rejects potions!" to player
on potion effect apply:
if {origin::%player%} is "asta":
if event isn't caused by a plugin:
cancel event
send action bar "&6Anti-magic nullified a magic effect!" to player
on damage by magic:
if {origin::%victim%} is "asta":
cancel event
send action bar "&6Anti-magic absorbed the attack!" to victim
if attacker is set:
send action bar "&cYour magic was nullified!" to attacker
every 1 second:
loop all players:
if {origin::%loop-player%} is "asta":
if loop-player has any potion effects:
remove all potion effects from loop-player
if health of loop-player <= {@low-health-threshold}:
send action bar "&6&l⚡ DETERMINATION ACTIVE ⚡" to loop-player