aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAqua Deus <95978183+aquadeus@users.noreply.github.com>2023-01-03 18:30:51 +0100
committerGitHub <noreply@github.com>2023-01-03 18:30:51 +0100
commit486152e1631a28c72148a9d6eb2526a31602d599 (patch)
treece1cf3587a029225448ca6fabaa4d4fbf90160e2 /src
parent33954538bc30650f639e258eeb057c1340f4c949 (diff)
Scripts/RLP: Added initial spawns and some cosmetic spells (#28629)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/DragonIsles/RubyLifePools/instance_ruby_life_pools.cpp69
-rw-r--r--src/server/scripts/DragonIsles/RubyLifePools/ruby_life_pools.cpp110
-rw-r--r--src/server/scripts/DragonIsles/RubyLifePools/ruby_life_pools.h57
-rw-r--r--src/server/scripts/DragonIsles/dragon_isles_script_loader.cpp8
4 files changed, 244 insertions, 0 deletions
diff --git a/src/server/scripts/DragonIsles/RubyLifePools/instance_ruby_life_pools.cpp b/src/server/scripts/DragonIsles/RubyLifePools/instance_ruby_life_pools.cpp
new file mode 100644
index 00000000000..adac601b261
--- /dev/null
+++ b/src/server/scripts/DragonIsles/RubyLifePools/instance_ruby_life_pools.cpp
@@ -0,0 +1,69 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * 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 2 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include "InstanceScript.h"
+#include "ScriptMgr.h"
+#include "ruby_life_pools.h"
+
+ObjectData const creatureData[] =
+{
+ { BOSS_MELIDRUSSA_CHILLWORN, DATA_MELIDRUSSA_CHILLWORN },
+ { BOSS_KOKIA_BLAZEHOOF, DATA_KOKIA_BLAZEHOOF },
+ { BOSS_KYRAKKA, DATA_KYRAKKA_AND_ERKHART_STORMVEIN },
+ { 0, 0 } // END
+};
+
+DoorData const doorData[] =
+{
+ { GO_FIRE_WALL, DATA_KOKIA_BLAZEHOOF, DOOR_TYPE_PASSAGE },
+ { 0, 0, DOOR_TYPE_ROOM } // END
+};
+
+DungeonEncounterData const encounters[] =
+{
+ { DATA_MELIDRUSSA_CHILLWORN, {{ 2609 }} },
+ { DATA_KOKIA_BLAZEHOOF, {{ 2606 }} },
+ { DATA_KYRAKKA_AND_ERKHART_STORMVEIN, {{ 2623 }} }
+};
+
+class instance_ruby_life_pools : public InstanceMapScript
+{
+ public:
+ instance_ruby_life_pools() : InstanceMapScript(RLPScriptName, 2521) { }
+
+ struct instance_ruby_life_pools_InstanceMapScript: public InstanceScript
+ {
+ instance_ruby_life_pools_InstanceMapScript(InstanceMap* map) : InstanceScript(map)
+ {
+ SetHeaders(DataHeader);
+ SetBossNumber(EncounterCount);
+ LoadObjectData(creatureData, nullptr);
+ LoadDoorData(doorData);
+ LoadDungeonEncounterData(encounters);
+ }
+ };
+
+ InstanceScript* GetInstanceScript(InstanceMap* map) const override
+ {
+ return new instance_ruby_life_pools_InstanceMapScript(map);
+ }
+};
+
+void AddSC_instance_ruby_life_pools()
+{
+ new instance_ruby_life_pools();
+}
diff --git a/src/server/scripts/DragonIsles/RubyLifePools/ruby_life_pools.cpp b/src/server/scripts/DragonIsles/RubyLifePools/ruby_life_pools.cpp
new file mode 100644
index 00000000000..03c6731718b
--- /dev/null
+++ b/src/server/scripts/DragonIsles/RubyLifePools/ruby_life_pools.cpp
@@ -0,0 +1,110 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * 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 2 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include "SpellAuras.h"
+#include "SpellScript.h"
+#include "ScriptMgr.h"
+#include "Unit.h"
+#include "ruby_life_pools.h"
+
+enum RLPSpells
+{
+ // Flashfrost Chillweaver
+ SPELL_ICE_SHIELD = 372749,
+
+ // Primal Juggernaut
+ SPELL_EXCAVATE = 373497
+};
+
+// 371652 - Executed
+class spell_ruby_life_pools_executed : public AuraScript
+{
+ PrepareAuraScript(spell_ruby_life_pools_executed);
+
+ void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
+ {
+ Unit* target = GetTarget();
+ target->SetUnitFlag3(UNIT_FLAG3_FAKE_DEAD);
+ target->SetUnitFlag2(UNIT_FLAG2_FEIGN_DEATH);
+ target->SetUnitFlag(UNIT_FLAG_PREVENT_EMOTES_FROM_CHAT_TEXT);
+ }
+
+ void Register() override
+ {
+ OnEffectApply += AuraEffectApplyFn(spell_ruby_life_pools_executed::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
+ }
+};
+
+// 384933 - Ice Shield
+class spell_ruby_life_pools_ice_shield : public AuraScript
+{
+ PrepareAuraScript(spell_ruby_life_pools_ice_shield);
+
+ void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ Unit* target = GetTarget();
+
+ if (Aura* iceShield = target->GetAura(SPELL_ICE_SHIELD))
+ iceShield->RefreshDuration();
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_ruby_life_pools_ice_shield::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
+// 372793 - Excavate
+class spell_ruby_life_pools_excavate : public AuraScript
+{
+ PrepareAuraScript(spell_ruby_life_pools_excavate);
+
+ void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
+ {
+ if (Unit* caster = GetCaster())
+ caster->CastSpell(GetTarget(), SPELL_EXCAVATE, true);
+ }
+
+ void Register() override
+ {
+ OnEffectPeriodic += AuraEffectPeriodicFn(spell_ruby_life_pools_excavate::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
+ }
+};
+
+// 395029 - Storm Infusion
+class spell_ruby_life_pools_storm_infusion : public SpellScript
+{
+ PrepareSpellScript(spell_ruby_life_pools_storm_infusion);
+
+ void SetDest(SpellDestination& dest)
+ {
+ dest.RelocateOffset({ 9.0f, 0.0f, 4.0f, 0.0f });
+ }
+
+ void Register() override
+ {
+ OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_ruby_life_pools_storm_infusion::SetDest, EFFECT_1, TARGET_DEST_DEST);
+ }
+};
+
+void AddSC_ruby_life_pools()
+{
+ RegisterSpellScript(spell_ruby_life_pools_executed);
+ RegisterSpellScript(spell_ruby_life_pools_ice_shield);
+ RegisterSpellScript(spell_ruby_life_pools_excavate);
+ RegisterSpellScript(spell_ruby_life_pools_storm_infusion);
+}
diff --git a/src/server/scripts/DragonIsles/RubyLifePools/ruby_life_pools.h b/src/server/scripts/DragonIsles/RubyLifePools/ruby_life_pools.h
new file mode 100644
index 00000000000..20a688dba85
--- /dev/null
+++ b/src/server/scripts/DragonIsles/RubyLifePools/ruby_life_pools.h
@@ -0,0 +1,57 @@
+/*
+ * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
+ *
+ * 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 2 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 <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef DEF_RUBY_LIFE_POOLS_H_
+#define DEF_RUBY_LIFE_POOLS_H_
+
+#include "CreatureAIImpl.h"
+
+#define DataHeader "RLP"
+#define RLPScriptName "instance_ruby_life_pools"
+
+uint32 const EncounterCount = 3;
+
+enum RLPDataTypes
+{
+ // Encounters
+ DATA_MELIDRUSSA_CHILLWORN = 0,
+ DATA_KOKIA_BLAZEHOOF = 1,
+ DATA_KYRAKKA_AND_ERKHART_STORMVEIN = 2
+};
+
+enum RLPCreatureIds
+{
+ // Bosses
+ BOSS_MELIDRUSSA_CHILLWORN = 188252,
+ BOSS_KOKIA_BLAZEHOOF = 189232,
+ BOSS_KYRAKKA = 190484
+};
+
+enum RLPGameObjectIds
+{
+ GO_FIRE_WALL = 377194
+};
+
+template <class AI, class T>
+inline AI* GetRubyLifePoolsAI(T* obj)
+{
+ return GetInstanceAI<AI>(obj, RLPScriptName);
+}
+
+#define RegisterRubyLifePoolsCreatureAI(ai_name) RegisterCreatureAIWithFactory(ai_name, GetRubyLifePoolsAI)
+
+#endif
diff --git a/src/server/scripts/DragonIsles/dragon_isles_script_loader.cpp b/src/server/scripts/DragonIsles/dragon_isles_script_loader.cpp
index a7db19599fc..5719c2936ee 100644
--- a/src/server/scripts/DragonIsles/dragon_isles_script_loader.cpp
+++ b/src/server/scripts/DragonIsles/dragon_isles_script_loader.cpp
@@ -18,9 +18,17 @@
// This is where scripts' loading functions should be declared:
void AddSC_zone_the_forbidden_reach();
+// Ruby Life Pools
+void AddSC_instance_ruby_life_pools();
+void AddSC_ruby_life_pools();
+
// The name of this function should match:
// void Add${NameOfDirectory}Scripts()
void AddDragonIslesScripts()
{
AddSC_zone_the_forbidden_reach();
+
+ // Ruby Life Pools
+ AddSC_instance_ruby_life_pools();
+ AddSC_ruby_life_pools();
}