Paste #18510: Untitled Paste

Date: 2015/07/22 13:55:51 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


setzen:
   - if <player.is_op> {
     - if <c.args.get[2]||null> == null {
       - narrate "<yellow>[DropWorld] <gray>Du musst diesen Ort einen Namen geben!" 
       - queue clear 
       }
     - if <yaml[spawning].list_keys[Drop]||null> contains <c.args.get[2]> {
       - narrate "<yellow>[DropWorld] <gray>Der Name exestiert schon!"
       - queue clear 
       }
     - if <c.args.get[2].length> >= 9 {
       - narrate "<yellow>[DropWorld] <gray>Der Name darf nur maximal 8 Buchstaben lang sein!!"
       - queue clear
       }
     - if <c.args.get[3]||null> == null {
       - narrate "<yellow>[DropWorld] <gray>Bitte gib eine Wahrscheinlichkeit noch an!" 
       - queue clear
       }
     - if <c.args.get[3].as_int||null> == null {
       - narrate "<yellow>[DropWorld] <gray>Es sollte schon eine Zahl sein!"
       - queue clear 
       }    
     - if <c.args.get[3]> <= 0 || <c.args.get[3]> > 1000 {
       - narrate "<yellow>[DropWorld] <gray>Es stehen dir Zahlen zwischen 1 und 1000 zur Verf<&uuml>gung!" 
       - queue clear 
       }    
     - define name <c.args.get[2]>
     - define location <player.location.simple>
     - define wahrscheinlichkeit <c.args.get[3]>
     - define sichtwinkel <player.location.cursor_on.add[0.5,0,0.5]>
     - narrate %sichtwinkel%
     - foreach <player.location.find.blocks[chest].within[10]> {
       - if %value% == %sichtwinkel% {
         - define slotzahl 1
         - while true {      
           - define itemm <%value%.inventory.slot[<def[slotzahl].as_int>].simple>
           - if <%value%.inventory.slot[1].simple> == i@air {
             - narrate "<yellow>[DropWorld] <red> Es muss aufjedenfall in Slot 1 ein Item sein! Dies wird immer gedropt egal welche wahrscheinlichkeit, dient dazu immer ein item spawnen zu lassen!"
             - queue clear 
             }        
           - if %itemm% !== i@air {
             - define itemanzahl <%value%.inventory.qty[%itemm%].as_int>
             - if <yaml[spawning].list_keys[Drop.%name%.item]> !contains %itemm% {
               - yaml id:spawning set Drop.%name%.item.%itemm%.itemanzahl:->:%itemanzahl%
               - yaml id:spawning set Drop.%name%.item.%itemm%.wahrscheinlichkeit:->:%wahrscheinlichkeit% 
               } 
             }
           - define slotzahl <math:%slotzahl%+1>
           - if <def[slotzahl]> == 28 {
             - narrate "<yellow>[DropWorld] <gray>Gespeichert als <yellow>N:<gray>[%name%] <yellow>O:<gray>[%location%] <yellow>I:<gray>[S. Kiste] <yellow>A:<gray>[S. Kiste] <yellow>W:<gray>[%wahrscheinlichkeit%]"
             - yaml id:spawning set Drop.%name%.Ort:->:%location%        
             - yaml savefile:dropeinstellung/spawning.yml id:spawning
             - queue clear 
             }
           } 
         }
       }
     - narrate "<yellow>[DropWorld] <red>Cursor muss sich auf einer Truhe in deiner n<&auml>he befinden!"
     - queue clear
     }
     - narrate "<yellow>[DropWorld] <red>Du hast auf diesen Befehl kein Zugriff!"
     - queue clear