ammo, pet return

This commit is contained in:
Yunfan Li
2023-05-30 17:10:51 +08:00
parent ffb0b260d3
commit 7f0b5c2f03
6 changed files with 36 additions and 27 deletions

View File

@@ -239,6 +239,9 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
// check activity
AllowActivity();
if (bot->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) {
return;
}
Spell* currentSpell = bot->GetCurrentSpell(CURRENT_GENERIC_SPELL);
if (currentSpell && currentSpell->getState() == SPELL_STATE_CASTING && currentSpell->GetCastTime())
{
@@ -448,7 +451,7 @@ void PlayerbotAI::Reset(bool full)
aiObjectContext->GetValue<GuidSet&>("ignore rpg target")->Get().clear();
bot->GetMotionMaster()->Clear();
bot->CleanupAfterTaxiFlight();
// bot->CleanupAfterTaxiFlight();
InterruptSpell();
if (full)
@@ -2470,13 +2473,13 @@ void PlayerbotAI::WaitForSpellCast(Spell* spell)
SpellInfo const* spellInfo = spell->GetSpellInfo();
float castTime = spell->GetCastTime();
if (spellInfo->IsChanneled())
{
int32 duration = spellInfo->GetDuration();
bot->ApplySpellMod(spellInfo->Id, SPELLMOD_DURATION, duration);
if (duration > 0)
castTime += duration;
}
// if (spellInfo->IsChanneled())
// {
// int32 duration = spellInfo->GetDuration();
// bot->ApplySpellMod(spellInfo->Id, SPELLMOD_DURATION, duration);
// if (duration > 0)
// castTime += duration;
// }
castTime = ceil(castTime);