mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-21 20:46:22 +00:00
Compare commits
10 Commits
hermensbas
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41c53365ae | ||
|
|
fd07e02a8a | ||
|
|
6cf7f1aaef | ||
|
|
9f54d7e702 | ||
|
|
aeaaee15da | ||
|
|
a1137dbddc | ||
|
|
2eb98c3233 | ||
|
|
29613e29b7 | ||
|
|
e2c203a35e | ||
|
|
1b1ed18a23 |
6
.github/workflows/windows_build.yml
vendored
6
.github/workflows/windows_build.yml
vendored
@@ -25,21 +25,25 @@ jobs:
|
||||
with:
|
||||
repository: 'mod-playerbots/azerothcore-wotlk'
|
||||
ref: 'Playerbot'
|
||||
path: 'ac'
|
||||
- name: Checkout Playerbot Module
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'mod-playerbots/mod-playerbots'
|
||||
path: 'modules/mod-playerbots'
|
||||
#path: 'modules/mod-playerbots'
|
||||
path: ac/modules/mod-playerbots
|
||||
- name: ccache
|
||||
uses: hendrikmuhs/ccache-action@v1.2.13
|
||||
- name: Configure OS
|
||||
shell: bash
|
||||
working-directory: ac
|
||||
env:
|
||||
CONTINUOUS_INTEGRATION: true
|
||||
run: |
|
||||
./acore.sh install-deps
|
||||
- name: Build
|
||||
shell: bash
|
||||
working-directory: ac
|
||||
run: |
|
||||
export CTOOLS_BUILD=all
|
||||
./acore.sh compiler build
|
||||
|
||||
@@ -49,7 +49,7 @@ bool AcceptInvitationAction::Execute(Event event)
|
||||
if (sRandomPlayerbotMgr->IsRandomBot(bot))
|
||||
botAI->SetMaster(inviter);
|
||||
// else
|
||||
// sPlayerbotDbStore->Save(botAI);
|
||||
// sPlayerbotRepository->Save(botAI);
|
||||
|
||||
botAI->ResetStrategies();
|
||||
botAI->ChangeStrategy("+follow,-lfg,-bg", BOT_STATE_NON_COMBAT);
|
||||
@@ -75,19 +75,17 @@ void AutoMaintenanceOnLevelupAction::LearnSpells(std::ostringstream* out)
|
||||
void AutoMaintenanceOnLevelupAction::LearnTrainerSpells(std::ostringstream* out)
|
||||
{
|
||||
PlayerbotFactory factory(bot, bot->GetLevel());
|
||||
factory.InitSkills();
|
||||
factory.InitClassSpells();
|
||||
factory.InitAvailableSpells();
|
||||
factory.InitSkills();
|
||||
factory.InitPet();
|
||||
}
|
||||
|
||||
void AutoMaintenanceOnLevelupAction::LearnQuestSpells(std::ostringstream* out)
|
||||
{
|
||||
// CreatureTemplate const* co = sCreatureStorage.LookupEntry<CreatureTemplate>(id);
|
||||
ObjectMgr::QuestMap const& questTemplates = sObjectMgr->GetQuestTemplates();
|
||||
for (ObjectMgr::QuestMap::const_iterator i = questTemplates.begin(); i != questTemplates.end(); ++i)
|
||||
{
|
||||
//uint32 questId = i->first; //not used, line marked for removal.
|
||||
Quest const* quest = i->second;
|
||||
|
||||
// only process class-specific quests to learn class-related spells, cuz
|
||||
@@ -104,14 +102,52 @@ void AutoMaintenanceOnLevelupAction::LearnQuestSpells(std::ostringstream* out)
|
||||
!bot->SatisfyQuestSkill(quest, false))
|
||||
continue;
|
||||
|
||||
if (quest->GetRewSpellCast() > 0) // RewardSpell - expected route
|
||||
// use the same logic and impl from Player::learnQuestRewardedSpells
|
||||
|
||||
int32 spellId = quest->GetRewSpellCast();
|
||||
if (!spellId)
|
||||
continue;
|
||||
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
continue;
|
||||
|
||||
// xinef: find effect with learn spell and check if we have this spell
|
||||
bool found = false;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
LearnSpell(quest->GetRewSpellCast(), out);
|
||||
if (spellInfo->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL && spellInfo->Effects[i].TriggerSpell &&
|
||||
!bot->HasSpell(spellInfo->Effects[i].TriggerSpell))
|
||||
{
|
||||
// pusywizard: don't re-add profession specialties!
|
||||
if (SpellInfo const* triggeredInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[i].TriggerSpell))
|
||||
if (triggeredInfo->Effects[0].Effect == SPELL_EFFECT_TRADE_SKILL)
|
||||
break; // pussywizard: break and not cast the spell (found is false)
|
||||
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (quest->GetRewSpell() > 0) // RewardDisplaySpell - fallback
|
||||
|
||||
// xinef: we know the spell, continue
|
||||
if (!found)
|
||||
continue;
|
||||
|
||||
bot->CastSpell(bot, spellId, true);
|
||||
|
||||
// Check if RewardDisplaySpell is set to output the proper spell learned
|
||||
// after processing quests. Output the original RewardSpell otherwise.
|
||||
uint32 rewSpellId = quest->GetRewSpell();
|
||||
if (rewSpellId)
|
||||
{
|
||||
LearnSpell(quest->GetRewSpell(), out);
|
||||
if (SpellInfo const* rewSpellInfo = sSpellMgr->GetSpellInfo(rewSpellId))
|
||||
{
|
||||
*out << FormatSpell(rewSpellInfo) << ", ";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
*out << FormatSpell(spellInfo) << ", ";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,41 +164,6 @@ std::string const AutoMaintenanceOnLevelupAction::FormatSpell(SpellInfo const* s
|
||||
return out.str();
|
||||
}
|
||||
|
||||
void AutoMaintenanceOnLevelupAction::LearnSpell(uint32 spellId, std::ostringstream* out)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
return;
|
||||
|
||||
SpellInfo const* triggeredInfo;
|
||||
|
||||
// find effect with learn spell and check if we have this spell
|
||||
bool found = false;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
{
|
||||
if (spellInfo->Effects[i].Effect == SPELL_EFFECT_LEARN_SPELL && spellInfo->Effects[i].TriggerSpell &&
|
||||
!bot->HasSpell(spellInfo->Effects[i].TriggerSpell))
|
||||
{
|
||||
triggeredInfo = sSpellMgr->GetSpellInfo(spellInfo->Effects[i].TriggerSpell);
|
||||
|
||||
// do not learn profession specialties!
|
||||
if (!triggeredInfo || triggeredInfo->Effects[0].Effect == SPELL_EFFECT_TRADE_SKILL)
|
||||
break;
|
||||
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
return;
|
||||
|
||||
// NOTE: When rewarding quests, core casts spells instead of learning them,
|
||||
// but we sacrifice safe cast checks here in favor of performance/speed
|
||||
bot->learnSpell(triggeredInfo->Id);
|
||||
*out << FormatSpell(triggeredInfo) << ", ";
|
||||
}
|
||||
|
||||
void AutoMaintenanceOnLevelupAction::AutoUpgradeEquip()
|
||||
{
|
||||
if (!sPlayerbotAIConfig->autoUpgradeEquip || !sRandomPlayerbotMgr->IsRandomBot(bot))
|
||||
@@ -28,7 +28,6 @@ protected:
|
||||
void LearnSpells(std::ostringstream* out);
|
||||
void LearnTrainerSpells(std::ostringstream* out);
|
||||
void LearnQuestSpells(std::ostringstream* out);
|
||||
void LearnSpell(uint32 spellId, std::ostringstream* out);
|
||||
std::string const FormatSpell(SpellInfo const* sInfo);
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "ChangeStrategyAction.h"
|
||||
|
||||
#include "Event.h"
|
||||
#include "PlayerbotDbStore.h"
|
||||
#include "PlayerbotRepository.h"
|
||||
#include "Playerbots.h"
|
||||
|
||||
bool ChangeCombatStrategyAction::Execute(Event event)
|
||||
@@ -24,7 +24,7 @@ bool ChangeCombatStrategyAction::Execute(Event event)
|
||||
case '+':
|
||||
case '-':
|
||||
case '~':
|
||||
sPlayerbotDbStore->Save(botAI);
|
||||
sPlayerbotRepository->Save(botAI);
|
||||
break;
|
||||
case '?':
|
||||
break;
|
||||
@@ -62,7 +62,7 @@ bool ChangeNonCombatStrategyAction::Execute(Event event)
|
||||
case '+':
|
||||
case '-':
|
||||
case '~':
|
||||
sPlayerbotDbStore->Save(botAI);
|
||||
sPlayerbotRepository->Save(botAI);
|
||||
break;
|
||||
case '?':
|
||||
break;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user