mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-03-16 13:55:08 +00:00
Refactor of EquipActions (#1994)
#PR Description The root cause of issue #1987 was the AI Value item usage becoming a very expensive call when bots gained professions accidentally. My original approach was to eliminate it entirely, but after inputs and testing I decided to introduce a more focused Ai value "Item upgrade" that only checks equipment and ammo inheriting directly from item usage, so the logic is unified between them. Upgrades are now only assessed when receiving an item that can be equipped. Additionally, I noticed that winning loot rolls did not trigger the upgrade action, so I added a new package handler for that. Performance needs to be re-evaluated, but I expect a reduction in calls and in the cost of each call. I tested with bots and selfbot in deadmines and ahadowfang keep. --------- Co-authored-by: bashermens <31279994+hermensbas@users.noreply.github.com>
This commit is contained in:
@@ -46,6 +46,7 @@ public:
|
||||
creators["questgiver quest details"] = &WorldPacketTriggerContext::questgiver_quest_details;
|
||||
|
||||
creators["item push result"] = &WorldPacketTriggerContext::item_push_result;
|
||||
creators["loot roll won"] = &WorldPacketTriggerContext::loot_roll_won;
|
||||
creators["party command"] = &WorldPacketTriggerContext::party_command;
|
||||
creators["taxi done"] = &WorldPacketTriggerContext::taxi_done;
|
||||
creators["cast failed"] = &WorldPacketTriggerContext::cast_failed;
|
||||
@@ -92,6 +93,7 @@ private:
|
||||
static Trigger* taxi_done(PlayerbotAI* botAI) { return new WorldPacketTrigger(botAI, "taxi done"); }
|
||||
static Trigger* party_command(PlayerbotAI* botAI) { return new WorldPacketTrigger(botAI, "party command"); }
|
||||
static Trigger* item_push_result(PlayerbotAI* botAI) { return new WorldPacketTrigger(botAI, "item push result"); }
|
||||
static Trigger* loot_roll_won(PlayerbotAI* botAI) { return new WorldPacketTrigger(botAI, "loot roll won"); }
|
||||
|
||||
// quest
|
||||
static Trigger* quest_update_add_kill(PlayerbotAI* ai) { return new WorldPacketTrigger(ai, "quest update add kill"); }
|
||||
|
||||
Reference in New Issue
Block a user