-
Notifications
You must be signed in to change notification settings - Fork 8
/
trollhear.lic
116 lines (108 loc) · 2.68 KB
/
trollhear.lic
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
=begin
Translate trollspeak to common
Translation won't be perfect, because some letters are deleted or moved when changed to trollspeak.
Start the script with some trollspeak to translate it.
Start the script with no variables and it will attempt to find and translate any trollspeak that shows up in the game.
author: Tillmen (tillmen@lichproject.org)
game: Gemstone
tags: speech
version: 0.1
=end
no_kill_all
hide_me
def to_common(troll)
sub_list = [
[ "mor'ir", "i'm" ],
[ "mor'ri", "i'm" ],
[ "mri'ir", "i'm" ],
[ "mri'ri", "i'm" ],
[ "mr'ir", "i'm" ],
[ "mr'ri", "i'm" ],
[ "'r'r'", "'re" ],
[ "'r'", "'re" ],
[ "r's'", "'s" ],
[ "r'r", 'r' ],
[ "r'k", 'k' ],
[ "r's", 's' ],
[ "r'v", 'v' ],
[ "r'w", 'w' ],
[ "r'p", 'p' ],
[ 'lar', 'l' ],
[ 'lor', 'l' ],
[ 'lur', 'l' ],
[ 'ghu', 'u' ],
[ 'mor', 'm' ],
[ 'mri', 'm' ],
[ 'ar', 'a' ],
[ 'br', 'b' ],
[ 'ra', 'a' ],
[ 'gr', 'g' ],
[ 'gh', 'h' ],
[ 'ir', 'i' ],
[ 'ri', 'i' ],
[ 'kr', 'k' ],
[ 'mr', 'm' ],
[ 'pr', 'p' ],
[ 'sr', 's' ],
[ 'ru', 'u' ],
[ 'vr', 'v' ],
[ 'wr', 'w' ],
[ "'", 'e' ],
# [ "`", "'" ],
[ ' .', '. ' ],
[ ' ,', ', ' ],
[ ' ?', '? ' ],
[ ' !', '! ' ]
]
troll = troll.split('')
which = 0
while which < troll.length
for sub in sub_list
if troll[which...(which+sub[0].length)].join == sub[0]
# echo 'change: ' + troll[which] + ' -> ' + sub[1]
troll[which] = sub[1]
(sub[0].length-1).times {
# echo 'delete: ' + troll[which+1]
troll.delete_at(which+1)
}
break
end
end
which += 1
end
troll.reverse!
if [ '.', '!', '?' ].include?(troll[0])
troll.push(troll[0])
troll.delete_at(0)
end
troll = troll.join.gsub(' .', '. ').gsub(' !', '! ').gsub(' ?', '? ').gsub(' ,', ', ').capitalize
return troll
end
if script.vars[0]
troll = script.vars[0].downcase
echo to_common(troll)
exit
end
loop {
line = get
if line =~ /troll.+"(.+)"/i
troll = $1.downcase
elsif line =~ /"(.+)"/
troll = $1.downcase
next unless (troll !~ /x|y|q|c|e|[^r]a[^r]|b[^r]|[^g]h|[^r`]i[^r]|l[^aou][^r]|m[^nr][^ri]|[^r][^']p[^r]|[^rhl`]u|[^r][^']v[^r]/) and (troll =~ /ar|ra|gr|gh|ir|ri|r'k|kr|lar|lor|lur|mr|mor|mri|r'p\pr|r'r|sr|r's|ru|ghu|vr|r'v|wr|r'w/)
else
next
end
if line =~ /\[(General|LNet|Merchant|Guild|House|Shattered)\]/
if $frontend == 'stormfront'
puts '<pushStream id="thoughts"/>[trollhear: ' + to_common(troll) + ']<popStream/>'
elsif $frontend == 'profanity'
_respond '<pushStream id="thoughts"/>[trollhear: ' + to_common(troll) + ']<popStream/>'
else
respond "You hear the faint thoughts of [trollhear echo in your mind:\n" + to_common(troll) + "]"
end
else
echo to_common(troll)
end
}
exit