[Commands] Overhauled #npcedit. (#1538)

* [Commands] Overhauled #npcedit.
- Added missing columns like untargetable, show_name, exp_mod, etc.
- Put stats in order of column appearance in table within help message and within code.
- Converted StringFormat to fmt::format.
- Added a GetGenderName() helper method.
- Prettified response messages of nearly every #npcedit option.

All tested and ready to go.

Would like input about possibly changing some of the command arguments to match the table column names more closely, example being "spell" should be "npc_spells_id".

* Cleanup.

* Fix indentation.
This commit is contained in:
Kinglykrab 2021-09-19 19:32:21 -04:00 committed by GitHub
parent 6a5face0aa
commit c0de178173
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 808 additions and 646 deletions

View File

@ -2232,3 +2232,15 @@ bool PlayerAppearance::IsValidWoad(uint16 race_id, uint8 gender_id, uint8 woad_v
}
return false;
}
const char* GetGenderName(uint32 gender_id) {
const char* gender_name = "Unknown";
if (gender_id == MALE) {
gender_name = "Male";
} else if (gender_id == FEMALE) {
gender_name = "Female";
} else if (gender_id == NEUTER) {
gender_name = "Neuter";
}
return gender_name;
}

View File

@ -851,6 +851,7 @@
const char* GetRaceIDName(uint16 race_id);
const char* GetPlayerRaceName(uint32 player_race_value);
const char* GetGenderName(uint32 gender_id);
uint32 GetPlayerRaceValue(uint16 race_id);
uint32 GetPlayerRaceBit(uint16 race_id);

File diff suppressed because it is too large Load Diff

View File

@ -3439,14 +3439,7 @@ void QuestManager::SetEXPModifierByCharID(uint32 character_id, uint32 zone_id, d
}
std::string QuestManager::getgendername(uint32 gender_id) {
auto gender_name = "Unknown";
if (gender_id == MALE) {
gender_name = "Male";
} else if (gender_id == FEMALE) {
gender_name = "Female";
} else if (gender_id == NEUTER) {
gender_name = "Neuter";
}
std::string gender_name = GetGenderName(gender_id);
return gender_name;
}