forked from brycole/gemstone
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkillcounter.lic
More file actions
450 lines (420 loc) · 25.2 KB
/
killcounter.lic
File metadata and controls
450 lines (420 loc) · 25.2 KB
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
=begin
This script counts how many creatures you've killed. It does not use fancy Stormfront dialog windows.
Currently only works with "standard" critters found in the Play.net bestiary.
Kill count is stored across sessions.
;killcounter help
Cait - loresinging@gmail.com
UPDATED: Probably will work with implosion now...
Also added a way to manually add/decrement critter kill counts
TODO: add option to add unique/invasion creatures to critter list?
see if Implosion actually works
=end
if defined?(GameObj.type_data)
GameObj.load_data if GameObj.type_data.empty? or GameObj.type_data.nil?
if GameObj.type_data.nil?
wait_while { running?('updater') }
wait_while { running?('repository') }
start_script 'repository', [ 'download', 'gameobj-data.xml' ]
wait_while { running?('repository') }
wait_while { running?('updater') }
start_script 'updater', [ 'add', 'gameobj-data.xml' ]
wait_while { running?('updater') }
GameObj.load_data
exit if GameObj.type_data.nil?
end
end
CharSettings['killcount'] ||= 0
CharSettings['silentmode'] ||=false
CharSettings['groupmode'] ||=false
status_tags
silence_me
kill_stats ||= Hash.new
kill_stats['kills'] ||= 0
kill_stats['kills'] = CharSettings['killcount'].to_s.to_i
kill_list = CharSettings['killlist']
kill_count = CharSettings['killcount'].to_s
up_hook = proc { |client_string|
begin
clientline=client_string
if client_string =~ /^(?:<c>)?kills/i
if client_string =~ /kills \+(.*)/
i=$1.to_i
if (i <= 0) || (i > kill_list.length) then
respond "Invalid creature number."
else
kill_list[i-1][:count] = kill_list[i-1][:count] +1;
kill_stats['kills'] += 1
kill_count = kill_stats['kills'].to_s
respond "Incrementing count for #{kill_list[i-1][:name]}."
end
else
if client_string =~ /kills -(.*)/
i=$1.to_i
if (i <= 0) || (i > kill_list.length) then
respond "Invalid creature number."
else
if (kill_list[i-1][:count] > 0) then
kill_list[i-1][:count] = kill_list[i-1][:count] -1;
if (kill_stats['kills'] > 0) then
kill_stats['kills'] -= 1
kill_count = kill_stats['kills'].to_s
respond "Decrementing count for #{kill_list[i-1][:name]}."
else
kill_list[i-1][:count] = 0;
respond "Kill count for #{kill_list[i-1][:name]} already at 0."
end
end
end
else
unless kill_stats['kills'].nil?
respond "Kill breakdown:"
total=0
for i in 0..(kill_list.length-1) do
if kill_list[i][:level].nil?
respond "#{i+1}: #{kill_list[i][:name]}: #{kill_list[i][:count]}"
else
respond "#{i+1}: #{kill_list[i][:name]}, lvl #{kill_list[i][:level]}: #{kill_list[i][:count]}"
end
total = total + kill_list[i][:count]
end
end
respond "Current Kill Total: #{total}"
respond ""
respond "Use kill +/-<number> to increment the killcount of the critter listed in that row.\n\n"
end
end
else
client_string
end
rescue
UpstreamHook.remove('killtracker')
client_string
end
}
before_dying { UpstreamHook.remove('killtracker') }
before_dying { CharSettings.save }
UpstreamHook.add('killtracker', up_hook)
if script.vars[1] =~ /kills/
respond
respond "Current kill count: #{CharSettings['killcount']}"
echo
exit
elsif script.vars[1] == 'clear'
CharSettings['killcount'] = 0
respond "Cleared your total kills to #{CharSettings['killcount']}"
CharSettings['killlist']=nil;
CharSettings.save
exit
elsif script.vars[1]=='silent'
CharSettings['silentmode']=(!CharSettings['silentmode'])
if CharSettings['silentmode'] then
respond "Setting killcounter to silent mode."
else
respond "Setting killcounter to verbose mode."
end
CharSettings.save
exit
elsif script.vars[1]=='groupmode'
CharSettings['groupmode']=(!CharSettings['groupmode'])
if CharSettings['groupmode'] then
respond "Setting killcounter to group mode."
else
respond "Setting killcounter to solo mode."
end
CharSettings.save
exit
elsif script.vars[1] =~ /help|setup/
respond <<-instructions
How to use:
Run ;killcounter to keep track of how many critters you've killed.
At any time you want to see how many critters you've killed, type kills on your commandline.
Options:
help/setup - You're reading it
clear - ;killcounter clear - Clears your counter and list
kills - Displays what your current kill tally is
kills +/-# Increment or decrement the specified critter #.
Check kills for the associated number for each critter.
Example: kills +4 will increment the count for the creature in the fourth place in your list.
silent - Toggles silent mode. No printout after each creature killed
Bugs:
Message me in game at Caithris
instructions
exit
elsif not script.vars[1].nil?
echo
echo "You typed in an invalid option"
echo
exit
end
creature_list=[["zombie rolton",1],["giant ant",1],["black-winged daggerbeak",1 ],["fire ant",1],["fanged rodent",1],["giant rat",1],["spotted gnarp",1],["young grass snake",1 ],["lesser ghoul",1],["black rolton",1],["mountain rolton",1],["carrion worm",1],["slimy little grub",1 ],["pale crab",2],["thyril",2],["spotted gak",2],["brown gak",2],["lesser frost shade",2 ],["cave gnome",2],["big ugly kobold",2],["moaning phantom",2],["sea nymph",2],["fanged goblin",2],["Mistydeep siren",2],["lesser shade",2],["rabid squirrel",2],["mountain snowcat",3 ],["kobold shepherd",3],["striped gak",3],["Bresnahanini rolton",3 ],["troglodyte",3],["cave gnoll",3],["striped relnak",3],["spotted velnalin",3 ],["greater ghoul",3],["white vysan",3],["greater ice spider",3 ],["dark vysan",3],["velnalin",3],["cave nipper",3],["ice skeleton",3],["relnak",3],["fire salamander",3],["water moccasin",4],["mongrel kobold",4],["urgh",4],["ridge orc",4],["fanged viper",4],["cobra",4],["spotted leaper",4],["black urgh",4],["whiptail",4],["revenant",4],["mongrel hobgoblin",5 ],["night golem",5],["mist wraith",5],["coyote",5],["bobcat",5],["water witch",5],["dark apparition",5],["nasty little gremlin",5 ],["spotted lynx",6],["monkey",6],["lesser orc",6],["lesser mummy",6],["snowy cockatrice",6 ],["leaper",6],["cockatrice",6],["firephantom",6],["spectral fisherman",6 ],["hobgoblin shaman",7 ],["blood eagle",7],["lesser burrow orc",7 ],["lesser red orc",7],["shelfae soldier",7],["greater kappa",7],["crystal crab",8],["mottled thrak",8],["greater orc",8],["greater spider",8],["albino tomb spider",8 ],["greater burrow orc",8 ],["bone golem",8],["crocodile",9],["brown spinner",9],["snow spectre",9],["death dirge",9],["rabid guard dog",10],["raider orc",10],["gnoll worker",10],["giant marmot",10],["cave worm",10],["werebear",10],["great boar",10],["wall guardian",11],["Neartofar orc",11],["shelfae chieftain",11 ],["dark orc",12],["crystal golem",12],["deranged sentry",13],["tawny brindlecat",13 ],["great stag",13],["plumed cockatrice",13 ],["gnoll thief",13],["darkwoode",13],["giant weasel",14],["black boar",14],["Agresh troll scout",14 ],["swamp troll",14],["shadowy spectre",14],["brown boar",14],["silverback orc",14],["great brown bear",14 ],["forest troll",14],["grey orc",14],["wolfshade",15],["ridgeback boar",15],["luminescent arachnid",15 ],["gnoll ranger",15],["Neartofar troll",15],["tomb wight",15],["black leopard",15],["arctic puma",15],["humpbacked puma",15],["panther",15],["large ogre",15],["puma",15],["red bear",16],["wind witch",16],["plains orc warrior",16 ],["mongrel wolfhound",16 ],["cave troll",16],["Agresh bear",16],["Agresh troll warrior",16 ],["phosphorescent worm",16 ],["mongrel troll",16],["fire guardian",16],["hill troll",16],["banded rattlesnake",16 ],["mountain ogre",16],["ghost wolf",16],["ghoul master",16],["fire rat",16],["black bear",16],["giant veaba",17],["mountain troll",17],["plains orc scout",17 ],["forest ogre",17],["gnoll guard",17],["plains ogre",17],["spiked cavern urchin",17 ],["black panther",17],["dark shambler",17],["mountain goat",17],["krolvin mercenary",17 ],["mountain lion",18],["nedum vereri",18],["cave lizard",18],["shelfae warlord",18],["rotting krolvin pirate",18 ],["thunder troll",18],["greenwing hornet",18 ],["ghostly warrior",18],["plains lion",18],["plains orc shaman",18 ],["bighorn sheep",18],["elder ghoul master",18 ],["war troll",18],["fire cat",18],["krolvin warrior",19],["striped warcat",20],["gnoll priest",20],["major spider",20],["ogre warrior",20],["Agresh troll chieftain",20 ],["wood wight",20],["massive grahnk",20],["steel golem",20],["arch wight",20],["cave bear",21],["plains orc chieftain",21 ],["ancient ghoul master",21 ],["Arachne servant",21],["crested basilisk",22 ],["cougar",22],["dark panther",22],["warthog",22],["nonomino",23],["niirsha",23],["fenghai",23],["crazed zombie",23],["rotting woodsman",23 ],["centaur",23],["Arachne acolyte",23],["tree viper",24],["giant albino scorpion",24 ],["arctic wolverine",24 ],["wolverine",24],["veteran reiver",24],["burly reiver",24],["ice hound",24],["carceris",25],["gnoll jarl",25],["krolvin warfarer",25 ],["spectral monk",25],["sacristan spirit",25],["Arachne priestess",26 ],["Arachne priest",26],["jungle troll",26],["tree spirit",26],["snow leopard",27],["Grutik savage",27],["troll chieftain",27],["cyclops",27],["lesser stone gargoyle",27 ],["monastic lich",27],["frenzied monk",27],["darken",28],["giant hawk-owl",28],["dobrem",28],["fire ogre",28],["ki-lin",28],["moaning spirit",28],["arctic manticore",29 ],["Grutik shaman",29],["pra'eda",29],["ice troll",29],["scaly burgee",29],["hunter troll",30],["hisskra warrior",30],["jungle troll chieftain",30 ],["elder tree spirit",30 ],["giant albino tomb spider",30],["mammoth arachnid",30 ],["hooded figure",30],["ash hag",31],["skeletal ice troll",31 ],["wild hound",31],["caribou",32],["ghostly mara",32],["rotting corpse",32],["rotting farmhand",32 ],["wild dog",32],["giant fog beetle",32 ],["ghostly pooka",33],["mezic",33],["three-toed tegu",33],["maw spore",33],["sand beetle",33],["hisskra shaman",33],["moor hound",33],["skeletal giant",33],["spectral warrior",34 ],["hisskra chieftain",34 ],["moor witch",34],["lava troll",34],["colossus vulture",34 ],["troll zombie",34 ],["tundra giant",34],["cold guardian",34],["skeletal soldier",34 ],["spectral shade",35],["shimmering fungus",35 ],["spectral woodsman",35 ],["barghest",35],["troll wraith",35],["water wyrd",35],["bog troll",35],["moor eagle",35],["snow crone",36],["dust beetle",36],["spectral lord",36],["fire giant",36],["undertaker bat",36],["arctic titan",36],["krolvin slaver",36],["shadow mare",37],["skeletal warhorse",37 ],["Sheruvian initiate",37 ],["lesser moor wight",37 ],["tusked ursian",37],["huge mein golem",37],["magru",37],["grizzly bear",38],["vesperti",38],["wood sprite",38],["shadow steed",38],["krolvin corsair",38],["mud wasp",38],["frost giant",38],["greater moor wight",39 ],["vourkha",39],["greater bog troll",39 ],["storm giant",39],["stone gargoyle",39],["myklian",40],["spectral miner",40],["kiramon worker",40],["lesser ice giant",41 ],["roa'ter",41],["Sheruvian monk",41],["skeletal lord",41],["bog wraith",41],["minor glacei",42],["dark vortece",42],["phantasma",42],["swamp hag",42],["frozen corpse",42],["baesrukha",42],["shan warrior",42],["shan ranger",42],["shan cleric",42],["shan wizard",42],["siren lizard",42],["wasp nest",43],["night mare",43],["dreadnought raptor",43 ],["bog wight",44],["forest trali shaman",44 ],["mastodonic leopard",44 ],["gaunt spectral servant",44 ],["firethorn shoot",44],["polar bear",44],["ice wraith",45],["lesser vruul",45],["greater ice giant",46 ],["kiramon defender",46 ],["cinder wasp",46],["forest trali",46],["rotting chimera",46],["lesser faeroth",46],["bog spectre",47],["major glacei",47],["horned vor'taz",48],["dybbuk",48],["necrotic snake",48],["sand devil",48],["red-scaled thrak",48 ],["warrior shade",48],["waern",49],["banshee",50],["flesh golem",50],["greater faeroth",50],["wooly mammoth",52],["tomb troll",52],["seeker",52],["snow madrinol",52],["lesser ice elemental",53 ],["sabre-tooth tiger",53 ],["ice golem",53],["stone sentinel",53],["animated slush",54],["skayl",54],["troll necromancer",54 ],["mage apprentice",54],["nightmare steed",55],["eidolon",55],["stone troll",55],["Citadel guardsman",56],["lava golem",56],["glacial morph",56],["stone giant",58],["Citadel arbalester",58],["massive pyrothag",58 ],["massive black boar",59 ],["forest viper",59 ],["fire elemental",60],["forest ogre",60 ],["Citadel herald",60],["stone mastiff",62],["bestial swordsman", 62],["Illoke mystic",62],["massive troll king",63 ],["ice elemental",63],["wind wraith",63],["soul golem",63],["Sheruvian harbinger",63 ],["fire sprite",64],["grifflet",64],["red tsark",66],["emaciated hierophant",66 ],["muscular supplicant",67 ],["Illoke shaman",67],["lesser griffin",69],["krag yeti",70],["hunch-backed dogmatist",70 ],["fire mage",71],["krag dweller",72],["storm griffin",73],["lesser minotaur",74],["moulis",75],["naisirc",75],["greater vruul",75],["minotaur warrior",76 ],["shrickhen",76],["csetairi",76],["raving lunatic",77],["farlook",77],["minotaur magus",78],["dhu goleras",78],["seraceris",78],["gnarled being",82],["caedera",82],["Vvrael witch",82],["lesser construct",83 ],["lich qyn'arj",84],["Vvrael warlock",84],["greater krynch",84],["gremlock",84],["festering taint",86],["aivren",86],["Illoke elder",86],["n'ecare",87],["greater earth elemental",88 ],["Illoke jarl",89],["Ithzir scout",89],["lost soul",91],["Ithzir initiate",91],["Ithzir janissary",92 ],["vaespilon",93],["Ithzir herald",93],["triton dissembler",94 ],["Ithzir adept",96],["siren",96],["triton executioner",96 ],["greater construct",96 ],["Ithzir seer",97],["triton combatant",98 ],["triton defender",98],["war griffin",100],["triton radical",100],["triton magus",102],["triton sentry",103],["greater water elemental",105],["water elemental",92],["rolton",1],["phantom",2],["wraith",15],["ghost",2],["skeleton",1],["kobold",1],["reiver",24],["thrak",8],["manticore",9],["goblin",2],["hobgoblin",3],["yeti",67],["spectre",14],["earth elemental",82],["fallen crusader",97],["murky soul siphon",106],["lich",110],["enormous rift crawler",103],["darkly inked fetish master", 104],["glistening cerebralite",100],["Vvrael destroyer",108],["zombie",23]]
recognition=Array.new
immolated = LimitedArray.new
immolated.max_size = 15
#action = proc { |server_string|
# if server_string =~ /recognition/ then
# echo server_string
# end
# server_string
#}
#before_dying{DownstreamHook.remove('recognitionhook')}
#DownstreamHook.add('recognitionhook',action)
while line = get do
# echo line
if line =~ /<stream id=\"thoughts\">/ then
next
### this next line stolified from Tillmen's loot.lic
elsif line =~ /You (?:swing|gesture|sing|weave another verse|continue to sing|channel|fire|wave|tap|rub|hurl|thrust|slash|throw|punch|attempt to punch|attempt to kick|attempt to throw|quickly dart behind .*? and try to hamstring|mentally attempt to locate your implanted essence)|Your (?:<.*?>)?raging sandstorm(?:<.*?>)? swirls around|^The flames surrounding <pushBold\/>an? <a exist=\"(?:\#{immolated.join('|')})\" noun=\".*?\">.*?<\/a><popBold\/> flare up violently\.\.\.|A .*? leaps from a <a.*?>.*?<\/a> <pushBold\/>.*?<a exist=\"(?:\#{weapon_fired.join('|')})\".*?>.*?<\/a><popBold\/> is wielding\./
candidates = Array.new
imploded = Array.new
recognition = Array.new
while (line = get) and (line !~ /Roundtime|A little bit late for that don't you think|<prompt/) do
if line =~ /^<pushBold\/>A <a exist=\".*?\" noun=\".*?\">.*?<\/a><popBold\/> releases a groan of mingled ecstasy and relief as <pushBold\/><a exist=\".*?\" noun=\".*?\">.*?<\/a><popBold\/> fades away/
if Stats.level - 63 < 9 then
kill_stats['kills'] += 1
CharSettings['killcount']=kill_stats['kills'].to_s
found=false
CharSettings['killlist'].each{|monster|
if monster[:name]=='wind wraith' then
#echo "adding to current list"
monster[:count] = monster[:count] +1;
found=true;
end
}
unless found then
#echo "pushing #{npc.name}, #{level}, 1 into killlist"
CharSettings['killlist'].push(h={:name=>'wind wraith',:level=>63,:count=>1})
end
unless CharSettings['silentmode']
echo "Total kills: #{kill_stats['kills']}"
end
end
CharSettings.save
end
if line =~ /<a exist=['\"](.*?)['\"]/
candidates.push($1) unless candidates.include?($1)
end
if line =~ /Wisps of black smoke swirl around <pushBold\/>.*?<a exist=\"(.*?)\" noun=\".*?\">.*?<\/a><popBold\/> and s?he bursts into flame!/
immolated.push($1) unless immolated.include?($1)
end
if line =~ /Rather abrupt decompression causes <pushBold\/>.*?<a exist=\".*?\" noun=\".*?\">(.*?)<\/a><popBold\/> to explode|Blast disperses the <pushBold\/><a exist=\".*?\" noun=\".*?\">(.*?)<\/a><popBold\/> into a fine mist|<a exist=\".*?\" noun=\".*?\">(.*?)<\/a><popBold\/> inverts as the intense vacuum rips it to shreds/
imploded.push($1)
end
end
imploded.each{|imploded_critter_name|
if imploded_critter_name=~/thief|bandit|brigand|mugger|rogue|highwayman|marauder|thug|robber|outlaw/ then
kill_stats['kills'] += 1
CharSettings['killcount']=kill_stats['kills'].to_s
if CharSettings['killlist'].nil?
CharSettings['killlist']=Array.new
CharSettings['killlist'].push(h={:name=>'bandit',:level=>nil,:count=>1})
kill_list=CharSettings['killlist']
else
found=false
CharSettings['killlist'].each{|monster|
if monster[:name]=='bandit' then
#echo "adding to current list"
monster[:count] = monster[:count] +1;
found=true;
end
}
unless found then
#echo "pushing #{'bandit'}, #{level}, 1 into killlist"
CharSettings['killlist'].push(h={:name=>'bandit',:level=>nil,:count=>1})
end
end
unless CharSettings['silentmode']
echo "Total kills: #{kill_stats['kills']}"
end
#echo "I detected that you gained #{$recognition} recognition points"
end
if imploded_critter_name=~/Grimswarm/ then
#echo "You killed a grim"
#echo recognition
if true then
kill_stats['kills'] += 1
grimname=imploded_critter_name
CharSettings['killcount']=kill_stats['kills'].to_s
if UserVars.grimcount.nil?
UserVars.grimcount = "1"
else
UserVars.grimcount = (UserVars.grimcount.to_i + 1).to_s
end
if imploded_critter_name=~/orc/ then
grimname=imploded_critter_name.split(" orc").first
elsif imploded_critter_name=~/troll/ then
grimname=imploded_critter_name.split(" troll").first
elsif imploded_critter_name=~/giant/ then
grimname=imploded_critter_name.split(" giant").first
end
if CharSettings['killlist'].nil?
CharSettings['killlist']=Array.new
CharSettings['killlist'].push(h={:name=>grimname,:level=>nil,:count=>1})
kill_list=CharSettings['killlist']
else
found=false
CharSettings['killlist'].each{|monster|
if monster[:name]==grimname then
#echo "adding to current list"
monster[:count] = monster[:count] +1;
found=true;
end
}
unless found then
#echo "pushing #{grimname}, #{level}, 1 into killlist"
CharSettings['killlist'].push(h={:name=>grimname,:level=>nil,:count=>1})
end
end
unless CharSettings['silentmode']
echo "Total kills: #{kill_stats['kills']}"
end
#echo "I detected that you gained #{$recognition} recognition points"
end
recognition = 0
end
creature_list.find{|critter, level|
if imploded_critter_name=~/#{critter}/ then
#echo "found critter, #{critter} level #{level}"
if Stats.level - level < 10 then
#if Stats.level>1
kill_stats['kills'] += 1
CharSettings['killcount']=kill_stats['kills'].to_s
unless CharSettings['silentmode']
echo "Total kills: #{kill_stats['kills']}"
end
if CharSettings['killlist'].nil?
#echo "pushing #{imploded_critter_name}, #{level}, 1 into killlist"
CharSettings['killlist']=Array.new
CharSettings['killlist'].push(h={:name=>imploded_critter_name,:level=>level,:count=>1})
kill_list=CharSettings['killlist']
else
found=false
CharSettings['killlist'].each{|monster|
if monster[:name]==imploded_critter_name then
#echo "adding to current list"
monster[:count] = monster[:count] +1;
found=true;
end
}
unless found then
#echo "pushing #{imploded_critter_name}, #{level}, 1 into killlist"
CharSettings['killlist'].push(h={:name=>imploded_critter_name,:level=>level,:count=>1})
end
end
#echo CharSettings['killlist']
end
break
end
}
}
for obj_id in candidates
if (npc = GameObj.npcs.find { |npc| npc.id == obj_id }) and (npc.status == 'dead')
#echo npc.name
if npc.name=~/thief|bandit|brigand|mugger|rogue|highwayman|marauder|thug|robber|outlaw/ then
kill_stats['kills'] += 1
CharSettings['killcount']=kill_stats['kills'].to_s
if CharSettings['killlist'].nil?
CharSettings['killlist']=Array.new
CharSettings['killlist'].push(h={:name=>'bandit',:level=>nil,:count=>1})
kill_list=CharSettings['killlist']
else
found=false
CharSettings['killlist'].each{|monster|
if monster[:name]=='bandit' then
#echo "adding to current list"
monster[:count] = monster[:count] +1;
found=true;
end
}
unless found then
#echo "pushing #{'bandit'}, #{level}, 1 into killlist"
CharSettings['killlist'].push(h={:name=>'bandit',:level=>nil,:count=>1})
end
end
unless CharSettings['silentmode']
echo "Total kills: #{kill_stats['kills']}"
end
#echo "I detected that you gained #{$recognition} recognition points"
end
if npc.name=~/Grimswarm/ then
#echo "You killed a grim"
#echo recognition
if true then
kill_stats['kills'] += 1
grimname=npc.name
CharSettings['killcount']=kill_stats['kills'].to_s
if UserVars.grimcount.nil?
UserVars.grimcount = "1"
else
UserVars.grimcount = (UserVars.grimcount.to_i + 1).to_s
end
if npc.name=~/orc/ then
grimname=npc.name.split(" orc").first
elsif npc.name=~/troll/ then
grimname=npc.name.split(" troll").first
elsif npc.name=~/giant/ then
grimname=npc.name.split(" giant").first
end
if CharSettings['killlist'].nil?
CharSettings['killlist']=Array.new
CharSettings['killlist'].push(h={:name=>grimname,:level=>nil,:count=>1})
kill_list=CharSettings['killlist']
else
found=false
CharSettings['killlist'].each{|monster|
if monster[:name]==grimname then
#echo "adding to current list"
monster[:count] = monster[:count] +1;
found=true;
end
}
unless found then
#echo "pushing #{grimname}, #{level}, 1 into killlist"
CharSettings['killlist'].push(h={:name=>grimname,:level=>nil,:count=>1})
end
end
unless CharSettings['silentmode']
echo "Total kills: #{kill_stats['kills']}"
end
#echo "I detected that you gained #{$recognition} recognition points"
end
recognition = 0
end
creature_list.find{|critter, level|
if npc.name=~/#{critter}/ then
#echo "found critter, #{critter} level #{level}"
if Stats.level - level < 10 then
#if Stats.level>1
kill_stats['kills'] += 1
CharSettings['killcount']=kill_stats['kills'].to_s
unless CharSettings['silentmode']
echo "Total kills: #{kill_stats['kills']}"
end
if CharSettings['killlist'].nil?
#echo "pushing #{npc.name}, #{level}, 1 into killlist"
CharSettings['killlist']=Array.new
CharSettings['killlist'].push(h={:name=>npc.name,:level=>level,:count=>1})
kill_list=CharSettings['killlist']
else
found=false
CharSettings['killlist'].each{|monster|
if monster[:name]==npc.name then
#echo "adding to current list"
monster[:count] = monster[:count] +1;
found=true;
end
}
unless found then
#echo "pushing #{npc.name}, #{level}, 1 into killlist"
CharSettings['killlist'].push(h={:name=>npc.name,:level=>level,:count=>1})
end
end
#echo CharSettings['killlist']
end
break
end
}
end
end
CharSettings.save
end
end