mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
refactor(Scripts/ScarletEnclave): Consolidate chapter scripts into a single file. (#26804)
This commit is contained in:
@@ -1,477 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of the AzerothCore 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 "CombatAI.h"
|
|
||||||
#include "CreatureScript.h"
|
|
||||||
#include "CreatureTextMgr.h"
|
|
||||||
#include "GameObjectScript.h"
|
|
||||||
#include "MoveSplineInit.h"
|
|
||||||
#include "ObjectMgr.h"
|
|
||||||
#include "PassiveAI.h"
|
|
||||||
#include "Player.h"
|
|
||||||
#include "ScriptedCreature.h"
|
|
||||||
#include "ScriptedEscortAI.h"
|
|
||||||
#include "ScriptedGossip.h"
|
|
||||||
#include "SpellInfo.h"
|
|
||||||
#include "SpellScript.h"
|
|
||||||
#include "SpellScriptLoader.h"
|
|
||||||
|
|
||||||
/*######
|
|
||||||
## npc_eye_of_acherus
|
|
||||||
######*/
|
|
||||||
|
|
||||||
enum EyeOfAcherusMisc
|
|
||||||
{
|
|
||||||
SPELL_THE_EYE_OF_ACHERUS = 51852,
|
|
||||||
};
|
|
||||||
|
|
||||||
enum DeathComesFromOnHigh
|
|
||||||
{
|
|
||||||
SPELL_CALL_OF_THE_DEAD = 51900
|
|
||||||
};
|
|
||||||
|
|
||||||
enum GothikActions
|
|
||||||
{
|
|
||||||
ACTION_DK_INITIATE_ASSAULT_ROAR = 15
|
|
||||||
};
|
|
||||||
|
|
||||||
// 51904 - Summon Ghouls On Scarlet Crusade
|
|
||||||
class spell_q12641_death_comes_from_on_high_summon_ghouls : public SpellScript
|
|
||||||
{
|
|
||||||
PrepareSpellScript(spell_q12641_death_comes_from_on_high_summon_ghouls);
|
|
||||||
|
|
||||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
|
||||||
{
|
|
||||||
return ValidateSpellInfo({ SPELL_CALL_OF_THE_DEAD });
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
|
||||||
{
|
|
||||||
PreventHitEffect(effIndex);
|
|
||||||
if (Unit* target = GetHitUnit())
|
|
||||||
target->CastSpell(target, SPELL_CALL_OF_THE_DEAD, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnEffectHitTarget += SpellEffectFn(spell_q12641_death_comes_from_on_high_summon_ghouls::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 52694 - Recall Eye of Acherus
|
|
||||||
class spell_q12641_death_comes_from_on_high_recall_eye : public SpellScript
|
|
||||||
{
|
|
||||||
PrepareSpellScript(spell_q12641_death_comes_from_on_high_recall_eye);
|
|
||||||
|
|
||||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
|
||||||
{
|
|
||||||
return ValidateSpellInfo({ SPELL_THE_EYE_OF_ACHERUS });
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
|
||||||
{
|
|
||||||
PreventHitEffect(effIndex);
|
|
||||||
Unit* caster = GetCaster();
|
|
||||||
Unit* owner = caster->GetCharmerOrOwner();
|
|
||||||
|
|
||||||
if (!caster || !owner)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (owner->HasAura(SPELL_THE_EYE_OF_ACHERUS))
|
|
||||||
owner->RemoveAurasDueToSpell(SPELL_THE_EYE_OF_ACHERUS);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnEffectHitTarget += SpellEffectFn(spell_q12641_death_comes_from_on_high_recall_eye::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 51761 - Rain of Darkness
|
|
||||||
class spell_q12641_rain_of_darkness : public SpellScript
|
|
||||||
{
|
|
||||||
PrepareSpellScript(spell_q12641_rain_of_darkness);
|
|
||||||
|
|
||||||
void ModDestHeight(SpellDestination& dest)
|
|
||||||
{
|
|
||||||
Position const offset = { 0.0f, 0.0f, 15.0f, 0.0f };
|
|
||||||
dest.RelocateOffset(offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q12641_rain_of_darkness::ModDestHeight, EFFECT_0, TARGET_DEST_CASTER_BACK);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
enum GiftOfTheHarvester
|
|
||||||
{
|
|
||||||
NPC_GHOUL = 28845,
|
|
||||||
MAX_GHOULS = 5,
|
|
||||||
|
|
||||||
SPELL_GHOUL_EMERGE = 50142,
|
|
||||||
SPELL_SUMMON_SCARLET_GHOST = 52505,
|
|
||||||
SPELL_GHOUL_SUBMERGE = 26234,
|
|
||||||
|
|
||||||
EVENT_GHOUL_RESTORE_STATE = 1,
|
|
||||||
EVENT_GHOUL_CHECK_COMBAT = 2,
|
|
||||||
EVENT_GHOUL_EMOTE = 3,
|
|
||||||
EVENT_GHOUL_MOVE_TO_PIT = 4,
|
|
||||||
|
|
||||||
SAY_GOTHIK_PIT = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
class spell_item_gift_of_the_harvester : public SpellScript
|
|
||||||
{
|
|
||||||
PrepareSpellScript(spell_item_gift_of_the_harvester);
|
|
||||||
|
|
||||||
SpellCastResult CheckRequirement()
|
|
||||||
{
|
|
||||||
std::list<Creature*> ghouls;
|
|
||||||
GetCaster()->GetAllMinionsByEntry(ghouls, NPC_GHOUL);
|
|
||||||
if (ghouls.size() >= MAX_GHOULS)
|
|
||||||
{
|
|
||||||
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_TOO_MANY_GHOULS);
|
|
||||||
return SPELL_FAILED_CUSTOM_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SPELL_CAST_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnCheckCast += SpellCheckCastFn(spell_item_gift_of_the_harvester::CheckRequirement);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class spell_q12698_the_gift_that_keeps_on_giving : public SpellScript
|
|
||||||
{
|
|
||||||
PrepareSpellScript(spell_q12698_the_gift_that_keeps_on_giving);
|
|
||||||
|
|
||||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
|
||||||
{
|
|
||||||
return ValidateSpellInfo({ SPELL_SUMMON_SCARLET_GHOST });
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
|
||||||
{
|
|
||||||
if (GetOriginalCaster() && GetHitUnit())
|
|
||||||
GetOriginalCaster()->CastSpell(GetHitUnit(), urand(0, 1) ? GetEffectValue() : SPELL_SUMMON_SCARLET_GHOST, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnEffectHitTarget += SpellEffectFn(spell_q12698_the_gift_that_keeps_on_giving::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
class npc_scarlet_ghoul : public CreatureScript
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
npc_scarlet_ghoul() : CreatureScript("npc_scarlet_ghoul") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return new npc_scarlet_ghoulAI(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct npc_scarlet_ghoulAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
npc_scarlet_ghoulAI(Creature* creature) : ScriptedAI(creature)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
EventMap events;
|
|
||||||
ObjectGuid gothikGUID;
|
|
||||||
|
|
||||||
void InitializeAI() override
|
|
||||||
{
|
|
||||||
me->SetUnitFlag(UNIT_FLAG_DISABLE_MOVE);
|
|
||||||
ScriptedAI::InitializeAI();
|
|
||||||
me->SetReactState(REACT_PASSIVE);
|
|
||||||
|
|
||||||
events.ScheduleEvent(EVENT_GHOUL_EMOTE, 1ms);
|
|
||||||
events.ScheduleEvent(EVENT_GHOUL_RESTORE_STATE, 3500ms);
|
|
||||||
}
|
|
||||||
|
|
||||||
void OwnerAttackedBy(Unit* attacker) override
|
|
||||||
{
|
|
||||||
if (!me->IsInCombat() && me->GetReactState() == REACT_DEFENSIVE)
|
|
||||||
AttackStart(attacker);
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetGUID(ObjectGuid const& guid, int32) override
|
|
||||||
{
|
|
||||||
gothikGUID = guid;
|
|
||||||
events.ScheduleEvent(EVENT_GHOUL_MOVE_TO_PIT, 3s);
|
|
||||||
me->GetMotionMaster()->Clear(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MovementInform(uint32 type, uint32 point) override
|
|
||||||
{
|
|
||||||
if (type == POINT_MOTION_TYPE && point == 1)
|
|
||||||
{
|
|
||||||
me->DespawnOrUnsummon(1500ms);
|
|
||||||
me->CastSpell(me, SPELL_GHOUL_SUBMERGE, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
|
||||||
{
|
|
||||||
events.Update(diff);
|
|
||||||
switch (events.ExecuteEvent())
|
|
||||||
{
|
|
||||||
case EVENT_GHOUL_MOVE_TO_PIT:
|
|
||||||
me->GetMotionMaster()->MovePoint(1, 2364.77f, -5776.14f, 151.36f);
|
|
||||||
if (Creature* gothik = ObjectAccessor::GetCreature(*me, gothikGUID))
|
|
||||||
gothik->AI()->DoAction(SAY_GOTHIK_PIT);
|
|
||||||
break;
|
|
||||||
case EVENT_GHOUL_EMOTE:
|
|
||||||
me->CastSpell(me, SPELL_GHOUL_EMERGE, true);
|
|
||||||
break;
|
|
||||||
case EVENT_GHOUL_RESTORE_STATE:
|
|
||||||
me->SetReactState(REACT_DEFENSIVE);
|
|
||||||
me->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE);
|
|
||||||
if (Player* owner = me->GetCharmerOrOwnerPlayerOrPlayerItself())
|
|
||||||
me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, frand(0.0f, 2 * M_PI));
|
|
||||||
events.ScheduleEvent(EVENT_GHOUL_CHECK_COMBAT, 1s);
|
|
||||||
return;
|
|
||||||
case EVENT_GHOUL_CHECK_COMBAT:
|
|
||||||
if (!me->IsInCombat())
|
|
||||||
if (Player* owner = me->GetCharmerOrOwnerPlayerOrPlayerItself())
|
|
||||||
if (owner->GetVictim())
|
|
||||||
AttackStart(owner->GetVictim());
|
|
||||||
|
|
||||||
events.Repeat(1s);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!UpdateVictim())
|
|
||||||
return;
|
|
||||||
|
|
||||||
DoMeleeAttackIfReady();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class npc_dkc1_gothik : public CreatureScript
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
npc_dkc1_gothik() : CreatureScript("npc_dkc1_gothik") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return new npc_dkc1_gothikAI(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct npc_dkc1_gothikAI : public ScriptedAI
|
|
||||||
{
|
|
||||||
npc_dkc1_gothikAI(Creature* creature) : ScriptedAI(creature) { spoken = 0; }
|
|
||||||
|
|
||||||
int32 spoken;
|
|
||||||
|
|
||||||
void DoAction(int32 action) override
|
|
||||||
{
|
|
||||||
if (action == SAY_GOTHIK_PIT && spoken <= 0)
|
|
||||||
{
|
|
||||||
spoken = 5000;
|
|
||||||
Talk(SAY_GOTHIK_PIT);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (action == ACTION_DK_INITIATE_ASSAULT_ROAR)
|
|
||||||
me->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MoveInLineOfSight(Unit* who) override
|
|
||||||
{
|
|
||||||
ScriptedAI::MoveInLineOfSight(who);
|
|
||||||
|
|
||||||
if (!who->IsImmuneToNPC() && who->GetEntry() == NPC_GHOUL && me->IsWithinDistInMap(who, 10.0f))
|
|
||||||
if (Unit* owner = who->GetOwner())
|
|
||||||
if (Player* player = owner->ToPlayer())
|
|
||||||
{
|
|
||||||
Creature* creature = who->ToCreature();
|
|
||||||
if (player->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE)
|
|
||||||
creature->CastSpell(owner, 52517, true);
|
|
||||||
|
|
||||||
creature->AI()->SetGUID(me->GetGUID());
|
|
||||||
creature->SetImmuneToAll(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
|
||||||
{
|
|
||||||
if (spoken > 0)
|
|
||||||
spoken -= diff;
|
|
||||||
|
|
||||||
ScriptedAI::UpdateAI(diff);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
/*######
|
|
||||||
##Quest 12848
|
|
||||||
######*/
|
|
||||||
|
|
||||||
#define GCD_CAST 1
|
|
||||||
|
|
||||||
enum UnworthyInitiate
|
|
||||||
{
|
|
||||||
SPELL_DK_INITIATE_VISUAL = 51519,
|
|
||||||
};
|
|
||||||
|
|
||||||
class spell_death_knight_initiate_visual : public SpellScript
|
|
||||||
{
|
|
||||||
PrepareSpellScript(spell_death_knight_initiate_visual);
|
|
||||||
|
|
||||||
void HandleScriptEffect(SpellEffIndex /* effIndex */)
|
|
||||||
{
|
|
||||||
Creature* target = GetHitCreature();
|
|
||||||
if (!target)
|
|
||||||
return;
|
|
||||||
|
|
||||||
uint32 spellId;
|
|
||||||
switch (target->GetDisplayId())
|
|
||||||
{
|
|
||||||
case 25369: spellId = 51552; break; // bloodelf female
|
|
||||||
case 25373: spellId = 51551; break; // bloodelf male
|
|
||||||
case 25363: spellId = 51542; break; // draenei female
|
|
||||||
case 25357: spellId = 51541; break; // draenei male
|
|
||||||
case 25361: spellId = 51537; break; // dwarf female
|
|
||||||
case 25356: spellId = 51538; break; // dwarf male
|
|
||||||
case 25372: spellId = 51550; break; // forsaken female
|
|
||||||
case 25367: spellId = 51549; break; // forsaken male
|
|
||||||
case 25362: spellId = 51540; break; // gnome female
|
|
||||||
case 25359: spellId = 51539; break; // gnome male
|
|
||||||
case 25355: spellId = 51534; break; // human female
|
|
||||||
case 25354: spellId = 51520; break; // human male
|
|
||||||
case 25360: spellId = 51536; break; // nightelf female
|
|
||||||
case 25358: spellId = 51535; break; // nightelf male
|
|
||||||
case 25368: spellId = 51544; break; // orc female
|
|
||||||
case 25364: spellId = 51543; break; // orc male
|
|
||||||
case 25371: spellId = 51548; break; // tauren female
|
|
||||||
case 25366: spellId = 51547; break; // tauren male
|
|
||||||
case 25370: spellId = 51545; break; // troll female
|
|
||||||
case 25365: spellId = 51546; break; // troll male
|
|
||||||
default: return;
|
|
||||||
}
|
|
||||||
|
|
||||||
target->CastSpell(target, spellId, true);
|
|
||||||
target->LoadEquipment();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnEffectHitTarget += SpellEffectFn(spell_death_knight_initiate_visual::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
enum spells_lich_king_whisper
|
|
||||||
{
|
|
||||||
SPELL_LICH_KING_VO_BLOCKER = 58207,
|
|
||||||
SPELL_LICHKINGDK001 = 58208,
|
|
||||||
SPELL_LICHKINGDK002 = 58209,
|
|
||||||
SPELL_LICHKINGDK003 = 58210,
|
|
||||||
SPELL_LICHKINGDK004 = 58211,
|
|
||||||
SPELL_LICHKINGDK005 = 58212,
|
|
||||||
SPELL_LICHKINGDK006 = 58213,
|
|
||||||
SPELL_LICHKINGDK007 = 58214,
|
|
||||||
SPELL_LICHKINGDK008 = 58215,
|
|
||||||
SPELL_LICHKINGDK009 = 58216,
|
|
||||||
SPELL_LICHKINGDK010 = 58217,
|
|
||||||
SPELL_LICHKINGDK011 = 58218,
|
|
||||||
SPELL_LICHKINGDK012 = 58219,
|
|
||||||
SPELL_LICHKINGDK013 = 58220,
|
|
||||||
SPELL_LICHKINGDK014 = 58221,
|
|
||||||
SPELL_LICHKINGDK015 = 58222,
|
|
||||||
SPELL_LICHKINGDK016 = 58223
|
|
||||||
};
|
|
||||||
|
|
||||||
//spell 58207 rand Whisper
|
|
||||||
class spell_lich_king_vo_blocker : public AuraScript
|
|
||||||
{
|
|
||||||
PrepareAuraScript(spell_lich_king_vo_blocker);
|
|
||||||
|
|
||||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
|
||||||
{
|
|
||||||
return ValidateSpellInfo
|
|
||||||
({
|
|
||||||
SPELL_LICHKINGDK001, SPELL_LICHKINGDK002, SPELL_LICHKINGDK003, SPELL_LICHKINGDK004,
|
|
||||||
SPELL_LICHKINGDK005, SPELL_LICHKINGDK006, SPELL_LICHKINGDK007, SPELL_LICHKINGDK008,
|
|
||||||
SPELL_LICHKINGDK009, SPELL_LICHKINGDK010, SPELL_LICHKINGDK011, SPELL_LICHKINGDK012,
|
|
||||||
SPELL_LICHKINGDK013, SPELL_LICHKINGDK014, SPELL_LICHKINGDK015, SPELL_LICHKINGDK016
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
||||||
{
|
|
||||||
if (Player* target = GetTarget()->ToPlayer())
|
|
||||||
{
|
|
||||||
//spell 58208-58223
|
|
||||||
GetCaster()->CastSpell(target, urand(SPELL_LICHKINGDK001, SPELL_LICHKINGDK016), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnEffectApply += AuraEffectApplyFn(spell_lich_king_vo_blocker::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 58208 - 58224 - Creature - The Lich King (28765) Whisper
|
|
||||||
class spell_lich_king_whisper : public SpellScript
|
|
||||||
{
|
|
||||||
PrepareSpellScript(spell_lich_king_whisper);
|
|
||||||
|
|
||||||
bool Validate(SpellInfo const* spellInfo) override
|
|
||||||
{
|
|
||||||
return sObjectMgr->GetBroadcastText(uint32(spellInfo->GetEffect(EFFECT_0).CalcValue())) &&
|
|
||||||
sSoundEntriesStore.LookupEntry(uint32(spellInfo->GetEffect(EFFECT_1).CalcValue()));
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
|
||||||
{
|
|
||||||
if (Player* player = GetHitPlayer())
|
|
||||||
GetCaster()->Whisper(uint32(GetEffectValue()), player, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
|
||||||
{
|
|
||||||
if (Player* player = GetHitPlayer())
|
|
||||||
player->PlayDistanceSound(uint32(GetEffectValue()), player);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnEffectHitTarget += SpellEffectFn(spell_lich_king_whisper::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
||||||
OnEffectHitTarget += SpellEffectFn(spell_lich_king_whisper::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
void AddSC_the_scarlet_enclave_c1()
|
|
||||||
{
|
|
||||||
RegisterSpellScript(spell_q12641_death_comes_from_on_high_summon_ghouls);
|
|
||||||
RegisterSpellScript(spell_q12641_death_comes_from_on_high_recall_eye);
|
|
||||||
RegisterSpellScript(spell_q12641_rain_of_darkness);
|
|
||||||
RegisterSpellScript(spell_item_gift_of_the_harvester);
|
|
||||||
RegisterSpellScript(spell_q12698_the_gift_that_keeps_on_giving);
|
|
||||||
new npc_scarlet_ghoul();
|
|
||||||
new npc_dkc1_gothik();
|
|
||||||
RegisterSpellScript(spell_death_knight_initiate_visual);
|
|
||||||
RegisterSpellScript(spell_lich_king_whisper);
|
|
||||||
RegisterSpellScript(spell_lich_king_vo_blocker);
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,91 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of the AzerothCore 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 "CreatureScript.h"
|
|
||||||
#include "ScriptedCreature.h"
|
|
||||||
#include "SpellAuras.h"
|
|
||||||
#include "SpellInfo.h"
|
|
||||||
#include "SpellScript.h"
|
|
||||||
#include "SpellScriptLoader.h"
|
|
||||||
|
|
||||||
enum DevourHumanoid
|
|
||||||
{
|
|
||||||
NPC_HEARTHGLEN_CRUSADER = 29102,
|
|
||||||
NPC_TIRISFAL_CRUSADER = 29103
|
|
||||||
};
|
|
||||||
|
|
||||||
// 53110 - Devour Humanoid
|
|
||||||
class spell_q12779_an_end_to_all_things : public SpellScript
|
|
||||||
{
|
|
||||||
PrepareSpellScript(spell_q12779_an_end_to_all_things);
|
|
||||||
|
|
||||||
SpellCastResult CheckCast()
|
|
||||||
{
|
|
||||||
if (Unit* caster = GetCaster())
|
|
||||||
if (caster->FindNearestCreature(NPC_HEARTHGLEN_CRUSADER, 15.0f, true) || caster->FindNearestCreature(NPC_TIRISFAL_CRUSADER, 15.0f, true))
|
|
||||||
return SPELL_CAST_OK;
|
|
||||||
|
|
||||||
return SPELL_FAILED_BAD_TARGETS;
|
|
||||||
}
|
|
||||||
|
|
||||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
|
||||||
{
|
|
||||||
if (Creature* c = GetHitUnit()->ToCreature())
|
|
||||||
if (Unit* caster = GetCaster())
|
|
||||||
{
|
|
||||||
c->AI()->AttackStart(caster);
|
|
||||||
c->CastSpell(caster, GetEffectValue(), true); // 53111
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
OnCheckCast += SpellCheckCastFn(spell_q12779_an_end_to_all_things::CheckCast);
|
|
||||||
OnEffectHitTarget += SpellEffectFn(spell_q12779_an_end_to_all_things::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// 53111 - Devour Humanoid (casted by the devoured creature)
|
|
||||||
class spell_q12779_an_end_to_all_things_devour_aura : public AuraScript
|
|
||||||
{
|
|
||||||
PrepareAuraScript(spell_q12779_an_end_to_all_things_devour_aura);
|
|
||||||
|
|
||||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
|
||||||
{
|
|
||||||
Unit* caster = GetCaster();
|
|
||||||
Unit* target = GetTarget();
|
|
||||||
if (!caster || !target)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE)
|
|
||||||
{
|
|
||||||
caster->SetDisableGravity(true);
|
|
||||||
Unit::Kill(target, caster);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Register() override
|
|
||||||
{
|
|
||||||
AfterEffectRemove += AuraEffectRemoveFn(spell_q12779_an_end_to_all_things_devour_aura::OnRemove, EFFECT_0, SPELL_AURA_CONTROL_VEHICLE, AURA_EFFECT_HANDLE_REAL);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
void AddSC_the_scarlet_enclave_c3()
|
|
||||||
{
|
|
||||||
RegisterSpellScript(spell_q12779_an_end_to_all_things);
|
|
||||||
RegisterSpellScript(spell_q12779_an_end_to_all_things_devour_aura);
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,143 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of the AzerothCore 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 "CreatureScript.h"
|
|
||||||
#include "PassiveAI.h"
|
|
||||||
#include "Player.h"
|
|
||||||
#include "ScriptedCreature.h"
|
|
||||||
|
|
||||||
/*####
|
|
||||||
## npc_valkyr_battle_maiden
|
|
||||||
####*/
|
|
||||||
|
|
||||||
enum Spells_VBM
|
|
||||||
{
|
|
||||||
SPELL_REVIVE = 51918
|
|
||||||
};
|
|
||||||
|
|
||||||
enum Says_VBM
|
|
||||||
{
|
|
||||||
WHISPER_REVIVE = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
class npc_valkyr_battle_maiden : public CreatureScript
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
npc_valkyr_battle_maiden() : CreatureScript("npc_valkyr_battle_maiden") { }
|
|
||||||
|
|
||||||
CreatureAI* GetAI(Creature* creature) const override
|
|
||||||
{
|
|
||||||
return new npc_valkyr_battle_maidenAI(creature);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct npc_valkyr_battle_maidenAI : public PassiveAI
|
|
||||||
{
|
|
||||||
npc_valkyr_battle_maidenAI(Creature* creature) : PassiveAI(creature) { }
|
|
||||||
|
|
||||||
uint32 FlyBackTimer;
|
|
||||||
float x, y, z;
|
|
||||||
uint32 phase;
|
|
||||||
|
|
||||||
void Reset() override
|
|
||||||
{
|
|
||||||
me->setActive(true);
|
|
||||||
me->SetVisible(false);
|
|
||||||
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
|
||||||
me->SetCanFly(true);
|
|
||||||
FlyBackTimer = 500;
|
|
||||||
phase = 0;
|
|
||||||
|
|
||||||
me->GetPosition(x, y, z);
|
|
||||||
z += 4.0f;
|
|
||||||
x -= 3.5f;
|
|
||||||
y -= 5.0f;
|
|
||||||
me->GetMotionMaster()->Clear(false);
|
|
||||||
me->SetPosition(x, y, z, 0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAI(uint32 diff) override
|
|
||||||
{
|
|
||||||
if (FlyBackTimer <= diff)
|
|
||||||
{
|
|
||||||
Player* player = nullptr;
|
|
||||||
if (me->IsSummon())
|
|
||||||
{
|
|
||||||
if (Unit * summoner = me->ToTempSummon()->GetSummonerUnit())
|
|
||||||
{
|
|
||||||
player = summoner->ToPlayer();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!player)
|
|
||||||
{
|
|
||||||
phase = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (phase)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
me->SetWalk(false);
|
|
||||||
me->HandleEmoteCommand(EMOTE_STATE_FLYGRABCLOSED);
|
|
||||||
FlyBackTimer = 500;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
if (player)
|
|
||||||
{
|
|
||||||
player->GetClosePoint(x, y, z, me->GetObjectSize());
|
|
||||||
}
|
|
||||||
z += 2.5f;
|
|
||||||
x -= 2.0f;
|
|
||||||
y -= 1.5f;
|
|
||||||
me->GetMotionMaster()->MovePoint(0, x, y, z);
|
|
||||||
if (player)
|
|
||||||
{
|
|
||||||
me->SetTarget(player->GetGUID());
|
|
||||||
}
|
|
||||||
me->SetVisible(true);
|
|
||||||
FlyBackTimer = 4500;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
if (player && !player->isResurrectRequested())
|
|
||||||
{
|
|
||||||
me->HandleEmoteCommand(EMOTE_ONESHOT_CUSTOM_SPELL_01);
|
|
||||||
DoCast(player, SPELL_REVIVE, true);
|
|
||||||
Talk(WHISPER_REVIVE, player);
|
|
||||||
}
|
|
||||||
FlyBackTimer = 5000;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
me->SetVisible(false);
|
|
||||||
FlyBackTimer = 3000;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
me->DisappearAndDie();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
//Nothing To DO
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
++phase;
|
|
||||||
}
|
|
||||||
else FlyBackTimer -= diff;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
void AddSC_the_scarlet_enclave()
|
|
||||||
{
|
|
||||||
new npc_valkyr_battle_maiden();
|
|
||||||
}
|
|
||||||
@@ -97,10 +97,6 @@ void AddSC_boss_majordomo();
|
|||||||
void AddSC_boss_ragnaros();
|
void AddSC_boss_ragnaros();
|
||||||
void AddSC_instance_molten_core();
|
void AddSC_instance_molten_core();
|
||||||
void AddSC_the_scarlet_enclave(); //Scarlet Enclave
|
void AddSC_the_scarlet_enclave(); //Scarlet Enclave
|
||||||
void AddSC_the_scarlet_enclave_c1();
|
|
||||||
void AddSC_the_scarlet_enclave_c2();
|
|
||||||
void AddSC_the_scarlet_enclave_c3();
|
|
||||||
void AddSC_the_scarlet_enclave_c5();
|
|
||||||
void AddSC_instance_scarlet_monastery(); //Scarlet Monastery
|
void AddSC_instance_scarlet_monastery(); //Scarlet Monastery
|
||||||
void AddSC_boss_kirtonos_the_herald();
|
void AddSC_boss_kirtonos_the_herald();
|
||||||
void AddSC_boss_darkmaster_gandling();
|
void AddSC_boss_darkmaster_gandling();
|
||||||
@@ -249,10 +245,6 @@ void AddEasternKingdomsScripts()
|
|||||||
AddSC_boss_ragnaros();
|
AddSC_boss_ragnaros();
|
||||||
AddSC_instance_molten_core();
|
AddSC_instance_molten_core();
|
||||||
AddSC_the_scarlet_enclave(); //Scarlet Enclave
|
AddSC_the_scarlet_enclave(); //Scarlet Enclave
|
||||||
AddSC_the_scarlet_enclave_c1();
|
|
||||||
AddSC_the_scarlet_enclave_c2();
|
|
||||||
AddSC_the_scarlet_enclave_c3();
|
|
||||||
AddSC_the_scarlet_enclave_c5();
|
|
||||||
AddSC_instance_scarlet_monastery(); //Scarlet Monastery
|
AddSC_instance_scarlet_monastery(); //Scarlet Monastery
|
||||||
AddSC_boss_kirtonos_the_herald();
|
AddSC_boss_kirtonos_the_herald();
|
||||||
AddSC_boss_darkmaster_gandling();
|
AddSC_boss_darkmaster_gandling();
|
||||||
|
|||||||
2945
src/server/scripts/EasternKingdoms/zone_the_scarlet_enclave.cpp
Normal file
2945
src/server/scripts/EasternKingdoms/zone_the_scarlet_enclave.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user