Merge commit '26c583c24ab7dbbf1fecf3dcd737c1ad543c8b33' into Playerbot_1017

This commit is contained in:
Yunfan Li
2023-10-17 22:18:39 +08:00
57 changed files with 1461 additions and 879 deletions

View File

@@ -3708,6 +3708,24 @@ uint32 Creature::GetPlayerDamageReq() const
return _playerDamageReq;
}
bool Creature::CanCastSpell(uint32 spellID) const
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
int32 currentPower = GetPower(getPowerType());
if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED) || IsSpellProhibited(spellInfo->GetSchoolMask()))
{
return false;
}
if (spellInfo && (currentPower < spellInfo->CalcPowerCost(this, spellInfo->GetSchoolMask())))
{
return false;
}
return true;
}
std::string Creature::GetDebugInfo() const
{
std::stringstream sstr;