Advertisement
Kukky

Untitled

Sep 24th, 2017
512
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. options:
  2.     bindable : sword or a bow or a pickaxe or a shovel or a hoe or an axe or shears #list of all items that can be bound, seperated by "or a/an"
  3.     binds : 5       #number of items that can be bound at once
  4.     soulbind : &3[&cSoulbind&3]
  5.  
  6.  
  7. command /soulbound:     #print all bound items and their slots
  8.     trigger:
  9.         loop {sb.%player%::*}:
  10.             send "%loop-value% - %loop-index%"
  11.         loop {sbA.%player%::*}:
  12.             send "%loop-value% - %loop-index%"
  13.  
  14. command /soulsummon:        #add all bound items to inventory
  15.     permission: kukky.perm
  16.     aliases: /ss
  17.     trigger:
  18.         loop {sb.%player%::*}:
  19.             add loop-value to the player's inventory
  20.            
  21. command /clear:
  22.     permission: kukky.perm
  23.     trigger:
  24.         loop {sb.%player%::*}:
  25.             remove loop-value from {sb.%player%::*}
  26.         loop {sbA.%player%::*}:
  27.             remove loop-value from {sbA.%player%::*}
  28.         send "Reset soulbinds"
  29. #
  30. # DEBUG BITS ^^^^^
  31. #
  32. # IMPORTANT BITS vvvvv
  33. #
  34. on death:       #make it so players dont drop their bound stuff
  35.     set {soulDied.%player%} to true
  36.     delete {sb2.%player%::*}
  37.     loop {sb.%player%::*}:
  38.         loop the drops:
  39.             if loop-value-1 == loop-value-2:
  40.                 remove loop-value-1 from the drops
  41.                 add loop-value-1 to {sb2.%player%::*}
  42.     loop {sbA.%player%::*}:
  43.         loop the drops:
  44.             if loop-value-1 == loop-value-2:
  45.                 remove loop-value-1 from the drops
  46.                 add loop-value-1 to {sb2.%player%::*}
  47.        
  48. on respawn:     #make it so players respawn with their bound stuff
  49.     {soulDied.%player%} is true
  50.     loop {sb2.%player%::*}:
  51.         add loop-value to the player's inventory
  52.     message "{@soulbind} &cYour soulbound items magically appear.."
  53.     delete {sb2.%player%::*}   
  54.     set {soulDied.%player%} to false
  55.    
  56. command /soulbind <text>:       #allow players to bind tools to named slots
  57.     description: Soulbind gear to stop it from dropping on death
  58.     executable by: players
  59.     aliases: /sb
  60.     trigger:
  61.         if arg 1 is "help":
  62.             send "{@soulbind} &cSoulbind Help" to player
  63.             send "" to player
  64.             send "{@soulbind} &c/soulbind help - Shows a list of Commands" to player
  65.             send "{@soulbind} &c/soulbind list - Shows lists of Binds" to player
  66.             send "{@soulbind} &c/soulbind armor - Soulbinds your Armor" to player
  67.             send "{@soulbind} &c/soulbind [name of soulbind] - Soulbinds an item in your hand" to player
  68.             send "{@soulbind} &c/unbind armor - Unbinds all armor" to player
  69.             send "{@soulbind} &c/unbind all - Unbinds all items" to player
  70.             send "{@soulbind} &c/unbind [name of soulbind] - Unbinds the specified item" to player
  71.             stop
  72.         else if arg 1 is "list":
  73.             loop {sb.%player%::*}:
  74.                 send "{@soulbind} &a%loop-value% - %loop-index%"
  75.             loop {sbA.%player%::*}:
  76.                 send "{@soulbind} &a%loop-value% - %loop-index%"
  77.             stop
  78.         else if arg 1 is "armor":
  79.             send "Armors bound"
  80.             set {sbA.%player%::helm} to helmet of player
  81.             set {sbA.%player%::chestplate} to chestplate of player
  82.             set {sbA.%player%::legs} to legs of player
  83.             set {sbA.%player%::boots} to boots of player
  84.             loop {sbA.%player%::*}:
  85.                 if loop-value is air:
  86.                     remove loop-value from {sbA.%player%::*}
  87.                 else:
  88.                     send "{@soulbind} &aBound %loop-value% - %loop-index%!" to the player
  89.             stop
  90.         else:
  91.             if the held item is a {@bindable}:
  92.                 reset {sbFail.%player%}
  93.                 set {sb.%player%::%arg 1%} to the held item
  94.                 loop {sb.%player%::*}:
  95.                     if {_n} is not set:
  96.                         set {_n} to 0
  97.                     add 1 to {_n}
  98.                     if {_n} is greater than {@binds}:
  99.                         subtract 1 from {_n}
  100.                         if {_n} is greater than {@binds}:
  101.                             send "{@soulbind} &cYou have an unnatural amount of Soulbound items! All items have been unbound."
  102.                             set {sbFail.%player%} to true
  103.                             loop {sb.%player%::*}:
  104.                                 remove loop-value-2 from {sb.%player%::*}
  105.                             exit the loop
  106.                         send "{@soulbind} &cYou have reached the Soulbind Limit!"
  107.                         set {sbFail.%player%} to true
  108.                         remove the held item from {sb.%player%::*}
  109.                         exit the loop
  110.                 if {sbFail.%player%} is true:
  111.                     reset {sbFail.%player%} # Add cool effects on failure here
  112.                 else:
  113.                     send "{@soulbind} &a%held item% &7has been successfully bound to you!"  # Add cool effects on success here
  114.             else:
  115.                 send "{@soulbind} &cThat item cannot be bound."
  116. #
  117. # /soulbind TODO: add cost?
  118. #
  119.  
  120. command /unbind <text>:     #unbinds the specified slot.    TODO: say if that slot wasnt bound in the first place?
  121.     trigger:
  122.         if arg 1 is "armor":
  123.             loop {sbA.%player%::*}:
  124.                 remove loop-value from {sbA.%player%::*}
  125.                 send "{@soulbind} &aUnbound Armor!"
  126.             stop
  127.         else if arg 1 is "all":
  128.             reset {sb.%player%}
  129.             send "{@soulbind} &aUnbound all items!"
  130.         send "{@soulbind} &aUnbound %{sb.%player%::%arg 1%}%!"
  131.         remove {sb.%player%::%arg 1%} from {sb.%player%::*}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement