-Drop: +create: - type: command - speed: 0 - debug: false - name: Drop - description: Setze Drops - usage: /drops - aliases: - - drops - allowed help: - - determine true - - commandArgs: - setzen: - usage: '/drop setzen' - erzeugen: - usage: '/drop erzeugen' - loeschen: - usage: '/drop loeschen' - anzeige: - usage: '/drop anzeige' - hinzu: - usage: 'drop hinzu' - - script: - - define command '' - - define args '' - - if ! { - - inject local help - } - else { - - inject local %command% } - - setzen: - - if { - - if == null { - - narrate "[DropWorld] Du musst diesen Ort einen Namen geben!" - - queue clear } - - if contains { - - narrate "[DropWorld] Der Name exestiert schon!" - - queue clear } - - if >= 9 { - - narrate "[DropWorld] Der Name darf nur maximal 8 Buchstaben lang sein!!" - - queue clear } - - if == null { - - narrate "[DropWorld] Bitte gib eine Wahrscheinlichkeit noch an!" - - queue clear } - - if == null { - - narrate "[DropWorld] Es sollte schon eine Zahl sein!" - - queue clear } - - if <= 0 || > 1000 { - - narrate "[DropWorld] Es stehen dir Zahlen zwischen 1 und 1000 zur Verf<ü>gung!" - - queue clear } - - define name - - define location - - define wahrscheinlichkeit - - define sichtwinkel - - narrate %sichtwinkel% - - foreach { - - if %value% == %sichtwinkel% { - - define slotzahl 1 - - while true { - - define itemm <%value%.inventory.slot[].simple> - - if <%value%.inventory.slot[1].simple> == i@air { - - narrate "[DropWorld] 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 !contains %itemm% { - - yaml id:spawning set Drop.%name%.item.%itemm%.itemanzahl:->:%itemanzahl% - - yaml id:spawning set Drop.%name%.item.%itemm%.wahrscheinlichkeit:->:%wahrscheinlichkeit% } } - - define slotzahl - - if == 28 { - - narrate "[DropWorld] Gespeichert als N:[%name%] O:[%location%] I:[S. Kiste] A:[S. Kiste] W:[%wahrscheinlichkeit%]" - - yaml id:spawning set Drop.%name%.Ort:->:%location% - - yaml savefile:dropeinstellung/spawning.yml id:spawning - - queue clear } - } - } - } - - narrate "[DropWorld] Cursor muss sich auf einer Truhe in deiner n<ä>he befinden!" - - queue clear - } - - narrate "[DropWorld] Du hast auf diesen Befehl kein Zugriff!" - - queue clear - - loeschen: - - if { - - if == null { - - narrate "[DropWorld] Du musst diesen Ort einen Namen geben!" - - queue clear } - - if !contains { - - narrate "[DropWorld] Der Name exestiert nicht in deiner Liste!" - - queue clear } - - define name - - narrate "[DropWorld] Deine Position %name% wurde gel<ö>scht!" - - yaml id:spawning set Drop.%name%:! - - yaml savefile:dropeinstellung/spawning.yml id:spawning - - queue clear - } - - narrate "[DropWorld] Du hast auf diesen Befehl kein Zugriff!" - - queue clear - - erzeugen: - if || { - - define eingabe - - if %eingabe% == null { - - narrate "[DropWorld] Bitte gib einen Namen ein!" + - define args + - if %args% == null { + - narrate "[DropWorld] Please enter a name!" - queue clear } - - if !contains %eingabe% { - - narrate "[DropWorld] Der Name exestiert nicht in der Liste!" + - if !contains %args% { + - narrate "[DropWorld] The name does not exist in that list!" - queue clear - } - - define ort - - foreach { + } + - define location + - foreach { - narrate %value% - - flag server item_%eingabe%:->:%value% + - flag server item_%args%:->:%value% } - - define itemm + - define itemm - if %itemm% == null { - queue clear } - - define itemanzahl - - define wahrscheinlichkeit .wahrscheinlichkeit].as_string> + - define itemcount + - define probability .probability].as_string> - if <= %wahrscheinlichkeit% { - - drop %itemm% location:%ort% qty:%itemanzahl% - - flag server item_%eingabe%:! - - narrate "wurde gespawnt: %itemm% mit %wahrscheinlichkeit%" + - drop %itemm% location:%location% qty:%itemcount% + - flag server item_%args%:! + - narrate "wurde gespawnt: %itemm% mit %probability%" - queue clear } else { - - drop %itemm% location:%ort% qty:%itemanzahl% - - flag server item_%eingabe%:! + - drop %itemm% location:%location% qty:%itemcount% + - flag server item_%args%:! - queue clear } } - - narrate "[DropWorld] Du hast auf diesen Befehl kein Zugriff!" + - narrate "[DropWorld] You are not allowed to use this command!" - - queue clear - - anzeige: - - if { - - define count 1 - - narrate "_______________[Drop World]_______________" - - narrate "" - - foreach { - - narrate "[] N: %value% O: I: A: W: " - - define count } - queue clear - } - - narrate "[DropWorld] Du hast auf diesen Befehl kein Zugriff!" - - queue clear - - help: - - if { - - narrate "_______________[Drop World]_______________" - - narrate "" - - narrate "/drop setzen NAME ITEMANZAHL WAHRSCHEINLICHKEIT [Drop-Punkt unter Spieler]" - - narrate "/drop loeschen NAME [L<ö>scht den Drop-Punkt]" - - narrate "/drop erzeugen NAME [Spawnt Item am Drop-Punkt]" - - narrate "/drop anzeige [Zeigt alle Drop-Orte an]" - }