Core/Scripts: Wormhole Generator - Pandaria (#18321)

This commit is contained in:
Krudor
2016-12-03 18:26:24 +01:00
committed by joschiwald
parent 1272e9eea6
commit 79b984832f
2 changed files with 79 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=126755;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(126755, 'spell_item_wormhole_pandaria');
DELETE FROM `spell_target_position` WHERE `ID` IN (126756,126757,126758,126759,126760,126761,126762,126763,126764);
INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `VerifiedBuild`) VALUES
(126756, 0, 870, 5150.88, 235.422, 6.48744, 22996),
(126757, 0, 870, 2096.54, 2158.18, 443.128, 22996),
(126758, 0, 870, 3072.24, 6119.23, 55.1368, 22996),
(126759, 0, 870, 634.678, 4153.04, 210.277, 22996),
(126760, 0, 870, -1509.39, 4574.97, 367.743, 22996),
(126761, 0, 870, -1494.64, -381.615, 120.762, 22996),
(126762, 0, 870, 124.442, 1027.04, 193.9, 22996),
(126763, 0, 870, 2389.92, -2083.52, 239.397, 22996),
(126764, 0, 870, 1208.64, 1376.96, 363.664, 22996);

View File

@@ -1373,6 +1373,69 @@ class spell_item_underbelly_elixir : public SpellScriptLoader
}
};
enum WormholeGeneratorPandariaSpell
{
SPELL_WORMHOLE_PANDARIA_ISLE_OF_RECKONING = 126756,
SPELL_WORMHOLE_PANDARIA_KUNLAI_UNDERWATER = 126757,
SPELL_WORMHOLE_PANDARIA_SRA_VESS = 126758,
SPELL_WORMHOLE_PANDARIA_RIKKITUN_VILLAGE = 126759,
SPELL_WORMHOLE_PANDARIA_ZANVESS_TREE = 126760,
SPELL_WORMHOLE_PANDARIA_ANGLERS_WHARF = 126761,
SPELL_WORMHOLE_PANDARIA_CRANE_STATUE = 126762,
SPELL_WORMHOLE_PANDARIA_EMPERORS_OMEN = 126763,
SPELL_WORMHOLE_PANDARIA_WHITEPETAL_LAKE = 126764,
};
std::vector<uint32> const WormholeTargetLocations =
{
SPELL_WORMHOLE_PANDARIA_ISLE_OF_RECKONING,
SPELL_WORMHOLE_PANDARIA_KUNLAI_UNDERWATER,
SPELL_WORMHOLE_PANDARIA_SRA_VESS,
SPELL_WORMHOLE_PANDARIA_RIKKITUN_VILLAGE,
SPELL_WORMHOLE_PANDARIA_ZANVESS_TREE,
SPELL_WORMHOLE_PANDARIA_ANGLERS_WHARF,
SPELL_WORMHOLE_PANDARIA_CRANE_STATUE,
SPELL_WORMHOLE_PANDARIA_EMPERORS_OMEN,
SPELL_WORMHOLE_PANDARIA_WHITEPETAL_LAKE
};
// 126755 - Wormhole: Pandaria
class spell_item_wormhole_pandaria : public SpellScriptLoader
{
public:
spell_item_wormhole_pandaria() : SpellScriptLoader("spell_item_wormhole_pandaria") { }
class spell_item_wormhole_pandaria_SpellScript : public SpellScript
{
PrepareSpellScript(spell_item_wormhole_pandaria_SpellScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
for (uint32 spellId : WormholeTargetLocations)
if (!sSpellMgr->GetSpellInfo(spellId))
return false;
return true;
}
void HandleTeleport(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
uint32 spellId = Trinity::Containers::SelectRandomContainerElement(WormholeTargetLocations);
GetCaster()->CastSpell(GetHitUnit(), spellId, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_item_wormhole_pandaria_SpellScript::HandleTeleport, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
{
return new spell_item_wormhole_pandaria_SpellScript();
}
};
// 47776 - Roll 'dem Bones
class spell_item_worn_troll_dice : public SpellScriptLoader
{
@@ -3075,6 +3138,7 @@ void AddSC_item_spell_scripts()
new spell_item_six_demon_bag();
new spell_item_the_eye_of_diminution();
new spell_item_underbelly_elixir();
new spell_item_wormhole_pandaria();
new spell_item_worn_troll_dice();
new spell_item_red_rider_air_rifle();