*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
@@ -65,14 +65,20 @@ struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
boss_flame_leviathanAI(Creature *c) : BossAI(c, BOSS_LEVIATHAN), vehicle(me->GetVehicleKit()) boss_flame_leviathanAI(Creature *c) : BossAI(c, BOSS_LEVIATHAN), vehicle(me->GetVehicleKit())
{ {
assert(vehicle); assert(vehicle);
me->SetReactState(REACT_DEFENSIVE);
} }
Vehicle *vehicle; Vehicle *vehicle;
void Reset()
{
_Reset();
me->SetReactState(REACT_AGGRESSIVE);
}
void EnterCombat(Unit *who) void EnterCombat(Unit *who)
{ {
_EnterCombat(); _EnterCombat();
me->SetReactState(REACT_DEFENSIVE);
events.ScheduleEvent(EVENT_PURSUE, 0); events.ScheduleEvent(EVENT_PURSUE, 0);
events.ScheduleEvent(EVENT_MISSILE, 1500); events.ScheduleEvent(EVENT_MISSILE, 1500);
events.ScheduleEvent(EVENT_VENT, 20000); events.ScheduleEvent(EVENT_VENT, 20000);
@@ -137,8 +143,7 @@ struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
switch(eventId) switch(eventId)
{ {
case 0: case 0: break; // this is a must
return;
case EVENT_PURSUE: case EVENT_PURSUE:
DoCastAOE(SPELL_PURSUED); DoCastAOE(SPELL_PURSUED);
events.RepeatEvent(35000); events.RepeatEvent(35000);
@@ -222,8 +227,6 @@ struct TRINITY_DLL_DECL boss_flame_leviathan_seatAI : public PassiveAI
boss_flame_leviathan_seatAI(Creature *c) : PassiveAI(c), vehicle(c->GetVehicleKit()) boss_flame_leviathan_seatAI(Creature *c) : PassiveAI(c), vehicle(c->GetVehicleKit())
{ {
assert(vehicle); assert(vehicle);
if (const CreatureInfo *cInfo = me->GetCreatureInfo())
me->SetDisplayId(cInfo->DisplayID_A[0]); // 0 invisible, 1 visible
#ifdef BOSS_DEBUG #ifdef BOSS_DEBUG
me->SetReactState(REACT_AGGRESSIVE); me->SetReactState(REACT_AGGRESSIVE);
#endif #endif
@@ -323,11 +326,7 @@ struct TRINITY_DLL_DECL boss_flame_leviathan_defense_turretAI : public ScriptedA
struct TRINITY_DLL_DECL boss_flame_leviathan_overload_deviceAI : public PassiveAI struct TRINITY_DLL_DECL boss_flame_leviathan_overload_deviceAI : public PassiveAI
{ {
boss_flame_leviathan_overload_deviceAI(Creature *c) : PassiveAI(c) boss_flame_leviathan_overload_deviceAI(Creature *c) : PassiveAI(c) {}
{
if (const CreatureInfo *cInfo = me->GetCreatureInfo())
me->SetDisplayId(cInfo->DisplayID_H[0]); // A0 gm, H0 device
}
void DoAction(const int32 param) void DoAction(const int32 param)
{ {
+6 -3
View File
@@ -171,7 +171,7 @@ void CasterAI::UpdateAI(const uint32 diff)
ArchorAI::ArchorAI(Creature *c) : CreatureAI(c) ArchorAI::ArchorAI(Creature *c) : CreatureAI(c)
{ {
assert(me->m_spells[0]); ASSERT(me->m_spells[0]);
m_minRange = GetSpellMinRange(me->m_spells[0], false); m_minRange = GetSpellMinRange(me->m_spells[0], false);
if(!m_minRange) if(!m_minRange)
m_minRange = MELEE_RANGE; m_minRange = MELEE_RANGE;
@@ -181,6 +181,9 @@ ArchorAI::ArchorAI(Creature *c) : CreatureAI(c)
void ArchorAI::AttackStart(Unit *who) void ArchorAI::AttackStart(Unit *who)
{ {
if(!who)
return;
if(me->IsWithinCombatRange(who, m_minRange)) if(me->IsWithinCombatRange(who, m_minRange))
{ {
if(me->Attack(who, true) && !who->IsFlying()) if(me->Attack(who, true) && !who->IsFlying())
@@ -214,15 +217,15 @@ void ArchorAI::UpdateAI(const uint32 diff)
TurretAI::TurretAI(Creature *c) : CreatureAI(c) TurretAI::TurretAI(Creature *c) : CreatureAI(c)
{ {
assert(me->m_spells[0]); ASSERT(me->m_spells[0]);
m_minRange = GetSpellMinRange(me->m_spells[0], false); m_minRange = GetSpellMinRange(me->m_spells[0], false);
me->m_CombatDistance = GetSpellMaxRange(me->m_spells[0], false); me->m_CombatDistance = GetSpellMaxRange(me->m_spells[0], false);
me->m_SightDistance = me->m_CombatDistance; me->m_SightDistance = me->m_CombatDistance;
sLog.outError("turret ai begins!");
} }
void TurretAI::AttackStart(Unit *who) void TurretAI::AttackStart(Unit *who)
{ {
if(who)
me->Attack(who, false); me->Attack(who, false);
} }
+1 -1
View File
@@ -2252,7 +2252,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
SetUnitMovementFlags(cainfo->move_flags); SetUnitMovementFlags(cainfo->move_flags);
if(GetCreatureInfo()->InhabitType & INHABIT_AIR) if(GetCreatureInfo()->InhabitType & INHABIT_AIR)
AddUnitMovementFlag(MOVEMENTFLAG_FLY_MODE); AddUnitMovementFlag(MOVEMENTFLAG_FLY_MODE + MOVEMENTFLAG_FLYING);
if(cainfo->auras) if(cainfo->auras)
{ {
+13
View File
@@ -1027,7 +1027,20 @@ uint32 ObjectMgr::ChooseDisplayId(uint32 team, const CreatureInfo *cinfo, const
return data->displayid; return data->displayid;
if(!team) if(!team)
{
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(); return cinfo->GetRandomValidModelId();
}
}
// use defaults from the template // use defaults from the template
uint32 display_id; uint32 display_id;
+14
View File
@@ -14790,6 +14790,20 @@ void Unit::ChangeSeat(int8 seatId, bool next)
void Unit::ExitVehicle() 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) if(!m_vehicle)
return; 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 RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura * except=NULL, bool negative = true, bool positive = true);
void RemoveNotOwnSingleTargetAuras(uint32 newPhase = 0x0); void RemoveNotOwnSingleTargetAuras(uint32 newPhase = 0x0);
void RemoveSpellsCausingAura(AuraType auraType);
void RemoveRankAurasDueToSpell(uint32 spellId); void RemoveRankAurasDueToSpell(uint32 spellId);
bool RemoveNoStackAurasDueToAura(Aura *Aur); bool RemoveNoStackAurasDueToAura(Aura *Aur);
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = NULL); void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = NULL);