aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMachiavelli <machiavelli.trinity@gmail.com>2011-11-28 15:42:32 +0100
committerMachiavelli <machiavelli.trinity@gmail.com>2011-11-28 15:42:32 +0100
commit059d4f52a3efd8695ec1e10c31959e24e50185c4 (patch)
tree64fbe879c99c031aca1fbcae26d3ac0feeae8abc
parent487da95a924458acf323e8d99b4c87b15f6d0ed5 (diff)
parent0b4b853a0530be6c2557dbc9f46ab61c0767f0cc (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.x
-rw-r--r--sql/updates/world/2011_11_27_00_world_creature_template.sql4
-rw-r--r--sql/updates/world/2011_11_27_00_world_spell_script.sql6
-rwxr-xr-xsrc/server/game/Entities/Transport/Transport.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockDepths/boss_tomb_of_seven.cpp2
-rw-r--r--src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp24
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp64
6 files changed, 91 insertions, 11 deletions
diff --git a/sql/updates/world/2011_11_27_00_world_creature_template.sql b/sql/updates/world/2011_11_27_00_world_creature_template.sql
new file mode 100644
index 00000000000..f29586ea142
--- /dev/null
+++ b/sql/updates/world/2011_11_27_00_world_creature_template.sql
@@ -0,0 +1,4 @@
+UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=150 WHERE `entry`=36597; -- The Lich King 10N
+UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=180 WHERE `entry`=39166; -- The Lich King 25N
+UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=180 WHERE `entry`=39167; -- The Lich King 10H
+UPDATE `creature_template` SET `mindmg`=509,`maxdmg`=683,`attackpower`=805,`dmg_multiplier`=225 WHERE `entry`=39168; -- The Lich King 25H
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
new file mode 100644
index 00000000000..5411d660c2b
--- /dev/null
+++ b/sql/updates/world/2011_11_27_00_world_spell_script.sql
@@ -0,0 +1,6 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_damage_reduction_aura';
+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
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();
}