-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathxmlpatch.lic
249 lines (198 loc) · 27.5 KB
/
xmlpatch.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
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
=begin
xmlpatch updates Lich's database of spell and item categorization information to include newer additions and fixes.
It performs those updates on startup and then exits.
This information is used by various scripts, including loot/sloot and various flavors, ;box and ;foreach
xmlpatch supercedes GameObjAdd and GameObjAddMore and contains the contents of both of those scripts. If you use
Bigshot, you'll still need GameObjAdd because it will insist on downloading it, but it does not need to run on
startup.
*** IF INFOMON IS TRUSTED, IT WILL NOT WORK WITH XMLPATCH. INFOMON DOES NOT NEED TO BE TRUSTED TO WORK. ***
You can fix this with ;untrust infomon
On first start (and ONLY on first start), xmlpatch will automatically:
* Add itself to autostart for all characters. ;autostart add --global xmlpatch
* Mark itself as updatable -- ;autostart set-updatable xmlpatch
* Remove GameObjAdd and GameObjAddMore from autostart and autoupdate.
author: LostRanger (thisgenericname@gmail.com)
game: GS
tags: utility
required: Lich >= 4.6.0.
version: 0.3.1 (2019-06-05)
changelog:
version 0.3.1 (2019-06-05)
* Added cockatiels as possible familiars
version 0.3 (2019-05-22)
* Added gyrfalcons as possible animal companions
version 0.2 (2017-07-24)
* Yell about trusted infomon
version 0.1 (2017-07-24)
* Initial release.
=end
VERSION = 0.3
unless XMLData.game =~ /^GS/
echo 'This script is only for GemStone IV titles.'
exit
end
wait_while { Script.running?('repository') or Script.running?('GameObjAdd') or Script.running?('GameObjAddMore') }
Spell.load
GameObj.load_data
unless GameSettings[:version] and GameSetting[:version] > 0.1
# Never run before
deprecated = %w(GameObjAdd GameObjAddMore).find_all{|x| Script.exists?(x)}
msg = []
msg << '='*40
msg << 'This appear to be your first time running xmlpatch.'
msg << ''
msg << 'For your convenience, this script will be set to automatically run on startup for all characters.'
msg << 'It will also be set as updatable (and thus will receive updates when you do ;repo download-updates)'
if deprecated.length > 0
msg << ''
msg << 'Also, the following scripts will be removed from autoupdate and autostart:'
msg << deprecated.join(', ')
end
msg << ''
msg << "You can undo these changes with the appropriate '#{$lich_char}repository' and '#{$lich_char}autostart' commands."
msg << '='*40
respond msg.join("\n")
Script.run("autostart", "remove --global #{script.name}.lic") if GameSettings[:version] == 0.1
Script.run("autostart", "add --global #{script.name}")
Script.run("repo", "set-updatable #{script.name}.lic")
deprecated.each{|name|
Script.run('repo', "unset-updatable #{name}.lic")
Script.run('autostart', "remove --global #{name}")
Script.run('autostart', "remove #{name}")
}
GameSettings[:version] = VERSION
echo "Done with first-time setup."
echo "*** If infomon crashes in a moment, please ;untrust infomon and try again. ***"
end
def apply_spell_patches
# Spell data patching
Spell[909].instance_variable_set(:@msgup, "Faint ripples in the .* form beneath you for a moment\\.")
Spell[909].instance_variable_set(:@msgdn, "Faint ripples in the .* beneath you become apparent before quickly dissipating\\.")
end
def apply_gameobjadd_patches
# Stolen and refactored from GameObjAdd last updated 2016-09-25 12:33pm by Hazado.
# Notes from that script follow:
# This script expands and incorporates what Kalros/Haldrik did in confluence_sort.lic
#
# Its designed to add new objects to GameObj data so that Lich recognizes things properly
# Just add it to your autostart - ;autostart add GameObjAdd
#
# Adds Reim NPCs to undead and aggressive npcs list
# Adds Sanctum of Souls NPCs to undead and aggressive npcs list
# Adds new NPC type noncorporeal
# Adds Reim Gems and gives them their own category
# Adds familiars and companions to their own categories
# Excludes stuff that shouldn't be picked up
# Adds Confluence plinites and cores to new category "confluence" (STOLEN from confluence_sort.lic!!)
# Adds Duskruin Shards to category "moonshard"
# Adds Duskruin digging gems to category "duskruin gem"
# Adds Pennant Chase gems to category "pennant chase gem"
# Adds Sanctum of Scales gems to category "gems"
reim_npcs = "ethereal (?:commoner|denizen|guard|guardsman|guardswoman|inmate|lunatic|madman|madwoman|peasant|prisoner|squire|swordsman|swordswoman|traveller|townsman|townswoman|villager)|ghostly (?:bandit|highwayman|highwaywoman|marauder|waylayer)|unworldly (?:guest|maid|noble|royal guard|royal knight|servant|slave|steward|visitor)|celestial (?:dancer|juggler|nomad|traveller)|Shopkeeper|Innkeeper|Bartender|Patrol Leader|Bandit Lord|Bandit Lady|Gypsy Queen|Gypsy King|Guard Captain|Wall Captain|Drill Sergeant|Stable Hostler|Dungeon Master|Master Torturer|Butler|Cook|Knight Captain|Foreign Dignitary|Royal Prince|Royal Princess|Royal Jester|Royal Emperor|Royal Empress"
# familiars = "(?:short-nosed|bare-backed|little-collar|long-tailed|long-tongued)?.*?(?:small|large|fruit|spotted|pygmy) bat|(?:(?:blue-eyed|disheveled|fat|fluffy|green-eyed|long-haired|orange-eyed|plump|shabby|short-haired|sleek|emerald-eyed)?.*?(?:black|calico|charcoal|ginger|grey|tabby|white) cat|(?:silver-eyed pure white cat|silver-ruffed charcoal black cat))|(?:large|small)?.*?(?:black|brown|dwarf|forest|green|grey|leaf|mountain|ochre|spotted|veiled) chameleon|(?:iridescent)?.*?(?:purple-plumed) cormorant|lithe golden-eyed coyote|(?:large|ruffled|sleek|small)?.*?(?:long-winged|narrow-winged|red-footed|red-necked) falcon|(?:(?:disheveled|sleek)?.*?(?:arctic|bat-eared|black|blue|desert|grey|kit|red|swift) fox|black-footed plump red fox)|(?:(?:large|plump|slimy|small|speckled)?.*?(?:brown|bull|green|green tree|horned|tree) frog|heavy-set bull frog)|gyrfalcon|(?:black-tailed|white-tailed)?.*?(?:black|broom|cape|mountain|red|savanna|scrub|snowshoe|woolly) hare|(?:(?:large|ruffled|sleek|small)?.*?(?:black|black-mantled|grey-bellied|grey-headed|red-chested|red-tailed|spot-tailed|white-bellied) hawk|dappled broad-winged hawk)|rangy dappled grey jackal|(?:roly-poly)?.*?(?:flamepoint) sand kitten|(?:greater|lesser|sleek|small)?.*?(?:bamboo|black|brown|crowned|dwarf|fork-crowned|golden|fork-marked|grey|grey-headed|mouse|red-bellied|ring-tailed|red-collared|ruffled|white-collared) lemur|slim dove grey merlin|(?:fat|plump|sleek|tiny)?.*?(?:black|brown|field|forest|furry|pocket|grey|white)?.*?mouse|(?:(?:greater|lesser|ruffled|sleek|pale-faced)?.*?(?:barn|pygmy|barred|screech|bay|snowy|crested|sooty|eagle|speckled|elf|spectacled|grass|spotted|great white|striped|grey|tawny|hawk|white|horned|white-faced|maned|wood|masked) owl|dark-eyed grey barred owl)|(?:brilliant)?.*?parrot|(?:large|ruffled|small|sleek)?.*?(?:brown|pink-backed|white|spot-billed) pelican|(?:crested|emperor|king|royal|yellow-eyed|little blue) penguin|(?:rusty|hooded|red-brown|black|brown|crested) pitohui|rock ptarmigan|(?:(?:large|ruffled|small|sleek)?.*?raven|glossy coal black raven)|squat pebble-backed toad|(?:black-banded|ivory-billed|black-billed|red-billed|black-necked|red-necked|blue-banded|spot-billed|curl-crested|stripe-billed|fiery-billed|yellow-browed|grey-breasted|yellow-ridged|groove-billed)?.*?(?:blue|bright blue|collared|emerald|green|hooded|speckled)?.*?toucan|(?:(?:arctic|blue|great white|grey) wolf|amber-eyed grizzled timber wolf)|(?:cloudy-eyed|long-eared|ethereal|long-nosed|foggy-eyed|soft-featured|lithe|white-eyed)?.*?air wyrdling|(?:amber-eyed|large-nosed|crumbling|rough|crystal-eyed|round-eared|dusty|squat|dusty-eyed|stout)?.*?earth wyrdling|(?:angular|sharp-eared|ember-eyed|sharp-nosed|lanky|smoky|red-eyed|smoky-eyed|scaled|smoldering)?.*?fire wyrdling|(?:angular|nebulous|hook-nosed|scaled|jagged-eared|silver-eyed|lanky|spark-eyed)?.*?lightning wyrdling|(?:blue-eyed|misty-eyed|frothy-eyed|sleek|lithe|small-nosed|long-eared|smooth|misty)?.*?water wyrdling"
# familiars = "(?:short-nosed|bare-backed|little-collar|long-tailed|long-tongued)?.*?(?:small|large|fruit|spotted|pygmy) bat|(?:(?:blue-eyed|disheveled|fat|fluffy|green-eyed|long-haired|orange-eyed|plump|shabby|short-haired|sleek|emerald-eyed)?.*?(?:black|calico|charcoal|ginger|grey|tabby|white) cat|(?:silver-eyed pure white cat|silver-ruffed charcoal black cat))|(?:large|small)?.*?(?:black|brown|dwarf|forest|green|grey|leaf|mountain|ochre|spotted|veiled) chameleon|(?:iridescent)?.*?(?:purple-plumed) cormorant|lithe golden-eyed coyote|(?:large|ruffled|sleek|small)?.*?(?:long-winged|narrow-winged|red-footed|red-necked) falcon|(?:(?:disheveled|sleek)?.*?(?:arctic|bat-eared|black|blue|desert|grey|kit|red|swift) fox|black-footed plump red fox)|(?:(?:large|plump|slimy|small|speckled)?.*?(?:brown|bull|green|green tree|horned|tree) frog|heavy-set bull frog)|gyrfalcon|(?:black-tailed|white-tailed)?.*?(?:black|broom|cape|mountain|red|savanna|scrub|snowshoe|woolly) hare|(?:(?:large|ruffled|sleek|small)?.*?(?:black|black-mantled|grey-bellied|grey-headed|red-chested|red-tailed|spot-tailed|white-bellied) hawk|dappled broad-winged hawk)|rangy dappled grey jackal|(?:roly-poly)?.*?(?:flamepoint) sand kitten|(?:greater|lesser|sleek|small)?.*?(?:bamboo|black|brown|crowned|dwarf|fork-crowned|golden|fork-marked|grey|grey-headed|mouse|red-bellied|ring-tailed|red-collared|ruffled|white-collared) lemur|slim dove grey merlin|(?:fat|plump|sleek|tiny)?.*?(?:black|brown|field|forest|furry|pocket|grey|white)?.*?mouse|(?:(?:greater|lesser|ruffled|sleek|pale-faced)?.*?(?:barn|pygmy|barred|screech|bay|snowy|crested|sooty|eagle|speckled|elf|spectacled|grass|spotted|great white|striped|grey|tawny|hawk|white|horned|white-faced|maned|wood|masked) owl|dark-eyed grey barred owl)|(?:brilliant)?.*?parrot|(?:large|ruffled|small|sleek)?.*?(?:brown|pink-backed|white|spot-billed) pelican|(?:crested|emperor|king|royal|yellow-eyed|little blue) penguin|(?:rusty|hooded|red-brown|black|brown|crested) pitohui|rock ptarmigan|(?:(?:large|ruffled|small|sleek)?.*?raven|glossy coal black raven)|squat pebble-backed toad|(?:black-banded|ivory-billed|black-billed|red-billed|black-necked|red-necked|blue-banded|spot-billed|curl-crested|stripe-billed|fiery-billed|yellow-browed|grey-breasted|yellow-ridged|groove-billed)?.*?(?:blue|bright blue|collared|emerald|green|hooded|speckled)?.*?toucan|(?:(?:arctic|blue|great white|grey) wolf|amber-eyed grizzled timber wolf)|(?:cloudy-eyed|long-eared|ethereal|long-nosed|foggy-eyed|soft-featured|lithe|white-eyed)?.*?air wyrdling|(?:amber-eyed|large-nosed|crumbling|rough|crystal-eyed|round-eared|dusty|squat|dusty-eyed|stout)?.*?earth wyrdling|(?:angular|sharp-eared|ember-eyed|sharp-nosed|lanky|smoky|red-eyed|smoky-eyed|scaled|smoldering)?.*?fire wyrdling|(?:angular|nebulous|hook-nosed|scaled|jagged-eared|silver-eyed|lanky|spark-eyed)?.*?lightning wyrdling|(?:blue-eyed|misty-eyed|frothy-eyed|sleek|lithe|small-nosed|long-eared|smooth|misty)?.*?water wyrdling|(?:pale green|leafy green|grass green|russet brown|light viridian|jade green|emerald|deep green|spike-backed|short-snouted|long-snouted|three-tied|drab|aged|scaly|split-tailed)?.*?iguana"
familiars = "(?:pink-cheeked|ruby-cheeked|croak-beaked|beady-eyed|green-faced|white-winged|white-faced|white-banded|grey-banded)?.*?(?:green|grey|yellow|albino) cockatiel|(?:short-nosed|bare-backed|little-collar|long-tailed|long-tongued)?.*?(?:small|large|fruit|spotted|pygmy) bat|(?:(?:blue-eyed|disheveled|fat|fluffy|green-eyed|long-haired|orange-eyed|plump|shabby|short-haired|sleek|emerald-eyed)?.*?(?:black|calico|charcoal|ginger|grey|tabby|white) cat|(?:silver-eyed pure white cat|silver-ruffed charcoal black cat))|(?:large|small)?.*?(?:black|brown|dwarf|forest|green|grey|leaf|mountain|ochre|spotted|veiled) chameleon|(?:iridescent)?.*?(?:purple-plumed) cormorant|lithe golden-eyed coyote|(?:large|ruffled|sleek|small)?.*?(?:long-winged|narrow-winged|red-footed|red-necked) falcon|(?:(?:disheveled|sleek)?.*?(?:arctic|bat-eared|black|blue|desert|grey|kit|red|swift) fox|black-footed plump red fox)|(?:(?:large|plump|slimy|small|speckled)?.*?(?:brown|bull|green|green tree|horned|tree) frog|heavy-set bull frog)|gyrfalcon|(?:black-tailed|white-tailed)?.*?(?:black|broom|cape|mountain|red|savanna|scrub|snowshoe|woolly) hare|(?:(?:large|ruffled|sleek|small)?.*?(?:black|black-mantled|grey-bellied|grey-headed|red-chested|red-tailed|spot-tailed|white-bellied) hawk|dappled broad-winged hawk)|rangy dappled grey jackal|(?:roly-poly)?.*?(?:flamepoint) sand kitten|(?:greater|lesser|sleek|small)?.*?(?:bamboo|black|brown|crowned|dwarf|fork-crowned|golden|fork-marked|grey|grey-headed|mouse|red-bellied|ring-tailed|red-collared|ruffled|white-collared) lemur|slim dove grey merlin|(?:fat|plump|sleek|tiny)?.*?(?:black|brown|field|forest|furry|pocket|grey|white)?.*?mouse|(?:(?:greater|lesser|ruffled|sleek|pale-faced)?.*?(?:barn|pygmy|barred|screech|bay|snowy|crested|sooty|eagle|speckled|elf|spectacled|grass|spotted|great white|striped|grey|tawny|hawk|white|horned|white-faced|maned|wood|masked) owl|dark-eyed grey barred owl)|(?:brilliant)?.*?parrot|(?:large|ruffled|small|sleek)?.*?(?:brown|pink-backed|white|spot-billed) pelican|(?:crested|emperor|king|royal|yellow-eyed|little blue) penguin|(?:rusty|hooded|red-brown|black|brown|crested) pitohui|rock ptarmigan|(?:(?:large|ruffled|small|sleek)?.*?raven|glossy coal black raven)|squat pebble-backed toad|(?:black-banded|ivory-billed|black-billed|red-billed|black-necked|red-necked|blue-banded|spot-billed|curl-crested|stripe-billed|fiery-billed|yellow-browed|grey-breasted|yellow-ridged|groove-billed)?.*?(?:blue|bright blue|collared|emerald|green|hooded|speckled)?.*?toucan|(?:(?:arctic|blue|great white|grey) wolf|amber-eyed grizzled timber wolf)|(?:cloudy-eyed|long-eared|ethereal|long-nosed|foggy-eyed|soft-featured|lithe|white-eyed)?.*?air wyrdling|(?:amber-eyed|large-nosed|crumbling|rough|crystal-eyed|round-eared|dusty|squat|dusty-eyed|stout)?.*?earth wyrdling|(?:angular|sharp-eared|ember-eyed|sharp-nosed|lanky|smoky|red-eyed|smoky-eyed|scaled|smoldering)?.*?fire wyrdling|(?:angular|nebulous|hook-nosed|scaled|jagged-eared|silver-eyed|lanky|spark-eyed)?.*?lightning wyrdling|(?:blue-eyed|misty-eyed|frothy-eyed|sleek|lithe|small-nosed|long-eared|smooth|misty)?.*?water wyrdling|(?:pale green|leafy green|grass green|russet brown|light viridian|jade green|emerald|deep green|spike-backed|short-snouted|long-snouted|three-tied|drab|aged|scaly|split-tailed)?.*?iguana|hummingbird"
#Exclude crap that shouldn't be picked up or is miscatgorized
#Add stuff that is missing!
if GameObj.type_data['armor'][:exclude].inspect !~ /dirty brown robes/i && GameObj.type_data['armor'][:exclude].inspect !~ /some flowing robes/i && GameObj.type_data['armor'][:exclude].inspect !~ /some tattered white robes/i
GameObj.type_data['armor'][:exclude] = Regexp.new(/^(?:some dirty brown robes|some flowing robes|some tattered white robes)$/)
end
if GameObj.type_data['clothing'][:exclude].inspect !~ /some tattered white robes/i && GameObj.type_data['clothing'][:exclude].inspect !~ /woven cloak/i
GameObj.type_data['clothing'][:exclude] = Regexp.new(/#{GameObj.type_data['clothing'][:exclude].inspect.gsub('\\','').gsub('/','')}|^(?:some tattered white robes|woven cloak|tattered plaid flannel shirt|weathered plaid flannel cap|some heavy leather boots)$/)
end
if GameObj.type_data['jewelry'][:noun].inspect !~ /scepter|plate|pitcher/i && GameObj.sellable_data['gemshop'][:noun].inspect !~ /scepter/i && GameObj.sellable_data['pawnshop'][:noun].inspect !~ /scepter/i
GameObj.type_data['jewelry'][:noun] = Regexp.new(/#{GameObj.type_data['jewelry'][:noun].inspect.gsub('\\','').gsub('/','')}|^(?:scepter|plate|pitcher)$/)
GameObj.sellable_data['gemshop'][:noun] = Regexp.new(/#{GameObj.sellable_data['gemshop'][:noun].inspect.gsub('\\','').gsub('/','')}|^(?:scepter)$/)
GameObj.sellable_data['pawnshop'][:noun] = Regexp.new(/#{GameObj.sellable_data['pawnshop'][:noun].inspect.gsub('$','').gsub('\\','').gsub('/','').gsub(')','')}|(?:scepter))$/)
end
if GameObj.type_data['uncommon'][:exclude].inspect !~ /\bdoor$/i
GameObj.type_data['uncommon'][:exclude] = Regexp.new(/#{GameObj.type_data['uncommon'][:exclude].inspect.gsub('\\','').gsub('/','')}|(?:door)$/)
end
#Adds Reim undead and Sanctum creatures to aggressive npc and undead category
if GameObj.type_data['aggressive npc'][:name].inspect !~ /#{reim_npcs}/i && GameObj.type_data['undead'][:name].inspect !~ /#{reim_npcs}/i
GameObj.type_data['aggressive npc'][:name] = Regexp.new(/(?:#{GameObj.type_data['aggressive npc'][:name].inspect.gsub('$','').gsub('\\','').gsub('/','')}|^(?:berserk )?(?:#{reim_npcs})|^(?:pale scaled shaper|patchwork flesh monstrosity|lithe veiled sentinel|shambling lurk|deathsworn fanatic))$/)
GameObj.type_data['undead'][:name] = Regexp.new(/^(?:seasoned |grizzled |battle-scarred |ancient |veteran |berserk )?(?:#{GameObj.type_data['undead'][:name].inspect.gsub('$','').gsub('\\','').gsub('/','')}|#{reim_npcs}|patchwork flesh monstrosity|shambling lurk)$/)
end
#Add Duskruin Shards
if GameObj.type_data['moonshard'].nil?
GameObj.type_data['gem'][:exclude] = Regexp.new(/#{GameObj.type_data['gem'][:exclude].inspect.gsub('\\','').gsub('/','')}|^cracked ur-barath stone$/)
GameObj.type_data['uncommon'][:exclude] = Regexp.new(/#{GameObj.type_data['uncommon'][:exclude].inspect.gsub('\\','').gsub('/','')}|^(?:thin iron strip|thin kakore strip)$/)
GameObj.type_data['valuable'][:exclude] = Regexp.new(/#{GameObj.type_data['valuable'][:exclude].inspect.gsub('\\','').gsub('/','')}|^golden glimaerstone nugget$/)
GameObj.type_data['moonshard'] = {:name=>'test'}
GameObj.type_data['moonshard'][:name] = Regexp.new(/^(?:jagged white sunstone shard|broken white opal sphere|white dreamstone sliver|thin platinum strip|black opal fragment|blood red garnet chunk|coarse grey moonstone shard|thin iron strip|cracked ur-barath stone|broken fire opal chunk|splintered fire agate shard|thin kakore strip|lopsided golden moonstone sphere|sharp golden topaz shard|golden glimaerstone nugget|reticulated crystal-edged golvern segment)$/)
end
#Reim gems get there own category!
if GameObj.type_data['reim'].nil?
GameObj.type_data['reim'] = {:name=>'test'}
GameObj.type_data['reim'][:name] = Regexp.new(/^(?:round of milky amber|smoky amethyst|hexagonal cobalt blue beryl|chunk of bronzite|marbled green chrysoprase|cluster of sky blue crystal|ice blue diamond|nebulous emerald|lustrous black garnet|ethereal blue gem|teardrop of dark green heliotrope|spear of lavender-grey iolite|piece of jet-flecked ivory|piece of black jade|piece of blue jade|pebble of orbicular jasper|cone of mahogany obsidian|heart of blue onyx|cloud opal|iridescent wood opal|jelly opal|shard of pink petalite|luminous prehnite|snow quartz|haloed Reim ruby|pallid sapphire|chunk of pale blue ice stone|chunk of pearly grey ice stone|chunk of snowy white ice stone|slice of ribbon stone|dark blue tempest stone|faint gold tempest stone|pale grey tempest stone|ebon-cored vortex stone|silver-cored vortex stone|sliver of bright green viridine)$/)
GameObj.type_data['gem'][:name] = Regexp.new(/#{GameObj.type_data['gem'][:name].inspect.gsub('\\','').gsub('/','')}|^cluster of sky blue crystal$/)
GameObj.type_data['gem'][:noun] = Regexp.new(/#{GameObj.type_data['gem'][:noun].inspect.gsub('\\','').gsub('/','')}|^(?:bronzite|iolite|petalite)$/)
GameObj.sellable_data['gemshop'][:noun] = Regexp.new(/#{GameObj.sellable_data['gemshop'][:noun].inspect.gsub('\\','').gsub('/','')}|^(?:bronzite|chrysoprase|heliotrope|iolite|petalite|prehnite|viridine)$/)
end
#Duskruin gems get there own category!
if GameObj.type_data['duskruin'].nil?
GameObj.type_data['duskruin'] = {:name=>'test'}
GameObj.type_data['duskruin'][:name] = Regexp.new(/^(?:flame-banded gold chameleon agate|thin shard of iridescent fire agate|gently sloped green moss agate|round of gnat-filled amber|slice of gold-blended ametrine|fragment of lilac-toned amethyst|brilliant teal-laced azurite|scintillating scarlet red blazestar|inky-cored vivid carmine bloodjewel|cluster of gingery golden chrysoberyl|clouded maize-colored citrine|pale metallic silver mistvein diamond|square-cut deep pink diamond|sharply cut salorisa pink diamond|large blood red diamond|flawless argent-white diamond|pale-edged powder blue dreamstone|smooth black umber-suffused dreamstone|heart-shaped aqua green emerald|black-rayed celadon star emerald|multi-faceted sky blue feystone|six-pointed rich sanguine garnet|beryl green crystal-filled geode|pristine smoky violet glimaerstone|teardrop of mauve petrified haon|dainty orb of primrose yellow heliodor|cushion-cut ember orange hyacinth|bronze-tinged lambent yellow jacinth|slim bar of woodland green jade|pyrite-capped vibrant blue lapis lazuli|small disk of velvety green malachite|silver-washed celestial blue moonstone|cyan-haloed creamy ivory moonstone|pearlescent raven black opal|pellucid blue-green ora-bloom|oversized shadowy purple pearl|glimmering magnolia white pearl|tiny prism of wintry blue peridot|trilliant-cut yellow-green peridot|triangular pastel rainbow quartz|hazy shard of faint pink rose quartz|cube of sheer blossom pink rosespar|wheel-incised incarnadine ruby|coin-sized seafoam white sandsilver|silver-swept blue mistvein sapphire|honey-tinted indigo water sapphire|dark-veined apple green turquoise)$/)
GameObj.type_data['gem'][:noun] = Regexp.new(/#{GameObj.type_data['gem'][:noun].inspect.gsub('\\','').gsub('/','')}|^(?:ametrine|chrysoberyl|citrine|haon|malachite|rosespar)$/)
GameObj.sellable_data['gemshop'][:noun] = Regexp.new(/#{GameObj.sellable_data['gemshop'][:noun].inspect.gsub('\\','').gsub('/','')}|^(?:ametrine|chrysoberyl|citrine|haon|malachite|rosespar)$/)
end
#Pennant Chase gems
if GameObj.type_data['pennant chase'].nil?
GameObj.type_data['pennant chase'] = {:name=>'test'}
GameObj.type_data['pennant chase'][:name] = Regexp.new(/^(?:chunk of|faceted|fist-sized|nugget of|piece of|polished|sliver of|smooth|thumb-sized) (?:banana|bright|candy|dark|forest|mint|ocean|pale|rose|sky|sunny|sunset|vibrant)?\s?(?:blue|green|orange|pink|red|violet|yellow)(?:-tinged)? (?:coral|diamond|dreamstone|glimaerstone|jade|quartz|roestone|sapphire|sphene|spinel|topaz|tourmaline|zircon)$/)
GameObj.type_data['pennant chase'][:exclude] = Regexp.new(/^(?:piece of blue jade)$/)
end
#Sanctum of Scales gems
GameObj.type_data['gem'][:name] = Regexp.new(/#{GameObj.type_data['gem'][:name].inspect.gsub('\\','').gsub('/','')}|^(?:dull grey crystal|pink salt crystal)$/)
GameObj.sellable_data['gemshop'][:name] = Regexp.new(/#{GameObj.sellable_data['gemshop'][:name].inspect.gsub('\\','').gsub('/','')}|^(?:dull grey crystal|pink salt crystal|tangerine wulfenite crystal|square of shale rock|cloudy alexandrite shard)$/)
GameObj.type_data['gem'][:noun] = Regexp.new(/#{GameObj.type_data['gem'][:noun].inspect.gsub('\\','').gsub('/','')}|^(?:spiral)$/)
GameObj.sellable_data['gemshop'][:noun] = Regexp.new(/#{GameObj.sellable_data['gemshop'][:noun].inspect.gsub('\\','').gsub('/','')}|^(?:crescent|fluorite|idocrase|spiral|tanzanite)$/)
#Noncorporeal creature identifier
if GameObj.type_data['noncorporeal'].nil?
GameObj.type_data['noncorporeal'] = {:name=>'test'}
GameObj.type_data['noncorporeal'][:name] = Regexp.new(/^(?:seasoned |grizzled |battle\-scarred |ancient |veteran |berserk )?(?:banshee|barghest|bog wraith|dark apparition|darkwoode|death dirge|eidolon|elder tree spirit|ethereal mage apprentice|ethereal triton sentry|fallen crusader|firephantom|gaunt spectral servant|ghost wolf|ghost|ghostly mara|ghostly pooka|ghostly warrior|ice wraith|lesser frost shade|lesser shade|lost soul|mist wraith|moaning phantom|moaning spirit|naisirc|nightmare steed|phantasma|phantasmal bestial swordsman|phantom|revenant|seraceris|shadow mare|shadow steed|shadowy spectre|snow spectre|spectral fisherman|spectral lord|spectral miner|spectral monk|spectral shade|spectral triton defender|spectral warrior|spectral woodsman|spectre|tree spirit|troll wraith|warrior shade|wind wraith|wolfshade|wraith|#{reim_npcs})$/)
end
#Ranger companions
if GameObj.type_data['companion'].nil?
GameObj.type_data['companion'] = {:noun=>'test'}
GameObj.type_data['companion'][:noun] = Regexp.new(/^(?:albatross|badger|banishara|barrowrat|baza|beaver|boarrat|bobcat|burrowvine|bushwag|buzzard|caiverine|canid|capybara|caracal|caracara|catamount|cavecail|cheetah|condor|cougar|coyote|crow|curhound|curwolf|cygnet|dhole|dobrem|dole|eagle|elf-owl|falcon|felid|fennec|fenvaok|ferret|fox|foxhound|goshawk|graiphel|greatfang|groundhog|gyrefalcon|gyrfalcon|harrier|hawk|hawk-eagle|hedgehog|heron|hound|hyena|jackal|jaguar|jaguarundi|karet|kestrel|kingfisher|kite|kodkod|kuvasz|ledisa|leopard|lion|loper|lugger|lynx|margay|marmot|mastiff|mink|mole|mongoose|mudcat|muskrat|muzzlerat|narmo|nutria|ocelot|osprey|owl|panther|passo|peregrine|pigeonhawk|porcupine|puma|raccoon|raptor|rasper|rat|raven|rockrat|rowl|saker|samoyed|sandrat|scrabbler|screech-owl|sea-eagle|seagull|seahawk|serval|shrika|shrike|sloth|snowcat|snow-owl|sparrowhawk|stratis|swift|tiger|tothis|trakel|tunnelcat|veercat|vole|vulture|weasel|whiskrat|wildcat|wolf|wolfhound|wolverine|wombat|woodchuck|woodpecker|woodshrew|yowler)$/)
GameObj.type_data['companion'][:exclude] = Regexp.new(/^(?:giant rat|mountain snowcat|bobcat|coyote|spotted lynx|blood eagle|giant marmot|giant weasel|arctic puma|black leopard|humpbacked puma|panther|puma|fire rat|ghost wolf|black panther|mountain lion|plains lion|cougar|dark panther|arctic wolverine|ice hound|night hound|wolverine|snow leopard|dobrem|martial eagle|wild hound|moor hound|colossus vulture|moor eagle|dreadnought raptor|mastodonic leopard|sabre-tooth tiger|stone mastiff|#{familiars})$/)
end
#Wizard familiars
if GameObj.type_data['familiar'].nil?
GameObj.type_data['familiar'] = {:name=>'test'}
GameObj.type_data['familiar'][:name] = Regexp.new(/^(?:#{familiars})$/)
end
end
def apply_gameobjaddmore_patches
# We allow 'shifting' so phased boxes still count as boxes.
box_adjectives = 'shifting|badly damaged|battered|corroded|dented|plain|rotting|scratched|simple|sturdy|weathered|acid-pitted|engraved|enruned|iron-bound'
box_materials = 'brass|fel|gold|haon|iron|maoral|mithril|modwir|monir|silver|steel|tanik|thanot|wooden'
box_nouns = 'box|chest|coffer|strongbox|trunk'
# Allow adjectives to be optional, since Lich won't report full item names if they're in the player's hands.
GameObj.type_data['box'][:name] = /^(?:(?:#{box_adjectives}) )?(?:#{box_materials}) (#{box_nouns})$/
GameObj.type_data['phased'] = {} unless GameObj.type_data['phased']
GameObj.type_data['phased'][:name] = /^shifting /
end
def restart_infomon
if Script.running?('infomon')
Spell.singleton_class.send(:prepend, SpellLoadFixupExtensions)
Script.kill('infomon')
wait_while { Script.running?('infomon') }
Script.start('infomon')
wait_until { Script.running?('infomon') }
end
end
module SpellLoadFixupExtensions
def load(filename=nil)
echo "xmlpatch is blocking this attempt at (re)loading Spell Data, as it would overwrite the patch. You can generally ignore this message."
SpellLoadFixupExtensions.send(:remove_method, :load) # Remove this so it doesn't happen again.
return true
end
end
apply_spell_patches
apply_gameobjadd_patches
apply_gameobjaddmore_patches
restart_infomon
# ;t
# Spell.load