-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinteractive-map.js
1181 lines (1130 loc) · 38.5 KB
/
interactive-map.js
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
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* hide element #id
*/
function hideIdElement(id) {
var x = document.getElementById(id);
if (x !== null) {
x.style.display = 'none';
}
}
/* hide all elements .classname
*/
function hideClassElements(classname) {
var x = document.getElementsByClassName(classname);
for (var i = 0; i < x.length; i++) {
x[i].style.display = 'none';
}
}
/* toggle element #id
*/
function toggleIdElement(id) {
var x = document.getElementById(id);
if (x !== null) {
if (x.style.display === 'none') {
x.style.display = 'block';
} else {
x.style.display = 'none';
}
}
}
/* toggle all elements .classname
*/
function toggleClassElements(classname) {
var x = document.getElementsByClassName(classname);
for (var i = 0; i < x.length; i++) {
if (x[i].style.display === 'none') {
x[i].style.display = 'block';
} else {
x[i].style.display = 'none';
}
}
}
/* toggle #id active via css class
*/
function toggleIdActive(id) {
var x = document.getElementById(id);
if (x !== null) {
if (x.classList.contains('active')) {
x.classList.remove('active');
} else {
x.classList.add('active');
}
}
}
/* toggle #id beautiful via css class
*/
function toggleIdBeautiful(id) {
var x = document.getElementById(id);
if (x !== null) {
if (x.classList.contains('beautiful')) {
x.classList.remove('beautiful');
} else {
x.classList.add('beautiful');
}
}
}
/* toggle .classname active via css class
*/
function toggleClassActive(classname) {
var x = document.getElementsByClassName(classname);
for (var i = 0; i < x.length; i++) {
if (x[i].classList.contains('active')) {
x[i].classList.remove('active');
} else {
x[i].classList.add('active');
}
}
}
/* unset .classname active via css class
*/
function unsetClassActive(classname) {
var x = document.getElementsByClassName(classname);
for (var i = 0; i < x.length; i++) {
x[i].classList.remove('active');
}
}
/* do we have a valid location in the url which we can
* use to jump to the proper sub map?
*/
function getLocation(zoneOrAlliance) {
var validLocations = [
/* structure:
['alliance-shortname', 'alliance-name',
['zone-1', 'zone-2', 'zone-3', ...] ], ...
*/
/* ad zones */
['ad', 'aldmeri-dominion',
['auridon', 'grahtwood', 'greenshade', 'malabaltor', 'reapersmarch', 'khenarthisroost'] ],
/* dc zones */
['dc', 'daggerfall-covenant',
['glenumbra', 'stormhaven', 'rivenspire', 'alikrdesert', 'bangkorai', 'betnikh', 'strosmkai'] ],
/* ep zones */
['ep', 'ebonheart-pact',
['stonefalls', 'deshaan', 'shadowfen', 'eastmarch', 'therift', 'bleakrockisle', 'balfoyen',
'blackreach-mzark' ] ],
/* cyro & neutral zones */
['cyro-neutral', 'cyro-neutral',
['cyrodiil', 'coldharbour', 'craglorn', 'imperialcity'] ],
/* dlc & chapter zones */
['dlc-chapter', 'dlc-chapter',
['wrothgar', 'hewsbane', 'goldcoast', 'clockworkcity', 'vvardenfell', 'summerset',
'artaeum', 'murkmire', 'elsweyr', 'northernelsweyr', 'southernelsweyr', 'westernskyrim',
'blackreach', 'blackreach-greymoor', 'thereach', 'blackreach-arkthzand', 'blackwood',
'deadlands', 'deadlands-fargrave', 'highisleandamenos', 'galenandyffelon', 'telvannipeninsula',
'apocrypha', 'westweald'] ],
/* overlay zone */
['overlay', 'overlay-alliance',
['overlay', 'overlay-zone'] ],
/* tamriel zone */
['tamriel', 'tamriel-alliance',
['tamriel', 'tamriel-zone'] ],
/* alliances & dummy alliances */
['alliance', 'alliance',
['aldmeri-dominion', 'daggerfall-covenant', 'ebonheart-pact', 'cyro-neutral', 'dlc-chapter',
'overlay-alliance', 'tamriel-alliance'] ]
];
var locZA = '';
if (zoneOrAlliance) { /* grab from parameter */
locZA = zoneOrAlliance;
} else { /* grab from url */
locZA = window.location.hash.substr(1); /* extract anchor */
}
for (var i = 0; i < validLocations.length; i++) {
for (var j = 0; j < validLocations[i][2].length; j++) {
if (locZA === validLocations[i][2][j]) {
if (validLocations[i][2][j] === 'elsweyr') { /* keep the legacy 'elsweyr' location remapped to 'northernelsweyr' */
var retval = [validLocations[i][1], 'northernelsweyr'];
} else if (validLocations[i][2][j] === 'blackreach') { /* keep the legacy 'blackreach' location remapped to 'blackreach-greymoor' */
var retval = [validLocations[i][1], 'blackreach-greymoor'];
} else if (validLocations[i][2][j] === 'overlay') { /* keep the legacy 'overlay' location remapped to 'overlay-zone' */
var retval = [validLocations[i][1], 'overlay-zone'];
} else {
var retval = [validLocations[i][1], validLocations[i][2][j]];
}
return retval;
}
}
}
return [false, false]; /* return [alliance, zone] */
}
/* return zone name based on data-name
*/
function getZoneName(zone) {
var locZ = getLocation(zone)[1]; /* sanitize zone or alliance */
var locZName = document.getElementById(locZ).getAttribute('data-name');
/* return zone name */
if (locZName !== '' && locZName) {
return locZName;
} else {
return '';
}
}
/* do we have foul or oily holes in our zone? (only needed in cwc)
*/
function foulOrOilyOrAbyssal(zone) {
var locZ = getLocation(zone)[1]; /* sanitize zone */
var x = document.getElementById(locZ).getElementsByClassName('foul fh'); /* foul fishing holes */
var y = document.getElementById(locZ).getElementsByClassName('oily fh'); /* oily fishing holes */
var z = document.getElementById(locZ).getElementsByClassName('abyssal fh'); /* abyssal fishing holes */
if (y.length > 0 && x.length === 0) {
return 'oily';
} else if (z.length > 0 && x.length === 0) {
return 'abyssal';
} else {
return 'foul';
}
}
/* count fishing holes of a certain type in a certain zone and
* add the numbers to the type-buttons
*/
function countFishingHoles(zone, type) {
var locZ = getLocation(zone)[1]; /* sanitize zone */
var x = ''; /* hole type */
if (type === 'oily' || type === 'abyssal') { /* oily and abyssal are equal to foul in terms of button id */
x = 'foul';
} else {
x = type;
}
var y = document.getElementById('tb-' + x); /* toggle button for hole types */
if (locZ === 'overlay-zone' && type === 'foul') { /* add oily and abyssal holes number to foul ones in overlay-zone - we have both! */
var z = document.getElementById(locZ).getElementsByClassName('oily' + ' fh').length +
document.getElementById(locZ).getElementsByClassName('abyssal' + ' fh').length +
document.getElementById(locZ).getElementsByClassName(type + ' fh').length;
} else {
var z = document.getElementById(locZ).getElementsByClassName(type + ' fh').length; /* zone fishing holes of a certain type */
}
/* replace button text */
if (y !== null) {
y.innerHTML = type + ' (' + z + ')';
}
/* also return the number of fishing holes */
return z;
}
/* count all fishing holes in a zone or an alliance
*/
function countAllFishingHoles(zoneOrAlliance) {
var locZA = getLocation(zoneOrAlliance)[1]; /* sanitize zone or alliance */
var x = document.getElementById(locZA).getElementsByClassName('fh').length; /* zone or alliance fishing holes */
return x;
}
/* return rare fish info for requested zone
*/
function getRareFish(zone) {
var locZ = getLocation(zone)[1]; /* sanitize zone */
switch(locZ) {
/* Aldmeri Dominion */
case 'auridon':
fish = [
[ ['blue'],
['foul', ''],
['river', 'Shimmerpike'],
['saltwater', 'Blue Monkfish', 'Thrassian Eel'],
['lake', 'Ilyadifish'] ],
[ ['green'],
['foul', ''],
['river', 'Blackspotted Pike', 'Bristlemouths', 'Muskie'],
['saltwater', 'Eucla Cod', 'Mola'],
['lake', 'Barbel', 'Mudfish', 'Sturgeon'] ] ]
break;
case 'grahtwood':
fish = [
[ ['blue'],
['foul', 'Bilious Catfish'],
['river', 'Greater Fangfin'],
['saltwater', 'Magrove Shark'],
['lake', 'Stickleback'] ],
[ ['green'],
['foul', 'Snapper Eel', 'Swamp Eel'],
['river', 'Hog Sucker', 'Tiger Perch'],
['saltwater', 'Devil Ray', 'Mojarra'],
['lake', 'Dreughfish', 'Koi'] ] ]
break;
case 'greenshade':
fish = [
[ ['blue'],
['foul', 'Viperfish'],
['river', 'Xylo Piranha'],
['saltwater', 'Zebra Pompano'],
['lake', 'Jungle Bass'] ],
[ ['green'],
['foul', 'Cusk Eel', 'Wolf-Eel'],
['river', 'Lyretail', 'Walleye'],
['saltwater', 'Manefish', 'Triggerfish'],
['lake', 'Archerfish', 'Murray Cod'] ] ]
break;
case 'malabaltor':
fish = [
[ ['blue'],
['foul', 'Ouze Toadfish'],
['river', 'Strident Leechfin'],
['saltwater', 'Abecean Halibut'],
['lake', 'Z\'en\'s Whitefish'] ],
[ ['green'],
['foul', 'Ghastel Bass', 'Stargazer'],
['river', 'Mrigal', 'Stonefish'],
['saltwater', 'Ono', 'Sea Bass'],
['lake', 'Arowana', 'Inconnu'] ] ]
break;
case 'reapersmarch':
fish = [
[ ['blue'],
['foul', 'Slimeslither'],
['river', 'Strid Shad'],
['saltwater', ''],
['lake', 'Forest Bream', 'Preposterous Mackerel'] ],
[ ['green'],
['foul', 'Brotula', 'Reaper\'s Eel', 'Red Gurnard'],
['river', 'Flying Fish', 'Sheepshead', 'Sweetfish'],
['saltwater', ''],
['lake', 'Brown Trout', 'Ladyfish'] ] ]
break;
case 'khenarthisroost':
fish = [
[ ['blue'],
['foul', ''],
['river', ''],
['saltwater', 'Pyandonean Ray'],
['lake', ''] ],
[ ['green'],
['foul', ''],
['river', ''],
['saltwater', ''],
['lake', ''] ] ]
break;
/* Daggerfall Covenant */
case 'glenumbra':
fish = [
[ ['blue'],
['foul', 'Hag Fen Hagfish'],
['river', 'Brook Trout'],
['saltwater', 'Azurian Flounder'],
['lake', 'Cambray Perch'] ],
[ ['green'],
['foul', 'Dragonfish', 'Lamprey'],
['river', 'Catfish', 'Warmouth'],
['saltwater', 'Finless Sole', 'Tuna'],
['lake', 'Powen', 'Rock Bass'] ] ]
break;
case 'stormhaven':
fish = [
[ ['blue'],
['foul', 'Gray Loach'],
['river', 'Dreugh Shrimp'],
['saltwater', 'Alcaire Pike'],
['lake', 'Silver Walleye'] ],
[ ['green'],
['foul', 'Sawfish', 'Yellow Moray'],
['river', 'Grass Carp', 'River Stingray'],
['saltwater', 'Dab', 'Stormhaven Flounder'],
['lake', 'Barfish', 'Yellow Bass'] ] ]
break;
case 'rivenspire':
fish = [
[ ['blue'],
['foul', ''],
['river', 'Ruby Trench'],
['saltwater', 'Northpoint Cod', 'Snakehead'],
['lake', 'Ichory Chub'] ],
[ ['green'],
['foul', ''],
['river', 'Ribbon Eel', 'Stream Catfish', 'Turbot'],
['saltwater', 'Dusky Grouper', 'Hake'],
['lake', 'Nase', 'Rivenspire Trout', 'Writhing Scrab'] ] ]
break;
case 'alikrdesert':
fish = [
[ ['blue'],
['foul', 'Midget Salmon', 'Sand Eel'],
['river', ''],
['saltwater', 'Bonefish'],
['lake', 'Desert Pupfish'] ],
[ ['green'],
['foul', 'Cutthroat Eel', 'Sand Moray'],
['river', ''],
['saltwater', 'Alewife', 'Driftfish', 'Sablefish'],
['lake', 'Banded Killifish', 'Lungfish', 'Saw Belly'] ] ]
break;
case 'bangkorai':
fish = [
[ ['blue'],
['foul', ''],
['river', 'Prickleback'],
['saltwater', 'Bjoulsae Hake'],
['lake', 'Lake Snapper', 'Scaly Lungfish'] ],
[ ['green'],
['foul', ''],
['river', 'Lenok', 'Panga', 'Pupfish'],
['saltwater', 'Morid Cod', 'Swai', 'Toadfish'],
['lake', 'Gar', 'Paddlefish'] ] ]
break;
case 'betnikh':
fish = [
[ ['blue'],
['foul', ''],
['river', ''],
['saltwater', ''],
['lake', ''] ],
[ ['green'],
['foul', ''],
['river', ''],
['saltwater', ''],
['lake', ''] ] ]
break;
case 'strosmkai':
fish = [
[ ['blue'],
['foul', ''],
['river', ''],
['saltwater', 'Eltheric Grouper'],
['lake', ''] ],
[ ['green'],
['foul', ''],
['river', ''],
['saltwater', ''],
['lake', ''] ] ]
break;
/* Ebonheart Pact */
case 'stonefalls':
fish = [
[ ['blue'],
['foul', 'Scum Carp'],
['river', 'Ash Shad'],
['saltwater', 'Akaviri Wrasse'],
['lake', 'Rainbow Zander'] ],
[ ['green'],
['foul', 'Fungusfish', 'Stinkfish'],
['river', 'Ricefish', 'Thorny Catfish'],
['saltwater', 'Armorhead', 'Travally'],
['lake', 'Lake Chub', 'Tench'] ] ]
break;
case 'deshaan':
fish = [
[ ['blue'],
['foul', ''],
['river', 'Toadstool Tilapia'],
['saltwater', 'Pikeblenny'],
['lake', 'Mud Lamprey', 'Old Man Gar'] ],
[ ['green'],
['foul', ''],
['river', 'Cutthroat Trout', 'Deshaan Chub', 'Mouthbrooder'],
['saltwater', 'Gibberfish', 'Monkfish', 'Mustard Eel'],
['lake', 'Gourami', 'Ide'] ] ]
break;
case 'shadowfen':
fish = [
[ ['blue'],
['foul', 'Coelcanth', 'Toxic Xoach'],
['river', 'Shark Tadpole'],
['saltwater', ''],
['lake', 'Histcarp'] ],
[ ['green'],
['foul', 'Eel-Goby', 'Pricklefish'],
['river', 'Boga', 'Hardyhead', 'Opah'],
['saltwater', ''],
['lake', 'Orange Roughy', 'Quillback', 'Zander'] ] ]
break;
case 'eastmarch':
fish = [
[ ['blue'],
['foul', 'Ice Remora'],
['river', 'White River Pickerel'],
['saltwater', 'Ghost Haddock'],
['lake', 'King Sturgeon'] ],
[ ['green'],
['foul', 'Modoc Sucker', 'Snipe Eel'],
['river', 'Ice Fish', 'Steelhead'],
['saltwater', 'Golem Shark', 'Pigfish'],
['lake', 'Char', 'Eastmarch Pike'] ] ]
break;
case 'therift':
fish = [
[ ['blue'],
['foul', 'Sulfursucker'],
['river', 'Muskellunge', 'White Roughy'],
['saltwater', ''],
['lake', 'Ilinalta Trout'] ],
[ ['green'],
['foul', 'Bream', 'Skate', 'Skorm'],
['river', 'Grouper', 'Sockeye Salmon'],
['saltwater', ''],
['lake', 'Ice Koi', 'Jarl Salmon', 'Zebra Oto'] ] ]
break;
case 'bleakrockisle':
fish = [
[ ['blue'],
['foul', ''],
['river', ''],
['saltwater', 'Inner Sea Scalyfin'],
['lake', ''] ],
[ ['green'],
['foul', ''],
['river', ''],
['saltwater', ''],
['lake', ''] ] ]
break;
case 'balfoyen':
fish = [
[ ['blue'],
['foul', ''],
['river', ''],
['saltwater', ''],
['lake', ''] ],
[ ['green'],
['foul', ''],
['river', ''],
['saltwater', ''],
['lake', ''] ] ]
break;
/* Cyrodiil & Neutral */
case 'cyrodiil':
fish = [
[ ['blue'],
['foul', 'Sewer Eel'],
['river', 'Nibenay Trout'],
['saltwater', 'Topal Fanche'],
['lake', 'Rumare Bream'] ],
[ ['green'],
['foul', 'Pufferfish', 'Quillfish'],
['river', 'Glassfish', 'Pirate Perch'],
['saltwater', 'Emperor Angelfish', 'Jewel Fish'],
['lake', 'Rainbow Fish', 'Yellow Perch'] ] ]
break;
case 'coldharbour':
fish = [
[ ['blue'],
['foul', 'Ghoulfish'],
['foul', 'Heinous Gar'],
['foul', 'Moray Leech'],
['foul', 'Stingerpike'] ],
[ ['green'],
['foul', 'Azure Eel', 'Bichir'],
['foul', 'Blue Slimefish', 'Cavefish'],
['foul', 'Fang Shark', 'Harbour Gar'],
['foul', 'Plasm Darter', 'Venomfish'] ] ]
break;
case 'craglorn':
fish = [
[ ['blue'],
['river', 'Nedic Eel'],
['river', 'Yokudan Cod'],
['lake', 'Crag Salmon'],
['lake', 'Glasshead Barreleye'] ],
[ ['green'],
['river', 'Bitterling', 'Dragon Goby'],
['river', 'Mermouth', 'Spiny Orcfish'],
['lake', 'Croaker', 'Forlorn Catfish'],
['lake', 'Ghost Knifefish', 'Nirn Flounder'] ] ]
break;
case 'imperialcity':
fish = [
[ ['blue'],
['foul', 'Aphotic Batfish'],
['foul', 'Cannibal Lancet'],
['foul', 'Glow-Spotted Blenny'],
['foul', ''] ],
[ ['green'],
['foul', 'Blobfin', 'Flabby Whalefish', 'Guiyu'],
['foul', 'Hatchetfish', 'Humpback Angler', 'Imperial Loosejaw'],
['foul', 'Scabrous Grenadier', 'Trapjaw Eel', 'Wen Loach'],
['foul', ''] ] ]
break;
/* DLC and Chapter Zones */
case 'wrothgar':
fish = [
[ ['blue'],
['foul', 'Greater Ashmouth'],
['river', 'Chinlea'],
['saltwater', 'Blue-Ringed Octopus'],
['lake', 'Giant Hammerjaw'] ],
[ ['green'],
['foul', 'Lesser Ashmouth', 'Pariah Lumpfish'],
['river', 'Nelma', 'Tum Weever'],
['saltwater', 'Black Scabbardfish', 'Hairy Coffinfish'],
['lake', 'Matron Eelpout', 'Vorkiposh'] ],
[ ['purple'],
['foul', ''],
['river', ''],
['saltwater', 'Crab-Slaughter Crane'],
['lake', ''] ] ]
break;
case 'hewsbane':
fish = [
[ ['blue'],
['foul', 'Keuppia'],
['river', 'Glass Catfish'],
['saltwater', 'Sparkling Anglermouth'],
['lake', 'Cichlid'] ],
[ ['green'],
['foul', 'Daggertooth', 'Fringed Mudskipper'],
['river', 'Firemouth', 'Hew\'s Rasbora'],
['saltwater', 'Beggar Shark', 'Crestfish'],
['lake', 'Bala Shark', 'Cherry Barb'] ] ]
break;
case 'goldcoast':
fish = [
[ ['blue'],
['foul', 'Ghastly Batfish'],
['river', 'Bullface Wingfin'],
['saltwater', 'Sleeper Shark'],
['lake', 'Palatine Sabertooth'] ],
[ ['green'],
['foul', 'Black Anvil Loach', 'Spiny Frogfish'],
['river', 'Gold Coast Crayfish', 'Longmouth Pike'],
['saltwater', 'Rattail', 'Scorpionfish'],
['lake', 'Hammer Bombil', 'Spotted Bass'] ] ]
break;
case 'clockworkcity':
fish = [
[ ['blue'],
['oily', 'Ancestor Wrasse'],
['oily', 'Barilzar\'s Grenadier'],
['oily', 'Enmegalabzu'],
['oily', ''] ],
[ ['green'],
['oily', 'Clicking Travally', 'Copperclaw Crayfish', 'Coppery Cucumber'],
['oily', 'Imperfect Blobfin', 'Oil-Eater Whalefish', 'Operant Eel'],
['oily', 'Orod', 'Verminous Catfish', 'Whisper Knifefish'],
['oily', ''] ] ]
break;
case 'vvardenfell':
fish = [
[ ['blue'],
['foul', 'Oanna'],
['river', 'Ash Blindfish'],
['saltwater', 'Resdaynian Sailfin'],
['lake', 'Shalk-Brother Crayfish'] ],
[ ['green'],
['foul', 'Firemouth Guiyu', 'Sleeper Coffinfish'],
['river', 'Netch-Hook Eel', 'Pilgrim Goby'],
['saltwater', 'Ghost Octopus', 'Weeping Pygmy Shark'],
['lake', 'Hoaga Oto', 'Pity Bombil'] ] ]
break;
case 'summerset':
fish = [
[ ['blue'],
['foul', 'Senche Flathead'],
['river', 'Great Yellowfin'],
['saltwater', 'Lingweloce'],
['lake', 'Crystal Hannia'] ],
[ ['green'],
['foul', 'Burnish Groper', 'Copper Oreodory'],
['river', 'Anu\'s Travally', 'Eton Sprat'],
['saltwater', 'Quicksilver Lingwe', 'Radiant Dory'],
['lake', 'Blooming Flowerhorn', 'Dusk Arowana'] ] ]
break;
case 'artaeum':
fish = [
[ ['blue'],
['foul', ''],
['river', ''],
['saltwater', 'Pearlescent Crayfish'],
['lake', ''] ],
[ ['green'],
['foul', ''],
['river', ''],
['saltwater', 'Abyssal Sea Pig', 'Weaving Octopus'],
['lake', ''] ] ]
break;
case 'murkmire':
fish = [
[ ['blue'],
['foul', 'Michinitl'],
['river', 'Hist Sap Shiner'],
['saltwater', 'Longlure Eelfin'],
['lake', 'Moist Scale Burrower'] ],
[ ['green'],
['foul', 'Ayotichin', 'Lined Sole'],
['river', 'Kuuyicet', 'Thick Scaled Mullet'],
['saltwater', 'Fat Sleeper', 'Spotted Seatrout'],
['lake', 'Bowfin', 'Redear Sunfish'] ] ]
break;
case 'northernelsweyr':
fish = [
[ ['blue'],
['river', 'Greater Senchefin'],
['river', 'Hircine\'s Pupfish'],
['river', 'Moon-Sugar Shrimp'],
['river', 'Northern Elsweyr Moon Tetra'] ],
[ ['green'],
['river', 'Cudgeon', 'Desert Sucker'],
['river', 'Freshwater Blenny', 'Galaxias'],
['river', 'Grayling', 'Reedfish'],
['river', 'Rimmen Bichir', 'Speckled Dace'] ] ]
break;
case 'southernelsweyr':
fish = [
[ ['blue'],
['foul', 'Radhin Zhab'],
['river', 'Roh-ri'],
['saltwater', 'Khaj\'Roh'],
['lake', ''] ],
[ ['green'],
['foul', 'Fif Cat', 'Pellitine Tilapia', 'Ruin Sucker'],
['river', 'Elsweyr River Perch', 'Fresh-Water Sardinella', 'Shaveskin Darter'],
['saltwater', 'Pellitine Horse Mackerel', 'Wedgefish', 'Zha\'ja Roh'],
['lake', ''] ] ]
break;
case 'blackreach-mzark':
fish = [
[ ['blue'],
['foul', ''],
['river', ''],
['saltwater', ''],
['lake', ''] ],
[ ['green'],
['foul', ''],
['river', ''],
['saltwater', ''],
['lake', ''] ] ]
break;
case 'westernskyrim':
fish = [
[ ['blue'],
['foul', ''],
['river', 'Blue Muskie'],
['saltwater', 'Birtingr'],
['lake', 'Lodsilungur'] ],
[ ['green'],
['foul', ''],
['river', 'Chillwind Pike', 'Morthal Longfin'],
['saltwater', 'Ghost Salmon', 'Skyrim Gurry Shark'],
['lake', 'Frigid Char', 'Solitude Loach'] ] ]
break;
case 'blackreach-greymoor':
fish = [
[ ['blue'],
['foul', 'Sanguine Lamprey'],
['river', 'Blue Muskie'],
['saltwater', ''],
['lake', 'Lodsilungur'] ],
[ ['green'],
['foul', 'Hypogean Tetra', 'Vandellia'],
['river', 'Chillwind Pike', 'Morthal Longfin'],
['saltwater', ''],
['lake', 'Frigid Char', 'Solitude Loach'] ] ]
break;
case 'thereach':
fish = [
[ ['blue'],
['foul', ''],
['river', 'Blackreach Pilgrim', 'Fretfish'],
['saltwater', ''],
['lake', 'Druadach Garpike'] ],
[ ['green'],
['foul', ''],
['river', 'Lost Valley Tench', 'Nchuand Cavetrout'],
['saltwater', ''],
['lake', 'Pinegilled Drum', 'Hagfin Vendace', 'Karth Crayfish'] ] ]
break;
case 'blackreach-arkthzand':
fish = [
[ ['blue'],
['foul', 'Briarthorn Goby'],
['river', 'Blackreach Pilgrim', 'Fretfish'],
['saltwater', ''],
['lake', ''] ],
[ ['green'],
['foul', 'Leechtooth Eel', 'Muckbelly Frogfish', 'Siltwallow Burrfish'],
['river', 'Lost Valley Tench', 'Nchuand Cavetrout'],
['saltwater', ''],
['lake', ''] ] ]
break;
case 'blackwood':
fish = [
[ ['blue'],
['foul', 'Stained Porgy'],
['river', 'Pantherfish'],
['saltwater', 'Opaline Albacore'],
['lake', 'Blackwater Bullhead'] ],
[ ['green'],
['foul', 'Inkspur Cuttlefish', 'Muddy Razorgill'],
['river', 'Ivory Darter', 'Onkobra Muskie'],
['saltwater', 'Harvester Octopus', 'Topal Nautilus'],
['lake', 'Red Zander', 'Speckled Sauger'] ] ]
break;
case 'deadlands':
fish = [
[ ['blue'],
['foul', 'Needlefish'],
['foul', 'Rustbelly Loach'],
['foul', 'Molten Nudibranch'],
['foul', 'Ogrim Goonch'] ],
[ ['green'],
['foul', 'Dusk Angler', 'Slag Eel'],
['foul', 'Corpus Hagfin', 'Deadlands Trout'],
['foul', 'Banegil', 'Vile Crayfish'],
['foul', 'Black-Eyed Croaker', 'Ebony Mudfish'] ] ]
break;
case 'deadlands-fargrave':
fish = [
[ ['blue'],
['foul', ''],
['river', ''],
['saltwater', ''],
['lake', ''] ],
[ ['green'],
['foul', ''],
['river', ''],
['saltwater', ''],
['lake', ''] ] ]
break;
case 'highisleandamenos':
fish = [
[ ['blue'],
['foul', 'Skulltooth Barbel'],
['river', 'Rockscale'],
['saltwater', 'Bluespotted Cornetfish'],
['lake', 'Rainbow Gudgeon'] ],
[ ['green'],
['foul', 'Ropefish', 'Systres Flounder'],
['river', 'Marbled Goby', 'Silver Bream'],
['saltwater', 'Daggerfish', 'Gonfalon Rockfish'],
['lake', 'Bronze-Banded Sunfish', 'Mudfin'] ] ]
break;
case 'galenandyffelon':
fish = [
[ ['blue'],
['foul', 'Galen Vent Spikefish'],
['river', ''],
['saltwater', 'Sea Robin'],
['lake', 'Firesong Bream'] ],
[ ['green'],
['foul', 'Abyssal Dragonfish', 'Obsidian Goby', 'Systres Skate'],
['river', ''],
['saltwater', 'Lizardfish', 'Pearlfish', 'Suncleft Cod'],
['lake', 'Glimmertarn Darter', 'Stone Circle Perch', 'Tidebarrow Tetra'] ] ]
break;
case 'telvannipeninsula':
fish = [
[ ['blue'],
['foul', ''],
['river', 'Sadrith Splat'],
['saltwater', 'Howling Shark'],
['lake', 'Morrowind Dreugh Shrimp'] ],
[ ['green'],
['foul', ''],
['river', 'Brown Hat Snail', 'Magma Salmon'],
['saltwater', 'Obdurate Albacore', 'Puffball Blowfish'],
['lake', 'Agarivore Shark', 'Deadlock Lobster'] ] ]
break;
case 'apocrypha':
fish = [
[ ['blue'],
['abyssal', 'Lurker Spawn'],
['river', ''],
['saltwater', ''],
['lake', ''] ],
[ ['green'],
['abyssal', 'Inkfish', 'Inkwell Squid'],
['river', ''],
['saltwater', ''],
['lake', ''] ] ]
break;
case 'westweald':
fish = [
[ ['blue'],
['foul', 'Bonytongue'],
['river', 'Larich Loach'],
['saltwater', ''],
['lake', 'Bitterfish'] ],
[ ['green'],
['foul', 'Skingrad Sculpin', 'Wildburn Blobfish', 'Dead Hopper Nymph'],
['river', 'Golden Sturgeon', 'Giant Strid Piranha', 'Marble Trout'],
['saltwater', ''],
['lake', 'Salasso Carp', 'Colovian Zander', 'False Hadolid'] ] ]
break;
default:
return false;
}
return fish;
}
/* generate info text with finshing hole sums
* and write it to the info-container
*/
function generateInfoText(zone) {
var locA = getLocation(zone)[0]; /* sanitize alliance */
var locZ = getLocation(zone)[1]; /* sanitize zone */
var x = document.getElementById('a-' + locZ);
var y = document.getElementById(locA);
var z = document.getElementById('info-container');
var fish = getRareFish(locZ);
var fishcaught = 15546; /* total number of fish caught */
var perfectroe = 159; /* total number of perfect roe from fish */
var txt = '';
var innerTxt = '';
var colClass = '';
var containerClass = '';
/* add zone as class to info container */
z.className = '';
z.classList.add('info-element');
z.classList.add(locZ);
/* add close button */
txt = txt + '<div class="close" onclick="toggleClassElements(\'info-element\');">X</div>';
/* generate info text with statistics */
txt = txt + '<p>All fishing holes in ' + y.getAttribute('data-name') + ': <b>' + countAllFishingHoles(locA) + '</b></p>';
if (locZ !== 'overlay-zone' && locZ !== 'tamriel-zone' && x !== null) {
txt = txt + '<p>All fishing holes in ' + x.innerHTML + ': <b>' + countAllFishingHoles(locZ) + '</b></p>';
}
txt = txt + '<p>Perfect Roe Rate: ' + perfectroe + '/' + fishcaught + ' (<b>' + Number(Math.round((perfectroe/fishcaught*100)+'e2')+'e-2') + '%</b>)</p>'
/* generate rare fish info */
if (fish) {
if (fish[1][1][2] && fish[1][2][2] && fish[1][3][2] && fish[1][4][2]) { /* we have 4 columns */
colClass = '-4';
containerClass = 'full';
} else if ((!fish[1][1][2] && !fish[1][2][2] && !fish[1][3][2]) || /* 1, 2, 3 - we only have 1 column */
(!fish[1][1][2] && !fish[1][2][2] && !fish[1][4][2]) || /* 1, 2, 4 */
(!fish[1][1][2] && !fish[1][3][2] && !fish[1][4][2]) || /* 1, 3, 4 */
(!fish[1][2][2] && !fish[1][3][2] && !fish[1][4][2])) { /* 2, 3, 4 */
colClass = '-1';
containerClass = 'dyn';
} else { /* we have more than 1 and less than 4 columns */
if ((!fish[1][1][2] && !fish[1][2][2]) || /* 1, 2 - we only have 2 columns */
(!fish[1][1][2] && !fish[1][3][2]) || /* 1, 3 */
(!fish[1][1][2] && !fish[1][4][2]) || /* 1, 4 */
(!fish[1][2][2] && !fish[1][3][2]) || /* 2, 3 */
(!fish[1][2][2] && !fish[1][4][2]) || /* 2, 4 */
(!fish[1][3][2] && !fish[1][4][2])) { /* 3, 4 */
colClass = '-2';
containerClass = 'dyn';
} else { /* leaves us with 3 columns in the end */
colClass = '-3';
containerClass = 'full';
}
}
txt = txt + '<div id="rare-fish-container"><div class="rare-fish ' + containerClass + '">'; /* table container */
for (i = 1; i < fish[0].length; i++) { /* i ... number of columns: 4, 3, 1 */
if (fish[0][i][1]) {
innerTxt = innerTxt + '<div class="col col' + colClass + '"><div class="cell head ' + fish[0][i][0] + '"><div class="inner">' + fish[0][i][0] + '</div></div>';
for (var j = 0; j < fish.length; j++) { /* j ... fish raritiy: green, blue, purple */
if (fish[j]) {
for (var k = 1; k < fish[j][i].length; k++) { /* k ... rare fish name */
if (fish[j][i][k]) {
innerTxt = innerTxt + '<div class="cell fish ' + fish[j][0][0] + '"><div class="inner">' + fish[j][i][k] + '</div></div>';
}
}
}
}
innerTxt = innerTxt + '</div>';
}
}
if (innerTxt) {
txt = txt + innerTxt;
} else {
txt = txt + '<em>No rare fish here :-(</em>';
}
txt = txt + '</div></div>';
}
/* replace info-container content */
document.getElementById('info-container').innerHTML = txt;
}
/* Generate HTML meta info data
*/
function generateMetaTitle(zone) {
var locZ = getLocation(zone)[1]; /* sanitize zone */
var metaTitle = 'Captain Trout\'s Interactive Fishing Map' /* meta title base string */
/* append zone name to meta title */
if (locZ !== '' && locZ) {
var retval = metaTitle + ' - ' + getZoneName(locZ);
} else {
var retval = metaTitle;
}
return retval;
}
/* Toggle zone map active - only one is active at a time
*/
function toggleZone(zone) {
var locZ = getLocation(zone)[1]; /* sanitize zone */
var numFoulHoles = 0;
var numRiverHoles = 0;
var numLakeHoles = 0;
var numSaltwaterHoles = 0;
if (locZ !== 'tamriel-zone') { /* show everything in tamriel-zone */
hideClassElements('zoco'); /* hide all zone containers */
toggleIdElement(locZ); /* now show one specific zone container by id */
hideClassElements('fishing-map-image'); /* hide all fishing maps */
toggleIdElement('img-' + locZ); /* now show one specific fishing map by id */
unsetClassActive('zone-button'); /* unset all zone-buttons */
toggleIdActive('tb-' + locZ); /* now set one specific zone-button active by id */
}
/* recount holes on zone change */
numFoulHoles = countFishingHoles(locZ, foulOrOilyOrAbyssal(locZ));
numRiverHoles = countFishingHoles(locZ, 'river');
numLakeHoles = countFishingHoles(locZ, 'lake');
numSaltwaterHoles = countFishingHoles(locZ, 'saltwater');
/* highlight rare fishing holes (rare means less than a certain percentage) */
if (numFoulHoles/countAllFishingHoles(locZ)*100 < 5.5) { /* less than 5.5% of all zone fishoing holes? */
var foulHoles = document.getElementById(locZ).getElementsByClassName(foulOrOilyOrAbyssal(locZ) + ' fh');
for (var i = 0; i < foulHoles.length; i++) {
foulHoles[i].classList.add('rare');
}
}
if (numRiverHoles/countAllFishingHoles(locZ)*100 < 5.5) { /* less than 5.5% of all zone fishoing holes? */
var riverHoles = document.getElementById(locZ).getElementsByClassName('river fh');
for (var i = 0; i < riverHoles.length; i++) {
riverHoles[i].classList.add('rare');
}
}
if (numLakeHoles/countAllFishingHoles(locZ)*100 < 5.5) { /* less than 5.5% of all zone fishoing holes? */
var lakeHoles = document.getElementById(locZ).getElementsByClassName('lake fh');