aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Spells/SpellMgr.cpp9
-rw-r--r--src/server/scripts/Northrend/zone_storm_peaks.cpp66
2 files changed, 51 insertions, 24 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 241df021a6c..730f89a7b6b 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -3393,6 +3393,11 @@ void SpellMgr::LoadSpellInfoCorrections()
case 34471: // The Beast Within
spellInfo->AttributesEx5 |= SPELL_ATTR5_USABLE_WHILE_CONFUSED | SPELL_ATTR5_USABLE_WHILE_FEARED | SPELL_ATTR5_USABLE_WHILE_STUNNED;
break;
+ case 56606: // Ride Jokkum
+ case 61791: // Ride Vehicle (Yogg-Saron)
+ /// @todo: remove this when basepoints of all Ride Vehicle auras are calculated correctly
+ spellInfo->Effects[EFFECT_0].BasePoints = 1;
+ break;
// ULDUAR SPELLS
//
case 62374: // Pursued (Flame Leviathan)
@@ -3431,10 +3436,6 @@ void SpellMgr::LoadSpellInfoCorrections()
// that will be clear if we get more spells with problem like this
spellInfo->AttributesEx |= SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY;
break;
- case 61791: // Ride Vehicle (Yogg-Saron)
- // TODO: remove this when basepoints of all Ride Vehicle auras are calculated correctly
- spellInfo->Effects[EFFECT_0].BasePoints = 1;
- break;
case 64468: // Empowering Shadows (Yogg-Saron)
case 64486: // Empowering Shadows (Yogg-Saron)
spellInfo->MaxAffectedTargets = 3; // same for both modes?
diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp
index 7a2afe5505f..c09c817a2bf 100644
--- a/src/server/scripts/Northrend/zone_storm_peaks.cpp
+++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp
@@ -163,7 +163,8 @@ public:
## npc_brunnhildar_prisoner
######*/
-enum BrunnhildarPrisoner {
+enum BrunnhildarPrisoner
+{
SPELL_ICE_PRISON = 54894,
SPELL_ICE_LANCE = 55046,
SPELL_FREE_PRISONER = 55048,
@@ -635,14 +636,13 @@ class spell_close_rift : public SpellScriptLoader
};
/*#####
-# spell_jokkum_scriptcast
+# Krolmir, Hammer of Storms
#####*/
enum JokkumScriptcast
{
SPELL_JOKKUM_KILL_CREDIT = 56545,
SPELL_JOKKUM_SUMMON = 56541,
- SPELL_RIDE_JOKKUM = 56606,
NPC_KINGJOKKUM = 30331,
SAY_HOLD_ON = 0,
PATH_JOKKUM = 2072200
@@ -658,29 +658,15 @@ class spell_jokkum_scriptcast : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
- if (!sSpellMgr->GetSpellInfo(SPELL_JOKKUM_KILL_CREDIT) || !sSpellMgr->GetSpellInfo(SPELL_JOKKUM_SUMMON))
+ if (!sSpellMgr->GetSpellInfo(SPELL_JOKKUM_SUMMON))
return false;
return true;
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
- if (Player* player = GetTarget()->ToPlayer())
- {
- player->CastSpell(player, SPELL_JOKKUM_KILL_CREDIT, true);
- player->CastSpell(player, SPELL_JOKKUM_SUMMON, true);
-
- if (Creature* kingjokkum = GetClosestCreatureWithEntry(player, NPC_KINGJOKKUM, 10.0f))
- {
- kingjokkum->setFaction(player->getFaction());
- player->CastSpell(kingjokkum, SPELL_RIDE_JOKKUM, true);
- player->SetUInt64Value(PLAYER_FARSIGHT, player->GetGUID());
- kingjokkum->AI()->Talk(0, player->GetGUID());
- kingjokkum->ToPlayer()->SetClientControl(kingjokkum, 1);
- kingjokkum->GetMotionMaster()->MovePath(PATH_JOKKUM, false);
- kingjokkum->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
- }
- }
+ Unit* target = GetTarget();
+ target->CastSpell(target, SPELL_JOKKUM_SUMMON, true);
}
void Register() OVERRIDE
@@ -695,6 +681,45 @@ class spell_jokkum_scriptcast : public SpellScriptLoader
}
};
+class npc_king_jokkum_vehicle : public CreatureScript
+{
+ public:
+ npc_king_jokkum_vehicle() : CreatureScript("npc_king_jokkum_vehicle") { }
+
+ struct npc_king_jokkum_vehicleAI : public VehicleAI
+ {
+ npc_king_jokkum_vehicleAI(Creature* creature) : VehicleAI(creature) { }
+
+ void OnCharmed(bool /*apply*/) OVERRIDE { }
+
+ void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply) OVERRIDE
+ {
+ if (apply)
+ {
+ Talk(SAY_HOLD_ON, who->GetGUID());
+ me->CastSpell(who, SPELL_JOKKUM_KILL_CREDIT, true);
+ me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
+ me->GetMotionMaster()->MovePath(PATH_JOKKUM, false);
+ }
+ }
+
+ void MovementInform(uint32 type, uint32 id) OVERRIDE
+ {
+ if (type != WAYPOINT_MOTION_TYPE)
+ return;
+
+ // PointId in WaypointMovementGenerator doesn't match with PointId in DB
+ if (id == 19)
+ me->GetVehicleKit()->RemoveAllPassengers();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_king_jokkum_vehicleAI(creature);
+ }
+};
+
void AddSC_storm_peaks()
{
new npc_injured_goblin();
@@ -706,4 +731,5 @@ void AddSC_storm_peaks()
new npc_brann_bronzebeard_keystone();
new spell_close_rift();
new spell_jokkum_scriptcast();
+ new npc_king_jokkum_vehicle();
}