mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
*Update vehicle code.
*Show correct visual effects to other players. *Do not allow attack players on vehicle. *Only dismiss vehicle when it is summoned. --HG-- branch : trunk
This commit is contained in:
@@ -517,7 +517,7 @@ void Unit::RemoveSpellbyDamageTaken(uint32 damage, uint32 spell)
|
||||
|
||||
uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDamage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask, SpellEntry const *spellProto, bool durabilityLoss)
|
||||
{
|
||||
if (!pVictim->isAlive() || pVictim->isInFlight() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
|
||||
if (!pVictim->isAlive() || pVictim->hasUnitState(UNIT_STAT_UNATTACKABLE) || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
|
||||
return 0;
|
||||
|
||||
//You don't lose health from damage taken from another player while in a sanctuary
|
||||
@@ -1320,7 +1320,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
|
||||
if(!this || !pVictim)
|
||||
return;
|
||||
|
||||
if (!pVictim->isAlive() || pVictim->isInFlight() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
|
||||
if (!pVictim->isAlive() || pVictim->hasUnitState(UNIT_STAT_UNATTACKABLE) || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
|
||||
return;
|
||||
|
||||
SpellEntry const *spellProto = sSpellStore.LookupEntry(damageInfo->SpellID);
|
||||
@@ -1563,7 +1563,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
|
||||
if(!this || !pVictim)
|
||||
return;
|
||||
|
||||
if (!pVictim->isAlive() || pVictim->isInFlight() || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
|
||||
if (!pVictim->isAlive() || pVictim->hasUnitState(UNIT_STAT_UNATTACKABLE) || pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())
|
||||
return;
|
||||
|
||||
//You don't lose health from damage taken from another player while in a sanctuary
|
||||
@@ -9665,7 +9665,7 @@ bool Unit::isAttackableByAOE() const
|
||||
if(GetTypeId()==TYPEID_PLAYER && ((Player *)this)->isGameMaster())
|
||||
return false;
|
||||
|
||||
return !isInFlight();
|
||||
return !hasUnitState(UNIT_STAT_UNATTACKABLE);
|
||||
}
|
||||
|
||||
int32 Unit::ModifyHealth(int32 dVal)
|
||||
@@ -12784,7 +12784,7 @@ void Unit::SetCharmedOrPossessedBy(Unit* charmer, bool possess)
|
||||
if(this == charmer)
|
||||
return;
|
||||
|
||||
if(isInFlight())
|
||||
if(hasUnitState(UNIT_STAT_UNATTACKABLE))
|
||||
return;
|
||||
|
||||
if(GetTypeId() == TYPEID_PLAYER && ((Player*)this)->GetTransport())
|
||||
|
||||
Reference in New Issue
Block a user