From b2b87ea4e021e9622c23de28e1baa7e415045a02 Mon Sep 17 00:00:00 2001 From: Kinglykrab <89047260+Kinglykrab@users.noreply.github.com> Date: Tue, 3 May 2022 23:04:54 -0400 Subject: [PATCH] [Quest API] Expand Bot quest API functionality. (#2096) * [Quest API] Expand Bot quest API functionality. - Add $bot->AddItem(slot_id, item_id, charges, attuned, augment_one, augment_two, augment_three, augment_four, augment_five, augment_six) to Perl. - Add $bot->CountItem(item_id) to Perl. - Add $bot->HasItem(item_id) to Perl. - Add $bot->RemoveItem(item_id) to Perl. - Add bot:AddItem(slot_id, item_id, charges, attuned, augment_one, augment_two, augment_three, augment_four, augment_five, augment_six) to Lua. - Add bot:CountItem(item_id) to Lua. - Add bot:GetOwner() to Lua. - Add bot:HasItem(item_id) to Lua. - Add bot:RemoveItem(item_id) to Lua. * Fix possible crash. --- zone/bot.cpp | 292 +++++++-- zone/bot.h | 35 +- zone/bot_command.cpp | 1450 ++++++++++++++++++++++-------------------- zone/lua_bot.cpp | 84 ++- zone/lua_bot.h | 15 + zone/perl_bot.cpp | 111 +++- 6 files changed, 1234 insertions(+), 753 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index 89b1e763f..4afefc598 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -3791,7 +3791,12 @@ void Bot::Depop() { } bool Bot::Spawn(Client* botCharacterOwner) { - if(GetBotID() > 0 && _botOwnerCharacterID > 0 && botCharacterOwner && botCharacterOwner->CharacterID() == _botOwnerCharacterID) { + if ( + GetBotID() && + _botOwnerCharacterID && + botCharacterOwner && + botCharacterOwner->CharacterID() == _botOwnerCharacterID + ) { // Rename the bot name to make sure that Mob::GetName() matches Mob::GetCleanName() so we dont have a bot named "Jesuschrist001" strcpy(name, GetCleanName()); @@ -3802,10 +3807,23 @@ bool Bot::Spawn(Client* botCharacterOwner) { helmtexture = 0; //0xFF; texture = 0; //0xFF; - if(Save()) - GetBotOwner()->CastToClient()->Message(Chat::White, "%s saved.", GetCleanName()); - else - GetBotOwner()->CastToClient()->Message(Chat::Red, "%s save failed!", GetCleanName()); + if (Save()) { + GetBotOwner()->CastToClient()->Message( + Chat::White, + fmt::format( + "{} saved.", + GetCleanName() + ).c_str() + ); + } else { + GetBotOwner()->CastToClient()->Message( + Chat::Red, + fmt::format( + "{} save failed!", + GetCleanName() + ).c_str() + ); + } // Spawn the bot at the bot owner's loc m_Position.x = botCharacterOwner->GetX(); @@ -3825,14 +3843,15 @@ bool Bot::Spawn(Client* botCharacterOwner) { ping_timer.Start(8000); // there is something askew with spawn struct appearance fields... // I re-enabled this until I can sort it out - uint32 itemID = 0; - uint8 materialFromSlot = 0xFF; - for (int i = EQ::invslot::EQUIPMENT_BEGIN; i <= EQ::invslot::EQUIPMENT_END; ++i) { - itemID = GetBotItemBySlot(i); - if(itemID != 0) { - materialFromSlot = EQ::InventoryProfile::CalcMaterialFromSlot(i); - if(materialFromSlot != 0xFF) - SendWearChange(materialFromSlot); + uint32 item_id = 0; + uint8 material_from_slot = 0xFF; + for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) { + item_id = GetBotItemBySlot(slot_id); + if (item_id != 0) { + material_from_slot = EQ::InventoryProfile::CalcMaterialFromSlot(slot_id); + if (material_from_slot != 0xFF) { + SendWearChange(material_from_slot); + } } } @@ -3843,26 +3862,29 @@ bool Bot::Spawn(Client* botCharacterOwner) { } // Deletes the inventory record for the specified item from the database for this bot. -void Bot::RemoveBotItemBySlot(uint32 slotID, std::string *errorMessage) +void Bot::RemoveBotItemBySlot(uint16 slot_id, std::string *error_message) { - if(!GetBotID()) + if (!GetBotID()) { return; + } - if(!database.botdb.DeleteItemBySlot(GetBotID(), slotID)) - *errorMessage = BotDatabase::fail::DeleteItemBySlot(); + if (!database.botdb.DeleteItemBySlot(GetBotID(), slot_id)) { + *error_message = BotDatabase::fail::DeleteItemBySlot(); + } - m_inv.DeleteItem(slotID); + m_inv.DeleteItem(slot_id); UpdateEquipmentLight(); } // Retrieves all the inventory records from the database for this bot. -void Bot::GetBotItems(EQ::InventoryProfile &inv, std::string* errorMessage) +void Bot::GetBotItems(EQ::InventoryProfile &inv, std::string* error_message) { - if(!GetBotID()) + if (!GetBotID()) { return; + } if (!database.botdb.LoadItems(GetBotID(), inv)) { - *errorMessage = BotDatabase::fail::LoadItems(); + *error_message = BotDatabase::fail::LoadItems(); return; } @@ -3870,15 +3892,23 @@ void Bot::GetBotItems(EQ::InventoryProfile &inv, std::string* errorMessage) } // Returns the inventory record for this bot from the database for the specified equipment slot. -uint32 Bot::GetBotItemBySlot(uint32 slotID) +uint32 Bot::GetBotItemBySlot(uint16 slot_id) { uint32 item_id = 0; - if(!GetBotID()) + if (!GetBotID()) { return item_id; + } - if (!database.botdb.LoadItemBySlot(GetBotID(), slotID, item_id)) { - if (GetBotOwner() && GetBotOwner()->IsClient()) - GetBotOwner()->CastToClient()->Message(Chat::Red, "%s", BotDatabase::fail::LoadItemBySlot()); + if (!database.botdb.LoadItemBySlot(GetBotID(), slot_id, item_id)) { + if (GetBotOwner() && GetBotOwner()->IsClient()) { + GetBotOwner()->CastToClient()->Message( + Chat::Red, + fmt::format( + "{}", + BotDatabase::fail::LoadItemBySlot() + ).c_str() + ); + } } return item_id; @@ -4075,63 +4105,191 @@ void Bot::SendBotArcheryWearChange(uint8 material_slot, uint32 material, uint32 } // Returns the item id that is in the bot inventory collection for the specified slot. -EQ::ItemInstance* Bot::GetBotItem(uint32 slotID) { - EQ::ItemInstance* item = m_inv.GetItem(slotID); - if(item) +EQ::ItemInstance* Bot::GetBotItem(uint16 slot_id) { + EQ::ItemInstance* item = m_inv.GetItem(slot_id); + if (item) { return item; + } return nullptr; } // Adds the specified item it bot to the NPC equipment array and to the bot inventory collection. -void Bot::BotAddEquipItem(int slot, uint32 id) { +void Bot::BotAddEquipItem(uint16 slot_id, uint32 item_id) { // this is being called before bot is assigned an entity id.. // ..causing packets to be sent out to zone with an id of '0' - if(slot > 0 && id > 0) { - uint8 materialFromSlot = EQ::InventoryProfile::CalcMaterialFromSlot(slot); + if (item_id) { + uint8 material_from_slot = EQ::InventoryProfile::CalcMaterialFromSlot(slot_id); - if (materialFromSlot != EQ::textures::materialInvalid) { - equipment[slot] = id; // npc has more than just material slots. Valid material should mean valid inventory index - if (GetID()) // temp hack fix - SendWearChange(materialFromSlot); + if (material_from_slot != EQ::textures::materialInvalid) { + equipment[slot_id] = item_id; // npc has more than just material slots. Valid material should mean valid inventory index + if (GetID()) { // temp hack fix + SendWearChange(material_from_slot); + } } UpdateEquipmentLight(); - if (UpdateActiveLight()) - if (GetID()) // temp hack fix + if (UpdateActiveLight()) { + if (GetID()) { // temp hack fix SendAppearancePacket(AT_Light, GetActiveLightType()); + } + } } } // Erases the specified item from bot the NPC equipment array and from the bot inventory collection. -void Bot::BotRemoveEquipItem(int16 slot) +void Bot::BotRemoveEquipItem(uint16 slot_id) { - uint8 material_slot = EQ::InventoryProfile::CalcMaterialFromSlot(slot); + uint8 material_slot = EQ::InventoryProfile::CalcMaterialFromSlot(slot_id); if (material_slot != EQ::textures::materialInvalid) { - equipment[slot] = 0; // npc has more than just material slots. Valid material should mean valid inventory index + equipment[slot_id] = 0; // npc has more than just material slots. Valid material should mean valid inventory index SendWearChange(material_slot); - if (material_slot == EQ::textures::armorChest) + if (material_slot == EQ::textures::armorChest) { SendWearChange(EQ::textures::armorArms); + } } UpdateEquipmentLight(); - if (UpdateActiveLight()) + if (UpdateActiveLight()) { SendAppearancePacket(AT_Light, GetActiveLightType()); + } } -void Bot::BotTradeAddItem(uint32 id, const EQ::ItemInstance* inst, int16 charges, uint32 equipableSlots, uint16 lootSlot, std::string* errorMessage, bool addToDb) +void Bot::BotTradeAddItem(const EQ::ItemInstance* inst, uint16 slot_id, std::string* error_message, bool save_to_database) { - if(addToDb) { - if (!database.botdb.SaveItemBySlot(this, lootSlot, inst)) { - *errorMessage = BotDatabase::fail::SaveItemBySlot(); + if (save_to_database) { + if (!database.botdb.SaveItemBySlot(this, slot_id, inst)) { + *error_message = BotDatabase::fail::SaveItemBySlot(); return; } - m_inv.PutItem(lootSlot, *inst); + m_inv.PutItem(slot_id, *inst); } - BotAddEquipItem(lootSlot, id); + auto item_id = inst ? inst->GetID() : 0; + + BotAddEquipItem(slot_id, item_id); +} + +void Bot::AddItem( + uint16 slot_id, + uint32 item_id, + int16 charges, + bool attuned, + uint32 augment_one, + uint32 augment_two, + uint32 augment_three, + uint32 augment_four, + uint32 augment_five, + uint32 augment_six +) { + auto inst = database.CreateItem( + item_id, + charges, + augment_one, + augment_two, + augment_three, + augment_four, + augment_five, + augment_six, + attuned + ); + + if (!inst) { + LogError( + "Bot:AddItem Invalid Item data: ID [{}] Charges [{}] Aug1 [{}] Aug2 [{}] Aug3 [{}] Aug4 [{}] Aug5 [{}] Aug6 [{}] Attuned [{}]", + item_id, + charges, + augment_one, + augment_two, + augment_three, + augment_four, + augment_five, + augment_six, + attuned + ); + return; + } + + if (!database.botdb.SaveItemBySlot(this, slot_id, inst)) { + LogError("Failed to save item by slot to slot [{}] for [{}].", slot_id, GetCleanName()); + return; + } + + m_inv.PutItem(slot_id, *inst); + + BotAddEquipItem(slot_id, item_id); +} + +uint32 Bot::CountItem(uint32 item_id) { + uint32 item_count = 0; + EQ::ItemInstance *inst = nullptr; + + for (uint16 slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) { + inst = GetBotItem(slot_id); + if (!inst || !inst->GetItem()) { + continue; + } + + if (inst->GetID() == item_id) { + item_count++; + } + } + + return item_count; +} + +bool Bot::HasItem(uint32 item_id) { + bool has_item = false; + EQ::ItemInstance *inst = nullptr; + + for (uint16 slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) { + inst = GetBotItem(slot_id); + if (!inst || !inst->GetItem()) { + continue; + } + + if (inst->GetID() == item_id) { + has_item = true; + break; + } + } + + return has_item; +} + +void Bot::RemoveItem(uint32 item_id) { + EQ::ItemInstance *inst = nullptr; + + for (uint16 slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) { + inst = GetBotItem(slot_id); + if (!inst || !inst->GetItem()) { + continue; + } + + + if (inst->GetID() == item_id) { + std::string error_message; + RemoveBotItemBySlot(slot_id, &error_message); + if (!error_message.empty()) { + if (GetOwner()) { + GetOwner()->CastToClient()->Message( + Chat::Magenta, + fmt::format( + "Database Error: {}", + error_message + ).c_str() + ); + } + return; + } + + BotRemoveEquipItem(slot_id); + CalcBotStats(GetOwner()->CastToClient()->GetBotOption(Client::booStatsUpdate)); + return; + } + } } bool Bot::RemoveBotFromGroup(Bot* bot, Group* group) { @@ -4181,21 +4339,28 @@ bool Bot::AddBotToGroup(Bot* bot, Group* group) { } // Completes a trade with a client bot owner -void Bot::FinishTrade(Client* client, BotTradeType tradeType) +void Bot::FinishTrade(Client* client, BotTradeType trade_type) { - if (!client || (GetOwner() != client) || client->GetTradeskillObject() || client->trade->state == Trading) { - if (client) + if ( + !client || + GetOwner() != client || + client->GetTradeskillObject() || + client->trade->state == Trading + ) { + if (client) { client->ResetTrade(); + } + return; } // these notes are not correct or obselete - if (tradeType == BotTradeClientNormal) { + if (trade_type == BotTradeClientNormal) { // Items being traded are found in the normal trade window used to trade between a Client and a Client or NPC // Items in this mode are found in slot ids 3000 thru 3003 - thought bots used the full 8-slot window..? PerformTradeWithClient(EQ::invslot::TRADE_BEGIN, EQ::invslot::TRADE_END, client); // {3000..3007} } - else if (tradeType == BotTradeClientNoDropNoTrade) { + else if (trade_type == BotTradeClientNoDropNoTrade) { // Items being traded are found on the Client's cursor slot, slot id 30. This item can be either a single item or it can be a bag. // If it is a bag, then we have to search for items in slots 331 thru 340 PerformTradeWithClient(EQ::invslot::slotCursor, EQ::invslot::slotCursor, client); @@ -4314,7 +4479,7 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client* return; } - if (trade_instance->IsStackable() && (trade_instance->GetCharges() < trade_instance->GetItem()->StackSize)) { // temp until partial stacks are implemented + if (trade_instance->IsStackable() && trade_instance->GetCharges() < trade_instance->GetItem()->StackSize) { // temp until partial stacks are implemented client->Message( Chat::Yellow, fmt::format( @@ -4586,7 +4751,7 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client* if (return_iterator.from_bot_slot == invslot::slotCursor) { // failed trade return // no movement action required - } else if ((return_iterator.from_bot_slot >= invslot::TRADE_BEGIN) && (return_iterator.from_bot_slot <= invslot::TRADE_END)) { // failed trade returns + } else if (return_iterator.from_bot_slot >= invslot::TRADE_BEGIN && return_iterator.from_bot_slot <= invslot::TRADE_END) { // failed trade returns client->PutItemInInventory(return_iterator.to_client_slot, *return_iterator.return_item_instance); client->SendItemPacket(return_iterator.to_client_slot, return_iterator.return_item_instance, ItemPacketTrade); client->DeleteItemInInventory(return_iterator.from_bot_slot); @@ -6548,17 +6713,18 @@ bool Bot::IsBotAttackAllowed(Mob* attacker, Mob* target, bool& hasRuleDefined) { return Result; } -void Bot::EquipBot(std::string* errorMessage) { - GetBotItems(m_inv, errorMessage); +void Bot::EquipBot(std::string* error_message) { + GetBotItems(m_inv, error_message); const EQ::ItemInstance* inst = nullptr; const EQ::ItemData* item = nullptr; - for (int i = EQ::invslot::EQUIPMENT_BEGIN; i <= EQ::invslot::EQUIPMENT_END; ++i) { - inst = GetBotItem(i); - if(inst) { + for (int slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) { + inst = GetBotItem(slot_id); + if (inst) { item = inst->GetItem(); - BotTradeAddItem(inst->GetID(), inst, inst->GetCharges(), item->Slots, i, errorMessage, false); - if(!errorMessage->empty()) + BotTradeAddItem(inst, slot_id, error_message, false); + if (!error_message->empty()) { return; + } } } UpdateEquipmentLight(); diff --git a/zone/bot.h b/zone/bot.h index 441199712..827c193fe 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -170,7 +170,7 @@ public: virtual void SetLevel(uint8 in_level, bool command = false); virtual void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho); virtual bool Process(); - void FinishTrade(Client* client, BotTradeType tradeType); + void FinishTrade(Client* client, BotTradeType trade_type); virtual bool Save(); virtual void Depop(); void CalcBotStats(bool showtext = true); @@ -344,8 +344,8 @@ public: virtual bool DoCastSpell(uint16 spell_id, uint16 target_id, EQ::spells::CastingSlot slot = EQ::spells::CastingSlot::Item, int32 casttime = -1, int32 mana_cost = -1, uint32* oSpellWillFinish = 0, uint32 item_slot = 0xFFFFFFFF, uint32 aa_id = 0); // Bot Equipment & Inventory Class Methods - void BotTradeAddItem(uint32 id, const EQ::ItemInstance* inst, int16 charges, uint32 equipableSlots, uint16 lootSlot, std::string* errorMessage, bool addToDb = true); - void EquipBot(std::string* errorMessage); + void BotTradeAddItem(const EQ::ItemInstance* inst, uint16 slot_id, std::string* error_message, bool save_to_database = true); + void EquipBot(std::string* error_message); bool CheckLoreConflict(const EQ::ItemData* item); virtual void UpdateEquipmentLight() { m_Light.Type[EQ::lightsource::LightEquipment] = m_inv.FindBrightestLightType(); m_Light.Level[EQ::lightsource::LightEquipment] = EQ::lightsource::TypeToLevel(m_Light.Type[EQ::lightsource::LightEquipment]); } const EQ::InventoryProfile& GetBotInv() const { return m_inv; } @@ -355,7 +355,7 @@ public: static Bot* LoadBot(uint32 botID); static uint32 SpawnedBotCount(uint32 botOwnerCharacterID); static void LevelBotWithClient(Client* client, uint8 level, bool sendlvlapp); - //static bool SetBotOwnerCharacterID(uint32 botID, uint32 botOwnerCharacterID, std::string* errorMessage); + //static bool SetBotOwnerCharacterID(uint32 botID, uint32 botOwnerCharacterID, std::string* error_message); static bool IsBotAttackAllowed(Mob* attacker, Mob* target, bool& hasRuleDefined); static Bot* GetBotByBotClientOwnerAndBotName(Client* c, std::string botName); static void ProcessBotGroupInvite(Client* c, std::string botName); @@ -416,7 +416,7 @@ public: uint32 GetBotSpellID() { return npc_spells_id; } Mob* GetBotOwner() { return this->_botOwner; } uint32 GetBotArcheryRange(); - EQ::ItemInstance* GetBotItem(uint32 slotID); + EQ::ItemInstance* GetBotItem(uint16 slot_id); virtual bool GetSpawnStatus() { return _spawnStatus; } uint8 GetPetChooserID() { return _petChooserID; } bool IsPetChooser() { return _petChooser; } @@ -571,8 +571,23 @@ public: // Publicized private functions static NPCType *FillNPCTypeStruct(uint32 botSpellsID, std::string botName, std::string botLastName, uint8 botLevel, uint16 botRace, uint8 botClass, uint8 gender, float size, uint32 face, uint32 hairStyle, uint32 hairColor, uint32 eyeColor, uint32 eyeColor2, uint32 beardColor, uint32 beard, uint32 drakkinHeritage, uint32 drakkinTattoo, uint32 drakkinDetails, int32 hp, int32 mana, int32 mr, int32 cr, int32 dr, int32 fr, int32 pr, int32 corrup, int32 ac, uint32 str, uint32 sta, uint32 dex, uint32 agi, uint32 _int, uint32 wis, uint32 cha, uint32 attack); - void BotRemoveEquipItem(int16 slot); - void RemoveBotItemBySlot(uint32 slotID, std::string* errorMessage); + void BotRemoveEquipItem(uint16 slot_id); + void RemoveBotItemBySlot(uint16 slot_id, std::string* error_message); + void AddItem( + uint16 slot_id, + uint32 item_id, + int16 charges = -1, + bool attuned = false, + uint32 augment_one = 0, + uint32 augment_two = 0, + uint32 augment_three = 0, + uint32 augment_four = 0, + uint32 augment_five = 0, + uint32 augment_six = 0 + ); + uint32 CountItem(uint32 item_id); + bool HasItem(uint32 item_id); + void RemoveItem(uint32 item_id); uint32 GetTotalPlayTime(); // New accessors for BotDatabase access @@ -714,9 +729,9 @@ private: void SetReturningFlag(bool flag = true) { m_returning_flag = flag; } // Private "Inventory" Methods - void GetBotItems(EQ::InventoryProfile &inv, std::string* errorMessage); - void BotAddEquipItem(int slot, uint32 id); - uint32 GetBotItemBySlot(uint32 slotID); + void GetBotItems(EQ::InventoryProfile &inv, std::string* error_message); + void BotAddEquipItem(uint16 slot_id, uint32 item_id); + uint32 GetBotItemBySlot(uint16 slot_id); // Private "Pet" Methods bool LoadPet(); // Load and spawn bot pet if there is one diff --git a/zone/bot_command.cpp b/zone/bot_command.cpp index a98287da9..f45a733a7 100644 --- a/zone/bot_command.cpp +++ b/zone/bot_command.cpp @@ -87,13 +87,6 @@ namespace { //#define BCSTSPELLDUMP // only needed if you're adding/tailoring bot command spells and need a file dump -#define m_message Chat::White -#define m_action Chat::Yellow -#define m_note Chat::Gray -#define m_usage Chat::Cyan -#define m_fail Chat::Red -#define m_unknown Chat::Magenta - #define HP_RATIO_DELTA 5.0f enum { EffectIDFirst = 1, EffectIDLast = 12 }; @@ -1272,7 +1265,7 @@ LinkedList cleanup_bot_command_list; */ int bot_command_not_avail(Client *c, const char *message) { - c->Message(m_fail, "Bot commands not available."); + c->Message(Chat::Red, "Bot commands not available."); return -1; } @@ -1625,7 +1618,7 @@ int bot_command_real_dispatch(Client *c, const char *message) BotCommandRecord *cur = bot_command_list[cstr]; if(c->Admin() < cur->access){ - c->Message(m_fail, "Your access level is not high enough to use this bot command."); + c->Message(Chat::Red, "Your access level is not high enough to use this bot command."); return(-1); } @@ -2306,11 +2299,11 @@ namespace ActionableBots return ABT_None; if (!ab_mask) - bot_owner->Message(m_fail, "Command passed null 'ActionableBot' criteria"); + bot_owner->Message(Chat::Red, "Command passed null 'ActionableBot' criteria"); else if (ab_mask & ab_type) - bot_owner->Message(m_fail, "You have no spawned bots meeting this criteria - type: '%s', name: '%s'", ab_type_arg.c_str(), ((name) ? (name) : (""))); + bot_owner->Message(Chat::Red, "You have no spawned bots meeting this criteria - type: '%s', name: '%s'", ab_type_arg.c_str(), ((name) ? (name) : (""))); else - bot_owner->Message(m_fail, "This command does not allow 'ActionableBot' criteria '%s'", ab_type_arg.c_str()); + bot_owner->Message(Chat::Red, "This command does not allow 'ActionableBot' criteria '%s'", ab_type_arg.c_str()); return ABT_None; } @@ -2535,21 +2528,21 @@ void bot_command_actionable(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_command_actionable", sep->arg[0], "actionable")) return; - c->Message(m_message, "Actionable command arguments:"); + c->Message(Chat::White, "Actionable command arguments:"); - c->Message(m_usage, "target - selects target as single bot .. use ^command [target] or imply by empty actionable argument"); - c->Message(m_usage, "byname [name] - selects single bot by name"); - c->Message(m_usage, "ownergroup - selects all bots in the owner's group"); - c->Message(m_usage, "botgroup [name] - selects members of a bot-group by its name"); - c->Message(m_usage, "targetgroup - selects all bots in target's group"); - c->Message(m_usage, "namesgroup [name] - selects all bots in name's group"); - c->Message(m_usage, "healrotation [name] - selects all member and target bots of a heal rotation where name is a member"); - c->Message(m_usage, "healrotationmembers [name] - selects all member bots of a heal rotation where name is a member"); - c->Message(m_usage, "healrotationtargets [name] - selects all target bots of a heal rotation where name is a member"); - c->Message(m_usage, "spawned - selects all spawned bots"); - c->Message(m_usage, "all - selects all spawned bots .. argument use indicates en masse database updating"); + c->Message(Chat::Cyan, "target - selects target as single bot .. use ^command [target] or imply by empty actionable argument"); + c->Message(Chat::Cyan, "byname [name] - selects single bot by name"); + c->Message(Chat::Cyan, "ownergroup - selects all bots in the owner's group"); + c->Message(Chat::Cyan, "botgroup [name] - selects members of a bot-group by its name"); + c->Message(Chat::Cyan, "targetgroup - selects all bots in target's group"); + c->Message(Chat::Cyan, "namesgroup [name] - selects all bots in name's group"); + c->Message(Chat::Cyan, "healrotation [name] - selects all member and target bots of a heal rotation where name is a member"); + c->Message(Chat::Cyan, "healrotationmembers [name] - selects all member bots of a heal rotation where name is a member"); + c->Message(Chat::Cyan, "healrotationtargets [name] - selects all target bots of a heal rotation where name is a member"); + c->Message(Chat::Cyan, "spawned - selects all spawned bots"); + c->Message(Chat::Cyan, "all - selects all spawned bots .. argument use indicates en masse database updating"); - c->Message(m_message, "You may only select your bots as actionable"); + c->Message(Chat::White, "You may only select your bots as actionable"); } void bot_command_aggressive(Client *c, const Seperator *sep) @@ -2558,7 +2551,7 @@ void bot_command_aggressive(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Stance) || helper_command_alias_fail(c, "bot_command_aggressive", sep->arg[0], "aggressive")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotationtargets | spawned] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotationtargets | spawned] ([actionable_name]))", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Stance); return; } @@ -2602,7 +2595,7 @@ void bot_command_aggressive(Client *c, const Seperator *sep) } } - c->Message(m_action, "%i of %i bots have used aggressive disciplines", success_count, candidate_count); + c->Message(Chat::Yellow, "%i of %i bots have used aggressive disciplines", success_count, candidate_count); } void bot_command_apply_poison(Client *c, const Seperator *sep) @@ -2615,7 +2608,7 @@ void bot_command_apply_poison(Client *c, const Seperator *sep) } if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s", sep->arg[0]); return; } @@ -2625,26 +2618,26 @@ void bot_command_apply_poison(Client *c, const Seperator *sep) } if (!my_rogue_bot) { - c->Message(m_fail, "You must target a rogue bot that you own to use this command!"); + c->Message(Chat::Red, "You must target a rogue bot that you own to use this command!"); return; } if (my_rogue_bot->GetLevel() < 18) { - c->Message(m_fail, "Your rogue bot must be level 18 before %s can apply poison!", (my_rogue_bot->GetGender() == 1 ? "she" : "he")); + c->Message(Chat::Red, "Your rogue bot must be level 18 before %s can apply poison!", (my_rogue_bot->GetGender() == 1 ? "she" : "he")); return; } const auto poison_instance = c->GetInv().GetItem(EQ::invslot::slotCursor); if (!poison_instance) { - c->Message(m_fail, "No item found on cursor!"); + c->Message(Chat::Red, "No item found on cursor!"); return; } auto poison_data = poison_instance->GetItem(); if (!poison_data) { - c->Message(m_fail, "No data found for cursor item!"); + c->Message(Chat::Red, "No data found for cursor item!"); return; } @@ -2652,13 +2645,13 @@ void bot_command_apply_poison(Client *c, const Seperator *sep) if ((~poison_data->Races) & GetPlayerRaceBit(my_rogue_bot->GetRace())) { - c->Message(m_fail, "Invalid race for weapon poison!"); + c->Message(Chat::Red, "Invalid race for weapon poison!"); return; } if (poison_data->Proc.Level2 > my_rogue_bot->GetLevel()) { - c->Message(m_fail, "This poison is too powerful for your intended target!"); + c->Message(Chat::Red, "This poison is too powerful for your intended target!"); return; } @@ -2671,17 +2664,17 @@ void bot_command_apply_poison(Client *c, const Seperator *sep) bool apply_poison_chance = (ChanceRoll < (.75 + poison_skill / 1000)); if (apply_poison_chance && my_rogue_bot->AddProcToWeapon(poison_data->Proc.Effect, false, (my_rogue_bot->GetDEX() / 100) + 103, POISON_PROC)) { - c->Message(m_action, "Successfully applied %s to %s's weapon.", poison_data->Name, my_rogue_bot->GetCleanName()); + c->Message(Chat::Yellow, "Successfully applied %s to %s's weapon.", poison_data->Name, my_rogue_bot->GetCleanName()); } else { - c->Message(m_fail, "Failed to apply %s to %s's weapon.", poison_data->Name, my_rogue_bot->GetCleanName()); + c->Message(Chat::Red, "Failed to apply %s to %s's weapon.", poison_data->Name, my_rogue_bot->GetCleanName()); } c->DeleteItemInInventory(EQ::invslot::slotCursor, 1, true); } else { - c->Message(m_fail, "Item on cursor is not a weapon poison!"); + c->Message(Chat::Red, "Item on cursor is not a weapon poison!"); return; } } @@ -2696,7 +2689,7 @@ void bot_command_apply_potion(Client* c, const Seperator* sep) } if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s", sep->arg[0]); return; } @@ -2706,21 +2699,21 @@ void bot_command_apply_potion(Client* c, const Seperator* sep) } if (!my_bot) { - c->Message(m_fail, "You must target a bot that you own to use this command!"); + c->Message(Chat::Red, "You must target a bot that you own to use this command!"); return; } const auto potion_instance = c->GetInv().GetItem(EQ::invslot::slotCursor); if (!potion_instance) { - c->Message(m_fail, "No item found on cursor!"); + c->Message(Chat::Red, "No item found on cursor!"); return; } auto potion_data = potion_instance->GetItem(); if (!potion_data) { - c->Message(m_fail, "No data found for cursor item!"); + c->Message(Chat::Red, "No data found for cursor item!"); return; } @@ -2728,39 +2721,39 @@ void bot_command_apply_potion(Client* c, const Seperator* sep) if (RuleB(Bots, RestrictApplyPotionToRogue) && potion_data->Classes != PLAYER_CLASS_ROGUE_BIT) { - c->Message(m_fail, "This command is restricted to rogue poison potions only!"); + c->Message(Chat::Red, "This command is restricted to rogue poison potions only!"); return; } if ((~potion_data->Races) & GetPlayerRaceBit(my_bot->GetRace())) { - c->Message(m_fail, "Invalid race for potion!"); + c->Message(Chat::Red, "Invalid race for potion!"); return; } if ((~potion_data->Classes) & GetPlayerClassBit(my_bot->GetClass())) { - c->Message(m_fail, "Invalid class for potion!"); + c->Message(Chat::Red, "Invalid class for potion!"); return; } if (potion_data->Click.Level2 > my_bot->GetLevel()) { - c->Message(m_fail, "This potion is too powerful for your intended target!"); + c->Message(Chat::Red, "This potion is too powerful for your intended target!"); return; } // TODO: figure out best way to handle casting time/animation if (my_bot->SpellFinished(potion_data->Click.Effect, my_bot, EQ::spells::CastingSlot::Item, 0)) { - c->Message(m_action, "Successfully applied %s to %s's buff effects.", potion_data->Name, my_bot->GetCleanName()); + c->Message(Chat::Yellow, "Successfully applied %s to %s's buff effects.", potion_data->Name, my_bot->GetCleanName()); } else { - c->Message(m_fail, "Failed to apply %s to %s's buff effects.", potion_data->Name, my_bot->GetCleanName()); + c->Message(Chat::Red, "Failed to apply %s to %s's buff effects.", potion_data->Name, my_bot->GetCleanName()); } c->DeleteItemInInventory(EQ::invslot::slotCursor, 1, true); } else { - c->Message(m_fail, "Item on cursor is not a potion!"); + c->Message(Chat::Red, "Item on cursor is not a potion!"); return; } } @@ -2772,7 +2765,7 @@ void bot_command_attack(Client *c, const Seperator *sep) } if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [actionable: byname | ownergroup | botgroup | namesgroup | healrotation | default: spawned] ([actionable_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [actionable: byname | ownergroup | botgroup | namesgroup | healrotation | default: spawned] ([actionable_name])", sep->arg[0]); return; } const int ab_mask = ActionableBots::ABM_Type2; @@ -2780,7 +2773,7 @@ void bot_command_attack(Client *c, const Seperator *sep) Mob* target_mob = ActionableTarget::AsSingle_ByAttackable(c); if (!target_mob) { - c->Message(m_fail, "You must an enemy to use this command"); + c->Message(Chat::Red, "You must an enemy to use this command"); return; } @@ -2814,7 +2807,7 @@ void bot_command_attack(Client *c, const Seperator *sep) Bot::BotGroupSay(first_attacker, "Attacking %s!", target_mob->GetCleanName()); } else { - c->Message(m_action, "%i of your bots are attacking %s!", sbl.size(), target_mob->GetCleanName()); + c->Message(Chat::Yellow, "%i of your bots are attacking %s!", sbl.size(), target_mob->GetCleanName()); } } @@ -2824,7 +2817,7 @@ void bot_command_bind_affinity(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_BindAffinity) || helper_command_alias_fail(c, "bot_command_bind_affinity", sep->arg[0], "bindaffinity")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_BindAffinity); return; } @@ -2849,9 +2842,9 @@ void bot_command_bind_affinity(Client *c, const Seperator *sep) // Cast effect message is not being generated if (helper_cast_standard_spell(my_bot, target_mob, local_entry->spell_id)) - c->Message(m_action, "Successfully bound %s to this location", target_mob->GetCleanName()); + c->Message(Chat::Yellow, "Successfully bound %s to this location", target_mob->GetCleanName()); else - c->Message(m_fail, "Failed to bind %s to this location", target_mob->GetCleanName()); + c->Message(Chat::Red, "Failed to bind %s to this location", target_mob->GetCleanName()); break; } @@ -2926,7 +2919,7 @@ void bot_command_charm(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Charm) || helper_command_alias_fail(c, "bot_command_charm", sep->arg[0], "charm")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([option: dire])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([option: dire])", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Charm); return; } @@ -2952,7 +2945,7 @@ void bot_command_charm(Client *c, const Seperator *sep) if (!target_mob) continue; if (target_mob->IsCharmed()) { - c->Message(m_fail, "Your is already charmed"); + c->Message(Chat::Red, "Your is already charmed"); return; } @@ -2979,7 +2972,7 @@ void bot_command_cure(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Cure) || helper_command_alias_fail(c, "bot_command_cure", sep->arg[0], "cure")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s [ailment: blindness | disease | poison | curse | corruption]", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s [ailment: blindness | disease | poison | curse | corruption]", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Cure); return; } @@ -2999,7 +2992,7 @@ void bot_command_cure(Client *c, const Seperator *sep) ailment_type = BCEnum::AT_Corruption; if (ailment_type == BCEnum::AT_None) { - c->Message(m_fail, "You must specify a cure [ailment] to use this command"); + c->Message(Chat::Red, "You must specify a cure [ailment] to use this command"); return; } @@ -3049,7 +3042,7 @@ void bot_command_defensive(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Stance) || helper_command_alias_fail(c, "bot_command_defensive", sep->arg[0], "defensive")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotationtargets | spawned] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotationtargets | spawned] ([actionable_name]))", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Stance); return; } @@ -3093,7 +3086,7 @@ void bot_command_defensive(Client *c, const Seperator *sep) } } - c->Message(m_action, "%i of %i bots have used defensive disciplines", success_count, candidate_count); + c->Message(Chat::Yellow, "%i of %i bots have used defensive disciplines", success_count, candidate_count); } void bot_command_depart(Client *c, const Seperator *sep) @@ -3102,7 +3095,7 @@ void bot_command_depart(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Depart) || helper_command_alias_fail(c, "bot_command_depart", sep->arg[0], "depart")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [list | destination] ([option: single])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [list | destination] ([option: single])", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Depart); return; } @@ -3120,7 +3113,7 @@ void bot_command_depart(Client *c, const Seperator *sep) return; } else if (destination.empty()) { - c->Message(m_fail, "A [destination] or [list] argument is required to use this command"); + c->Message(Chat::Red, "A [destination] or [list] argument is required to use this command"); return; } @@ -3160,7 +3153,7 @@ void bot_command_escape(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Escape) || helper_command_alias_fail(c, "bot_command_escape", sep->arg[0], "escape")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([option: lesser])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([option: lesser])", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Escape); return; } @@ -3202,33 +3195,33 @@ void bot_command_find_aliases(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_command_find_aliases", sep->arg[0], "findaliases")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [alias | command]", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [alias | command]", sep->arg[0]); return; } auto find_iter = bot_command_aliases.find(sep->arg[1]); if (find_iter == bot_command_aliases.end()) { - c->Message(m_fail, "No bot commands or aliases match '%s'", sep->arg[1]); + c->Message(Chat::Red, "No bot commands or aliases match '%s'", sep->arg[1]); return; } auto command_iter = bot_command_list.find(find_iter->second); if (find_iter->second.empty() || command_iter == bot_command_list.end()) { - c->Message(m_unknown, "An unknown condition has occurred..."); + c->Message(Chat::Magenta, "An unknown condition has occurred..."); return; } - c->Message(m_message, "Available bot command aliases for '%s':", command_iter->first.c_str()); + c->Message(Chat::White, "Available bot command aliases for '%s':", command_iter->first.c_str()); int bot_command_aliases_shown = 0; for (auto alias_iter : bot_command_aliases) { if (strcasecmp(find_iter->second.c_str(), alias_iter.second.c_str()) || c->Admin() < command_iter->second->access) continue; - c->Message(m_usage, "%c%s", BOT_COMMAND_CHAR, alias_iter.first.c_str()); + c->Message(Chat::Cyan, "%c%s", BOT_COMMAND_CHAR, alias_iter.first.c_str()); ++bot_command_aliases_shown; } - c->Message(m_message, "%d bot command alias%s listed.", bot_command_aliases_shown, bot_command_aliases_shown != 1 ? "es" : ""); + c->Message(Chat::White, "%d bot command alias%s listed.", bot_command_aliases_shown, bot_command_aliases_shown != 1 ? "es" : ""); } void bot_command_follow(Client *c, const Seperator *sep) @@ -3236,8 +3229,8 @@ void bot_command_follow(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_command_follow", sep->arg[0], "follow")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([option: reset]) [actionable: byname | ownergroup | botgroup | namesgroup | healrotation | spawned] ([actionable_name])", sep->arg[0]); - c->Message(m_usage, "usage: %s chain", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([option: reset]) [actionable: byname | ownergroup | botgroup | namesgroup | healrotation | spawned] ([actionable_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s chain", sep->arg[0]); return; } const int ab_mask = ActionableBots::ABM_Type2; @@ -3251,7 +3244,7 @@ void bot_command_follow(Client *c, const Seperator *sep) if (!optional_arg.compare("chain")) { auto chain_count = helper_bot_follow_option_chain(c); - c->Message(m_action, "%i of your bots %s now chain following you", chain_count, (chain_count == 1 ? "is" : "are")); + c->Message(Chat::Yellow, "%i of your bots %s now chain following you", chain_count, (chain_count == 1 ? "is" : "are")); return; } @@ -3263,7 +3256,7 @@ void bot_command_follow(Client *c, const Seperator *sep) else { target_mob = ActionableTarget::VerifyFriendly(c, BCEnum::TT_Single); if (!target_mob) { - c->Message(m_fail, "You must a friendly mob to use this command"); + c->Message(Chat::Red, "You must a friendly mob to use this command"); return; } } @@ -3310,9 +3303,9 @@ void bot_command_follow(Client *c, const Seperator *sep) } else { if (reset) - c->Message(m_action, "%i of your bots are following their default assignments", sbl.size()); + c->Message(Chat::Yellow, "%i of your bots are following their default assignments", sbl.size()); else - c->Message(m_action, "%i of your bots are following %s", sbl.size(), target_mob->GetCleanName()); + c->Message(Chat::Yellow, "%i of your bots are following %s", sbl.size(), target_mob->GetCleanName()); } } @@ -3323,7 +3316,7 @@ void bot_command_guard(Client *c, const Seperator *sep) } if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([option: clear]) [actionable: target | byname | ownergroup | botgroup | namesgroup | healrotation | spawned] ([actionable_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([option: clear]) [actionable: target | byname | ownergroup | botgroup | namesgroup | healrotation | spawned] ([actionable_name])", sep->arg[0]); return; } const int ab_mask = (ActionableBots::ABM_Target | ActionableBots::ABM_Type2); @@ -3360,7 +3353,7 @@ void bot_command_guard(Client *c, const Seperator *sep) Bot::BotGroupSay(sbl.front(), "%suarding this position.", (clear ? "No longer g" : "G")); } else { - c->Message(m_action, "%i of your bots are %sguarding their positions.", sbl.size(), (clear ? "no longer " : "")); + c->Message(Chat::Yellow, "%i of your bots are %sguarding their positions.", sbl.size(), (clear ? "no longer " : "")); } } @@ -3425,7 +3418,7 @@ void bot_command_help(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_command_help", sep->arg[0], "help")) return; - c->Message(m_message, "Available EQEMu bot commands:"); + c->Message(Chat::White, "Available EQEMu bot commands:"); int bot_commands_shown = 0; for (auto command_iter : bot_command_list) { @@ -3434,7 +3427,7 @@ void bot_command_help(Client *c, const Seperator *sep) if (c->Admin() < command_iter.second->access) continue; - c->Message(m_usage, "%c%s - %s", BOT_COMMAND_CHAR, command_iter.first.c_str(), command_iter.second->desc == nullptr ? "[no description]" : command_iter.second->desc); + c->Message(Chat::Cyan, "%c%s - %s", BOT_COMMAND_CHAR, command_iter.first.c_str(), command_iter.second->desc == nullptr ? "[no description]" : command_iter.second->desc); ++bot_commands_shown; } if (parse->PlayerHasQuestSub(EVENT_BOT_COMMAND)) { @@ -3443,8 +3436,8 @@ void bot_command_help(Client *c, const Seperator *sep) bot_commands_shown += i; } } - c->Message(m_message, "%d bot command%s listed.", bot_commands_shown, bot_commands_shown != 1 ? "s" : ""); - c->Message(m_note, "type %ccommand [help | usage] for more information", BOT_COMMAND_CHAR); + c->Message(Chat::White, "%d bot command%s listed.", bot_commands_shown, bot_commands_shown != 1 ? "s" : ""); + c->Message(Chat::Gray, "type %ccommand [help | usage] for more information", BOT_COMMAND_CHAR); } void bot_command_hold(Client *c, const Seperator *sep) @@ -3454,7 +3447,7 @@ void bot_command_hold(Client *c, const Seperator *sep) } if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([option: clear]) [actionable: target | byname | ownergroup | botgroup | namesgroup | healrotation | spawned] ([actionable_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([option: clear]) [actionable: target | byname | ownergroup | botgroup | namesgroup | healrotation | spawned] ([actionable_name])", sep->arg[0]); return; } const int ab_mask = (ActionableBots::ABM_Target | ActionableBots::ABM_Type2); @@ -3491,7 +3484,7 @@ void bot_command_hold(Client *c, const Seperator *sep) Bot::BotGroupSay(sbl.front(), "%solding my attacks.", (clear ? "No longer h" : "H")); } else { - c->Message(m_action, "%i of your bots are %sholding their attacks.", sbl.size(), (clear ? "no longer " : "")); + c->Message(Chat::Yellow, "%i of your bots are %sholding their attacks.", sbl.size(), (clear ? "no longer " : "")); } } @@ -3501,7 +3494,7 @@ void bot_command_identify(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Identify) || helper_command_alias_fail(c, "bot_command_identify", sep->arg[0], "identify")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Identify); return; } @@ -3558,7 +3551,7 @@ void bot_command_invisibility(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Invisibility) || helper_command_alias_fail(c, "bot_command_invisibility", sep->arg[0], "invisibility")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s [invisibility: living | undead | animal | see]", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s [invisibility: living | undead | animal | see]", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Invisibility); return; } @@ -3576,7 +3569,7 @@ void bot_command_invisibility(Client *c, const Seperator *sep) invisibility_type = BCEnum::IT_See; if (invisibility_type == BCEnum::IT_None) { - c->Message(m_fail, "You must specify an [invisibility]"); + c->Message(Chat::Red, "You must specify an [invisibility]"); return; } @@ -3612,7 +3605,7 @@ void bot_command_item_use(Client* c, const Seperator* sep) { if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([empty])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([empty])", sep->arg[0]); return; } @@ -3625,20 +3618,20 @@ void bot_command_item_use(Client* c, const Seperator* sep) const auto item_instance = c->GetInv().GetItem(EQ::invslot::slotCursor); if (!item_instance) { - c->Message(m_fail, "No item found on cursor!"); + c->Message(Chat::Red, "No item found on cursor!"); return; } auto item_data = item_instance->GetItem(); if (!item_data) { - c->Message(m_fail, "No data found for cursor item!"); + c->Message(Chat::Red, "No data found for cursor item!"); return; } if (item_data->ItemClass != EQ::item::ItemClassCommon || item_data->Slots == 0) { - c->Message(m_fail, "'%s' is not an equipable item!", item_data->Name); + c->Message(Chat::Red, "'%s' is not an equipable item!", item_data->Name); return; } @@ -3713,7 +3706,7 @@ void bot_command_levitation(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Levitation) || helper_command_alias_fail(c, "bot_command_levitation", sep->arg[0], "levitation")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Levitation); return; } @@ -3750,7 +3743,7 @@ void bot_command_lull(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Lull) || helper_command_alias_fail(c, "bot_command_lull", sep->arg[0], "lull")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Lull); return; } @@ -3792,7 +3785,7 @@ void bot_command_mesmerize(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Mesmerize) || helper_command_alias_fail(c, "bot_command_mesmerize", sep->arg[0], "mesmerize")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Mesmerize); return; } @@ -3834,7 +3827,7 @@ void bot_command_movement_speed(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_MovementSpeed) || helper_command_alias_fail(c, "bot_command_movement_speed", sep->arg[0], "movementspeed")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([group | sow])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([group | sow])", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_MovementSpeed); return; } @@ -3881,7 +3874,7 @@ void bot_command_owner_option(Client *c, const Seperator *sep) { if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [option] [argument]", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [option] [argument]", sep->arg[0]); std::string window_title = "Bot Owner Options"; std::string window_text = @@ -3990,7 +3983,7 @@ void bot_command_owner_option(Client *c, const Seperator *sep) database.botdb.SaveOwnerOption(c->CharacterID(), Client::booDeathMarquee, c->GetBotOption(Client::booDeathMarquee)); - c->Message(m_action, "Bot 'death marquee' is now %s.", (c->GetBotOption(Client::booDeathMarquee) == true ? "enabled" : "disabled")); + c->Message(Chat::Yellow, "Bot 'death marquee' is now %s.", (c->GetBotOption(Client::booDeathMarquee) == true ? "enabled" : "disabled")); } else if (!owner_option.compare("statsupdate")) { @@ -4006,7 +3999,7 @@ void bot_command_owner_option(Client *c, const Seperator *sep) database.botdb.SaveOwnerOption(c->CharacterID(), Client::booStatsUpdate, c->GetBotOption(Client::booStatsUpdate)); - c->Message(m_action, "Bot 'stats update' is now %s.", (c->GetBotOption(Client::booStatsUpdate) == true ? "enabled" : "disabled")); + c->Message(Chat::Yellow, "Bot 'stats update' is now %s.", (c->GetBotOption(Client::booStatsUpdate) == true ? "enabled" : "disabled")); } else if (!owner_option.compare("spawnmessage")) { @@ -4042,7 +4035,7 @@ void bot_command_owner_option(Client *c, const Seperator *sep) } else { - c->Message(m_fail, "Owner option '%s' argument '%s' is not recognized.", owner_option.c_str(), argument.c_str()); + c->Message(Chat::Red, "Owner option '%s' argument '%s' is not recognized.", owner_option.c_str(), argument.c_str()); return; } @@ -4070,11 +4063,11 @@ void bot_command_owner_option(Client *c, const Seperator *sep) } else { - c->Message(m_action, "Bot 'spawn message' is now ERROR."); + c->Message(Chat::Yellow, "Bot 'spawn message' is now ERROR."); return; } - c->Message(m_action, "Bot 'spawn message' is now %s.", argument.c_str()); + c->Message(Chat::Yellow, "Bot 'spawn message' is now %s.", argument.c_str()); } else if (!owner_option.compare("altcombat")) { @@ -4092,10 +4085,10 @@ void bot_command_owner_option(Client *c, const Seperator *sep) database.botdb.SaveOwnerOption(c->CharacterID(), Client::booAltCombat, c->GetBotOption(Client::booAltCombat)); - c->Message(m_action, "Bot 'alt combat' is now %s.", (c->GetBotOption(Client::booAltCombat) == true ? "enabled" : "disabled")); + c->Message(Chat::Yellow, "Bot 'alt combat' is now %s.", (c->GetBotOption(Client::booAltCombat) == true ? "enabled" : "disabled")); } else { - c->Message(m_fail, "Bot owner option 'altcombat' is not allowed on this server."); + c->Message(Chat::Red, "Bot owner option 'altcombat' is not allowed on this server."); } } else if (!owner_option.compare("autodefend")) { @@ -4114,10 +4107,10 @@ void bot_command_owner_option(Client *c, const Seperator *sep) database.botdb.SaveOwnerOption(c->CharacterID(), Client::booAutoDefend, c->GetBotOption(Client::booAutoDefend)); - c->Message(m_action, "Bot 'auto defend' is now %s.", (c->GetBotOption(Client::booAutoDefend) == true ? "enabled" : "disabled")); + c->Message(Chat::Yellow, "Bot 'auto defend' is now %s.", (c->GetBotOption(Client::booAutoDefend) == true ? "enabled" : "disabled")); } else { - c->Message(m_fail, "Bot owner option 'autodefend' is not allowed on this server."); + c->Message(Chat::Red, "Bot owner option 'autodefend' is not allowed on this server."); } } else if (!owner_option.compare("buffcounter")) { @@ -4134,7 +4127,7 @@ void bot_command_owner_option(Client *c, const Seperator *sep) database.botdb.SaveOwnerOption(c->CharacterID(), Client::booBuffCounter, c->GetBotOption(Client::booBuffCounter)); - c->Message(m_action, "Bot 'buff counter' is now %s.", (c->GetBotOption(Client::booBuffCounter) == true ? "enabled" : "disabled")); + c->Message(Chat::Yellow, "Bot 'buff counter' is now %s.", (c->GetBotOption(Client::booBuffCounter) == true ? "enabled" : "disabled")); } else if (!owner_option.compare("monkwumessage")) { @@ -4150,7 +4143,7 @@ void bot_command_owner_option(Client *c, const Seperator *sep) database.botdb.SaveOwnerOption(c->CharacterID(), Client::booMonkWuMessage, c->GetBotOption(Client::booMonkWuMessage)); - c->Message(m_action, "Bot 'monk wu message' is now %s.", (c->GetBotOption(Client::booMonkWuMessage) == true ? "enabled" : "disabled")); + c->Message(Chat::Yellow, "Bot 'monk wu message' is now %s.", (c->GetBotOption(Client::booMonkWuMessage) == true ? "enabled" : "disabled")); } else if (!owner_option.compare("current")) { @@ -4183,7 +4176,7 @@ void bot_command_owner_option(Client *c, const Seperator *sep) c->SendPopupToClient(window_title.c_str(), window_text.c_str()); } else { - c->Message(m_fail, "Owner option '%s' is not recognized.", owner_option.c_str()); + c->Message(Chat::Red, "Owner option '%s' is not recognized.", owner_option.c_str()); } } @@ -4211,9 +4204,9 @@ void bot_command_pick_lock(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_command_pick_lock", sep->arg[0], "picklock")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s", sep->arg[0]); - c->Message(m_note, "requires one of the following bot classes:"); - c->Message(m_message, "Rogue(5) or Bard(40)"); + c->Message(Chat::Cyan, "usage: %s", sep->arg[0]); + c->Message(Chat::Gray, "requires one of the following bot classes:"); + c->Message(Chat::White, "Rogue(5) or Bard(40)"); return; } @@ -4223,7 +4216,7 @@ void bot_command_pick_lock(Client *c, const Seperator *sep) float pick_lock_value = 0.0f; ActionableBots::Filter_ByHighestPickLock(c, sbl, pick_lock_value); if (sbl.empty()) { - c->Message(m_fail, "No bots are capable of performing this action"); + c->Message(Chat::Red, "No bots are capable of performing this action"); return; } @@ -4260,7 +4253,7 @@ void bot_command_pick_lock(Client *c, const Seperator *sep) Bot::BotGroupSay(my_bot, "I am not skilled enough for this lock..."); } } - c->Message(m_action, "%i door%s attempted - %i door%s successful", door_count, ((door_count != 1) ? ("s") : ("")), open_count, ((open_count != 1) ? ("s") : (""))); + c->Message(Chat::Yellow, "%i door%s attempted - %i door%s successful", door_count, ((door_count != 1) ? ("s") : ("")), open_count, ((open_count != 1) ? ("s") : (""))); } void bot_command_precombat(Client* c, const Seperator* sep) @@ -4270,13 +4263,13 @@ void bot_command_precombat(Client* c, const Seperator* sep) } if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([set | clear])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([set | clear])", sep->arg[0]); return; } if (!c->GetTarget() || !c->IsAttackAllowed(c->GetTarget())) { - c->Message(m_fail, "This command requires an attackable target."); + c->Message(Chat::Red, "This command requires an attackable target."); return; } @@ -4292,7 +4285,7 @@ void bot_command_precombat(Client* c, const Seperator* sep) c->SetBotPrecombat(!c->GetBotPrecombat()); } - c->Message(m_action, "Precombat flag is now %s.", (c->GetBotPrecombat() == true ? "set" : "clear")); + c->Message(Chat::Yellow, "Precombat flag is now %s.", (c->GetBotPrecombat() == true ? "set" : "clear")); } // TODO: Rework to allow owner specificed criteria for puller @@ -4303,7 +4296,7 @@ void bot_command_pull(Client *c, const Seperator *sep) } if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s", sep->arg[0]); return; } int ab_mask = ActionableBots::ABM_OwnerGroup; // existing behavior - need to add c->IsGrouped() check and modify code if different behavior is desired @@ -4317,13 +4310,13 @@ void bot_command_pull(Client *c, const Seperator *sep) auto target_mob = ActionableTarget::VerifyEnemy(c, BCEnum::TT_Single); if (!target_mob) { - c->Message(m_fail, "Your current target is not attackable!"); + c->Message(Chat::Red, "Your current target is not attackable!"); return; } if (target_mob->IsNPC() && target_mob->GetHateList().size()) { - c->Message(m_fail, "Your current target is already engaged!"); + c->Message(Chat::Red, "Your current target is already engaged!"); return; } @@ -4417,7 +4410,7 @@ void bot_command_release(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_command_release", sep->arg[0], "release")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([actionable: ] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([actionable: ] ([actionable_name]))", sep->arg[0]); return; } const int ab_mask = ActionableBots::ABM_NoFilter; @@ -4432,7 +4425,7 @@ void bot_command_release(Client *c, const Seperator *sep) bot_iter->SetPauseAI(false); } - c->Message(m_action, "%i of your bots %s released.", sbl.size(), ((sbl.size() != 1) ? ("are") : ("is"))); + c->Message(Chat::Yellow, "%i of your bots %s released.", sbl.size(), ((sbl.size() != 1) ? ("are") : ("is"))); } void bot_command_resistance(Client *c, const Seperator *sep) @@ -4441,7 +4434,7 @@ void bot_command_resistance(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Resistance) || helper_command_alias_fail(c, "bot_command_resistance", sep->arg[0], "resistance")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s [resistance: fire | cold | poison | disease | magic | corruption]", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s [resistance: fire | cold | poison | disease | magic | corruption]", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Resistance); return; } @@ -4463,7 +4456,7 @@ void bot_command_resistance(Client *c, const Seperator *sep) resistance_type = BCEnum::RT_Corruption; if (resistance_type == BCEnum::RT_None) { - c->Message(m_fail, "You must specify a [resistance]"); + c->Message(Chat::Red, "You must specify a [resistance]"); return; } @@ -4515,8 +4508,8 @@ void bot_command_resurrect(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Resurrect) || helper_command_alias_fail(c, "bot_command_resurrect", sep->arg[0], "resurrect")) return; if (helper_is_help_or_usage(sep->arg[1])) { - //c->Message(m_usage, "usage: %s ([option: aoe])", sep->arg[0]); - c->Message(m_usage, "usage: %s", sep->arg[0]); + //c->Message(Chat::Cyan, "usage: %s ([option: aoe])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Resurrect); return; } @@ -4569,7 +4562,7 @@ void bot_command_rune(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Rune) || helper_command_alias_fail(c, "bot_command_rune", sep->arg[0], "rune")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Rune); return; } @@ -4608,7 +4601,7 @@ void bot_command_send_home(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_SendHome) || helper_command_alias_fail(c, "bot_command_send_home", sep->arg[0], "sendhome")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([option: group])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([option: group])", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_SendHome); return; } @@ -4652,7 +4645,7 @@ void bot_command_size(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Size) || helper_command_alias_fail(c, "bot_command_size", sep->arg[0], "size")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s [grow | shrink]", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s [grow | shrink]", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Size); return; } @@ -4663,7 +4656,7 @@ void bot_command_size(Client *c, const Seperator *sep) size_type = BCEnum::SzT_Enlarge; } else if (size_arg.compare("shrink")) { - c->Message(m_fail, "This command requires a [grow | shrink] argument"); + c->Message(Chat::Red, "This command requires a [grow | shrink] argument"); return; } @@ -4700,14 +4693,14 @@ void bot_command_summon_corpse(Client *c, const Seperator *sep) // Same methodology as old command..but, does not appear to work... (note: didn't work there, either...) // temp - c->Message(m_fail, "This command is currently unavailable..."); + c->Message(Chat::Red, "This command is currently unavailable..."); return; bcst_list* local_list = &bot_command_spells[BCEnum::SpT_SummonCorpse]; if (helper_spell_list_fail(c, local_list, BCEnum::SpT_SummonCorpse) || helper_command_alias_fail(c, "bot_command_summon_corpse", sep->arg[0], "summoncorpse")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_SummonCorpse); return; } @@ -4747,7 +4740,7 @@ void bot_command_suspend(Client *c, const Seperator *sep) return; } if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([actionable: ] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([actionable: ] ([actionable_name]))", sep->arg[0]); return; } const int ab_mask = ActionableBots::ABM_NoFilter; @@ -4762,7 +4755,7 @@ void bot_command_suspend(Client *c, const Seperator *sep) bot_iter->SetPauseAI(true); } - c->Message(m_action, "%i of your bots %s suspended.", sbl.size(), ((sbl.size() != 1) ? ("are") : ("is"))); + c->Message(Chat::Yellow, "%i of your bots %s suspended.", sbl.size(), ((sbl.size() != 1) ? ("are") : ("is"))); } void bot_command_taunt(Client *c, const Seperator *sep) @@ -4770,7 +4763,7 @@ void bot_command_taunt(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_command_taunt", sep->arg[0], "taunt")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([option: on | off]) ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotationtargets | spawned] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([option: on | off]) ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotationtargets | spawned] ([actionable_name]))", sep->arg[0]); return; } const int ab_mask = ActionableBots::ABM_Type1; @@ -4826,12 +4819,12 @@ void bot_command_taunt(Client *c, const Seperator *sep) if (taunting_count) { if (toggle_taunt) - c->Message(m_action, "%i of your bots and their pets %s toggled their taunting state", taunting_count, ((taunting_count != 1) ? ("have") : ("has"))); + c->Message(Chat::Yellow, "%i of your bots and their pets %s toggled their taunting state", taunting_count, ((taunting_count != 1) ? ("have") : ("has"))); else - c->Message(m_action, "%i of your bots and their pets %s %s taunting", taunting_count, ((taunting_count != 1) ? ("have") : ("has")), ((taunt_state) ? ("started") : ("stopped"))); + c->Message(Chat::Yellow, "%i of your bots and their pets %s %s taunting", taunting_count, ((taunting_count != 1) ? ("have") : ("has")), ((taunt_state) ? ("started") : ("stopped"))); } else { - c->Message(m_fail, "None of your bots are capable of taunting"); + c->Message(Chat::Red, "None of your bots are capable of taunting"); } } @@ -4840,9 +4833,9 @@ void bot_command_track(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_command_track", sep->arg[0], "track")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s (Ranger: [option=all: all | rare | local])", sep->arg[0]); - c->Message(m_note, "requires one of the following bot classes:"); - c->Message(m_message, "Ranger(1), Druid(20) or Bard(35)"); + c->Message(Chat::Cyan, "usage: %s (Ranger: [option=all: all | rare | local])", sep->arg[0]); + c->Message(Chat::Gray, "requires one of the following bot classes:"); + c->Message(Chat::White, "Ranger(1), Druid(20) or Bard(35)"); return; } @@ -4862,7 +4855,7 @@ void bot_command_track(Client *c, const Seperator *sep) my_bot = ActionableBots::AsSpawned_ByMinLevelAndClass(c, sbl, 35, BARD); } if (!my_bot) { - c->Message(m_fail, "No bots are capable of performing this action"); + c->Message(Chat::Red, "No bots are capable of performing this action"); return; } @@ -4897,7 +4890,7 @@ void bot_command_track(Client *c, const Seperator *sep) return; } if (!base_distance) { - c->Message(m_unknown, "An unknown codition has occurred"); + c->Message(Chat::Magenta, "An unknown codition has occurred"); return; } @@ -4912,7 +4905,7 @@ void bot_command_water_breathing(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_WaterBreathing) || helper_command_alias_fail(c, "bot_command_water_breathing", sep->arg[0], "waterbreathing")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_WaterBreathing); return; } @@ -4981,19 +4974,19 @@ void bot_subcommand_bot_beard_color(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_beard_color", sep->arg[0], "botbeardcolor")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [value: 0-n] (Dwarves or male bots only)", sep->arg[0]); - c->Message(m_note, "note: Actual limit is filter-based"); + c->Message(Chat::Cyan, "usage: %s [value: 0-n] (Dwarves or male bots only)", sep->arg[0]); + c->Message(Chat::Gray, "note: Actual limit is filter-based"); return; } auto my_bot = ActionableBots::AsTarget_ByBot(c); if (!my_bot) { - c->Message(m_fail, "You must a bot that you own to use this command"); + c->Message(Chat::Red, "You must a bot that you own to use this command"); return; } if (!sep->IsNumber(1)) { - c->Message(m_fail, "A numeric [value] is required to use this command"); + c->Message(Chat::Red, "A numeric [value] is required to use this command"); return; } @@ -5018,19 +5011,19 @@ void bot_subcommand_bot_beard_style(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_beard_style", sep->arg[0], "botbeardstyle")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [value: 0-n] (Dwarves or male bots only)", sep->arg[0]); - c->Message(m_note, "note: Actual limit is filter-based"); + c->Message(Chat::Cyan, "usage: %s [value: 0-n] (Dwarves or male bots only)", sep->arg[0]); + c->Message(Chat::Gray, "note: Actual limit is filter-based"); return; } auto my_bot = ActionableBots::AsTarget_ByBot(c); if (!my_bot) { - c->Message(m_fail, "You must a bot that you own to use this command"); + c->Message(Chat::Red, "You must a bot that you own to use this command"); return; } if (!sep->IsNumber(1)) { - c->Message(m_fail, "A numeric [value] is required to use this command"); + c->Message(Chat::Red, "A numeric [value] is required to use this command"); return; } @@ -5055,7 +5048,7 @@ void bot_subcommand_bot_camp(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_camp", sep->arg[0], "botcamp")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); return; } const int ab_mask = ActionableBots::ABM_NoFilter; @@ -5073,30 +5066,30 @@ void bot_subcommand_bot_clone(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_clone", sep->arg[0], "botclone")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [clone_name]", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [clone_name]", sep->arg[0]); return; } auto my_bot = ActionableBots::AsTarget_ByBot(c); if (!my_bot) { - c->Message(m_fail, "You must a bot that you own to use this command"); + c->Message(Chat::Red, "You must a bot that you own to use this command"); return; } if (!my_bot->GetBotID()) { - c->Message(m_unknown, "An unknown error has occured - BotName: %s, BotID: %u", my_bot->GetCleanName(), my_bot->GetBotID()); + c->Message(Chat::Magenta, "An unknown error has occured - BotName: %s, BotID: %u", my_bot->GetCleanName(), my_bot->GetBotID()); LogCommands("bot_command_clone(): - Error: Active bot reported invalid ID (BotName: [{}], BotID: [{}], OwnerName: [{}], OwnerID: [{}], AcctName: [{}], AcctID: [{}])", my_bot->GetCleanName(), my_bot->GetBotID(), c->GetCleanName(), c->CharacterID(), c->AccountName(), c->AccountID()); return; } if (sep->arg[1][0] == '\0' || sep->IsNumber(1)) { - c->Message(m_fail, "You must [name] your bot clone"); + c->Message(Chat::Red, "You must [name] your bot clone"); return; } std::string bot_name = sep->arg[1]; if (!Bot::IsValidName(bot_name)) { - c->Message(m_fail, "'%s' is an invalid name. You may only use characters 'A-Z', 'a-z' and '_'", bot_name.c_str()); + c->Message(Chat::Red, "'%s' is an invalid name. You may only use characters 'A-Z', 'a-z' and '_'", bot_name.c_str()); return; } @@ -5104,11 +5097,11 @@ void bot_subcommand_bot_clone(Client *c, const Seperator *sep) bool available_flag = false; if (!database.botdb.QueryNameAvailablity(bot_name, available_flag)) { - c->Message(m_fail, "%s", BotDatabase::fail::QueryNameAvailablity()); + c->Message(Chat::Red, "%s", BotDatabase::fail::QueryNameAvailablity()); return; } if (!available_flag) { - c->Message(m_fail, "The name %s is already being used. Please choose a different name", bot_name.c_str()); + c->Message(Chat::Red, "The name %s is already being used. Please choose a different name", bot_name.c_str()); return; } @@ -5116,30 +5109,30 @@ void bot_subcommand_bot_clone(Client *c, const Seperator *sep) uint32 bot_count = 0; if (!database.botdb.QueryBotCount(c->CharacterID(), bot_count)) { - c->Message(m_fail, "%s", BotDatabase::fail::QueryBotCount()); + c->Message(Chat::Red, "%s", BotDatabase::fail::QueryBotCount()); return; } if (bot_count >= max_bot_count) { - c->Message(m_fail, "You have reached the maximum limit of %i bots", max_bot_count); + c->Message(Chat::Red, "You have reached the maximum limit of %i bots", max_bot_count); return; } uint32 clone_id = 0; if (!database.botdb.CreateCloneBot(c->CharacterID(), my_bot->GetBotID(), bot_name, clone_id) || !clone_id) { - c->Message(m_fail, "%s '%s'", BotDatabase::fail::CreateCloneBot(), bot_name.c_str()); + c->Message(Chat::Red, "%s '%s'", BotDatabase::fail::CreateCloneBot(), bot_name.c_str()); return; } int clone_stance = EQ::constants::stancePassive; if (!database.botdb.LoadStance(my_bot->GetBotID(), clone_stance)) - c->Message(m_fail, "%s for bot '%s'", BotDatabase::fail::LoadStance(), my_bot->GetCleanName()); + c->Message(Chat::Red, "%s for bot '%s'", BotDatabase::fail::LoadStance(), my_bot->GetCleanName()); if (!database.botdb.SaveStance(clone_id, clone_stance)) - c->Message(m_fail, "%s for clone '%s'", BotDatabase::fail::SaveStance(), bot_name.c_str()); + c->Message(Chat::Red, "%s for clone '%s'", BotDatabase::fail::SaveStance(), bot_name.c_str()); if (!database.botdb.CreateCloneBotInventory(c->CharacterID(), my_bot->GetBotID(), clone_id)) - c->Message(m_fail, "%s for clone '%s'", BotDatabase::fail::CreateCloneBotInventory(), bot_name.c_str()); + c->Message(Chat::Red, "%s for clone '%s'", BotDatabase::fail::CreateCloneBotInventory(), bot_name.c_str()); - c->Message(m_action, "Bot '%s' was successfully cloned to bot '%s'", my_bot->GetCleanName(), bot_name.c_str()); + c->Message(Chat::Yellow, "Bot '%s' was successfully cloned to bot '%s'", my_bot->GetCleanName(), bot_name.c_str()); } void bot_command_view_combos(Client *c, const Seperator *sep) @@ -5170,7 +5163,7 @@ void bot_command_view_combos(Client *c, const Seperator *sep) std::string window_title = "Bot Races"; std::string window_text; std::string message_separator = " "; - c->Message(m_usage, "Usage: %s [bot_race]", sep->arg[0]); + c->Message(Chat::Cyan, "Usage: %s [bot_race]", sep->arg[0]); window_text.append("Races:"); for (int race_id = 0; race_id <= 15; ++race_id) { window_text.append(message_separator); @@ -5182,7 +5175,7 @@ void bot_command_view_combos(Client *c, const Seperator *sep) } if (sep->arg[1][0] == '\0' || !sep->IsNumber(1)) { - c->Message(m_fail, "Invalid Race!"); + c->Message(Chat::Red, "Invalid Race!"); return; } uint16 bot_race = atoi(sep->arg[1]); @@ -5191,7 +5184,7 @@ void bot_command_view_combos(Client *c, const Seperator *sep) std::string window_title = "Bot Classes"; std::string window_text; std::string message_separator = " "; - c->Message(m_usage, "%s can be these classes.", race_name); + c->Message(Chat::Cyan, "%s can be these classes.", race_name); window_text.append("Classes:"); for (int class_id = 0; class_id <= 15; ++class_id) { if (classes_bitmask & GetPlayerClassBit(class_id)) { @@ -5234,7 +5227,7 @@ void bot_subcommand_bot_create(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_create", sep->arg[0], "botcreate")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [bot_name] [bot_class] [bot_race] [bot_gender]", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [bot_name] [bot_class] [bot_race] [bot_gender]", sep->arg[0]); std::string window_title = "Bot Create Options"; std::string window_text; std::string message_separator; @@ -5286,25 +5279,25 @@ void bot_subcommand_bot_create(Client *c, const Seperator *sep) } if (sep->arg[1][0] == '\0' || sep->IsNumber(1)) { - c->Message(m_fail, "You must [name] your bot"); + c->Message(Chat::Red, "You must [name] your bot"); return; } std::string bot_name = sep->arg[1]; bot_name = ucfirst(bot_name); if (sep->arg[2][0] == '\0' || !sep->IsNumber(2)) { - c->Message(m_fail, "Invalid Class!"); + c->Message(Chat::Red, "Invalid Class!"); return; } uint8 bot_class = atoi(sep->arg[2]); if (sep->arg[3][0] == '\0' || !sep->IsNumber(3)) { - c->Message(m_fail, "Invalid Race!"); + c->Message(Chat::Red, "Invalid Race!"); return; } uint16 bot_race = atoi(sep->arg[3]); if (sep->arg[4][0] == '\0') { - c->Message(m_fail, "Invalid Gender!"); + c->Message(Chat::Red, "Invalid Gender!"); return; } uint8 bot_gender = atoi(sep->arg[4]); @@ -5317,20 +5310,20 @@ void bot_subcommand_bot_delete(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_delete", sep->arg[0], "botdelete")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s", sep->arg[0]); return; } auto my_bot = ActionableBots::AsTarget_ByBot(c); if (!my_bot) { - c->Message(m_fail, "You must a bot that you own to use this command"); + c->Message(Chat::Red, "You must a bot that you own to use this command"); return; } std::string error_message; if (!my_bot->DeleteBot()) { - c->Message(m_unknown, "Failed to delete '%s' due to database error", my_bot->GetCleanName()); + c->Message(Chat::Magenta, "Failed to delete '%s' due to database error", my_bot->GetCleanName()); return; } @@ -5339,7 +5332,7 @@ void bot_subcommand_bot_delete(Client *c, const Seperator *sep) my_bot->Camp(false); - c->Message(m_action, "Successfully deleted bot '%s' (id: %i)", bot_name.c_str(), bid); + c->Message(Chat::Yellow, "Successfully deleted bot '%s' (id: %i)", bot_name.c_str(), bid); } void bot_subcommand_bot_details(Client *c, const Seperator *sep) @@ -5349,19 +5342,19 @@ void bot_subcommand_bot_details(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_details", sep->arg[0], "botdetails")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [value: 0-n] (Drakkin bots only)", sep->arg[0]); - c->Message(m_note, "note: Actual limit is filter-based"); + c->Message(Chat::Cyan, "usage: %s [value: 0-n] (Drakkin bots only)", sep->arg[0]); + c->Message(Chat::Gray, "note: Actual limit is filter-based"); return; } auto my_bot = ActionableBots::AsTarget_ByBot(c); if (!my_bot) { - c->Message(m_fail, "You must a bot that you own to use this command"); + c->Message(Chat::Red, "You must a bot that you own to use this command"); return; } if (!sep->IsNumber(1)) { - c->Message(m_fail, "A numeric [value] is required to use this command"); + c->Message(Chat::Red, "A numeric [value] is required to use this command"); return; } @@ -5516,20 +5509,20 @@ void bot_subcommand_bot_eyes(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_eyes", sep->arg[0], "boteyes")) return; if (helper_is_help_or_usage(sep->arg[1])) { - //c->Message(m_usage, "usage: %s [value:0-n] ([option: left | right])", sep->arg[0]); - c->Message(m_usage, "usage: %s [value: 0-n]", sep->arg[0]); - c->Message(m_note, "note: Actual limit is filter-based"); + //c->Message(Chat::Cyan, "usage: %s [value:0-n] ([option: left | right])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [value: 0-n]", sep->arg[0]); + c->Message(Chat::Gray, "note: Actual limit is filter-based"); return; } auto my_bot = ActionableBots::AsTarget_ByBot(c); if (!my_bot) { - c->Message(m_fail, "You must a bot that you own to use this command"); + c->Message(Chat::Red, "You must a bot that you own to use this command"); return; } if (!sep->IsNumber(1)) { - c->Message(m_fail, "A numeric [value] is required to use this command"); + c->Message(Chat::Red, "A numeric [value] is required to use this command"); return; } @@ -5562,7 +5555,7 @@ void bot_subcommand_bot_eyes(Client *c, const Seperator *sep) if (helper_bot_appearance_fail(c, my_bot, fail_type, "eyes")) return; - c->Message(m_action, "This feature will update the next time your bot is spawned"); + c->Message(Chat::Yellow, "This feature will update the next time your bot is spawned"); //helper_bot_appearance_form_final(c, my_bot); } @@ -5571,19 +5564,19 @@ void bot_subcommand_bot_face(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_face", sep->arg[0], "botface")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [value: 0-n]", sep->arg[0]); - c->Message(m_note, "note: Actual limit is filter-based"); + c->Message(Chat::Cyan, "usage: %s [value: 0-n]", sep->arg[0]); + c->Message(Chat::Gray, "note: Actual limit is filter-based"); return; } auto my_bot = ActionableBots::AsTarget_ByBot(c); if (!my_bot) { - c->Message(m_fail, "You must a bot that you own to use this command"); + c->Message(Chat::Red, "You must a bot that you own to use this command"); return; } if (!sep->IsNumber(1)) { - c->Message(m_fail, "A numeric [value] is required to use this command"); + c->Message(Chat::Red, "A numeric [value] is required to use this command"); return; } @@ -5611,8 +5604,8 @@ void bot_subcommand_bot_follow_distance(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_follow_distance", sep->arg[0], "botfollowdistance")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [set] [distance] ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); - c->Message(m_usage, "usage: %s [clear] ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [set] [distance] ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [clear] ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); return; } const int ab_mask = ActionableBots::ABM_NoFilter; @@ -5623,7 +5616,7 @@ void bot_subcommand_bot_follow_distance(Client *c, const Seperator *sep) if (!strcasecmp(sep->arg[1], "set")) { if (!sep->IsNumber(2)) { - c->Message(m_fail, "A numeric [distance] is required to use this command"); + c->Message(Chat::Red, "A numeric [distance] is required to use this command"); return; } @@ -5636,7 +5629,7 @@ void bot_subcommand_bot_follow_distance(Client *c, const Seperator *sep) ab_arg = 3; } else if (strcasecmp(sep->arg[1], "clear")) { - c->Message(m_fail, "This command requires a [set | clear] argument"); + c->Message(Chat::Red, "This command requires a [set | clear] argument"); return; } @@ -5652,7 +5645,7 @@ void bot_subcommand_bot_follow_distance(Client *c, const Seperator *sep) bot_iter->SetFollowDistance(bfd); if (ab_type != ActionableBots::ABT_All && !database.botdb.SaveFollowDistance(c->CharacterID(), bot_iter->GetBotID(), bfd)) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::SaveFollowDistance(), bot_iter->GetCleanName()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::SaveFollowDistance(), bot_iter->GetCleanName()); return; } @@ -5661,14 +5654,14 @@ void bot_subcommand_bot_follow_distance(Client *c, const Seperator *sep) if (ab_type == ActionableBots::ABT_All) { if (!database.botdb.SaveAllFollowDistances(c->CharacterID(), bfd)) { - c->Message(m_fail, "%s", BotDatabase::fail::SaveAllFollowDistances()); + c->Message(Chat::Red, "%s", BotDatabase::fail::SaveAllFollowDistances()); return; } - c->Message(m_action, "%s all of your bot follow distances", set_flag ? "Set" : "Cleared"); + c->Message(Chat::Yellow, "%s all of your bot follow distances", set_flag ? "Set" : "Cleared"); } else { - c->Message(m_action, "%s %i of your spawned bot follow distances", (set_flag ? "Set" : "Cleared"), bot_count); + c->Message(Chat::Yellow, "%s %i of your spawned bot follow distances", (set_flag ? "Set" : "Cleared"), bot_count); } } @@ -5677,19 +5670,19 @@ void bot_subcommand_bot_hair_color(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_hair_color", sep->arg[0], "bothaircolor")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [value: 0-n]", sep->arg[0]); - c->Message(m_note, "note: Actual limit is filter-based"); + c->Message(Chat::Cyan, "usage: %s [value: 0-n]", sep->arg[0]); + c->Message(Chat::Gray, "note: Actual limit is filter-based"); return; } auto my_bot = ActionableBots::AsTarget_ByBot(c); if (!my_bot) { - c->Message(m_fail, "You must a bot that you own to use this command"); + c->Message(Chat::Red, "You must a bot that you own to use this command"); return; } if (!sep->IsNumber(1)) { - c->Message(m_fail, "A numeric [value] is required to use this command"); + c->Message(Chat::Red, "A numeric [value] is required to use this command"); return; } @@ -5712,19 +5705,19 @@ void bot_subcommand_bot_hairstyle(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_hairstyle", sep->arg[0], "bothairstyle")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [value: 0-n]", sep->arg[0]); - c->Message(m_note, "note: Actual limit is filter-based"); + c->Message(Chat::Cyan, "usage: %s [value: 0-n]", sep->arg[0]); + c->Message(Chat::Gray, "note: Actual limit is filter-based"); return; } auto my_bot = ActionableBots::AsTarget_ByBot(c); if (!my_bot) { - c->Message(m_fail, "You must a bot that you own to use this command"); + c->Message(Chat::Red, "You must a bot that you own to use this command"); return; } if (!sep->IsNumber(1)) { - c->Message(m_fail, "A numeric [value] is required to use this command"); + c->Message(Chat::Red, "A numeric [value] is required to use this command"); return; } @@ -5749,19 +5742,19 @@ void bot_subcommand_bot_heritage(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_heritage", sep->arg[0], "botheritage")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [value: 0-n] (Drakkin bots only)", sep->arg[0]); - c->Message(m_note, "note: Actual limit is filter-based"); + c->Message(Chat::Cyan, "usage: %s [value: 0-n] (Drakkin bots only)", sep->arg[0]); + c->Message(Chat::Gray, "note: Actual limit is filter-based"); return; } auto my_bot = ActionableBots::AsTarget_ByBot(c); if (!my_bot) { - c->Message(m_fail, "You must a bot that you own to use this command"); + c->Message(Chat::Red, "You must a bot that you own to use this command"); return; } if (!sep->IsNumber(1)) { - c->Message(m_fail, "A numeric [value] is required to use this command"); + c->Message(Chat::Red, "A numeric [value] is required to use this command"); return; } @@ -5786,18 +5779,18 @@ void bot_subcommand_bot_inspect_message(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_inspect_message", sep->arg[0], "botinspectmessage")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [set | clear] ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); - c->Message(m_note, "Notes:"); + c->Message(Chat::Cyan, "usage: %s [set | clear] ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Gray, "Notes:"); if (c->ClientVersion() >= EQ::versions::ClientVersion::SoF) { - c->Message(m_message, "- Self-inspect and type your bot's inspect message"); - c->Message(m_message, "- Close the self-inspect window to update the server"); - c->Message(m_message, "- Type '%s set' to set the bot's inspect message", sep->arg[0]); + c->Message(Chat::White, "- Self-inspect and type your bot's inspect message"); + c->Message(Chat::White, "- Close the self-inspect window to update the server"); + c->Message(Chat::White, "- Type '%s set' to set the bot's inspect message", sep->arg[0]); } else { - c->Message(m_message, "- Self-inspect and type your bot's inspect message"); - c->Message(m_message, "- Close the self-inspect window"); - c->Message(m_message, "- Self-inspect again to update the server"); - c->Message(m_message, "- Type '%s set' to set the bot's inspect message", sep->arg[0]); + c->Message(Chat::White, "- Self-inspect and type your bot's inspect message"); + c->Message(Chat::White, "- Close the self-inspect window"); + c->Message(Chat::White, "- Self-inspect again to update the server"); + c->Message(Chat::White, "- Type '%s set' to set the bot's inspect message", sep->arg[0]); } return; } @@ -5830,7 +5823,7 @@ void bot_subcommand_bot_inspect_message(Client *c, const Seperator *sep) memcpy(bot_message_struct, client_message_struct, sizeof(InspectMessage_Struct)); if (ab_type != ActionableBots::ABT_All && !database.botdb.SaveInspectMessage(bot_iter->GetBotID(), *bot_message_struct)) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::SaveInspectMessage(), bot_iter->GetCleanName()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::SaveInspectMessage(), bot_iter->GetCleanName()); return; } @@ -5844,14 +5837,14 @@ void bot_subcommand_bot_inspect_message(Client *c, const Seperator *sep) memcpy(&bot_message_struct, client_message_struct, sizeof(InspectMessage_Struct)); if (!database.botdb.SaveAllInspectMessages(c->CharacterID(), bot_message_struct)) { - c->Message(m_fail, "%s", BotDatabase::fail::SaveAllInspectMessages()); + c->Message(Chat::Red, "%s", BotDatabase::fail::SaveAllInspectMessages()); return; } - c->Message(m_action, "%s all of your bot inspect messages", set_flag ? "Set" : "Cleared"); + c->Message(Chat::Yellow, "%s all of your bot inspect messages", set_flag ? "Set" : "Cleared"); } else { - c->Message(m_action, "%s %i of your spawned bot inspect messages", set_flag ? "Set" : "Cleared", bot_count); + c->Message(Chat::Yellow, "%s %i of your spawned bot inspect messages", set_flag ? "Set" : "Cleared", bot_count); } } @@ -5864,8 +5857,8 @@ void bot_subcommand_bot_list(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_list", sep->arg[0], "botlist")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s (account) ([class] [value]) ([race] [value]) ([name] [partial-full])", sep->arg[0]); - c->Message(m_note, "note: filter criteria is orderless and optional"); + c->Message(Chat::Cyan, "usage: %s (account) ([class] [value]) ([race] [value]) ([name] [partial-full])", sep->arg[0]); + c->Message(Chat::Gray, "note: filter criteria is orderless and optional"); return; } bool Account = false; @@ -5899,17 +5892,17 @@ void bot_subcommand_bot_list(Client *c, const Seperator *sep) continue; } - c->Message(m_fail, "A numeric value or name is required to use the filter property of this command (f: '%s', v: '%s')", sep->arg[i], sep->arg[i + 1]); + c->Message(Chat::Red, "A numeric value or name is required to use the filter property of this command (f: '%s', v: '%s')", sep->arg[i], sep->arg[i + 1]); return; } std::list bots_list; if (!database.botdb.LoadBotsList(c->CharacterID(), bots_list, Account)) { - c->Message(m_fail, "%s", BotDatabase::fail::LoadBotsList()); + c->Message(Chat::Red, "%s", BotDatabase::fail::LoadBotsList()); return; } if (bots_list.empty()) { - c->Message(m_fail, "You have no bots"); + c->Message(Chat::Red, "You have no bots"); return; } @@ -5958,7 +5951,7 @@ void bot_subcommand_bot_out_of_combat(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_out_of_combat", sep->arg[0], "botoutofcombat")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([option: on | off]) ([actionable: target | byname] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([option: on | off]) ([actionable: target | byname] ([actionable_name]))", sep->arg[0]); return; } const int ab_mask = (ActionableBots::ABM_Target | ActionableBots::ABM_ByName); @@ -6084,7 +6077,7 @@ void bot_subcommand_bot_report(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_report", sep->arg[0], "botreport")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); return; } const int ab_mask = ActionableBots::ABM_NoFilter; @@ -6115,7 +6108,7 @@ void bot_subcommand_bot_report(Client *c, const Seperator *sep) if (!IsNonSpellFighterClass(bot_iter->GetClass())) report_msg.append(StringFormat(": %3.1f%% mana", bot_iter->GetManaRatio())); - c->Message(m_message, "%s", report_msg.c_str()); + c->Message(Chat::White, "%s", report_msg.c_str()); } } @@ -6124,18 +6117,18 @@ void bot_subcommand_bot_spawn(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_spawn", sep->arg[0], "botspawn")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [bot_name]", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [bot_name]", sep->arg[0]); return; } int rule_level = RuleI(Bots, BotCharacterLevel); if (c->GetLevel() < rule_level) { - c->Message(m_fail, "You must be level %i to use bots", rule_level); + c->Message(Chat::Red, "You must be level %i to use bots", rule_level); return; } if (c->GetFeigned()) { - c->Message(m_fail, "You can not spawn a bot while feigned"); + c->Message(Chat::Red, "You can not spawn a bot while feigned"); return; } @@ -6143,44 +6136,44 @@ void bot_subcommand_bot_spawn(Client *c, const Seperator *sep) int rule_limit = RuleI(Bots, SpawnLimit); if (spawned_bot_count >= rule_limit && !c->GetGM()) { - c->Message(m_fail, "You can not have more than %i spawned bots", rule_limit); + c->Message(Chat::Red, "You can not have more than %i spawned bots", rule_limit); return; } if (RuleB(Bots, QuestableSpawnLimit) && !c->GetGM()) { int allowed_bot_count = 0; if (!database.botdb.LoadQuestableSpawnCount(c->CharacterID(), allowed_bot_count)) { - c->Message(m_fail, "%s", BotDatabase::fail::LoadQuestableSpawnCount()); + c->Message(Chat::Red, "%s", BotDatabase::fail::LoadQuestableSpawnCount()); return; } if (!allowed_bot_count) { - c->Message(m_fail, "You are not currently allowed any spawned bots"); + c->Message(Chat::Red, "You are not currently allowed any spawned bots"); return; } if (spawned_bot_count >= allowed_bot_count) { - c->Message(m_fail, "You have reached your current limit of %i spawned bots", allowed_bot_count); + c->Message(Chat::Red, "You have reached your current limit of %i spawned bots", allowed_bot_count); return; } } if (sep->arg[1][0] == '\0' || sep->IsNumber(1)) { - c->Message(m_fail, "You must specify a [name] to use this command"); + c->Message(Chat::Red, "You must specify a [name] to use this command"); return; } std::string bot_name = sep->arg[1]; uint32 bot_id = 0; if (!database.botdb.LoadBotID(c->CharacterID(), bot_name, bot_id)) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::LoadBotID(), bot_name.c_str()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadBotID(), bot_name.c_str()); return; } if (!bot_id) { - c->Message(m_fail, "You don't own a bot named '%s'", bot_name.c_str()); + c->Message(Chat::Red, "You don't own a bot named '%s'", bot_name.c_str()); return; } if (entity_list.GetMobByBotID(bot_id)) { - c->Message(m_fail, "'%s' is already spawned in zone", bot_name.c_str()); + c->Message(Chat::Red, "'%s' is already spawned in zone", bot_name.c_str()); return; } @@ -6194,29 +6187,29 @@ void bot_subcommand_bot_spawn(Client *c, const Seperator *sep) if (member_iter->qglobal) // what is this?? really should have had a message to describe failure... (can't spawn bots if you are assigned to a task/instance?) return; if (!member_iter->qglobal && (member_iter->GetAppearance() != eaDead) && (member_iter->IsEngaged() || (member_iter->IsClient() && member_iter->CastToClient()->GetAggroCount()))) { - c->Message(m_fail, "You can't summon bots while you are engaged."); + c->Message(Chat::Red, "You can't summon bots while you are engaged."); return; } } } else if (c->GetAggroCount() > 0) { - c->Message(m_fail, "You can't spawn bots while you are engaged."); + c->Message(Chat::Red, "You can't spawn bots while you are engaged."); return; } //if (c->IsEngaged()) { - // c->Message(m_fail, "You can't spawn bots while you are engaged."); + // c->Message(Chat::Red, "You can't spawn bots while you are engaged."); // return; //} auto my_bot = Bot::LoadBot(bot_id); if (!my_bot) { - c->Message(m_fail, "No valid bot '%s' (id: %i) exists", bot_name.c_str(), bot_id); + c->Message(Chat::Red, "No valid bot '%s' (id: %i) exists", bot_name.c_str(), bot_id); return; } if (!my_bot->Spawn(c)) { - c->Message(m_fail, "Failed to spawn bot '%s' (id: %i)", bot_name.c_str(), bot_id); + c->Message(Chat::Red, "Failed to spawn bot '%s' (id: %i)", bot_name.c_str(), bot_id); safe_delete(my_bot); return; } @@ -6259,8 +6252,8 @@ void bot_subcommand_bot_stance(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_stance", sep->arg[0], "botstance")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [current | value: 1-9] ([actionable: target | byname] ([actionable_name]))", sep->arg[0]); - c->Message(m_note, "value: %u(%s), %u(%s), %u(%s), %u(%s), %u(%s), %u(%s), %u(%s)", + c->Message(Chat::Cyan, "usage: %s [current | value: 1-9] ([actionable: target | byname] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Gray, "value: %u(%s), %u(%s), %u(%s), %u(%s), %u(%s), %u(%s), %u(%s)", EQ::constants::stancePassive, EQ::constants::GetStanceName(EQ::constants::stancePassive), EQ::constants::stanceBalanced, EQ::constants::GetStanceName(EQ::constants::stanceBalanced), EQ::constants::stanceEfficient, EQ::constants::GetStanceName(EQ::constants::stanceEfficient), @@ -6287,7 +6280,7 @@ void bot_subcommand_bot_stance(Client *c, const Seperator *sep) } if (!current_flag && bst == EQ::constants::stanceUnknown) { - c->Message(m_fail, "A [current] argument or valid numeric [value] is required to use this command"); + c->Message(Chat::Red, "A [current] argument or valid numeric [value] is required to use this command"); return; } @@ -6318,20 +6311,20 @@ void bot_subcommand_bot_stop_melee_level(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_stop_melee_level", sep->arg[0], "botstopmeleelevel")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [current | reset | sync | value: 0-255]", sep->arg[0]); - c->Message(m_note, "note: Only caster or hybrid class bots may be modified"); - c->Message(m_note, "note: Use [reset] to set stop melee level to server rule"); - c->Message(m_note, "note: Use [sync] to set stop melee level to current bot level"); + c->Message(Chat::Cyan, "usage: %s [current | reset | sync | value: 0-255]", sep->arg[0]); + c->Message(Chat::Gray, "note: Only caster or hybrid class bots may be modified"); + c->Message(Chat::Gray, "note: Use [reset] to set stop melee level to server rule"); + c->Message(Chat::Gray, "note: Use [sync] to set stop melee level to current bot level"); return; } auto my_bot = ActionableBots::AsTarget_ByBot(c); if (!my_bot) { - c->Message(m_fail, "You must a bot that you own to use this command"); + c->Message(Chat::Red, "You must a bot that you own to use this command"); return; } if (!IsCasterClass(my_bot->GetClass()) && !IsHybridClass(my_bot->GetClass())) { - c->Message(m_fail, "You must a caster or hybrid class bot to use this command"); + c->Message(Chat::Red, "You must a caster or hybrid class bot to use this command"); return; } @@ -6344,20 +6337,20 @@ void bot_subcommand_bot_stop_melee_level(Client *c, const Seperator *sep) sml = my_bot->GetLevel(); } else if (!strcasecmp(sep->arg[1], "current")) { - c->Message(m_message, "My current melee stop level is %u", my_bot->GetStopMeleeLevel()); + c->Message(Chat::White, "My current melee stop level is %u", my_bot->GetStopMeleeLevel()); return; } else if (strcasecmp(sep->arg[1], "reset")) { - c->Message(m_fail, "A [current] or [reset] argument, or numeric [value] is required to use this command"); + c->Message(Chat::Red, "A [current] or [reset] argument, or numeric [value] is required to use this command"); return; } // [reset] falls through with initialization value my_bot->SetStopMeleeLevel(sml); if (!database.botdb.SaveStopMeleeLevel(c->CharacterID(), my_bot->GetBotID(), sml)) - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::SaveStopMeleeLevel(), my_bot->GetCleanName()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::SaveStopMeleeLevel(), my_bot->GetCleanName()); - c->Message(m_action, "Successfully set stop melee level for %s to %u", my_bot->GetCleanName(), sml); + c->Message(Chat::Yellow, "Successfully set stop melee level for %s to %u", my_bot->GetCleanName(), sml); } void bot_subcommand_bot_summon(Client *c, const Seperator *sep) @@ -6365,7 +6358,7 @@ void bot_subcommand_bot_summon(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_summon", sep->arg[0], "botsummon")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); return; } const int ab_mask = ActionableBots::ABM_NoFilter; @@ -6394,9 +6387,9 @@ void bot_subcommand_bot_summon(Client *c, const Seperator *sep) } if (sbl.size() == 1) - c->Message(m_action, "Summoned %s to you", ((sbl.front()) ? (sbl.front()->GetCleanName()) : ("'nullptr'"))); + c->Message(Chat::Yellow, "Summoned %s to you", ((sbl.front()) ? (sbl.front()->GetCleanName()) : ("'nullptr'"))); else - c->Message(m_action, "Summoned %i bots to you", sbl.size()); + c->Message(Chat::Yellow, "Summoned %i bots to you", sbl.size()); } void bot_subcommand_bot_tattoo(Client *c, const Seperator *sep) @@ -6406,19 +6399,19 @@ void bot_subcommand_bot_tattoo(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_tattoo", sep->arg[0], "bottattoo")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [value: 0-n] (Drakkin bots only)", sep->arg[0]); - c->Message(m_note, "note: Actual limit is filter-based"); + c->Message(Chat::Cyan, "usage: %s [value: 0-n] (Drakkin bots only)", sep->arg[0]); + c->Message(Chat::Gray, "note: Actual limit is filter-based"); return; } auto my_bot = ActionableBots::AsTarget_ByBot(c); if (!my_bot) { - c->Message(m_fail, "You must a bot that you own to use this command"); + c->Message(Chat::Red, "You must a bot that you own to use this command"); return; } if (!sep->IsNumber(1)) { - c->Message(m_fail, "A numeric [value] is required to use this command"); + c->Message(Chat::Red, "A numeric [value] is required to use this command"); return; } @@ -6443,7 +6436,7 @@ void bot_subcommand_bot_toggle_archer(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_toggle_archer", sep->arg[0], "bottogglearcher")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([option: on | off]) ([actionable: target | byname] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([option: on | off]) ([actionable: target | byname] ([actionable_name]))", sep->arg[0]); return; } const int ab_mask = (ActionableBots::ABM_Target | ActionableBots::ABM_ByName); @@ -6487,7 +6480,7 @@ void bot_subcommand_bot_toggle_helm(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_toggle_helm", sep->arg[0], "bottogglehelm")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([option: on | off]) ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([option: on | off]) ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); return; } const int ab_mask = ActionableBots::ABM_NoFilter; @@ -6524,7 +6517,7 @@ void bot_subcommand_bot_toggle_helm(Client *c, const Seperator *sep) if (ab_type != ActionableBots::ABT_All) { if (!database.botdb.SaveHelmAppearance(c->CharacterID(), bot_iter->GetBotID(), bot_iter->GetShowHelm())) { - c->Message(m_unknown, "%s for '%s'", bot_iter->GetCleanName()); + c->Message(Chat::Magenta, "%s for '%s'", bot_iter->GetCleanName()); return; } @@ -6546,17 +6539,17 @@ void bot_subcommand_bot_toggle_helm(Client *c, const Seperator *sep) std::string query; if (toggle_helm) { if (!database.botdb.ToggleAllHelmAppearances(c->CharacterID())) - c->Message(m_fail, "%s", BotDatabase::fail::ToggleAllHelmAppearances()); + c->Message(Chat::Red, "%s", BotDatabase::fail::ToggleAllHelmAppearances()); } else { if (!database.botdb.SaveAllHelmAppearances(c->CharacterID(), helm_state)) - c->Message(m_fail, "%s", BotDatabase::fail::SaveAllHelmAppearances()); + c->Message(Chat::Red, "%s", BotDatabase::fail::SaveAllHelmAppearances()); } - c->Message(m_action, "%s all of your bot show helm flags", toggle_helm ? "Toggled" : (helm_state ? "Set" : "Cleared")); + c->Message(Chat::Yellow, "%s all of your bot show helm flags", toggle_helm ? "Toggled" : (helm_state ? "Set" : "Cleared")); } else { - c->Message(m_action, "%s %i of your spawned bot show helm flags", toggle_helm ? "Toggled" : (helm_state ? "Set" : "Cleared"), bot_count); + c->Message(Chat::Yellow, "%s %i of your spawned bot show helm flags", toggle_helm ? "Toggled" : (helm_state ? "Set" : "Cleared"), bot_count); } // Notes: @@ -6614,14 +6607,14 @@ void bot_subcommand_bot_update(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_update", sep->arg[0], "botupdate")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s", sep->arg[0]); return; } std::list sbl; MyBots::PopulateSBL_BySpawnedBots(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You currently have no spawned bots"); + c->Message(Chat::Red, "You currently have no spawned bots"); return; } @@ -6636,7 +6629,7 @@ void bot_subcommand_bot_update(Client *c, const Seperator *sep) ++bot_count; } - c->Message(m_action, "Updated %i of your %i spawned bots", bot_count, sbl.size()); + c->Message(Chat::Yellow, "Updated %i of your %i spawned bots", bot_count, sbl.size()); } void bot_subcommand_bot_woad(Client *c, const Seperator *sep) @@ -6644,19 +6637,19 @@ void bot_subcommand_bot_woad(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_bot_woad", sep->arg[0], "botwoad")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [value: 0-n] (Barbarian bots only)", sep->arg[0]); - c->Message(m_note, "note: Actual limit is filter-based"); + c->Message(Chat::Cyan, "usage: %s [value: 0-n] (Barbarian bots only)", sep->arg[0]); + c->Message(Chat::Gray, "note: Actual limit is filter-based"); return; } auto my_bot = ActionableBots::AsTarget_ByBot(c); if (!my_bot) { - c->Message(m_fail, "You must a bot that you own to use this command"); + c->Message(Chat::Red, "You must a bot that you own to use this command"); return; } if (!sep->IsNumber(1)) { - c->Message(m_fail, "A numeric [value] is required to use this command"); + c->Message(Chat::Red, "A numeric [value] is required to use this command"); return; } @@ -6685,35 +6678,35 @@ void bot_subcommand_botgroup_add_member(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_botgroup_add_member", sep->arg[0], "botgroupaddmember")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s [member_name] ([leader_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s [member_name] ([leader_name])", sep->arg[0]); return; } std::list sbl; MyBots::PopulateSBL_ByNamedBot(c, sbl, sep->arg[1]); if (sbl.empty()) { - c->Message(m_fail, "You must [name] a new member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must [name] a new member as a bot that you own to use this command"); return; } auto new_member = sbl.front(); if (!new_member) { - c->Message(m_unknown, "Error: New member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: New member bot dereferenced to nullptr"); return; } if (new_member->HasGroup()) { - c->Message(m_fail, "%s is already a current member of a group and can not join another one", new_member->GetCleanName()); + c->Message(Chat::Red, "%s is already a current member of a group and can not join another one", new_member->GetCleanName()); return; } uint32 botgroup_id = 0; if (!database.botdb.LoadBotGroupIDByMemberID(new_member->GetBotID(), botgroup_id)) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::LoadBotGroupIDByMemberID(), new_member->GetCleanName()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadBotGroupIDByMemberID(), new_member->GetCleanName()); return; } if (botgroup_id) { - c->Message(m_fail, "%s is already a current member of a bot-group", new_member->GetCleanName()); + c->Message(Chat::Red, "%s is already a current member of a bot-group", new_member->GetCleanName()); return; } @@ -6721,50 +6714,50 @@ void bot_subcommand_botgroup_add_member(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a group leader as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a group leader as a bot that you own to use this command"); return; } auto botgroup_leader = sbl.front(); if (!botgroup_leader) { - c->Message(m_unknown, "Error: Group leader bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Group leader bot dereferenced to nullptr"); return; } Group* group_inst = botgroup_leader->GetGroup(); if (!group_inst || group_inst->GetLeader() != botgroup_leader) { - c->Message(m_fail, "%s is not the current leader of a group", botgroup_leader->GetCleanName()); + c->Message(Chat::Red, "%s is not the current leader of a group", botgroup_leader->GetCleanName()); return; } botgroup_id = 0; if (!database.botdb.LoadBotGroupIDByLeaderID(botgroup_leader->GetBotID(), botgroup_id)) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::LoadBotGroupIDByLeaderID(), botgroup_leader->GetCleanName()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadBotGroupIDByLeaderID(), botgroup_leader->GetCleanName()); return; } if (!botgroup_id) { - c->Message(m_fail, "%s is not the current leader of a bot-group", botgroup_leader->GetCleanName()); + c->Message(Chat::Red, "%s is not the current leader of a bot-group", botgroup_leader->GetCleanName()); return; } if (!Bot::AddBotToGroup(new_member, group_inst)) { - c->Message(m_fail, "Could not add %s as a new member to %s's group", new_member->GetCleanName(), botgroup_leader->GetCleanName()); + c->Message(Chat::Red, "Could not add %s as a new member to %s's group", new_member->GetCleanName(), botgroup_leader->GetCleanName()); return; } database.SetGroupID(new_member->GetName(), group_inst->GetID(), new_member->GetBotID()); if (!database.botdb.AddMemberToBotGroup(botgroup_leader->GetBotID(), new_member->GetBotID())) { - c->Message(m_fail, "%s - %s->%s", BotDatabase::fail::AddMemberToBotGroup(), new_member->GetCleanName(), botgroup_leader->GetCleanName()); + c->Message(Chat::Red, "%s - %s->%s", BotDatabase::fail::AddMemberToBotGroup(), new_member->GetCleanName(), botgroup_leader->GetCleanName()); Bot::RemoveBotFromGroup(new_member, botgroup_leader->GetGroup()); return; } std::string botgroup_name; if (!database.botdb.LoadBotGroupNameByLeaderID(botgroup_leader->GetBotID(), botgroup_name)) - c->Message(m_fail, "%s", BotDatabase::fail::LoadBotGroupNameByLeaderID()); + c->Message(Chat::Red, "%s", BotDatabase::fail::LoadBotGroupNameByLeaderID()); - c->Message(m_action, "Successfully added %s to bot-group %s", new_member->GetCleanName(), botgroup_name.c_str()); + c->Message(Chat::Yellow, "Successfully added %s to bot-group %s", new_member->GetCleanName(), botgroup_name.c_str()); } void bot_subcommand_botgroup_create(Client *c, const Seperator *sep) @@ -6772,23 +6765,23 @@ void bot_subcommand_botgroup_create(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_botgroup_create", sep->arg[0], "botgroupcreate")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s [group_name] ([leader_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s [group_name] ([leader_name])", sep->arg[0]); return; } std::string botgroup_name_arg = sep->arg[1]; if (botgroup_name_arg.empty()) { - c->Message(m_fail, "You must specify a [name] for this bot-group to use this command"); + c->Message(Chat::Red, "You must specify a [name] for this bot-group to use this command"); return; } bool extant_flag = false; if (!database.botdb.QueryBotGroupExistence(botgroup_name_arg, extant_flag)) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::QueryBotGroupExistence(), botgroup_name_arg.c_str()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::QueryBotGroupExistence(), botgroup_name_arg.c_str()); return; } if (extant_flag) { - c->Message(m_fail, "The [name] %s already exists for a bot-group. Please choose another", botgroup_name_arg.c_str()); + c->Message(Chat::Red, "The [name] %s already exists for a bot-group. Please choose another", botgroup_name_arg.c_str()); return; } @@ -6797,49 +6790,49 @@ void bot_subcommand_botgroup_create(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a group leader as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a group leader as a bot that you own to use this command"); return; } auto botgroup_leader = sbl.front(); if (!botgroup_leader) { - c->Message(m_unknown, "Error: Group leader bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Group leader bot dereferenced to nullptr"); return; } if (botgroup_leader->HasGroup()) { - c->Message(m_fail, "%s is already a current member of a group", botgroup_leader->GetCleanName()); + c->Message(Chat::Red, "%s is already a current member of a group", botgroup_leader->GetCleanName()); return; } uint32 botgroup_id = 0; if (!database.botdb.LoadBotGroupIDByLeaderID(botgroup_leader->GetBotID(), botgroup_id)) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::LoadBotGroupIDByLeaderID(), botgroup_leader->GetCleanName()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadBotGroupIDByLeaderID(), botgroup_leader->GetCleanName()); return; } if (botgroup_id) { - c->Message(m_fail, "%s is already the current leader of a bot-group", botgroup_leader->GetCleanName()); + c->Message(Chat::Red, "%s is already the current leader of a bot-group", botgroup_leader->GetCleanName()); return; } botgroup_id = 0; if (!database.botdb.LoadBotGroupIDByMemberID(botgroup_leader->GetBotID(), botgroup_id)) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::LoadBotGroupIDByMemberID(), botgroup_leader->GetCleanName()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadBotGroupIDByMemberID(), botgroup_leader->GetCleanName()); return; } if (botgroup_id) { - c->Message(m_fail, "%s is already a current member of a bot-group", botgroup_leader->GetCleanName()); + c->Message(Chat::Red, "%s is already a current member of a bot-group", botgroup_leader->GetCleanName()); return; } Group* group_inst = new Group(botgroup_leader); if (!group_inst) { - c->Message(m_unknown, "Could not create a new group instance"); + c->Message(Chat::Magenta, "Could not create a new group instance"); return; } if (!database.botdb.CreateBotGroup(botgroup_name_arg, botgroup_leader->GetBotID())) { - c->Message(m_fail, "%s '%s'", BotDatabase::fail::CreateBotGroup(), botgroup_name_arg.c_str()); + c->Message(Chat::Red, "%s '%s'", BotDatabase::fail::CreateBotGroup(), botgroup_name_arg.c_str()); safe_delete(group_inst); return; } @@ -6849,7 +6842,7 @@ void bot_subcommand_botgroup_create(Client *c, const Seperator *sep) database.SetGroupLeaderName(group_inst->GetID(), botgroup_leader->GetCleanName()); botgroup_leader->SetFollowID(c->GetID()); - c->Message(m_action, "Successfully created bot-group '%s' with '%s' as its leader", botgroup_name_arg.c_str(), botgroup_leader->GetCleanName()); + c->Message(Chat::Yellow, "Successfully created bot-group '%s' with '%s' as its leader", botgroup_name_arg.c_str(), botgroup_leader->GetCleanName()); } void bot_subcommand_botgroup_delete(Client *c, const Seperator *sep) @@ -6857,33 +6850,33 @@ void bot_subcommand_botgroup_delete(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_botgroup_delete", sep->arg[0], "botgroupdelete")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [botgroup_name]", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [botgroup_name]", sep->arg[0]); return; } std::string botgroup_name_arg = sep->arg[1]; if (botgroup_name_arg.empty()) { - c->Message(m_fail, "You must specify a [name] for this bot-group to use this command"); + c->Message(Chat::Red, "You must specify a [name] for this bot-group to use this command"); return; } uint32 botgroup_id = 0; if (!database.botdb.LoadBotGroupIDForLoadBotGroup(c->CharacterID(), botgroup_name_arg, botgroup_id)) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::LoadBotGroupIDForLoadBotGroup(), botgroup_name_arg.c_str()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadBotGroupIDForLoadBotGroup(), botgroup_name_arg.c_str()); return; } if (!botgroup_id) { - c->Message(m_fail, "Could not locate group id for '%s'", botgroup_name_arg.c_str()); + c->Message(Chat::Red, "Could not locate group id for '%s'", botgroup_name_arg.c_str()); return; } uint32 leader_id = 0; if (!database.botdb.LoadLeaderIDByBotGroupID(botgroup_id, leader_id)) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::LoadLeaderIDByBotGroupID(), botgroup_name_arg.c_str()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadLeaderIDByBotGroupID(), botgroup_name_arg.c_str()); return; } if (!leader_id) { - c->Message(m_fail, "Could not locate leader id for '%s'", botgroup_name_arg.c_str()); + c->Message(Chat::Red, "Could not locate leader id for '%s'", botgroup_name_arg.c_str()); return; } @@ -6893,11 +6886,11 @@ void bot_subcommand_botgroup_delete(Client *c, const Seperator *sep) std::map> member_list; if (!database.botdb.LoadBotGroup(botgroup_name_arg, member_list)) { - c->Message(m_fail, "%s '%s'", BotDatabase::fail::LoadBotGroup(), botgroup_name_arg.c_str()); + c->Message(Chat::Red, "%s '%s'", BotDatabase::fail::LoadBotGroup(), botgroup_name_arg.c_str()); return; } if (member_list.find(botgroup_id) == member_list.end() || member_list[botgroup_id].empty()) { - c->Message(m_fail, "Could not locate member list for bot-group '%s'", botgroup_name_arg.c_str()); + c->Message(Chat::Red, "Could not locate member list for bot-group '%s'", botgroup_name_arg.c_str()); return; } @@ -6917,11 +6910,11 @@ void bot_subcommand_botgroup_delete(Client *c, const Seperator *sep) } if (!database.botdb.DeleteBotGroup(leader_id)) { - c->Message(m_fail, "%s '%s'", BotDatabase::fail::DeleteBotGroup(), botgroup_name_arg.c_str()); + c->Message(Chat::Red, "%s '%s'", BotDatabase::fail::DeleteBotGroup(), botgroup_name_arg.c_str()); return; } - c->Message(m_action, "Successfully deleted bot-group %s", botgroup_name_arg.c_str()); + c->Message(Chat::Yellow, "Successfully deleted bot-group %s", botgroup_name_arg.c_str()); } void bot_subcommand_botgroup_list(Client *c, const Seperator *sep) @@ -6929,25 +6922,25 @@ void bot_subcommand_botgroup_list(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_botgroup_list", sep->arg[0], "botgrouplist")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s", sep->arg[0]); return; } std::list> botgroups_list; if (!database.botdb.LoadBotGroupsListByOwnerID(c->CharacterID(), botgroups_list)) { - c->Message(m_fail, "%s", BotDatabase::fail::LoadBotGroupsListByOwnerID()); + c->Message(Chat::Red, "%s", BotDatabase::fail::LoadBotGroupsListByOwnerID()); return; } if (botgroups_list.empty()) { - c->Message(m_fail, "You have no saved bot-groups"); + c->Message(Chat::Red, "You have no saved bot-groups"); return; } int botgroup_count = 0; for (auto botgroups_iter : botgroups_list) - c->Message(m_message, "(%i) Bot-group name: %s | Leader: %s", (++botgroup_count), botgroups_iter.first.c_str(), botgroups_iter.second.c_str()); + c->Message(Chat::White, "(%i) Bot-group name: %s | Leader: %s", (++botgroup_count), botgroups_iter.first.c_str(), botgroups_iter.second.c_str()); - c->Message(m_action, "%i bot-groups listed", botgroup_count); + c->Message(Chat::Yellow, "%i bot-groups listed", botgroup_count); } void bot_subcommand_botgroup_load(Client *c, const Seperator *sep) @@ -6955,23 +6948,23 @@ void bot_subcommand_botgroup_load(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_botgroup_load", sep->arg[0], "botgroupload")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [botgroup_name]", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [botgroup_name]", sep->arg[0]); return; } std::string botgroup_name_arg = sep->arg[1]; if (botgroup_name_arg.empty()) { - c->Message(m_fail, "You must specify the [name] of a bot-group to load to use this command"); + c->Message(Chat::Red, "You must specify the [name] of a bot-group to load to use this command"); return; } bool extant_flag = false; if (!database.botdb.QueryBotGroupExistence(botgroup_name_arg, extant_flag)) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::QueryBotGroupExistence(), botgroup_name_arg.c_str()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::QueryBotGroupExistence(), botgroup_name_arg.c_str()); return; } if (!extant_flag) { - c->Message(m_fail, "Bot-group %s does not exist", botgroup_name_arg.c_str()); + c->Message(Chat::Red, "Bot-group %s does not exist", botgroup_name_arg.c_str()); return; } @@ -6983,31 +6976,31 @@ void bot_subcommand_botgroup_load(Client *c, const Seperator *sep) for (auto member_iter : member_list) { if (member_iter->IsEngaged() || member_iter->GetAggroCount() > 0) { - c->Message(m_fail, "You can't spawn bots while your group is engaged"); + c->Message(Chat::Red, "You can't spawn bots while your group is engaged"); return; } } } else { if (c->GetAggroCount() > 0) { - c->Message(m_fail, "You can't spawn bots while you are engaged"); + c->Message(Chat::Red, "You can't spawn bots while you are engaged"); return; } } uint32 botgroup_id = 0; if (!database.botdb.LoadBotGroupIDForLoadBotGroup(c->CharacterID(), botgroup_name_arg, botgroup_id) || !botgroup_id) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::LoadBotGroupIDForLoadBotGroup(), botgroup_name_arg.c_str()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadBotGroupIDForLoadBotGroup(), botgroup_name_arg.c_str()); return; } std::map> member_list; if (!database.botdb.LoadBotGroup(botgroup_name_arg, member_list)) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::LoadBotGroup(), botgroup_name_arg.c_str()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadBotGroup(), botgroup_name_arg.c_str()); return; } if (member_list.find(botgroup_id) == member_list.end() || member_list[botgroup_id].empty()) { - c->Message(m_fail, "Database returned an empty list for bot-group '%s'", botgroup_name_arg.c_str()); + c->Message(Chat::Red, "Database returned an empty list for bot-group '%s'", botgroup_name_arg.c_str()); return; } @@ -7016,46 +7009,46 @@ void bot_subcommand_botgroup_load(Client *c, const Seperator *sep) if (RuleB(Bots, QuestableSpawnLimit)) { int allowed_bot_count = 0; if (!database.botdb.LoadQuestableSpawnCount(c->CharacterID(), allowed_bot_count)) { - c->Message(m_fail, "%s", BotDatabase::fail::LoadQuestableSpawnCount()); + c->Message(Chat::Red, "%s", BotDatabase::fail::LoadQuestableSpawnCount()); return; } if (!allowed_bot_count) { - c->Message(m_fail, "You can not spawn any bots"); + c->Message(Chat::Red, "You can not spawn any bots"); return; } if (spawned_bot_count >= allowed_bot_count || (spawned_bot_count + member_list.begin()->second.size()) > allowed_bot_count) { - c->Message(m_fail, "You can not spawn more than %i bot%s (quest-limit)", allowed_bot_count, ((allowed_bot_count == 1) ? ("") : ("s"))); + c->Message(Chat::Red, "You can not spawn more than %i bot%s (quest-limit)", allowed_bot_count, ((allowed_bot_count == 1) ? ("") : ("s"))); return; } } const int allowed_bot_limit = RuleI(Bots, SpawnLimit); if (spawned_bot_count >= allowed_bot_limit || (spawned_bot_count + member_list.begin()->second.size()) > allowed_bot_limit) { - c->Message(m_fail, "You can not spawn more than %i bot%s (hard-limit)", allowed_bot_limit, ((allowed_bot_limit == 1) ? ("") : ("s"))); + c->Message(Chat::Red, "You can not spawn more than %i bot%s (hard-limit)", allowed_bot_limit, ((allowed_bot_limit == 1) ? ("") : ("s"))); return; } uint32 leader_id = 0; if (!database.botdb.LoadLeaderIDByBotGroupName(botgroup_name_arg, leader_id)) { - c->Message(m_fail, "%s for '%s'", BotDatabase::fail::LoadLeaderIDByBotGroupName(), botgroup_name_arg.c_str()); + c->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::LoadLeaderIDByBotGroupName(), botgroup_name_arg.c_str()); return; } if (!leader_id) { - c->Message(m_fail, "Cannot locate bot-group leader id for '%s'", botgroup_name_arg.c_str()); + c->Message(Chat::Red, "Cannot locate bot-group leader id for '%s'", botgroup_name_arg.c_str()); return; } auto botgroup_leader = Bot::LoadBot(leader_id); if (!botgroup_leader) { - c->Message(m_fail, "Could not load bot-group leader for '%s'", botgroup_name_arg.c_str()); + c->Message(Chat::Red, "Could not load bot-group leader for '%s'", botgroup_name_arg.c_str()); safe_delete(botgroup_leader); return; } if (!botgroup_leader->Spawn(c)) { - c->Message(m_fail, "Could not spawn bot-group leader %s for '%s'", botgroup_leader->GetName(), botgroup_name_arg.c_str()); + c->Message(Chat::Red, "Could not spawn bot-group leader %s for '%s'", botgroup_leader->GetName(), botgroup_name_arg.c_str()); safe_delete(botgroup_leader); return; } @@ -7072,13 +7065,13 @@ void bot_subcommand_botgroup_load(Client *c, const Seperator *sep) for (auto member_iter : member_list[botgroup_id]) { auto botgroup_member = Bot::LoadBot(member_iter); if (!botgroup_member) { - c->Message(m_fail, "Could not load bot id %i", member_iter); + c->Message(Chat::Red, "Could not load bot id %i", member_iter); safe_delete(botgroup_member); return; } if (!botgroup_member->Spawn(c)) { - c->Message(m_fail, "Could not spawn bot '%s' (id: %i)", botgroup_member->GetName(), member_iter); + c->Message(Chat::Red, "Could not spawn bot '%s' (id: %i)", botgroup_member->GetName(), member_iter); safe_delete(botgroup_member); return; } @@ -7086,7 +7079,7 @@ void bot_subcommand_botgroup_load(Client *c, const Seperator *sep) Bot::AddBotToGroup(botgroup_member, group_inst); } - c->Message(m_action, "Successfully loaded bot-group %s", botgroup_name_arg.c_str()); + c->Message(Chat::Yellow, "Successfully loaded bot-group %s", botgroup_name_arg.c_str()); } void bot_subcommand_botgroup_remove_member(Client *c, const Seperator *sep) @@ -7094,7 +7087,7 @@ void bot_subcommand_botgroup_remove_member(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_botgroup_remove_member", sep->arg[0], "botgroupremovemember")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([member_name])", sep->arg[0]); return; } @@ -7103,32 +7096,32 @@ void bot_subcommand_botgroup_remove_member(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a group member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a group member as a bot that you own to use this command"); return; } auto group_member = sbl.front(); if (!group_member) { - c->Message(m_unknown, "Error: Group member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Group member bot dereferenced to nullptr"); return; } if (!group_member->HasGroup()) { - c->Message(m_fail, "%s is not a current member of a group", group_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a group", group_member->GetCleanName()); return; } if (!Bot::RemoveBotFromGroup(group_member, group_member->GetGroup())) { - c->Message(m_fail, "Could not remove %s from their group", group_member->GetCleanName()); + c->Message(Chat::Red, "Could not remove %s from their group", group_member->GetCleanName()); return; } if (!database.botdb.RemoveMemberFromBotGroup(group_member->GetBotID())) { - c->Message(m_fail, "%s - '%s'", BotDatabase::fail::RemoveMemberFromBotGroup(), group_member->GetCleanName()); + c->Message(Chat::Red, "%s - '%s'", BotDatabase::fail::RemoveMemberFromBotGroup(), group_member->GetCleanName()); return; } - c->Message(m_action, "Successfully removed %s from their bot-group", group_member->GetCleanName()); + c->Message(Chat::Yellow, "Successfully removed %s from their bot-group", group_member->GetCleanName()); } void bot_subcommand_circle(Client *c, const Seperator *sep) @@ -7137,7 +7130,7 @@ void bot_subcommand_circle(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Depart) || helper_command_alias_fail(c, "bot_subcommand_circle", sep->arg[0], "circle")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [list | destination] ([option: single])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [list | destination] ([option: single])", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Depart, DRUID); return; } @@ -7154,7 +7147,7 @@ void bot_subcommand_circle(Client *c, const Seperator *sep) return; } else if (destination.empty()) { - c->Message(m_fail, "A [destination] or [list] argument is required to use this command"); + c->Message(Chat::Red, "A [destination] or [list] argument is required to use this command"); return; } @@ -7195,7 +7188,7 @@ void bot_subcommand_heal_rotation_adaptive_targeting(Client *c, const Seperator if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_adaptive_targeting", sep->arg[0], "healrotationadaptivetargeting")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([member_name]) ([option: on | off])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([member_name]) ([option: on | off])", sep->arg[0]); return; } @@ -7212,18 +7205,18 @@ void bot_subcommand_heal_rotation_adaptive_targeting(Client *c, const Seperator } if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } @@ -7233,13 +7226,13 @@ void bot_subcommand_heal_rotation_adaptive_targeting(Client *c, const Seperator hr_adaptive_targeting = true; } else if (adaptive_targeting_arg.compare("off")) { - c->Message(m_action, "Adaptive targeting is currently '%s' for %s's Heal Rotation", (((*current_member->MemberOfHealRotation())->AdaptiveTargeting()) ? ("on") : ("off")), current_member->GetCleanName()); + c->Message(Chat::Yellow, "Adaptive targeting is currently '%s' for %s's Heal Rotation", (((*current_member->MemberOfHealRotation())->AdaptiveTargeting()) ? ("on") : ("off")), current_member->GetCleanName()); return; } (*current_member->MemberOfHealRotation())->SetAdaptiveTargeting(hr_adaptive_targeting); - c->Message(m_action, "Adaptive targeting is now '%s' for %s's Heal Rotation", (((*current_member->MemberOfHealRotation())->AdaptiveTargeting()) ? ("on") : ("off")), current_member->GetCleanName()); + c->Message(Chat::Yellow, "Adaptive targeting is now '%s' for %s's Heal Rotation", (((*current_member->MemberOfHealRotation())->AdaptiveTargeting()) ? ("on") : ("off")), current_member->GetCleanName()); } void bot_subcommand_heal_rotation_add_member(Client *c, const Seperator *sep) @@ -7247,25 +7240,25 @@ void bot_subcommand_heal_rotation_add_member(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_add_member", sep->arg[0], "healrotationaddmember")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s [new_member_name] ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s [new_member_name] ([member_name])", sep->arg[0]); return; } std::list sbl; MyBots::PopulateSBL_ByNamedBot(c, sbl, sep->arg[1]); if (sbl.empty()) { - c->Message(m_fail, "You must [name] a new member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must [name] a new member as a bot that you own to use this command"); return; } auto new_member = sbl.front(); if (!new_member) { - c->Message(m_unknown, "Error: New member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: New member bot dereferenced to nullptr"); return; } if (new_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is already a current member of a Heal Rotation and can not join another one", new_member->GetCleanName()); + c->Message(Chat::Red, "%s is already a current member of a Heal Rotation and can not join another one", new_member->GetCleanName()); return; } @@ -7273,27 +7266,27 @@ void bot_subcommand_heal_rotation_add_member(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } if (!new_member->JoinHealRotationMemberPool(current_member->MemberOfHealRotation())) { - c->Message(m_fail, "Failed to add %s as a current member of this Heal Rotation", new_member->GetCleanName()); + c->Message(Chat::Red, "Failed to add %s as a current member of this Heal Rotation", new_member->GetCleanName()); return; } - c->Message(m_action, "Successfully added %s as a current member of this Heal Rotation", new_member->GetCleanName()); + c->Message(Chat::Yellow, "Successfully added %s as a current member of this Heal Rotation", new_member->GetCleanName()); } void bot_subcommand_heal_rotation_add_target(Client *c, const Seperator *sep) @@ -7301,7 +7294,7 @@ void bot_subcommand_heal_rotation_add_target(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_add_target", sep->arg[0], "healrotationaddtarget")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s [heal_target_name] ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s [heal_target_name] ([member_name])", sep->arg[0]); return; } @@ -7310,40 +7303,40 @@ void bot_subcommand_heal_rotation_add_target(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a member of a Heal Rotation", current_member->GetCleanName()); return; } auto heal_target = entity_list.GetMob(sep->arg[1]); if (!heal_target) { - c->Message(m_fail, "No target exists by the name '%s'", sep->arg[1]); + c->Message(Chat::Red, "No target exists by the name '%s'", sep->arg[1]); return; } if ((!heal_target->IsClient() && !heal_target->IsBot() && !heal_target->IsPet()) || (heal_target->IsPet() && (!heal_target->GetOwner() || (!heal_target->GetOwner()->IsClient() && !heal_target->GetOwner()->IsBot())))) { - c->Message(m_fail, "%s's entity type is not an allowable heal target", heal_target->GetCleanName()); + c->Message(Chat::Red, "%s's entity type is not an allowable heal target", heal_target->GetCleanName()); return; } if (!heal_target->JoinHealRotationTargetPool(current_member->MemberOfHealRotation())) { - c->Message(m_fail, "Failed to add heal target with a name of '%s'", heal_target->GetCleanName()); + c->Message(Chat::Red, "Failed to add heal target with a name of '%s'", heal_target->GetCleanName()); return; } - c->Message(m_action, "Successfully added heal target %s to %s's Heal Rotation", heal_target->GetCleanName(), current_member->GetCleanName()); + c->Message(Chat::Yellow, "Successfully added heal target %s to %s's Heal Rotation", heal_target->GetCleanName(), current_member->GetCleanName()); } void bot_subcommand_heal_rotation_adjust_critical(Client *c, const Seperator *sep) @@ -7351,8 +7344,8 @@ void bot_subcommand_heal_rotation_adjust_critical(Client *c, const Seperator *se if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_adjust_critical", sep->arg[0], "healrotationadjustcritical")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s [armor_type] [value: %3.1f-%3.1f | + | -] ([member_name])", sep->arg[0], CRITICAL_HP_RATIO_BASE, SAFE_HP_RATIO_BASE); - c->Message(m_note, "armor_types: %u(Base), %u(Cloth), %u(Leather), %u(Chain), %u(Plate)", + c->Message(Chat::Cyan, "usage: () %s [armor_type] [value: %3.1f-%3.1f | + | -] ([member_name])", sep->arg[0], CRITICAL_HP_RATIO_BASE, SAFE_HP_RATIO_BASE); + c->Message(Chat::Gray, "armor_types: %u(Base), %u(Cloth), %u(Leather), %u(Chain), %u(Plate)", ARMOR_TYPE_UNKNOWN, ARMOR_TYPE_CLOTH, ARMOR_TYPE_LEATHER, ARMOR_TYPE_CHAIN, ARMOR_TYPE_PLATE); return; } @@ -7365,7 +7358,7 @@ void bot_subcommand_heal_rotation_adjust_critical(Client *c, const Seperator *se armor_type_value = atoi(armor_type_arg.c_str()); if (armor_type_value > ARMOR_TYPE_LAST) { - c->Message(m_fail, "You must specify a valid [armor_type: %u-%u] to use this command", ARMOR_TYPE_FIRST, ARMOR_TYPE_LAST); + c->Message(Chat::Red, "You must specify a valid [armor_type: %u-%u] to use this command", ARMOR_TYPE_FIRST, ARMOR_TYPE_LAST); return; } @@ -7374,18 +7367,18 @@ void bot_subcommand_heal_rotation_adjust_critical(Client *c, const Seperator *se if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } @@ -7403,12 +7396,12 @@ void bot_subcommand_heal_rotation_adjust_critical(Client *c, const Seperator *se critical_ratio = CRITICAL_HP_RATIO_ABS; if (!(*current_member->MemberOfHealRotation())->SetArmorTypeCriticalHPRatio(armor_type_value, critical_ratio)) { - c->Message(m_fail, "Critical value %3.1f%%(%u) exceeds safe value %3.1f%%(%u) for %s's Heal Rotation", + c->Message(Chat::Red, "Critical value %3.1f%%(%u) exceeds safe value %3.1f%%(%u) for %s's Heal Rotation", critical_ratio, armor_type_value, (*current_member->MemberOfHealRotation())->ArmorTypeSafeHPRatio(armor_type_value), armor_type_value, current_member->GetCleanName()); return; } - c->Message(m_action, "Class Armor Type %u critical value %3.1f%% set for %s's Heal Rotation", + c->Message(Chat::Yellow, "Class Armor Type %u critical value %3.1f%% set for %s's Heal Rotation", armor_type_value, (*current_member->MemberOfHealRotation())->ArmorTypeCriticalHPRatio(armor_type_value), current_member->GetCleanName()); } @@ -7417,8 +7410,8 @@ void bot_subcommand_heal_rotation_adjust_safe(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_adjust_safe", sep->arg[0], "healrotationadjustsafe")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s [armor_type] [value: %3.1f-%3.1f | + | -] ([member_name])", sep->arg[0], CRITICAL_HP_RATIO_BASE, SAFE_HP_RATIO_BASE); - c->Message(m_note, "armor_types: %u(Base), %u(Cloth), %u(Leather), %u(Chain), %u(Plate)", + c->Message(Chat::Cyan, "usage: () %s [armor_type] [value: %3.1f-%3.1f | + | -] ([member_name])", sep->arg[0], CRITICAL_HP_RATIO_BASE, SAFE_HP_RATIO_BASE); + c->Message(Chat::Gray, "armor_types: %u(Base), %u(Cloth), %u(Leather), %u(Chain), %u(Plate)", ARMOR_TYPE_UNKNOWN, ARMOR_TYPE_CLOTH, ARMOR_TYPE_LEATHER, ARMOR_TYPE_CHAIN, ARMOR_TYPE_PLATE); return; } @@ -7431,7 +7424,7 @@ void bot_subcommand_heal_rotation_adjust_safe(Client *c, const Seperator *sep) armor_type_value = atoi(armor_type_arg.c_str()); if (armor_type_value > ARMOR_TYPE_LAST) { - c->Message(m_fail, "You must specify a valid [armor_type: %u-%u] to use this command", ARMOR_TYPE_FIRST, ARMOR_TYPE_LAST); + c->Message(Chat::Red, "You must specify a valid [armor_type: %u-%u] to use this command", ARMOR_TYPE_FIRST, ARMOR_TYPE_LAST); return; } @@ -7440,18 +7433,18 @@ void bot_subcommand_heal_rotation_adjust_safe(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } @@ -7469,12 +7462,12 @@ void bot_subcommand_heal_rotation_adjust_safe(Client *c, const Seperator *sep) safe_ratio = CRITICAL_HP_RATIO_ABS; if (!(*current_member->MemberOfHealRotation())->SetArmorTypeSafeHPRatio(armor_type_value, safe_ratio)) { - c->Message(m_fail, "Safe value %3.1f%%(%u) does not exceed critical value %3.1f%%(%u) for %s's Heal Rotation", + c->Message(Chat::Red, "Safe value %3.1f%%(%u) does not exceed critical value %3.1f%%(%u) for %s's Heal Rotation", safe_ratio, armor_type_value, (*current_member->MemberOfHealRotation())->ArmorTypeCriticalHPRatio(armor_type_value), armor_type_value, current_member->GetCleanName()); return; } - c->Message(m_action, "Class Armor Type %u safe value %3.1f%% set for %s's Heal Rotation", + c->Message(Chat::Yellow, "Class Armor Type %u safe value %3.1f%% set for %s's Heal Rotation", armor_type_value, (*current_member->MemberOfHealRotation())->ArmorTypeSafeHPRatio(armor_type_value), current_member->GetCleanName()); } @@ -7483,7 +7476,7 @@ void bot_subcommand_heal_rotation_casting_override(Client *c, const Seperator *s if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_casting_override", sep->arg[0], "healrotationcastingoverride")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([member_name]) ([option: on | off])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([member_name]) ([option: on | off])", sep->arg[0]); return; } @@ -7500,18 +7493,18 @@ void bot_subcommand_heal_rotation_casting_override(Client *c, const Seperator *s } if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } @@ -7521,13 +7514,13 @@ void bot_subcommand_heal_rotation_casting_override(Client *c, const Seperator *s hr_casting_override = true; } else if (casting_override_arg.compare("off")) { - c->Message(m_action, "Casting override is currently '%s' for %s's Heal Rotation", (((*current_member->MemberOfHealRotation())->CastingOverride()) ? ("on") : ("off")), current_member->GetCleanName()); + c->Message(Chat::Yellow, "Casting override is currently '%s' for %s's Heal Rotation", (((*current_member->MemberOfHealRotation())->CastingOverride()) ? ("on") : ("off")), current_member->GetCleanName()); return; } (*current_member->MemberOfHealRotation())->SetCastingOverride(hr_casting_override); - c->Message(m_action, "Casting override is now '%s' for %s's Heal Rotation", (((*current_member->MemberOfHealRotation())->CastingOverride()) ? ("on") : ("off")), current_member->GetCleanName()); + c->Message(Chat::Yellow, "Casting override is now '%s' for %s's Heal Rotation", (((*current_member->MemberOfHealRotation())->CastingOverride()) ? ("on") : ("off")), current_member->GetCleanName()); } void bot_subcommand_heal_rotation_change_interval(Client *c, const Seperator *sep) @@ -7535,7 +7528,7 @@ void bot_subcommand_heal_rotation_change_interval(Client *c, const Seperator *se if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_change_interval", sep->arg[0], "healrotationchangeinterval")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([member_name]) ([interval=%u: %u-%u(seconds)])", + c->Message(Chat::Cyan, "usage: () %s ([member_name]) ([interval=%u: %u-%u(seconds)])", sep->arg[0], CASTING_CYCLE_DEFAULT_INTERVAL_S, CASTING_CYCLE_MINIMUM_INTERVAL_S, CASTING_CYCLE_MAXIMUM_INTERVAL_S); return; } @@ -7553,18 +7546,18 @@ void bot_subcommand_heal_rotation_change_interval(Client *c, const Seperator *se } if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } @@ -7575,7 +7568,7 @@ void bot_subcommand_heal_rotation_change_interval(Client *c, const Seperator *se } else { hr_change_interval_s = (*current_member->MemberOfHealRotation())->IntervalS(); - c->Message(m_action, "Casting interval is currently '%i' second%s for %s's Heal Rotation", hr_change_interval_s, ((hr_change_interval_s == 1) ? ("") : ("s")), current_member->GetCleanName()); + c->Message(Chat::Yellow, "Casting interval is currently '%i' second%s for %s's Heal Rotation", hr_change_interval_s, ((hr_change_interval_s == 1) ? ("") : ("s")), current_member->GetCleanName()); return; } @@ -7585,7 +7578,7 @@ void bot_subcommand_heal_rotation_change_interval(Client *c, const Seperator *se (*current_member->MemberOfHealRotation())->SetIntervalS(hr_change_interval_s); hr_change_interval_s = (*current_member->MemberOfHealRotation())->IntervalS(); - c->Message(m_action, "Casting interval is now '%i' second%s for %s's Heal Rotation", hr_change_interval_s, ((hr_change_interval_s == 1) ? ("") : ("s")), current_member->GetCleanName()); + c->Message(Chat::Yellow, "Casting interval is now '%i' second%s for %s's Heal Rotation", hr_change_interval_s, ((hr_change_interval_s == 1) ? ("") : ("s")), current_member->GetCleanName()); } void bot_subcommand_heal_rotation_clear_hot(Client *c, const Seperator *sep) @@ -7593,7 +7586,7 @@ void bot_subcommand_heal_rotation_clear_hot(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_clear_hot", sep->arg[0], "healrotationclearhot")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([member_name])", sep->arg[0]); return; } @@ -7602,26 +7595,26 @@ void bot_subcommand_heal_rotation_clear_hot(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } if (!(*current_member->MemberOfHealRotation())->ClearHOTTarget()) { - c->Message(m_fail, "Failed to clear %s's Heal Rotation HOT", current_member->GetCleanName()); + c->Message(Chat::Red, "Failed to clear %s's Heal Rotation HOT", current_member->GetCleanName()); } - c->Message(m_action, "Succeeded in clearing %s's Heal Rotation HOT", current_member->GetCleanName()); + c->Message(Chat::Yellow, "Succeeded in clearing %s's Heal Rotation HOT", current_member->GetCleanName()); } void bot_subcommand_heal_rotation_clear_targets(Client *c, const Seperator *sep) @@ -7629,7 +7622,7 @@ void bot_subcommand_heal_rotation_clear_targets(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_clear_targets", sep->arg[0], "healrotationcleartargets")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([member_name])", sep->arg[0]); return; } @@ -7638,27 +7631,27 @@ void bot_subcommand_heal_rotation_clear_targets(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a member of a Heal Rotation", current_member->GetCleanName()); return; } if (!(*current_member->MemberOfHealRotation())->ClearTargetPool()) { - c->Message(m_fail, "Failed to clear all targets from %s's Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "Failed to clear all targets from %s's Heal Rotation", current_member->GetCleanName()); return; } - c->Message(m_action, "All targets have been cleared from %s's Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Yellow, "All targets have been cleared from %s's Heal Rotation", current_member->GetCleanName()); } void bot_subcommand_heal_rotation_create(Client *c, const Seperator *sep) @@ -7666,7 +7659,7 @@ void bot_subcommand_heal_rotation_create(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_create", sep->arg[0], "healrotationcreate")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([creator_name]) ([interval=%u: %u-%u(seconds)] [fastheals=off: on | off] [adaptivetargeting=off: on | off] [castingoverride=off: on | off])", + c->Message(Chat::Cyan, "usage: () %s ([creator_name]) ([interval=%u: %u-%u(seconds)] [fastheals=off: on | off] [adaptivetargeting=off: on | off] [castingoverride=off: on | off])", sep->arg[0], CASTING_CYCLE_DEFAULT_INTERVAL_S, CASTING_CYCLE_MINIMUM_INTERVAL_S, CASTING_CYCLE_MAXIMUM_INTERVAL_S); return; } @@ -7693,18 +7686,18 @@ void bot_subcommand_heal_rotation_create(Client *c, const Seperator *sep) } if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a creator as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a creator as a bot that you own to use this command"); return; } auto creator_member = sbl.front(); if (!creator_member) { - c->Message(m_unknown, "Error: Creator bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Creator bot dereferenced to nullptr"); return; } if (creator_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is already a current member of a Heal Rotation", creator_member->GetCleanName()); + c->Message(Chat::Red, "%s is already a current member of a Heal Rotation", creator_member->GetCleanName()); return; } @@ -7735,7 +7728,7 @@ void bot_subcommand_heal_rotation_create(Client *c, const Seperator *sep) hr_interval_s *= 1000; // convert to milliseconds for Bot/HealRotation constructor if (!creator_member->CreateHealRotation(hr_interval_s, hr_fast_heals, hr_adaptive_targeting, hr_casting_override)) { - c->Message(m_fail, "Failed to add %s as a current member to a new Heal Rotation", creator_member->GetCleanName()); + c->Message(Chat::Red, "Failed to add %s as a current member to a new Heal Rotation", creator_member->GetCleanName()); return; } @@ -7746,10 +7739,10 @@ void bot_subcommand_heal_rotation_create(Client *c, const Seperator *sep) bool target_fail = false; if (!database.botdb.LoadHealRotation(creator_member, member_list, target_list, load_flag, member_fail, target_fail)) - c->Message(m_fail, "%s", BotDatabase::fail::LoadHealRotation()); + c->Message(Chat::Red, "%s", BotDatabase::fail::LoadHealRotation()); if (!load_flag) { - c->Message(m_action, "Successfully added %s as a current member to a new Heal Rotation", creator_member->GetCleanName()); + c->Message(Chat::Yellow, "Successfully added %s as a current member to a new Heal Rotation", creator_member->GetCleanName()); return; } @@ -7765,18 +7758,18 @@ void bot_subcommand_heal_rotation_create(Client *c, const Seperator *sep) continue; if (!bot_iter->JoinHealRotationMemberPool(creator_member->MemberOfHealRotation())) - c->Message(m_fail, "Failed to add member '%s'", bot_iter->GetCleanName()); + c->Message(Chat::Red, "Failed to add member '%s'", bot_iter->GetCleanName()); member_found = true; break; } if (!member_found) - c->Message(m_fail, "Could not locate member with bot id '%u'", member_iter); + c->Message(Chat::Red, "Could not locate member with bot id '%u'", member_iter); } } else { - c->Message(m_fail, "%s", BotDatabase::fail::LoadHealRotationMembers()); + c->Message(Chat::Red, "%s", BotDatabase::fail::LoadHealRotationMembers()); } if (!target_fail) { @@ -7786,19 +7779,19 @@ void bot_subcommand_heal_rotation_create(Client *c, const Seperator *sep) auto target_mob = entity_list.GetMob(target_iter.c_str()); if (!target_mob) { - c->Message(m_fail, "Could not locate target '%s'", target_iter.c_str()); + c->Message(Chat::Red, "Could not locate target '%s'", target_iter.c_str()); continue; } if (!target_mob->JoinHealRotationTargetPool(creator_member->MemberOfHealRotation())) - c->Message(m_fail, "Failed to add target '%s'", target_mob->GetCleanName()); + c->Message(Chat::Red, "Failed to add target '%s'", target_mob->GetCleanName()); } } else { - c->Message(m_fail, "%s", BotDatabase::fail::LoadHealRotationTargets()); + c->Message(Chat::Red, "%s", BotDatabase::fail::LoadHealRotationTargets()); } - c->Message(m_action, "Successfully loaded %s's Heal Rotation", creator_member->GetCleanName()); + c->Message(Chat::Yellow, "Successfully loaded %s's Heal Rotation", creator_member->GetCleanName()); } void bot_subcommand_heal_rotation_delete(Client *c, const Seperator *sep) @@ -7806,7 +7799,7 @@ void bot_subcommand_heal_rotation_delete(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_delete", sep->arg[0], "healrotationdelete")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([option: all]) ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([option: all]) ([member_name])", sep->arg[0]); return; } @@ -7819,9 +7812,9 @@ void bot_subcommand_heal_rotation_delete(Client *c, const Seperator *sep) if (all_flag) { if (database.botdb.DeleteAllHealRotations(c->CharacterID())) - c->Message(m_action, "Succeeded in deleting all heal rotations"); + c->Message(Chat::Yellow, "Succeeded in deleting all heal rotations"); else - c->Message(m_fail, "%s", BotDatabase::fail::DeleteAllHealRotations()); + c->Message(Chat::Red, "%s", BotDatabase::fail::DeleteAllHealRotations()); return; } @@ -7831,22 +7824,22 @@ void bot_subcommand_heal_rotation_delete(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!database.botdb.DeleteHealRotation(current_member->GetBotID())) { - c->Message(m_fail, "%s", BotDatabase::fail::DeleteHealRotation()); + c->Message(Chat::Red, "%s", BotDatabase::fail::DeleteHealRotation()); return; } - c->Message(m_action, "Succeeded in deleting %s's heal rotation", current_member->GetCleanName()); + c->Message(Chat::Yellow, "Succeeded in deleting %s's heal rotation", current_member->GetCleanName()); } void bot_subcommand_heal_rotation_fast_heals(Client *c, const Seperator *sep) @@ -7854,7 +7847,7 @@ void bot_subcommand_heal_rotation_fast_heals(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_fast_heals", sep->arg[0], "healrotationfastheals")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([member_name]) ([option: on | off])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([member_name]) ([option: on | off])", sep->arg[0]); return; } @@ -7871,18 +7864,18 @@ void bot_subcommand_heal_rotation_fast_heals(Client *c, const Seperator *sep) } if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } @@ -7892,13 +7885,13 @@ void bot_subcommand_heal_rotation_fast_heals(Client *c, const Seperator *sep) hr_fast_heals = true; } else if (fast_heals_arg.compare("off")) { - c->Message(m_action, "Fast heals are currently '%s' for %s's Heal Rotation", (((*current_member->MemberOfHealRotation())->FastHeals()) ? ("on") : ("off")), current_member->GetCleanName()); + c->Message(Chat::Yellow, "Fast heals are currently '%s' for %s's Heal Rotation", (((*current_member->MemberOfHealRotation())->FastHeals()) ? ("on") : ("off")), current_member->GetCleanName()); return; } (*current_member->MemberOfHealRotation())->SetFastHeals(hr_fast_heals); - c->Message(m_action, "Fast heals are now '%s' for %s's Heal Rotation", (((*current_member->MemberOfHealRotation())->FastHeals()) ? ("on") : ("off")), current_member->GetCleanName()); + c->Message(Chat::Yellow, "Fast heals are now '%s' for %s's Heal Rotation", (((*current_member->MemberOfHealRotation())->FastHeals()) ? ("on") : ("off")), current_member->GetCleanName()); } void bot_subcommand_heal_rotation_list(Client *c, const Seperator *sep) @@ -7906,7 +7899,7 @@ void bot_subcommand_heal_rotation_list(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_list", sep->arg[0], "healrotationlist")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([member_name])", sep->arg[0]); return; } @@ -7915,48 +7908,48 @@ void bot_subcommand_heal_rotation_list(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } - c->Message(m_note, "Heal Rotation Settings:"); + c->Message(Chat::Gray, "Heal Rotation Settings:"); - c->Message(m_message, "Current state: %s", (((*current_member->MemberOfHealRotation())->IsActive()) ? ("active") : ("inactive"))); - c->Message(m_message, "Casting interval: %i seconds", (*current_member->MemberOfHealRotation())->IntervalS()); - c->Message(m_message, "Fast heals: '%s'", (((*current_member->MemberOfHealRotation())->FastHeals()) ? ("on") : ("off"))); - c->Message(m_message, "Adaptive targeting: '%s'", (((*current_member->MemberOfHealRotation())->AdaptiveTargeting()) ? ("on") : ("off"))); - c->Message(m_message, "Casting override: '%s'", (((*current_member->MemberOfHealRotation())->CastingOverride()) ? ("on") : ("off"))); - c->Message(m_message, "HOT state: %s", (((*current_member->MemberOfHealRotation())->IsHOTActive()) ? ("active") : ("inactive"))); - c->Message(m_message, "HOT target: %s", (((*current_member->MemberOfHealRotation())->HOTTarget()) ? ((*current_member->MemberOfHealRotation())->HOTTarget()->GetCleanName()) : ("null"))); + c->Message(Chat::White, "Current state: %s", (((*current_member->MemberOfHealRotation())->IsActive()) ? ("active") : ("inactive"))); + c->Message(Chat::White, "Casting interval: %i seconds", (*current_member->MemberOfHealRotation())->IntervalS()); + c->Message(Chat::White, "Fast heals: '%s'", (((*current_member->MemberOfHealRotation())->FastHeals()) ? ("on") : ("off"))); + c->Message(Chat::White, "Adaptive targeting: '%s'", (((*current_member->MemberOfHealRotation())->AdaptiveTargeting()) ? ("on") : ("off"))); + c->Message(Chat::White, "Casting override: '%s'", (((*current_member->MemberOfHealRotation())->CastingOverride()) ? ("on") : ("off"))); + c->Message(Chat::White, "HOT state: %s", (((*current_member->MemberOfHealRotation())->IsHOTActive()) ? ("active") : ("inactive"))); + c->Message(Chat::White, "HOT target: %s", (((*current_member->MemberOfHealRotation())->HOTTarget()) ? ((*current_member->MemberOfHealRotation())->HOTTarget()->GetCleanName()) : ("null"))); - c->Message(m_message, "Base hp limits - critical: %3.1f%%, safe: %3.1f%%", + c->Message(Chat::White, "Base hp limits - critical: %3.1f%%, safe: %3.1f%%", (*current_member->MemberOfHealRotation())->ArmorTypeCriticalHPRatio(ARMOR_TYPE_UNKNOWN), (*current_member->MemberOfHealRotation())->ArmorTypeSafeHPRatio(ARMOR_TYPE_UNKNOWN)); - c->Message(m_message, "Cloth hp limits - critical: %3.1f%%, safe: %3.1f%%", + c->Message(Chat::White, "Cloth hp limits - critical: %3.1f%%, safe: %3.1f%%", (*current_member->MemberOfHealRotation())->ArmorTypeCriticalHPRatio(ARMOR_TYPE_CLOTH), (*current_member->MemberOfHealRotation())->ArmorTypeSafeHPRatio(ARMOR_TYPE_CLOTH)); - c->Message(m_message, "Leather hp limits - critical: %3.1f%%, safe: %3.1f%%", + c->Message(Chat::White, "Leather hp limits - critical: %3.1f%%, safe: %3.1f%%", (*current_member->MemberOfHealRotation())->ArmorTypeCriticalHPRatio(ARMOR_TYPE_LEATHER), (*current_member->MemberOfHealRotation())->ArmorTypeSafeHPRatio(ARMOR_TYPE_LEATHER)); - c->Message(m_message, "Chain hp limits - critical: %3.1f%%, safe: %3.1f%%", + c->Message(Chat::White, "Chain hp limits - critical: %3.1f%%, safe: %3.1f%%", (*current_member->MemberOfHealRotation())->ArmorTypeCriticalHPRatio(ARMOR_TYPE_CHAIN), (*current_member->MemberOfHealRotation())->ArmorTypeSafeHPRatio(ARMOR_TYPE_CHAIN)); - c->Message(m_message, "Plate hp limits - critical: %3.1f%%, safe: %3.1f%%", + c->Message(Chat::White, "Plate hp limits - critical: %3.1f%%, safe: %3.1f%%", (*current_member->MemberOfHealRotation())->ArmorTypeCriticalHPRatio(ARMOR_TYPE_PLATE), (*current_member->MemberOfHealRotation())->ArmorTypeSafeHPRatio(ARMOR_TYPE_PLATE)); - c->Message(m_note, "Heal Rotation Members:"); + c->Message(Chat::Gray, "Heal Rotation Members:"); int member_index = 0; auto member_pool = (*current_member->MemberOfHealRotation())->MemberList(); @@ -7964,12 +7957,12 @@ void bot_subcommand_heal_rotation_list(Client *c, const Seperator *sep) if (!member_iter) continue; - c->Message(m_message, "(%i) %s", (++member_index), member_iter->GetCleanName()); + c->Message(Chat::White, "(%i) %s", (++member_index), member_iter->GetCleanName()); } if (!member_index) - c->Message(m_fail, "(0) None"); + c->Message(Chat::Red, "(0) None"); - c->Message(m_note, "Heal Rotation Targets:"); + c->Message(Chat::Gray, "Heal Rotation Targets:"); int target_index = 0; auto target_pool = (*current_member->MemberOfHealRotation())->TargetList(); @@ -7977,10 +7970,10 @@ void bot_subcommand_heal_rotation_list(Client *c, const Seperator *sep) if (!target_iter) continue; - c->Message(m_message, "(%i) %s", (++target_index), target_iter->GetCleanName()); + c->Message(Chat::White, "(%i) %s", (++target_index), target_iter->GetCleanName()); } if (!target_index) - c->Message(m_message, "(0) None"); + c->Message(Chat::White, "(0) None"); } void bot_subcommand_heal_rotation_remove_member(Client *c, const Seperator *sep) @@ -7988,7 +7981,7 @@ void bot_subcommand_heal_rotation_remove_member(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_remove_member", sep->arg[0], "healrotationremovemember")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([member_name])", sep->arg[0]); return; } @@ -7997,27 +7990,27 @@ void bot_subcommand_heal_rotation_remove_member(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } if (!current_member->LeaveHealRotationMemberPool()) { - c->Message(m_fail, "Failed to remove %s from their Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "Failed to remove %s from their Heal Rotation", current_member->GetCleanName()); return; } - c->Message(m_action, "%s has been removed from their Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Yellow, "%s has been removed from their Heal Rotation", current_member->GetCleanName()); } void bot_subcommand_heal_rotation_remove_target(Client *c, const Seperator *sep) @@ -8025,7 +8018,7 @@ void bot_subcommand_heal_rotation_remove_target(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_remove_target", sep->arg[0], "healrotationremovetarget")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s [heal_target_name] ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s [heal_target_name] ([member_name])", sep->arg[0]); return; } @@ -8034,33 +8027,33 @@ void bot_subcommand_heal_rotation_remove_target(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } auto heal_target = entity_list.GetMob(sep->arg[1]); if (!heal_target) { - c->Message(m_fail, "No target exists by the name '%s'", sep->arg[1]); + c->Message(Chat::Red, "No target exists by the name '%s'", sep->arg[1]); return; } if (!current_member->MemberOfHealRotation()->get()->IsTargetInPool(heal_target) || !heal_target->LeaveHealRotationTargetPool()) { - c->Message(m_fail, "Failed to remove heal target with a name of '%s'", heal_target->GetCleanName()); + c->Message(Chat::Red, "Failed to remove heal target with a name of '%s'", heal_target->GetCleanName()); return; } - c->Message(m_action, "Successfully removed heal target %s from %s's Heal Rotation", heal_target->GetCleanName(), current_member->GetCleanName()); + c->Message(Chat::Yellow, "Successfully removed heal target %s from %s's Heal Rotation", heal_target->GetCleanName(), current_member->GetCleanName()); } void bot_subcommand_heal_rotation_reset_limits(Client *c, const Seperator *sep) @@ -8068,7 +8061,7 @@ void bot_subcommand_heal_rotation_reset_limits(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_reset_limits", sep->arg[0], "healrotationresetlimits")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([member_name])", sep->arg[0]); return; } @@ -8077,24 +8070,24 @@ void bot_subcommand_heal_rotation_reset_limits(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } (*current_member->MemberOfHealRotation())->ResetArmorTypeHPLimits(); - c->Message(m_action, "Class Armor Type HP limit criteria has been set to default values for %s's Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Yellow, "Class Armor Type HP limit criteria has been set to default values for %s's Heal Rotation", current_member->GetCleanName()); } void bot_subcommand_heal_rotation_save(Client *c, const Seperator *sep) @@ -8102,7 +8095,7 @@ void bot_subcommand_heal_rotation_save(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_save", sep->arg[0], "healrotationsave")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([member_name])", sep->arg[0]); return; } @@ -8111,33 +8104,33 @@ void bot_subcommand_heal_rotation_save(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } bool member_fail = false; bool target_fail = false; if (!database.botdb.SaveHealRotation(current_member, member_fail, target_fail)) { - c->Message(m_fail, "%s", BotDatabase::fail::SaveHealRotation()); + c->Message(Chat::Red, "%s", BotDatabase::fail::SaveHealRotation()); return; } if (member_fail) - c->Message(m_fail, "Failed to save heal rotation members"); + c->Message(Chat::Red, "Failed to save heal rotation members"); if (target_fail) - c->Message(m_fail, "Failed to save heal rotation targets"); + c->Message(Chat::Red, "Failed to save heal rotation targets"); - c->Message(m_action, "Succeeded in saving %s's heal rotation", current_member->GetCleanName()); + c->Message(Chat::Yellow, "Succeeded in saving %s's heal rotation", current_member->GetCleanName()); } void bot_subcommand_heal_rotation_set_hot(Client *c, const Seperator *sep) @@ -8145,7 +8138,7 @@ void bot_subcommand_heal_rotation_set_hot(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_set_hot", sep->arg[0], "healrotationsethot")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s [heal_override_target_name] ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s [heal_override_target_name] ([member_name])", sep->arg[0]); return; } @@ -8154,38 +8147,38 @@ void bot_subcommand_heal_rotation_set_hot(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a member of a Heal Rotation", current_member->GetCleanName()); return; } auto hot_target = entity_list.GetMob(sep->arg[1]); if (!hot_target) { - c->Message(m_fail, "No target exists by the name '%s'", sep->arg[1]); + c->Message(Chat::Red, "No target exists by the name '%s'", sep->arg[1]); return; } if (!(*current_member->MemberOfHealRotation())->IsTargetInPool(hot_target)) { - c->Message(m_fail, "%s is not a target in %s's Heal Rotation", hot_target->GetCleanName(), current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a target in %s's Heal Rotation", hot_target->GetCleanName(), current_member->GetCleanName()); return; } if (!(*current_member->MemberOfHealRotation())->SetHOTTarget(hot_target)) { - c->Message(m_fail, "Failed to set %s as the HOT in %s's Heal Rotation", hot_target->GetCleanName(), current_member->GetCleanName()); + c->Message(Chat::Red, "Failed to set %s as the HOT in %s's Heal Rotation", hot_target->GetCleanName(), current_member->GetCleanName()); return; } - c->Message(m_action, "Succeeded in setting %s as the HOT in %s's Heal Rotation", hot_target->GetCleanName(), current_member->GetCleanName()); + c->Message(Chat::Yellow, "Succeeded in setting %s as the HOT in %s's Heal Rotation", hot_target->GetCleanName(), current_member->GetCleanName()); } void bot_subcommand_heal_rotation_start(Client *c, const Seperator *sep) @@ -8193,7 +8186,7 @@ void bot_subcommand_heal_rotation_start(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_start", sep->arg[0], "healrotationstart")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([member_name])", sep->arg[0]); return; } @@ -8202,32 +8195,32 @@ void bot_subcommand_heal_rotation_start(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } if ((*current_member->MemberOfHealRotation())->IsActive()) { - c->Message(m_fail, "%s's Heal Rotation is already active", current_member->GetCleanName()); + c->Message(Chat::Red, "%s's Heal Rotation is already active", current_member->GetCleanName()); return; } if (!current_member->MemberOfHealRotation()->get()->Start()) { - c->Message(m_fail, "Failed to start %s's Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "Failed to start %s's Heal Rotation", current_member->GetCleanName()); return; } - c->Message(m_action, "%s's Heal Rotation is now active", current_member->GetCleanName()); + c->Message(Chat::Yellow, "%s's Heal Rotation is now active", current_member->GetCleanName()); } void bot_subcommand_heal_rotation_stop(Client *c, const Seperator *sep) @@ -8235,7 +8228,7 @@ void bot_subcommand_heal_rotation_stop(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_heal_rotation_stop", sep->arg[0], "healrotationstop")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: () %s ([member_name])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: () %s ([member_name])", sep->arg[0]); return; } @@ -8244,51 +8237,61 @@ void bot_subcommand_heal_rotation_stop(Client *c, const Seperator *sep) if (sbl.empty()) MyBots::PopulateSBL_ByTargetedBot(c, sbl); if (sbl.empty()) { - c->Message(m_fail, "You must or [name] a current member as a bot that you own to use this command"); + c->Message(Chat::Red, "You must or [name] a current member as a bot that you own to use this command"); return; } auto current_member = sbl.front(); if (!current_member) { - c->Message(m_unknown, "Error: Current member bot dereferenced to nullptr"); + c->Message(Chat::Magenta, "Error: Current member bot dereferenced to nullptr"); return; } if (!current_member->IsHealRotationMember()) { - c->Message(m_fail, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "%s is not a current member of a Heal Rotation", current_member->GetCleanName()); return; } if (!(*current_member->MemberOfHealRotation())->IsActive()) { - c->Message(m_fail, "%s's Heal Rotation is already inactive", current_member->GetCleanName()); + c->Message(Chat::Red, "%s's Heal Rotation is already inactive", current_member->GetCleanName()); return; } if (!current_member->MemberOfHealRotation()->get()->Stop()) { - c->Message(m_fail, "Failed to stop %s's Heal Rotation", current_member->GetCleanName()); + c->Message(Chat::Red, "Failed to stop %s's Heal Rotation", current_member->GetCleanName()); return; } - c->Message(m_action, "%s's Heal Rotation is now inactive", current_member->GetCleanName()); + c->Message(Chat::Yellow, "%s's Heal Rotation is now inactive", current_member->GetCleanName()); } void bot_subcommand_inventory_give(Client *c, const Seperator *sep) { - if (helper_command_alias_fail(c, "bot_subcommand_inventory_give", sep->arg[0], "inventorygive")) - return; - if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([actionable: target | byname] ([actionable_name]))", sep->arg[0]); + if (helper_command_alias_fail(c, "bot_subcommand_inventory_give", sep->arg[0], "inventorygive")) { return; } + + if (helper_is_help_or_usage(sep->arg[1])) { + c->Message( + Chat::Cyan, + fmt::format( + "Usage: {} ([actionable: target | byname] ([actionable_name]))", + sep->arg[0] + ).c_str() + ); + return; + } + int ab_mask = (ActionableBots::ABM_Target | ActionableBots::ABM_ByName); std::list sbl; - if (ActionableBots::PopulateSBL(c, sep->arg[1], sbl, ab_mask, sep->arg[2]) == ActionableBots::ABT_None) + if (ActionableBots::PopulateSBL(c, sep->arg[1], sbl, ab_mask, sep->arg[2]) == ActionableBots::ABT_None) { return; + } auto my_bot = sbl.front(); if (!my_bot) { - c->Message(m_unknown, "ActionableBots returned 'nullptr'"); + c->Message(Chat::Magenta, "ActionableBots returned 'nullptr'"); return; } @@ -8297,69 +8300,121 @@ void bot_subcommand_inventory_give(Client *c, const Seperator *sep) void bot_subcommand_inventory_list(Client *c, const Seperator *sep) { - if (helper_command_alias_fail(c, "bot_subcommand_inventory_list", sep->arg[0], "inventorylist")) - return; - if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([actionable: target | byname] ([actionable_name]))", sep->arg[0]); + if (helper_command_alias_fail(c, "bot_subcommand_inventory_list", sep->arg[0], "inventorylist")) { return; } + + if (helper_is_help_or_usage(sep->arg[1])) { + c->Message( + Chat::Cyan, + fmt::format( + "Usage: {} ([actionable: target | byname] ([actionable_name]))", + sep->arg[0] + ).c_str() + ); + return; + } + int ab_mask = (ActionableBots::ABM_Target | ActionableBots::ABM_ByName); std::list sbl; - if (ActionableBots::PopulateSBL(c, sep->arg[1], sbl, ab_mask, sep->arg[2]) == ActionableBots::ABT_None) + if (ActionableBots::PopulateSBL(c, sep->arg[1], sbl, ab_mask, sep->arg[2]) == ActionableBots::ABT_None) { return; + } auto my_bot = sbl.front(); if (!my_bot) { - c->Message(m_unknown, "ActionableBots returned 'nullptr'"); + c->Message(Chat::Magenta, "ActionableBots returned 'nullptr'"); return; } const EQ::ItemInstance* inst = nullptr; const EQ::ItemData* item = nullptr; - bool is2Hweapon = false; + bool is_2h_weapon = false; EQ::SayLinkEngine linker; linker.SetLinkType(EQ::saylink::SayLinkItemInst); uint32 inventory_count = 0; - for (int i = EQ::invslot::EQUIPMENT_BEGIN; i <= EQ::invslot::EQUIPMENT_END; ++i) { - if ((i == EQ::invslot::slotSecondary) && is2Hweapon) + for (uint16 slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) { + if (slot_id == EQ::invslot::slotSecondary && is_2h_weapon) { continue; + } - inst = my_bot->CastToBot()->GetBotItem(i); + inst = my_bot->CastToBot()->GetBotItem(slot_id); if (!inst || !inst->GetItem()) { - c->Message(m_message, "I need something for my %s (slot %i)", EQ::invslot::GetInvPossessionsSlotName(i), i); + c->Message( + Chat::White, + fmt::format( + "Slot {} ({}) | Empty", + slot_id, + EQ::invslot::GetInvPossessionsSlotName(slot_id) + ).c_str() + ); continue; } item = inst->GetItem(); - if ((i == EQ::invslot::slotPrimary) && item->IsType2HWeapon()) { - is2Hweapon = true; + if (slot_id == EQ::invslot::slotPrimary && item->IsType2HWeapon()) { + is_2h_weapon = true; } linker.SetItemInst(inst); - c->Message(m_message, "Using %s in my %s (slot %i)", linker.GenerateLink().c_str(), EQ::invslot::GetInvPossessionsSlotName(i), i); + c->Message( + Chat::White, + fmt::format( + "Slot {} ({}) | {}", + slot_id, + EQ::invslot::GetInvPossessionsSlotName(slot_id), + linker.GenerateLink() + ).c_str() + ); ++inventory_count; } uint32 database_count = 0; - if (!database.botdb.QueryInventoryCount(my_bot->GetBotID(), database_count)) - c->Message(m_unknown, "%s", BotDatabase::fail::QueryInventoryCount()); + if (!database.botdb.QueryInventoryCount(my_bot->GetBotID(), database_count)) { + c->Message( + Chat::Magenta, + fmt::format( + "{}", + BotDatabase::fail::QueryInventoryCount() + ).c_str() + ); + } - if (inventory_count != database_count) - c->Message(m_unknown, "Inventory-database item count mismatch: inv = '%u', db = '%u'", inventory_count, database_count); + if (inventory_count != database_count) { + c->Message( + Chat::Magenta, + fmt::format( + "Inventory-database item count mismatch, inventory has {} item{} and the database has {} item{}.", + inventory_count, + inventory_count != 1 ? "s" : "", + database_count, + database_count != 1 ? "s" : "" + ).c_str() + ); + } } void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) { - if (helper_command_alias_fail(c, "bot_subcommand_inventory_remove", sep->arg[0], "inventoryremove")) - return; - if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [slotid: 0-22] ([actionable: target | byname] ([actionable_name]))", sep->arg[0]); + if (helper_command_alias_fail(c, "bot_subcommand_inventory_remove", sep->arg[0], "inventoryremove")) { return; } + + if (helper_is_help_or_usage(sep->arg[1])) { + c->Message( + Chat::Cyan, + fmt::format( + "Usage: {} [Slot ID: 0-22] ([actionable: target | byname] ([actionable_name]))", + sep->arg[0] + ).c_str() + ); + return; + } + int ab_mask = (ActionableBots::ABM_Target | ActionableBots::ABM_ByName); if (c->GetTradeskillObject() || (c->trade->state == Trading)) { @@ -8368,40 +8423,51 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) } std::list sbl; - if (ActionableBots::PopulateSBL(c, sep->arg[2], sbl, ab_mask, sep->arg[3]) == ActionableBots::ABT_None) - return; - - auto my_bot = sbl.front(); - if (!my_bot) { - c->Message(m_unknown, "ActionableBots returned 'nullptr'"); + if (ActionableBots::PopulateSBL(c, sep->arg[2], sbl, ab_mask, sep->arg[3]) == ActionableBots::ABT_None) { return; } - int slotId = atoi(sep->arg[1]); - if (!sep->IsNumber(1) || (slotId > EQ::invslot::EQUIPMENT_END || slotId < EQ::invslot::EQUIPMENT_BEGIN)) { - c->Message(m_fail, "Valid slots are 0-22"); + auto my_bot = sbl.front(); + if (!my_bot) { + c->Message(Chat::Magenta, "ActionableBots returned 'nullptr'"); + return; + } + + if (!sep->IsNumber(1)) { + c->Message(Chat::Red, "Slot ID must be a number."); + return; + } + + auto slot_id = static_cast(std::stoul(sep->arg[1])); + if (slot_id > EQ::invslot::EQUIPMENT_END || slot_id < EQ::invslot::EQUIPMENT_BEGIN) { + c->Message(Chat::Red, "Valid slots are 0 to 22."); return; } const EQ::ItemData* itm = nullptr; - const EQ::ItemInstance* itminst = my_bot->GetBotItem(slotId); - if (itminst) - itm = itminst->GetItem(); + const EQ::ItemInstance* inst = my_bot->GetBotItem(slot_id); + if (inst) { + itm = inst->GetItem(); + } - if (itminst && itm && c->CheckLoreConflict(itm)) { + if (inst && itm && c->CheckLoreConflict(itm)) { c->MessageString(Chat::White, PICK_LORE); return; } for (int m = EQ::invaug::SOCKET_BEGIN; m <= EQ::invaug::SOCKET_END; ++m) { - if (!itminst) + if (!inst) { break; + } - EQ::ItemInstance *itma = itminst->GetAugment(m); - if (!itma) + EQ::ItemInstance *augment = inst->GetAugment(m); + if (!augment) { continue; - if (!c->CheckLoreConflict(itma->GetItem())) + } + + if (!c->CheckLoreConflict(augment->GetItem())) { continue; + } c->MessageString(Chat::White, PICK_LORE); return; @@ -8409,109 +8475,139 @@ void bot_subcommand_inventory_remove(Client *c, const Seperator *sep) std::string error_message; if (itm) { - c->PushItemOnCursor(*itminst, true); - if ((slotId == EQ::invslot::slotRange) || (slotId == EQ::invslot::slotAmmo) || (slotId == EQ::invslot::slotPrimary) || (slotId == EQ::invslot::slotSecondary)) + c->PushItemOnCursor(*inst, true); + if ( + slot_id == EQ::invslot::slotRange || + slot_id == EQ::invslot::slotAmmo || + slot_id == EQ::invslot::slotPrimary || + slot_id == EQ::invslot::slotSecondary + ) { my_bot->SetBotArcher(false); + } - my_bot->RemoveBotItemBySlot(slotId, &error_message); + my_bot->RemoveBotItemBySlot(slot_id, &error_message); if (!error_message.empty()) { - c->Message(m_unknown, "Database Error: %s", error_message.c_str()); + c->Message( + Chat::Magenta, + fmt::format( + "Database Error: {}", + error_message + ).c_str() + ); return; } - my_bot->BotRemoveEquipItem(slotId); + my_bot->BotRemoveEquipItem(slot_id); my_bot->CalcBotStats(c->GetBotOption(Client::booStatsUpdate)); } - switch (slotId) { - case EQ::invslot::slotCharm: - case EQ::invslot::slotEar1: - case EQ::invslot::slotHead: - case EQ::invslot::slotFace: - case EQ::invslot::slotEar2: - case EQ::invslot::slotNeck: - case EQ::invslot::slotBack: - case EQ::invslot::slotWrist1: - case EQ::invslot::slotWrist2: - case EQ::invslot::slotRange: - case EQ::invslot::slotPrimary: - case EQ::invslot::slotSecondary: - case EQ::invslot::slotFinger1: - case EQ::invslot::slotFinger2: - case EQ::invslot::slotChest: - case EQ::invslot::slotWaist: - case EQ::invslot::slotPowerSource: - case EQ::invslot::slotAmmo: - c->Message(m_message, "My %s is %s unequipped", EQ::invslot::GetInvPossessionsSlotName(slotId), ((itm) ? ("now") : ("already"))); - break; - case EQ::invslot::slotShoulders: - case EQ::invslot::slotArms: - case EQ::invslot::slotHands: - case EQ::invslot::slotLegs: - case EQ::invslot::slotFeet: - c->Message(m_message, "My %s are %s unequipped", EQ::invslot::GetInvPossessionsSlotName(slotId), ((itm) ? ("now") : ("already"))); - break; - default: - c->Message(m_fail, "I'm soo confused..."); - break; + switch (slot_id) { + case EQ::invslot::slotCharm: + case EQ::invslot::slotEar1: + case EQ::invslot::slotHead: + case EQ::invslot::slotFace: + case EQ::invslot::slotEar2: + case EQ::invslot::slotNeck: + case EQ::invslot::slotBack: + case EQ::invslot::slotWrist1: + case EQ::invslot::slotWrist2: + case EQ::invslot::slotRange: + case EQ::invslot::slotPrimary: + case EQ::invslot::slotSecondary: + case EQ::invslot::slotFinger1: + case EQ::invslot::slotFinger2: + case EQ::invslot::slotChest: + case EQ::invslot::slotWaist: + case EQ::invslot::slotPowerSource: + case EQ::invslot::slotAmmo: + c->Message( + Chat::White, + fmt::format( + "My {} (Slot {}) is {} unequipped.", + EQ::invslot::GetInvPossessionsSlotName(slot_id), + slot_id, + itm ? "now" : "already" + ).c_str() + ); + break; + case EQ::invslot::slotShoulders: + case EQ::invslot::slotArms: + case EQ::invslot::slotHands: + case EQ::invslot::slotLegs: + case EQ::invslot::slotFeet: + c->Message( + Chat::White, + fmt::format( + "My {} (Slot {}) are {} unequipped", + EQ::invslot::GetInvPossessionsSlotName(slot_id), + slot_id, + itm ? "now" : "already" + ).c_str() + ); + break; + default: + break; } } void bot_subcommand_inventory_window(Client *c, const Seperator *sep) { - if (helper_command_alias_fail(c, "bot_subcommand_inventory_window", sep->arg[0], "inventorywindow")) - return; - if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [actionable: target]", sep->arg[0]); + if (helper_command_alias_fail(c, "bot_subcommand_inventory_window", sep->arg[0], "inventorywindow")) { return; } + + if (helper_is_help_or_usage(sep->arg[1])) { + c->Message( + Chat::Cyan, + fmt::format( + "Usage: {} [actionable: target]", + sep->arg[0] + ).c_str() + ); + return; + } + int ab_mask = ActionableBots::ABM_Target; std::list sbl; - if (ActionableBots::PopulateSBL(c, sep->arg[1], sbl, ab_mask, sep->arg[2]) == ActionableBots::ABT_None) + if (ActionableBots::PopulateSBL(c, sep->arg[1], sbl, ab_mask, sep->arg[2]) == ActionableBots::ABT_None) { return; + } auto my_bot = sbl.front(); if (!my_bot) { - c->Message(m_unknown, "ActionableBots returned 'nullptr'"); + c->Message(Chat::Magenta, "ActionableBots returned 'nullptr'"); return; } - std::string window_title = my_bot->GetCleanName(); - window_title.append("`s Inventory"); + std::string window_title = fmt::format( + "{}'s Inventory", + my_bot->GetCleanName() + ); - std::string window_text; - //std::string item_link; - //EQ::SayLinkEngine linker; - //linker.SetLinkType(EQ::saylink::SayLinkItemInst); - - for (int i = EQ::invslot::EQUIPMENT_BEGIN; i <= EQ::invslot::EQUIPMENT_END; ++i) { + std::string window_text = ""; + for (uint16 slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invslot::EQUIPMENT_END; ++slot_id) { const EQ::ItemData* item = nullptr; - const EQ::ItemInstance* inst = my_bot->CastToBot()->GetBotItem(i); - if (inst) + const EQ::ItemInstance* inst = my_bot->CastToBot()->GetBotItem(slot_id); + if (inst) { item = inst->GetItem(); - - window_text.append(""); - window_text.append(EQ::invslot::GetInvPossessionsSlotName(i)); - window_text.append(": "); - if (item) { - //window_text.append(""); - //linker.SetItemInst(inst); - //item_link = linker.GenerateLink(); - //window_text.append(item_link.c_str()); - - window_text.append(""); - window_text.append(StringFormat("%s", item->Name)); } - else { - window_text.append(""); - window_text.append("[empty]"); - } - window_text.append("
"); + + window_text.append( + fmt::format( + "
", + EQ::invslot::GetInvPossessionsSlotName(slot_id), + item ? "" : "", + item ? item->Name : "Empty" + ) + ); } - window_text.append(""); + window_text.append("
{}{}{}
"); - c->SendPopupToClient(window_title.c_str(), window_text.c_str()); + c->SendPopupToClient( + window_title.c_str(), + window_text.c_str() + ); } void bot_subcommand_pet_get_lost(Client *c, const Seperator *sep) @@ -8519,7 +8615,7 @@ void bot_subcommand_pet_get_lost(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_pet_get_lost", sep->arg[0], "petgetlost")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([actionable: target | byname | ownergroup | botgroup | targetgroup | namesgroup | healrotation | spawned] ([actionable_name]))", sep->arg[0]); return; } int ab_mask = ActionableBots::ABM_NoFilter; @@ -8542,7 +8638,7 @@ void bot_subcommand_pet_get_lost(Client *c, const Seperator *sep) ++summoned_pet; } - c->Message(m_action, "%i of your bots released their summoned pet%s", summoned_pet, (summoned_pet == 1) ? "" : "s"); + c->Message(Chat::Yellow, "%i of your bots released their summoned pet%s", summoned_pet, (summoned_pet == 1) ? "" : "s"); } void bot_subcommand_pet_remove(Client *c, const Seperator *sep) @@ -8550,7 +8646,7 @@ void bot_subcommand_pet_remove(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_pet_remove", sep->arg[0], "petremove")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s ([actionable: target | byname] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s ([actionable: target | byname] ([actionable_name]))", sep->arg[0]); return; } int ab_mask = (ActionableBots::ABM_Target | ActionableBots::ABM_ByName); @@ -8562,7 +8658,7 @@ void bot_subcommand_pet_remove(Client *c, const Seperator *sep) uint16 class_mask = (PLAYER_CLASS_DRUID_BIT | PLAYER_CLASS_NECROMANCER_BIT | PLAYER_CLASS_ENCHANTER_BIT); ActionableBots::Filter_ByClasses(c, sbl, class_mask); if (sbl.empty()) { - c->Message(m_fail, "You have no spawned bots capable of charming"); + c->Message(Chat::Red, "You have no spawned bots capable of charming"); return; } sbl.remove(nullptr); @@ -8590,7 +8686,7 @@ void bot_subcommand_pet_remove(Client *c, const Seperator *sep) } if (sbl.size() != 1) - c->Message(m_action, "%i of your bots set for charming, %i of your bots set for summoned pet use", charmed_pet, summoned_pet); + c->Message(Chat::Yellow, "%i of your bots set for charming, %i of your bots set for summoned pet use", charmed_pet, summoned_pet); } void bot_subcommand_pet_set_type(Client *c, const Seperator *sep) @@ -8598,9 +8694,9 @@ void bot_subcommand_pet_set_type(Client *c, const Seperator *sep) if (helper_command_alias_fail(c, "bot_subcommand_pet_set_type", sep->arg[0], "petsettype")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [type: water | fire | air | earth | monster] ([actionable: target | byname] ([actionable_name]))", sep->arg[0]); - c->Message(m_note, "requires one of the following bot classes:"); - c->Message(m_message, "Magician(1)"); + c->Message(Chat::Cyan, "usage: %s [type: water | fire | air | earth | monster] ([actionable: target | byname] ([actionable_name]))", sep->arg[0]); + c->Message(Chat::Gray, "requires one of the following bot classes:"); + c->Message(Chat::White, "Magician(1)"); return; } int ab_mask = (ActionableBots::ABM_Target | ActionableBots::ABM_ByName); // this can be expanded without code modification @@ -8631,7 +8727,7 @@ void bot_subcommand_pet_set_type(Client *c, const Seperator *sep) } if (pet_type == 255) { - c->Message(m_fail, "You must specify a pet [type: water | fire | air | earth | monster]"); + c->Message(Chat::Red, "You must specify a pet [type: water | fire | air | earth | monster]"); return; } @@ -8642,13 +8738,13 @@ void bot_subcommand_pet_set_type(Client *c, const Seperator *sep) uint16 class_mask = PLAYER_CLASS_MAGICIAN_BIT; ActionableBots::Filter_ByClasses(c, sbl, class_mask); if (sbl.empty()) { - c->Message(m_fail, "You have no spawned Magician bots"); + c->Message(Chat::Red, "You have no spawned Magician bots"); return; } ActionableBots::Filter_ByMinLevel(c, sbl, level_req); if (sbl.empty()) { - c->Message(m_fail, "You have no spawned Magician bots capable of using this pet type: '%s'", pet_arg.c_str()); + c->Message(Chat::Red, "You have no spawned Magician bots capable of using this pet type: '%s'", pet_arg.c_str()); return; } @@ -8673,7 +8769,7 @@ void bot_subcommand_portal(Client *c, const Seperator *sep) if (helper_spell_list_fail(c, local_list, BCEnum::SpT_Depart) || helper_command_alias_fail(c, "bot_subcommand_portal", sep->arg[0], "portal")) return; if (helper_is_help_or_usage(sep->arg[1])) { - c->Message(m_usage, "usage: %s [list | destination] ([option: single])", sep->arg[0]); + c->Message(Chat::Cyan, "usage: %s [list | destination] ([option: single])", sep->arg[0]); helper_send_usage_required_bots(c, BCEnum::SpT_Depart, WIZARD); return; } @@ -8690,7 +8786,7 @@ void bot_subcommand_portal(Client *c, const Seperator *sep) return; } else if (destination.empty()) { - c->Message(m_fail, "A [destination] or [list] argument is required to use this command"); + c->Message(Chat::Red, "A [destination] or [list] argument is required to use this command"); return; } @@ -8734,13 +8830,13 @@ bool helper_bot_appearance_fail(Client *bot_owner, Bot *my_bot, BCEnum::AFType f { switch (fail_type) { case BCEnum::AFT_Value: - bot_owner->Message(m_fail, "Failed to change '%s' for %s due to invalid value for this command", type_desc, my_bot->GetCleanName()); + bot_owner->Message(Chat::Red, "Failed to change '%s' for %s due to invalid value for this command", type_desc, my_bot->GetCleanName()); return true; case BCEnum::AFT_GenderRace: - bot_owner->Message(m_fail, "Failed to change '%s' for %s due to invalid bot gender and/or race for this command", type_desc, my_bot->GetCleanName()); + bot_owner->Message(Chat::Red, "Failed to change '%s' for %s due to invalid bot gender and/or race for this command", type_desc, my_bot->GetCleanName()); return true; case BCEnum::AFT_Race: - bot_owner->Message(m_fail, "Failed to change '%s' for %s due to invalid bot race for this command", type_desc, my_bot->GetCleanName()); + bot_owner->Message(Chat::Red, "Failed to change '%s' for %s due to invalid bot race for this command", type_desc, my_bot->GetCleanName()); return true; default: return false; @@ -8752,12 +8848,12 @@ void helper_bot_appearance_form_final(Client *bot_owner, Bot *my_bot) if (!MyBots::IsMyBot(bot_owner, my_bot)) return; if (!my_bot->Save()) { - bot_owner->Message(m_unknown, "Failed to save appearance change for %s due to unknown cause...", my_bot->GetCleanName()); + bot_owner->Message(Chat::Magenta, "Failed to save appearance change for %s due to unknown cause...", my_bot->GetCleanName()); return; } helper_bot_appearance_form_update(my_bot); - bot_owner->Message(m_action, "Successfully changed appearance for %s!", my_bot->GetCleanName()); + bot_owner->Message(Chat::Yellow, "Successfully changed appearance for %s!", my_bot->GetCleanName()); } void helper_bot_appearance_form_update(Bot *my_bot) @@ -8791,17 +8887,17 @@ uint32 helper_bot_create(Client *bot_owner, std::string bot_name, uint8 bot_clas if (!bot_owner) return bot_id; if (!Bot::IsValidName(bot_name)) { - bot_owner->Message(m_fail, "'%s' is an invalid name. You may only use characters 'A-Z', 'a-z' and '_'", bot_name.c_str()); + bot_owner->Message(Chat::Red, "'%s' is an invalid name. You may only use characters 'A-Z', 'a-z' and '_'", bot_name.c_str()); return bot_id; } bool available_flag = false; if (!database.botdb.QueryNameAvailablity(bot_name, available_flag)) { - bot_owner->Message(m_fail, "%s for '%s'", BotDatabase::fail::QueryNameAvailablity(), bot_name.c_str()); + bot_owner->Message(Chat::Red, "%s for '%s'", BotDatabase::fail::QueryNameAvailablity(), bot_name.c_str()); return bot_id; } if (!available_flag) { - bot_owner->Message(m_fail, "The name %s is already being used. Please choose a different name", bot_name.c_str()); + bot_owner->Message(Chat::Red, "The name %s is already being used. Please choose a different name", bot_name.c_str()); return bot_id; } @@ -8810,7 +8906,7 @@ uint32 helper_bot_create(Client *bot_owner, std::string bot_name, uint8 bot_clas const char* bot_class_name = GetClassIDName(bot_class); std::string view_saylink = EQ::SayLinkEngine::GenerateQuestSaylink(fmt::format("^viewcombos {}", bot_race), false, "view"); bot_owner->Message( - m_fail, + Chat::Red, fmt::format( "{} {} is an invalid race-class combination, would you like to {} proper combinations for {}?", bot_race_name, @@ -8823,7 +8919,7 @@ uint32 helper_bot_create(Client *bot_owner, std::string bot_name, uint8 bot_clas } if (bot_gender > FEMALE) { - bot_owner->Message(m_fail, "gender: %u (M), %u (F)", MALE, FEMALE); + bot_owner->Message(Chat::Red, "gender: %u (M), %u (F)", MALE, FEMALE); return bot_id; } @@ -8831,22 +8927,22 @@ uint32 helper_bot_create(Client *bot_owner, std::string bot_name, uint8 bot_clas uint32 bot_count = 0; if (!database.botdb.QueryBotCount(bot_owner->CharacterID(), bot_count)) { - bot_owner->Message(m_fail, "%s", BotDatabase::fail::QueryBotCount()); + bot_owner->Message(Chat::Red, "%s", BotDatabase::fail::QueryBotCount()); return bot_id; } if (bot_count >= max_bot_count) { - bot_owner->Message(m_fail, "You have reached the maximum limit of %i bots.", max_bot_count); + bot_owner->Message(Chat::Red, "You have reached the maximum limit of %i bots.", max_bot_count); return bot_id; } auto my_bot = new Bot(Bot::CreateDefaultNPCTypeStructForBot(bot_name.c_str(), "", bot_owner->GetLevel(), bot_race, bot_class, bot_gender), bot_owner); if (!my_bot->Save()) { - bot_owner->Message(m_unknown, "Failed to create '%s' due to unknown cause", my_bot->GetCleanName()); + bot_owner->Message(Chat::Magenta, "Failed to create '%s' due to unknown cause", my_bot->GetCleanName()); return bot_id; } - bot_owner->Message(m_action, "Successfully created '%s' (id: %u)", my_bot->GetCleanName(), my_bot->GetBotID()); + bot_owner->Message(Chat::Yellow, "Successfully created '%s' (id: %u)", my_bot->GetCleanName(), my_bot->GetBotID()); bot_id = my_bot->GetBotID(); safe_delete(my_bot); @@ -8867,10 +8963,10 @@ void helper_bot_out_of_combat(Client *bot_owner, Bot *my_bot) case SHADOWKNIGHT: case DRUID: case MONK: - bot_owner->Message(m_unknown, "%s has no out-of-combat behavior defined", my_bot->GetCleanName()); + bot_owner->Message(Chat::Magenta, "%s has no out-of-combat behavior defined", my_bot->GetCleanName()); break; case BARD: - bot_owner->Message(m_action, "%s will %s use out-of-combat behavior for bard songs", my_bot->GetCleanName(), ((my_bot->GetAltOutOfCombatBehavior()) ? ("now") : ("no longer"))); + bot_owner->Message(Chat::Yellow, "%s will %s use out-of-combat behavior for bard songs", my_bot->GetCleanName(), ((my_bot->GetAltOutOfCombatBehavior()) ? ("now") : ("no longer"))); break; case ROGUE: case SHAMAN: @@ -8880,11 +8976,11 @@ void helper_bot_out_of_combat(Client *bot_owner, Bot *my_bot) case ENCHANTER: case BEASTLORD: case BERSERKER: - bot_owner->Message(m_unknown, "%s has no out-of-combat behavior defined", my_bot->GetCleanName()); + bot_owner->Message(Chat::Magenta, "%s has no out-of-combat behavior defined", my_bot->GetCleanName()); break; default: break; - bot_owner->Message(m_fail, "Undefined bot class for %s", my_bot->GetCleanName()); + bot_owner->Message(Chat::Red, "Undefined bot class for %s", my_bot->GetCleanName()); } } @@ -8972,7 +9068,7 @@ bool helper_cast_standard_spell(Bot* casting_bot, Mob* target_mob, int spell_id, bool helper_command_disabled(Client* bot_owner, bool rule_value, const char* command) { if (rule_value == false) { - bot_owner->Message(m_fail, "Bot command %s is not enabled on this server.", command); + bot_owner->Message(Chat::Red, "Bot command %s is not enabled on this server.", command); return true; } @@ -8983,7 +9079,7 @@ bool helper_command_alias_fail(Client *bot_owner, const char* command_handler, c { auto alias_iter = bot_command_aliases.find(&alias[1]); if (alias_iter == bot_command_aliases.end() || alias_iter->second.compare(command)) { - bot_owner->Message(m_fail, "Undefined linker usage in %s (%s)", command_handler, &alias[1]); + bot_owner->Message(Chat::Red, "Undefined linker usage in %s (%s)", command_handler, &alias[1]); return true; } @@ -9000,13 +9096,13 @@ void helper_command_depart_list(Client* bot_owner, Bot* druid_bot, Bot* wizard_b if (!MyBots::IsMyBot(bot_owner, wizard_bot)) wizard_bot = nullptr; if (!druid_bot && !wizard_bot) { - bot_owner->Message(m_fail, "No bots are capable of performing this action"); + bot_owner->Message(Chat::Red, "No bots are capable of performing this action"); return; } - bot_owner->Message(m_message, "The following destinations are available:"); + bot_owner->Message(Chat::White, "The following destinations are available:"); if (!local_list) { - bot_owner->Message(m_fail, "None"); + bot_owner->Message(Chat::Red, "None"); return; } @@ -9039,7 +9135,7 @@ void helper_command_depart_list(Client* bot_owner, Bot* druid_bot, Bot* wizard_b } } if (!destinations) - bot_owner->Message(m_fail, "None"); + bot_owner->Message(Chat::Red, "None"); } bool helper_is_help_or_usage(const char* arg) @@ -9057,7 +9153,7 @@ bool helper_no_available_bots(Client *bot_owner, Bot *my_bot) if (!bot_owner) return true; if (!my_bot) { - bot_owner->Message(m_fail, "No bots are capable of performing this action"); + bot_owner->Message(Chat::Red, "No bots are capable of performing this action"); return true; } @@ -9066,7 +9162,7 @@ bool helper_no_available_bots(Client *bot_owner, Bot *my_bot) void helper_send_available_subcommands(Client *bot_owner, const char* command_simile, const std::list& subcommand_list) { - bot_owner->Message(m_message, "Available %s management subcommands:", command_simile); + bot_owner->Message(Chat::White, "Available %s management subcommands:", command_simile); int bot_subcommands_shown = 0; for (const auto subcommand_iter : subcommand_list) { @@ -9076,20 +9172,20 @@ void helper_send_available_subcommands(Client *bot_owner, const char* command_si if (bot_owner->Admin() < find_iter->second->access) continue; - bot_owner->Message(m_usage, "%c%s - %s", BOT_COMMAND_CHAR, subcommand_iter, ((find_iter != bot_command_list.end()) ? (find_iter->second->desc) : ("[no description]"))); + bot_owner->Message(Chat::Cyan, "%c%s - %s", BOT_COMMAND_CHAR, subcommand_iter, ((find_iter != bot_command_list.end()) ? (find_iter->second->desc) : ("[no description]"))); ++bot_subcommands_shown; } - bot_owner->Message(m_message, "%d bot subcommand%s listed.", bot_subcommands_shown, bot_subcommands_shown != 1 ? "s" : ""); + bot_owner->Message(Chat::White, "%d bot subcommand%s listed.", bot_subcommands_shown, bot_subcommands_shown != 1 ? "s" : ""); } void helper_send_usage_required_bots(Client *bot_owner, BCEnum::SpType spell_type, uint8 bot_class) { - bot_owner->Message(m_note, "requires one of the following bot classes:"); + bot_owner->Message(Chat::Gray, "requires one of the following bot classes:"); if (bot_class) - bot_owner->Message(m_message, "%s", required_bots_map_by_class[spell_type][bot_class].c_str()); + bot_owner->Message(Chat::White, "%s", required_bots_map_by_class[spell_type][bot_class].c_str()); else - bot_owner->Message(m_message, "%s", required_bots_map[spell_type].c_str()); + bot_owner->Message(Chat::White, "%s", required_bots_map[spell_type].c_str()); } bool helper_spell_check_fail(STBaseEntry* local_entry) @@ -9105,7 +9201,7 @@ bool helper_spell_check_fail(STBaseEntry* local_entry) bool helper_spell_list_fail(Client *bot_owner, bcst_list* spell_list, BCEnum::SpType spell_type) { if (!spell_list || spell_list->empty()) { - bot_owner->Message(m_fail, "%s", required_bots_map[spell_type].c_str()); + bot_owner->Message(Chat::Red, "%s", required_bots_map[spell_type].c_str()); return true; } diff --git a/zone/lua_bot.cpp b/zone/lua_bot.cpp index 69ddc1187..858ac44ea 100644 --- a/zone/lua_bot.cpp +++ b/zone/lua_bot.cpp @@ -6,10 +6,90 @@ #include "bot.h" #include "lua_bot.h" +#include "lua_mob.h" + +void Lua_Bot::AddItem(uint16 slot_id, uint32 item_id) { + Lua_Safe_Call_Void(); + self->AddItem(slot_id, item_id); +} + +void Lua_Bot::AddItem(uint16 slot_id, uint32 item_id, int16 charges) { + Lua_Safe_Call_Void(); + self->AddItem(slot_id, item_id, charges); +} + +void Lua_Bot::AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned) { + Lua_Safe_Call_Void(); + self->AddItem(slot_id, item_id, charges, attuned); +} + +void Lua_Bot::AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one) { + Lua_Safe_Call_Void(); + self->AddItem(slot_id, item_id, charges, attuned, augment_one); +} + +void Lua_Bot::AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two) { + Lua_Safe_Call_Void(); + self->AddItem(slot_id, item_id, charges, attuned, augment_one, augment_two); +} + +void Lua_Bot::AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two, uint32 augment_three) { + Lua_Safe_Call_Void(); + self->AddItem(slot_id, item_id, charges, attuned, augment_one, augment_two, augment_three); +} + +void Lua_Bot::AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two, uint32 augment_three, uint32 augment_four) { + Lua_Safe_Call_Void(); + self->AddItem(slot_id, item_id, charges, attuned, augment_one, augment_two, augment_three, augment_four); +} + +void Lua_Bot::AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two, uint32 augment_three, uint32 augment_four, uint32 augment_five) { + Lua_Safe_Call_Void(); + self->AddItem(slot_id, item_id, charges, attuned, augment_one, augment_two, augment_three, augment_four, augment_five); +} + +void Lua_Bot::AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two, uint32 augment_three, uint32 augment_four, uint32 augment_five, uint32 augment_six) { + Lua_Safe_Call_Void(); + self->AddItem(slot_id, item_id, charges, attuned, augment_one, augment_two, augment_three, augment_four, augment_five, augment_six); +} + +uint32 Lua_Bot::CountItem(uint32 item_id) { + Lua_Safe_Call_Int(); + return self->CountItem(item_id); +} + +Lua_Mob Lua_Bot::GetOwner() { + Lua_Safe_Call_Class(Lua_Mob); + return Lua_Mob(self->GetOwner()); +} + +bool Lua_Bot::HasItem(uint32 item_id) { + Lua_Safe_Call_Bool(); + return self->HasItem(item_id); +} + +void Lua_Bot::RemoveItem(uint32 item_id) { + Lua_Safe_Call_Void(); + self->RemoveItem(item_id); +} luabind::scope lua_register_bot() { - return luabind::class_("Bot").def(luabind::constructor<>()); + return luabind::class_("Bot") + .def(luabind::constructor<>()) + .def("AddItem", (void(Lua_Bot::*)(uint16,uint32))&Lua_Bot::AddItem) + .def("AddItem", (void(Lua_Bot::*)(uint16,uint32,int16))&Lua_Bot::AddItem) + .def("AddItem", (void(Lua_Bot::*)(uint16,uint32,int16,bool))&Lua_Bot::AddItem) + .def("AddItem", (void(Lua_Bot::*)(uint16,uint32,int16,bool,uint32))&Lua_Bot::AddItem) + .def("AddItem", (void(Lua_Bot::*)(uint16,uint32,int16,bool,uint32,uint32))&Lua_Bot::AddItem) + .def("AddItem", (void(Lua_Bot::*)(uint16,uint32,int16,bool,uint32,uint32,uint32))&Lua_Bot::AddItem) + .def("AddItem", (void(Lua_Bot::*)(uint16,uint32,int16,bool,uint32,uint32,uint32,uint32))&Lua_Bot::AddItem) + .def("AddItem", (void(Lua_Bot::*)(uint16,uint32,int16,bool,uint32,uint32,uint32,uint32,uint32))&Lua_Bot::AddItem) + .def("AddItem", (void(Lua_Bot::*)(uint16,uint32,int16,bool,uint32,uint32,uint32,uint32,uint32,uint32))&Lua_Bot::AddItem) + .def("CountItem", (uint32(Lua_Bot::*)(uint32))&Lua_Bot::CountItem) + .def("GetOwner", (Lua_Mob(Lua_Bot::*)(void))&Lua_Bot::GetOwner) + .def("HasItem", (bool(Lua_Bot::*)(uint32))&Lua_Bot::HasItem) + .def("RemoveItem", (void(Lua_Bot::*)(uint32))&Lua_Bot::RemoveItem); } #endif -#endif \ No newline at end of file +#endif diff --git a/zone/lua_bot.h b/zone/lua_bot.h index fffb844ea..be72892e6 100644 --- a/zone/lua_bot.h +++ b/zone/lua_bot.h @@ -7,6 +7,7 @@ class Bot; class Lua_Bot; +class Lua_Mob; namespace luabind { struct scope; @@ -25,6 +26,20 @@ public: operator Bot*() { return reinterpret_cast(GetLuaPtrData()); } + + void AddItem(uint16 slot_id, uint32 item_id); + void AddItem(uint16 slot_id, uint32 item_id, int16 charges); + void AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned); + void AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one); + void AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two); + void AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two, uint32 augment_three); + void AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two, uint32 augment_three, uint32 augment_four); + void AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two, uint32 augment_three, uint32 augment_four, uint32 augment_five); + void AddItem(uint16 slot_id, uint32 item_id, int16 charges, bool attuned, uint32 augment_one, uint32 augment_two, uint32 augment_three, uint32 augment_four, uint32 augment_five, uint32 augment_six); + uint32 CountItem(uint32 item_id); + Lua_Mob GetOwner(); + bool HasItem(uint32 item_id); + void RemoveItem(uint32 item_id); }; #endif diff --git a/zone/perl_bot.cpp b/zone/perl_bot.cpp index cb40bf013..4746a98d5 100644 --- a/zone/perl_bot.cpp +++ b/zone/perl_bot.cpp @@ -44,6 +44,111 @@ XS(XS_Bot_GetOwner) XSRETURN(1); } +XS(XS_Bot_AddItem); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Bot_AddItem) { + dXSARGS; + if (items < 3 || items > 11) + Perl_croak(aTHX_ "Usage: Bot::AddItem(THIS, uint16 slot_id, uint32 item_id, [int16 charges = -1], [bool attuned = false], [uint32 augment_one = 0], [uint32 augment_two = 0], [uint32 augment_three = 0], [uint32 augment_four = 0], [uint32 augment_five = 0], [uint32 augment_six = 0])"); // @categories Inventory and Items, Script Utility + { + Bot* THIS; + uint16 slot_id = (uint16) SvUV(ST(1)); + uint32 item_id = (uint32) SvUV(ST(2)); + int16 charges = -1; + bool attuned = false; + uint32 augment_one = 0; + uint32 augment_two = 0; + uint32 augment_three = 0; + uint32 augment_four = 0; + uint32 augment_five = 0; + uint32 augment_six = 0; + VALIDATE_THIS_IS_BOT; + + if (items > 3) { + charges = (int16) SvIV(ST(3)); + } + + if (items > 4) { + attuned = (bool) SvTRUE(ST(4)); + } + + if (items > 5) { + augment_one = (uint32) SvUV(ST(5)); + } + + if (items > 6) { + augment_two = (uint32) SvUV(ST(6)); + } + + if (items > 7) { + augment_three = (uint32) SvUV(ST(7)); + } + + if (items > 8) { + augment_four = (uint32) SvUV(ST(8)); + } + + if (items > 9) { + augment_five = (uint32) SvUV(ST(9)); + } + + if (items > 10) { + augment_six = (uint32) SvUV(ST(10)); + } + + THIS->AddItem(slot_id, item_id, charges, attuned, augment_one, augment_two, augment_three, augment_four, augment_five, augment_six); + } + XSRETURN_EMPTY; +} + +XS(XS_Bot_CountItem); +XS(XS_Bot_CountItem) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Bot::CountItem(THIS, uint32 item_id)"); + { + Bot* THIS; + int item_count = 0; + uint32 item_id = (uint32) SvUV(ST(1)); + dXSTARG; + VALIDATE_THIS_IS_BOT; + item_count = THIS->CountItem(item_id); + XSprePUSH; + PUSHu((UV) item_count); + } + XSRETURN(1); +} + +XS(XS_Bot_HasItem); +XS(XS_Bot_HasItem) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Bot:HasItem(THIS, uint32 item_id)"); + { + Bot* THIS; + bool has_item = false; + uint32 item_id = (uint32) SvUV(ST(1)); + VALIDATE_THIS_IS_BOT; + has_item = THIS->HasItem(item_id); + ST(0) = boolSV(has_item); + sv_2mortal(ST(0)); + } + XSRETURN(1); +} + +XS(XS_Bot_RemoveItem); +XS(XS_Bot_RemoveItem) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Bot::RemoveItem(THIS, uint32 item_id)"); // @categories Spells and Disciplines + { + Bot* THIS; + uint32 item_id = (uint32) SvUV(ST(1)); + VALIDATE_THIS_IS_BOT; + THIS->RemoveItem(item_id); + } + XSRETURN_EMPTY; +} + #ifdef __cplusplus extern "C" #endif @@ -62,9 +167,13 @@ XS(boot_Bot) char buf[128]; XS_VERSION_BOOTCHECK; + newXSproto(strcpy(buf, "AddItem"), XS_Bot_AddItem, file, "$$$;$$$$$$$$"); + newXSproto(strcpy(buf, "CountItem"), XS_Bot_CountItem, file, "$$"); newXSproto(strcpy(buf, "GetOwner"), XS_Bot_GetOwner, file, "$"); + newXSproto(strcpy(buf, "HasItem"), XS_Bot_HasItem, file, "$$"); + newXSproto(strcpy(buf, "RemoveItem"), XS_Bot_RemoveItem, file, "$$"); XSRETURN_YES; } #endif //EMBPERL_XS_CLASSES -#endif //BOTS \ No newline at end of file +#endif //BOTS