diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index 0586ea7c..57735710 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -1090,7 +1090,7 @@ bool PlayerbotFactory::CanEquipItem(ItemTemplate const* proto, uint32 desiredQua else if (level < 80) delta = 9; // urand(2, 4); else if (level == 80) - delta = 2; // urand(2, 4); + delta = 9; // urand(2, 4); if (desiredQuality > ITEM_QUALITY_NORMAL && (requiredLevel > level || requiredLevel < level - delta)) @@ -1256,7 +1256,7 @@ void PlayerbotFactory::InitEquipment(bool incremental) else if (blevel < 80) delta = 9; else if (blevel == 80) - delta = 2; + delta = 9; for(uint8 slot = 0; slot < EQUIPMENT_SLOT_END; ++slot) { diff --git a/src/PlayerbotMgr.cpp b/src/PlayerbotMgr.cpp index 7440ccc3..9c82eeea 100644 --- a/src/PlayerbotMgr.cpp +++ b/src/PlayerbotMgr.cpp @@ -551,6 +551,7 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje if (master->GetSession()->GetSecurity() <= SEC_PLAYER && sPlayerbotAIConfig->autoInitOnly && cmd != "init=auto") { return "The command is not allowed, use init=auto instead."; } + int gs; if (cmd == "init=white" || cmd == "init=common") { PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_NORMAL); @@ -588,6 +589,13 @@ std::string const PlayerbotHolder::ProcessBotCommand(std::string const cmd, Obje factory.Randomize(false); return "ok, gear score limit: " + std::to_string(mixedGearScore / (ITEM_QUALITY_EPIC + 1)) + "(for epic)"; } + else if (cmd.starts_with("init=") && sscanf(cmd.c_str(), "init=%d", &gs) != -1) + { + // uint32 mixedGearScore = PlayerbotAI::GetMixedGearScore(master, false, false, 12) * sPlayerbotAIConfig->autoInitEquipLevelLimitRatio; + PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_LEGENDARY, gs); + factory.Randomize(false); + return "ok, gear score limit: " + std::to_string(gs / (ITEM_QUALITY_EPIC + 1)) + "(for epic)"; + } } if (cmd == "levelup" || cmd == "level") diff --git a/src/RandomItemMgr.cpp b/src/RandomItemMgr.cpp index 653664ca..502fce09 100644 --- a/src/RandomItemMgr.cpp +++ b/src/RandomItemMgr.cpp @@ -347,7 +347,7 @@ bool RandomItemMgr::CanEquipItem(BotEquipKey key, ItemTemplate const* proto) else if (level < 80) delta = 9; // urand(2, 4); else if (level == 80) - delta = 2; // urand(2, 4); + delta = 9; // urand(2, 4); if (key.quality > ITEM_QUALITY_NORMAL && (requiredLevel > level || requiredLevel < level - delta)) return false; diff --git a/src/strategy/druid/BearTankDruidStrategy.cpp b/src/strategy/druid/BearTankDruidStrategy.cpp index ce06a066..7f0ed5bf 100644 --- a/src/strategy/druid/BearTankDruidStrategy.cpp +++ b/src/strategy/druid/BearTankDruidStrategy.cpp @@ -152,7 +152,7 @@ NextAction** BearTankDruidStrategy::getDefaultActions() void BearTankDruidStrategy::InitTriggers(std::vector &triggers) { FeralDruidStrategy::InitTriggers(triggers); - triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("feral charge - bear", ACTION_MOVE + 8), nullptr))); + triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("feral charge - bear", ACTION_NORMAL + 8), nullptr))); triggers.push_back(new TriggerNode("thorns", NextAction::array(0, new NextAction("thorns", ACTION_HIGH + 9), nullptr))); triggers.push_back(new TriggerNode("bear form", NextAction::array(0, new NextAction("dire bear form", ACTION_HIGH + 8), nullptr))); triggers.push_back(new TriggerNode("faerie fire (feral)", NextAction::array(0, new NextAction("faerie fire (feral)", ACTION_HIGH + 7), nullptr))); diff --git a/src/strategy/generic/MeleeCombatStrategy.cpp b/src/strategy/generic/MeleeCombatStrategy.cpp index baf7062d..179d3621 100644 --- a/src/strategy/generic/MeleeCombatStrategy.cpp +++ b/src/strategy/generic/MeleeCombatStrategy.cpp @@ -10,7 +10,7 @@ void MeleeCombatStrategy::InitTriggers(std::vector &triggers) CombatStrategy::InitTriggers(triggers); // triggers.push_back(new TriggerNode("not facing target", NextAction::array(0, new NextAction("set facing", ACTION_MOVE + 7), nullptr))); - triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("reach melee", ACTION_MOVE + 8), nullptr))); + triggers.push_back(new TriggerNode("enemy out of melee", NextAction::array(0, new NextAction("reach melee", ACTION_NORMAL + 8), nullptr))); // triggers.push_back(new TriggerNode("enemy too close for melee", NextAction::array(0, new NextAction("move out of enemy contact", ACTION_NORMAL + 8), nullptr))); } diff --git a/src/strategy/values/ExpectedLifetimeValue.cpp b/src/strategy/values/ExpectedLifetimeValue.cpp index 2e41b10c..3518af2e 100644 --- a/src/strategy/values/ExpectedLifetimeValue.cpp +++ b/src/strategy/values/ExpectedLifetimeValue.cpp @@ -1,4 +1,6 @@ #include "ExpectedLifetimeValue.h" +#include "AiFactory.h" +#include "PlayerbotAI.h" #include "Playerbots.h" #include "SharedDefines.h" @@ -23,22 +25,44 @@ float ExpectedGroupDpsValue::Calculate() } else { dps_num = group->GetMembersCount() * 0.7; } + uint32 mixedGearScore = PlayerbotAI::GetMixedGearScore(bot, false, false, 12); // efficiency record based on rare gear level, is there better calculation method? - float dps_efficiency = 1; - if (bot->GetLevel() < 30) { - dps_efficiency = 1.5; - } else if (bot->GetLevel() < 40) { - dps_efficiency = 2; - } else if (bot->GetLevel() < 50) { - dps_efficiency = 3; - } else if (bot->GetLevel() < 60) { - dps_efficiency = 4; - } else if (bot->GetLevel() < 70) { - dps_efficiency = 7; - } else if (bot->GetLevel() < 80) { - dps_efficiency = 12; + // float dps_efficiency = 1; + float basic_dps; + int32 basic_gs; + int32 level = bot->GetLevel(); + + if (level <= 15) { + basic_dps = 5 + level * 1; + } else if (level <= 30) { + basic_dps = 20 + (level - 15) * 2; + } else if (level <= 40) { + basic_dps = 50 + (level - 30) * 3; + } else if (level <= 55) { + basic_dps = 80 + (level - 45) * 8; + } else if (level <= 60) { + basic_dps = 200 + (level - 55) * 30; + } else if (level <= 70) { + basic_dps = 350 + (level - 60) * 40; } else { - dps_efficiency = 25; + basic_dps = 750 + (level - 70) * 100; } - return dps_num * bot->GetLevel() * dps_efficiency; + + if (level <= 8) { + basic_gs = (level + 5) * 2; + } else if (level <= 15) { + basic_gs = (level + 5) * 3; + } else if (level <= 60) { + basic_gs = (level + 5) * 4; + } else if (level <= 70) { + basic_gs = (85 + (level - 60) * 3) * 4; + } else if (level <= 80) { + basic_gs = (155 + (level - 70) * 4) * 4; + } + + float gs_modifier = (float)mixedGearScore / basic_gs; + if (gs_modifier < 0.5) gs_modifier = 0.5; + if (gs_modifier > 3) gs_modifier = 3; + + return dps_num * basic_dps * gs_modifier; } \ No newline at end of file