mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
Core/SAI: Fix SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL
Proper usage of params: -param1: flat hp value -param2: percent hp value Note: only one of these params should be used(in case you set values in both,the script will chose percent)
This commit is contained in:
@@ -634,8 +634,11 @@ void SmartAI::SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
|
||||
void SmartAI::DamageTaken(Unit* doneBy, uint32& damage)
|
||||
{
|
||||
GetScript()->ProcessEventsFor(SMART_EVENT_DAMAGED, doneBy, damage);
|
||||
if ((me->GetHealth() - damage) <= mInvincibilityHpLevel)
|
||||
damage = me->GetHealth() - mInvincibilityHpLevel;
|
||||
if (damage >= me->GetHealth() - mInvincibilityHpLevel)
|
||||
{
|
||||
damage = 0;
|
||||
me->SetHealth(mInvincibilityHpLevel);
|
||||
}
|
||||
}
|
||||
|
||||
void SmartAI::HealReceived(Unit* doneBy, uint32& addhealth)
|
||||
|
||||
Reference in New Issue
Block a user