mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 09:07:19 +00:00
Minor fixes to spell and mount init (#863)
* Make summon imp non-temporary * Remove horse mount from troll * Set facing to during spell casting * Allow rpg status command * Init unarmed skill and fix skill clear * Cast delay after interrupt spell
This commit is contained in:
@@ -328,13 +328,14 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
|
||||
if (currentSpell && currentSpell->GetSpellInfo() && currentSpell->getState() == SPELL_STATE_PREPARING)
|
||||
{
|
||||
const SpellInfo* spellInfo = currentSpell->GetSpellInfo();
|
||||
|
||||
Unit* spellTarget = currentSpell->m_targets.GetUnitTarget();
|
||||
// interrupt if target is dead
|
||||
if (currentSpell->m_targets.GetUnitTarget() && !currentSpell->m_targets.GetUnitTarget()->IsAlive() &&
|
||||
if (spellTarget && !spellTarget->IsAlive() &&
|
||||
!spellInfo->IsAllowingDeadTarget())
|
||||
{
|
||||
InterruptSpell();
|
||||
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
|
||||
YieldThread(GetReactDelay());
|
||||
return;
|
||||
}
|
||||
|
||||
bool isHeal = false;
|
||||
@@ -357,10 +358,16 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal)
|
||||
}
|
||||
}
|
||||
// interrupt if target ally has full health (heal by other member)
|
||||
if (isHeal && isSingleTarget && currentSpell->m_targets.GetUnitTarget() && currentSpell->m_targets.GetUnitTarget()->IsFullHealth())
|
||||
if (isHeal && isSingleTarget && spellTarget && spellTarget->IsFullHealth())
|
||||
{
|
||||
InterruptSpell();
|
||||
SetNextCheckDelay(sPlayerbotAIConfig->reactDelay);
|
||||
YieldThread(GetReactDelay());
|
||||
return;
|
||||
}
|
||||
|
||||
if (spellTarget && !bot->HasInArc(CAST_ANGLE_IN_FRONT, spellTarget) && (spellInfo->FacingCasterFlags & SPELL_FACING_FLAG_INFRONT))
|
||||
{
|
||||
sServerFacade->SetFacingTo(bot, spellTarget);
|
||||
}
|
||||
|
||||
// wait for spell cast
|
||||
@@ -817,6 +824,7 @@ bool PlayerbotAI::IsAllowedCommand(std::string const text)
|
||||
unsecuredCommands.insert("sendmail");
|
||||
unsecuredCommands.insert("invite");
|
||||
unsecuredCommands.insert("leave");
|
||||
unsecuredCommands.insert("rpg status");
|
||||
}
|
||||
|
||||
for (std::set<std::string>::iterator i = unsecuredCommands.begin(); i != unsecuredCommands.end(); ++i)
|
||||
|
||||
Reference in New Issue
Block a user