Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


<div align="center">
<img src="icon.png" alt="Playerbots Icon" width="700px">
<img src="banner.png" alt="Playerbots Banner" width="700px">
</div>

<div align="center">
Expand Down
Binary file added banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,740 changes: 1,741 additions & 1,999 deletions data/sql/playerbots/base/ai_playerbot_texts.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
-- zhTW, esES, esMX, ruRU)
-- #########################################################

DELETE FROM ai_playerbot_texts WHERE name IN ('pvp_currency', 'pvp_arena_team', 'pvp_no_arena_team');
DELETE FROM ai_playerbot_texts_chance WHERE name IN ('pvp_currency', 'pvp_arena_team', 'pvp_no_arena_team');

-- ---------------------------------------------------------
-- pvp_currency
-- [PVP] Arena points: %arena_points | Honor Points: %honor_points
-- ---------------------------------------------------------
INSERT INTO `ai_playerbot_texts`
(`name`, `text`, `say_type`, `reply_type`,
(`id`, `name`, `text`, `say_type`, `reply_type`,
`text_loc1`, `text_loc2`, `text_loc3`, `text_loc4`,
`text_loc5`, `text_loc6`, `text_loc7`, `text_loc8`)
SELECT
VALUES (
1737,
'pvp_currency',
'[PVP] Arena points: %arena_points | Honor Points: %honor_points',
0, 0,
Expand All @@ -31,20 +35,20 @@ SELECT
-- esMX
'[PVP] Puntos de arena: %arena_points | Puntos de honor: %honor_points',
-- ruRU
'[PVP] Очки арены: %arena_points | Очки чести: %honor_points'
WHERE NOT EXISTS (
SELECT 1 FROM `ai_playerbot_texts` WHERE `name` = 'pvp_currency'
);
'[PVP] Очки арены: %arena_points | Очки чести: %honor_points');

INSERT INTO ai_playerbot_texts_chance (name, probability) VALUES ('pvp_currency', 100);

-- ---------------------------------------------------------
-- pvp_arena_team
-- [PVP] %bracket: <%team_name> (rating %team_rating)
-- ---------------------------------------------------------
INSERT INTO `ai_playerbot_texts`
(`name`, `text`, `say_type`, `reply_type`,
(`id`, `name`, `text`, `say_type`, `reply_type`,
`text_loc1`, `text_loc2`, `text_loc3`, `text_loc4`,
`text_loc5`, `text_loc6`, `text_loc7`, `text_loc8`)
SELECT
VALUES (
1738,
'pvp_arena_team',
'[PVP] %bracket: <%team_name> (rating %team_rating)',
0, 0,
Expand All @@ -63,20 +67,20 @@ SELECT
-- esMX
'[PVP] %bracket: <%team_name> (índice %team_rating)',
-- ruRU
'[PVP] %bracket: <%team_name> (рейтинг %team_rating)'
WHERE NOT EXISTS (
SELECT 1 FROM `ai_playerbot_texts` WHERE `name` = 'pvp_arena_team'
);
'[PVP] %bracket: <%team_name> (рейтинг %team_rating)');

INSERT INTO ai_playerbot_texts_chance (name, probability) VALUES ('pvp_arena_team', 100);

-- ---------------------------------------------------------
-- pvp_no_arena_team
-- [PVP] I have no Arena Team.
-- ---------------------------------------------------------
INSERT INTO `ai_playerbot_texts`
(`name`, `text`, `say_type`, `reply_type`,
(`id`, `name`, `text`, `say_type`, `reply_type`,
`text_loc1`, `text_loc2`, `text_loc3`, `text_loc4`,
`text_loc5`, `text_loc6`, `text_loc7`, `text_loc8`)
SELECT
VALUES (
1739,
'pvp_no_arena_team',
'[PVP] I have no Arena Team.',
0, 0,
Expand All @@ -95,7 +99,6 @@ SELECT
-- esMX
'[PVP] No tengo equipo de arena.',
-- ruRU
'[PVP] У меня нет команды арены.'
WHERE NOT EXISTS (
SELECT 1 FROM `ai_playerbot_texts` WHERE `name` = 'pvp_no_arena_team'
);
'[PVP] У меня нет команды арены.');

INSERT INTO ai_playerbot_texts_chance (name, probability) VALUES ('pvp_no_arena_team', 100);
Binary file modified icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 0 additions & 10 deletions src/Ai/Base/Actions/BattleGroundJoinAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ bool BGJoinAction::Execute(Event /*event*/)

BattlegroundQueueTypeId queueTypeId = (BattlegroundQueueTypeId)bgList[urand(0, bgList.size() - 1)];
BattlegroundTypeId bgTypeId = BattlegroundMgr::BGTemplateId(queueTypeId);
BattlegroundBracketId bracketId;
bool isArena = false;
bool isRated = false;

Battleground* bg = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId);
Expand All @@ -37,12 +35,8 @@ bool BGJoinAction::Execute(Event /*event*/)
if (!pvpDiff)
return false;

bracketId = pvpDiff->GetBracketId();

if (ArenaType type = ArenaType(BattlegroundMgr::BGArenaType(queueTypeId)))
{
isArena = true;

std::vector<uint32>::iterator i = find(ratedList.begin(), ratedList.end(), queueTypeId);
if (i != ratedList.end())
isRated = true;
Expand Down Expand Up @@ -408,8 +402,6 @@ bool BGJoinAction::JoinQueue(uint32 type)

bracketId = pvpDiff->GetBracketId();

uint32 BracketSize = bg->GetMaxPlayersPerTeam() * 2;
uint32 TeamSize = bg->GetMaxPlayersPerTeam();
TeamId teamId = bot->GetTeamId();

// check if already in queue
Expand Down Expand Up @@ -486,8 +478,6 @@ bool BGJoinAction::JoinQueue(uint32 type)
if (isArena)
{
isArena = true;
BracketSize = type * 2;
TeamSize = type;
isRated = botAI->GetAiObjectContext()->GetValue<uint32>("arena type")->Get();

if (joinAsGroup)
Expand Down
2 changes: 0 additions & 2 deletions src/Ai/Base/Actions/BattleGroundTactics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2497,7 +2497,6 @@ bool BGTactics::selectObjective(bool reset)
EYBotStrategy strategyHorde = static_cast<EYBotStrategy>(GetBotStrategyForTeam(bg, TEAM_HORDE));
EYBotStrategy strategyAlliance = static_cast<EYBotStrategy>(GetBotStrategyForTeam(bg, TEAM_ALLIANCE));
EYBotStrategy strategy = (team == TEAM_ALLIANCE) ? strategyAlliance : strategyHorde;
EYBotStrategy enemyStrategy = (team == TEAM_ALLIANCE) ? strategyHorde : strategyAlliance;

auto IsOwned = [&](uint32 nodeId) -> bool
{ return eyeOfTheStormBG->GetCapturePointInfo(nodeId)._ownerTeamId == team; };
Expand Down Expand Up @@ -3231,7 +3230,6 @@ bool BGTactics::selectObjectiveWp(std::vector<BattleBotPath*> const& vPaths)
if (bgType == BATTLEGROUND_RB)
bgType = bg->GetBgTypeID(true);

PositionMap& posMap = context->GetValue<PositionMap&>("position")->Get();
PositionInfo pos = context->GetValue<PositionMap&>("position")->Get()["bg objective"];
if (!pos.isSet())
return false;
Expand Down
4 changes: 0 additions & 4 deletions src/Ai/Base/Actions/ChatShortcutActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ bool FollowChatShortcutAction::Execute(Event /*event*/)
std::string const target = formation->GetTargetName();
bool moved = false;
if (!target.empty())
{
moved = Follow(AI_VALUE(Unit*, target));
}
else
{
WorldLocation loc = formation->GetLocation();
Expand All @@ -83,9 +81,7 @@ bool FollowChatShortcutAction::Execute(Event /*event*/)
}

if (Pet* pet = bot->GetPet())
{
botAI->PetFollow();
}

if (moved)
{
Expand Down
2 changes: 0 additions & 2 deletions src/Ai/Base/Actions/ChooseRpgTargetAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ float ChooseRpgTargetAction::getMaxRelevance(GuidPosition guidP)

bool ChooseRpgTargetAction::Execute(Event /*event*/)
{
//TravelTarget* travelTarget = AI_VALUE(TravelTarget*, "travel target"); //not used, line marked for removal.
Player* master = botAI->GetMaster();
GuidPosition masterRpgTarget;
if (master && master != bot && GET_PLAYERBOT_AI(master) && master->GetMapId() == bot->GetMapId() && !master->IsBeingTeleported())
Expand All @@ -124,7 +123,6 @@ bool ChooseRpgTargetAction::Execute(Event /*event*/)
master = nullptr;

std::unordered_map<ObjectGuid, uint32> targets;
// uint32 num = 0; //not used, line marked for removal.
GuidVector possibleTargets = AI_VALUE(GuidVector, "possible rpg targets");
GuidVector possibleObjects = AI_VALUE(GuidVector, "nearest game objects no los");
GuidVector possiblePlayers = AI_VALUE(GuidVector, "nearest friendly players");
Expand Down
13 changes: 0 additions & 13 deletions src/Ai/Base/Actions/ChooseTravelTargetAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,6 @@ void ChooseTravelTargetAction::ReportTravelTarget(TravelTarget* newTarget, Trave
QuestTravelDestination* QuestDestination = (QuestTravelDestination*)destination;
Quest const* quest = QuestDestination->GetQuestTemplate();
WorldPosition botLocation(bot);

CreatureTemplate const* cInfo = nullptr;
GameObjectTemplate const* gInfo = nullptr;

if (destination->getEntry() > 0)
cInfo = sObjectMgr->GetCreatureTemplate(destination->getEntry());
else
gInfo = sObjectMgr->GetGameObjectTemplate(destination->getEntry() * -1);

std::string Sub;

if (newTarget->isGroupCopy())
Expand Down Expand Up @@ -823,10 +814,6 @@ char* strstri(char const* haystack, char const* needle);

TravelDestination* ChooseTravelTargetAction::FindDestination(Player* bot, std::string const name, bool zones, bool npcs, bool quests, bool mobs, bool bosses)
{
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);

// AiObjectContext* context = botAI->GetAiObjectContext(); //not used, line marked for removal.

std::vector<TravelDestination*> dests;

//Quests
Expand Down
4 changes: 2 additions & 2 deletions src/Ai/Base/Actions/DebugAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,8 @@ bool DebugAction::Execute(Event event)
botPos.setY(botPos.GetPositionY() + (dy - 5) * 5);
botPos.setZ(botPos.getHeight());

Creature* wpCreature = bot->SummonCreature(effect, botPos.GetPositionX(), botPos.GetPositionY(), botPos.GetPositionZ(), 0,
TEMPSUMMON_TIMED_DESPAWN, 10000.0f);
bot->SummonCreature(effect, botPos.GetPositionX(), botPos.GetPositionY(), botPos.GetPositionZ(), 0,
TEMPSUMMON_TIMED_DESPAWN, 10000.0f);
}
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/Ai/Base/Actions/EquipAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ void EquipAction::EquipItem(Item* item)
if (itemProto->Class == ITEM_CLASS_CONTAINER)
{
// Attempt to equip as a bag
Bag* pBag = reinterpret_cast<Bag*>(item);
uint8 newBagSlot = GetSmallestBagSlot();

if (newBagSlot > 0)
{
uint16 src = ((bagIndex << 8) | slot);
Expand Down
4 changes: 1 addition & 3 deletions src/Ai/Base/Actions/FishingAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ bool MoveNearWaterAction::isUseful()
FishingSpotValue* fishingSpotValueObject = (FishingSpotValue*)context->GetValue<WorldPosition>("fishing spot");
WorldPosition pos = fishingSpotValueObject->Get();
return !pos.IsValid() || fishingSpotValueObject->IsStale(FISHING_LOCATION_TIMEOUT) ||
bot->GetExactDist(&pos) < 0.1f;
bot->GetExactDist(&pos) > 0.1f;

}

Expand Down Expand Up @@ -292,7 +292,6 @@ bool MoveNearWaterAction::isPossible()
// Water spot is out of range, lets look for a spot to move to for the fishing hole.
if (distance > MAX_DISTANCE_TO_WATER || distance < MIN_DISTANCE_TO_WATER)
{
float angle = bot->GetAngle(fishingHole.GetPositionX(), fishingHole.GetPositionY());
WorldPosition landSpot = FindLandRadialFromPosition(botAI, fishingHole, MIN_DISTANCE_TO_WATER, MAX_DISTANCE_TO_WATER, SEARCH_INCREMENT, fishingSearchWindow, 32);
if (landSpot.IsValid())
{
Expand Down Expand Up @@ -323,7 +322,6 @@ bool MoveNearWaterAction::isPossible()
if (!water.IsValid())
return false;

bool hasLOS = bot->IsWithinLOS(water.GetPositionX(), water.GetPositionY(), water.GetPositionZ());
float angle = bot->GetAngle(water.GetPositionX(), water.GetPositionY());
WorldPosition landSpot =
FindLandFromPosition(botAI, 0.0f, MAX_DISTANCE_TO_WATER, 1.0f, angle, water, fishingSearchWindow, false);
Expand Down
2 changes: 0 additions & 2 deletions src/Ai/Base/Actions/GiveItemAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ bool GiveItemAction::Execute(Event /*event*/)
if (receiverAi->GetAiObjectContext()->GetValue<uint32>("item count", item)->Get())
return true;

bool moved = false;
std::vector<Item*> items = InventoryAction::parseItems(item, ITERATE_ITEMS_IN_BAGS);
for (Item* item : items)
{
Expand All @@ -42,7 +41,6 @@ bool GiveItemAction::Execute(Event /*event*/)
bot->MoveItemFromInventory(item->GetBagSlot(), item->GetSlot(), true);
item->SetOwnerGUID(target->GetGUID());
receiver->MoveItemToInventory(dest, item, true);
moved = true;

std::ostringstream out;
out << "Got " << chat->FormatItem(item->GetTemplate(), item->GetCount()) << " from " << bot->GetName();
Expand Down
3 changes: 0 additions & 3 deletions src/Ai/Base/Actions/GuildCreateActions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
bool BuyPetitionAction::Execute(Event /*event*/)
{
GuidVector vendors = botAI->GetAiObjectContext()->GetValue<GuidVector>("nearest npcs")->Get();
bool vendored = false, result = false;
for (GuidVector::iterator i = vendors.begin(); i != vendors.end(); ++i)
{
ObjectGuid vendorguid = *i;
Expand Down Expand Up @@ -97,7 +96,6 @@ bool BuyPetitionAction::canBuyPetition(Player* bot)

bool PetitionOfferAction::Execute(Event event)
{
uint32 petitionEntry = 5863; // GUILD_CHARTER
std::vector<Item*> petitions = AI_VALUE2(std::vector<Item*>, "inventory items", chat->FormatQItem(5863));

if (petitions.empty())
Expand Down Expand Up @@ -212,7 +210,6 @@ bool PetitionOfferNearbyAction::isUseful()
bool PetitionTurnInAction::Execute(Event /*event*/)
{
GuidVector vendors = botAI->GetAiObjectContext()->GetValue<GuidVector>("nearest npcs")->Get();
bool vendored = false, result = false;
std::vector<Item*> petitions = AI_VALUE2(std::vector<Item*>, "inventory items", chat->FormatQItem(5863));

if (petitions.empty())
Expand Down
2 changes: 0 additions & 2 deletions src/Ai/Base/Actions/InviteToGroupAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ std::vector<Player*> InviteGuildToGroupAction::getGuildMembers()

bool InviteGuildToGroupAction::Execute(Event /*event*/)
{
Guild* guild = sGuildMgr->GetGuildById(bot->GetGuildId());

for (auto& member : getGuildMembers())
{
Player* player = member;
Expand Down
2 changes: 0 additions & 2 deletions src/Ai/Base/Actions/LootRollAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ bool LootRollAction::Execute(Event /*event*/)
continue;
}
ObjectGuid guid = roll->itemGUID;
uint32 slot = roll->itemSlot;
uint32 itemId = roll->itemid;
int32 randomProperty = 0;
if (roll->itemRandomPropId)
Expand Down Expand Up @@ -184,7 +183,6 @@ bool MasterLootRollAction::Execute(Event event)
if (!group)
return false;

RollVote vote = CalculateRollVote(proto);
group->CountRollVote(bot->GetGUID(), creatureGuid, CalculateRollVote(proto));

return true;
Expand Down
1 change: 0 additions & 1 deletion src/Ai/Base/Actions/LootStrategyAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ bool LootStrategyAction::Execute(Event event)
{
std::string const strategy = event.getParam();

LootObjectStack* lootItems = AI_VALUE(LootObjectStack*, "available loot");
std::set<uint32>& alwaysLootItems = AI_VALUE(std::set<uint32>&, "always loot list");
Value<LootStrategy*>* lootStrategy = context->GetValue<LootStrategy*>("loot strategy");

Expand Down
2 changes: 1 addition & 1 deletion src/Ai/Base/Actions/MailAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class TakeMailProcessor : public MailProcessor
private:
bool CheckBagSpace(Player* bot)
{
uint32 totalused = 0, total = 16;
uint32 totalused = 0;
for (uint8 slot = INVENTORY_SLOT_ITEM_START; slot < INVENTORY_SLOT_ITEM_END; slot++)
if (bot->GetItemByPos(INVENTORY_SLOT_BAG_0, slot))
++totalused;
Expand Down
Loading
Loading