This commit is contained in:
Kinglykrab 2025-08-20 23:02:41 -04:00
parent aba58172f4
commit 36f8c3a89f
5 changed files with 51 additions and 0 deletions

View File

@ -414,6 +414,7 @@ namespace DatabaseSchema {
"bot_spell_settings",
"bot_spells_entries",
"bot_stances",
"bot_stat_caps",
"bot_timers"
};
}

View File

@ -471,3 +471,13 @@ bool PetType::IsValid(uint8 pet_type)
{
return pet_types.find(pet_type) != pet_types.end();
}
std::string StatCap::GetName(uint8 stat_id)
{
return IsValid(stat_id) ? stat_caps[stat_id] : "UNKNOWN STAT CAP";
}
bool StatCap::IsValid(uint8 stat_id)
{
return stat_caps.find(stat_id) != stat_caps.end();
}

View File

@ -942,6 +942,34 @@ namespace StatCap {
constexpr uint8 Stat = 19;
constexpr uint8 Strikethrough = 20;
constexpr uint8 StunResist = 21;
static std::map<uint8, std::string> stat_caps = {
{ Accuracy, "Accuracy" },
{ Attack, "Attack" },
{ Avoidance, "Avoidance" },
{ Clairvoyance, "Clairvoyance" },
{ CombatEffects, "Combat Effects" },
{ DamageShield, "Damage Shield" },
{ DOTShielding, "Damage Over Time Shielding" },
{ DSMitigation, "Damage Shield Mitigation" },
{ EnduranceRegen, "Endurance Regen" },
{ ExtraDamage, "Extra Damage" },
{ Haste, "Haste" },
{ HasteV3, "Haste V3" },
{ HealAmount, "Heal Amount" },
{ HealthRegen, "Health Regen" },
{ ManaRegen, "Mana Regen" },
{ QuiverHaste, "Quiver Haste" },
{ Shielding, "Shielding" },
{ SpellDamage, "Spell Damage" },
{ SpellShielding, "Spell Shielding" },
{ Stat, "Stat" },
{ Strikethrough, "Strikethrough" },
{ StunResist, "Stun Resist" }
};
std::string GetName(uint8 stat_id);
bool IsValid(uint8 stat_id);
}
#endif /*COMMON_EMU_CONSTANTS_H*/

View File

@ -6049,6 +6049,11 @@ std::string Perl__get_pet_type_name(uint8 pet_type)
return PetType::GetName(pet_type);
}
std::string Perl__get_stat_cap_name(uint8 stat_id)
{
return StatCap::GetName(stat_id);
}
void perl_register_quest()
{
perl::interpreter perl(PERL_GET_THX);
@ -6760,6 +6765,7 @@ void perl_register_quest()
package.add("getspellstat", (int(*)(uint32, std::string))&Perl__getspellstat);
package.add("getspellstat", (int(*)(uint32, std::string, uint8))&Perl__getspellstat);
package.add("getskillname", &Perl__getskillname);
package.add("get_stat_cap_name", &Perl__get_stat_cap_name);
package.add("get_timers", &Perl__get_timers);
package.add("getlevel", &Perl__getlevel);
package.add("getplayerburiedcorpsecount", &Perl__getplayerburiedcorpsecount);

View File

@ -5711,6 +5711,11 @@ std::string lua_get_pet_type_name(uint8 pet_type)
return PetType::GetName(pet_type);
}
std::string lua_get_stat_cap_name(uint8 stat_id)
{
return StatCap::GetName(stat_id);
}
#define LuaCreateNPCParse(name, c_type, default_value) do { \
cur = table[#name]; \
if(luabind::type(cur) != LUA_TNIL) { \
@ -6526,6 +6531,7 @@ luabind::scope lua_register_general() {
luabind::def("get_timers", &lua_get_timers),
luabind::def("get_pet_command_name", &lua_get_pet_command_name),
luabind::def("get_pet_type_name", &lua_get_pet_type_name),
luabind::def("get_stat_cap_name", &lua_get_stat_cap_name),
/*
Cross Zone
*/