*Always remove riding aura when exit vehicle.

*Other misc changes.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-25 23:55:37 -05:00
parent 70aea97d53
commit 058e6827a6
6 changed files with 45 additions and 17 deletions
+7 -4
View File
@@ -171,7 +171,7 @@ void CasterAI::UpdateAI(const uint32 diff)
ArchorAI::ArchorAI(Creature *c) : CreatureAI(c)
{
assert(me->m_spells[0]);
ASSERT(me->m_spells[0]);
m_minRange = GetSpellMinRange(me->m_spells[0], false);
if(!m_minRange)
m_minRange = MELEE_RANGE;
@@ -181,6 +181,9 @@ ArchorAI::ArchorAI(Creature *c) : CreatureAI(c)
void ArchorAI::AttackStart(Unit *who)
{
if(!who)
return;
if(me->IsWithinCombatRange(who, m_minRange))
{
if(me->Attack(who, true) && !who->IsFlying())
@@ -214,16 +217,16 @@ void ArchorAI::UpdateAI(const uint32 diff)
TurretAI::TurretAI(Creature *c) : CreatureAI(c)
{
assert(me->m_spells[0]);
ASSERT(me->m_spells[0]);
m_minRange = GetSpellMinRange(me->m_spells[0], false);
me->m_CombatDistance = GetSpellMaxRange(me->m_spells[0], false);
me->m_SightDistance = me->m_CombatDistance;
sLog.outError("turret ai begins!");
}
void TurretAI::AttackStart(Unit *who)
{
me->Attack(who, false);
if(who)
me->Attack(who, false);
}
void TurretAI::UpdateAI(const uint32 diff)
+1 -1
View File
@@ -2252,7 +2252,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
SetUnitMovementFlags(cainfo->move_flags);
if(GetCreatureInfo()->InhabitType & INHABIT_AIR)
AddUnitMovementFlag(MOVEMENTFLAG_FLY_MODE);
AddUnitMovementFlag(MOVEMENTFLAG_FLY_MODE + MOVEMENTFLAG_FLYING);
if(cainfo->auras)
{
+14 -1
View File
@@ -1027,7 +1027,20 @@ uint32 ObjectMgr::ChooseDisplayId(uint32 team, const CreatureInfo *cinfo, const
return data->displayid;
if(!team)
return cinfo->GetRandomValidModelId();
{
switch(cinfo->Entry)
{
case 28511: // Eye of Acherus
case 33114: // Flame Leviathan Seat (model 24914 chair)
case 33167: // Salvaged Demolisher Mechanic Seat
case 33218: // Pyrite Safety Container
return cinfo->DisplayID_A[0];
case 33143: // Overload Control Device
return cinfo->DisplayID_H[0];
default:
return cinfo->GetRandomValidModelId();
}
}
// use defaults from the template
uint32 display_id;
+14
View File
@@ -14790,6 +14790,20 @@ void Unit::ChangeSeat(int8 seatId, bool next)
void Unit::ExitVehicle()
{
if(!m_vehicle)
return;
Unit *vehicleBase = m_vehicle->GetBase();
const AuraEffectList &modAuras = vehicleBase->GetAurasByType(SPELL_AURA_CONTROL_VEHICLE);
for(AuraEffectList::const_iterator itr = modAuras.begin(); itr != modAuras.end(); ++itr)
{
if((*itr)->GetParentAura()->GetSourceGUID() == GetGUID())
{
vehicleBase->RemoveAura((*itr)->GetParentAura());
break; // there should be no case that a vehicle has two auras for one source
}
}
if(!m_vehicle)
return;
-1
View File
@@ -1495,7 +1495,6 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura * except=NULL, bool negative = true, bool positive = true);
void RemoveNotOwnSingleTargetAuras(uint32 newPhase = 0x0);
void RemoveSpellsCausingAura(AuraType auraType);
void RemoveRankAurasDueToSpell(uint32 spellId);
bool RemoveNoStackAurasDueToAura(Aura *Aur);
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = NULL);