From 55a37c48eb61f95bc2da5be3387aa6e3e2cfde62 Mon Sep 17 00:00:00 2001 From: Wishmaster117 <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 00:15:46 +0200 Subject: [PATCH 01/15] Add /w botname "glyphs" and "glyph equip" commands --- src/factory/PlayerbotFactory.cpp | 4 + src/strategy/AiObjectContext.h | 1 + src/strategy/actions/ChangeTalentsAction.cpp | 9 + src/strategy/actions/ChatActionContext.h | 6 + src/strategy/actions/EquipGlyphsAction.cpp | 159 ++++++++++++++++++ src/strategy/actions/EquipGlyphsAction.h | 37 ++++ src/strategy/actions/TellGlyphsAction.cpp | 113 +++++++++++++ src/strategy/actions/TellGlyphsAction.h | 21 +++ .../generic/ChatCommandHandlerStrategy.cpp | 4 + src/strategy/triggers/ChatTriggerContext.h | 4 + src/strategy/values/ValueContext.h | 8 + 11 files changed, 366 insertions(+) create mode 100644 src/strategy/actions/EquipGlyphsAction.cpp create mode 100644 src/strategy/actions/EquipGlyphsAction.h create mode 100644 src/strategy/actions/TellGlyphsAction.cpp create mode 100644 src/strategy/actions/TellGlyphsAction.h diff --git a/src/factory/PlayerbotFactory.cpp b/src/factory/PlayerbotFactory.cpp index 02e47b21..b43ee055 100644 --- a/src/factory/PlayerbotFactory.cpp +++ b/src/factory/PlayerbotFactory.cpp @@ -39,6 +39,7 @@ #include "SpellAuraDefines.h" #include "StatsWeightCalculator.h" #include "World.h" +#include "AiObjectContext.h" const uint64 diveMask = (1LL << 7) | (1LL << 44) | (1LL << 37) | (1LL << 38) | (1LL << 26) | (1LL << 30) | (1LL << 27) | (1LL << 33) | (1LL << 24) | (1LL << 34); @@ -3330,6 +3331,9 @@ void PlayerbotFactory::InitReagents() void PlayerbotFactory::InitGlyphs(bool increment) { bot->InitGlyphsForLevel(); + if (!increment && + botAI->GetAiObjectContext()->GetValue("custom_glyphs")->Get()) + return; // // Added for custom Glyphs - custom glyphs flag test if (!increment) { diff --git a/src/strategy/AiObjectContext.h b/src/strategy/AiObjectContext.h index cfa7d4db..c65ad8ae 100644 --- a/src/strategy/AiObjectContext.h +++ b/src/strategy/AiObjectContext.h @@ -27,6 +27,7 @@ typedef UntypedValue* (*ValueCreator)(PlayerbotAI* botAI); class AiObjectContext : public PlayerbotAIAware { public: + static BoolCalculatedValue* custom_glyphs(PlayerbotAI* ai); // Added for cutom glyphs AiObjectContext(PlayerbotAI* botAI, SharedNamedObjectContextList& sharedStrategyContext = sharedStrategyContexts, SharedNamedObjectContextList& sharedActionContext = sharedActionContexts, diff --git a/src/strategy/actions/ChangeTalentsAction.cpp b/src/strategy/actions/ChangeTalentsAction.cpp index 33931d92..65634162 100644 --- a/src/strategy/actions/ChangeTalentsAction.cpp +++ b/src/strategy/actions/ChangeTalentsAction.cpp @@ -11,9 +11,18 @@ #include "PlayerbotAIConfig.h" #include "PlayerbotFactory.h" #include "Playerbots.h" +#include "AiObjectContext.h" +#include "Log.h" bool ChangeTalentsAction::Execute(Event event) { + auto* flag = botAI->GetAiObjectContext()->GetValue("custom_glyphs"); // Added for custom Glyphs + + if (flag->Get()) // Added for custom Glyphs + { + flag->Set(false); + LOG_INFO("playerbots", "Custom Glyph Flag set to OFF"); + } std::string param = event.getParam(); std::ostringstream out; diff --git a/src/strategy/actions/ChatActionContext.h b/src/strategy/actions/ChatActionContext.h index f0a8d3f7..bc111ac6 100644 --- a/src/strategy/actions/ChatActionContext.h +++ b/src/strategy/actions/ChatActionContext.h @@ -79,6 +79,8 @@ #include "UnlockItemAction.h" #include "UnlockTradedItemAction.h" #include "PetAction.h" +#include "TellGlyphsAction.h" +#include "EquipGlyphsAction.h" class ChatActionContext : public NamedObjectContext { @@ -189,6 +191,8 @@ public: creators["calc"] = &ChatActionContext::calc; creators["wipe"] = &ChatActionContext::wipe; creators["pet"] = &ChatActionContext::pet; + creators["glyphs"] = &ChatActionContext::glyphs; // Added for custom Glyphs + creators["glyph equip"] = &ChatActionContext::glyph_equip; // Added for custom Glyphs } private: @@ -296,6 +300,8 @@ private: static Action* calc(PlayerbotAI* ai) { return new TellCalculateItemAction(ai); } static Action* wipe(PlayerbotAI* ai) { return new WipeAction(ai); } static Action* pet(PlayerbotAI* botAI) { return new PetAction(botAI); } + static Action* glyphs(PlayerbotAI* botAI) { return new TellGlyphsAction(botAI); } // Added for custom Glyphs + static Action* glyph_equip(PlayerbotAI* ai) { return new EquipGlyphsAction(ai); } // Added for custom Glyphs }; #endif diff --git a/src/strategy/actions/EquipGlyphsAction.cpp b/src/strategy/actions/EquipGlyphsAction.cpp new file mode 100644 index 00000000..4c7ac14d --- /dev/null +++ b/src/strategy/actions/EquipGlyphsAction.cpp @@ -0,0 +1,159 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license, you may redistribute it + * and/or modify it under version 2 of the License, or (at your option), any later version. + */ + +#include "EquipGlyphsAction.h" + +#include "Playerbots.h" +#include "ObjectMgr.h" +#include "SpellMgr.h" +#include "DBCStores.h" +#include "AiObjectContext.h" +#include "Log.h" + +#include +#include +#include + +namespace +{ + // itemId -> GlyphInfo + std::unordered_map s_GlyphCache; +} + +void EquipGlyphsAction::BuildGlyphCache() +{ + if (!s_GlyphCache.empty()) + return; + + ItemTemplateContainer const* store = sObjectMgr->GetItemTemplateStore(); + + for (auto const& kv : *store) + { + uint32 itemId = kv.first; + ItemTemplate const* proto = &kv.second; + if (!proto || proto->Class != ITEM_CLASS_GLYPH) + continue; + + // inspect item spell + for (uint32 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) + { + uint32 spellId = proto->Spells[i].SpellId; + if (!spellId) continue; + + SpellInfo const* si = sSpellMgr->GetSpellInfo(spellId); + if (!si) continue; + + for (uint8 eff = 0; eff <= EFFECT_2; ++eff) + { + if (si->Effects[eff].Effect != SPELL_EFFECT_APPLY_GLYPH) + continue; + + uint32 glyphId = si->Effects[eff].MiscValue; + if (!glyphId) continue; + + if (auto const* gp = sGlyphPropertiesStore.LookupEntry(glyphId)) + s_GlyphCache[itemId] = {gp, proto}; + } + } + } +} + +EquipGlyphsAction::GlyphInfo const* EquipGlyphsAction::GetGlyphInfo(uint32 itemId) +{ + BuildGlyphCache(); + auto it = s_GlyphCache.find(itemId); + return (it == s_GlyphCache.end()) ? nullptr : &it->second; +} + +/// ----------------------------------------------------------------- +/// Validation and collect +/// ----------------------------------------------------------------- +bool EquipGlyphsAction::CollectGlyphs(std::vector const& itemIds, + std::vector& out) const +{ + std::unordered_set seen; + + for (uint32 itemId : itemIds) + { + if (!seen.insert(itemId).second) + return false; // double + + auto const* info = GetGlyphInfo(itemId); + if (!info) // no good glyph + return false; + + // check class by AllowableClass + if ((info->proto->AllowableClass & bot->getClassMask()) == 0) + return false; + + out.push_back(info); + } + return out.size() <= 6 && !out.empty(); +} + +/// ----------------------------------------------------------------- +/// Action +/// ----------------------------------------------------------------- +bool EquipGlyphsAction::Execute(Event event) +{ + // 1) parse IDs + std::vector itemIds; + std::istringstream iss(event.getParam()); + for (uint32 id; iss >> id; ) itemIds.push_back(id); + + std::vector glyphs; + if (!CollectGlyphs(itemIds, glyphs)) + { + botAI->TellMaster("glyph equip : liste invalide (IDs items glyphes de ta classe, max 6)."); + return false; + } + + // 2) prepare a empty slots table ? + bool used[6] = {false,false,false,false,false,false}; + + // 3) for each glyph, find the first available and compatible socket + for (auto const* g : glyphs) + { + bool placed = false; + + for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i) + { + if (used[i]) continue; + + uint32 slotId = bot->GetGlyphSlot(i); + auto const* gs = sGlyphSlotStore.LookupEntry(slotId); + if (!gs || gs->TypeFlags != g->prop->TypeFlags) + continue; // major/minor don't match + + // Remove aura if exist + uint32 cur = bot->GetGlyph(i); + if (cur) + if (auto* old = sGlyphPropertiesStore.LookupEntry(cur)) + bot->RemoveAurasDueToSpell(old->SpellId); + + // Apply new one + bot->CastSpell(bot, g->prop->SpellId, true); + bot->SetGlyph(i, g->prop->Id, true); + + used[i] = true; + placed = true; + break; + } + + if (!placed) + { + botAI->TellMaster("Not enought empty sockets for all glyphs."); + return false; + } + } + + botAI->TellMaster("Glyphs updated."); + + // Flag to custom glyphs + botAI->GetAiObjectContext()->GetValue("custom_glyphs")->Set(true); + LOG_INFO("playerbots", "Custom Glyph Flag set to ON"); + + return true; +} diff --git a/src/strategy/actions/EquipGlyphsAction.h b/src/strategy/actions/EquipGlyphsAction.h new file mode 100644 index 00000000..9206915e --- /dev/null +++ b/src/strategy/actions/EquipGlyphsAction.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license, you may redistribute it + * and/or modify it under version 2 of the License, or (at your option), any later version. + */ + +#ifndef _PLAYERBOT_EQUIPGLYPHSACTION_H +#define _PLAYERBOT_EQUIPGLYPHSACTION_H + +#include "Action.h" + +// 1 = major, 2 = minor dans GlyphProperties.dbc +enum class GlyphKind : uint32 { MAJOR = 1, MINOR = 2 }; + +class EquipGlyphsAction : public Action +{ +public: + EquipGlyphsAction(PlayerbotAI* ai) : Action(ai, "glyph equip") {} + bool Execute(Event event) override; + + /// ---- Rendu public pour être utilisable par le cache global ---- + struct GlyphInfo + { + GlyphPropertiesEntry const* prop; ///< entrée GlyphProperties.dbc + ItemTemplate const* proto; ///< template de l’objet glyphe + }; + +private: + /// Construit la cache {itemId -> GlyphInfo} + static void BuildGlyphCache(); + static GlyphInfo const* GetGlyphInfo(uint32 itemId); + + /// Parse & valide la liste d’items glyphes + bool CollectGlyphs(std::vector const& itemIds, + std::vector& out) const; +}; + +#endif diff --git a/src/strategy/actions/TellGlyphsAction.cpp b/src/strategy/actions/TellGlyphsAction.cpp new file mode 100644 index 00000000..3f48dbd8 --- /dev/null +++ b/src/strategy/actions/TellGlyphsAction.cpp @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license, you may redistribute it + * and/or modify it under version 2 of the License, or (at your option), any later version. + */ + +#include "TellGlyphsAction.h" + +#include "Event.h" +#include "Playerbots.h" + +#include "ObjectMgr.h" +#include "SpellMgr.h" +#include "World.h" + +#include +#include + +namespace +{ + // ----------------------------------------------------------------- + // Cache : GlyphID (MiscValue) -> ItemTemplate* + // ----------------------------------------------------------------- + std::unordered_map s_GlyphItemCache; + + void BuildGlyphItemCache() + { + if (!s_GlyphItemCache.empty()) + return; + + ItemTemplateContainer const* store = sObjectMgr->GetItemTemplateStore(); + + for (auto const& kv : *store) // C++17 : range-for sur map + { + ItemTemplate const* proto = &kv.second; + + if (!proto || proto->Class != ITEM_CLASS_GLYPH) + continue; + + for (uint32 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) + { + uint32 spellId = proto->Spells[i].SpellId; + if (!spellId) + continue; + + SpellInfo const* spell = sSpellMgr->GetSpellInfo(spellId); + if (!spell) + continue; + + for (uint32 eff = 0; eff <= EFFECT_2; ++eff) + { + if (spell->Effects[eff].Effect != SPELL_EFFECT_APPLY_GLYPH) + continue; + + uint32 glyphId = spell->Effects[eff].MiscValue; + if (glyphId) + s_GlyphItemCache[glyphId] = proto; + } + } + } + } +} // namespace + +// ----------------------------------------------------------------- +// Action +// ----------------------------------------------------------------- +bool TellGlyphsAction::Execute(Event event) +{ + //----------------------------------------------------------------- + // 1. who sended the wisp ? (source of event) + //----------------------------------------------------------------- + Player* sender = event.getOwner(); // API Event + if (!sender) + return false; + + //----------------------------------------------------------------- + // 2. Generate glyphId cache -> item + //----------------------------------------------------------------- + BuildGlyphItemCache(); + + //----------------------------------------------------------------- + // 3. Look at the 6 glyphs sockets + //----------------------------------------------------------------- + std::ostringstream list; + bool first = true; + + for (uint8 slot = 0; slot < MAX_GLYPH_SLOT_INDEX; ++slot) + { + uint32 glyphId = bot->GetGlyph(slot); + if (!glyphId) + continue; + + auto it = s_GlyphItemCache.find(glyphId); + if (it == s_GlyphItemCache.end()) + continue; // No glyph found (rare) + + if (!first) + list << ", "; + + // chat->FormatItem + list << chat->FormatItem(it->second); + first = false; + } + + //----------------------------------------------------------------- + // 4. Send chat messages + //----------------------------------------------------------------- + if (first) // no glyphs + botAI->TellMaster("No glyphs equipped"); + else + botAI->TellMaster(std::string("Glyphs: ") + list.str()); + + return true; +} diff --git a/src/strategy/actions/TellGlyphsAction.h b/src/strategy/actions/TellGlyphsAction.h new file mode 100644 index 00000000..b68e9fef --- /dev/null +++ b/src/strategy/actions/TellGlyphsAction.h @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2016+ AzerothCore , released under GNU GPL v2 license, you may redistribute it + * and/or modify it under version 2 of the License, or (at your option), any later version. + */ + +#ifndef _PLAYERBOT_TELLGLYPHSACTION_H +#define _PLAYERBOT_TELLGLYPHSACTION_H + +#include "Action.h" + +class TellGlyphsAction : public Action +{ +public: + TellGlyphsAction(PlayerbotAI* ai, std::string const name = "glyphs") + : Action(ai, name) {} + + bool Execute(Event event) override; +}; + +#endif + diff --git a/src/strategy/generic/ChatCommandHandlerStrategy.cpp b/src/strategy/generic/ChatCommandHandlerStrategy.cpp index 20ed07b8..db44bf10 100644 --- a/src/strategy/generic/ChatCommandHandlerStrategy.cpp +++ b/src/strategy/generic/ChatCommandHandlerStrategy.cpp @@ -103,6 +103,8 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector& trigger triggers.push_back( new TriggerNode("wipe", NextAction::array(0, new NextAction("wipe", relevance), nullptr))); triggers.push_back(new TriggerNode("pet", NextAction::array(0, new NextAction("pet", relevance), nullptr))); + triggers.push_back(new TriggerNode("glyphs", NextAction::array(0, new NextAction("glyphs", relevance), nullptr))); // Added for custom Glyphs + triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs } ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) @@ -183,4 +185,6 @@ ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : Pas supported.push_back("unlock items"); supported.push_back("unlock traded item"); supported.push_back("pet"); + supported.push_back("glyphs"); // Added for custom Glyphs + supported.push_back("glyph equip"); // Added for custom Glyphs } diff --git a/src/strategy/triggers/ChatTriggerContext.h b/src/strategy/triggers/ChatTriggerContext.h index 6979e81f..64239fe9 100644 --- a/src/strategy/triggers/ChatTriggerContext.h +++ b/src/strategy/triggers/ChatTriggerContext.h @@ -134,6 +134,8 @@ public: creators["qi"] = &ChatTriggerContext::qi; creators["wipe"] = &ChatTriggerContext::wipe; creators["pet"] = &ChatTriggerContext::pet; + creators["glyphs"] = &ChatTriggerContext::glyphs; // Added for custom Glyphs + creators["glyph equip"] = &ChatTriggerContext::glyph_equip; // Added for custom Glyphs } private: @@ -247,6 +249,8 @@ private: static Trigger* qi(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "qi"); } static Trigger* wipe(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "wipe"); } static Trigger* pet(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "pet"); } + static Trigger* glyphs(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "glyphs"); } // Added for custom Glyphs + static Trigger* glyph_equip(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "glyph equip"); } // Added for custom Glyphs }; #endif diff --git a/src/strategy/values/ValueContext.h b/src/strategy/values/ValueContext.h index c9dcdb7c..2e735fc6 100644 --- a/src/strategy/values/ValueContext.h +++ b/src/strategy/values/ValueContext.h @@ -160,6 +160,7 @@ public: creators["my attacker count"] = &ValueContext::my_attacker_count; creators["has aggro"] = &ValueContext::has_aggro; creators["mounted"] = &ValueContext::mounted; + creators["custom_glyphs"] = &ValueContext::custom_glyphs; // Added for custom glyphs creators["can loot"] = &ValueContext::can_loot; creators["loot target"] = &ValueContext::loot_target; @@ -554,6 +555,13 @@ private: static UntypedValue* last_flee_angle(PlayerbotAI* ai) { return new LastFleeAngleValue(ai); } static UntypedValue* last_flee_timestamp(PlayerbotAI* ai) { return new LastFleeTimestampValue(ai); } static UntypedValue* recently_flee_info(PlayerbotAI* ai) { return new RecentlyFleeInfo(ai); } + // ------------------------------------------------------- + // Flag for cutom glyphs : true when /w bot glyph equip … + // ------------------------------------------------------- + static UntypedValue* custom_glyphs(PlayerbotAI* ai) + { + return new ManualSetValue(ai, false, "custom_glyphs"); + } }; #endif From 961629f4ce618330c7aff2082c1be0cca1e205ce Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 18:58:16 +0200 Subject: [PATCH 02/15] Update EquipGlyphsAction.cpp --- src/strategy/actions/EquipGlyphsAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strategy/actions/EquipGlyphsAction.cpp b/src/strategy/actions/EquipGlyphsAction.cpp index 4c7ac14d..b2709c84 100644 --- a/src/strategy/actions/EquipGlyphsAction.cpp +++ b/src/strategy/actions/EquipGlyphsAction.cpp @@ -106,7 +106,7 @@ bool EquipGlyphsAction::Execute(Event event) std::vector glyphs; if (!CollectGlyphs(itemIds, glyphs)) { - botAI->TellMaster("glyph equip : liste invalide (IDs items glyphes de ta classe, max 6)."); + botAI->TellMaster("Usage: glyph equip <6 glyph item IDs> (3 major, 3 minor)."); return false; } From 4c9e4e7b0f46884160a20d36961eb5ba7cd5ef70 Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:18:09 +0200 Subject: [PATCH 03/15] Update ChatTriggerContext.h --- src/strategy/triggers/ChatTriggerContext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strategy/triggers/ChatTriggerContext.h b/src/strategy/triggers/ChatTriggerContext.h index 64239fe9..99e69d0a 100644 --- a/src/strategy/triggers/ChatTriggerContext.h +++ b/src/strategy/triggers/ChatTriggerContext.h @@ -134,8 +134,8 @@ public: creators["qi"] = &ChatTriggerContext::qi; creators["wipe"] = &ChatTriggerContext::wipe; creators["pet"] = &ChatTriggerContext::pet; - creators["glyphs"] = &ChatTriggerContext::glyphs; // Added for custom Glyphs - creators["glyph equip"] = &ChatTriggerContext::glyph_equip; // Added for custom Glyphs + creators["glyphs"] = &ChatTriggerContext::glyphs; // Added for custom Glyphs + creators["glyph equip"] = &ChatTriggerContext::glyph_equip; // Added for custom Glyphs } private: From 849b21f916a6d44fd7488d6ae0c8f64a47d5f816 Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:23:39 +0200 Subject: [PATCH 04/15] Update ChatCommandHandlerStrategy.cpp Fix indentation: replaced tabs with spaces --- src/strategy/generic/ChatCommandHandlerStrategy.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/strategy/generic/ChatCommandHandlerStrategy.cpp b/src/strategy/generic/ChatCommandHandlerStrategy.cpp index db44bf10..89237eed 100644 --- a/src/strategy/generic/ChatCommandHandlerStrategy.cpp +++ b/src/strategy/generic/ChatCommandHandlerStrategy.cpp @@ -104,7 +104,7 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector& trigger new TriggerNode("wipe", NextAction::array(0, new NextAction("wipe", relevance), nullptr))); triggers.push_back(new TriggerNode("pet", NextAction::array(0, new NextAction("pet", relevance), nullptr))); triggers.push_back(new TriggerNode("glyphs", NextAction::array(0, new NextAction("glyphs", relevance), nullptr))); // Added for custom Glyphs - triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs + triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs } ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) @@ -185,6 +185,6 @@ ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : Pas supported.push_back("unlock items"); supported.push_back("unlock traded item"); supported.push_back("pet"); - supported.push_back("glyphs"); // Added for custom Glyphs - supported.push_back("glyph equip"); // Added for custom Glyphs + supported.push_back("glyphs"); // Added for custom Glyphs + supported.push_back("glyph equip"); // Added for custom Glyphs } From c5c1274d3cf8ca1424714c25a26c718ca4444c87 Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:24:39 +0200 Subject: [PATCH 05/15] Update ChatCommandHandlerStrategy.cpp --- src/strategy/generic/ChatCommandHandlerStrategy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strategy/generic/ChatCommandHandlerStrategy.cpp b/src/strategy/generic/ChatCommandHandlerStrategy.cpp index 89237eed..7ad37af8 100644 --- a/src/strategy/generic/ChatCommandHandlerStrategy.cpp +++ b/src/strategy/generic/ChatCommandHandlerStrategy.cpp @@ -104,7 +104,7 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector& trigger new TriggerNode("wipe", NextAction::array(0, new NextAction("wipe", relevance), nullptr))); triggers.push_back(new TriggerNode("pet", NextAction::array(0, new NextAction("pet", relevance), nullptr))); triggers.push_back(new TriggerNode("glyphs", NextAction::array(0, new NextAction("glyphs", relevance), nullptr))); // Added for custom Glyphs - triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs +triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs } ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) From e0ef04e1b9410a434830bf1643d3fa7559a95f8b Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:25:31 +0200 Subject: [PATCH 06/15] Update ChatTriggerContext.h --- src/strategy/triggers/ChatTriggerContext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strategy/triggers/ChatTriggerContext.h b/src/strategy/triggers/ChatTriggerContext.h index 99e69d0a..bbeccea3 100644 --- a/src/strategy/triggers/ChatTriggerContext.h +++ b/src/strategy/triggers/ChatTriggerContext.h @@ -249,8 +249,8 @@ private: static Trigger* qi(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "qi"); } static Trigger* wipe(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "wipe"); } static Trigger* pet(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "pet"); } - static Trigger* glyphs(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "glyphs"); } // Added for custom Glyphs - static Trigger* glyph_equip(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "glyph equip"); } // Added for custom Glyphs +static Trigger* glyphs(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "glyphs"); } // Added for custom Glyphs +static Trigger* glyph_equip(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "glyph equip"); } // Added for custom Glyphs }; #endif From e64da42f87ae6f995d39990713f90e01702281ae Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:26:07 +0200 Subject: [PATCH 07/15] Update ChatCommandHandlerStrategy.cpp --- src/strategy/generic/ChatCommandHandlerStrategy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strategy/generic/ChatCommandHandlerStrategy.cpp b/src/strategy/generic/ChatCommandHandlerStrategy.cpp index 7ad37af8..8514b5ba 100644 --- a/src/strategy/generic/ChatCommandHandlerStrategy.cpp +++ b/src/strategy/generic/ChatCommandHandlerStrategy.cpp @@ -104,7 +104,7 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector& trigger new TriggerNode("wipe", NextAction::array(0, new NextAction("wipe", relevance), nullptr))); triggers.push_back(new TriggerNode("pet", NextAction::array(0, new NextAction("pet", relevance), nullptr))); triggers.push_back(new TriggerNode("glyphs", NextAction::array(0, new NextAction("glyphs", relevance), nullptr))); // Added for custom Glyphs -triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs + triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs } ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) From 1e128ea24f9cf64a74f74b7909a7e746995c5a25 Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:26:38 +0200 Subject: [PATCH 08/15] Update ChatTriggerContext.h --- src/strategy/triggers/ChatTriggerContext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strategy/triggers/ChatTriggerContext.h b/src/strategy/triggers/ChatTriggerContext.h index bbeccea3..a0bde0f0 100644 --- a/src/strategy/triggers/ChatTriggerContext.h +++ b/src/strategy/triggers/ChatTriggerContext.h @@ -249,8 +249,8 @@ private: static Trigger* qi(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "qi"); } static Trigger* wipe(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "wipe"); } static Trigger* pet(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "pet"); } -static Trigger* glyphs(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "glyphs"); } // Added for custom Glyphs -static Trigger* glyph_equip(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "glyph equip"); } // Added for custom Glyphs + static Trigger* glyphs(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "glyphs"); } // Added for custom Glyphs + static Trigger* glyph_equip(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "glyph equip"); } // Added for custom Glyphs }; #endif From 2beee4aec959ca54a1f239571edcb00cf0ece832 Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:27:01 +0200 Subject: [PATCH 09/15] Update ChatCommandHandlerStrategy.cpp --- src/strategy/generic/ChatCommandHandlerStrategy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strategy/generic/ChatCommandHandlerStrategy.cpp b/src/strategy/generic/ChatCommandHandlerStrategy.cpp index 8514b5ba..d8dbddc9 100644 --- a/src/strategy/generic/ChatCommandHandlerStrategy.cpp +++ b/src/strategy/generic/ChatCommandHandlerStrategy.cpp @@ -104,7 +104,7 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector& trigger new TriggerNode("wipe", NextAction::array(0, new NextAction("wipe", relevance), nullptr))); triggers.push_back(new TriggerNode("pet", NextAction::array(0, new NextAction("pet", relevance), nullptr))); triggers.push_back(new TriggerNode("glyphs", NextAction::array(0, new NextAction("glyphs", relevance), nullptr))); // Added for custom Glyphs - triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs + triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs } ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) From 5108f709c79e76993777d30505f9965a24470bab Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:27:25 +0200 Subject: [PATCH 10/15] Update ChatTriggerContext.h --- src/strategy/triggers/ChatTriggerContext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strategy/triggers/ChatTriggerContext.h b/src/strategy/triggers/ChatTriggerContext.h index a0bde0f0..e9c5c937 100644 --- a/src/strategy/triggers/ChatTriggerContext.h +++ b/src/strategy/triggers/ChatTriggerContext.h @@ -249,8 +249,8 @@ private: static Trigger* qi(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "qi"); } static Trigger* wipe(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "wipe"); } static Trigger* pet(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "pet"); } - static Trigger* glyphs(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "glyphs"); } // Added for custom Glyphs - static Trigger* glyph_equip(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "glyph equip"); } // Added for custom Glyphs + static Trigger* glyphs(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "glyphs"); } // Added for custom Glyphs + static Trigger* glyph_equip(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "glyph equip"); } // Added for custom Glyphs }; #endif From e62da73706708a5a7b2d2b32d9a74ff8d667428e Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:27:48 +0200 Subject: [PATCH 11/15] Update ChatCommandHandlerStrategy.cpp --- src/strategy/generic/ChatCommandHandlerStrategy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strategy/generic/ChatCommandHandlerStrategy.cpp b/src/strategy/generic/ChatCommandHandlerStrategy.cpp index d8dbddc9..335662e7 100644 --- a/src/strategy/generic/ChatCommandHandlerStrategy.cpp +++ b/src/strategy/generic/ChatCommandHandlerStrategy.cpp @@ -104,7 +104,7 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector& trigger new TriggerNode("wipe", NextAction::array(0, new NextAction("wipe", relevance), nullptr))); triggers.push_back(new TriggerNode("pet", NextAction::array(0, new NextAction("pet", relevance), nullptr))); triggers.push_back(new TriggerNode("glyphs", NextAction::array(0, new NextAction("glyphs", relevance), nullptr))); // Added for custom Glyphs - triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs + triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs } ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) From 00b03bd29dc835e9d2dde9adc0b50225873de61f Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:28:11 +0200 Subject: [PATCH 12/15] Update ChatTriggerContext.h --- src/strategy/triggers/ChatTriggerContext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strategy/triggers/ChatTriggerContext.h b/src/strategy/triggers/ChatTriggerContext.h index e9c5c937..2bca74ba 100644 --- a/src/strategy/triggers/ChatTriggerContext.h +++ b/src/strategy/triggers/ChatTriggerContext.h @@ -249,8 +249,8 @@ private: static Trigger* qi(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "qi"); } static Trigger* wipe(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "wipe"); } static Trigger* pet(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "pet"); } - static Trigger* glyphs(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "glyphs"); } // Added for custom Glyphs - static Trigger* glyph_equip(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "glyph equip"); } // Added for custom Glyphs + static Trigger* glyphs(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "glyphs"); } // Added for custom Glyphs + static Trigger* glyph_equip(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "glyph equip"); } // Added for custom Glyphs }; #endif From 179e3bbf71534b02419755d87b20b3c45102eb89 Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:28:31 +0200 Subject: [PATCH 13/15] Update ChatCommandHandlerStrategy.cpp --- src/strategy/generic/ChatCommandHandlerStrategy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strategy/generic/ChatCommandHandlerStrategy.cpp b/src/strategy/generic/ChatCommandHandlerStrategy.cpp index 335662e7..89237eed 100644 --- a/src/strategy/generic/ChatCommandHandlerStrategy.cpp +++ b/src/strategy/generic/ChatCommandHandlerStrategy.cpp @@ -104,7 +104,7 @@ void ChatCommandHandlerStrategy::InitTriggers(std::vector& trigger new TriggerNode("wipe", NextAction::array(0, new NextAction("wipe", relevance), nullptr))); triggers.push_back(new TriggerNode("pet", NextAction::array(0, new NextAction("pet", relevance), nullptr))); triggers.push_back(new TriggerNode("glyphs", NextAction::array(0, new NextAction("glyphs", relevance), nullptr))); // Added for custom Glyphs - triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs + triggers.push_back(new TriggerNode("glyph equip", NextAction::array(0, new NextAction("glyph equip", relevance), nullptr))); // Added for custom Glyphs } ChatCommandHandlerStrategy::ChatCommandHandlerStrategy(PlayerbotAI* botAI) : PassTroughStrategy(botAI) From 2aca50c1c77ccea9185a586371d2df33474a8b74 Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 19:28:58 +0200 Subject: [PATCH 14/15] Update ChatTriggerContext.h --- src/strategy/triggers/ChatTriggerContext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strategy/triggers/ChatTriggerContext.h b/src/strategy/triggers/ChatTriggerContext.h index 2bca74ba..aabbf529 100644 --- a/src/strategy/triggers/ChatTriggerContext.h +++ b/src/strategy/triggers/ChatTriggerContext.h @@ -249,8 +249,8 @@ private: static Trigger* qi(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "qi"); } static Trigger* wipe(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "wipe"); } static Trigger* pet(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "pet"); } - static Trigger* glyphs(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "glyphs"); } // Added for custom Glyphs - static Trigger* glyph_equip(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "glyph equip"); } // Added for custom Glyphs + static Trigger* glyphs(PlayerbotAI* botAI) { return new ChatCommandTrigger(botAI, "glyphs"); } // Added for custom Glyphs + static Trigger* glyph_equip(PlayerbotAI* ai) { return new ChatCommandTrigger(ai, "glyph equip"); } // Added for custom Glyphs }; #endif From c6005449e0fa702c5eec6d720ad67a99c6846e52 Mon Sep 17 00:00:00 2001 From: Alex Dcnh <140754794+Wishmaster117@users.noreply.github.com> Date: Sat, 26 Jul 2025 21:56:53 +0200 Subject: [PATCH 15/15] Update EquipGlyphsAction.cpp --- src/strategy/actions/EquipGlyphsAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strategy/actions/EquipGlyphsAction.cpp b/src/strategy/actions/EquipGlyphsAction.cpp index b2709c84..d879e753 100644 --- a/src/strategy/actions/EquipGlyphsAction.cpp +++ b/src/strategy/actions/EquipGlyphsAction.cpp @@ -151,7 +151,7 @@ bool EquipGlyphsAction::Execute(Event event) botAI->TellMaster("Glyphs updated."); - // Flag to custom glyphs + // Flag for custom glyphs botAI->GetAiObjectContext()->GetValue("custom_glyphs")->Set(true); LOG_INFO("playerbots", "Custom Glyph Flag set to ON");