Core/Unit: Renamed addUnitState/hasUnitState/clearUnitState to AddUnitState/HasUnitState/ClearUnitState

Core/Vehicles: Allow the vehicle to always damage the passenger (removed unneded dbc hacks from scripts)

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-12-17 13:43:24 +01:00
parent ee3fd3ebeb
commit 82f45966fc
99 changed files with 353 additions and 361 deletions
@@ -1075,7 +1075,7 @@ void AuraEffect::Update(uint32 diff, Unit * caster)
std::list<AuraApplication*> effectApplications;
GetApplicationList(effectApplications);
// tick on targets of effects
if (!caster || !caster->hasUnitState(UNIT_STAT_ISOLATED))
if (!caster || !caster->HasUnitState(UNIT_STAT_ISOLATED))
{
for (std::list<AuraApplication*>::iterator apptItr = effectApplications.begin(); apptItr != effectApplications.end(); ++apptItr)
PeriodicTick(*apptItr, caster);
@@ -1258,7 +1258,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
if (!target->isAlive())
return;
if (target->hasUnitState(UNIT_STAT_ISOLATED))
if (target->HasUnitState(UNIT_STAT_ISOLATED))
{
SendTickImmune(target, caster);
return;
@@ -1415,7 +1415,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
if (!target->isAlive())
return;
if (target->hasUnitState(UNIT_STAT_ISOLATED))
if (target->HasUnitState(UNIT_STAT_ISOLATED))
{
SendTickImmune(target, caster);
return;
@@ -1498,7 +1498,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
if (!target->isAlive())
return;
if (target->hasUnitState(UNIT_STAT_ISOLATED))
if (target->HasUnitState(UNIT_STAT_ISOLATED))
{
SendTickImmune(target, caster);
return;
@@ -1531,7 +1531,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
if (!target->isAlive())
return;
if (target->hasUnitState(UNIT_STAT_ISOLATED))
if (target->HasUnitState(UNIT_STAT_ISOLATED))
{
SendTickImmune(target, caster);
return;
@@ -1640,7 +1640,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
if (!target->isAlive())
return;
if (target->hasUnitState(UNIT_STAT_ISOLATED))
if (target->HasUnitState(UNIT_STAT_ISOLATED))
{
SendTickImmune(target, caster);
return;
@@ -1753,7 +1753,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
if (!target->isAlive())
return;
if (target->hasUnitState(UNIT_STAT_ISOLATED))
if (target->HasUnitState(UNIT_STAT_ISOLATED))
{
SendTickImmune(target, caster);
return;
@@ -1793,7 +1793,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
if (!target->isAlive())
return;
if (target->hasUnitState(UNIT_STAT_ISOLATED))
if (target->HasUnitState(UNIT_STAT_ISOLATED))
{
SendTickImmune(target, caster);
return;
@@ -1829,7 +1829,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
if (!target->isAlive())
return;
if (target->hasUnitState(UNIT_STAT_ISOLATED))
if (target->HasUnitState(UNIT_STAT_ISOLATED))
{
SendTickImmune(target, caster);
return;
@@ -3424,7 +3424,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const * aurApp, uint8 mode, bo
target->VisitNearbyObject(target->GetMap()->GetVisibilityRange(), searcher);
for (UnitList::iterator iter = targets.begin(); iter != targets.end(); ++iter)
{
if (!(*iter)->hasUnitState(UNIT_STAT_CASTING))
if (!(*iter)->HasUnitState(UNIT_STAT_CASTING))
continue;
for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++)
@@ -3443,7 +3443,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const * aurApp, uint8 mode, bo
// blizz like 2.0.x
target->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
target->addUnitState(UNIT_STAT_DIED);
target->AddUnitState(UNIT_STAT_DIED);
target->CombatStop();
target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
@@ -3468,7 +3468,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const * aurApp, uint8 mode, bo
// blizz like 2.0.x
target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
target->clearUnitState(UNIT_STAT_DIED);
target->ClearUnitState(UNIT_STAT_DIED);
}
}
@@ -4482,7 +4482,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const * aurApp, uin
if (GetSpellProto()->Mechanic == MECHANIC_BANISH)
{
if (apply)
target->addUnitState(UNIT_STAT_ISOLATED);
target->AddUnitState(UNIT_STAT_ISOLATED);
else
{
bool banishFound = false;
@@ -4494,7 +4494,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const * aurApp, uin
break;
}
if (!banishFound)
target->clearUnitState(UNIT_STAT_ISOLATED);
target->ClearUnitState(UNIT_STAT_ISOLATED);
}
}
}
+1 -1
View File
@@ -1823,7 +1823,7 @@ void UnitAura::FillTargetMap(std::map<Unit *, uint8> & targets, Unit * caster)
if (modOwner)
modOwner->ApplySpellMod(GetId(), SPELLMOD_RADIUS, radius);
if (!GetUnitOwner()->hasUnitState(UNIT_STAT_ISOLATED))
if (!GetUnitOwner()->HasUnitState(UNIT_STAT_ISOLATED))
{
switch(GetSpellProto()->Effect[effIndex])
{
+10 -10
View File
@@ -1415,7 +1415,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
}
// assisting case, healing and resurrection
if (unit->hasUnitState(UNIT_STAT_ATTACK_PLAYER))
if (unit->HasUnitState(UNIT_STAT_ATTACK_PLAYER))
{
m_caster->SetContestedPvP();
if (m_caster->GetTypeId() == TYPEID_PLAYER)
@@ -3357,8 +3357,8 @@ void Spell::cast(bool skipCheck)
m_spellState = SPELL_STATE_DELAYED;
SetDelayStart(0);
if (m_caster->hasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
m_caster->clearUnitState(UNIT_STAT_CASTING);
if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
m_caster->ClearUnitState(UNIT_STAT_CASTING);
}
else
{
@@ -3731,8 +3731,8 @@ void Spell::finish(bool ok)
if (IsChanneledSpell(m_spellInfo))
m_caster->UpdateInterruptMask();
if (m_caster->hasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
m_caster->clearUnitState(UNIT_STAT_CASTING);
if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_caster->IsNonMeleeSpellCasted(false, false, true))
m_caster->ClearUnitState(UNIT_STAT_CASTING);
// Unsummon summon as possessed creatures on spell cancel
if (IsChanneledSpell(m_spellInfo) && m_caster->GetTypeId() == TYPEID_PLAYER)
@@ -4870,8 +4870,8 @@ SpellCastResult Spell::CheckCast(bool strict)
if (!m_IsTriggeredSpell && m_spellInfo->TargetAuraState && !target->HasAuraState(AuraState(m_spellInfo->TargetAuraState), m_spellInfo, m_caster))
return SPELL_FAILED_TARGET_AURASTATE;
// Not allow casting on flying player
if (target->hasUnitState(UNIT_STAT_UNATTACKABLE))
// Not allow casting on flying player or on vehicle player (if caster isnt vehicle)
if (target->HasUnitState(UNIT_STAT_IN_FLIGHT) || (target->HasUnitState(UNIT_STAT_ONVEHICLE) && target->GetVehicleBase() != m_caster))
return SPELL_FAILED_BAD_TARGETS;
if (!m_IsTriggeredSpell && !m_caster->canSeeOrDetect(target))
@@ -5225,7 +5225,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (strict && m_caster->IsScriptOverriden(m_spellInfo, 6953))
m_caster->RemoveMovementImpairingAuras();
}
if (m_caster->hasUnitState(UNIT_STAT_ROOT))
if (m_caster->HasUnitState(UNIT_STAT_ROOT))
return SPELL_FAILED_ROOTED;
break;
}
@@ -5426,7 +5426,7 @@ SpellCastResult Spell::CheckCast(bool strict)
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
Unit* target = m_targets.getUnitTarget();
if (m_caster == target && m_caster->hasUnitState(UNIT_STAT_ROOT))
if (m_caster == target && m_caster->HasUnitState(UNIT_STAT_ROOT))
{
if (m_caster->GetTypeId() == TYPEID_PLAYER)
return SPELL_FAILED_ROOTED;
@@ -5652,7 +5652,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
if (!m_caster->isAlive() && !(m_spellInfo->Attributes & SPELL_ATTR_CASTABLE_WHILE_DEAD))
return SPELL_FAILED_CASTER_DEAD;
if (m_caster->hasUnitState(UNIT_STAT_CASTING) && !m_IsTriggeredSpell) //prevent spellcast interruption by another spellcast
if (m_caster->HasUnitState(UNIT_STAT_CASTING) && !m_IsTriggeredSpell) //prevent spellcast interruption by another spellcast
return SPELL_FAILED_SPELL_IN_PROGRESS;
if (m_caster->isInCombat() && IsNonCombatSpell(m_spellInfo))
return SPELL_FAILED_AFFECTING_COMBAT;
+3 -3
View File
@@ -1320,7 +1320,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
}
//Any effect which causes you to lose control of your character will supress the starfall effect.
if (m_caster->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED))
if (m_caster->HasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED))
return;
m_caster->CastSpell(unitTarget, damage, true);
@@ -3241,7 +3241,7 @@ void Spell::EffectDistract(SpellEffIndex /*effIndex*/)
return;
// target must be OK to do this
if (unitTarget->hasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING))
if (unitTarget->HasUnitState(UNIT_STAT_CONFUSED | UNIT_STAT_STUNNED | UNIT_STAT_FLEEING))
return;
float angle = unitTarget->GetAngle(&m_targets.m_dstPos);
@@ -6178,7 +6178,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/)
pet->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);
pet->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
pet->setDeathState(ALIVE);
pet->clearUnitState(UNIT_STAT_ALL_STATE);
pet->ClearUnitState(UNIT_STAT_ALL_STATE);
pet->SetHealth(pet->CountPctFromMaxHealth(damage));
//pet->AIM_Initialize();