-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMQ2Status.cpp
More file actions
1749 lines (1657 loc) · 65.2 KB
/
MQ2Status.cpp
File metadata and controls
1749 lines (1657 loc) · 65.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
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
/*
//MQ2Status by Chatwiththisname and Sic
// /status help - returns help information for the / commands
*/
#include <mq/Plugin.h>
#include <mq/imgui/ImGuiUtils.h>
PreSetup("MQ2Status");
PLUGIN_VERSION(2.0);
bool bShowPlugin = true;
bool bShowWarrior = true;
bool bShowCleric = true;
bool bShowPaladin = false;
bool bShowRanger = false;
bool bShowShadowknight = true;
bool bShowDruid = false;
bool bShowMonk = true;
bool bShowBard = false;
bool bShowRogue = true;
bool bShowShaman = false;
bool bShowNecromancer = false;
bool bShowWizard = false;
bool bShowMage = false;
bool bShowEnchanter = false;
bool bShowBeastlord = true;
bool bShowBerserker = true;
bool bConnectedToEQBC = false;
bool bConnectedToDannet = false;
const int MAX_ARGS = 20;
std::string ConnectedToReportOutput();
bool HaveAlias(const std::string& aliasName);
bool IHaveSpa(int spa);
bool IsDefined(const char* szLine);
inline float PercentHealth(PlayerClient* pSpawn);
inline float PercentEndurance(PlayerClient* pSpawn);
inline float PercentMana(PlayerClient* pSpawn);
void DoINIThings();
void ParseBoolArg(const char* Arg, const char* Arg2, const char* Arg3, bool* theOption, const char* INIsection);
std::string PutCommas(const std::string& input);
void StatusCmd(PlayerClient* pChar, const char* szLine);
std::string GetSpellUpgradeType(int level);
template <typename T>
std::string LabeledText(const std::string& Label, T Value);
std::string stringBuffer;
std::string GetColorCode(char Color, bool Dark);
struct XpacCurrency
{
std::string XpacShortName;
ALTCURRENCY Group;
ALTCURRENCY Raid;
// currently the only usage of this optional is for additional secondary raid currency
// so if we label is "Raid2" it means in the future we can add "Group2" options currency if needed
std::optional<ALTCURRENCY> Raid2;
// I'm not including RoF atm, it has 4 raid currencys but no group currency
// std::optional<ALTCURRENCY> Raid3;
// std::optional<ALTCURRENCY> Raid4;
//
};
const std::vector<XpacCurrency> currencyxpac =
{
//{ Xpac, group, raid },
{ "SoR", ALTCURRENCY_RIFTTOUCHEDSIGILS, ALTCURRENCY_FORGOTTENRUINEDCOINS },
{ "ToB", ALTCURRENCY_SCALEWROUGHTEMBLEM, ALTCURRENCY_BROODOFFICERSEMBLEM },
{ "LS", ALTCURRENCY_LAURIONINNVOUCHER, ALTCURRENCY_SHALOWAINSPRIVATERESERVE },
{ "NoS", ALTCURRENCY_SHADEDSPECIE, ALTCURRENCY_SPIRITUALMEDALLIONS },
{ "ToL", ALTCURRENCY_SCARLETMARKS, ALTCURRENCY_MEDALSOFCONFLICT },
{ "CoV", ALTCURRENCY_RESTLESSMARKS, ALTCURRENCY_WARFORGEDEMBLEMS },
{ "ToV", ALTCURRENCY_FROSTSTONEDUCATS, ALTCURRENCY_WARLORDSSYMBOLS },
{ "TBL", ALTCURRENCY_FETTEREDIFRITCOINS, ALTCURRENCY_ENTWINEDDJINNCOINS },
{ "RoS", ALTCURRENCY_BATHEZIDTRADEGEMS, ALTCURRENCY_ANCIENTDRACONICCOIN },
{ "EoK", ALTCURRENCY_SATHIRTRADEGEMS, ALTCURRENCY_ANCIENTSEBILISIANCOINS },
{ "TBM", ALTCURRENCY_REMNANTSOFTRANQUILITY, ALTCURRENCY_BIFURCATEDCOINS },
{ "TDS", ALTCURRENCY_PIECESOFEIGHT, ALTCURRENCY_ARXENERGYCRYSTALS },
{ "CoTF", ALTCURRENCY_MARKSOFVALOR, ALTCURRENCY_MEDALSOFHEROISM, ALTCURRENCY_FISTSOFBAYLE },
// I haven't decided how to handle when there is no group currency
//{ "RoF", ALTCURRENCY_MARKSOFVALOR, ALTCURRENCY_VELIUMSHARDS, ALTCURRENCY_CRYSTALLIZEDFEAR, ALTCURRENCY_SHADOWSTONES, ALTCURRENCY_DREADSTONES },
};
template <typename T>
std::string to_string_with_precision(const T a_value, const int n = 6)
{
std::ostringstream out;
out.precision(n);
out << std::fixed << a_value;
return out.str();
}
// TODO: FIXME
// There currently isn't a way to check what lua stuff is running in c++ land
// unlike plugins that use the g_pluginMap global
// MQ2Lua uses a s_infoMap which is local to MQ2Lua
std::string LuaScriptStatus(const char* scriptname)
{
std::string outputBuffer = {};
if (IsPluginLoaded("Lua")) {
char luaScript[64] = { 0 };
// format is "${Lua.Script[scriptname].Status}"
sprintf_s(luaScript, "${Lua.Script[%s].Status}", scriptname);
ParseMacroData(luaScript, 64);
outputBuffer = luaScript;
}
/* return values as defined in LuaThread.h
"STARTING";
"RUNNING";
"PAUSED";
"EXITED";
"UNKNOWN";
*/
return outputBuffer;
}
// TODO:: FIXME
// ideally would actually be able to pull in-script TLO's
// so we can see if it is paused
// which is not the same as the paused lua status in some circumstances
bool IsLuaScriptRunning(const char* scriptname)
{
return string_equals(LuaScriptStatus(scriptname), "RUNNING");
}
// TODO remove once an appropriate function is in main/core.
int ItemCountByType(int type)
{
PcProfile* pcProfile = GetPcProfile();
int count = 0;
for (int i = InvSlot_FirstWornItem; i < InvSlot_Max; i++) {
// check top level slots
if (ItemClient* pItem = pcProfile->GetInventorySlot(i)) {
if (pItem->GetItemClass() == type) {
count += pItem->GetItemCount();
}
if (!pItem->IsContainer())
continue;
// check inside the container
for (ItemClient* pPackItem : pItem->GetHeldItems()) {
if (pPackItem && pPackItem->GetItemClass() == type) {
count += pPackItem->GetItemCount();
}
}
}
}
return count;
};
enum eItemCountStatusType
{
Item,
ItemAll,
ItemBank
};
std::string ItemCountStatusByID(const char* Arg, const int type)
{
std::string output;
const char* findItemIDname = GetNextArg(Arg, 2);
int iItemID = GetIntFromString(findItemIDname, 0);
ItemClient* findItemName = FindItemByID(iItemID);
if (findItemName) {
findItemIDname = findItemName->GetName();
}
if (iItemID) {
switch (type) {
case eItemCountStatusType::Item:
output = LabeledText(findItemIDname, FindItemCountByID(iItemID));
break;
case eItemCountStatusType::ItemAll:
output = LabeledText(findItemIDname, FindItemCountByID(iItemID) + FindBankItemCountByID(iItemID));
break;
case eItemCountStatusType::ItemBank:
output = LabeledText(findItemIDname, FindBankItemCountByID(iItemID));
break;
default:
break;
}
}
else {
WriteChatf("\ao[MQ2Status] \arPlease provide a valid Item ID to search for.\aw");
WriteChatf("\ao[MQ2Status] \arExample: \ay\"/status itembank id 10037\"\aw.");
}
return output;
}
std::string ItemCountStatusByName(const char* Arg, const int type)
{
size_t len = strlen(Arg);
std::string name = Arg;
if (len >= 2 && Arg[0] == '"' && Arg[len - 1] == '"') {
name = "=" + std::string(Arg + 1, len - 2);
}
switch (type) {
case eItemCountStatusType::Item:
return LabeledText(name, FindItemCountByName(name.c_str()));
case eItemCountStatusType::ItemAll:
return LabeledText(name, FindItemCountByName(name.c_str()) + FindBankItemCountByName(name.c_str(), 0));
case eItemCountStatusType::ItemBank:
return LabeledText(name, FindBankItemCountByName(name.c_str(), 0));
default:
return {};
}
}
const std::map<std::string, int> mEquipInvSlotName
{
{ "Ammo", eInventorySlot::InvSlot_Ammo },
{ "Arms", eInventorySlot::InvSlot_Arms },
{ "Back", eInventorySlot::InvSlot_Back },
{ "Charm", eInventorySlot::InvSlot_Charm },
{ "Chest", eInventorySlot::InvSlot_Chest },
{ "Face", eInventorySlot::InvSlot_Face },
{ "Feet", eInventorySlot::InvSlot_Feet },
{ "Hands", eInventorySlot::InvSlot_Hands },
{ "Head", eInventorySlot::InvSlot_Head },
{ "Left Ear", eInventorySlot::InvSlot_LeftEar },
{ "Left Finger", eInventorySlot::InvSlot_LeftFingers },
{ "Left Ring", eInventorySlot::InvSlot_LeftFingers },
{ "Left Wrist", eInventorySlot::InvSlot_LeftWrist },
{ "Legs", eInventorySlot::InvSlot_Legs },
{ "Neck", eInventorySlot::InvSlot_Neck },
{ "Powersource", eInventorySlot::InvSlot_PowerSource },
{ "Primary", eInventorySlot::InvSlot_Primary },
{ "Mainhand", eInventorySlot::InvSlot_Primary },
{ "Range", eInventorySlot::InvSlot_Range },
{ "Right Ear", eInventorySlot::InvSlot_RightEar },
{ "Right Finger", eInventorySlot::InvSlot_RightFingers },
{ "Right Ring", eInventorySlot::InvSlot_RightFingers },
{ "Right Wrist", eInventorySlot::InvSlot_RightWrist },
{ "Secondary", eInventorySlot::InvSlot_Secondary },
{ "Offhand", eInventorySlot::InvSlot_Secondary },
{ "Shoulders", eInventorySlot::InvSlot_Shoulders },
{ "Waist", eInventorySlot::InvSlot_Waist },
};
const std::vector<std::pair<const char*, bool*>> vShowClassesOptions =
{
{ "plugin", &bShowPlugin },
{ "warrior", &bShowWarrior },
{ "cleric", &bShowCleric },
{ "paladin", &bShowPaladin },
{ "ranger", &bShowRanger },
{ "shadowknight", &bShowShadowknight },
{ "druid", &bShowDruid },
{ "monk", &bShowMonk },
{ "bard", &bShowBard },
{ "rogue", &bShowRogue },
{ "shaman", &bShowShaman },
{ "necromancer", &bShowNecromancer },
{ "wizard", &bShowWizard },
{ "magician", &bShowMage },
{ "enchanter", &bShowEnchanter },
{ "beastlord", &bShowBeastlord },
{ "berserker", &bShowBerserker },
};
void StatusCmd(PlayerClient* pChar, const char* szLine)
{
std::string outputcmd = ConnectedToReportOutput();
std::string stringBuffer;
if (!bConnectedToDannet && !bConnectedToEQBC) return;
bool classPlugin = false; // Only true if there is a class plugin for this class, and the plugin was loaded.
bool notLoaded = false; // Would only be true if one of the classes in the switch has a plugin, but it's not loaded
// Get our Parameters
char Arg[MAX_STRING] = { 0 };
char Arg2[MAX_STRING] = { 0 };
char Arg3[MAX_STRING] = { 0 };
char NextArg[MAX_STRING] = { 0 };
// TODO:: refactor parseboolarg to not need arg, arg2, and arg3 passed
GetArg(Arg, szLine, 1);
GetArg(Arg2, szLine, 2);
GetArg(Arg3, szLine, 3);
strcpy_s(NextArg, GetNextArg(szLine));
PcClient* pCharInfo = GetCharInfo();
PcProfile* pCharInfo2 = GetPcProfile();
if (Arg[0] != '\0') {
if (ci_equals(Arg, "aa")) {
stringBuffer += LabeledText("Available AA Points", pCharInfo2->AAPoints);
}
else if (ci_equals(Arg, "achieve") || ci_equals(Arg, "achievement")) {
AchievementManager& achievemanager = AchievementManager::Instance();
int id = 0;
// if there is no second argument, we're going to give them the total completed achievement score
if (NextArg[0] == '\0') {
stringBuffer += LabeledText("Score", achievemanager.completedAchievementScore);
stringBuffer += GetColorCode('g', false) + " Points";
}
else {
const Achievement* Achieve = nullptr;
if (IsNumber(NextArg)) {
id = atoi(NextArg);
Achieve = GetAchievementById(id);
}
else {
Achieve = GetAchievementByName(NextArg);
if (Achieve) {
id = Achieve->id;
}
}
// get the achievement by the ID number just collected
const eqlib::Achievement* AchieveByID = GetAchievementById(id);
if (AchieveByID != nullptr) {
// is this achievement complete?
const bool bComplete = IsAchievementComplete(AchieveByID);
stringBuffer += LabeledText("Achieve", AchieveByID->name.c_str());
stringBuffer += LabeledText(" Status", (bComplete ? " Completed" : GetColorCode('r', false) + " Incomplete"));
// if the achievement is not complete, output what we're missing from it.
if (!bComplete) {
// Get incomplete components
// we need to get achievementindex by ID
int achievementIndex = achievemanager.GetAchievementIndexById(id);
// we need to get the individual achievement/component info
const SingleAchievementAndComponentsInfo* info = achievemanager.GetAchievementClientInfoByIndex(achievementIndex);
if (info) {
// we want to go through these achievements and check their completion status
for (int i = 0; i < Achieve->componentsByType[AchievementComponentCompletion].GetCount(); i++) {
const AchievementComponent& component = Achieve->componentsByType[AchievementComponentCompletion][i];
// if it is not set, then we are missing it.
if (!info->IsComponentComplete(AchievementComponentCompletion, i)) {
stringBuffer += LabeledText(" Missing", component.description.c_str());
}
}
}
}
}
else {
WriteChatf("\ao[MQ2Status] \arPlease provide a valid Achievement by name or ID to search for.");
WriteChatf("\ao[MQ2Status] \arExample: \agNorrathian Explorer\ar or \ag100000050\ar.");
WriteChatf("\ao[MQ2Status] \arKeep in mind achievements, by name will report the first achievement it finds with that name.");
}
}
}
else if (ci_equals(Arg, "aaxp")) {
stringBuffer += LabeledText("Assigned AA", pCharInfo2->AAPointsAssigned[0]);
stringBuffer += LabeledText(" Spent AA", pCharInfo2->AAPointsSpent);
stringBuffer += LabeledText(" AAXP", pCharInfo->AAExp * 0.001);
stringBuffer += LabeledText(" Banked AA", pCharInfo2->AAPoints);
}
else if (ci_equals(Arg, "bagspace")) {
stringBuffer += LabeledText("Bagspace", GetFreeInventory(1));
}
else if (ci_equals(Arg, "campfire")) {
if (pLocalPlayer && pLocalPlayer->Campfire) {
std::string cfStatus;
std::string cfInfo;
std::string cfTimeRemainHMS;
std::string cfZoneLongName;
if (int cfTimeRemain = pLocalPlayer->CampfireTimestamp - GetFastTime()) {
int Hrs = ((cfTimeRemain / 60) / 60);
std::string sHrs = std::to_string(Hrs);
int Mins = ((cfTimeRemain / 60) - (Hrs * 60));
std::string sMins = std::to_string(Mins);
int Secs = ((cfTimeRemain)-((Mins + (Hrs * 60)) * 60));
std::string sSecs = std::to_string(Secs);
cfTimeRemainHMS += sHrs + ":" + sMins + ":" + sSecs;
if (int ZoneID = pWorldData->GetZoneBaseId(pLocalPlayer->CampfireZoneID)) {
if (ZoneID < MAX_ZONES && pWorldData) {
if (EQZoneInfo* pZoneID = ((EQWorldData*)pWorldData)->ZoneArray[ZoneID]) {
cfZoneLongName += pZoneID->LongName;
}
else {
stringBuffer += GetColorCode('r', false) + "I don't appear to have a campfire" + GetColorCode('w', false);
}
}
else {
if (ZoneID > MAX_ZONES) {
stringBuffer += GetColorCode('r', false) + "ZoneID is bad?!" + GetColorCode('w', false);
}
if (!pWorldData) {
stringBuffer += GetColorCode('r', false) + "There was no pWorldData, are you in game?!" + GetColorCode('w', false);
}
}
}
else {
return;
}
cfStatus += GetColorCode('g', false) + "Active " + GetColorCode('g', false);
}
stringBuffer += LabeledText("Campfire", cfStatus) + " " + LabeledText("Time Left", cfTimeRemainHMS) + " " + LabeledText("Zone", cfZoneLongName);
}
else {
stringBuffer += GetColorCode('r', false) + " " + "We do not appear to have a campfire in a usable location!" + GetColorCode('w', false);
}
}
else if (ci_equals(Arg, "collected") || ci_equals(Arg, "collection")) {
if (NextArg[0] == '\0') {
WriteChatf("\ao[MQ2Status] \arPlease provide a valid \agCollection Item\ag to search for.\aw");
WriteChatf("\ao[MQ2Status] \arExamples: \agKromzek Bracer\ar, \agLucky Clover\ar, \agAir-Infused Opal\ar, etc.\aw");
}
else {
// start an achievement manager
AchievementManager& achievemanager = AchievementManager::Instance();
// We need this bool so we can output if there was invalid component search
bool bFoundComponent = false;
// we need to check all the categories for "Collections"
// most of them are just ##09 for collections, but there are at least 2 that are not, so we should check everything
for (const AchievementCategory& achievecat : achievemanager.categories) {
// if we found a category with collections in the name
if (string_equals(achievecat.name, "Collections")) {
// We need to check the children of this category
for (int i = 0; i < achievecat.GetAchievementCount(); ++i) {
int id = achievecat.GetAchievementId(i);
// we need to get achievementindex by ID
int achievementIndex = achievemanager.GetAchievementIndexById(id);
// we need to get the actual achievement by the index we just got
const Achievement* Achieve = achievemanager.GetAchievementByIndex(achievementIndex);
// we need to get the individual achievement/component info
const SingleAchievementAndComponentsInfo* info = achievemanager.GetAchievementClientInfoByIndex(achievementIndex);
if (info) {
// we want to go through these achievements and check their completion status
for (int i = 0; i < Achieve->componentsByType[AchievementComponentCompletion].GetCount(); i++) {
const AchievementComponent& component = Achieve->componentsByType[AchievementComponentCompletion][i];
if (ci_equals(NextArg, component.description)) {
bFoundComponent = true;
// if it is not set, then we are missing it.
if (!info->IsComponentComplete(AchievementComponentCompletion, i)) {
stringBuffer += LabeledText(component.description.c_str(), "\arMissing\ax");
}
else {
stringBuffer += LabeledText(component.description.c_str(), "Collected");
}
}
}
}
}
}
}
// if we didn't find what we're checking for in any achievement, output it was invalid
if (!bFoundComponent) {
WriteChatf("\ao[MQ2Status] \arNo such collection item: \ay%s\ax.", NextArg);
WriteChatf("\ao[MQ2Status] \arPlease provide a valid \agCollection Item\ar to search for.");
WriteChatf("\ao[MQ2Status] \arExamples: \agKromzek Bracer\ar, \agLucky Clover\ar, \agAir-Infused Opal\ar, etc.");
}
}
}
else if (ci_equals(Arg, "currency")) {
if (NextArg[0] == '\0') { // if an Argument after currency wasn't made, we need to ask for one
WriteChatf("\ao[MQ2Status] \arPlease provide a valid Currency Name to search for.\aw");
}
else { // We need to lowercase and be able to do a "find" in case someone puts an "s" on a currency
std::string tempArg = NextArg; // convert our arg to string for transform
std::transform(tempArg.begin(), tempArg.end(), tempArg.begin(), tolower); // lowercase
#if !defined (ROF2EMU)
if (tempArg.find("loyalty") == '\0') {
stringBuffer += LabeledText("Loyalty Tokens", pCharInfo->LoyaltyRewardBalance); // Using LoyaltyRewardBalance instead of AltCurrency since we can access directly
}
else if (tempArg.find("dbc") == '\0' || tempArg.find("daybreak") == '\0') { // DayBreakCurrency
if (CSidlScreenWnd* MarketWnd = (CSidlScreenWnd*)FindMQ2Window("MarketPlaceWnd")) {
if (CXWnd* Funds = MarketWnd->GetChildItem("MKPW_AvailableFundsUpper")) {
if (Funds) {
stringBuffer += LabeledText("Daybreak Cash", Funds->GetWindowText().c_str());
}
}
}
else
stringBuffer += LabeledText("Daybreak Cash", "Unable to access");
}
else {
#endif !defined (ROF2EMU)
int altCurrency = GetCurrencyIDByName(NextArg);
bool bFound = false;
if (altCurrency != -1) {
stringBuffer += LabeledText(tempArg, pPlayerPointManager->GetAltCurrency(altCurrency));
bFound = true;
}
else {
for (const auto& xpac : currencyxpac) {
if (ci_equals(xpac.XpacShortName, NextArg)) {
stringBuffer += LabeledText("Xpac", xpac.XpacShortName);
stringBuffer += LabeledText(" Group", pPlayerPointManager->GetAltCurrency(xpac.Group));
stringBuffer += LabeledText(" Raid", pPlayerPointManager->GetAltCurrency(xpac.Raid));
if (xpac.Raid2) {
stringBuffer += LabeledText(" Raid2", pPlayerPointManager->GetAltCurrency(xpac.Raid2.value()));
}
bFound = true;
}
}
}
if (!bFound) {
stringBuffer += LabeledText(tempArg, "Is not a valid currency");
}
#if !defined (ROF2EMU)
}
#endif !defined (ROF2EMU)
}
}
else if (ci_equals(Arg, "evolve") || ci_equals(Arg, "evolving")) {
if (NextArg[0] == '\0') {
WriteChatf("\ao[MQ2Status] \arPlease provide a valid Item to check your evolving status on\aw");
WriteChatf("\ao[MQ2Status] \arExamples: Threadbare Weighted Tabard, Djarn's Tarnished Amethyst Ring, Wrathful Harasser's Earring of Rallos Zek, etc.\aw");
}
else {
if (ItemClient* myItem = FindItemByName(NextArg)) {
if (IsEvolvingItem(myItem)) {
stringBuffer += LabeledText("Item", myItem->GetName());
stringBuffer += LabeledText(" Level", myItem->pEvolutionData->EvolvingCurrentLevel);
stringBuffer += LabeledText(" Max", myItem->pEvolutionData->EvolvingMaxLevel);
stringBuffer += LabeledText(" Pct", myItem->pEvolutionData->EvolvingExpPct);
}
else {
WriteChatf("\ao[MQ2Status] \ag%s \aris not an evolving item. Please provide a valid Item to check your evolving status on\aw", myItem->GetName());
}
}
else {
WriteChatf("\ao[MQ2Status] \arPlease provide a valid Item to check your evolving status on\aw");
WriteChatf("\ao[MQ2Status] \arExamples: Threadbare Weighted Tabard, Djarn's Tarnished Amethyst Ring, Wrathful Harasser's Earring of Rallos Zek, etc.\aw");
}
}
}
else if (ci_equals(Arg, "fellow") || ci_equals(Arg, "fellowship")) { // We only have this WriteChatf and not reporting to eqbc/dannet
SFellowship& fellowship = pLocalPlayer->Fellowship;
if (fellowship.Members > 0) {
WriteChatf("FS MoTD: \ag%s\aw", fellowship.MotD);
WriteChatf("FS Leader is: \ag%s\aw , We have: \ay%lu\aw members", fellowship.FellowshipMember[0].Name, fellowship.Members);
for (int i = 0; i < fellowship.Members; i++) {
SFellowshipMember& thisMember = fellowship.FellowshipMember[i];
WriteChatf("\ag%s\aw - \ay%lu\aw - \ap%s\aw ", thisMember.Name, thisMember.Level, GetClassDesc(thisMember.Class));
}
} else {
WriteChatf("\arIt does not appear we are in a fellowship.\aw");
}
}
else if (ci_equals(Arg, "gear")) {
bool bFound = false;
size_t size = strlen(NextArg);
if (size) {
for (const auto& x : mEquipInvSlotName) {
if (ci_equals(x.first, NextArg)) {
// did we find a valid gear slot?
bFound = true;
if (ItemClient* item = FindItemBySlot(x.second)) {
// itemtagsize is 512 in FormatItemLink, so we need this buffer that size as well
char buffer[512] = {};
FormatItemLink(buffer, 512, item);
stringBuffer += LabeledText(x.first, buffer);
}
else {
stringBuffer += LabeledText(x.first, " is empty.");
}
}
}
}
// this bool check also covers if !strlen as found would be false
if (!bFound) {
if (size)
WriteChatf("\ao[MQ2Status] \ag%s\ar is invalid.", NextArg);
WriteChatf("\ao[MQ2Status] \arPlease provide a valid gear slot.");
WriteChatf("\ao[MQ2Status] \arExamples: primary, secondary, left ring, etc.\aw");
}
}
else if (ci_equals(Arg, "hunger") || ci_equals(Arg, "thirst")) {
stringBuffer += LabeledText("Hunger", pCharInfo2->hungerlevel);
stringBuffer += LabeledText(" Food", ItemCountByType(ItemClass_Food));
stringBuffer += LabeledText(" Thirst", pCharInfo2->thirstlevel);
stringBuffer += LabeledText(" Drink", ItemCountByType(ItemClass_Drink));
}
else if (ci_equals(Arg, "help")) {
WriteChatf("Welcome to MQ2Status");
WriteChatf("By \aoChatWithThisName\aw & \agSic\aw Exclusively for \arRedGuides\aw.");
WriteChatf("\agValid Status options are:\aw");
WriteChatf("\ao/status will output to eqbc/dannet: If we have a CWTN Class Plugin loaded, if we have a macro, if our macro is kiss - it will say what our role is, if we are paused, if we are hidden, and if we have a merc that is alive.");
WriteChatf("\ao/status \agaa\aw: Reports how many \"banked\" AA points you have.");
WriteChatf("\ao/status \agaaxp\aw: Reports our Spent AA, our AAXP %%, and our Banked AA.");
WriteChatf("\ao/status \agachievement\aw: Reports the status of an achievement by name, or id.");
WriteChatf("\ao/status \agbagspace\aw: Reports how many open bagspaces you have.");
WriteChatf("\ao/status \agcampfire\aw: Reports campfire information including Active, Duration, and Zone.");
WriteChatf("\ao/status \agcollection\aw: Reports if we have collected an item by name.");
WriteChatf("\ao/status \agcurrency\aw: Reports how many of an alt currency you have.");
WriteChatf("\ao/status \agevolve / evolving\aw: Reports the evolution status of an item by name.");
WriteChatf("\ao/status \agfellowship\aw: This returns to your mq2window (does not eqbc/dannet) information on your fellowship");
WriteChatf("\ao/status \aghunger / thirst\aw: Reports your hunger, how many food items you have, your thirst, and how many drink items you have.");
WriteChatf("\ao/status \aggtribute\aw: or \agguildtribute\aw: Displays if your current Guild Tribute Status is On or Off and the current Guild Favor.");
WriteChatf("\ao/status \aginvis\aw: Reports our Invis and IVU status, so we can check we are \"Double Invis\".");
WriteChatf("\ao/status \agitem\aw \ayitem name\aw: reports how many \ayitem name\aw you have in your inventory.");
WriteChatf("\ao/status \agitembank\aw \ayitem name\aw: reports how many \ayitem name\aw you have in your bank.");
WriteChatf("\ao/status \agitemall\aw \ayitem name\aw: reports how many \ayitem name\aw you have in your bank + inventory combined.");
WriteChatf("\ao/status \agitem \ap/\ag itemall \ap/\ag itembank \awsearching can also use \ayID #\aw. \arExample: \ay\"/status itembank id 10037\"");
WriteChatf("\ao/status \agkrono\aw: Reports how many krono we have.");
WriteChatf("\ao/status \aglogin\aw: Reports your login account name.");
WriteChatf("\ao/status \agmerc\aw: Reports mercenary information including class, and role.");
WriteChatf("\ao/status \agmacro\aw: Reports what macro you currently have running.");
WriteChatf("\ao/status \agmoney \aw or \agplat\aw: Reports how much plat you have.");
WriteChatf("\ao/status \agparcel\aw: Reports our \"Parcel\" status.");
WriteChatf("\ao/status \agquest\aw or \agtask\aw \ayQuest name\aw: Reports if you have a quest/task matching \ayQuest name\aw.");
WriteChatf("\ao/status \agqueststep\aw or \agtaskstep\aw \ayQuest name\aw: Reports what step you are on if you have a quest/task matching \ayQuest name\aw.");
WriteChatf("\ao/status \agshow\aw: Allows toggling on/off of the CWTN Class Plugins to be visible during /status.");
WriteChatf("\ao/status \agskill\aw \ayskill name\aw: reports out your current skill value for \ay skill name\aw.");
WriteChatf("\ao/status \agstat\aw \ayoption\aw: reports the following options: Hdex, HStr, HSta, HInt, HAgi, HWis, HCha, HPS, Mana, Endurance, Luck, Weight.");
WriteChatf("\ao/status \agspell \ayoption\aw: takes a spell by name, or level, and reports the spells you have that match. Useful to see what ranks of spells you have.");
#if !defined(ROF2EMU)
WriteChatf("\ao/status \agsub\aw: Reports our subscription level, and if we are All Access, how many days are left.");
#endif
WriteChatf("\ao/status \agtribute\aw: Displays if your current Tribute Status is On or Off and the current Favor");
WriteChatf("\ao/status \agxp\aw: Reports our level, Current XP %%, Banked AA, and our AAXP %%.");
WriteChatf("\ao/status \agzone\aw: Reports what zone we are in.");
}
// We don't appear to have a way to access the information directly so I'm accessing the tribute window
else if (ci_equals(Arg, "gtribute") || ci_equals(Arg, "guildtribute")) {
if (CXWnd* TributeBenefitWnd = FindMQ2Window("TributeBenefitWnd")) {
if (CLabelWnd* GuildTributeStatus = (CLabelWnd*)TributeBenefitWnd->GetChildItem("TBWG_ActivateButton")) {
std::string strGuildTributeStatus = GuildTributeStatus->GetWindowText().c_str();
if (!strGuildTributeStatus.empty()) {
stringBuffer += LabeledText("Guild Tribute Status", ci_equals(strGuildTributeStatus, "Deactivate") ? "On" : "Off");
}
}
if (CLabelWnd* GuildTributePoints = (CLabelWnd*)TributeBenefitWnd->GetChildItem("TBWG_GuildPoolLabel")) {
std::string strGuildTributePoints = GuildTributePoints->GetWindowText().c_str();
if (!strGuildTributePoints.empty()) {
stringBuffer += LabeledText(" Guild Favor", strGuildTributePoints);
}
}
}
}
else if (ci_equals(Arg, "invis")) {
if (IHaveSpa(eEQSPA::SPA_INVISIBILITY) || IHaveSpa(eEQSPA::SPA_IMPROVED_INVIS)) {
stringBuffer += GetColorCode('g', false) + "INVIS" + GetColorCode('x', false) + "::";
}
else {
stringBuffer += GetColorCode('r', false) + "INVIS" + GetColorCode('x', false) + "::";
}
if (IHaveSpa(eEQSPA::SPA_INVIS_VS_UNDEAD) || IHaveSpa(eEQSPA::SPA_IMPROVED_INVIS_UNDEAD)) {
stringBuffer += GetColorCode('g', false) + "IVU";
}
else {
stringBuffer += GetColorCode('r', false) + "IVU";
}
}
else if (ci_equals(Arg, "item")) {
if (NextArg[0] == '\0') {
WriteChatf("\ao[MQ2Status] \arPlease provide a valid Item to search for\aw");
WriteChatf("\ao[MQ2Status] \arExamples: Bone Chips, Diamond, Blue Diamond, etc.\aw");
WriteChatf("\ao[MQ2Status] \arOr ID using the id tag. Example: \ay\"/status item id 10037\"\aw.");
}
else if (ci_equals(NextArg, "id")) {
stringBuffer += ItemCountStatusByID(szLine, eItemCountStatusType::Item);
}
else {
stringBuffer += ItemCountStatusByName(NextArg, eItemCountStatusType::Item);
}
}
else if (ci_equals(Arg, "itemall")) {
if (NextArg[0] == '\0') {
WriteChatf("\ao[MQ2Status] \arPlease provide a valid Item to search for\aw");
WriteChatf("\ao[MQ2Status] \arExamples: Bone Chips, Diamond, Blue Diamond, etc.\aw");
WriteChatf("\ao[MQ2Status] \arOr ID using the id tag. Example: \ay\"/status itemall id 10037\"\aw.");
}
else if (ci_equals(NextArg, "id")) {
stringBuffer += ItemCountStatusByID(szLine, eItemCountStatusType::ItemAll);
}
else {
stringBuffer += ItemCountStatusByName(NextArg, eItemCountStatusType::ItemAll);
}
}
else if (ci_equals(Arg, "itembank")) {
if (NextArg[0] == '\0') {
WriteChatf("\ao[MQ2Status] \arPlease provide a valid Item to search for\aw");
WriteChatf("\ao[MQ2Status] \arExamples: Bone Chips, Diamond, Blue Diamond, etc.\aw");
WriteChatf("\ao[MQ2Status] \arOr ID using the id tag. Example: \ay\"/status itembank id 10037\"\aw.");
}
else if (ci_equals(NextArg, "id")) {
stringBuffer += ItemCountStatusByID(szLine, eItemCountStatusType::ItemBank);
}
else {
stringBuffer += ItemCountStatusByName(NextArg, eItemCountStatusType::ItemBank);
}
}
else if (ci_equals(Arg, "krono")) {
stringBuffer += LabeledText("Krono", pCharInfo->Krono);
}
else if (ci_equals(Arg, "login")) {
stringBuffer += LabeledText("Login Name", GetLoginName());
}
else if (ci_equals(Arg, "macro")) {
if (gMacroStack && strlen(gszMacroName)) {
stringBuffer += LabeledText(" Macro", gszMacroName);
}
else {
stringBuffer += LabeledText(" Macro", "NULL");
}
}
else if (ci_equals(Arg, "merc")) {
if (pMercManager && pMercManager->HasMercenary()) {
switch (pMercManager->GetMercenaryState())
{
case MercenaryState_Dead:
stringBuffer += GetColorCode('o', false) + "Class: " + GetColorCode('r', false) + "Dead! " + GetColorCode('w', false);
break;
case MercenaryState_Suspended:
stringBuffer += GetColorCode('o', false) + "Mercenary State: " + GetColorCode('r', false) + "Suspended! " + GetColorCode('w', false);
break;
case MercenaryState_Active:
stringBuffer += GetColorCode('o', false) + "Mercenary State: " + GetColorCode('g', false) + "Alive! " + GetColorCode('w', false);
{
int mercStance = pMercManager->currentMercenary.GetCurrentStanceId();
if (PlayerClient* myMerc = GetSpawnByID(pMercManager->mercenarySpawnId)) {
switch (myMerc->GetClass()) {
case Cleric:
stringBuffer += GetColorCode('o', false) + "Class: " + GetColorCode('g', false) + "Cleric " + GetColorCode('w', false);
{
switch (mercStance) {
case 0:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Balanced " + GetColorCode('w', false);
//status Balanced
break;
case 1:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Efficient" + GetColorCode('w', false);
//status Efficient
break;
case 2:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Reactive " + GetColorCode('w', false);
//status Reactive
break;
case 3:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Passive " + GetColorCode('w', false);
//status Passive
break;
default:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Unknown " + GetColorCode('w', false);
break;
}
}
break;
case Warrior:
stringBuffer += GetColorCode('o', false) + "Class: " + GetColorCode('g', false) + "Warrior " + GetColorCode('w', false);
{
switch (mercStance) {
case 0:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Aggressive " + GetColorCode('w', false);
//status Aggressive
break;
case 1:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Assist " + GetColorCode('w', false);
//status Assist
break;
case 2:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Passive " + GetColorCode('w', false);
//status Passive
break;
default:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Unknown " + GetColorCode('w', false);
break;
}
}
break;
case Wizard:
stringBuffer += GetColorCode('o', false) + "Class: " + GetColorCode('g', false) + "Wizard " + GetColorCode('w', false);
{
switch (mercStance) {
case 0:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Passive " + GetColorCode('w', false);
//status Passive
break;
case 1:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Balanced " + GetColorCode('w', false);
//status Balanced
break;
case 2:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Burn " + GetColorCode('w', false);
//status Burn
break;
case 3:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Burn AE " + GetColorCode('w', false);
//status Burn AE
break;
default:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Unknown " + GetColorCode('w', false);
break;
}
}
break;
case Rogue:
stringBuffer += GetColorCode('o', false) + "Class: " + GetColorCode('g', false) + "Rogue " + GetColorCode('w', false);
{
switch (mercStance) {
case 0:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Passive " + GetColorCode('w', false);
//status Passive
break;
case 1:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Balanced " + GetColorCode('w', false);
//status Balanced
break;
case 2:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Burn " + GetColorCode('w', false);
//status Burn
break;
default:
stringBuffer += GetColorCode('o', false) + "Stance: " + GetColorCode('g', false) + "Unknown " + GetColorCode('w', false);
break;
}
}
break;
default:
stringBuffer += GetColorCode('g', false) + "Unknown Class " + GetColorCode('w', false);
break;
}
}
}
break;
default:
stringBuffer += GetColorCode('g', false) + "Unknown" + GetColorCode('w', false);
break;
}
}
else {
stringBuffer += GetColorCode('r', false) + "It does not appear we have a merc." + GetColorCode('w', false);
}
}
else if (ci_equals(Arg, "money") || ci_equals(Arg, "plat")) {
std::string myPlat = PutCommas(std::to_string(pLocalPC->GetCurrentPcProfile()->Plat));
stringBuffer += LabeledText("Plat", myPlat);
}
else if (ci_equals(Arg, "parcel")) {
switch (GetCharInfo()->ParcelStatus) {
case ePS_HasParcels:
stringBuffer += GetColorCode('g', false) + "We have parcels!" + GetColorCode('x', false);
break;
case ePS_NoParcels:
stringBuffer += GetColorCode('t', false) + "We do not have any parcels!" + GetColorCode('x', false);
break;
case ePS_OverParcelsLimit:
stringBuffer += GetColorCode('r', false) + "We have a PARCEL OVERLOAD!" + GetColorCode('x', false);
break;
default:
break;
}
}
else if (ci_equals(Arg, "powersource")) {
if (auto powersource = GetPcProfile()->GetInventorySlot(InvSlot_PowerSource)) {
stringBuffer += LabeledText(powersource->GetName(), (powersource->Power * 100) / powersource->GetItemDefinition()->MaxPower);
stringBuffer += GetColorCode('o', true) + "%";
}
else {
stringBuffer += GetColorCode('r', false) + "No Powersource Equipped.";
}
}
else if (ci_equals(Arg, "quest") || ci_equals(Arg, "task")) {
if (NextArg[0] == '\0') { // if an Argument after quest/task wasn't made, we need to ask for one
WriteChatf("\ao[MQ2Status] \arPlease provide a valid Quest/Task Name to search for.\aw");
}
else {
stringBuffer += GetColorCode('o', false);
stringBuffer += "Quest/Task \"";
stringBuffer += GetColorCode('t', true);
stringBuffer += NextArg;
stringBuffer += GetColorCode('o', false);
stringBuffer += "\": ";
char tempTask[MAX_STRING] = "";
sprintf_s(tempTask, "${Task[%s]}", NextArg);
ParseMacroData(tempTask, MAX_STRING);
if (_stricmp(tempTask, "NULL")) {
stringBuffer += GetColorCode('g', false);
}
else {
stringBuffer += GetColorCode('r', false);
}
stringBuffer += tempTask;
}
}
else if (ci_equals(Arg, "queststep") || ci_equals(Arg, "taskstep")) {
if (NextArg[0] == '\0') { // if an Argument after quest/task wasn't made, we need to ask for one
WriteChatf("\ao[MQ2Status] \arPlease provide a valid Quest/Task Name to search for.\aw");
}
else {
char buffer[MAX_STRING] = {};
bool bFoundMatch = false;
for (int i = 0; i < MAX_SHARED_TASK_ENTRIES; ++i) {
const auto& task = pTaskManager->SharedTaskEntries[i];
auto taskStatus = pTaskManager->GetTaskStatus(pLocalPC, i, task.TaskSystem);
if (ci_find_substr(task.TaskTitle, NextArg) != -1) {
for (int j = 0; j < MAX_TASK_ELEMENTS; ++j) {
int iCurrCount = taskStatus->CurrentCounts[j];
int iReqCount = task.Elements[j].RequiredCount;
if (iCurrCount < iReqCount && !task.Elements[j].bOptional) {
pTaskManager->GetElementDescription(&task.Elements[j], buffer);
if (buffer[0]) {
stringBuffer += LabeledText(task.TaskTitle, buffer);
stringBuffer += LabeledText(" Have", iCurrCount);
stringBuffer += LabeledText(" Need", iReqCount);
bFoundMatch = true;
// We only want to report the first step we find.
//bBreak = true;
break;
}
}
}
}
}
if (!bFoundMatch) {
for (int i = 0; i < MAX_QUEST_ENTRIES; ++i) {
const auto& task = pTaskManager->QuestEntries[i];
auto taskStatus = pTaskManager->GetTaskStatus(pLocalPC, i, task.TaskSystem);
if (ci_find_substr(task.TaskTitle, NextArg) != -1) {
for (int j = 0; j < MAX_TASK_ELEMENTS; ++j) {
if (taskStatus->CurrentCounts[j] < task.Elements[j].RequiredCount && !task.Elements[j].bOptional) {
pTaskManager->GetElementDescription(&task.Elements[j], buffer);
if (buffer[0]) {
int iCurrCount = taskStatus->CurrentCounts[j];
int iReqCount = task.Elements[j].RequiredCount;
stringBuffer += LabeledText(task.TaskTitle, buffer);
stringBuffer += LabeledText(" Curr", iCurrCount);
stringBuffer += LabeledText(" Rec", iReqCount);
bFoundMatch = true;
// We only want to report the first step we find.
break;
}
}
}
}
}
}
if (!bFoundMatch) {
stringBuffer += LabeledText(NextArg, "NULL");
}
}
}
else if (ci_equals(Arg, "show")) {
bool bFound = false;
for (const auto& options : vShowClassesOptions) {
if (ci_equals(Arg2, options.first)) {
ParseBoolArg(Arg, Arg2, Arg3, options.second, "ShowPlugin");
bFound = true;
break;
}
}
if (!bFound) {
WriteChatf("\ao[MQ2Status] \arPlease provide a valid \agShow\aw option.\aw");
WriteChatf("\ao[MQ2Status] \ayImportant!\aw \agShow Plugin Off\aw will hide ALL the plugins.");
WriteChatf("\ao[MQ2Status] \ayImportant!\aw To display an individual plugin, you will need \agShow Plugin On\aw as well as the individual class plugin set to on.");
WriteChatf("\ao[MQ2Status] \arExamples: \agShow\ay Plugin, \agShow\ay Warrior, \agShow\ay Cleric, \agShow\ay Paladin, \agShow\ay Ranger, \agShow\ay Shadowknight, \agShow\ay Druid, \agShow\ay Monk, \agShow\ay Bard\aw");
WriteChatf("\ao[MQ2Status] \arExamples: \agShow\ay Rogue, \agShow\ay Shaman, \agShow\ay Necromancer, \agShow\ay Wizard, \agShow\ay Magician, \agShow\ay Enchanter, \agShow\ay Beastlord, \agShow\ay Berserker\aw");
}
}
else if (ci_equals(Arg, "skill")) {
bool bFoundMatch = false;
if (NextArg[0] == '\0') {
WriteChatf("\ao[MQ2Status] \arPlease provide a valid skill to search for.\aw");
WriteChatf("\ao[MQ2Status] \arExamples: Baking, Fishing, Jewelry Making, etc.\aw");
}
else {
for (int iSkillNum = 0; iSkillNum < NUM_SKILLS; iSkillNum++) {
if (ci_equals(NextArg, szSkills[iSkillNum])) {
if (pCharInfo2->Skill[iSkillNum] >= 0) {
stringBuffer += LabeledText(NextArg, GetAdjustedSkill(iSkillNum));
bFoundMatch = true;
break;
}
}
}
}
if (!bFoundMatch) {
WriteChatf("\ao[MQ2Status] \ay%s \arwas not found to be a valid skill.", NextArg);
return;
}
}
else if (ci_equals(Arg, "spell")) {
int iArg = GetIntFromString(NextArg, 0);
int myclass = pLocalPlayer->GetClass();
if (NextArg[0] == '\0' || iArg > pCharInfo->GetLevel()) {
WriteChatf("\ao[MQ2Status] \arPlease provide a valid spell by name or level to search for.\aw");
}
else if (!IsNumber(NextArg)) {
bool bFound = false;
// spells
for (int i = 0; i < NUM_BOOK_SLOTS; i++) {
if (pCharInfo2->SpellBook[i] != -1) {