aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Northrend
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/Northrend')
-rw-r--r--src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp2
-rw-r--r--src/server/scripts/Northrend/isle_of_conquest.cpp125
-rw-r--r--src/server/scripts/Northrend/zone_dalaran.cpp6
3 files changed, 129 insertions, 4 deletions
diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
index ca478244d2a..9a9e7aa6849 100644
--- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
+++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp
@@ -354,7 +354,7 @@ public:
if (caster)
{
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f))
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true))
DoCast(target, SPELL_PRIMARY(id));
}
else
diff --git a/src/server/scripts/Northrend/isle_of_conquest.cpp b/src/server/scripts/Northrend/isle_of_conquest.cpp
index 8cdfce90bc9..14763577c66 100644
--- a/src/server/scripts/Northrend/isle_of_conquest.cpp
+++ b/src/server/scripts/Northrend/isle_of_conquest.cpp
@@ -20,6 +20,9 @@
#include "PassiveAI.h"
#include "BattlegroundIC.h"
#include "Player.h"
+#include "Vehicle.h"
+#include "SpellScript.h"
+#include "SpellInfo.h"
// TO-DO: This should be done with SmartAI, but yet it does not correctly support vehicles's AIs.
// Even adding ReactState Passive we still have issues using SmartAI.
@@ -70,7 +73,129 @@ class npc_four_car_garage : public CreatureScript
}
};
+class spell_ioc_gunship_portal : public SpellScriptLoader
+{
+ public:
+ spell_ioc_gunship_portal() : SpellScriptLoader("spell_ioc_gunship_portal") { }
+
+ class spell_ioc_gunship_portal_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_ioc_gunship_portal_SpellScript);
+
+ bool Load() override
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Player* caster = GetCaster()->ToPlayer();
+ if (Battleground* bg = caster->GetBattleground())
+ if (bg->GetTypeID(true) == BATTLEGROUND_IC)
+ bg->DoAction(1, caster->GetGUID());
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_ioc_gunship_portal_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_ioc_gunship_portal_SpellScript();
+ }
+};
+
+enum ParachuteIC
+{
+ SPELL_PARACHUTE_IC = 66657
+};
+
+class spell_ioc_parachute_ic : public SpellScriptLoader
+{
+ public:
+ spell_ioc_parachute_ic() : SpellScriptLoader("spell_ioc_parachute_ic") { }
+
+ class spell_ioc_parachute_ic_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_ioc_parachute_ic_AuraScript);
+
+ void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
+ {
+ if (Player* target = GetTarget()->ToPlayer())
+ if (target->m_movementInfo.fallTime > 2000)
+ target->CastSpell(target, SPELL_PARACHUTE_IC, true);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_ioc_parachute_ic_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_ioc_parachute_ic_AuraScript();
+ }
+};
+
+enum Launch
+{
+ SPELL_LAUNCH_NO_FALLING_DAMAGE = 66251
+};
+
+class spell_ioc_launch : public SpellScriptLoader
+{
+ public:
+ spell_ioc_launch() : SpellScriptLoader("spell_ioc_launch") { }
+
+ class spell_ioc_launch_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_ioc_launch_SpellScript);
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ if (Player* player = GetHitPlayer())
+ player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage
+ }
+
+ void Launch()
+ {
+ WorldLocation const* const position = GetExplTargetDest();
+
+ if (Player* player = GetHitPlayer())
+ {
+ player->ExitVehicle();
+
+ // A better research is needed
+ // There is no spell for this, the following calculation was based on void Spell::CalculateJumpSpeeds
+
+ float speedZ = 10.0f;
+ float dist = position->GetExactDist2d(player->GetPositionX(), player->GetPositionY());
+ float speedXY = dist;
+
+ player->GetMotionMaster()->MoveJump(position->GetPositionX(), position->GetPositionY(), position->GetPositionZ(), speedXY, speedZ);
+ }
+ }
+
+ void Register() override
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_ioc_launch_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_FORCE_CAST);
+ AfterHit += SpellHitFn(spell_ioc_launch_SpellScript::Launch);
+ }
+ };
+
+ SpellScript* GetSpellScript() const override
+ {
+ return new spell_ioc_launch_SpellScript();
+ }
+};
+
void AddSC_isle_of_conquest()
{
new npc_four_car_garage();
+ new spell_ioc_gunship_portal();
+ new spell_ioc_parachute_ic();
+ new spell_ioc_launch();
}
diff --git a/src/server/scripts/Northrend/zone_dalaran.cpp b/src/server/scripts/Northrend/zone_dalaran.cpp
index 0897131eaf8..27d3e6dadc6 100644
--- a/src/server/scripts/Northrend/zone_dalaran.cpp
+++ b/src/server/scripts/Northrend/zone_dalaran.cpp
@@ -158,7 +158,7 @@ class npc_minigob_manabonk : public CreatureScript
me->setActive(true);
}
- void Reset()
+ void Reset() override
{
me->SetVisible(false);
events.ScheduleEvent(EVENT_SELECT_TARGET, IN_MILLISECONDS);
@@ -188,7 +188,7 @@ class npc_minigob_manabonk : public CreatureScript
CharacterDatabase.CommitTransaction(trans);
}
- void UpdateAI(uint32 diff)
+ void UpdateAI(uint32 diff) override
{
events.Update(diff);
@@ -232,7 +232,7 @@ class npc_minigob_manabonk : public CreatureScript
EventMap events;
};
- CreatureAI* GetAI(Creature* creature) const
+ CreatureAI* GetAI(Creature* creature) const override
{
return new npc_minigob_manabonkAI(creature);
}