mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-16 18:30:27 +00:00
Add additional trading options (#1186)
* Add addclass bots to trading list, differentiate between buying and selling. * typos * Try calling playerguid * point IsAddclassBot to IsRandomBot * typo * Fix through IsAddClassbot * Working Version * Minor typos.
This commit is contained in:
@@ -32,7 +32,7 @@ bool TradeStatusAction::Execute(Event event)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sPlayerbotAIConfig->enableRandomBotTrading && sRandomPlayerbotMgr->IsRandomBot(bot))
|
||||
if (sPlayerbotAIConfig->enableRandomBotTrading == 0 && (sRandomPlayerbotMgr->IsRandomBot(bot)|| sRandomPlayerbotMgr->IsAddclassBot(bot)))
|
||||
{
|
||||
bot->Whisper("Trading is disabled", LANG_UNIVERSAL, trader);
|
||||
return false;
|
||||
@@ -171,7 +171,6 @@ bool TradeStatusAction::CheckTrade()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool isGettingItem = false;
|
||||
for (uint32 slot = 0; slot < TRADE_SLOT_TRADED_COUNT; ++slot)
|
||||
{
|
||||
@@ -182,7 +181,7 @@ bool TradeStatusAction::CheckTrade()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (isGettingItem)
|
||||
{
|
||||
if (bot->GetGroup() && bot->GetGroup()->IsMember(bot->GetTrader()->GetGUID()) &&
|
||||
@@ -215,7 +214,16 @@ bool TradeStatusAction::CheckTrade()
|
||||
int32 botMoney = bot->GetTradeData()->GetMoney() + botItemsMoney;
|
||||
int32 playerItemsMoney = CalculateCost(trader, false);
|
||||
int32 playerMoney = trader->GetTradeData()->GetMoney() + playerItemsMoney;
|
||||
|
||||
if (botItemsMoney > 0 && sPlayerbotAIConfig->enableRandomBotTrading == 2 && (sRandomPlayerbotMgr->IsRandomBot(bot)|| sRandomPlayerbotMgr->IsAddclassBot(bot)))
|
||||
{
|
||||
bot->Whisper("Selling is disabled.", LANG_UNIVERSAL, trader);
|
||||
return false;
|
||||
}
|
||||
if (playerItemsMoney && sPlayerbotAIConfig->enableRandomBotTrading == 3 && (sRandomPlayerbotMgr->IsRandomBot(bot)|| sRandomPlayerbotMgr->IsAddclassBot(bot)))
|
||||
{
|
||||
bot->Whisper("Buying is disabled.", LANG_UNIVERSAL, trader);
|
||||
return false;
|
||||
}
|
||||
for (uint32 slot = 0; slot < TRADE_SLOT_TRADED_COUNT; ++slot)
|
||||
{
|
||||
Item* item = bot->GetTradeData()->GetItem((TradeSlots)slot);
|
||||
|
||||
Reference in New Issue
Block a user