diff options
Diffstat (limited to 'src')
4 files changed, 81 insertions, 11 deletions
diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index f48d5ed631a..47ac5d57e00 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -664,9 +664,9 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, return 0; } - creature->m_isWorldObject = true; //so it will not be unloaded with grid map->AddToMap(creature); m_NPCPassengerSet.insert(creature); + creature->SetWorldObject(true); //so it will not be unloaded with grid if (tguid == 0) { diff --git a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp index 2fa19405153..b7b453caf60 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp @@ -56,7 +56,7 @@ public: break; case GOSSIP_ACTION_INFO_DEF+11: player->CLOSE_GOSSIP_MENU(); - creature->CastSpell(player, SPELL_LEARN_SMELT, false); + player->CastSpell(player, SPELL_LEARN_SMELT, false); break; case GOSSIP_ACTION_INFO_DEF+2: player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 282e6b3eb98..f28cd537e03 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -240,6 +240,8 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); _cannotMove = true; + + me->SetFlying(true); } uint32 GetData(uint32 data) @@ -351,6 +353,8 @@ public: _EnterCombat(); me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetFlying(false); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); Talk(SAY_AGGRO_P_ONE); @@ -404,6 +408,7 @@ public: void PrepareForVortex() { me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetFlying(true); me->GetMotionMaster()->MovementExpired(); me->GetMotionMaster()->MovePoint(MOVE_VORTEX, MalygosPositions[1].GetPositionX(), MalygosPositions[1].GetPositionY(), MalygosPositions[1].GetPositionZ()); @@ -439,6 +444,7 @@ public: me->SetInCombatWithZone(); break; case MOVE_CENTER_PLATFORM: + // Malygos is already flying here, there is no need to set it again. _cannotMove = false; // malygos will move into center of platform and then he does not chase dragons, he just turns to his current target. me->GetMotionMaster()->MoveIdle(); @@ -451,22 +457,21 @@ public: SetPhase(PHASE_TWO, true); me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SetFlying(true); me->GetMotionMaster()->MoveIdle(); me->GetMotionMaster()->MovePoint(MOVE_DEEP_BREATH_ROTATION, MalygosPhaseTwoWaypoints[0]); - Creature* summon = me->SummonCreature(NPC_HOVER_DISK_CASTER, HoverDiskWaypoints[MAX_HOVER_DISK_WAYPOINTS-1]); - if (summon && summon->IsAIEnabled) - summon->AI()->DoAction(ACTION_HOVER_DISK_START_WP_2); - summon = me->SummonCreature(NPC_HOVER_DISK_CASTER, HoverDiskWaypoints[0]); - if (summon && summon->IsAIEnabled) - summon->AI()->DoAction(ACTION_HOVER_DISK_START_WP_1); - for (uint8 i = 0; i < 2; i++) { + // Starting position. One starts from the first waypoint and another from the last. + uint8 pos = !i ? MAX_HOVER_DISK_WAYPOINTS-1 : 0; + if (Creature* summon = me->SummonCreature(NPC_HOVER_DISK_CASTER, HoverDiskWaypoints[pos])) + if (summon->IsAIEnabled) + summon->AI()->DoAction(ACTION_HOVER_DISK_START_WP_1+i); + // not sure about its position. - summon = me->SummonCreature(NPC_HOVER_DISK_MELEE, HoverDiskWaypoints[0]); - if (summon) + if (Creature* summon = me->SummonCreature(NPC_HOVER_DISK_MELEE, HoverDiskWaypoints[0])) summon->SetInCombatWithZone(); } } @@ -695,6 +700,7 @@ class spell_malygos_vortex_visual : public SpellScriptLoader malygos->SetInCombatWithZone(); malygos->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + malygos->SetFlying(false); malygos->GetMotionMaster()->MoveChase(caster->getVictim()); malygos->RemoveAura(SPELL_VORTEX_1); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index f0b48a5ad90..90abf2073ee 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1359,6 +1359,69 @@ public: } }; +enum DamageReductionAura +{ + SPELL_BLESSING_OF_SANCTUARY = 20911, + SPELL_GREATER_BLESSING_OF_SANCTUARY = 25899, + SPELL_RENEWED_HOPE = 63944, + SPELL_VIGILANCE = 50720, + SPELL_DAMAGE_REDUCTION_AURA = 68066, +}; + +class spell_gen_damage_reduction_aura : public SpellScriptLoader +{ +public: + spell_gen_damage_reduction_aura() : SpellScriptLoader("spell_gen_damage_reduction_aura") { } + + class spell_gen_damage_reduction_auraScript : public AuraScript + { + PrepareAuraScript(spell_gen_damage_reduction_auraScript); + + bool Validate(SpellInfo const* /*SpellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_DAMAGE_REDUCTION_AURA)) + return false; + return true; + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (!target || target->HasAura(SPELL_DAMAGE_REDUCTION_AURA)) + return; + + target->CastSpell(target, SPELL_DAMAGE_REDUCTION_AURA, true); + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (!target || !target->HasAura(SPELL_DAMAGE_REDUCTION_AURA)) + return; + + if (target->HasAura(SPELL_BLESSING_OF_SANCTUARY) || + target->HasAura(SPELL_GREATER_BLESSING_OF_SANCTUARY) || + target->HasAura(SPELL_RENEWED_HOPE) || + target->HasAura(SPELL_VIGILANCE)) + return; + + target->RemoveAurasDueToSpell(SPELL_DAMAGE_REDUCTION_AURA); + } + + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_gen_damage_reduction_auraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_damage_reduction_auraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_damage_reduction_auraScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -1390,4 +1453,5 @@ void AddSC_generic_spell_scripts() new spell_gen_launch(); new spell_gen_vehicle_scaling(); new spell_gen_oracle_wolvar_reputation(); + new spell_gen_damage_reduction_aura(); } |