[Quest API] Add Augment Slot Type/Visible to GetItemStat (#2686)

* [Quest API] Add Augment Slot Type/Visible to GetItemStat

# Notes
- Adds the ability to get an item's augment slot types and augment slot visibility information.

* const
This commit is contained in:
Alex King 2023-01-01 11:35:15 -05:00 committed by GitHub
parent 3a4ba6f422
commit 1531650b3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 371 additions and 348 deletions

View File

@ -206,7 +206,7 @@ namespace EQ
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, float value); void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, float value);
void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, bool value); void SetCustomItemData(uint32 character_id, int16 slot_id, std::string identifier, bool value);
std::string GetCustomItemData(int16 slot_id, std::string identifier); std::string GetCustomItemData(int16 slot_id, std::string identifier);
static int GetItemStatValue(uint32 item_id, const char* identifier); static const int GetItemStatValue(uint32 item_id, std::string identifier);
protected: protected:
/////////////////////////////// ///////////////////////////////
// Protected Methods // Protected Methods

View File

@ -2412,9 +2412,9 @@ std::string Perl__get_data_remaining(std::string bucket_name)
return DataBucket::GetDataRemaining(bucket_name); return DataBucket::GetDataRemaining(bucket_name);
} }
int Perl__getitemstat(uint32 item_id, std::string stat_identifier) const int Perl__getitemstat(uint32 item_id, std::string identifier)
{ {
return quest_manager.getitemstat(item_id, stat_identifier); return quest_manager.getitemstat(item_id, identifier);
} }
int Perl__getspellstat(uint32 spell_id, std::string stat_identifier) int Perl__getspellstat(uint32 spell_id, std::string stat_identifier)

View File

@ -3871,339 +3871,362 @@ std::string EQ::InventoryProfile::GetCustomItemData(int16 slot_id, std::string i
return ""; return "";
} }
int EQ::InventoryProfile::GetItemStatValue(uint32 item_id, const char* identifier) { const int EQ::InventoryProfile::GetItemStatValue(uint32 item_id, std::string identifier) {
const EQ::ItemInstance* inst = database.CreateItem(item_id); if (identifier.empty()) {
if (!inst)
return 0; return 0;
const EQ::ItemData* item = inst->GetItem();
if (!item)
return 0;
if (!identifier)
return 0;
int32 stat = 0;
std::string id = identifier;
for(uint32 i = 0; i < id.length(); ++i) {
id[i] = tolower(id[i]);
} }
if (id == "itemclass")
stat = int32(item->ItemClass); const auto* inst = database.CreateItem(item_id);
if (id == "id") if (!inst) {
stat = int32(item->ID); return 0;
if (id == "idfile") }
stat = atoi(&item->IDFile[2]);
if (id == "weight") const auto* item = inst->GetItem();
stat = int32(item->Weight); if (!item) {
if (id == "norent") return 0;
stat = int32(item->NoRent); }
if (id == "nodrop")
stat = int32(item->NoDrop); int stat = 0;
if (id == "size")
stat = int32(item->Size); if (Strings::EqualFold(identifier, "itemclass")) {
if (id == "slots") stat = static_cast<int>(item->ItemClass);
stat = int32(item->Slots); } else if (Strings::EqualFold(identifier, "id")) {
if (id == "price") stat = static_cast<int>(item->ID);
stat = int32(item->Price); } else if (Strings::EqualFold(identifier, "idfile")) {
if (id == "icon") stat = Strings::IsNumber(&item->IDFile[2]) ? std::stoi(&item->IDFile[2]) : 0;
stat = int32(item->Icon); } else if (Strings::EqualFold(identifier, "weight")) {
if (id == "loregroup") stat = static_cast<int>(item->Weight);
stat = int32(item->LoreGroup); } else if (Strings::EqualFold(identifier, "norent")) {
if (id == "loreflag") stat = static_cast<int>(item->NoRent);
stat = int32(item->LoreFlag); } else if (Strings::EqualFold(identifier, "nodrop")) {
if (id == "pendingloreflag") stat = static_cast<int>(item->NoDrop);
stat = int32(item->PendingLoreFlag); } else if (Strings::EqualFold(identifier, "size")) {
if (id == "artifactflag") stat = static_cast<int>(item->Size);
stat = int32(item->ArtifactFlag); } else if (Strings::EqualFold(identifier, "slots")) {
if (id == "summonedflag") stat = static_cast<int>(item->Slots);
stat = int32(item->SummonedFlag); } else if (Strings::EqualFold(identifier, "price")) {
if (id == "fvnodrop") stat = static_cast<int>(item->Price);
stat = int32(item->FVNoDrop); } else if (Strings::EqualFold(identifier, "icon")) {
if (id == "favor") stat = static_cast<int>(item->Icon);
stat = int32(item->Favor); } else if (Strings::EqualFold(identifier, "loregroup")) {
if (id == "guildfavor") stat = static_cast<int>(item->LoreGroup);
stat = int32(item->GuildFavor); } else if (Strings::EqualFold(identifier, "loreflag")) {
if (id == "pointtype") stat = static_cast<int>(item->LoreFlag);
stat = int32(item->PointType); } else if (Strings::EqualFold(identifier, "pendingloreflag")) {
if (id == "bagtype") stat = static_cast<int>(item->PendingLoreFlag);
stat = int32(item->BagType); } else if (Strings::EqualFold(identifier, "artifactflag")) {
if (id == "bagslots") stat = static_cast<int>(item->ArtifactFlag);
stat = int32(item->BagSlots); } else if (Strings::EqualFold(identifier, "summonedflag")) {
if (id == "bagsize") stat = static_cast<int>(item->SummonedFlag);
stat = int32(item->BagSize); } else if (Strings::EqualFold(identifier, "fvnodrop")) {
if (id == "bagwr") stat = static_cast<int>(item->FVNoDrop);
stat = int32(item->BagWR); } else if (Strings::EqualFold(identifier, "favor")) {
if (id == "benefitflag") stat = static_cast<int>(item->Favor);
stat = int32(item->BenefitFlag); } else if (Strings::EqualFold(identifier, "guildfavor")) {
if (id == "tradeskills") stat = static_cast<int>(item->GuildFavor);
stat = int32(item->Tradeskills); } else if (Strings::EqualFold(identifier, "pointtype")) {
if (id == "cr") stat = static_cast<int>(item->PointType);
stat = int32(item->CR); } else if (Strings::EqualFold(identifier, "bagtype")) {
if (id == "dr") stat = static_cast<int>(item->BagType);
stat = int32(item->DR); } else if (Strings::EqualFold(identifier, "bagslots")) {
if (id == "pr") stat = static_cast<int>(item->BagSlots);
stat = int32(item->PR); } else if (Strings::EqualFold(identifier, "bagsize")) {
if (id == "mr") stat = static_cast<int>(item->BagSize);
stat = int32(item->MR); } else if (Strings::EqualFold(identifier, "bagwr")) {
if (id == "fr") stat = static_cast<int>(item->BagWR);
stat = int32(item->FR); } else if (Strings::EqualFold(identifier, "benefitflag")) {
if (id == "astr") stat = static_cast<int>(item->BenefitFlag);
stat = int32(item->AStr); } else if (Strings::EqualFold(identifier, "tradeskills")) {
if (id == "asta") stat = static_cast<int>(item->Tradeskills);
stat = int32(item->ASta); } else if (Strings::EqualFold(identifier, "cr")) {
if (id == "aagi") stat = static_cast<int>(item->CR);
stat = int32(item->AAgi); } else if (Strings::EqualFold(identifier, "dr")) {
if (id == "adex") stat = static_cast<int>(item->DR);
stat = int32(item->ADex); } else if (Strings::EqualFold(identifier, "pr")) {
if (id == "acha") stat = static_cast<int>(item->PR);
stat = int32(item->ACha); } else if (Strings::EqualFold(identifier, "mr")) {
if (id == "aint") stat = static_cast<int>(item->MR);
stat = int32(item->AInt); } else if (Strings::EqualFold(identifier, "fr")) {
if (id == "awis") stat = static_cast<int>(item->FR);
stat = int32(item->AWis); } else if (Strings::EqualFold(identifier, "astr")) {
if (id == "hp") stat = static_cast<int>(item->AStr);
stat = int32(item->HP); } else if (Strings::EqualFold(identifier, "asta")) {
if (id == "mana") stat = static_cast<int>(item->ASta);
stat = int32(item->Mana); } else if (Strings::EqualFold(identifier, "aagi")) {
if (id == "ac") stat = static_cast<int>(item->AAgi);
stat = int32(item->AC); } else if (Strings::EqualFold(identifier, "adex")) {
if (id == "deity") stat = static_cast<int>(item->ADex);
stat = int32(item->Deity); } else if (Strings::EqualFold(identifier, "acha")) {
if (id == "skillmodvalue") stat = static_cast<int>(item->ACha);
stat = int32(item->SkillModValue); } else if (Strings::EqualFold(identifier, "aint")) {
if (id == "skillmodtype") stat = static_cast<int>(item->AInt);
stat = int32(item->SkillModType); } else if (Strings::EqualFold(identifier, "awis")) {
if (id == "banedmgrace") stat = static_cast<int>(item->AWis);
stat = int32(item->BaneDmgRace); } else if (Strings::EqualFold(identifier, "hp")) {
if (id == "banedmgamt") stat = static_cast<int>(item->HP);
stat = int32(item->BaneDmgAmt); } else if (Strings::EqualFold(identifier, "mana")) {
if (id == "banedmgbody") stat = static_cast<int>(item->Mana);
stat = int32(item->BaneDmgBody); } else if (Strings::EqualFold(identifier, "ac")) {
if (id == "magic") stat = static_cast<int>(item->AC);
stat = int32(item->Magic); } else if (Strings::EqualFold(identifier, "deity")) {
if (id == "casttime_") stat = static_cast<int>(item->Deity);
stat = int32(item->CastTime_); } else if (Strings::EqualFold(identifier, "skillmodvalue")) {
if (id == "reqlevel") stat = static_cast<int>(item->SkillModValue);
stat = int32(item->ReqLevel); } else if (Strings::EqualFold(identifier, "skillmodtype")) {
if (id == "bardtype") stat = static_cast<int>(item->SkillModType);
stat = int32(item->BardType); } else if (Strings::EqualFold(identifier, "banedmgrace")) {
if (id == "bardvalue") stat = static_cast<int>(item->BaneDmgRace);
stat = int32(item->BardValue); } else if (Strings::EqualFold(identifier, "banedmgamt")) {
if (id == "light") stat = static_cast<int>(item->BaneDmgAmt);
stat = int32(item->Light); } else if (Strings::EqualFold(identifier, "banedmgbody")) {
if (id == "delay") stat = static_cast<int>(item->BaneDmgBody);
stat = int32(item->Delay); } else if (Strings::EqualFold(identifier, "magic")) {
if (id == "reclevel") stat = static_cast<int>(item->Magic);
stat = int32(item->RecLevel); } else if (Strings::EqualFold(identifier, "casttime_")) {
if (id == "recskill") stat = static_cast<int>(item->CastTime_);
stat = int32(item->RecSkill); } else if (Strings::EqualFold(identifier, "reqlevel")) {
if (id == "elemdmgtype") stat = static_cast<int>(item->ReqLevel);
stat = int32(item->ElemDmgType); } else if (Strings::EqualFold(identifier, "bardtype")) {
if (id == "elemdmgamt") stat = static_cast<int>(item->BardType);
stat = int32(item->ElemDmgAmt); } else if (Strings::EqualFold(identifier, "bardvalue")) {
if (id == "range") stat = static_cast<int>(item->BardValue);
stat = int32(item->Range); } else if (Strings::EqualFold(identifier, "light")) {
if (id == "damage") stat = static_cast<int>(item->Light);
stat = int32(item->Damage); } else if (Strings::EqualFold(identifier, "delay")) {
if (id == "color") stat = static_cast<int>(item->Delay);
stat = int32(item->Color); } else if (Strings::EqualFold(identifier, "reclevel")) {
if (id == "classes") stat = static_cast<int>(item->RecLevel);
stat = int32(item->Classes); } else if (Strings::EqualFold(identifier, "recskill")) {
if (id == "races") stat = static_cast<int>(item->RecSkill);
stat = int32(item->Races); } else if (Strings::EqualFold(identifier, "elemdmgtype")) {
if (id == "maxcharges") stat = static_cast<int>(item->ElemDmgType);
stat = int32(item->MaxCharges); } else if (Strings::EqualFold(identifier, "elemdmgamt")) {
if (id == "itemtype") stat = static_cast<int>(item->ElemDmgAmt);
stat = int32(item->ItemType); } else if (Strings::EqualFold(identifier, "range")) {
if (id == "material") stat = static_cast<int>(item->Range);
stat = int32(item->Material); } else if (Strings::EqualFold(identifier, "damage")) {
if (id == "casttime") stat = static_cast<int>(item->Damage);
stat = int32(item->CastTime); } else if (Strings::EqualFold(identifier, "color")) {
if (id == "elitematerial") stat = static_cast<int>(item->Color);
stat = int32(item->EliteMaterial); } else if (Strings::EqualFold(identifier, "classes")) {
if (id == "herosforgemodel") stat = static_cast<int>(item->Classes);
stat = int32(item->HerosForgeModel); } else if (Strings::EqualFold(identifier, "races")) {
if (id == "procrate") stat = static_cast<int>(item->Races);
stat = int32(item->ProcRate); } else if (Strings::EqualFold(identifier, "maxcharges")) {
if (id == "combateffects") stat = static_cast<int>(item->MaxCharges);
stat = int32(item->CombatEffects); } else if (Strings::EqualFold(identifier, "itemtype")) {
if (id == "shielding") stat = static_cast<int>(item->ItemType);
stat = int32(item->Shielding); } else if (Strings::EqualFold(identifier, "material")) {
if (id == "stunresist") stat = static_cast<int>(item->Material);
stat = int32(item->StunResist); } else if (Strings::EqualFold(identifier, "casttime")) {
if (id == "strikethrough") stat = static_cast<int>(item->CastTime);
stat = int32(item->StrikeThrough); } else if (Strings::EqualFold(identifier, "elitematerial")) {
if (id == "extradmgskill") stat = static_cast<int>(item->EliteMaterial);
stat = int32(item->ExtraDmgSkill); } else if (Strings::EqualFold(identifier, "herosforgemodel")) {
if (id == "extradmgamt") stat = static_cast<int>(item->HerosForgeModel);
stat = int32(item->ExtraDmgAmt); } else if (Strings::EqualFold(identifier, "procrate")) {
if (id == "spellshield") stat = static_cast<int>(item->ProcRate);
stat = int32(item->SpellShield); } else if (Strings::EqualFold(identifier, "combateffects")) {
if (id == "avoidance") stat = static_cast<int>(item->CombatEffects);
stat = int32(item->Avoidance); } else if (Strings::EqualFold(identifier, "shielding")) {
if (id == "accuracy") stat = static_cast<int>(item->Shielding);
stat = int32(item->Accuracy); } else if (Strings::EqualFold(identifier, "stunresist")) {
if (id == "charmfileid") stat = static_cast<int>(item->StunResist);
stat = int32(item->CharmFileID); } else if (Strings::EqualFold(identifier, "strikethrough")) {
if (id == "factionmod1") stat = static_cast<int>(item->StrikeThrough);
stat = int32(item->FactionMod1); } else if (Strings::EqualFold(identifier, "extradmgskill")) {
if (id == "factionmod2") stat = static_cast<int>(item->ExtraDmgSkill);
stat = int32(item->FactionMod2); } else if (Strings::EqualFold(identifier, "extradmgamt")) {
if (id == "factionmod3") stat = static_cast<int>(item->ExtraDmgAmt);
stat = int32(item->FactionMod3); } else if (Strings::EqualFold(identifier, "spellshield")) {
if (id == "factionmod4") stat = static_cast<int>(item->SpellShield);
stat = int32(item->FactionMod4); } else if (Strings::EqualFold(identifier, "avoidance")) {
if (id == "factionamt1") stat = static_cast<int>(item->Avoidance);
stat = int32(item->FactionAmt1); } else if (Strings::EqualFold(identifier, "accuracy")) {
if (id == "factionamt2") stat = static_cast<int>(item->Accuracy);
stat = int32(item->FactionAmt2); } else if (Strings::EqualFold(identifier, "charmfileid")) {
if (id == "factionamt3") stat = static_cast<int>(item->CharmFileID);
stat = int32(item->FactionAmt3); } else if (Strings::EqualFold(identifier, "factionmod1")) {
if (id == "factionamt4") stat = static_cast<int>(item->FactionMod1);
stat = int32(item->FactionAmt4); } else if (Strings::EqualFold(identifier, "factionmod2")) {
if (id == "augtype") stat = static_cast<int>(item->FactionMod2);
stat = int32(item->AugType); } else if (Strings::EqualFold(identifier, "factionmod3")) {
if (id == "ldontheme") stat = static_cast<int>(item->FactionMod3);
stat = int32(item->LDoNTheme); } else if (Strings::EqualFold(identifier, "factionmod4")) {
if (id == "ldonprice") stat = static_cast<int>(item->FactionMod4);
stat = int32(item->LDoNPrice); } else if (Strings::EqualFold(identifier, "factionamt1")) {
if (id == "ldonsold") stat = static_cast<int>(item->FactionAmt1);
stat = int32(item->LDoNSold); } else if (Strings::EqualFold(identifier, "factionamt2")) {
if (id == "banedmgraceamt") stat = static_cast<int>(item->FactionAmt2);
stat = int32(item->BaneDmgRaceAmt); } else if (Strings::EqualFold(identifier, "factionamt3")) {
if (id == "augrestrict") stat = static_cast<int>(item->FactionAmt3);
stat = int32(item->AugRestrict); } else if (Strings::EqualFold(identifier, "factionamt4")) {
if (id == "endur") stat = static_cast<int>(item->FactionAmt4);
stat = int32(item->Endur); } else if (Strings::EqualFold(identifier, "augtype")) {
if (id == "dotshielding") stat = static_cast<int>(item->AugType);
stat = int32(item->DotShielding); } else if (Strings::EqualFold(identifier, "ldontheme")) {
if (id == "attack") stat = static_cast<int>(item->LDoNTheme);
stat = int32(item->Attack); } else if (Strings::EqualFold(identifier, "ldonprice")) {
if (id == "regen") stat = static_cast<int>(item->LDoNPrice);
stat = int32(item->Regen); } else if (Strings::EqualFold(identifier, "ldonsold")) {
if (id == "manaregen") stat = static_cast<int>(item->LDoNSold);
stat = int32(item->ManaRegen); } else if (Strings::EqualFold(identifier, "banedmgraceamt")) {
if (id == "enduranceregen") stat = static_cast<int>(item->BaneDmgRaceAmt);
stat = int32(item->EnduranceRegen); } else if (Strings::EqualFold(identifier, "augrestrict")) {
if (id == "haste") stat = static_cast<int>(item->AugRestrict);
stat = int32(item->Haste); } else if (Strings::EqualFold(identifier, "endur")) {
if (id == "damageshield") stat = static_cast<int>(item->Endur);
stat = int32(item->DamageShield); } else if (Strings::EqualFold(identifier, "dotshielding")) {
if (id == "recastdelay") stat = static_cast<int>(item->DotShielding);
stat = int32(item->RecastDelay); } else if (Strings::EqualFold(identifier, "attack")) {
if (id == "recasttype") stat = static_cast<int>(item->Attack);
stat = int32(item->RecastType); } else if (Strings::EqualFold(identifier, "regen")) {
if (id == "augdistiller") stat = static_cast<int>(item->Regen);
stat = int32(item->AugDistiller); } else if (Strings::EqualFold(identifier, "manaregen")) {
if (id == "attuneable") stat = static_cast<int>(item->ManaRegen);
stat = int32(item->Attuneable); } else if (Strings::EqualFold(identifier, "enduranceregen")) {
if (id == "nopet") stat = static_cast<int>(item->EnduranceRegen);
stat = int32(item->NoPet); } else if (Strings::EqualFold(identifier, "haste")) {
if (id == "potionbelt") stat = static_cast<int>(item->Haste);
stat = int32(item->PotionBelt); } else if (Strings::EqualFold(identifier, "damageshield")) {
if (id == "stackable") stat = static_cast<int>(item->DamageShield);
stat = int32(item->Stackable); } else if (Strings::EqualFold(identifier, "recastdelay")) {
if (id == "notransfer") stat = static_cast<int>(item->RecastDelay);
stat = int32(item->NoTransfer); } else if (Strings::EqualFold(identifier, "recasttype")) {
if (id == "questitemflag") stat = static_cast<int>(item->RecastType);
stat = int32(item->QuestItemFlag); } else if (Strings::EqualFold(identifier, "augdistiller")) {
if (id == "stacksize") stat = static_cast<int>(item->AugDistiller);
stat = int32(item->StackSize); } else if (Strings::EqualFold(identifier, "attuneable")) {
if (id == "potionbeltslots") stat = static_cast<int>(item->Attuneable);
stat = int32(item->PotionBeltSlots); } else if (Strings::EqualFold(identifier, "nopet")) {
if (id == "book") stat = static_cast<int>(item->NoPet);
stat = int32(item->Book); } else if (Strings::EqualFold(identifier, "potionbelt")) {
if (id == "booktype") stat = static_cast<int>(item->PotionBelt);
stat = int32(item->BookType); } else if (Strings::EqualFold(identifier, "stackable")) {
if (id == "svcorruption") stat = static_cast<int>(item->Stackable);
stat = int32(item->SVCorruption); } else if (Strings::EqualFold(identifier, "notransfer")) {
if (id == "purity") stat = static_cast<int>(item->NoTransfer);
stat = int32(item->Purity); } else if (Strings::EqualFold(identifier, "questitemflag")) {
if (id == "backstabdmg") stat = static_cast<int>(item->QuestItemFlag);
stat = int32(item->BackstabDmg); } else if (Strings::EqualFold(identifier, "stacksize")) {
if (id == "dsmitigation") stat = static_cast<int>(item->StackSize);
stat = int32(item->DSMitigation); } else if (Strings::EqualFold(identifier, "potionbeltslots")) {
if (id == "heroicstr") stat = static_cast<int>(item->PotionBeltSlots);
stat = int32(item->HeroicStr); } else if (Strings::EqualFold(identifier, "book")) {
if (id == "heroicint") stat = static_cast<int>(item->Book);
stat = int32(item->HeroicInt); } else if (Strings::EqualFold(identifier, "booktype")) {
if (id == "heroicwis") stat = static_cast<int>(item->BookType);
stat = int32(item->HeroicWis); } else if (Strings::EqualFold(identifier, "svcorruption")) {
if (id == "heroicagi") stat = static_cast<int>(item->SVCorruption);
stat = int32(item->HeroicAgi); } else if (Strings::EqualFold(identifier, "purity")) {
if (id == "heroicdex") stat = static_cast<int>(item->Purity);
stat = int32(item->HeroicDex); } else if (Strings::EqualFold(identifier, "backstabdmg")) {
if (id == "heroicsta") stat = static_cast<int>(item->BackstabDmg);
stat = int32(item->HeroicSta); } else if (Strings::EqualFold(identifier, "dsmitigation")) {
if (id == "heroiccha") stat = static_cast<int>(item->DSMitigation);
stat = int32(item->HeroicCha); } else if (Strings::EqualFold(identifier, "heroicstr")) {
if (id == "heroicmr") stat = static_cast<int>(item->HeroicStr);
stat = int32(item->HeroicMR); } else if (Strings::EqualFold(identifier, "heroicint")) {
if (id == "heroicfr") stat = static_cast<int>(item->HeroicInt);
stat = int32(item->HeroicFR); } else if (Strings::EqualFold(identifier, "heroicwis")) {
if (id == "heroiccr") stat = static_cast<int>(item->HeroicWis);
stat = int32(item->HeroicCR); } else if (Strings::EqualFold(identifier, "heroicagi")) {
if (id == "heroicdr") stat = static_cast<int>(item->HeroicAgi);
stat = int32(item->HeroicDR); } else if (Strings::EqualFold(identifier, "heroicdex")) {
if (id == "heroicpr") stat = static_cast<int>(item->HeroicDex);
stat = int32(item->HeroicPR); } else if (Strings::EqualFold(identifier, "heroicsta")) {
if (id == "heroicsvcorrup") stat = static_cast<int>(item->HeroicSta);
stat = int32(item->HeroicSVCorrup); } else if (Strings::EqualFold(identifier, "heroiccha")) {
if (id == "healamt") stat = static_cast<int>(item->HeroicCha);
stat = int32(item->HealAmt); } else if (Strings::EqualFold(identifier, "heroicmr")) {
if (id == "spelldmg") stat = static_cast<int>(item->HeroicMR);
stat = int32(item->SpellDmg); } else if (Strings::EqualFold(identifier, "heroicfr")) {
if (id == "ldonsellbackrate") stat = static_cast<int>(item->HeroicFR);
stat = int32(item->LDoNSellBackRate); } else if (Strings::EqualFold(identifier, "heroiccr")) {
if (id == "scriptfileid") stat = static_cast<int>(item->HeroicCR);
stat = int32(item->ScriptFileID); } else if (Strings::EqualFold(identifier, "heroicdr")) {
if (id == "expendablearrow") stat = static_cast<int>(item->HeroicDR);
stat = int32(item->ExpendableArrow); } else if (Strings::EqualFold(identifier, "heroicpr")) {
if (id == "clairvoyance") stat = static_cast<int>(item->HeroicPR);
stat = int32(item->Clairvoyance); } else if (Strings::EqualFold(identifier, "heroicsvcorrup")) {
// Begin Effects stat = static_cast<int>(item->HeroicSVCorrup);
if (id == "clickeffect") } else if (Strings::EqualFold(identifier, "healamt")) {
stat = int32(item->Click.Effect); stat = static_cast<int>(item->HealAmt);
if (id == "clicktype") } else if (Strings::EqualFold(identifier, "spelldmg")) {
stat = int32(item->Click.Type); stat = static_cast<int>(item->SpellDmg);
if (id == "clicklevel") } else if (Strings::EqualFold(identifier, "ldonsellbackrate")) {
stat = int32(item->Click.Level); stat = static_cast<int>(item->LDoNSellBackRate);
if (id == "clicklevel2") } else if (Strings::EqualFold(identifier, "scriptfileid")) {
stat = int32(item->Click.Level2); stat = static_cast<int>(item->ScriptFileID);
if (id == "proceffect") } else if (Strings::EqualFold(identifier, "expendablearrow")) {
stat = int32(item->Proc.Effect); stat = static_cast<int>(item->ExpendableArrow);
if (id == "proctype") } else if (Strings::EqualFold(identifier, "clairvoyance")) {
stat = int32(item->Proc.Type); stat = static_cast<int>(item->Clairvoyance);
if (id == "proclevel") } else if (Strings::EqualFold(identifier, "clickeffect")) {
stat = int32(item->Proc.Level); stat = static_cast<int>(item->Click.Effect);
if (id == "proclevel2") } else if (Strings::EqualFold(identifier, "clicktype")) {
stat = int32(item->Proc.Level2); stat = static_cast<int>(item->Click.Type);
if (id == "worneffect") } else if (Strings::EqualFold(identifier, "clicklevel")) {
stat = int32(item->Worn.Effect); stat = static_cast<int>(item->Click.Level);
if (id == "worntype") } else if (Strings::EqualFold(identifier, "clicklevel2")) {
stat = int32(item->Worn.Type); stat = static_cast<int>(item->Click.Level2);
if (id == "wornlevel") } else if (Strings::EqualFold(identifier, "proceffect")) {
stat = int32(item->Worn.Level); stat = static_cast<int>(item->Proc.Effect);
if (id == "wornlevel2") } else if (Strings::EqualFold(identifier, "proctype")) {
stat = int32(item->Worn.Level2); stat = static_cast<int>(item->Proc.Type);
if (id == "focuseffect") } else if (Strings::EqualFold(identifier, "proclevel")) {
stat = int32(item->Focus.Effect); stat = static_cast<int>(item->Proc.Level);
if (id == "focustype") } else if (Strings::EqualFold(identifier, "proclevel2")) {
stat = int32(item->Focus.Type); stat = static_cast<int>(item->Proc.Level2);
if (id == "focuslevel") } else if (Strings::EqualFold(identifier, "worneffect")) {
stat = int32(item->Focus.Level); stat = static_cast<int>(item->Worn.Effect);
if (id == "focuslevel2") } else if (Strings::EqualFold(identifier, "worntype")) {
stat = int32(item->Focus.Level2); stat = static_cast<int>(item->Worn.Type);
if (id == "scrolleffect") } else if (Strings::EqualFold(identifier, "wornlevel")) {
stat = int32(item->Scroll.Effect); stat = static_cast<int>(item->Worn.Level);
if (id == "scrolltype") } else if (Strings::EqualFold(identifier, "wornlevel2")) {
stat = int32(item->Scroll.Type); stat = static_cast<int>(item->Worn.Level2);
if (id == "scrolllevel") } else if (Strings::EqualFold(identifier, "focuseffect")) {
stat = int32(item->Scroll.Level); stat = static_cast<int>(item->Focus.Effect);
if (id == "scrolllevel2") } else if (Strings::EqualFold(identifier, "focustype")) {
stat = int32(item->Scroll.Level2); stat = static_cast<int>(item->Focus.Type);
} else if (Strings::EqualFold(identifier, "focuslevel")) {
stat = static_cast<int>(item->Focus.Level);
} else if (Strings::EqualFold(identifier, "focuslevel2")) {
stat = static_cast<int>(item->Focus.Level2);
} else if (Strings::EqualFold(identifier, "scrolleffect")) {
stat = static_cast<int>(item->Scroll.Effect);
} else if (Strings::EqualFold(identifier, "scrolltype")) {
stat = static_cast<int>(item->Scroll.Type);
} else if (Strings::EqualFold(identifier, "scrolllevel")) {
stat = static_cast<int>(item->Scroll.Level);
} else if (Strings::EqualFold(identifier, "scrolllevel2")) {
stat = static_cast<int>(item->Scroll.Level2);
} else if (Strings::EqualFold(identifier, "augslot1type")) {
stat = static_cast<int>(item->AugSlotType[0]);
} else if (Strings::EqualFold(identifier, "augslot2type")) {
stat = static_cast<int>(item->AugSlotType[1]);
} else if (Strings::EqualFold(identifier, "augslot3type")) {
stat = static_cast<int>(item->AugSlotType[2]);
} else if (Strings::EqualFold(identifier, "augslot4type")) {
stat = static_cast<int>(item->AugSlotType[3]);
} else if (Strings::EqualFold(identifier, "augslot5type")) {
stat = static_cast<int>(item->AugSlotType[4]);
} else if (Strings::EqualFold(identifier, "augslot6type")) {
stat = static_cast<int>(item->AugSlotType[5]);
} else if (Strings::EqualFold(identifier, "augslot1visible")) {
stat = static_cast<int>(item->AugSlotVisible[0]);
} else if (Strings::EqualFold(identifier, "augslot2visible")) {
stat = static_cast<int>(item->AugSlotVisible[1]);
} else if (Strings::EqualFold(identifier, "augslot3visible")) {
stat = static_cast<int>(item->AugSlotVisible[2]);
} else if (Strings::EqualFold(identifier, "augslot4visible")) {
stat = static_cast<int>(item->AugSlotVisible[3]);
} else if (Strings::EqualFold(identifier, "augslot5visible")) {
stat = static_cast<int>(item->AugSlotVisible[4]);
} else if (Strings::EqualFold(identifier, "augslot6visible")) {
stat = static_cast<int>(item->AugSlotVisible[5]);
}
safe_delete(inst); safe_delete(inst);
return stat; return stat;

View File

@ -2012,8 +2012,8 @@ std::string lua_get_data_remaining(std::string bucket_name) {
return DataBucket::GetDataRemaining(bucket_name); return DataBucket::GetDataRemaining(bucket_name);
} }
int lua_get_item_stat(uint32 item_id, std::string stat_identifier) { const int lua_get_item_stat(uint32 item_id, std::string identifier) {
return quest_manager.getitemstat(item_id, stat_identifier); return quest_manager.getitemstat(item_id, identifier);
} }
int lua_get_spell_stat(uint32 spell_id, std::string stat_identifier) { int lua_get_spell_stat(uint32 spell_id, std::string stat_identifier) {

View File

@ -2213,9 +2213,9 @@ int Lua_Mob::GetWeaponDamageBonus(Lua_Item weapon, bool offhand) {
return self->GetWeaponDamageBonus(weapon, offhand); return self->GetWeaponDamageBonus(weapon, offhand);
} }
int Lua_Mob::GetItemStat(uint32 itemid, const char* identifier) { const int Lua_Mob::GetItemStat(uint32 item_id, std::string identifier) {
Lua_Safe_Call_Int(); Lua_Safe_Call_Int();
return self->GetItemStat(itemid, identifier); return self->GetItemStat(item_id, identifier);
} }
Lua_StatBonuses Lua_Mob::GetItemBonuses() Lua_StatBonuses Lua_Mob::GetItemBonuses()
@ -3090,7 +3090,7 @@ luabind::scope lua_register_mob() {
.def("GetInvul", (bool(Lua_Mob::*)(void))&Lua_Mob::GetInvul) .def("GetInvul", (bool(Lua_Mob::*)(void))&Lua_Mob::GetInvul)
.def("GetItemBonuses", &Lua_Mob::GetItemBonuses) .def("GetItemBonuses", &Lua_Mob::GetItemBonuses)
.def("GetItemHPBonuses", &Lua_Mob::GetItemHPBonuses) .def("GetItemHPBonuses", &Lua_Mob::GetItemHPBonuses)
.def("GetItemStat", (int(Lua_Mob::*)(uint32,const char*))&Lua_Mob::GetItemStat) .def("GetItemStat", &Lua_Mob::GetItemStat)
.def("GetLastName", &Lua_Mob::GetLastName) .def("GetLastName", &Lua_Mob::GetLastName)
.def("GetLevel", &Lua_Mob::GetLevel) .def("GetLevel", &Lua_Mob::GetLevel)
.def("GetLevelCon", (uint32(Lua_Mob::*)(int))&Lua_Mob::GetLevelCon) .def("GetLevelCon", (uint32(Lua_Mob::*)(int))&Lua_Mob::GetLevelCon)

View File

@ -452,7 +452,7 @@ public:
bool IsAmnesiad(); bool IsAmnesiad();
int32 GetMeleeMitigation(); int32 GetMeleeMitigation();
int GetWeaponDamageBonus(Lua_Item weapon, bool offhand); int GetWeaponDamageBonus(Lua_Item weapon, bool offhand);
int GetItemStat(uint32 itemid, const char* identifier); const int GetItemStat(uint32 item_id, std::string identifier);
Lua_StatBonuses GetItemBonuses(); Lua_StatBonuses GetItemBonuses();
Lua_StatBonuses GetSpellBonuses(); Lua_StatBonuses GetSpellBonuses();
Lua_StatBonuses GetAABonuses(); Lua_StatBonuses GetAABonuses();

View File

@ -4971,9 +4971,9 @@ void Mob::TrySympatheticProc(Mob *target, uint32 spell_id)
CheckNumHitsRemaining(NumHit::MatchingSpells, -1, focus_spell); CheckNumHitsRemaining(NumHit::MatchingSpells, -1, focus_spell);
} }
int32 Mob::GetItemStat(uint32 itemid, const char *identifier) const int Mob::GetItemStat(uint32 item_id, std::string identifier)
{ {
return EQ::InventoryProfile::GetItemStatValue(itemid, identifier); return EQ::InventoryProfile::GetItemStatValue(item_id, identifier);
} }
std::string Mob::GetGlobal(const char *varname) { std::string Mob::GetGlobal(const char *varname) {

View File

@ -876,7 +876,7 @@ public:
void Shout(const char *format, ...); void Shout(const char *format, ...);
void Emote(const char *format, ...); void Emote(const char *format, ...);
void QuestJournalledSay(Client *QuestInitiator, const char *str, Journal::Options &opts); void QuestJournalledSay(Client *QuestInitiator, const char *str, Journal::Options &opts);
int32 GetItemStat(uint32 itemid, const char *identifier); const int GetItemStat(uint32 item_id, std::string identifier);
int64 CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, bool best_focus=false, uint16 casterid = 0, Mob *caster = nullptr); int64 CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, bool best_focus=false, uint16 casterid = 0, Mob *caster = nullptr);
uint8 IsFocusEffect(uint16 spellid, int effect_index, bool AA=false,uint32 aa_effect=0); uint8 IsFocusEffect(uint16 spellid, int effect_index, bool AA=false,uint32 aa_effect=0);

View File

@ -1908,9 +1908,9 @@ void Perl_Mob_TempName(Mob* self, const char* name) // @categories Script Utilit
self->TempName(name); self->TempName(name);
} }
int Perl_Mob_GetItemStat(Mob* self, uint32 item_id, const char* stat) // @categories Inventory and Items, Stats and Attributes const int Perl_Mob_GetItemStat(Mob* self, uint32 item_id, std::string identifier) // @categories Inventory and Items, Stats and Attributes
{ {
return self->GetItemStat(item_id, stat); return self->GetItemStat(item_id, identifier);
} }
std::string Perl_Mob_GetGlobal(Mob* self, const char* varname) std::string Perl_Mob_GetGlobal(Mob* self, const char* varname)

View File

@ -3633,9 +3633,9 @@ std::string QuestManager::getinventoryslotname(int16 slot_id) {
return EQ::invslot::GetInvPossessionsSlotName(slot_id); return EQ::invslot::GetInvPossessionsSlotName(slot_id);
} }
int QuestManager::getitemstat(uint32 item_id, std::string stat_identifier) { const int QuestManager::getitemstat(uint32 item_id, std::string stat_identifier) {
QuestManagerCurrentQuestVars(); QuestManagerCurrentQuestVars();
return EQ::InventoryProfile::GetItemStatValue(item_id, stat_identifier.c_str()); return EQ::InventoryProfile::GetItemStatValue(item_id, stat_identifier);
} }
int QuestManager::getspellstat(uint32 spell_id, std::string stat_identifier, uint8 slot) { int QuestManager::getspellstat(uint32 spell_id, std::string stat_identifier, uint8 slot) {

View File

@ -337,7 +337,7 @@ public:
std::string getgendername(uint32 gender_id); std::string getgendername(uint32 gender_id);
std::string getdeityname(uint32 deity_id); std::string getdeityname(uint32 deity_id);
std::string getinventoryslotname(int16 slot_id); std::string getinventoryslotname(int16 slot_id);
int getitemstat(uint32 item_id, std::string stat_identifier); const int getitemstat(uint32 item_id, std::string stat_identifier);
int getspellstat(uint32 spell_id, std::string stat_identifier, uint8 slot = 0); int getspellstat(uint32 spell_id, std::string stat_identifier, uint8 slot = 0);
const SPDat_Spell_Struct *getspell(uint32 spell_id); const SPDat_Spell_Struct *getspell(uint32 spell_id);
std::string getenvironmentaldamagename(uint8 damage_type); std::string getenvironmentaldamagename(uint8 damage_type);