Merge branch 'npcbots_3.3.5' into CI

This commit is contained in:
trickerer
2023-06-20 19:03:41 +07:00
7 changed files with 13 additions and 14 deletions

View File

@@ -105,19 +105,19 @@ public:
return new crypt_lord_botAI(creature);
}
bool OnGossipHello(Player* player, Creature* creature)
bool OnGossipHello(Player* player, Creature* creature) override
{
return creature->GetBotAI()->OnGossipHello(player, 0);
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action)
bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) override
{
if (bot_ai* ai = creature->GetBotAI())
return ai->OnGossipSelect(player, creature, sender, action);
return true;
}
bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, char const* code)
bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, char const* code) override
{
if (bot_ai* ai = creature->GetBotAI())
return ai->OnGossipSelectCode(player, creature, sender, action, code);

View File

@@ -1169,7 +1169,7 @@ void BotDataMgr::LoadWanderMap(bool reload)
const uint8 TEAMS_COUNT = TEAM_NEUTRAL + 1;
char const* const team_strs[TEAMS_COUNT] = { "Alliance", "Horde", "Neutral" };
std::array<bool, DEFAULT_MAX_LEVEL> spawn_node_levels[TEAMS_COUNT]{false};
std::array<bool, DEFAULT_MAX_LEVEL> spawn_node_levels[TEAMS_COUNT]{ { false } };
uint8 min_spawn_level = DEFAULT_MAX_LEVEL;
uint8 max_spawn_level = 0;
for (WanderNode const* wp : all_spawn_nodes)

View File

@@ -3,6 +3,7 @@
#include "botcommon.h"
#include "DatabaseEnvFwd.h"
#include "DBCEnums.h"
#include <functional>
#include <set>

View File

@@ -1818,7 +1818,7 @@ void bot_pet_ai::RegeneratePetFocus()
if (curValue == maxValue || regenTimer >= REGEN_CD)
me->SetPower(POWER_FOCUS, curValue);
else
me->UpdateUInt32Value(UNIT_FIELD_POWER1 + POWER_FOCUS, curValue);
me->UpdateUInt32Value(UNIT_FIELD_POWER1 + uint16(POWER_FOCUS), curValue);
}
}
@@ -1851,7 +1851,7 @@ void bot_pet_ai::RegeneratePetEnergy()
if (curValue == maxValue || regenTimer >= REGEN_CD)
me->SetPower(POWER_ENERGY, curValue);
else
me->UpdateUInt32Value(UNIT_FIELD_POWER1 + POWER_ENERGY, curValue);
me->UpdateUInt32Value(UNIT_FIELD_POWER1 + uint16(POWER_ENERGY), curValue);
}
}
//////////

View File

@@ -1163,9 +1163,6 @@ void Battleground::RemoveBotAtLeave(ObjectGuid guid)
RemoveBotFromResurrectQueue(guid);
// GetStatus might be changed in RemovePlayer - define it here
BattlegroundStatus status = GetStatus();
// BG subclass specific code
RemoveBot(guid);

View File

@@ -302,7 +302,6 @@ GroupQueueInfo* BattlegroundQueue::AddBotAsGroup(ObjectGuid guid, TeamId teamId,
uint32 q_max_level = std::min(bracketEntry->maxLevel, (uint32)80);
uint32 qHorde = GetPlayersCountInGroupsQueue(bracketId, BG_QUEUE_NORMAL_HORDE);
uint32 qAlliance = GetPlayersCountInGroupsQueue(bracketId, BG_QUEUE_NORMAL_ALLIANCE);
uint32 qTotal = qHorde + qAlliance;
sWorld->SendWorldTextOptional(LANG_BG_QUEUE_ANNOUNCE_WORLD, ANNOUNCER_FLAG_DISABLE_BG_QUEUE, bgName.c_str(), q_min_level, q_max_level, qAlliance + qHorde, MaxPlayers);
}

View File

@@ -3857,12 +3857,14 @@ float Unit::GetUnitParryChance() const
if (ToCreature()->isWorldBoss())
chance = 13.4f; // + 0.6 by skill diff
else if (GetCreatureType() == CREATURE_TYPE_HUMANOID)
{
//npcbot - custom parry chance instead of bunch of auras
if (IsNPCBot())
chance = ToCreature()->GetCreatureParryChance();
else
//end npcbot
chance = 5.0f;
}
// Xinef: if aura is present, type should not matter
chance += GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT);
@@ -20923,7 +20925,7 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const
return 8571;
}
}
else if (Player::TeamIdForRace(GetRace()) == ALLIANCE)
else if (Player::TeamIdForRace(GetRace()) == TEAM_ALLIANCE)
return 892;
else
return 8571;
@@ -21002,16 +21004,16 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const
return 2289;
}
}
else if (Player::TeamIdForRace(GetRace()) == ALLIANCE)
else if (Player::TeamIdForRace(GetRace()) == TEAM_ALLIANCE)
return 2281;
else
return 2289;
case FORM_FLIGHT:
if (Player::TeamIdForRace(GetRace()) == ALLIANCE)
if (Player::TeamIdForRace(GetRace()) == TEAM_ALLIANCE)
return 20857;
return 20872;
case FORM_FLIGHT_EPIC:
if (Player::TeamIdForRace(GetRace()) == ALLIANCE)
if (Player::TeamIdForRace(GetRace()) == TEAM_ALLIANCE)
return 21243;
return 21244;
default: