[Bots] Add Rule Allowing Bots to Equip Any Race Items (#2578)

* [Bots] Add Rule AllowBotEquipAnyRaceGear

* Fix formatting

* Update item_instance.cpp

* Update bot.cpp

* Update item_data.h

Co-authored-by: Alex King <89047260+Kinglykrab@users.noreply.github.com>
This commit is contained in:
Aeadoin
2022-11-26 17:39:31 -05:00
committed by GitHub
parent 31d57342e1
commit ea9a02bec4
6 changed files with 61 additions and 7 deletions
+6 -2
View File
@@ -4728,8 +4728,12 @@ void Bot::PerformTradeWithClient(int16 begin_slot_id, int16 end_slot_id, Client*
return;
}
}
if (!trade_instance->IsEquipable(GetBaseRace(), GetClass()) || (GetLevel() < trade_instance->GetItem()->ReqLevel)) { // deity checks will be handled within IsEquipable()
if (
!trade_instance->IsClassEquipable(GetClass()) ||
GetLevel() < trade_instance->GetItem()->ReqLevel ||
(!trade_instance->IsRaceEquipable(GetRace()) && !RuleB(Bot, AllowBotEquipAnyRaceGear))
) {
if (trade_event_exists) {
event_trade.push_back(ClientTrade(trade_instance, trade_index));
continue;