Core/AI: Fix some wannabe-invinceable typos here and there...
This commit is contained in:
@@ -95,7 +95,7 @@ CreatureEventAI::CreatureEventAI(Creature* c) : CreatureAI(c)
|
||||
m_AttackDistance = 0.0f;
|
||||
m_AttackAngle = 0.0f;
|
||||
|
||||
m_InvinceabilityHpLevel = 0;
|
||||
m_InvincibilityHpLevel = 0;
|
||||
|
||||
//Handle Spawned Events
|
||||
if (!m_bEmptyList)
|
||||
@@ -816,9 +816,9 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
|
||||
case ACTION_T_SET_INVINCIBILITY_HP_LEVEL:
|
||||
{
|
||||
if (action.invincibility_hp_level.is_percent)
|
||||
m_InvinceabilityHpLevel = me->CountPctFromMaxHealth(action.invincibility_hp_level.hp_level);
|
||||
m_InvincibilityHpLevel = me->CountPctFromMaxHealth(action.invincibility_hp_level.hp_level);
|
||||
else
|
||||
m_InvinceabilityHpLevel = action.invincibility_hp_level.hp_level;
|
||||
m_InvincibilityHpLevel = action.invincibility_hp_level.hp_level;
|
||||
break;
|
||||
}
|
||||
case ACTION_T_MOUNT_TO_ENTRY_OR_MODEL:
|
||||
@@ -1350,12 +1350,12 @@ void CreatureEventAI::ReceiveEmote(Player* player, uint32 textEmote)
|
||||
|
||||
void CreatureEventAI::DamageTaken(Unit* /*done_by*/, uint32& damage)
|
||||
{
|
||||
if (m_InvinceabilityHpLevel > 0 && me->GetHealth() < m_InvinceabilityHpLevel+damage)
|
||||
if (m_InvincibilityHpLevel > 0 && me->GetHealth() < m_InvincibilityHpLevel+damage)
|
||||
{
|
||||
if (me->GetHealth() <= m_InvinceabilityHpLevel)
|
||||
if (me->GetHealth() <= m_InvincibilityHpLevel)
|
||||
damage = 0;
|
||||
else
|
||||
damage = me->GetHealth() - m_InvinceabilityHpLevel;
|
||||
damage = me->GetHealth() - m_InvincibilityHpLevel;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -641,6 +641,6 @@ class CreatureEventAI : public CreatureAI
|
||||
bool m_MeleeEnabled; // If we allow melee auto attack
|
||||
float m_AttackDistance; // Distance to attack from
|
||||
float m_AttackAngle; // Angle of attack
|
||||
uint32 m_InvinceabilityHpLevel; // Minimal health level allowed at damage apply
|
||||
uint32 m_InvincibilityHpLevel; // Minimal health level allowed at damage apply
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -68,7 +68,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
|
||||
mFollowCredit = 0;
|
||||
mFollowArrivedEntry = 0;
|
||||
mFollowCreditType = 0;
|
||||
mInvinceabilityHpLevel = 0;
|
||||
mInvincibilityHpLevel = 0;
|
||||
}
|
||||
|
||||
void SmartAI::UpdateDespawn(const uint32 diff)
|
||||
@@ -638,8 +638,8 @@ 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) <= mInvinceabilityHpLevel)
|
||||
damage = me->GetHealth() - mInvinceabilityHpLevel;
|
||||
if ((me->GetHealth() - damage) <= mInvincibilityHpLevel)
|
||||
damage = me->GetHealth() - mInvincibilityHpLevel;
|
||||
}
|
||||
|
||||
void SmartAI::HealReceived(Unit* doneBy, uint32& addhealth)
|
||||
|
||||
@@ -174,7 +174,7 @@ class SmartAI : public CreatureAI
|
||||
|
||||
void SetSwim(bool swim = true);
|
||||
|
||||
void SetInvinceabilityHpLevel(uint32 level) { mInvinceabilityHpLevel = level; }
|
||||
void SetInvincibilityHpLevel(uint32 level) { mInvincibilityHpLevel = level; }
|
||||
|
||||
void sGossipHello(Player* player);
|
||||
void sGossipSelect(Player* player, uint32 sender, uint32 action);
|
||||
@@ -223,7 +223,7 @@ class SmartAI : public CreatureAI
|
||||
bool mCanAutoAttack;
|
||||
bool mCanCombatMove;
|
||||
bool mForcedPaused;
|
||||
uint32 mInvinceabilityHpLevel;
|
||||
uint32 mInvincibilityHpLevel;
|
||||
|
||||
bool AssistPlayerInCombat(Unit* who);
|
||||
|
||||
|
||||
@@ -1043,9 +1043,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
break;
|
||||
|
||||
if (e.action.invincHP.percent)
|
||||
ai->SetInvinceabilityHpLevel(me->CountPctFromMaxHealth(e.action.invincHP.percent));
|
||||
ai->SetInvincibilityHpLevel(me->CountPctFromMaxHealth(e.action.invincHP.percent));
|
||||
else
|
||||
ai->SetInvinceabilityHpLevel(e.action.invincHP.minHP);
|
||||
ai->SetInvincibilityHpLevel(e.action.invincHP.minHP);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_DATA:
|
||||
|
||||
Reference in New Issue
Block a user