Skip to content

Commit

Permalink
Merge pull request liyunfan1223#538 from liyunfan1223/disable_test_items
Browse files Browse the repository at this point in the history
Disable test items (and gems)
  • Loading branch information
liyunfan1223 authored Sep 21, 2024
2 parents ef4064c + 68bf09c commit 2cb6f14
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 14 deletions.
9 changes: 0 additions & 9 deletions src/RandomItemMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -967,15 +967,6 @@ void RandomItemMgr::BuildItemInfoCache()
if (!proto)
continue;

// skip non armor/weapon
if (proto->Class != ITEM_CLASS_WEAPON && proto->Class != ITEM_CLASS_ARMOR &&
proto->Class != ITEM_CLASS_CONTAINER && proto->Class != ITEM_CLASS_PROJECTILE &&
proto->Class != ITEM_CLASS_GEM)
continue;

// if (!CanEquipItemNew(proto))
// continue;

// skip test items
if (strstr(proto->Name1.c_str(), "(Test)") || strstr(proto->Name1.c_str(), "(TEST)") ||
strstr(proto->Name1.c_str(), "(test)") || strstr(proto->Name1.c_str(), "(JEFFTEST)") ||
Expand Down
7 changes: 4 additions & 3 deletions src/factory/PlayerbotFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ void PlayerbotFactory::Init()
if (id == 47181 || id == 50358 || id == 47242 || id == 52639 || id == 47147 || id == 7218) // Test Enchant
continue;

if (strstr(spellInfo->SpellName[0], "Test"))
continue;

uint32 requiredLevel = spellInfo->BaseLevel;

for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j)
Expand All @@ -137,8 +134,11 @@ void PlayerbotFactory::Init()
// SpellInfo const* enchantSpell = sSpellMgr->GetSpellInfo(enchant->spellid[0]);
// if (!enchantSpell)
// continue;
if (strstr(spellInfo->SpellName[0], "Test"))
break;

enchantSpellIdCache.push_back(id);
break;
// LOG_INFO("playerbots", "Add {} to enchantment spells", id);
}
}
Expand All @@ -161,6 +161,7 @@ void PlayerbotFactory::Init()
}
if (sRandomItemMgr->IsTestItem(gemId))
continue;

if (!proto || !sGemPropertiesStore.LookupEntry(proto->GemProperties))
{
continue;
Expand Down
16 changes: 16 additions & 0 deletions src/factory/StatsCollector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ bool StatsCollector::SpecialSpellFilter(uint32 spellId) {
// trinket
switch (spellId)
{
case 27521: // Insightful Earthstorm Diamond
stats[STATS_TYPE_MANA_REGENERATION] += 20;
return true;
case 55381: // Insightful Earthsiege Diamond
stats[STATS_TYPE_MANA_REGENERATION] += 40;
return true;
case 39442: // Darkmoon Card: Wrath
if (type_ != CollectorType::SPELL_HEAL)
stats[STATS_TYPE_CRIT] += 50;
Expand Down Expand Up @@ -669,6 +675,16 @@ void StatsCollector::HandleApplyAura(const SpellEffectInfo& effectInfo, float mu
CollectSpellStats(effectInfo.TriggerSpell, multiplier, triggerCooldown);
break;
}
case SPELL_AURA_MOD_CRIT_DAMAGE_BONUS:
{
if (type_ != CollectorType::SPELL_HEAL)
{
int32 statType = effectInfo.MiscValue;
if (statType & SPELL_SCHOOL_MASK_NORMAL) // physical
stats[STATS_TYPE_CRIT] += 30 * val * multiplier;
}
break;
}
default:
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/strategy/actions/MovementActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1893,7 +1893,7 @@ bool AvoidAoeAction::AvoidGameObjectWithDamage()
continue;
}

float radius = (float)goInfo->trap.diameter / 2;
float radius = (float)goInfo->trap.diameter / 2 + go->GetCombatReach();
if (!radius || radius > sPlayerbotAIConfig->maxAoeAvoidRadius)
continue;
// for (int i = 0; i < MAX_SPELL_EFFECTS; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/strategy/values/Formations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ WorldLocation MoveFormation::MoveSingleLine(std::vector<Player*> line, float dif
float lz = cz;

Player* master = botAI->GetMaster();
if (!master->GetMap()->CheckCollisionAndGetValidCoords(
if (!master || !master->GetMap()->CheckCollisionAndGetValidCoords(
master, master->GetPositionX(), master->GetPositionY(), master->GetPositionZ(), lx, ly, lz))
{
lx = x + cos(angle) * radius;
Expand Down

0 comments on commit 2cb6f14

Please sign in to comment.