Date: 2016/04/23 08:41:17 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# This is the first mage special ability - there is a 1 in 8 chance that every (hostile) mob in 20 blocks will be struck by lightning when a player hits an entity. I pinched (and edited) this from darthriddle's Sword of Purity so credit to him
mage:
type: world
debug: false
events:
on player damages entity:
- if <player.has_permission[class.mage]> && <util.random.int[1].to[8]> == 2 {
- foreach <player.location.find.entities[zombie|creeper|enderman|skeleton|pig_zombie|wither_skeleton|spider].within[20]> {
- strike <def[value].location>
}
}
on player damaged by lightning:
- if <player.has_permission[class.mage]> {
- determine cancelled
}
classes:
type: command
debug: true
name: class
script:
# This deals with the race section of classes.
- if <context.args.get[1].is[==].to[race]> {
# This is a list of races players can choose along with classes for each race.
- if <context.args.get[2].is[==].to[list]> {
- narrate "<&2>[Classes] <&a>You may choose one of three races."
- narrate "<&2>[Classes] <&1>The agile (+100 Acrobatics) Elf is capable of healing magic (/c prayer and /c heal)."
- narrate "<&2>[Classes] <&1>Elf classes are Guardian, Herbalist, Woodsman."
- narrate "<&2>[Classes] <&3>The Dwarf is a capable miner (+100 Mining) and can sense nearby ores (/c dowse and /c stonevision)."
- narrate "<&2>[Classes] <&3>Dwarf classes are Blacksmith, Warrior, Miner."
- narrate "<&2>[Classes] <&6>The strong (+100 Swords +100 Unarmed) Human cannot use magic without specialist training."
- narrate "<&2>[Classes] <&6>Human classes are Soldier, Mage, Builder."
- determine fulfilled
}
- if <player.flag[racechosen]> {
- narrate "<&c>[Classes] You have already chosen a race."
- determine cancelled
}
# These are the three races players can choose currently - it might be possible to add donator or perk unlocked races.
- if <context.args.get[2].is[==].to[elf]> {
- ^execute as_server "addlevels <PLAYER.NAME> acrobatics 100"
- ^execute as_server "pex user <PLAYER.NAME> group add elf"
- flag player elf
- flag player racechosen
- narrate "Your race is now <context.args.get[2]>"
}
- if <context.args.get[2].is[==].to[dwarf]> {
- ^execute as_server "addlevels <PLAYER.NAME> mining 100"
- ^execute as_server "pex user <PLAYER.NAME> group add dwarf"
- flag player dwarf
- flag player racechosen
- narrate "Your race is now <context.args.get[2]>"
}
- if <context.args.get[2].is[==].to[human]]> {
- ^execute as_server "addlevels <PLAYER.NAME> swords 100"
- ^execute as_server "addlevels <PLAYER.NAME> unarmed 100"
- flag player human
- flag player racechosen
- narrate "Your race is now <context.args.get[2]>"
}
}
# This is the class help command, it gives information about the entire classes system
- if <context.args.get[1].is[==].to[help]> {
- narrate "<&2>[Classes] <&a>You may choose one of three races and one of three unique classses for that race."
- narrate "<&2>[Classes] <&a>Each race and class will give you different MCMMO boosts and a passive or active skill."
- narrate "<&2>[Classes] <&a>Use /class race <racename> to choose your race."
- narrate "<&2>[Classes] <&a>Use /class class <classname> choose your class."
- narrate "<&2>[Classes] <&a>Use /class race list to list races."
- narrate "<&2>[Classes] <&a>Use /class class list to list classes for each race."
}
# This is the class list, it lists classes and bonuses by race
- if <context.args.get[1].is[==].to[class]> {
- if <context.args.get[2].is[==].to[list]> {
- narrate "<&2>[Classes] <&a>You may choose one of three classes for each race."
- narrate "<&2>[Classes] <&1>Elf Guardians are excellent fighters (+75 Swords +75 Archery)."
- narrate "<&2>[Classes] <&1>Elf Herbalists can forage well (+25 Herbalism) and nature flourishes in their presence (/c tree and /c lifewalk)."
- narrate "<&2>[Classes] <&1>An Elf woodsman is completely at home in the wilderness (+75 Taming) (+75 Fishing)."
- narrate "<&2>[Classes] <&3>Dwarf Blacksmiths excell at forging and repairing armour. (+100 Repair and /c armor)"
- narrate "<&2>[Classes] <&3>Dwarf Warriors are trained in all forms of combat (+25 Archery +50 Swords +50 Axes +25 Unarmed)"
- narrate "<&2>[Classes] <&3>Dwarf Miners can dig a hole in seconds (+75 Mining +75 Excavation)"
- narrate "<&2>[Classes] <&6>Human Soldiers are strong with conventional weapons (+75 Swords +75 Archery)"
- narrate "<&2>[Classes] <&6>Human Mages are at their best when fighting mobs (Special passive ability)"
- narrate "<&2>[Classes] <&6>Human Builders can find materials anywhere (+75 Woodcutting +75 Excavation)"
}
# This makes sure that players cannot repeatedly choose classes. This might be phased out if I can work out how to subtract mcmmo levels
- if <player.flag[classchosen]> {
- narrate "<&c>[Classes] You have already chosen a class."
- determine cancelled
}
# Moving on to the elven classes now
- if <context.args.get[2].is[==].to[guardian]> && <player.flag[elf]> {
- ^execute as_server "addlevels <PLAYER.NAME> swords 75"
- ^execute as_server "addlevels <PLAYER.NAME> archery 75"
- flag player guardian
- flag player classchosen
- narrate "Your class is now <context.args.get[2]>"
} else {
- narrate "<&c>[Classes] Your race cannot choose this class."
}
- if <context.args.get[2].is[==].to[herbalist]> && <player.flag[elf]> {
- ^execute as_server "addlevels <PLAYER.NAME> herbalism 25"
- ^execute as_server "pex user <PLAYER.NAME> group add herbalist"
- flag player herbalist
- flag player classchosen
- narrate "Your class is now <context.args.get[2]>"
} else {
- narrate "<&c>[Classes] Your race cannot choose this class."
}
- if <context.args.get[2].is[==].to[woodsman]> && <player.flag[elf]> {
- ^execute as_server "addlevels <PLAYER.NAME> taming 75"
- ^execute as_server "addlevels <PLAYER.NAME> fishing 75"
- flag player woodsman
- flag player classchosen
- narrate "Your class is now <context.args.get[2]>"
} else {
- narrate "<&c>[Classes] Your race cannot choose this class."
}
# The next three classes are the dwarven classes
- if <context.args.get[2].is[==].to[blacksmith]> && <player.flag[dwarf]> {
- ^execute as_server "addlevels <PLAYER.NAME> repair 100"
- ^execute as_server "pex user <PLAYER.NAME> group add blacksmith"
- flag player blacksmith
- flag player classchosen
- narrate "Your class is now <context.args.get[2]>"
} else {
- narrate "<&c>[Classes] Your race cannot choose this class."
}
- if <context.args.get[2].is[==].to[warrior]> && <player.flag[dwarf]> {
- ^execute as_server "addlevels <PLAYER.NAME> swords 50"
- ^execute as_server "addlevels <PLAYER.NAME> axes 50"
- ^execute as_server "addlevels <PLAYER.NAME> archery 25"
- ^execute as_server "addlevels <PLAYER.NAME> unarmed 25"
- flag player warrior
- flag player classchosen
- narrate "Your class is now <context.args.get[2]>"
} else {
- narrate "<&c>[Classes] Your race cannot choose this class."
}
- if <context.args.get[2].is[==].to[miner]> && <player.flag[dwarf]> {
- ^execute as_server "addlevels <PLAYER.NAME> excavation 75"
- ^execute as_server "addlevels <PLAYER.NAME> mining 75"
- flag player miner
- flag player classchosen
- narrate "Your class is now <context.args.get[2]>"
} else {
- narrate "<&c>[Classes] Your race cannot choose this class."
}
# Last but not least are the 3 human classes.
- if <context.args.get[2].is[==].to[soldier]> && <player.flag[human]> {
- ^execute as_server "addlevels <PLAYER.NAME> swords 75"
- ^execute as_server "addlevels <PLAYER.NAME> archery 75"
- flag player soldier
- flag player classchosen
- narrate "Your class is now <context.args.get[2]>"
} else {
- narrate "<&c>[Classes] Your race cannot choose this class."
}
- if <context.args.get[2].is[==].to[mage]> && <player.flag[human]> {
- ^execute as_server "pex user <PLAYER.NAME> add class.mage"
- flag player mage
- flag player classchosen
- narrate "Your class is now <context.args.get[2]>"
} else {
- narrate "<&c>[Classes] Your race cannot choose this class."
}
- if <context.args.get[2].is[==].to[builder]> && <player.flag[human]> {
- ^execute as_server "addlevels <PLAYER.NAME> woodcutting 75"
- ^execute as_server "addlevels <PLAYER.NAME> excavation 75"
- flag player builder
- flag player classchosen
- narrate "Your class is now <context.args.get[2]>"
} else {
- narrate "<&c>[Classes] Your race cannot choose this class."
}
}
}
deflagger:
type: assignment
interact scripts:
- 10 flagrace
deflagger2:
type: assignment
interact scripts:
- 10 flagclass
flagrace:
type: interact
steps:
1:
click trigger:
script:
- flag player racechosen:!
flagclass:
type: interact
steps:
1:
click trigger:
script:
- flag player classchosen:!
#####################################################################
ERROR:
while parsing a block mapping
in "<unicode string>", line 19, column 4:
type: command
^
expected <block end>, but found '<block sequence start>'
in "<unicode string>", line 26, column 5:
- if <context.args.get[2].is[==] ...