Scripts/Spells: Dimensional Ripper - Everlook

Port From (https://github.com/TrinityCore/TrinityCore/commit/b8d675eba761a5616c7d69a78851ea61af61f4f6)
This commit is contained in:
hondacrx
2021-12-26 19:36:53 -05:00
parent ce3b99471d
commit 39dd51370f
3 changed files with 36 additions and 18 deletions
-18
View File
@@ -576,24 +576,6 @@ namespace Game.Spells
Log.outError(LogFilter.Spells, "Spell.EffectTeleportUnits - spellId {0} attempted to teleport creature to a different map.", m_spellInfo.Id);
return;
}
// post effects for TARGET_DEST_DB
switch (m_spellInfo.Id)
{
// Dimensional Ripper - Everlook
case 23442:
{
int r = RandomHelper.IRand(0, 119);
if (r >= 70) // 7/12 success
{
if (r < 100) // 4/12 evil twin
m_caster.CastSpell(m_caster, 23445, new CastSpellExtraArgs(TriggerCastFlags.FullMask).SetOriginalCastId(m_castId));
else // 1/12 fire
m_caster.CastSpell(m_caster, 23449, new CastSpellExtraArgs(TriggerCastFlags.FullMask).SetOriginalCastId(m_castId));
}
return;
}
}
}
[SpellEffectHandler(SpellEffectName.TeleportWithSpellVisualKitLoadingScreen)]
+34
View File
@@ -173,6 +173,7 @@ namespace Scripts.Spells.Items
// TransporterSpells
public const uint EvilTwin = 23445;
public const uint TransporterMalfunctionFire = 23449;
public const uint TransporterMalfunctionSmaller = 36893;
public const uint TransporterMalfunctionBigger = 36895;
public const uint TransporterMalfunctionChicken = 36940;
@@ -1801,6 +1802,39 @@ namespace Scripts.Spells.Items
}
}
[Script] // 23442 - Dimensional Ripper - Everlook
class spell_item_dimensional_ripper_everlook : SpellScript
{
public override bool Validate(SpellInfo spellInfo)
{
return ValidateSpellInfo(SpellIds.TransporterMalfunctionFire, SpellIds.EvilTwin);
}
public override bool Load()
{
return GetCaster().IsPlayer();
}
void HandleScript(uint effIndex)
{
int r = RandomHelper.IRand(0, 119);
if (r <= 70) // 7/12 success
return;
Unit caster = GetCaster();
if (r < 100) // 4/12 evil twin
caster.CastSpell(caster, SpellIds.EvilTwin, true);
else // 1/12 fire
caster.CastSpell(caster, SpellIds.TransporterMalfunctionFire, true);
}
public override void Register()
{
OnEffectHitTarget.Add(new EffectHandler(HandleScript, 0, SpellEffectName.TeleportUnits));
}
}
[Script] // 36941 - Ultrasafe Transporter: Toshley's Station
class spell_item_ultrasafe_transporter : SpellScript
{
@@ -0,0 +1,2 @@
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_item_dimensional_ripper_everlook';
INSERT INTO `spell_script_names` VALUES (23442,'spell_item_dimensional_ripper_everlook');