diff options
author | megamage <none@none> | 2009-08-25 23:55:37 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-25 23:55:37 -0500 |
commit | 058e6827a69d1d3185109be4ddb8ac235478acf8 (patch) | |
tree | c7503f3e59e4077d4e85aeb366970699d661d179 /src | |
parent | 70aea97d53a79f1d17256c36d5e5e8943800f69a (diff) |
*Always remove riding aura when exit vehicle.
*Other misc changes.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp | 19 | ||||
-rw-r--r-- | src/game/CombatAI.cpp | 11 | ||||
-rw-r--r-- | src/game/Creature.cpp | 2 | ||||
-rw-r--r-- | src/game/ObjectMgr.cpp | 15 | ||||
-rw-r--r-- | src/game/Unit.cpp | 14 | ||||
-rw-r--r-- | src/game/Unit.h | 1 |
6 files changed, 45 insertions, 17 deletions
diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp index 0d0ca80830d..49b3a30c5ca 100644 --- a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp @@ -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()) { assert(vehicle); - me->SetReactState(REACT_DEFENSIVE); } Vehicle *vehicle; + void Reset() + { + _Reset(); + me->SetReactState(REACT_AGGRESSIVE); + } + void EnterCombat(Unit *who) { _EnterCombat(); + me->SetReactState(REACT_DEFENSIVE); events.ScheduleEvent(EVENT_PURSUE, 0); events.ScheduleEvent(EVENT_MISSILE, 1500); events.ScheduleEvent(EVENT_VENT, 20000); @@ -137,8 +143,7 @@ struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI switch(eventId) { - case 0: - return; + case 0: break; // this is a must case EVENT_PURSUE: DoCastAOE(SPELL_PURSUED); 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()) { assert(vehicle); - if (const CreatureInfo *cInfo = me->GetCreatureInfo()) - me->SetDisplayId(cInfo->DisplayID_A[0]); // 0 invisible, 1 visible #ifdef BOSS_DEBUG me->SetReactState(REACT_AGGRESSIVE); #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 { - 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 - } + boss_flame_leviathan_overload_deviceAI(Creature *c) : PassiveAI(c) {} void DoAction(const int32 param) { diff --git a/src/game/CombatAI.cpp b/src/game/CombatAI.cpp index 36d0b1699b8..37ef8186e2b 100644 --- a/src/game/CombatAI.cpp +++ b/src/game/CombatAI.cpp @@ -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) diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 8299d74f389..8c143b664c2 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -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) { diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 084c7fe0b8d..f1bef6c6808 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -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; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 62fe2de21be..992ad255688 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -14793,6 +14793,20 @@ 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; + //sLog.outError("exit vehicle"); m_vehicle->RemovePassenger(this); diff --git a/src/game/Unit.h b/src/game/Unit.h index 17979c94e0b..4ac99da3361 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -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); |