mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-29 16:43:47 +00:00
fix(Scripts/Karazhan): Fix Aran combat movement behavior (#17359)
* fix(Scripts/Karazhan): Fix Aran combat movement behavior * Update SmartScript.cpp
This commit is contained in:
@@ -3707,6 +3707,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;
|
||||
|
||||
@@ -399,6 +399,12 @@ public:
|
||||
* */
|
||||
void ResumeChasingVictim() { GetMotionMaster()->MoveChase(GetVictim()); };
|
||||
|
||||
/**
|
||||
* @brief Returns true if the creature is able to cast the spell.
|
||||
*
|
||||
* */
|
||||
bool CanCastSpell(uint32 spellID) const;
|
||||
|
||||
std::string GetDebugInfo() const override;
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user