mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 17:19:07 +00:00
feat(Core/Scripting): Implement SetInvincibility() to prevent creatur… (#20508)
This commit is contained in:
@@ -198,7 +198,7 @@ struct ScriptedAI : public CreatureAI
|
||||
void AttackStartNoMove(Unit* target);
|
||||
|
||||
// Called at any Damage from any attacker (before damage apply)
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/, DamageEffectType /*damagetype*/, SpellSchoolMask /*damageSchoolMask*/) override {}
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/, DamageEffectType /*damagetype*/, SpellSchoolMask /*damageSchoolMask*/) override;
|
||||
|
||||
//Called at World update tick
|
||||
void UpdateAI(uint32 diff) override;
|
||||
@@ -438,9 +438,14 @@ struct ScriptedAI : public CreatureAI
|
||||
|
||||
Player* SelectTargetFromPlayerList(float maxdist, uint32 excludeAura = 0, bool mustBeInLOS = false) const;
|
||||
|
||||
// Allows dropping to 1 HP but prevents creature from dying.
|
||||
void SetInvincibility(bool apply) { _invincible = apply; };
|
||||
[[nodiscard]] bool IsInvincible() const { return _invincible; };
|
||||
|
||||
private:
|
||||
Difficulty _difficulty;
|
||||
bool _isHeroic;
|
||||
bool _invincible;
|
||||
std::unordered_set<uint32> _uniqueTimedEvents;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user