mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
dps estimation
This commit is contained in:
@@ -1090,7 +1090,7 @@ bool PlayerbotFactory::CanEquipItem(ItemTemplate const* proto, uint32 desiredQua
|
|||||||
else if (level < 80)
|
else if (level < 80)
|
||||||
delta = 9; // urand(2, 4);
|
delta = 9; // urand(2, 4);
|
||||||
else if (level == 80)
|
else if (level == 80)
|
||||||
delta = 2; // urand(2, 4);
|
delta = 9; // urand(2, 4);
|
||||||
|
|
||||||
if (desiredQuality > ITEM_QUALITY_NORMAL &&
|
if (desiredQuality > ITEM_QUALITY_NORMAL &&
|
||||||
(requiredLevel > level || requiredLevel < level - delta))
|
(requiredLevel > level || requiredLevel < level - delta))
|
||||||
@@ -1256,7 +1256,7 @@ void PlayerbotFactory::InitEquipment(bool incremental)
|
|||||||
else if (blevel < 80)
|
else if (blevel < 80)
|
||||||
delta = 9;
|
delta = 9;
|
||||||
else if (blevel == 80)
|
else if (blevel == 80)
|
||||||
delta = 2;
|
delta = 9;
|
||||||
|
|
||||||
for(uint8 slot = 0; slot < EQUIPMENT_SLOT_END; ++slot)
|
for(uint8 slot = 0; slot < EQUIPMENT_SLOT_END; ++slot)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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") {
|
if (master->GetSession()->GetSecurity() <= SEC_PLAYER && sPlayerbotAIConfig->autoInitOnly && cmd != "init=auto") {
|
||||||
return "The command is not allowed, use init=auto instead.";
|
return "The command is not allowed, use init=auto instead.";
|
||||||
}
|
}
|
||||||
|
int gs;
|
||||||
if (cmd == "init=white" || cmd == "init=common")
|
if (cmd == "init=white" || cmd == "init=common")
|
||||||
{
|
{
|
||||||
PlayerbotFactory factory(bot, master->getLevel(), ITEM_QUALITY_NORMAL);
|
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);
|
factory.Randomize(false);
|
||||||
return "ok, gear score limit: " + std::to_string(mixedGearScore / (ITEM_QUALITY_EPIC + 1)) + "(for epic)";
|
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")
|
if (cmd == "levelup" || cmd == "level")
|
||||||
|
|||||||
@@ -347,7 +347,7 @@ bool RandomItemMgr::CanEquipItem(BotEquipKey key, ItemTemplate const* proto)
|
|||||||
else if (level < 80)
|
else if (level < 80)
|
||||||
delta = 9; // urand(2, 4);
|
delta = 9; // urand(2, 4);
|
||||||
else if (level == 80)
|
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))
|
if (key.quality > ITEM_QUALITY_NORMAL && (requiredLevel > level || requiredLevel < level - delta))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ NextAction** BearTankDruidStrategy::getDefaultActions()
|
|||||||
void BearTankDruidStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
void BearTankDruidStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
||||||
{
|
{
|
||||||
FeralDruidStrategy::InitTriggers(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("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("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)));
|
triggers.push_back(new TriggerNode("faerie fire (feral)", NextAction::array(0, new NextAction("faerie fire (feral)", ACTION_HIGH + 7), nullptr)));
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ void MeleeCombatStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
|
|||||||
CombatStrategy::InitTriggers(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("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)));
|
// triggers.push_back(new TriggerNode("enemy too close for melee", NextAction::array(0, new NextAction("move out of enemy contact", ACTION_NORMAL + 8), nullptr)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
#include "ExpectedLifetimeValue.h"
|
#include "ExpectedLifetimeValue.h"
|
||||||
|
#include "AiFactory.h"
|
||||||
|
#include "PlayerbotAI.h"
|
||||||
#include "Playerbots.h"
|
#include "Playerbots.h"
|
||||||
#include "SharedDefines.h"
|
#include "SharedDefines.h"
|
||||||
|
|
||||||
@@ -23,22 +25,44 @@ float ExpectedGroupDpsValue::Calculate()
|
|||||||
} else {
|
} else {
|
||||||
dps_num = group->GetMembersCount() * 0.7;
|
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?
|
// efficiency record based on rare gear level, is there better calculation method?
|
||||||
float dps_efficiency = 1;
|
// float dps_efficiency = 1;
|
||||||
if (bot->GetLevel() < 30) {
|
float basic_dps;
|
||||||
dps_efficiency = 1.5;
|
int32 basic_gs;
|
||||||
} else if (bot->GetLevel() < 40) {
|
int32 level = bot->GetLevel();
|
||||||
dps_efficiency = 2;
|
|
||||||
} else if (bot->GetLevel() < 50) {
|
if (level <= 15) {
|
||||||
dps_efficiency = 3;
|
basic_dps = 5 + level * 1;
|
||||||
} else if (bot->GetLevel() < 60) {
|
} else if (level <= 30) {
|
||||||
dps_efficiency = 4;
|
basic_dps = 20 + (level - 15) * 2;
|
||||||
} else if (bot->GetLevel() < 70) {
|
} else if (level <= 40) {
|
||||||
dps_efficiency = 7;
|
basic_dps = 50 + (level - 30) * 3;
|
||||||
} else if (bot->GetLevel() < 80) {
|
} else if (level <= 55) {
|
||||||
dps_efficiency = 12;
|
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 {
|
} 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;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user