From ea1206ec71e78ed1ca2337dd1c3e8de08bc8b645 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 11 Jan 2023 01:05:29 -0500 Subject: [PATCH] Scripts/RLP: Added initial spawns and some cosmetic spells Port From (https://github.com/TrinityCore/TrinityCore/commit/486152e1631a28c72148a9d6eb2526a31602d599) --- .../RubyLifePools/InstanceRubyLifePools.cs | 86 +++++++++++++++++ .../RubyLifePools/RubyLifePools.cs | 93 +++++++++++++++++++ 2 files changed, 179 insertions(+) create mode 100644 Source/Scripts/DragonIsles/RubyLifePools/InstanceRubyLifePools.cs create mode 100644 Source/Scripts/DragonIsles/RubyLifePools/RubyLifePools.cs diff --git a/Source/Scripts/DragonIsles/RubyLifePools/InstanceRubyLifePools.cs b/Source/Scripts/DragonIsles/RubyLifePools/InstanceRubyLifePools.cs new file mode 100644 index 000000000..5f43714d0 --- /dev/null +++ b/Source/Scripts/DragonIsles/RubyLifePools/InstanceRubyLifePools.cs @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2012-2020 CypherCore + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +using Framework.Constants; +using Game.Maps; +using Game.Scripting; + +namespace Scripts.DragonIsles.RubyLifePools +{ + struct DataTypes + { + // Encounters + public const uint MelidrussaChillworn = 0; + public const uint KokiaBlazehoof = 1; + public const uint KyrakkaAndErkhartStormvein = 2; + } + + struct CreatureIds + { + // Bosses + public const uint MelidrussaChillworn = 188252; + public const uint KokiaBlazehoof = 189232; + public const uint Kyrakka = 190484; + } + + struct GameObjectIds + { + public const uint FireWall = 377194; + } + + [Script] + class instance_ruby_life_pools : InstanceMapScript + { + public static ObjectData[] creatureData = + { + new ObjectData(CreatureIds.MelidrussaChillworn, DataTypes.MelidrussaChillworn), + new ObjectData(CreatureIds.KokiaBlazehoof, DataTypes.KokiaBlazehoof), + new ObjectData(CreatureIds.Kyrakka, DataTypes.KyrakkaAndErkhartStormvein), + }; + + public static DoorData[] doorData = + { + new DoorData(GameObjectIds.FireWall, DataTypes.KokiaBlazehoof, DoorType.Passage), + }; + + public static DungeonEncounterData[] encounters = + { + new DungeonEncounterData(DataTypes.MelidrussaChillworn, 2609 ), + new DungeonEncounterData(DataTypes.KokiaBlazehoof, 2606 ), + new DungeonEncounterData(DataTypes.KyrakkaAndErkhartStormvein, 2623 ) + }; + + public instance_ruby_life_pools() : base(nameof(instance_ruby_life_pools), 2521) { } + + class instance_ruby_life_pools_InstanceMapScript : InstanceScript + { + public instance_ruby_life_pools_InstanceMapScript(InstanceMap map) : base(map) + { + SetHeaders("RLP"); + SetBossNumber(3); + LoadObjectData(creatureData, null); + LoadDoorData(doorData); + LoadDungeonEncounterData(encounters); + } + } + + public override InstanceScript GetInstanceScript(InstanceMap map) + { + return new instance_ruby_life_pools_InstanceMapScript(map); + } + } +} diff --git a/Source/Scripts/DragonIsles/RubyLifePools/RubyLifePools.cs b/Source/Scripts/DragonIsles/RubyLifePools/RubyLifePools.cs new file mode 100644 index 000000000..15a9ef32c --- /dev/null +++ b/Source/Scripts/DragonIsles/RubyLifePools/RubyLifePools.cs @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2012-2020 CypherCore + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +using Framework.Constants; +using Game.Entities; +using Game.Scripting; +using Game.Spells; + +namespace Scripts.DragonIsles.RubyLifePools +{ + struct SpellIds + { + // Flashfrost Chillweaver + public const uint IceShield = 372749; + + // Primal Juggernaut + public const uint Excavate = 373497; + }; + + // 371652 - Executed + class spell_ruby_life_pools_executed : AuraScript + { + void HandleEffectApply(AuraEffect aurEff, AuraEffectHandleModes mode) + { + Unit target = GetTarget(); + target.SetUnitFlag3(UnitFlags3.FakeDead); + target.SetUnitFlag2(UnitFlags2.FeignDeath); + target.SetUnitFlag(UnitFlags.PreventEmotesFromChatText); + } + + public override void Register() + { + OnEffectApply.Add(new EffectApplyHandler(HandleEffectApply, 0, AuraType.ModStun, AuraEffectHandleModes.Real)); + } + } + + // 384933 - Ice Shield + class spell_ruby_life_pools_ice_shield : AuraScript + { + void HandleEffectPeriodic(AuraEffect aurEff) + { + Aura iceShield = GetTarget()?.GetAura(SpellIds.IceShield); + iceShield?.RefreshDuration(); + } + + public override void Register() + { + OnEffectPeriodic.Add(new EffectPeriodicHandler(HandleEffectPeriodic, 0, AuraType.PeriodicDummy)); + } + } + + // 372793 - Excavate + class spell_ruby_life_pools_excavate : AuraScript + { + void HandleEffectPeriodic(AuraEffect aurEff) + { + GetCaster()?.CastSpell(GetTarget(), SpellIds.Excavate, true); + } + + public override void Register() + { + OnEffectPeriodic.Add(new EffectPeriodicHandler(HandleEffectPeriodic, 0, AuraType.PeriodicDummy)); + } + } + + // 395029 - Storm Infusion + class spell_ruby_life_pools_storm_infusion : SpellScript + { + void SetDest(ref SpellDestination dest) + { + dest.RelocateOffset(new Position(9.0f, 0.0f, 4.0f, 0.0f)); + } + + public override void Register() + { + OnDestinationTargetSelect.Add(new DestinationTargetSelectHandler(SetDest, 1, Targets.DestDest)); + } + } +}