Merge branch 'liyunfan1223:master' into locale_fix

This commit is contained in:
Atidote
2024-07-28 10:52:13 +02:00
committed by GitHub
9 changed files with 46 additions and 55 deletions

View File

@@ -50,18 +50,17 @@ jobs:
path: 'modules/mod-playerbots' path: 'modules/mod-playerbots'
- name: Cache - name: Cache
uses: actions/cache@v3 uses: actions/cache@v4
with: with:
path: | path: ${{ github.workspace }}/var/ccache
/var/cache/apt key: ccache:${{ matrix.os }}:${{ matrix.c_compiler }}:${{ github.ref }}:${{ github.sha }}
/var/lib/apt
key: ccache:${{ matrix.os }}:${{ github.ref }}:${{ github.sha }}
restore-keys: | restore-keys: |
ccache:${{ matrix.os }}:${{ github.ref }} ccache:${{ matrix.os }}:${{ matrix.c_compiler }}:${{ github.ref }}
ccache:${{ matrix.os }}:${{ matrix.c_compiler }}
ccache:${{ matrix.os }} ccache:${{ matrix.os }}
- name: Install Requirements - name: Install Requirements
run: sudo apt-get update && sudo apt-get install git cmake make gcc g++ clang libmysqlclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev mysql-server libboost-all-dev run: sudo apt-get update && sudo apt-get install ccache git cmake make gcc g++ clang libmysqlclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev mysql-server libboost-all-dev
- name: Configure CMake - name: Configure CMake
run: > run: >

View File

@@ -26,14 +26,8 @@ jobs:
with: with:
repository: 'liyunfan1223/mod-playerbots' repository: 'liyunfan1223/mod-playerbots'
path: 'modules/mod-playerbots' path: 'modules/mod-playerbots'
- name: Cache - name: ccache
uses: actions/cache@v3 uses: hendrikmuhs/ccache-action@v1.2.13
with:
path: C:\ProgramData\chocolatey\cache
key: ccache:${{ matrix.os }}:${{ github.ref }}:${{ github.sha }}
restore-keys: |
ccache:${{ matrix.os }}:${{ github.ref }}
ccache:${{ matrix.os }}
- name: Configure OS - name: Configure OS
shell: bash shell: bash
env: env:

View File

@@ -96,7 +96,7 @@ void LootObject::Refresh(Player* bot, ObjectGuid lootGUID)
if (IsNeededForQuest(bot, itemId)) if (IsNeededForQuest(bot, itemId))
{ {
this->guid = guid; this->guid = lootGUID;
return; return;
} }
isQuestItemOnly |= itemId > 0; isQuestItemOnly |= itemId > 0;

View File

@@ -350,7 +350,7 @@ void PlayerbotAI::UpdateAIInternal([[maybe_unused]] uint32 elapsed, bool minimal
std::string const command = holder.GetCommand(); std::string const command = holder.GetCommand();
Player* owner = holder.GetOwner(); Player* owner = holder.GetOwner();
if (owner == master && !helper.ParseChatCommand(command, owner) && holder.GetType() == CHAT_MSG_WHISPER) if (!helper.ParseChatCommand(command, owner) && holder.GetType() == CHAT_MSG_WHISPER)
{ {
// To prevent spam caused by WIM // To prevent spam caused by WIM
if (!(command.rfind("WIM", 0) == 0) && if (!(command.rfind("WIM", 0) == 0) &&
@@ -625,10 +625,15 @@ void PlayerbotAI::HandleCommand(uint32 type, std::string const text, Player* fro
return; return;
} }
if (!IsAllowedCommand(filtered) && !GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_ALLOW_ALL, type != CHAT_MSG_WHISPER, fromPlayer)) if (!IsAllowedCommand(filtered) &&
(master != fromPlayer || !GetSecurity()->CheckLevelFor(PLAYERBOT_SECURITY_ALLOW_ALL, type != CHAT_MSG_WHISPER, fromPlayer)))
return; return;
if (type == CHAT_MSG_RAID_WARNING && filtered.find(bot->GetName()) != std::string::npos && filtered.find("award") == std::string::npos) if (!IsAllowedCommand(filtered) && master != fromPlayer)
return;
if (type == CHAT_MSG_RAID_WARNING && filtered.find(bot->GetName()) != std::string::npos &&
filtered.find("award") == std::string::npos)
{ {
ChatCommandHolder cmd("warning", fromPlayer, type); ChatCommandHolder cmd("warning", fromPlayer, type);
chatCommands.push(cmd); chatCommands.push(cmd);

View File

@@ -849,6 +849,21 @@ void MovementAction::UpdateMovementState()
if (bot->IsFlying()) if (bot->IsFlying())
bot->UpdateSpeed(MOVE_FLIGHT, true); bot->UpdateSpeed(MOVE_FLIGHT, true);
Transport* newTransport = bot->GetMap()->GetTransportForPos(bot->GetPhaseMask(), bot->GetPositionX(), bot->GetPositionY(), bot->GetPositionZ(), bot);
if (newTransport != bot->GetTransport())
{
LOG_DEBUG("playerbots", "Bot {} is on a transport", bot->GetName());
if (bot->GetTransport())
bot->GetTransport()->RemovePassenger(bot, true);
if (newTransport)
newTransport->AddPassenger(bot, true);
bot->StopMovingOnCurrentPos();
}
// Temporary speed increase in group // Temporary speed increase in group
//if (botAI->HasRealPlayerMaster()) //if (botAI->HasRealPlayerMaster())
//bot->SetSpeedRate(MOVE_RUN, 1.1f); //bot->SetSpeedRate(MOVE_RUN, 1.1f);

View File

@@ -206,7 +206,7 @@ bool SummonAction::Teleport(Player* summoner, Player* player)
return false; return false;
} }
bool revive = sPlayerbotAIConfig->reviveBotWhenSummoned == 2 || (sPlayerbotAIConfig->reviveBotWhenSummoned == 1 && !master->IsInCombat()); bool revive = sPlayerbotAIConfig->reviveBotWhenSummoned == 2 || (sPlayerbotAIConfig->reviveBotWhenSummoned == 1 && !master->IsInCombat() && master->IsAlive());
if (bot->isDead() && revive) if (bot->isDead() && revive)
{ {
bot->ResurrectPlayer(1.0f, false); bot->ResurrectPlayer(1.0f, false);

View File

@@ -5,9 +5,7 @@
#ifndef _PLAYERBOT_SHAMANACTIONS_H #ifndef _PLAYERBOT_SHAMANACTIONS_H
#define _PLAYERBOT_SHAMANACTIONS_H #define _PLAYERBOT_SHAMANACTIONS_H
#include "Define.h"
#include "GenericSpellActions.h" #include "GenericSpellActions.h"
#include "Playerbots.h"
#include "SharedDefines.h" #include "SharedDefines.h"
class PlayerbotAI; class PlayerbotAI;
@@ -362,31 +360,11 @@ class CastWindShearOnEnemyHealerAction : public CastSpellOnEnemyHealerAction
CastWindShearOnEnemyHealerAction(PlayerbotAI* botAI) : CastSpellOnEnemyHealerAction(botAI, "wind shear") { } CastWindShearOnEnemyHealerAction(PlayerbotAI* botAI) : CastSpellOnEnemyHealerAction(botAI, "wind shear") { }
}; };
// class CastCurePoisonAction : public CastCureSpellAction CURE_ACTION(CastCurePoisonActionSham, "cure disease");
// { CURE_PARTY_ACTION(CastCurePoisonOnPartyActionSham, "cure poison", DISPEL_POISON);
// public:
// CastCurePoisonAction(PlayerbotAI* botAI) : CastCureSpellAction(botAI, "cure poison") { }
// };
// class CastCurePoisonOnPartyAction : public CurePartyMemberAction CURE_ACTION(CastCureDiseaseActionSham, "cure disease");
// { CURE_PARTY_ACTION(CastCureDiseaseOnPartyActionSham, "cure disease", DISPEL_DISEASE);
// public:
// CastCurePoisonOnPartyAction(PlayerbotAI* botAI) : CurePartyMemberAction(botAI, "cure poison", DISPEL_POISON) { }
// };
// class CastCureDiseaseAction : public CastCureSpellAction
// {
// public:
// CastCureDiseaseAction(PlayerbotAI* botAI) : CastCureSpellAction(botAI, "cure disease") { }
// };
// class CastCureDiseaseOnPartyAction : public CurePartyMemberAction
// {
// public:
// CastCureDiseaseOnPartyAction(PlayerbotAI* botAI) : CurePartyMemberAction(botAI, "cure disease", DISPEL_DISEASE) { }
// std::string const getName() override { return "cure disease on party"; }
// };
class CastLavaBurstAction : public CastSpellAction class CastLavaBurstAction : public CastSpellAction
{ {

View File

@@ -213,10 +213,10 @@ class ShamanAiObjectContextInternal : public NamedObjectContext<Action>
creators["heroism"] = &ShamanAiObjectContextInternal::heroism; creators["heroism"] = &ShamanAiObjectContextInternal::heroism;
creators["bloodlust"] = &ShamanAiObjectContextInternal::bloodlust; creators["bloodlust"] = &ShamanAiObjectContextInternal::bloodlust;
creators["elemental mastery"] = &ShamanAiObjectContextInternal::elemental_mastery; creators["elemental mastery"] = &ShamanAiObjectContextInternal::elemental_mastery;
// creators["cure disease"] = &ShamanAiObjectContextInternal::cure_disease; creators["cure disease"] = &ShamanAiObjectContextInternal::cure_disease;
// creators["cure disease on party"] = &ShamanAiObjectContextInternal::cure_disease_on_party; creators["cure disease on party"] = &ShamanAiObjectContextInternal::cure_disease_on_party;
// creators["cure poison"] = &ShamanAiObjectContextInternal::cure_poison; creators["cure poison"] = &ShamanAiObjectContextInternal::cure_poison;
// creators["cure poison on party"] = &ShamanAiObjectContextInternal::cure_poison_on_party; creators["cure poison on party"] = &ShamanAiObjectContextInternal::cure_poison_on_party;
creators["lava burst"] = &ShamanAiObjectContextInternal::lava_burst; creators["lava burst"] = &ShamanAiObjectContextInternal::lava_burst;
creators["earth shield on main tank"] = &ShamanAiObjectContextInternal::earth_shield_on_main_tank; creators["earth shield on main tank"] = &ShamanAiObjectContextInternal::earth_shield_on_main_tank;
creators["fire elemental totem"] = &ShamanAiObjectContextInternal::fire_elemental_totem; creators["fire elemental totem"] = &ShamanAiObjectContextInternal::fire_elemental_totem;
@@ -277,10 +277,10 @@ class ShamanAiObjectContextInternal : public NamedObjectContext<Action>
static Action* lava_lash(PlayerbotAI* botAI) { return new CastLavaLashAction(botAI); } static Action* lava_lash(PlayerbotAI* botAI) { return new CastLavaLashAction(botAI); }
static Action* ancestral_spirit(PlayerbotAI* botAI) { return new CastAncestralSpiritAction(botAI); } static Action* ancestral_spirit(PlayerbotAI* botAI) { return new CastAncestralSpiritAction(botAI); }
static Action* wind_shear_on_enemy_healer(PlayerbotAI* botAI) { return new CastWindShearOnEnemyHealerAction(botAI); } static Action* wind_shear_on_enemy_healer(PlayerbotAI* botAI) { return new CastWindShearOnEnemyHealerAction(botAI); }
// static Action* cure_poison(PlayerbotAI* botAI) { return new CastCurePoisonAction(botAI); } static Action* cure_poison(PlayerbotAI* botAI) { return new CastCurePoisonActionSham(botAI); }
// static Action* cure_poison_on_party(PlayerbotAI* botAI) { return new CastCurePoisonOnPartyAction(botAI); } static Action* cure_poison_on_party(PlayerbotAI* botAI) { return new CastCurePoisonOnPartyActionSham(botAI); }
// static Action* cure_disease(PlayerbotAI* botAI) { return new CastCureDiseaseAction(botAI); } static Action* cure_disease(PlayerbotAI* botAI) { return new CastCureDiseaseActionSham(botAI); }
// static Action* cure_disease_on_party(PlayerbotAI* botAI) { return new CastCureDiseaseOnPartyAction(botAI); } static Action* cure_disease_on_party(PlayerbotAI* botAI) { return new CastCureDiseaseOnPartyActionSham(botAI); }
static Action* lava_burst(PlayerbotAI* ai) { return new CastLavaBurstAction(ai); } static Action* lava_burst(PlayerbotAI* ai) { return new CastLavaBurstAction(ai); }
static Action* earth_shield_on_main_tank(PlayerbotAI* ai) { return new CastEarthShieldOnMainTankAction(ai); } static Action* earth_shield_on_main_tank(PlayerbotAI* ai) { return new CastEarthShieldOnMainTankAction(ai); }
static Action* totem_of_wrath(PlayerbotAI* ai) { return new CastTotemOfWrathAction(ai); } static Action* totem_of_wrath(PlayerbotAI* ai) { return new CastTotemOfWrathAction(ai); }

View File

@@ -160,7 +160,7 @@ bool GrindTargetValue::needForQuest(Unit* target)
{ {
QuestStatusData* questStatus = sTravelMgr->getQuestStatus(bot, questId); QuestStatusData* questStatus = sTravelMgr->getQuestStatus(bot, questId);
if (questTemplate->GetQuestLevel() > bot->GetLevel()) if (questTemplate->GetQuestLevel() > bot->GetLevel()+5)
continue; continue;
for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++) for (int j = 0; j < QUEST_OBJECTIVES_COUNT; j++)