From 61866831caca9f2c980e518bf6b0b8b8691ad151 Mon Sep 17 00:00:00 2001 From: PKX Date: Tue, 15 Nov 2011 16:00:40 +0100 Subject: Core/Spells: Fix Damage Taken raid buffs Fixes 3% reduced damage taken from Blessing of Sanctuary and Renewed Hope Signed-off-by: PKX --- src/server/scripts/Spells/spell_generic.cpp | 64 +++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'src') 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(); } -- cgit v1.2.3 From 0136c8605427a058f464d1d8d41be0d969ce0c30 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 27 Nov 2011 00:39:27 +0200 Subject: Core/Pets: Water Elementals are now permanent pets --- src/server/game/Entities/Pet/Pet.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 404fe24d467..e20a4860896 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1764,6 +1764,8 @@ bool Pet::IsPermanentPetFor(Player* owner) return GetCreatureInfo()->type == CREATURE_TYPE_DEMON; case CLASS_DEATH_KNIGHT: return GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD; + case CLASS_MAGE: + return GetCreatureInfo()->type == CREATURE_TYPE_ELEMENTAL; default: return false; } -- cgit v1.2.3 From dd06dc75e6afde438b7f2fee3725f06e090dc640 Mon Sep 17 00:00:00 2001 From: Shocker Date: Sun, 27 Nov 2011 00:40:58 +0200 Subject: Revert "Core/Pets: Water Elementals are now permanent pets" (wrong branch) This reverts commit 0136c8605427a058f464d1d8d41be0d969ce0c30. Also add line ending to recently added SQL file --- sql/updates/world/2011_11_27_00_world_spell_script.sql | 2 +- src/server/game/Entities/Pet/Pet.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/sql/updates/world/2011_11_27_00_world_spell_script.sql b/sql/updates/world/2011_11_27_00_world_spell_script.sql index 2919c3e6538..5411d660c2b 100644 --- a/sql/updates/world/2011_11_27_00_world_spell_script.sql +++ b/sql/updates/world/2011_11_27_00_world_spell_script.sql @@ -3,4 +3,4 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (20911,'spell_gen_damage_reduction_aura'), -- Blessing of Sanctuary (25899,'spell_gen_damage_reduction_aura'), -- Greater Blessing of Sanctuary (63944,'spell_gen_damage_reduction_aura'), -- Renewed Hope -(50720,'spell_gen_damage_reduction_aura'); -- Vigilance \ No newline at end of file +(50720,'spell_gen_damage_reduction_aura'); -- Vigilance diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index e20a4860896..404fe24d467 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -1764,8 +1764,6 @@ bool Pet::IsPermanentPetFor(Player* owner) return GetCreatureInfo()->type == CREATURE_TYPE_DEMON; case CLASS_DEATH_KNIGHT: return GetCreatureInfo()->type == CREATURE_TYPE_UNDEAD; - case CLASS_MAGE: - return GetCreatureInfo()->type == CREATURE_TYPE_ELEMENTAL; default: return false; } -- cgit v1.2.3 From df3f11dc805a552e9e2ac781adcd8f4c6ac9a075 Mon Sep 17 00:00:00 2001 From: Manuel Carrasco Date: Sun, 27 Nov 2011 14:52:28 -0300 Subject: Scripts/EoE: Malygos does not fly always. --- .../Northrend/Nexus/EyeOfEternity/boss_malygos.cpp | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src') 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); -- cgit v1.2.3 From 86f7f546ec6daf8126bcfceb79b5b78f22d9380b Mon Sep 17 00:00:00 2001 From: Supabad Date: Mon, 28 Nov 2011 12:22:45 +0100 Subject: Core/Transports: Fix crash related to Transport --- src/server/game/Entities/Transport/Transport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 97f5af1c6e9..008f752306d 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) { -- cgit v1.2.3 From b8a0d04acc20f4b7ca5d1b479012c0d3db19f6dd Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Mon, 28 Nov 2011 16:36:43 +0200 Subject: Scripts/Brd: Fix learning of Dark Iron Smelting. --- .../scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3