Date: 2015/07/22 13:55:51 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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<ü>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<ä>he befinden!"
- queue clear
}
- narrate "<yellow>[DropWorld] <red>Du hast auf diesen Befehl kein Zugriff!"
- queue clear