Date: 2016/03/11 14:52:29 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
Chat_Channels:
type: world
events:
on player chats:
- determine passively cancelled
- choose <player.flag[chat_channel]>:
- case global:
- announce format:GlobalChat_Format <c.message>
- case local:
- narrate format:LocalChat_Format <c.message> targets:<pl.location.find.players.within[20]>
- case trade:
- if <pl.location.cuboids.filter[contains[_town]].size.is[LESS].than[1]> {
- narrate "<&4>You cannot use Trade Chat unless you are in a town."
- queue clear
}
- narrate format:TradeChat_Format <c.message> targets:<pl.location.cuboids.filter[contains[_town]].get[1].list_players>
on global command:
- determine passively fulfilled
- if <player.flag[chat_channel].is[==].to[global]> {
- narrate "<&4>Your default channel is already Global Chat."
} else {
- narrate "<&3>Set your chat channel to <&8><&lb><&7>Global<&8><&rb>"
- flag player chat_channel:global
}
on trade command:
- determine passively fulfilled
- if <player.flag[chat_channel].is[==].to[trade]> {
- narrate "<&4>Your default channel is already Trade Chat."
} else {
- narrate "<&3>Set your chat channel to <&8><&lb><&5>Trade<&8><&rb>"
- flag player chat_channel:trade
}
on local command:
- determine passively fulfilled
- if <player.flag[chat_channel].is[==].to[local]> {
- narrate "<&4>Your default channel is already Local."
} else {
- narrate "<&3>Set your chat channel to <&2><&lb>Local<&rb>"
- flag player chat_channel:local
}
on player joins:
- if <player.has_flag[chat_channel].not> {
- flag player chat_channel:local
}
LocalChat_Format:
type: format
format: <&2><&lb><player.name><&rb><&co> <&f><text>
format: <&2><&lb><player.name><&rb><&co> <&f><text>
GlobalChat_Format:
type: format
format: <&8><&lb><&7>Global<&8><&rb> <&8><&lb><player.name><&rb><&co> <&a><text>
TradeChat_Format:
type: format
format: <&8><&lb><&5><player.location.cuboids.filter[contains[_town]].get[1].before[_town].to_titlecase> Trade<&8><&rb> <&d><&lb><player.name><&rb><&co> <&b><text>