Initial commit
This commit is contained in:
418
scripts/chat/chat_commands.dsc
Normal file
418
scripts/chat/chat_commands.dsc
Normal file
@@ -0,0 +1,418 @@
|
||||
chat_command_ooc:
|
||||
debug: false
|
||||
type: command
|
||||
name: ooc
|
||||
usage: /ooc (message)
|
||||
description: Sends a message in global OOC.
|
||||
permission: chat.command.chat.ooc
|
||||
tab completions:
|
||||
1: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 0:
|
||||
- if !<player.has_flag[chat_disableooc]>:
|
||||
- if <player.flag[chat_channel].if_null[ic]> == ooc:
|
||||
- narrate "<&c>You are currently switched to OOC chat, so you cannot disable it."
|
||||
- stop
|
||||
- flag <player> chat_disableooc:true
|
||||
- narrate format:formats_prefix "Disabled OOC chat."
|
||||
- else:
|
||||
- flag <player> chat_disableooc:!
|
||||
- narrate format:formats_prefix "Enabled OOC chat."
|
||||
- stop
|
||||
- else if <player.has_flag[chat_disableooc]>:
|
||||
- narrate "<&c>You cannot use OOC chat while it is disabled. Please enable it first."
|
||||
- stop
|
||||
- run chat_channel_ooc def.player:<player> def.message:<context.raw_args.escaped.replace[&].with[&\]>
|
||||
|
||||
chat_command_looc:
|
||||
debug: false
|
||||
type: command
|
||||
name: looc
|
||||
usage: /looc (message)
|
||||
description: Sends a message in local LOOC.
|
||||
permission: chat.command.chat.looc
|
||||
tab completions:
|
||||
1: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 0:
|
||||
- narrate "<&c>Please enter a message!"
|
||||
- stop
|
||||
- run chat_channel_looc def.player:<player> def.message:<context.raw_args.escaped.replace[&].with[&\]>
|
||||
|
||||
chat_command_me:
|
||||
debug: false
|
||||
type: command
|
||||
name: me
|
||||
usage: /me (message)
|
||||
description: Sends a message in IC, 1st person action.
|
||||
permission: chat.command.chat.me
|
||||
tab completions:
|
||||
1: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 0:
|
||||
- narrate "<&c>Please enter a message!"
|
||||
- stop
|
||||
- run chat_channel_ic_me def.player:<player> def.message:<context.raw_args.parse_color.escaped.replace[&].with[&\]>
|
||||
|
||||
chat_command_meclose:
|
||||
debug: false
|
||||
type: command
|
||||
name: meclose
|
||||
usage: /meclose (message)
|
||||
aliases:
|
||||
- mec
|
||||
description: Sends a message in IC, 1st person action, close range.
|
||||
permission: chat.command.chat.mec
|
||||
tab completions:
|
||||
1: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 0:
|
||||
- narrate "<&c>Please enter a message!"
|
||||
- stop
|
||||
- run chat_channel_ic_mec def.player:<player> def.message:<context.raw_args.parse_color.escaped.replace[&].with[&\]>
|
||||
|
||||
chat_command_melong:
|
||||
debug: false
|
||||
type: command
|
||||
name: melong
|
||||
usage: /melong (message)
|
||||
aliases:
|
||||
- mel
|
||||
description: Sends a message in IC, 1st person action, long range.
|
||||
permission: chat.command.chat.mel
|
||||
tab completions:
|
||||
1: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 0:
|
||||
- narrate "<&c>Please enter a message!"
|
||||
- stop
|
||||
- run chat_channel_ic_mel def.player:<player> def.message:<context.raw_args.parse_color.escaped.replace[&].with[&\]>
|
||||
|
||||
chat_command_whisper:
|
||||
debug: false
|
||||
type: command
|
||||
name: whisper
|
||||
usage: /whisper (message)
|
||||
aliases:
|
||||
- w
|
||||
description: Sends a message in IC, whispering.
|
||||
permission: chat.command.chat.whisper
|
||||
tab completions:
|
||||
1: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 0:
|
||||
- narrate "<&c>Please enter a message!"
|
||||
- stop
|
||||
- run chat_channel_ic_whisper def.player:<player> def.message:<context.raw_args.parse_color.escaped.replace[&].with[&\]>
|
||||
|
||||
chat_command_yell:
|
||||
debug: false
|
||||
type: command
|
||||
name: yell
|
||||
usage: /yell (message)
|
||||
aliases:
|
||||
- y
|
||||
description: Sends a message in IC, yelling.
|
||||
permission: chat.command.chat.yell
|
||||
tab completions:
|
||||
1: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 0:
|
||||
- narrate "<&c>Please enter a message!"
|
||||
- stop
|
||||
- run chat_channel_ic_yell def.player:<player> def.message:<context.raw_args.parse_color.escaped.replace[&].with[&\]>
|
||||
|
||||
chat_command_my:
|
||||
debug: false
|
||||
type: command
|
||||
name: my
|
||||
usage: /my (message)
|
||||
description: Sends a message in IC, 1st person possessive.
|
||||
permission: chat.command.chat.my
|
||||
tab completions:
|
||||
1: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 0:
|
||||
- narrate "<&c>Please enter a message!"
|
||||
- stop
|
||||
- run chat_channel_ic_my def.player:<player> def.message:<context.raw_args.parse_color.escaped.replace[&].with[&\]>
|
||||
|
||||
chat_command_it:
|
||||
debug: false
|
||||
type: command
|
||||
name: it
|
||||
usage: /it (message)
|
||||
description: Sends a message in IC, 3rd person action.
|
||||
permission: chat.command.chat.it
|
||||
tab completions:
|
||||
1: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 0:
|
||||
- narrate "<&c>Please enter a message!"
|
||||
- stop
|
||||
- run chat_channel_ic_it def.player:<player> def.message:<context.raw_args.parse_color.escaped.replace[&].with[&\]>
|
||||
|
||||
chat_command_itclose:
|
||||
debug: false
|
||||
type: command
|
||||
name: itclose
|
||||
usage: /itclose (message)
|
||||
aliases:
|
||||
- itc
|
||||
description: Sends a message in IC, 3rd person action, close range.
|
||||
permission: chat.command.chat.itc
|
||||
tab completions:
|
||||
1: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 0:
|
||||
- narrate "<&c>Please enter a message!"
|
||||
- stop
|
||||
- run chat_channel_ic_itc def.player:<player> def.message:<context.raw_args.parse_color.escaped.replace[&].with[&\]>
|
||||
|
||||
chat_command_itl:
|
||||
debug: false
|
||||
type: command
|
||||
name: itlong
|
||||
usage: /itlong (message)
|
||||
aliases:
|
||||
- itl
|
||||
description: Sends a message in IC, 3rd person action, long range.
|
||||
permission: chat.command.chat.itl
|
||||
tab completions:
|
||||
1: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 0:
|
||||
- narrate "<&c>Please enter a message!"
|
||||
- stop
|
||||
- run chat_channel_ic_itl def.player:<player> def.message:<context.raw_args.parse_color.escaped.replace[&].with[&\]>
|
||||
|
||||
chat_command_languageadd:
|
||||
debug: false
|
||||
type: command
|
||||
name: languageadd
|
||||
usage: /languageadd (player) (language)
|
||||
aliases:
|
||||
- langadd
|
||||
description: Allows a user to speak a new language.
|
||||
permission: chat.command.admin.languageadd
|
||||
tab completions:
|
||||
1: <server.online_players.parse[name]>
|
||||
2: <script[chat_data_languages].data_key[known]>
|
||||
script:
|
||||
- if <context.args.size> < 2:
|
||||
- narrate "<&c>Invalid use. Please try /<context.alias> (player) (language)."
|
||||
- stop
|
||||
- define player <server.match_offline_player[<context.args.get[1]>].if_null[null]>
|
||||
- if <[player]> == null:
|
||||
- narrate "<&c>A player with name <context.args.get[1]> was not found."
|
||||
- stop
|
||||
- define language <context.args.get[2].to_sentence_case>
|
||||
- define known <script[chat_data_languages].data_key[known]>
|
||||
- if !<[known].contains[<[language]>]>:
|
||||
- narrate "<&c>Language <[language]> is not a known language."
|
||||
- stop
|
||||
- flag <[player]> chat_languages:<[player].flag[chat_languages].if_null[<list[]>].include[<[language]>].deduplicate>
|
||||
- narrate format:formats_prefix "Player <&e><[player].name> <&7>may now speak in <[language]>."
|
||||
|
||||
chat_command_languageremove:
|
||||
debug: false
|
||||
type: command
|
||||
name: languageremove
|
||||
usage: /languageremove (player) (language)
|
||||
aliases:
|
||||
- langremove
|
||||
- langrem
|
||||
description: Removes a language that a player knows.
|
||||
permission: chat.command.admin.languageremove
|
||||
tab completions:
|
||||
1: <server.online_players.parse[name]>
|
||||
2: <script[chat_data_languages].data_key[known]>
|
||||
script:
|
||||
- if <context.args.size> < 2:
|
||||
- narrate "<&c>Invalid use. Please try /<context.alias> (player) (language)."
|
||||
- stop
|
||||
- define player <server.match_offline_player[<context.args.get[1]>].if_null[null]>
|
||||
- if <[player]> == null:
|
||||
- narrate "<&c>A player with name <context.args.get[1]> was not found."
|
||||
- stop
|
||||
- define language <context.args.get[2].to_sentence_case>
|
||||
- define known <script[chat_data_languages].data_key[known]>
|
||||
- if !<[known].contains[<[language]>]>:
|
||||
- narrate "<&c>Language <[language]> is not a known language."
|
||||
- stop
|
||||
- flag <[player]> chat_languages:<[player].flag[chat_languages].if_null[<list[]>].exclude[<[language]>]>
|
||||
- narrate format:formats_prefix "Player <&e><[player].name> <&7>cannot speak <[language]> any longer."
|
||||
|
||||
chat_command_language:
|
||||
debug: false
|
||||
type: command
|
||||
name: language
|
||||
usage: /language (language) (message)
|
||||
aliases:
|
||||
- lang
|
||||
description: Sends a message in IC, in a language.
|
||||
permission: chat.command.chat.language
|
||||
tab completions:
|
||||
1: <player.flag[chat_languages].if_null[<list[]>]>
|
||||
2: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 1:
|
||||
- narrate "<&c>Invalid use. Please use /<context.alias> (language) (message)."
|
||||
- stop
|
||||
- define language <context.args.get[1].to_sentence_case>
|
||||
- if !<player.flag[chat_languages].contains[<[language]>].if_null[false]>:
|
||||
- narrate "<&c>Your character cannot speak in <[language]>."
|
||||
- stop
|
||||
- run chat_channel_ic_language def.player:<player> def.message:<context.raw_args.split.get[2].to[last].space_separated.parse_color.escaped.replace[&].with[&\]> def.language:<[language]>
|
||||
|
||||
chat_command_languagewhisper:
|
||||
debug: false
|
||||
type: command
|
||||
name: languagewhisper
|
||||
usage: /languagewhisper (language) (message)
|
||||
aliases:
|
||||
- langwhisper
|
||||
- langw
|
||||
description: Sends a message in IC, in a language, whispering.
|
||||
permission: chat.command.chat.languagewhisper
|
||||
tab completions:
|
||||
1: <player.flag[chat_languages].if_null[<list[]>]>
|
||||
2: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 1:
|
||||
- narrate "<&c>Invalid use. Please use /<context.alias> (language) (message)."
|
||||
- stop
|
||||
- define language <context.args.get[1].to_sentence_case>
|
||||
- if !<player.flag[chat_languages].contains[<[language]>].if_null[false]>:
|
||||
- narrate "<&c>Your character cannot speak in <[language]>."
|
||||
- stop
|
||||
- run chat_channel_ic_languagewhisper def.player:<player> def.message:<context.raw_args.split.get[2].to[last].space_separated.parse_color.escaped.replace[&].with[&\]> def.language:<[language]>
|
||||
|
||||
chat_command_languageyell:
|
||||
debug: false
|
||||
type: command
|
||||
name: languageyell
|
||||
usage: /languageyell (language) (message)
|
||||
aliases:
|
||||
- langyell
|
||||
- langy
|
||||
description: Sends a message in IC, in a language, yelling.
|
||||
permission: chat.command.chat.languageyell
|
||||
tab completions:
|
||||
1: <player.flag[chat_languages].if_null[<list[]>]>
|
||||
2: <<>message<>>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 1:
|
||||
- narrate "<&c>Invalid use. Please use /<context.alias> (language) (message)."
|
||||
- stop
|
||||
- define language <context.args.get[1].to_sentence_case>
|
||||
- if !<player.flag[chat_languages].contains[<[language]>].if_null[false]>:
|
||||
- narrate "<&c>Your character cannot speak in <[language]>."
|
||||
- stop
|
||||
- run chat_channel_ic_languageyell def.player:<player> def.message:<context.raw_args.split.get[2].to[last].space_separated.parse_color.escaped.replace[&].with[&\]> def.language:<[language]>
|
||||
|
||||
##
|
||||
## Channel switch
|
||||
##
|
||||
|
||||
chat_command_channelswitch:
|
||||
debug: false
|
||||
type: command
|
||||
name: channelswitch
|
||||
usage: /channelswitch (channel)
|
||||
aliases:
|
||||
- chsw
|
||||
description: Changes your main channel.
|
||||
permission: chat.command.channelswitch
|
||||
tab completions:
|
||||
1: <list[ic|ooc]>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 0:
|
||||
- narrate "<&c>Invalid use. Please use /<context.alias> (channel)."
|
||||
- stop
|
||||
- define channel <context.args.get[1].to_lowercase>
|
||||
- choose <[channel]>:
|
||||
- case ic:
|
||||
- flag <player> chat_channel:ic
|
||||
- narrate format:formats_prefix "Changed channel to IC."
|
||||
- stop
|
||||
- case ooc:
|
||||
- if <player.has_flag[chat_disableooc]>:
|
||||
- narrate "<&c>You currently have OOC disabled. Use /ooc first to enable it."
|
||||
- stop
|
||||
- flag <player> chat_channel:ooc
|
||||
- narrate format:formats_prefix "Changed channel to OOC."
|
||||
- stop
|
||||
- narrate "<&c>Unknown channel <[channel]>. Please try: ic, ooc."
|
||||
|
||||
##
|
||||
## Chat Color
|
||||
##
|
||||
|
||||
chat_command_chatcolor:
|
||||
debug: false
|
||||
type: command
|
||||
name: chatcolor
|
||||
usage: /chatcolor (color)
|
||||
description: Changes the chat color for your actions.
|
||||
permission: chat.command.chatcolor
|
||||
tab completions:
|
||||
1: <proc[chat_allowed_colors]>
|
||||
script:
|
||||
- if <context.source_type> != player:
|
||||
- narrate "<&c>Please run this command as a player."
|
||||
- stop
|
||||
- if <context.args.size> <= 0:
|
||||
- narrate "<&c>Invalid use. Please use /<context.alias> (color)."
|
||||
- stop
|
||||
- define color <context.args.get[1].to_lowercase>
|
||||
- if !<proc[chat_allowed_colors].contains[<[color]>]>:
|
||||
- narrate "<&c>You must choose a color from this list: <proc[chat_allowed_colors].comma_separated>"
|
||||
- stop
|
||||
- flag <player> chat_color:<element[&<color[<[color]>].hex>].parse_color>
|
||||
- narrate format:formats_prefix "Changed chat color to <element[&<color[<[color]>].hex>].parse_color><[color]>."
|
||||
142
scripts/chat/chat_data.dsc
Normal file
142
scripts/chat/chat_data.dsc
Normal file
@@ -0,0 +1,142 @@
|
||||
chat_data_languages:
|
||||
debug: false
|
||||
type: data
|
||||
# all languages allowed by Google Translate
|
||||
known:
|
||||
- Afrikaans
|
||||
- Akan
|
||||
- Albanian
|
||||
- Amharic
|
||||
- Arabic
|
||||
- Armenian
|
||||
- Assamese
|
||||
- Aymara
|
||||
- Azerbaijani
|
||||
- Bambara
|
||||
- Basque
|
||||
- Belarusian
|
||||
- Bengali
|
||||
- Bhojpuri
|
||||
- Bosnian
|
||||
- Bulgarian
|
||||
- Burmese
|
||||
- Catalan
|
||||
- Cebuano
|
||||
- Chewa
|
||||
- Chinese
|
||||
- Corsican
|
||||
- Croatian
|
||||
- Czech
|
||||
- Danish
|
||||
- Dhivehi
|
||||
- Dogri
|
||||
- Dutch
|
||||
#- English
|
||||
- Esperanto
|
||||
- Estonian
|
||||
- Ewe
|
||||
- Filipino
|
||||
- Finnish
|
||||
- French
|
||||
- Galician
|
||||
- Georgian
|
||||
- German
|
||||
- Goan Konkani
|
||||
- Greek
|
||||
- Guarani
|
||||
- Gujarati
|
||||
- Haitian Creole
|
||||
- Hausa
|
||||
- Hawaiian
|
||||
- Hebrew
|
||||
- Hindi
|
||||
- Hmong
|
||||
- Hungarian
|
||||
- Icelandic
|
||||
- Igbo
|
||||
- Ilocano
|
||||
- Indonesian
|
||||
- Irish
|
||||
- Italian
|
||||
#- Japanese
|
||||
- Javanese
|
||||
- Kannada
|
||||
- Kazakh
|
||||
- Khmer
|
||||
- Kinyarwanda
|
||||
- Konkani
|
||||
- Korean
|
||||
- Krio
|
||||
- Kurdish
|
||||
- Kyrgyz
|
||||
- Lao
|
||||
- Latin
|
||||
- Latvian
|
||||
- Lingala
|
||||
- Lithuanian
|
||||
- Luganda
|
||||
- Luxembourgish
|
||||
- Macedonian
|
||||
- Maithili
|
||||
- Malagasy
|
||||
- Malay
|
||||
- Malayalam
|
||||
- Maldivian
|
||||
- Maltese
|
||||
- Māori
|
||||
- Marathi
|
||||
- Meitei
|
||||
- Mizo
|
||||
- Mongolian
|
||||
- Nepali
|
||||
- Northern Sotho
|
||||
- Norwegian
|
||||
- Nyanja
|
||||
- Odia
|
||||
- Oromo
|
||||
- Pashto
|
||||
- Persian
|
||||
- Polish
|
||||
- Portuguese
|
||||
- Punjabi
|
||||
- Quechua
|
||||
- Romanian
|
||||
- Russian
|
||||
- Samoan
|
||||
- Sanskrit
|
||||
- Scottish Gaelic
|
||||
- Serbian
|
||||
- Shona
|
||||
- Sindhi
|
||||
- Sinhala
|
||||
- Slovak
|
||||
- Slovene
|
||||
- Somali
|
||||
- Sotho
|
||||
- Southern Quechua
|
||||
- Spanish
|
||||
- Sundanese
|
||||
- Swahili
|
||||
- Swedish
|
||||
- Tagalog
|
||||
- Tajik
|
||||
- Tamil
|
||||
- Tatar
|
||||
- Telugu
|
||||
- Thai
|
||||
- Tigrinya
|
||||
- Tsonga
|
||||
- Turkish
|
||||
- Turkmen
|
||||
- Twi
|
||||
- Ukrainian
|
||||
- Urdu
|
||||
- Uyghur
|
||||
- Uzbek
|
||||
- Vietnamese
|
||||
- Welsh
|
||||
- West Frisian
|
||||
- Xhosa
|
||||
- Yiddish
|
||||
- Yoruba
|
||||
- Zulu
|
||||
266
scripts/chat/chat_tasks.dsc
Normal file
266
scripts/chat/chat_tasks.dsc
Normal file
@@ -0,0 +1,266 @@
|
||||
chat_name_ooc:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: player
|
||||
script:
|
||||
- determine <placeholder[luckperms_prefix_element_highest_on_track_color].player[<[player]>].if_null[<&7>].parse_color><[player].name>
|
||||
|
||||
chat_special_group:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: player
|
||||
script:
|
||||
- define result <placeholder[luckperms_prefix_element_highest_on_track_special].player[<[player]>].if_null[<&f>].parse_color>
|
||||
- if <[result].strip_color.length> > 0:
|
||||
- define result <[result]><&sp>
|
||||
- determine <[result]>
|
||||
|
||||
chat_roles_group:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: player
|
||||
script:
|
||||
- determine <placeholder[luckperms_prefix_element_highest_on_track_roles].player[<[player]>].if_null[<&f>].parse_color><&f>
|
||||
|
||||
chat_channel_ooc:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message
|
||||
script:
|
||||
- define message <[message].strip_color.replace[&\].with[&].unescaped>
|
||||
- define final "<&8>[<&7><&l>OOC<&8>] <proc[chat_special_group].context[<[player]>]><proc[chat_name_ooc].context[<[player]>]><&7>: <&l><[message]>"
|
||||
- narrate targets:<server.online_players.filter_tag[<[filter_value].has_flag[chat_disableooc].not>]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_looc:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message
|
||||
script:
|
||||
- define message <[message].strip_color.replace[&\].with[&].unescaped>
|
||||
- define final "<&8>[<&7>LOOC<&8>] <proc[chat_special_group].context[<[player]>]><&7><proc[character_get_name].context[<[player]>]> <proc[chat_name_ooc].context[<[player]>]><&7>: <[message]>"
|
||||
- narrate targets:<[player].location.find_players_within[10]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_allowed_colors:
|
||||
debug: false
|
||||
type: procedure
|
||||
script:
|
||||
- determine <util.color_names.exclude[black].exclude[transparent].exclude[white]>
|
||||
|
||||
chat_tokenize_actions:
|
||||
debug: false
|
||||
type: procedure
|
||||
definitions: message|initializer|actioncolor|speechcolor|separator|forcecaps
|
||||
script:
|
||||
- define result <empty>
|
||||
- define index 1
|
||||
- if <[message].starts_with[*]>:
|
||||
- define index 2
|
||||
- else:
|
||||
- define result <[actioncolor]><[initializer]>
|
||||
- foreach <[message].split[*]> as:token:
|
||||
- if <[token].trim.parse_color.strip_color.length> <= 0:
|
||||
- foreach next
|
||||
- if <[index].is_odd>:
|
||||
- if <[forcecaps]>:
|
||||
- define token <[token].replace[&\].with[&].unescaped.to_uppercase>
|
||||
- define result "<[result]> <[separator]><[speechcolor]><[token].trim><[separator]>"
|
||||
- else:
|
||||
- define result "<[result]> <[actioncolor]><[token].trim>"
|
||||
- define index <[index].add[1]>
|
||||
- determine <[result].trim>
|
||||
|
||||
chat_channel_ic:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message
|
||||
script:
|
||||
- if <[message].starts_with[*]> && <[message].split[*].size> == 2:
|
||||
- if <[message].ends_with[*]>:
|
||||
- run chat_channel_ic_me def.player:<[player]> def.message:<[message].substring[2,<[message].length.sub[1]>]>
|
||||
- else:
|
||||
- run chat_channel_ic_me def.player:<[player]> def.message:<[message].substring[2,<[message].length>]>
|
||||
- stop
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define tokenized <proc[chat_tokenize_actions].context[<[message]>|<player.flag[chat_color].if_null[<&e>]>says<&7>:|<player.flag[chat_color].if_null[<&e>]>|<&f>|<&f><&dq><&f>|false].replace[&\].with[&].unescaped>
|
||||
- define final "<&color[#b8b9ba]><placeholder[essentials_nickname].player[<[player]>]> <&f><proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <[tokenized]>"
|
||||
- narrate targets:<[player].location.find_players_within[10]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_me:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message
|
||||
script:
|
||||
- define message <[message].replace[&\].with[&].unescaped>
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final "<&e>*** <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <player.flag[chat_color].if_null[<&e>]><&o><[message]>"
|
||||
- narrate targets:<[player].location.find_players_within[10]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_mec:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message
|
||||
script:
|
||||
- define message <[message].replace[&\].with[&].unescaped>
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final "<&e>* <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <player.flag[chat_color].if_null[<&e>]><&o><[message]>"
|
||||
- narrate targets:<[player].location.find_players_within[3]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_mel:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message
|
||||
script:
|
||||
- define message <[message].replace[&\].with[&].unescaped>
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final "<&e>**** <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <player.flag[chat_color].if_null[<&e>]><&o><[message]>"
|
||||
- narrate targets:<[player].location.find_players_within[25]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_whisper:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message
|
||||
script:
|
||||
- if <[message].starts_with[*]> && <[message].split[*].size> == 2:
|
||||
- if <[message].ends_with[*]>:
|
||||
- run chat_channel_ic_mec def.player:<[player]> def.message:<[message].substring[2,<[message].length.sub[1]>]>
|
||||
- else:
|
||||
- run chat_channel_ic_mec def.player:<[player]> def.message:<[message].substring[2,<[message].length>]>
|
||||
- stop
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define tokenized <proc[chat_tokenize_actions].context[<[message]>|whispers|<&8>|<&7>|<&6><&sq>|false].replace[&\].with[&].unescaped>
|
||||
- define final "<&color[#d1d1d1]><placeholder[essentials_nickname].player[<[player]>]> <&f><proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <[tokenized]>"
|
||||
- narrate targets:<[player].location.find_players_within[3]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_yell:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message
|
||||
script:
|
||||
- if <[message].starts_with[*]> && <[message].split[*].size> == 2:
|
||||
- if <[message].ends_with[*]>:
|
||||
- run chat_channel_ic_mel def.player:<[player]> def.message:<[message].substring[2,<[message].length.sub[1]>]>
|
||||
- else:
|
||||
- run chat_channel_ic_mel def.player:<[player]> def.message:<[message].substring[2,<[message].length>]>
|
||||
- stop
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define tokenized <proc[chat_tokenize_actions].context[<[message]>|yells|<&6>|<&f>|<&6><&sq>|true].replace[&\].with[&].unescaped>
|
||||
- define final "<&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <[tokenized]>"
|
||||
- narrate targets:<[player].location.find_players_within[25]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_my:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message
|
||||
script:
|
||||
- define message <[message].replace[&\].with[&].unescaped>
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define possession_name <proc[character_get_name].context[<[player]>]>
|
||||
- if <[possession_name].to_lowercase.ends_with[s]>:
|
||||
- define possession_name <[possession_name]><&sq>
|
||||
- else:
|
||||
- define possession_name <[possession_name]><&sq>s
|
||||
- define final "<&e>*** <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <[possession_name]> <&f><[message]>"
|
||||
- narrate targets:<[player].location.find_players_within[10]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_it:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message
|
||||
script:
|
||||
- define message <[message].replace[&\].with[&].unescaped>
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final "<&6>*** <&e><[message]> <&7>(<proc[character_get_name].context[<[player]>]>)"
|
||||
- narrate targets:<[player].location.find_players_within[10]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_itc:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message
|
||||
script:
|
||||
- define message <[message].replace[&\].with[&].unescaped>
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final "<&6>* <&e><[message]> <&7>(<proc[character_get_name].context[<[player]>]>)"
|
||||
- narrate targets:<[player].location.find_players_within[3]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_itl:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message
|
||||
script:
|
||||
- define message <[message].replace[&\].with[&].unescaped>
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final "<&6>**** <&e><[message]> <&7>(<proc[character_get_name].context[<[player]>]>)"
|
||||
- narrate targets:<[player].location.find_players_within[25]> <[final]>
|
||||
- announce to_console <[final]>
|
||||
|
||||
chat_channel_ic_language:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message|language
|
||||
script:
|
||||
- define message <[message].replace[&\].with[&].unescaped>
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final_known "<&6>[<&7>L<&6>] <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <player.flag[chat_color].if_null[<&f>]>says <&f><&dq><&o><[message]><&f><&dq> in <[language]>"
|
||||
- define final_unknown "<&6>[<&7>L<&6>] <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <player.flag[chat_color].if_null[<&f>]>says something in <[language]>"
|
||||
- define all <[player].location.find_players_within[10]>
|
||||
- define speakers <[all].filter_tag[<[filter_value].flag[chat_languages].contains[<[language]>].if_null[false]>]>
|
||||
- define others <[all].exclude[<[speakers]>]>
|
||||
- narrate targets:<[speakers]> <[final_known]>
|
||||
- narrate targets:<[others]> <[final_unknown]>
|
||||
- announce to_console <[final_known]>
|
||||
|
||||
chat_channel_ic_languagewhisper:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message|language
|
||||
script:
|
||||
- define message <[message].replace[&\].with[&].unescaped>
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final_known "<&6>[<&7>L<&6>] <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <&f>whispers <&dq><&o><[message]><&f><&dq> in <[language]>"
|
||||
- define final_unknown "<&6>[<&7>L<&6>] <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <&f>whispers something in <[language]>"
|
||||
- define all <[player].location.find_players_within[3]>
|
||||
- define speakers <[all].filter_tag[<[filter_value].flag[chat_languages].contains[<[language]>].if_null[false]>]>
|
||||
- define others <[all].exclude[<[speakers]>]>
|
||||
- narrate targets:<[speakers]> <[final_known]>
|
||||
- narrate targets:<[others]> <[final_unknown]>
|
||||
- announce to_console <[final_known]>
|
||||
|
||||
chat_channel_ic_languageyell:
|
||||
debug: false
|
||||
type: task
|
||||
definitions: player|message|language
|
||||
script:
|
||||
- define message <[message].replace[&\].with[&].unescaped>
|
||||
- if !<[player].has_permission[chat.colors]>:
|
||||
- define message <[message].strip_color>
|
||||
- define final_known "<&6>[<&7>L<&6>] <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <&f>yells <&dq><&o><[message].to_uppercase><&f><&dq> in <[language]>"
|
||||
- define final_unknown "<&6>[<&7>L<&6>] <&f><placeholder[essentials_nickname].player[<[player]>]> <proc[chat_special_group].context[<[player]>]><proc[chat_roles_group].context[<[player]>]> <proc[character_get_name].context[<[player]>]> <&f>yells something in <[language]>"
|
||||
- define all <[player].location.find_players_within[25]>
|
||||
- define speakers <[all].filter_tag[<[filter_value].flag[chat_languages].contains[<[language]>].if_null[false]>]>
|
||||
- define others <[all].exclude[<[speakers]>]>
|
||||
- narrate targets:<[speakers]> <[final_known]>
|
||||
- narrate targets:<[others]> <[final_unknown]>
|
||||
- announce to_console <[final_known]>
|
||||
11
scripts/chat/chat_world.dsc
Normal file
11
scripts/chat/chat_world.dsc
Normal file
@@ -0,0 +1,11 @@
|
||||
chat_world:
|
||||
debug: false
|
||||
type: world
|
||||
events:
|
||||
on player chats:
|
||||
- determine cancelled passively
|
||||
- define channel <player.flag[chat_channel].if_null[ic]>
|
||||
- if <[channel]> == ic:
|
||||
- run chat_channel_ic def.player:<player> def.message:<context.message.parse_color.escaped.replace[&].with[&\]>
|
||||
- else if <[channel]> == ooc:
|
||||
- run chat_channel_ooc def.player:<player> def.message:<context.message.escaped.replace[&].with[&\]>
|
||||
Reference in New Issue
Block a user