diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..848d188 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,76 @@ +sudo: required +dist: bionic # (18.04) + +language: cpp + +cache: ccache + +addons: + apt: + update: true + +services: + - mysql + +git: + depth: 10 + +stages: + - prepare_cache + - run + +jobs: + include: + - stage: prepare_cache + env: TRAVIS_BUILD_ID="1" + before_install: + - cd .. + - git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk + - mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules + - cd azerothcore-wotlk + - source ./apps/ci/ci-before_install.sh + install: + - source ./apps/ci/ci-install.sh OFF + script: + - source ./apps/ci/ci-compile.sh + + - stage: run + env: TRAVIS_BUILD_ID="1" + before_install: + - cd .. + - git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk + - mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules + - cd azerothcore-wotlk + - source ./apps/ci/ci-before_install.sh + install: + - source ./apps/ci/ci-install.sh ON + - source ./apps/ci/ci-import-db.sh + script: + - source ./apps/ci/ci-compile.sh + - source ./apps/ci/ci-worldserver-dry-run.sh + + - stage: prepare_cache + env: TRAVIS_BUILD_ID="2" + before_install: + - cd .. + - git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk + - mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules + - cd azerothcore-wotlk + - source ./apps/ci/ci-before_install.sh + install: + - source ./apps/ci/ci-install.sh OFF + script: + - source ./apps/ci/ci-compile.sh + + - stage: run + env: TRAVIS_BUILD_ID="2" + before_install: + - cd .. + - git clone --depth=1 --branch=master https://github.com/azerothcore/azerothcore-wotlk.git azerothcore-wotlk + - mv "$TRAVIS_BUILD_DIR" azerothcore-wotlk/modules + - cd azerothcore-wotlk + - source ./apps/ci/ci-before_install.sh + install: + - source ./apps/ci/ci-install.sh ON + script: + - source ./apps/ci/ci-compile.sh diff --git a/README.md b/README.md index 3a4028f..e70d563 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# ![logo](https://raw.githubusercontent.com/azerothcore/azerothcore.github.io/master/images/logo-github.png) AzerothCore +- Latest build status with azerothcore: [![Build Status](https://travis-ci.org/azerothcore/mod-ah-bot.svg?branch=master)](https://travis-ci.org/azerothcore/mod-ah-bot) # Mod-AHBOT diff --git a/conf/conf.sh.dist b/conf/conf.sh.dist new file mode 100644 index 0000000..fd5e7c6 --- /dev/null +++ b/conf/conf.sh.dist @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# +# CUSTOM +# + +DB_WORLD_CUSTOM_PATHS+=( + $MOD_AH_BOT_ROOT"/sql/world/" +) diff --git a/conf/mod_ahbot.conf.dist b/conf/mod_ahbot.conf.dist index f787b54..42f1446 100644 --- a/conf/mod_ahbot.conf.dist +++ b/conf/mod_ahbot.conf.dist @@ -183,6 +183,10 @@ AuctionHouseBot.DisableDruidItems = 0 ############################################################################### # AUCTION HOUSE BOT FILTERS PART 3 # +# AuctionHouseBot.DisabledItems +# Prevent Seller from listing specific item(s) +# Default "" (none) +# # AuctionHouseBot.DisableItemsBelowLevel # Prevent Seller from listing Items below this Level # Default 0 (Off) @@ -249,6 +253,7 @@ AuctionHouseBot.DisableDruidItems = 0 # ############################################################################### +AuctionHouseBot.DisabledItems = "" AuctionHouseBot.DisableItemsBelowLevel = 0 AuctionHouseBot.DisableItemsAboveLevel = 0 AuctionHouseBot.DisableTGsBelowLevel = 0 diff --git a/include.sh b/include.sh index e69de29..038ece6 100644 --- a/include.sh +++ b/include.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +MOD_AH_BOT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/" && pwd )" + +source $MOD_AH_BOT_ROOT"/conf/conf.sh.dist" + +if [ -f $MOD_AH_BOT_ROOT"/conf/conf.sh" ]; then + source $MOD_AH_BOT_ROOT"/conf/conf.sh" +fi diff --git a/src/AuctionHouseBot.cpp b/src/AuctionHouseBot.cpp index 3dec109..d656144 100644 --- a/src/AuctionHouseBot.cpp +++ b/src/AuctionHouseBot.cpp @@ -375,15 +375,10 @@ void AuctionHouseBot::addNewAuctions(Player *AHBplayer, AHBConfig *config) uint64 bidPrice = 0; uint32 stackCount = 1; - switch (SellMethod) - { - case 0: - buyoutPrice = prototype->SellPrice; - break; - case 1: - buyoutPrice = prototype->BuyPrice; - break; - } + if (SellMethod) + buyoutPrice = prototype->BuyPrice; + else + buyoutPrice = prototype->SellPrice; if (prototype->Quality <= AHB_MAX_QUALITY) { @@ -571,39 +566,34 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con long double bidMax = 0; // check that bid has acceptable value and take bid based on vendorprice, stacksize and quality - switch (BuyMethod) + if (BuyMethod) { - case 0: + if (prototype->Quality <= AHB_MAX_QUALITY) { - if (prototype->Quality <= AHB_MAX_QUALITY) - { - if (currentprice < prototype->SellPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality)) - bidMax = prototype->SellPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality); - } - else - { - // quality is something it shouldn't be, let's get out of here - if (debug_Out) sLog->outError( "AHBuyer: Quality %u not Supported", prototype->Quality); - continue; - } - break; + if (currentprice < prototype->SellPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality)) + bidMax = prototype->SellPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality); } - case 1: + else { - if (prototype->Quality <= AHB_MAX_QUALITY) - { - if (currentprice < prototype->BuyPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality)) - bidMax = prototype->BuyPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality); - } - else - { - // quality is something it shouldn't be, let's get out of here - if (debug_Out) sLog->outError( "AHBuyer: Quality %u not Supported", prototype->Quality); + // quality is something it shouldn't be, let's get out of here + if (debug_Out) sLog->outError( "AHBuyer: Quality %u not Supported", prototype->Quality); continue; - } - break; } } + else + { + if (prototype->Quality <= AHB_MAX_QUALITY) + { + if (currentprice < prototype->BuyPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality)) + bidMax = prototype->BuyPrice * pItem->GetCount() * config->GetBuyerPrice(prototype->Quality); + } + else + { + // quality is something it shouldn't be, let's get out of here + if (debug_Out) sLog->outError( "AHBuyer: Quality %u not Supported", prototype->Quality); + continue; + } + } // check some special items, and do recalculating to their prices switch (prototype->Class) @@ -866,16 +856,15 @@ void AuctionHouseBot::Initialize() break; } - switch (SellMethod) + if (SellMethod) { - case 0: - if (itr->second.SellPrice == 0) - continue; - break; - case 1: if (itr->second.BuyPrice == 0) continue; - break; + } + else + { + if (itr->second.SellPrice == 0) + continue; } if (itr->second.Quality > 6) diff --git a/src/cs_ah_bot.cpp b/src/cs_ah_bot.cpp index e11d24b..1de4081 100644 --- a/src/cs_ah_bot.cpp +++ b/src/cs_ah_bot.cpp @@ -98,7 +98,7 @@ public: return false; } - auctionbot->Commands(0, ahMapID, NULL, NULL); + auctionbot->Commands(0, ahMapID, 0, NULL); } else if (strncmp(opt, "minitems", l) == 0) { @@ -109,7 +109,7 @@ public: return false; } - auctionbot->Commands(1, ahMapID, NULL, param1); + auctionbot->Commands(1, ahMapID, 0, param1); } else if (strncmp(opt, "maxitems", l) == 0) { @@ -120,7 +120,7 @@ public: return false; } - auctionbot->Commands(2, ahMapID, NULL, param1); + auctionbot->Commands(2, ahMapID, 0, param1); } else if (strncmp(opt, "mintime", l) == 0) { @@ -134,7 +134,7 @@ public: return false; } - auctionbot.Commands(3, ahMapID, NULL, param1); + auctionbot.Commands(3, ahMapID, 0, param1); */ } else if (strncmp(opt, "maxtime", l) == 0) @@ -149,7 +149,7 @@ public: return false; } - auctionbot.Commands(4, ahMapID, NULL, param1); + auctionbot.Commands(4, ahMapID, 0, param1); */ } else if (strncmp(opt, "percentages", l) == 0) @@ -234,7 +234,7 @@ public: strcat(param, param13); strcat(param, " "); strcat(param, param14); - auctionbot->Commands(5, ahMapID, NULL, param); + auctionbot->Commands(5, ahMapID, 0, param); } else if (strncmp(opt, "minprice", l) == 0) { @@ -451,7 +451,7 @@ public: return false; } - auctionbot->Commands(12, ahMapID, NULL, param1); + auctionbot->Commands(12, ahMapID, 0, param1); } else if (strncmp(opt, "bidsperinterval", l) == 0) { @@ -463,7 +463,7 @@ public: return false; } - auctionbot->Commands(13, ahMapID, NULL, param1); + auctionbot->Commands(13, ahMapID, 0, param1); } else {