-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGuildRaidSnapShot.lua
More file actions
2896 lines (2584 loc) · 90.6 KB
/
GuildRaidSnapShot.lua
File metadata and controls
2896 lines (2584 loc) · 90.6 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
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
-- GuildRaidSnapShot Mod
-- Copyright (c) 2005-2014 Sigma Star Systems
-- Released under the MIT License. See LICENSE.txt for full license
GuildRaidSnapShot_SnapShots = {};
GuildRaidSnapShot_Loot = {};
GuildRaidSnapShot_Notes = {};
GuildRaidSnapShot_Adj = {};
GRSS_Calendar = {};
GRSS_Alts = {};
GRSS_MainOnly = {};
GRSS_Divide = {};
GRSS_Systems = {};
GRSS_Full_DKP = {};
GRSS_Bosses_Old = {"Lucifron","Magmadar","Gehennas","Garr","Baron Geddon","Shazzrah","Sulfuron Harbinger","Golemagg the Incinerator","Ragnaros","Doom Lord Kazzak","Azuregos","Lethon","Emeriss","Onyxia","Taerar","Ysondre","Razorgore the Untamed","Vaelastrasz the Corrupt","Flamegor","Ebonroc","Firemaw","Chromaggus","Broodlord Lashlayer","Nefarian","Prophet Skeram","Lord Kri","Battleguard Sartura","Princess Huhuran","Fankriss the Unyielding","Viscidus","Ouro","C'Thun","Emperor Vek'nilash","Emperor Vek'lor","Anub'Rekhan","Grand Widow Faerlina","Maexxna","Feugen","Gluth","Gothik the Harvester","Grobbulus","Heigan the Unclean","Highlord Mograine","Instructor Razuvious","Lady Blaumeux","Loatheb","Noth the Plaguebringer","Patchwerk","Sapphiron","Sir Zeliek","Stalagg","Thaddius","Thane Korth'azz","Ossirian the Unscarred","Moam","Kurinnaxx","General Rajaxx","Buru the Gorger","Ayamiss the Hunter","Bloodlord Mandokir","Gahz'ranka","Gri'lek","Hakkar","Hazza'rah","High Priest Thekal","High Priest Venoxis","High Priestess Arlokk","High Priestess Jeklik","High Priestess Mar'li","Jin'do the Hexxer","Renataki","Wushoolay","The Crone","Hyakiss the Lurker","Julianne","Maiden of Virtue","Moroes","Netherspite","Nightbane","Prince Malchezaar","Rokad the Ravager","Romulo","Shade of Aran","Shadikith the Glider","Terestian Illhoof","The Big Bad Wolf","The Curator","Gruul the Dragonkiller","Magtheridon","High King Maulgar","Fathom-Lord Karathress","Hydross the Unstable","Lady Vashj","Leotheras the Blind","Morogrim Tidewalker","The Lurker Below","Al'ar","High Astromancer Solarian","Kael'thas Sunstrider","Void Reaver","Doomwalker","Attumen the Huntsman","Illidan Stormrage","Gathios the Shatterer","High Nethermancer Zerevor","Lady Malande","Veras Darkshadow","Essence of Anger","Gurtogg Bloodboil","Illidari Council","Teron Gorefiend","High Warlord Naj'entus","Mother Shahraz","Shade of Akama","Supremus","Anetheron","Archimonde","Azgalor","Kaz'rogal","Rage Winterchill","Nalorakk","Akil'zon","Jan'alai","Halazzi","Hex Lord Malacrass","Zul'jin","Kalecgos","Sathrovarr the Corruptor","Brutallus","Felmyst","Lady Sacrolash","Grand Warlock Alythess","M'uru","Entropius","Kil'jaeden","Kel'Thuzad","Sartharion","Archavon the Stone Watcher","Malygos","Flame Leviathan","Razorscale","XT-002 Deconstructor","Ignis the Furnace Master","Assembly of Iron","Kologarn","Auriaya","Mimiron","Hodir","Thorim","Freva","General Vezax","Yogg-Saron","Algalon the Observer","Emalon the Storm Watcher","Icehowl","Lord Jaraxxus","Fjola Lightbane","Anub'arak","Koralon the Flame Watcher","Lord Marrowgar","Lady Deathwhisper","Deathbringer Saurfang","Festergut","Rotface","Professor Putricide","Blood-Queen Lana'thal","Valithria Dreamwalker","Sindragosa","The Lich King","Prince Keleseth",
-- Cata Bosses
"Argaloth","Halfus Wyrmbreaker","Theralion","Cho'gall","Magmaw","Omnitron Defense System","Maloriak","Atramedes","Chimaeron","Nefarian","Al'Akir","Sinestra","Shannox","Lord Rhyolith","Beth'tilac","Alysrazor","Baelroc","Majordomo Staghelm","Ragnaros","Volcanus","Morchok","Warlord Zon'ozz","Yor'sahj the Unsleeping","Hagara the Stormbinder","Ultraxion","Warmaster Blackhorn","Deathwing",
-- MOP Bosses
"Imperial Vizier Zor'lok","Blade Lord Ta'yak","Garalon","Wind Lord Mel'jarak","Amber-Shaper Un-sok","Grand Empress Shek'zeer",
"Jade Guardian","Feng the Accursed","Gara'jal the Spiritbinder","The Spirit Kings","Elegon","Jan-xi",
"Sha of Anger","Salyis's Warband",
"Tsulong","Lei Shi","Sha of Fear",
"Jin'rokh the Breaker","Horridon","Tortos","Megaera","Ji-Kun","Durumu the Forgotten","Primordius","Dark Animus","Iron Qon","Twin Consorts","Lei Shen","Ra-den",
"Immerseus","The Fallen Protectors","Amalgam of Corruption","Sha of Pride","Galakras","Iron Juggernaut","Earthbreaker Haromm","General Nazgrim","Malkorok","Thok the Bloodthirsty","Siegecrafter Blackfuse","Garrosh Hellscream",
};
GRSS_Bosses = {
-- WOD Bosses
"Kargath Bladefist", "The Butcher", "Brackenspore", "Tectus", "Pol", "Ko'ragh", "Imperator Mar'gok",
"Gruul","Oregorger", "Blast Furnace", "Hans'gar", "Flamebender Ka'graz", "Kromog", "Beastlord Darmac","Operator Thogar","Admiral Gar'an","Blackhand",
"Siegemaster Mar'tak", "Kormrok","Killrogg Deadeye","Gurtogg Bloodboil","Gorefiend","Shadow-Lord Iskar","Socrethar the Eternal","Tyrant Velhari","Fel Lord Zakuun","Xhul'horac","Mannoroth","Archimonde",
--[[ (TESTING) uncomment for testing the mobs outside shattrath and orgrimmar
"Dreadfang Lurker","Timber Worg","Ironspine Petrifier","Talrendis Scout","Weakened Mosshoof Stag"
--]]
};
GRSS_FastBossLookup = {}; --This gets initialized with the mod
GRSS_Ignore = {"Onyxian","Onyxia's Elite Guard","Maexxna Spiderling","Patchwerk Golem","Hakkari","Son of Hakkar"," slain by ","Nightbane .+",".+the Crone","Netherspite Infernal","Ember of Al'ar","Sartharion Twilight Whelp","Sartharion Twilight Egg"};
GRSS_Yells = {};
GRSS_LootIgnore = {"Hakkari Bijou","Alabaster Idol","Amber Idol","Azure Idol","Jasper Idol","Lambent Idol","Obsidian Idol","Onyx Idol","Vermillion Idol","Lava Core","Fiery Core","Large .+ Shard","Small .+ Shard","Nexus Crystal","Wartorn .+ Scrap","Badge of Justice","Cosmic Infuser","^Devastation$","Infinity Blade","Phaseshift Bulwark","Warp Slicer","Staff of Disintegration","Netherstrand Longbow","Nether Spike","Bundle of Nether Spikes","Emblem of Heroism","Emblem of Valor","Abyss Crystal","Emblem of Conquest","Emblem of Triumph","Emblem of Frost","Maelstrom Crystal"};
-- GRSS_Yells = Bosses that when they die trigger a snapshot
GRSS_Yells["Majordomo Executus"] = "Impossible!.+I submit!";
GRSS_Yells["Attumen the Huntsman"] = "Always knew.+the hunted";
GRSS_Yells["Freya"] = "His hold on me dissipates";
GRSS_Yells["Thorim"] = "Stay your arms!";
GRSS_Yells["Hodir"] = "I am released from his grasp";
GRSS_Yells["Mimiron"] = "I allowed my mind to be corrupted";
GRSS_Yells["Garrosh Hellscream"] = "That was just a taste of what the future brings. FOR THE HORDE!";
GRSS_Yells["King Varian Wrynn"] = "GLORY TO THE ALLIANCE!";
GRSS_Yells["High Overlord Saurfang"] = "The Alliance falter. Onward to the Lich King!";
GRSS_Yells["Muradin Bronzebeard"] = "Don't say I didn't warn ya, scoundrels! Onward, brothers and sisters!";
GRSS_Yells["Valithria Dreamwalker"] = "I am renewed!.+to rest!";
GRSS_Yells["Elementium Monstrosity"] = "IMPOSSIBLE";
GRSS_Yells["Omnitron"] = "Defense systems obliterated. Powering down.";
GRSS_Yells["Al'Akir"] = "The Conclave of Wind has dissipated.+";
GRSS_Yells["Lorewalker Cho"] = "A secret passage has opened beneath the platform, this way!";
GRSS_Yells["Elder Asani"] = "The Sha...must be...stopped.";
--GRSS_Yells["Chops"] = "this is a test";
-- GRSS_Yell_Redirects = Bosses that if they yell something from above, the snapshot gets recorded not as the name of the mob, but as the assignment
-- For example, in Garrosh Hellscream yells "That was just a test of what the future brings. FOR THE HORDE", the snapshot will be recorded as "Faction Champions"
GRSS_Yell_Redirect = {};
GRSS_Yell_Redirect["Garrosh Hellscream"] = "Faction Champions";
GRSS_Yell_Redirect["King Varian Wrynn"] = "Faction Champions";
GRSS_Yell_Redirect["High Overlord Saurfang"] = "Gunship Battle";
GRSS_Yell_Redirect["Muradin Bronzebeard"] = "Gunship Battle";
GRSS_Yell_Redirect["Elementium Monstrosity"] = "Twilight Ascendants";
GRSS_Yell_Redirect["Omnitron"] = "Omnitron Defense System";
GRSS_Yell_Redirect["Al'Akir"] = "Conclave of Wind";
GRSS_Yell_Redirect["Lorewalker Cho"] = "The Spirit Kings";
GRSS_Yell_Redirect["Elder Asani"] = "Protectors of the Endless";
--GRSS_Yell_Redirect["Chops"] = "Faction Champions Test";
-- GRSS_BossRedirects = When a specific boss dies, the snapshot is recorded as something else
-- In this case, if "Jade Guardian" dies, the snapshot is recorded as "The Stone Guard"
-- This is useful for bosses that are linked together and share health.
GRSS_Boss_Redirect = {};
GRSS_Boss_Redirect["Jade Guardian"] = "The Stone Guard";
GRSS_Boss_Redirect["Jan-xi"] = "Will of the Emperor";
GRSS_Boss_Redirect["Amalgam of Corruption"] = "Norushen";
GRSS_Boss_Redirect["Earthbreaker Haromm"] = "Kor'kron Dark Shaman";
GRSS_Boss_Redirect["Gurtogg Bloodboil"] = "Hellfire High Council";
GRSS_Boss_Redirect["Siegemaster Mar'tak"] = "Hellfire Assault";
GRSS_Boss_Redirect["Pol"] = "Twin Ogron";
GRSS_Boss_Redirect["Admiral Gar'an"] = "Iron Maidens";
--GRSS_Boss_Redirect["Weakened Mosshoof Stag"] = "Test Redirect";
-- GRSS_BossEmote = events that aren't yells or anything, but something represent "world emotes"
-- For the "Chess" event example from Burning Crusade's Karazhan, when the Chess events ends, there
-- is a world-emote like "The doors of the Gamesman's Hall shake...". This is how it triggers when the event happens
GRSS_BossEmote = {};
GRSS_BossEmote["Chess"] = "doors of the Gamesman's Hall";
-- GRSS_ZoneIgnore is probably no longer necessary, since GRSS already checks if you're in a PVP (Arena or Battleground)
GRSS_ZoneIgnore = {"Arathi Basin","Alterac Valley","Eye of the Storm","Warsong Gulch"};
GRSS_Auto = 1;
GRSS_LootCap = 1;
GRSS_Bidding = 0;
GRSS_Rolling = 0;
GRSS_BidRolls = nil;
GRSS_HighBid = 0;
GRSS_HighBidder = "";
GRSS_CurrentSort = "total";
GRSS_BidStyle = "Silent Auction";
GRSS_CurrentItem = "";
GRSS_ItemHistory = {};
GRSS_TakeScreenshots = 0;
GRSS_CurrentLootDate = "";
GRSS_CurrentLootIndex = 0;
GRSS_LastCommand = {};
GRSS_ItemPrices = {};
GRSS_RaidFilter = "All";
GRSS_ClassFilter = "All";
GRSS_ItemQueue = {};
GRSS_ItemBoxOpen = 0;
GRSS_Old_Bosses_On = false;
GRSS_WipeCauser = "Unknown";
GRSS_LastWipeTime = 0;
GRSS_LastSnapshot = 0;
GRSSNewVersionPrinted = nil;
GRSS_PopupPoints = 0;
GRSS_PopupLootDate = "";
GRSS_PopupLootIndex = "";
GRSS_WaitListRequest = {}; --This is functioning as a Queue of WaitingList requests
GRSS_WaitListRequestBoxOpen = 0;
GRSS_NumberedSystems = {};
GRSS_Loot = {};
GRSS_WaitingList = {};
GRSS_RaidSignups = {};
GRSS_InviteType = "Waiting List";
GRSS_RollNumber = 1000;
GRSS_RaidPointsPopup = 1;
GRSS_AutoWipe = 1;
GRSS_PendingSnapShotName = ""
GRSS_CurrentCalendarIndex = 1;
GRSS_LootPromptInCombat = 0;
GRSS_LastSnapShotName = "";
GRSS_Redistribute_SnapShot = "";
GRSS_Redistribute_SnapShot_ExpireTime = 0;
GRSS_DoingParty = 1;
GRSS_NextTime = nil;
GRSS_Period = 60;
GRSS_ReadyForTimer = false;
GRSS_Prefix = "GRSS: ";
GRSS_Guild = {};
GRSS_DKP = {};
GRSS_Bids = {};
GRSSCurrentSystem = "";
GRSSCurrentAction = "DKP Standings";
GRSSHelpMsg = {
"!help = This help menu",
"!dkp = Your current DKP",
"!dkp name [name2 name3...] = the DKP for the player 'name' (and name2 and name3) (i.e. !dkp Joe Fred)",
"!items = Your item history",
"!items name = Item history for player 'name' (i.e. !items Joe)",
"!bid X = Bid X points on the current item",
"!request = Put in a request for the item",
"!dkpclass class [class2 class3...] = the current standings for the 'class' (and 'class2' and 'class3') (i.e. !dkpclass mage warlock)",
"!dkpraid X = the current standings for DKP System X for current raid members (to get the list of appropriate Systems, just type !dkpraid)",
"!dkpall X = the current standings for DKP System X (to get the list of appropriate Systems, just type !dkpall)",
"!price itemname = the price of the item 'itemname' (parts of names work too, i.e. '!price felheart' will retrieve the prices of all items with 'felheart' in the name)",
"!waitlist = Add me to the Waiting List",
"!waitlistwho = Show a list of who's on the waiting list",
};
local GRSSVersion = "2.033";
local GRSSUsage = {
"Type |c00ffff00/grss <snapshotname>|r to take a snapshot (ex: |c00ffff00/grss Kel'Thuzad|r)",
"|c00ffff00/grss loot|r to open a loot prompt to manually record an item being received",
"|c00ffff00/grss adj|r to record an adjustment",
"|c00ffff00/grss reset|r to delete all your snapshots",
"|c00ffff00/grss show|r to bring up the DKP standings/bidding/rolling screen",
"|c00ffff00/grss invite|r to bring up the Waiting List/Auto-Invite screen",
"|c00ffff00/grss starttimer|r start Periodic Snapshots",
"|c00ffff00/grss stoptimer|r to disable Periodic Snapshots",
"|c00ffff00/grss noauto|r to disable auto-snapshot",
"|c00ffff00/grss yesauto|r to enable auto-snapshot",
"|c00ffff00/grss nosnapshotpopup|r to disable snapshot points popup asking how many points a snapshot is worth",
"|c00ffff00/grss yessnapshotpopup|r to enable snapshots points popup asking how many points a snapshot is worth",
"|c00ffff00/grss yesscreenshot|r to make snapshots also take a screenshot",
"|c00ffff00/grss noscreenshot|r to make snapshots NOT take a screenshot",
"|c00ffff00/grss yesloot|r to make Loot received (Blue and better) prompt for points spent",
"|c00ffff00/grss noloot|r to disable the loot prompt when items are received",
"|c00ffff00/grss yeswipe|r to enable the snapshot prompt when a wipe occurs",
"|c00ffff00/grss nowipe|r to disable the snapshot prompt when a wipe occurs",
"|c00ffff00/grss yeslootcombat|r allows the loot prompt to pop up in combat",
"|c00ffff00/grss nolootcombat|r forces the loot prompt to wait until out of combat (recommended unless you're having problems)",
"|c00ffff00/grss yesold|r enables old bosses to trigger a snapshot",
"|c00ffff00/grss noold|r disables old bosses triggering a snapshot",
"==========================================",
"Members can also send you tells like the following for information (you can even send yourself a tell for this info, too)",
};
local GRSS_Colors={
--[[
["ff9d9d9d"] = "grey",
["ffffffff"] = "white",
["ff00ff00"] = "green",
["ff0070dd"] = "rare",--]]
["ffa335ee"] = "epic",
["ffff8000"] = "legendary"
};
local GRSS_ChatFrame_OnEvent_Original = nil;
function GRSS_IsWhisperGRSSWhisper(e,t,w)
if string.find(w,"^!dkp") or string.find(w,"^!items") or string.find(w,"^!info") or string.find(w,"^!commands") or string.find(w,"^!price") or string.find(w,"^!waitlist") then
return true;
else
return false;
end
end
function GRSS_IsOutgoingWhisperGRSSWhisper(e,t,w)
if string.find(w,"^"..GRSS_Prefix) then
return true;
else
return false;
end
end
function GRSS_SetItemRef(link,text,button)
if GRSSCurrentAction ~= "DKP Standings" and GRSS_Bidding~=1 and GRSS_Rolling~=1 then
GRSSItemName:SetText(text);
end
end
function GRSS_EnableOldBosses()
GRSS_Old_Bosses_On = true;
GRSS_FastBossLookup = {};
for i,v in pairs(GRSS_Bosses) do
GRSS_FastBossLookup[v] = v;
end
for i,v in pairs(GRSS_Bosses_Old) do
GRSS_FastBossLookup[v] = v;
end
end
function GRSS_DisableOldBosses()
GRSS_Old_Bosses_On = false;
GRSS_FastBossLookup = {};
for i,v in pairs(GRSS_Bosses) do
GRSS_FastBossLookup[v] = v;
end
end
-- ******************************************************************
-- ************************** ENTRY POINT ***************************
-- ******************************************************************
function GuildRaidSnapShot_OnLoad(this)
SlashCmdList["GuildRaidSnapShot"] = GuildRaidSnapShot_SlashHandler;
SLASH_GuildRaidSnapShot1 = "/grss";
SLASH_GuildRaidSnapShot1 = "/GRSS";
if GRSS_Old_Bosses_On == true then
GRSS_EnableOldBosses();
else
GRSS_DisableOldBosses();
end
this:RegisterEvent("PLAYER_REGEN_ENABLED");
this:RegisterEvent("PLAYER_REGEN_DISABLED");
this:RegisterEvent("PLAYER_DEAD");
this:RegisterEvent("CHAT_MSG_COMBAT_FRIENDLY_DEATH");
this:RegisterEvent("CHAT_MSG_COMBAT_HOSTILE_DEATH");
this:RegisterEvent("PLAYER_TARGET_CHANGED");
this:RegisterEvent("CHAT_MSG_LOOT");
this:RegisterEvent("CHAT_MSG_MONSTER_YELL");
--this:RegisterEvent("CHAT_MSG_YELL");
this:RegisterEvent("CHAT_MSG_RAID_BOSS_EMOTE");
this:RegisterEvent("PLAYER_GUILD_UPDATE");
this:RegisterEvent("GUILD_ROSTER_UPDATE");
this:RegisterEvent("CHAT_MSG_WHISPER");
this:RegisterEvent("CHAT_MSG_SYSTEM");
this:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED");
this:RegisterEvent("LOOT_OPENED");
this:RegisterEvent("RAID_ROSTER_UPDATE");
this:RegisterEvent("VARIABLES_LOADED");
this:RegisterEvent("CALENDAR_OPEN_EVENT");
this:RegisterEvent("CALENDAR_UPDATE_EVENT");
this:RegisterEvent("CALENDAR_UPDATE_EVENT_LIST");
this:RegisterEvent("CALENDAR_NEW_EVENT");
--
--
this:RegisterEvent("ADDON_LOADED");
DEFAULT_CHAT_FRAME:AddMessage("GuildRaidSnapShot (By DKPSystem.com) Version "..GRSSVersion.." loaded. ");
DEFAULT_CHAT_FRAME:AddMessage("Type |c00ffff00/grss|r to get a list of options for GuildRaidSnapShot");
ChatFrame_AddMessageEventFilter("CHAT_MSG_WHISPER",GRSS_IsWhisperGRSSWhisper); -- incoming whispers
ChatFrame_AddMessageEventFilter("CHAT_MSG_WHISPER_INFORM",GRSS_IsOutgoingWhisperGRSSWhisper); --outgoing whispers
hooksecurefunc("SetItemRef",GRSS_SetItemRef);
StaticPopupDialogs["GRSS_ITEMPOINTS"] = {
text = "How many points did |c00ffff00%s|r spend on %s",
button1 = "OK",
button2 = "Cancel",
OnAccept = function(self)
points = self.editBox:GetText()
GRSSRecordItemPointsOnly(points);
end,
OnShow = function(self)
GRSS_ItemBoxOpen = 1;
self.editBox:SetText(GRSS_PopupPoints);
end,
OnHide = function(self)
if table.getn(GRSS_ItemQueue) > 0 then
GRSS_NextItemPopup();
else
GRSS_ItemBoxOpen = 0;
end
end,
timeout = 0,
whileDead = 1,
hideOnEscape = 1,
hasEditBox = 1,
enterClicksFirstButton = 1,
};
StaticPopupDialogs["GRSS_RAIDPOINTS"] = {
text = "How many points should be awarded for the attendees in the snapshot called |c00ffff00%s|r?. Enter |c00ff0000zs|r if you want to award points based on the following loot (items awarded for the next 10 minutes)",
button1 = "OK",
button2 = "Cancel",
OnAccept = function(self)
points = self.editBox:GetText()
GRSSSetSnapshotPoints(points);
end,
OnShow = function(self)
GRSS_SnapshotBoxOpen = 1;
self.editBox:SetText(GRSS_LastSnapShotPoints);
end,
OnHide = function(self)
end,
timeout = 0,
whileDead = 1,
hideOnEscape = 1,
hasEditBox = 1,
enterClicksFirstButton = 1,
};
StaticPopupDialogs["GRSS_WAITINGLIST"] = {
text = "Name of person(s) to add to waiting list? If adding more than one, seperate by a space",
button1 = "OK",
button2 = "Cancel",
OnAccept = function(self)
name = self.editBox:GetText();
GRSS_AddNameToWaitingList(name);
end,
OnShow = function(self)
self.editBox:SetText("")
end,
timeout = 0,
whileDead = 1,
hideOnEscape = 1,
hasEditBox = 1,
enterClicksFirstButton = 1,
};
StaticPopupDialogs["GRSS_RAIDCHECK"] = {
text = "There are %s recorded right now. Would you like to keep this data (and apply any expenditures to the current standings) or would you like to purge all the data. You should ONLY purge if you've already uploaded your snapshots.",
button1 = "Purge",
button2 = "Keep",
OnAccept = function(self)
GuildRaidSnapShot_SnapShots = {};
GuildRaidSnapShot_Loot = {};
GuildRaidSnapShot_Adj = {};
GRSSPrint("Snapshots Purged");
end,
OnCancel = function(self)
GRSS_RecalcSpentLoot();
end,
timeout = 0,
whileDead = 1,
};
StaticPopupDialogs["GRSS_TIMERCHECK"] = {
text = "The timer is currently running to take snapshots. The next snapshot is set to be taken in |c00ffff00%s minutes|r. Continue the periodic snapshots, or Stop the Timer?",
button1 = "Continue",
button2 = "Stop Timer",
OnAccept = function(self)
GRSS_ReadyForTimer = true;
local mins = GRSS_NextTime - GetTime();
if mins > 0 then
mins = math.floor(mins / 60);
GRSSPrint("The next snapshot wlll be in "..mins.." minutes");
end
end,
OnCancel = function(self)
GRSS_NextTime = nil;
GRSS_ReadyForTimer = true;
GRSSPrint("Snapshot Timer Stopped");
end,
timeout = 0
};
StaticPopupDialogs["GRSS_STARTTIMER"] = {
text = "How many minutes between snapshots?",
button1 = "OK",
button2 = "Cancel",
OnAccept = function(self)
mins = self.editBox:GetText();
if tonumber(mins) == nil then
GRSSPrint(mins.." isn't exactly a number, is it?");
else
GRSS_StartTimer(mins);
end
end,
OnShow = function(self)
self.editBox:SetText(GRSS_Period);
end,
timeout = 0,
whileDead = 1,
hideOnEscape = 1,
hasEditBox = 1,
enterClicksFirstButton = 1,
};
StaticPopupDialogs["GRSS_WIPE"] = {
text = "Was this a wipe? If so, and if you want to take a snapshot, enter the name of the snapshot and click 'Record Wipe', otherwise, click Cancel",
button1 = "Record Wipe",
button2 = "Cancel",
OnAccept = function(self)
name = self.editBox:GetText()
GRSS_TakeSnapShot(name);
end,
OnShow = function(self)
self.editBox:SetText("Wipe on "..GRSS_WipeCauser);
end,
timeout = 0,
whileDead = 1,
hideOnEscape = 1,
hasEditBox = 1,
enterClicksFirstButton = 1,
};
StaticPopupDialogs["GRSS_AUTOWAITLIST"] = {
text = "|c00ffff00%s|r is requesting to be added to the Wait List. Accept or Deny?",
button1 = "Accept",
button2 = "Deny",
OnAccept = function(self)
local last = table.getn(GRSS_WaitListRequest);
local name = GRSS_WaitListRequest[last];
GRSS_AddNameToWaitingList(name);
GRSS_SendWhisper("You've been added to the waiting list","WHISPER",nil,name);
end,
OnCancel = function(self)
local last = table.getn(GRSS_WaitListRequest);
local name = GRSS_WaitListRequest[last];
GRSS_SendWhisper("Your request to be added to the waiting list has been denied","WHISPER",nil,name);
end,
OnHide = function(self)
table.remove(GRSS_WaitListRequest);
if table.getn(GRSS_WaitListRequest) > 0 then
GRSS_NextWaitListRequest();
else
GRSS_WaitListRequestBoxOpen = 0;
end
end,
onShow = function(self)
GRSS_WaitListRequestBoxOpen = 1;
end,
timeout = 0,
whileDead = 1,
};
end
function GRSS_GetCalendar()
local curmonth,curyear;
_,curmonth,_,curyear = CalendarGetDate();
if(GRSS_Calendar == nil) then
GRSS_Calendar = {};
end
local keepers = {}
for m = -1,1 do
for d=1,31 do
local numevents = CalendarGetNumDayEvents(0,d);
--GRSSPrint("Num Events:"..numevents);
if numevents > 0 then
for e=1,numevents do
local title, hour, minute, caltype,_,eventtype = CalendarGetDayEvent(m,d,e);
if eventtype > 0 then
if caltype=="GUILD" or caltype=="GUILD_EVENT" or caltype=="PLAYER" then
month = curmonth + m;
year = curyear;
if(month < 0) then
year = year - 1;
month = 12;
elseif(month > 12) then
year = year + 1;
month = 1;
end
local found = GRSS_FindEvent(title,year,month,d,hour,minute);
if found == nil then
local event = {
title = title,
monthoffset = m,
month = month,
year = year,
day = d,
eventindex = e,
hour = hour,
minute = minute,
eventtype = eventtype
}
table.insert(GRSS_Calendar,event);
found = table.getn(GRSS_Calendar);
end
keepers[found] = found;
end
end
end
end
end
end
for i,v in pairs(GRSS_Calendar) do
if keepers[i]==nil then
GRSS_Calendar[i] = nil;
end
end
end
function GRSS_FindEvent(title,year,month,day,hour,minute)
for i,e in pairs(GRSS_Calendar) do
if(e.title == title and e.month==month and e.day==day and e.hour==hour and e.minute==minute and e.year==year) then
return i;
end
end
return nil;
end
function GRSS_StoreEventDetails()
local title, desc, creator,eventtype,_,maxsize,_,_,month,day,year,hour,minute = CalendarGetEventInfo();
local i = GRSS_FindEvent(title,year,month,day,hour,minute);
if i ~= nil then
GRSS_Calendar[i].description = desc;
GRSS_Calendar[i].creator = creator;
GRSS_Calendar[i].maxsize = maxsize;
local numinvites = CalendarEventGetNumInvites();
local invites = {}
for ii = 1,numinvites do
local name,level,className,_,inviteStatus,modStatus = CalendarEventGetInvite(ii);
local _,s_month, s_day, s_year, s_hour, s_minute = CalendarEventGetInviteResponseTime(ii);
local signuptime;
if s_year==0 then
signuptime = month.."/"..day.."/"..year.." "..hour..":"..minute;
else
signuptime = s_month.."/"..s_day.."/"..s_year.." "..s_hour..":"..s_minute;
end
local inv = {
name = name,
level = level,
class = className,
status = inviteStatus,
signuptime = signuptime,
};
table.insert(invites,inv);
end
GRSS_Calendar[i].invites = invites;
end
end
function GRSS_StartTimer(mins)
GRSS_Period = mins;
GRSS_NextTime = GetTime() + (GRSS_Period*60);
GRSS_TakeSnapShot("Periodic Snapshot");
GRSSPrint("Periodic Snapshots Started. Next Snapshot will be in "..mins.." minutes");
end
function GRSS_StopTimer()
GRSS_Period = nil;
GRSS_NextTime = nil;
GRSSPrint("Periodic Snapshots Halted");
end
function GRSS_Timer_OnUpdate()
if GRSS_ReadyForTimer and GRSS_Period and GRSS_NextTime then
local now = GetTime();
if now > GRSS_NextTime then
GRSS_TakeSnapShot("Periodic Snapshot");
GRSSPrint("Next snapshot will be in "..GRSS_Period.." minutes");
GRSS_NextTime = GetTime() + (GRSS_Period*60);
--GRSS_TimerNotify = {};
end
end
--GRSSPrint("update");
if type(GRSS_GeneralTimer)=="function" then
local now = GetTime();
if now > GRSS_GeneralTimeout then
GRSSPrint("Timeout");
GRSS_GeneralTimer();
GRSS_GeneralTimer = nil;
GRSS_GeneralTimeout = nil;
end
end
end
function GRSS_StartGeneralTimer(seconds,fun)
GRSS_GeneralTimer = fun;
GRSS_GeneralTimeout = GetTime() + seconds;
end
function GRSS_NextItemPopup()
if table.getn(GRSS_ItemQueue) > 0 then
local i = table.getn(GRSS_ItemQueue);
local item, name, points;
GRSS_PopupLootDate = GRSS_ItemQueue[i].date;
GRSS_PopupLootIndex = GRSS_ItemQueue[i].index;
item = GRSS_ItemQueue[i].item;
name = GRSS_ItemQueue[i].name;
GRSS_PopupPoints = GRSS_ItemQueue[i].points;
table.remove(GRSS_ItemQueue,i);
StaticPopup_Show("GRSS_ITEMPOINTS",name,item);
end
end
function GRSS_EnqueueItem(date,index,name,item,points)
local temp = {};
temp.date = date;
temp.index = index;
temp.name = name;
temp.item = item;
temp.points = points;
table.insert(GRSS_ItemQueue,1,temp);
end
function GRSSLootSave()
local system = UIDropDownMenu_GetText(GRSSLootSystemDropDown);
local player = GRSSLootPlayer:GetText();
local points = GRSSLootPoints:GetText();
local item = GRSSLootItem:GetText();
GRSSLootClear();
GRSSRecordItem(system,player,item,points);
end
function GRSSRecordItemPointsOnly(points)
local lootrec = GuildRaidSnapShot_Loot[GRSS_PopupLootDate][GRSS_PopupLootIndex];
local playername = lootrec.player;
local sys = lootrec.system;
local hardpoints = GRSSPlayerPointCost(playername,sys,points);
GuildRaidSnapShot_Loot[GRSS_PopupLootDate][GRSS_PopupLootIndex].points = points;
GuildRaidSnapShot_Loot[GRSS_PopupLootDate][GRSS_PopupLootIndex].hardpoints = hardpoints;
GRSS_RecordCurrentPlayerReceivedItem(points);
if GRSS_Redistributing() then
GRSSObamaPoints(hardpoints)
end
end
function GRSSAdjSave()
local system = UIDropDownMenu_GetText(GRSSAdjSystemDropDown);
local player = GRSSAdjPlayer:GetText();
local points = GRSSAdjPoints:GetText();
local desc = GRSSAdjDesc:GetText();
local adjtype = "";
if GRSS_Divide[system] then
adjtype = GRSS_GetAdjType();
end
GRSSAdjClear();
GRSSRecordAdj(system,player,item,points,adjtype,desc);
end
function GRSSRecordItem(system,player,item,points)
local lootdate = date("%Y-%m-%d");
if(GuildRaidSnapShot_Loot[lootdate] == nil) then
GuildRaidSnapShot_Loot[lootdate] = {};
end
local iteminfo = {};
iteminfo.player = player;
iteminfo.item = item;
iteminfo.RealmName = GetRealmName();
iteminfo.date = date("%Y-%m-%d %H:%M:%S");
iteminfo.system = system;
iteminfo.points = points;
iteminfo.hardpoints = GRSSPlayerPointCost(player,system,points);
if GRSS_Redistributing() then
GRSSObamaPoints(iteminfo.hardpoints);
end
table.insert(GuildRaidSnapShot_Loot[lootdate],iteminfo);
if points ~= nil then
GRSSAddPoints(player,system,"spent",iteminfo.hardpoints);
end
return lootdate;
end
function GRSSRecordAdj(system,player,item,points,adjtype,desc)
local lootdate = date("%Y-%m-%d");
if(GuildRaidSnapShot_Adj[lootdate] == nil) then
GuildRaidSnapShot_Adj[lootdate] = {};
end
local adjinfo = {};
adjinfo.player = player;
adjinfo.item = item;
adjinfo.RealmName = GetRealmName();
adjinfo.date = date("%Y-%m-%d %H:%M:%S");
adjinfo.system = system;
adjinfo.points = points;
adjinfo.adjtype = adjtype;
adjinfo.description = desc;
table.insert(GuildRaidSnapShot_Adj[lootdate],adjinfo);
if points ~= nil then
if GRSS_Divide[system] then
GRSSAddPoints(player,system,adjtype,points);
else
GRSSAddPoints(player,system,"adj",points);
end
end
return lootdate;
end
function GRSSLootClear()
getglobal("GRSSLootPlayer"):SetText("");
getglobal("GRSSLootPoints"):SetText("");
getglobal("GRSSLootItem"):SetText("");
end
function GRSSAdjClear()
getglobal("GRSSAdjPlayer"):SetText("");
getglobal("GRSSAdjPoints"):SetText("");
getglobal("GRSSAdjDesc"):SetText("");
end
function GRSS_RecalcSpentLoot()
if GuildRaidSnapShot_Loot then
for ld,daytable in pairs(GuildRaidSnapShot_Loot) do
for lootindex,loottable in pairs(daytable) do
if loottable.system == nil or GRSS_Systems[loottable.system]==nil then
loottable.system = GRSSCurrentSystem
end
--points = GRSSPlayerPointCost(loottable.player,loottable.system,loottable.points);
points = loottable.hardpoints;
if tonumber(points) == nil then
points = loottable.points;
end
if tonumber(points) ~= nil then
GRSSAddPoints(loottable.player,loottable.system,"spent",points);
end
end
end
end
if GuildRaidSnapShot_Adj then
for ld,daytable in pairs(GuildRaidSnapShot_Adj) do
if daytable then
for adjindex,adjtable in pairs(daytable) do
if adjtable.system == nil or GRSS_Systems[adjtable.system]==nil then
adjtable.system = GRSSCurrentSystem
end
points = adjtable.points;
if tonumber(points) ~= nil then
if GRSS_Divide[adjtable.system] then
adjtype = adjtable.adjtype;
else
adjtype = "adj";
end
GRSSAddPoints(adjtable.player,adjtable.system,adjtype,points);
end
end
end
end
end
if GuildRaidSnapShot_SnapShots then
for snapshot in pairs(GuildRaidSnapShot_SnapShots) do
GRSSAddSnapshotPoints(snapshot);
end
GRSSChangeSystem(GRSSCurrentSystem);
end
end
function GRSSSetSnapshotPoints(points)
if string.lower(points)=="zs" or string.lower(points)=="sz" then
GRSSPrint("All Items received for the next 15 minutes will get redistributed and associated with this snapshot");
GRSS_Redistribute_SnapShot = GRSS_LastSnapShotName;
GRSS_Redistribute_SnapShot_ExpireTime = GetTime() + 15*60; -- Expire in 15 minutes
GuildRaidSnapShot_SnapShots[GRSS_LastSnapShotName].redistribute = 1;
GuildRaidSnapShot_SnapShots[GRSS_LastSnapShotName].points = 0;
else
GuildRaidSnapShot_SnapShots[GRSS_LastSnapShotName].points = points;
end
GRSSAddSnapshotPoints(GRSS_LastSnapShotName);
end
-- This works for the whole snapshot
function GRSSAddSnapshotPoints(snapshotname)
local points = GRSSNumNilZero(GuildRaidSnapShot_SnapShots[snapshotname].points);
local sys = GuildRaidSnapShot_SnapShots[snapshotname].system;
local players = GRSS_ParsePlayers(GuildRaidSnapShot_SnapShots[snapshotname].Raid);
if GuildRaidSnapShot_SnapShots[snapshotname].redistribute then
points = points/table.getn(players);
end
for _,mem in pairs(players) do
GRSSAddPoints(mem,sys,"earned",points);
end
end
-- Obama = Redistribution, get it? OLZOLZOLZ
-- This works only for newly added items, to adjust the previous value of a snapshot when an item is received and redistributed
function GRSSObamaPoints(totalpoints)
local snapshotname = GRSS_Redistribute_SnapShot;
local curpoints = GuildRaidSnapShot_SnapShots[snapshotname].points;
local sys = GuildRaidSnapShot_SnapShots[snapshotname].system;
local players = GRSS_ParsePlayers(GuildRaidSnapShot_SnapShots[snapshotname].Raid);
local newpoints = curpoints + totalpoints;
GuildRaidSnapShot_SnapShots[snapshotname].points = newpoints;
local toadd = totalpoints / table.getn(players);
for _,mem in pairs(players) do
GRSSAddPoints(mem,sys,"earned",toadd);
end
end
-- Returns the snapshot name if we are redistributing, else, returns nil
function GRSS_Redistributing()
if GRSS_Redistribute_SnapShot_ExpireTime > 0 and GetTime() < GRSS_Redistribute_SnapShot_ExpireTime then
return GRSS_Redistribute_SnapShot;
else
return nil;
end
end
function GRSSTrim (s)
return (string.gsub(s, "^%s*(.-)%s*$", "%1"))
end
function GRSS_ParsePlayers(str)
local retarr = {};
local pzarr = { strsplit(",",str) }; -- Players with Zones
for _,pz in pairs(pzarr) do
local p,z = strsplit(":",pz);
if(z~="Offline") then
table.insert(retarr,GRSSTrim(p));
end
end
return retarr;
end
function GRSS_PendingSnapshotCheck()
local items = 0;
local snapshots = 0;
local adjustments = 0;
for _ in pairs(GuildRaidSnapShot_SnapShots) do
snapshots = snapshots + 1;
end
for i,v in pairs(GuildRaidSnapShot_Adj) do
adjustments = adjustments + table.getn(v);
end
for i,v in pairs(GuildRaidSnapShot_Loot) do
items = items + table.getn(v);
end
if snapshots > 0 or items > 0 or adjustments > 0 then
local msg = items.." items, "..snapshots.." snapshots, and "..adjustments.." adjustments";
StaticPopup_Show("GRSS_RAIDCHECK",msg);
end
end
function GRSS_TimerRunningCheck()
if GRSS_NextTime then
local mins = math.floor((GRSS_NextTime - GetTime())/60);
if mins < 0 then
mins = 0
end
GRSSPrint("timercheck");
StaticPopup_Show("GRSS_TIMERCHECK",mins);
else
GRSS_ReadyForTimer = true;
end
end
--
function GRSS_RecordCurrentPlayerReceivedItem(pointstr)
playername = string.lower(GuildRaidSnapShot_Loot[GRSS_PopupLootDate][GRSS_PopupLootIndex].player);
normalplayername = GuildRaidSnapShot_Loot[GRSS_PopupLootDate][GRSS_PopupLootIndex].player;
points = GRSSPlayerPointCost(playername,GRSSCurrentSystem,pointstr);
if tonumber(points) ~= nil and tonumber(points) ~= 0 then
points = tonumber(points);
GRSSAddPoints(normalplayername,GRSSCurrentSystem,"spent",points);
temp = "Today: "..normalplayername.." <-- "..GuildRaidSnapShot_Loot[GRSS_PopupLootDate][GRSS_PopupLootIndex].item.." for "..points;
if GRSS_ItemHistory[string.upper(playername)] ~= nil then
table.insert(GRSS_ItemHistory[string.upper(playername)],temp);
else
GRSS_ItemHistory[string.upper(playername)] = {};
GRSS_ItemHistory[string.upper(playername)][0] = temp;
end
GRSSScrollBar_Update();
end
end
function GRSS_GetItemPoints(item)
for i,v in pairs(GRSS_ItemPrices[GRSSCurrentSystem]) do
if string.lower(item)==string.lower(v.name) then
return v.points;
end
end
return "";
end
--Sorts the Temp table GRSS_DKP
function GRSSSortBy(sort)
GRSS_CurrentSort = sort;
table.sort(GRSS_DKP,
function(a,b)
if sort=="spent" then
if GRSSCurrentAction == "DKP Standings" then
return GRSSNum(a.spent) > GRSSNum(b.spent);
elseif GRSSCurrentAction == "Rolls" or GRSSCurrentAction=="DKP+Roll" then
return GRSSNum(a.roll) > GRSSNum(b.roll);
elseif GRSSCurrentAction == "Bids" or GRSSCurrentAction == "Bid+Roll" then
return GRSSNum(a.bid) > GRSSNum(b.bid);
end
elseif sort=="bidroll" or (GRSSCurrentAction=="Bid+Roll" and sort=="adj") then
return GRSSNumNilZero(a.roll) + GRSSNumNilZero(a.bid) > GRSSNumNilZero(b.roll) + GRSSNumNilZero(b.bid);
elseif sort=="rankid" then
return GRSSNum(a.rankid) < GRSSNum(b.rankid);
elseif a[sort]==b[sort] then
return GRSSNum(a.total) > GRSSNum(b.total);
elseif sort=="name" or sort=="class" then
return (string.lower(a[sort]) < string.lower(b[sort]))
else
return (GRSSNum(a[sort]) > GRSSNum(b[sort]))
end
end
);
GRSSScrollBar_Update();
end
--Sorts the Full table generated by the downloader: GRSS_Full_DKP
function GRSSSortByFull(sort,sys)
table.sort(GRSS_Full_DKP[sys],
function(a,b)
if sort=="spent" then
if GRSSCurrentAction == "DKP Standings" then
return GRSSNum(a.spent) > GRSSNum(b.spent);
elseif GRSSCurrentAction == "Rolls" then
return GRSSNum(a.roll) > GRSSNum(b.roll);
elseif GRSSCurrentAction == "Bids" then
return GRSSNum(a.bid) > GRSSNum(b.bid);
end
elseif a[sort]==b[sort] then
return GRSSNum(a.earned) + GRSSNum(a.adj) - GRSSNum(a.spent) > GRSSNum(b.earned) + GRSSNum(b.adj) - GRSSNum(b.spent);
elseif sort=="name" or sort=="class" then
return (string.lower(a[sort]) < string.lower(b[sort]))
else
return (GRSSNum(a[sort]) > GRSSNum(b[sort]))
end
end
);
end
function GRSSChangeSystem(sys)
if sys ~= nil and GRSS_Full_DKP[sys]~=nil then
local inc = 1;
local i,v;
local top = table.getn(GRSS_Full_DKP[sys]);