mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 16:16:27 +00:00
Merge commit '26c583c24ab7dbbf1fecf3dcd737c1ad543c8b33' into Playerbot_1017
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -366,6 +366,7 @@ public:
|
||||
|
||||
// Handling caster facing during spellcast
|
||||
void SetTarget(ObjectGuid guid = ObjectGuid::Empty) override;
|
||||
void ClearTarget() { SetTarget(); };
|
||||
void FocusTarget(Spell const* focusSpell, WorldObject const* target);
|
||||
void ReleaseFocus(Spell const* focusSpell);
|
||||
[[nodiscard]] bool IsMovementPreventedByCasting() const override;
|
||||
@@ -398,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:
|
||||
|
||||
@@ -1175,6 +1175,14 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
HandleStatModifier(UNIT_MOD_ATTACK_POWER, TOTAL_PCT, aurEff->GetAmount(), true);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case NPC_VOIDWALKER:
|
||||
{
|
||||
if (AuraEffect* aurEff = owner->GetAuraEffectDummy(SPELL_GLYPH_OF_VOIDWALKER))
|
||||
{
|
||||
HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_PCT, aurEff->GetAmount(), true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NPC_WATER_ELEMENTAL_PERM:
|
||||
|
||||
@@ -147,6 +147,7 @@ enum PetScalingSpells
|
||||
SPELL_WARLOCK_PET_SCALING_04 = 34958,
|
||||
SPELL_WARLOCK_PET_SCALING_05 = 61013, // Hit / Expertise
|
||||
SPELL_GLYPH_OF_FELGUARD = 56246,
|
||||
SPELL_GLYPH_OF_VOIDWALKER = 56247,
|
||||
SPELL_INFERNAL_SCALING_01 = 36186,
|
||||
SPELL_INFERNAL_SCALING_02 = 36188,
|
||||
SPELL_INFERNAL_SCALING_03 = 36189,
|
||||
|
||||
@@ -11272,12 +11272,12 @@ void Unit::SendEnergizeSpellLog(Unit* victim, uint32 spellID, uint32 damage, Pow
|
||||
|
||||
void Unit::EnergizeBySpell(Unit* victim, uint32 spellID, uint32 damage, Powers powerType)
|
||||
{
|
||||
victim->ModifyPower(powerType, damage, false);
|
||||
int32 gainedPower = victim->ModifyPower(powerType, damage, false);
|
||||
|
||||
if (powerType != POWER_HAPPINESS)
|
||||
if (powerType != POWER_HAPPINESS && gainedPower)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
|
||||
victim->getHostileRefMgr().threatAssist(this, float(damage) * 0.5f, spellInfo);
|
||||
victim->getHostileRefMgr().threatAssist(this, float(gainedPower) * 0.5f, spellInfo);
|
||||
}
|
||||
|
||||
SendEnergizeSpellLog(victim, spellID, damage, powerType);
|
||||
@@ -20255,7 +20255,7 @@ bool Unit::CanSwim() const
|
||||
// Mirror client behavior, if this method returns false then client will not use swimming animation and for players will apply gravity as if there was no water
|
||||
if (HasUnitFlag(UNIT_FLAG_CANNOT_SWIM))
|
||||
return false;
|
||||
if (HasUnitFlag(UNIT_FLAG_POSSESSED)) // is player
|
||||
if (HasUnitFlag(UNIT_FLAG_POSSESSED) || HasUnitFlag(UNIT_FLAG_PLAYER_CONTROLLED)) // is player
|
||||
return true;
|
||||
if (HasUnitFlag2(UNIT_FLAG2_UNUSED_6))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user