Date: 2019/11/12 15:22:46 UTC-08: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
gladiatorarena:
type: assignment
actions:
on assignment:
- trigger name:click state:true
- trigger name:chat state:true
interact scripts:
- gladiatorarena_interact
#formatting ---------------------------------------------------
#I've committed to the "Talk" format so I'm not gonna change it. e.e
NPCTalk:
type: format
format: "<npc.name><&co> <&l>-<&l>-<&l>-<&l>> <&b><&l>You<&8><&co> <&6><text>"
ConsoleTalk:
type: format
format: "<&l><&o><&7><text>"
ErrorTalk:
type: format
format: "<&4>Error<&f><&co> <&f><text>"
#end formatting ------------------------------------------------
#Inventory
NPCinventory:
type: inventory
title: "<&6>Join Minigame?"
size: 9
definitions:
1: Yesitem
2: Noitem
3:
slots:
- "[] [] [] [1] [] [2] [] [] []"
#Inventory event handler
NPCinventory_handler:
type: world
events:
on player clicks in NPCinventory priority:100:
- determine passively cancelled
on player drags in NPCinventory priority:100:
- determine passively cancelled
on player clicks yesitem in NPCinventory:
- if <player.has_flag[allowcmd]>:!
- inventory close
- narrate format:errortalk "Error! you dont have permission to execute this!"
- stop
- inventory close
- narrate "<&l><&o><&3>Loading..."
- permission add minigame.minigame group:default
- execute as_player "mg join EMGladiatorArena"
- permission remove minigame.minigame
- flag player allowcmd:!
- wait 1s
- narrate "<&l><&o><&a>Loaded!"
on player clicks noitem in NPCinventory:
- if <player.has_flag[allowcmd]>:!
- inventory close
- narrate "<&4>Error<&r><&co> <&f>Error! you dont have permission to execute this!"
- stop
- narrate "<&l><&o><&3>Loading..."
- inventory clear d:NPCinventory
- inventory set i@yesitem d:in@NPCinventory slot:7
- narrate "<&l><&o><&a>Done"
#Items ---------------------------------------------------
Yesitem:
type: item
material: lime_stained_glass_pane
display name: "<&l><&a>Yes!"
Noitem:
type: item
material: red_stained_glass_pane
display name: "<&l><&4>No!"
#End items -----------------------------------------------
#Commands to run -----------------------------------------
yesgladiatorarena:
type: command
name: yesgladiatorarena
description: "The yes command for the JG script"
usage: /
allowed help:
- determine false
script:
- if <player.has_flag[allowcmd]>:!
- narrate "<&4>Error<&r><&co> <&f>Error! you dont have permission to execute this!"
- stop
- flag player allowcmd:!
- narrate "<&l><&o><&3>Loading..."
- zap 2 gladiatorarena_interact
- narrate "<&l><&o><&a>Loaded!"
- narrate format:consoletalk "Interact with the NPC to continue"
nogladiatorarena:
type: command
name: nogladiatorarena
description: "The no command for the JG script"
usage: /
allowed help:
- determine false
script:
- flag player npc_engaged
- if <player.has_flag[allowcmd]>:!
- narrate "<&4>Error<&r><&co> <&f>Error! you dont have permission to execute this!"
- stop
- flag player allowcmd:!
- narrate format:NPCTalk "Okay, bye then!"
- flag player npc_engaged:!
- narrate format:ConsoleTalk "The npc is no longer interacting with you!"
- stop
joinmg:
type: command
name: "joinmg"
description: "The join command for the minigame EMGladiatorArena"
usage: /
allowed help:
- determine false
script:
- if <player.has_flag[allowcmd]>:!
- narrate "<&4>Error<&r><&co> <&f>Error! you dont have permission to execute this!"
- stop
- flag player allowcmd:!
#Commands end --------------------------------------------
#Interact script
gladiatorarena_interact:
type: interact
steps:
1:
click trigger:
script:
- flag player npc_engaged
- if <player.has_flag[clicked]>:
#If player clicks more than once
- narrate format:errortalk "Error! You've clicked more than once!"
- wait 10s
- flag player clicked:!
- flag player npc_engaged:!
- stop
- if <player.has_flag[hasrunnarrate]>:
- if <player.has_flag[clicked]>:
#If player clicks more than once after running narrate
- narrate format:errortalk "Error! You've clicked more than once!"
- wait 10s
- flag player clicked:!
- flag player npc_engaged:!
- stop
- flag player allowcmd
- narrate format:NPCTalk "Would you like to join the arena?"
- wait 2s
- inventory open D:in@NPCinventory
- flag player npc_engaged:!
- stop
- flag player clicked
- flag player allowcmd
- narrate format:NPCTalk "Welcome, would you like some information about the arena?"
- narrate "<&l><&7>~<&l><&0>~<element[<&a><&l>Yes!].on_click[/yesgladiatorarena].type[run_command].on_hover[<&c>Click <&f>to learn more from this <&k>v<&4><&o><&b>shady <&b>individual<&k>v]><&l><&0>~<&l><&7>~<&r> <&6><&l>| <&l><&7>~<&l><&0>~<element[<&4><&l>No!].on_click[/nogladiatorarena].type[run_command].on_hover[<&c>Click <&f>to walk away from this <&k>v<&4><&o><&b>shady <&b>individual<&k>v]><&l><&0>~<&l><&7>~<&r>"
- flag player npc_engaged:!
2:
click trigger:
script:
- flag player npc_engaged
- zap 2
- narrate format:consoletalk "Interact with the NPC to continue"
- flag player npc_engaged:!
3:
click trigger:
script:
- flag player npc_engaged
- flag player hasrunnarrate
- zap 1
- narrate format:consoletalk "Interact with the NPC to continue"
- flag player npc_engaged:!