Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-07-29 15:40:17 +08:00
129 changed files with 3078 additions and 1132 deletions

View File

@@ -87,12 +87,18 @@ public:
ChatCommandTable GetCommands() const override
{
static ChatCommandTable auraCommandTable =
{
{ "stack", HandleAuraStacksCommand, SEC_GAMEMASTER, Console::No },
{ "", HandleAuraCommand, SEC_GAMEMASTER, Console::No }
};
static ChatCommandTable commandTable =
{
{ "commentator", HandleCommentatorCommand, SEC_MODERATOR, Console::No },
{ "dev", HandleDevCommand, SEC_ADMINISTRATOR, Console::No },
{ "gps", HandleGPSCommand, SEC_MODERATOR, Console::No },
{ "aura", HandleAuraCommand, SEC_GAMEMASTER, Console::No },
{ "aura", auraCommandTable },
{ "unaura", HandleUnAuraCommand, SEC_GAMEMASTER, Console::No },
{ "appear", HandleAppearCommand, SEC_MODERATOR, Console::No },
{ "summon", HandleSummonCommand, SEC_GAMEMASTER, Console::No },
@@ -129,7 +135,7 @@ public:
{ "cometome", HandleComeToMeCommand, SEC_ADMINISTRATOR, Console::No },
{ "damage", HandleDamageCommand, SEC_GAMEMASTER, Console::No },
{ "combatstop", HandleCombatStopCommand, SEC_GAMEMASTER, Console::Yes },
{ "flusharenapoints", HandleFlushArenaPointsCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "flusharenapoints", HandleFlushArenaPointsCommand, SEC_ADMINISTRATOR, Console::Yes },
{ "freeze", HandleFreezeCommand, SEC_GAMEMASTER, Console::No },
{ "unfreeze", HandleUnFreezeCommand, SEC_GAMEMASTER, Console::No },
{ "possess", HandlePossessCommand, SEC_GAMEMASTER, Console::No },
@@ -653,6 +659,51 @@ public:
return true;
}
static bool HandleAuraStacksCommand(ChatHandler* handler, SpellInfo const* spell, int16 stacks)
{
if (!spell)
{
handler->SendErrorMessage(LANG_COMMAND_NOSPELLFOUND);
return false;
}
if (!SpellMgr::IsSpellValid(spell))
{
handler->SendErrorMessage(LANG_COMMAND_SPELL_BROKEN, spell->Id);
return false;
}
if (!stacks)
{
handler->SendErrorMessage(LANG_COMMAND_AURASTACK_NO_STACK);
return false;
}
Unit* target = handler->getSelectedUnit();
if (!target)
{
handler->SendErrorMessage(LANG_SELECT_CHAR_OR_CREATURE);
return false;
}
Aura* aur = target->GetAura(spell->Id);
if (!aur)
{
handler->SendErrorMessage(LANG_COMMAND_AURASTACK_NO_AURA, spell->Id);
return false;
}
if (!spell->StackAmount)
{
handler->SendErrorMessage(LANG_COMMAND_AURASTACK_CANT_STACK, spell->Id);
return false;
}
aur->ModStackAmount(stacks);
return true;
}
static bool HandleUnAuraCommand(ChatHandler* handler, Variant<SpellInfo const*, std::string_view> spells)
{
Unit* target = handler->getSelectedUnit();

View File

@@ -279,7 +279,7 @@ public:
handler->PSendSysMessage("Connection peak: {}.", connPeak);
handler->PSendSysMessage(LANG_UPTIME, secsToTimeString(GameTime::GetUptime().count()));
handler->PSendSysMessage("Update time diff: {}ms. Last %d diffs summary:", sWorldUpdateTime.GetLastUpdateTime(), sWorldUpdateTime.GetDatasetSize());
handler->PSendSysMessage("Update time diff: {}ms. Last {} diffs summary:", sWorldUpdateTime.GetLastUpdateTime(), sWorldUpdateTime.GetDatasetSize());
handler->PSendSysMessage("|- Mean: {}ms", sWorldUpdateTime.GetAverageUpdateTime());
handler->PSendSysMessage("|- Median: {}ms", sWorldUpdateTime.GetPercentile(50));
handler->PSendSysMessage("|- Percentiles (95, 99, max): {}ms, {}ms, {}ms",

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "blackfathom_deeps.h"

View File

@@ -16,10 +16,10 @@
*/
#include "CreatureScript.h"
#include "GridNotifiers.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellAuras.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "hyjal.h"
@@ -145,32 +145,35 @@ struct npc_doomfire_spirit : public ScriptedAI
{
npc_doomfire_spirit(Creature* creature) : ScriptedAI(creature){ }
float const turnConstant = 0.785402f;
float fAngle = urand(0, M_PI * 2);
float const turnConstant = 0.785402f; // 45 degree turns, verified with sniffs
void Reset() override
{
scheduler.CancelAll();
ScheduleTimedEvent(0s, [&] {
float nextOrientation = Position::NormalizeOrientation(me->GetOrientation() + irand(-1, 1) * turnConstant);
Position pos = GetFirstRandomAngleCollisionPosition(8.f, nextOrientation); // both orientation and distance verified with sniffs
me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), nextOrientation);
}, 1600ms);
ScheduleUniqueTimedEvent(10ms, [&] {
TryTeleportInDirection(1.f, M_PI, 1.f, true); //turns around and teleports 1 unit on spawn, assuming same logic as later teleports applies
fAngle = urand(0, M_PI * 2);
ScheduleTimedEvent(10ms, [&] {
float angle = irand(-1, 1) * turnConstant;
TryTeleportInDirection(8.f, angle, 2.f, false);
}, 1600ms);
},1);
}
Position GetFirstRandomAngleCollisionPosition(float dist, float angle)
void TryTeleportInDirection(float dist, float angle, float step, bool alwaysturn)
{
Position pos;
for (uint32 i = 0; i < 10; ++i)
while (dist >= 0)
{
pos = me->WorldObject::GetFirstCollisionPosition(dist, angle);
if (me->GetDistance(pos) > dist * 0.8f) // if at least 80% distance, good enough
if (fabsf(dist - me->GetExactDist2d(pos)) < 0.001) // Account for small deviation
break;
angle += (M_PI / 5); // else try slightly different angle
dist -= step; // Distance drops with each unsuccessful attempt
}
return pos;
if (dist || alwaysturn)
me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), Position::NormalizeOrientation(me->GetOrientation() + angle));
else // Orientation does not change if not moving, verified with sniffs
me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), me->GetOrientation());
}
void UpdateAI(uint32 diff) override
@@ -268,10 +271,10 @@ struct boss_archimonde : public BossAI
Talk(SAY_AIR_BURST);
DoCastRandomTarget(SPELL_AIR_BURST);
}, 25s, 40s);
ScheduleTimedEvent(25s, 35s, [&]
ScheduleTimedEvent(8s, [&]
{
DoCastDoomFire();
}, 20s);
}, 8s);
ScheduleTimedEvent(25s, 35s, [&]
{
DoCastRandomTarget(SPELL_GRIP_OF_THE_LEGION);
@@ -400,7 +403,7 @@ struct boss_archimonde : public BossAI
float angle = 2 * M_PI * rand() / RAND_MAX;
float x = me->GetPositionX() + DOOMFIRE_OFFSET * cos(angle);
float y = me->GetPositionY() + DOOMFIRE_OFFSET * sin(angle);
Position spiritPosition = Position(x, y, me->GetPositionZ());
Position spiritPosition = Position(x, y, me->GetPositionZ(), Position::NormalizeOrientation(angle + M_PI)); //spirit faces archimonde on spawn
Position doomfirePosition = Position(x, y, me->GetPositionZ());
if (Creature* doomfireSpirit = me->SummonCreature(CREATURE_DOOMFIRE_SPIRIT, spiritPosition, TEMPSUMMON_TIMED_DESPAWN, 27000))
{

View File

@@ -16,6 +16,7 @@
*/
#include "CreatureScript.h"
#include "GridNotifiers.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"

View File

@@ -16,6 +16,7 @@
*/
#include "CreatureScript.h"
#include "GridNotifiers.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"

View File

@@ -19,7 +19,6 @@
#define DEF_HYJAL_H
#include "CreatureAIImpl.h"
#include "GridNotifiers.h"
#define DataHeader "HY"

View File

@@ -18,7 +18,6 @@
#include "Chat.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "Opcodes.h"
#include "Player.h"
#include "WorldPacket.h"
#include "hyjal.h"

View File

@@ -18,8 +18,10 @@
#include "the_black_morass.h"
#include "CreatureScript.h"
#include "MoveSplineInit.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
#include "SmartAI.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
enum medivhMisc

View File

@@ -19,8 +19,6 @@
#define DEF_THEBLACKMORASS_H
#include "CreatureAIImpl.h"
#include "PassiveAI.h"
#include "SpellScript.h"
#define DataHeader "TBM"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "maraudon.h"

View File

@@ -20,10 +20,16 @@
#include "CellImpl.h"
#include "CreatureScript.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
/// @todo: this import is not necessary for compilation and marked as unused by the IDE
// however, for some reasons removing it would cause a damn linking issue
// there is probably some underlying problem with imports which should properly addressed
// see: https://github.com/azerothcore/azerothcore-wotlk/issues/9766
#include "GridNotifiersImpl.h"
/*######
## npc_belnistrasz for Quest 3525 "Extinguishing the Idol"
######*/

View File

@@ -19,7 +19,6 @@
#define DEF_RAZORFEN_DOWNS_H
#include "CreatureAIImpl.h"
#include "PassiveAI.h"
#define DataHeader "RFD"

View File

@@ -19,7 +19,6 @@
#include "GameObjectAI.h"
#include "GameObjectScript.h"
#include "MiscPackets.h"
#include "Opcodes.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "wailing_caverns.h"

View File

@@ -20,8 +20,6 @@
#define DataHeader "WC"
#include "CreatureAI.h"
enum DataTypes
{
TYPE_LORD_COBRAHN = 0,

View File

@@ -16,10 +16,12 @@
*/
#include "CreatureScript.h"
#include "CellImpl.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "InstanceMapScript.h"
#include "InstanceScript.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "TemporarySummon.h"
#include "zulfarrak.h"

View File

@@ -17,6 +17,7 @@
#include "zulfarrak.h"
#include "Cell.h"
#include "CellImpl.h"
#include "CreatureScript.h"
#include "GameObject.h"
#include "GameObjectAI.h"
@@ -28,6 +29,13 @@
#include "ScriptSystem.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
/// @todo: this import is not necessary for compilation and marked as unused by the IDE
// however, for some reasons removing it would cause a damn linking issue
// there is probably some underlying problem with imports which should properly addressed
// see: https://github.com/azerothcore/azerothcore-wotlk/issues/9766
#include "GridNotifiersImpl.h"
/* ScriptData
SDName: Zulfarrak
SD%Complete: 50
@@ -40,8 +48,6 @@ npc_sergeant_bly
npc_weegli_blastfuse
EndContentData */
#include "GridNotifiersImpl.h"
/*######
## npc_sergeant_bly
######*/

View File

@@ -18,9 +18,7 @@
#ifndef DEF_ZULFARRACK_H
#define DEF_ZULFARRACK_H
#include "CellImpl.h"
#include "CreatureAIImpl.h"
#include "SpellScript.h"
#define DataHeader "ZF"

View File

@@ -31,7 +31,6 @@ EndContentData */
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellInfo.h"
/*####
# npc_rizzle_sprysprocket

View File

@@ -18,7 +18,6 @@
#include "CreatureScript.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"

View File

@@ -18,7 +18,6 @@
#include "Group.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
/* ScriptData

View File

@@ -31,7 +31,6 @@ npc_clintar_dreamwalker
EndContentData */
#include "Cell.h"
#include "CellImpl.h"
#include "CreatureScript.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"

View File

@@ -19,9 +19,6 @@
#define DEF_AZJOL_NERUB_H
#include "CreatureAIImpl.h"
#include "SpellAuraEffects.h"
#include "SpellAuras.h"
#include "SpellScript.h"
#define DataHeader "AN"

View File

@@ -19,6 +19,8 @@
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "azjol_nerub.h"
#include "SpellInfo.h"
#include "SpellScript.h"
enum Spells
{

View File

@@ -21,6 +21,8 @@
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "azjol_nerub.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
enum Spells
{

View File

@@ -21,6 +21,7 @@
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "azjol_nerub.h"
#include "SpellScript.h"
DoorData const doorData[] =
{

View File

@@ -18,10 +18,12 @@
#include "AreaTriggerScript.h"
#include "CreatureScript.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellScriptLoader.h"
#include "ruby_sanctum.h"
#include "SpellScript.h"
enum Texts
{
@@ -332,34 +334,28 @@ public:
}
};
class spell_baltharus_enervating_brand_trigger : public SpellScriptLoader
class spell_baltharus_enervating_brand_trigger : public SpellScript
{
public:
spell_baltharus_enervating_brand_trigger() : SpellScriptLoader("spell_baltharus_enervating_brand_trigger") { }
PrepareSpellScript(spell_baltharus_enervating_brand_trigger);
class spell_baltharus_enervating_brand_trigger_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_baltharus_enervating_brand_trigger_SpellScript);
return ValidateSpellInfo({ SPELL_SIPHONED_MIGHT });
}
void CheckDistance()
{
if (Unit* caster = GetOriginalCaster())
if (Unit* target = GetHitUnit())
if (target == GetCaster()
// the spell has an unlimited range, so we need this check
&& target->GetDistance2d(caster) <= 12.0f)
target->CastSpell(caster, SPELL_SIPHONED_MIGHT, true);
}
void Register() override
{
OnHit += SpellHitFn(spell_baltharus_enervating_brand_trigger_SpellScript::CheckDistance);
}
};
SpellScript* GetSpellScript() const override
void CheckDistance()
{
return new spell_baltharus_enervating_brand_trigger_SpellScript();
if (Unit* caster = GetOriginalCaster())
if (Unit* target = GetHitUnit())
if (target == GetCaster()
// the spell has an unlimited range, so we need this check
&& target->GetDistance2d(caster) <= 12.0f)
target->CastSpell(caster, SPELL_SIPHONED_MIGHT, true);
}
void Register() override
{
OnHit += SpellHitFn(spell_baltharus_enervating_brand_trigger::CheckDistance);
}
};
@@ -484,7 +480,7 @@ void AddSC_boss_baltharus_the_warborn()
{
new boss_baltharus_the_warborn();
new npc_baltharus_the_warborn_clone();
new spell_baltharus_enervating_brand_trigger();
RegisterSpellScript(spell_baltharus_enervating_brand_trigger);
new npc_xerestrasza();
new at_baltharus_plateau();
}

View File

@@ -19,6 +19,7 @@
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "ruby_sanctum.h"
#include "SpellScript.h"
enum Texts
{
@@ -184,65 +185,48 @@ public:
}
};
class spell_saviana_conflagration_init : public SpellScriptLoader
class spell_saviana_conflagration_init : public SpellScript
{
public:
spell_saviana_conflagration_init() : SpellScriptLoader("spell_saviana_conflagration_init") { }
PrepareSpellScript(spell_saviana_conflagration_init);
class spell_saviana_conflagration_init_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_saviana_conflagration_init_SpellScript);
return ValidateSpellInfo({ SPELL_FLAME_BEACON, SPELL_CONFLAGRATION_MISSLE });
}
void HandleDummy(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetCaster()->CastSpell(GetHitUnit(), SPELL_FLAME_BEACON, true);
GetCaster()->CastSpell(GetHitUnit(), SPELL_CONFLAGRATION_MISSLE, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_saviana_conflagration_init_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const override
void HandleDummy(SpellEffIndex effIndex)
{
return new spell_saviana_conflagration_init_SpellScript();
PreventHitDefaultEffect(effIndex);
GetCaster()->CastSpell(GetHitUnit(), SPELL_FLAME_BEACON, true);
GetCaster()->CastSpell(GetHitUnit(), SPELL_CONFLAGRATION_MISSLE, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_saviana_conflagration_init::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
class spell_saviana_conflagration_throwback : public SpellScriptLoader
class spell_saviana_conflagration_throwback : public SpellScript
{
public:
spell_saviana_conflagration_throwback() : SpellScriptLoader("spell_saviana_conflagration_throwback") { }
PrepareSpellScript(spell_saviana_conflagration_throwback);
class spell_saviana_conflagration_throwback_SpellScript : public SpellScript
void HandleScript(SpellEffIndex effIndex)
{
PrepareSpellScript(spell_saviana_conflagration_throwback_SpellScript);
PreventHitDefaultEffect(effIndex);
GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
}
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_saviana_conflagration_throwback_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const override
void Register() override
{
return new spell_saviana_conflagration_throwback_SpellScript();
OnEffectHitTarget += SpellEffectFn(spell_saviana_conflagration_throwback::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
void AddSC_boss_saviana_ragefire()
{
new boss_saviana_ragefire();
new spell_saviana_conflagration_init();
new spell_saviana_conflagration_throwback();
RegisterSpellScript(spell_saviana_conflagration_init);
RegisterSpellScript(spell_saviana_conflagration_throwback);
}

View File

@@ -23,6 +23,7 @@
#include "TemporarySummon.h"
#include "WorldPacket.h"
#include "ruby_sanctum.h"
#include "SpellScript.h"
BossBoundaryData const boundaries =
{
@@ -244,41 +245,35 @@ public:
}
};
class spell_ruby_sanctum_rallying_shout : public SpellScriptLoader
class spell_ruby_sanctum_rallying_shout : public SpellScript
{
public:
spell_ruby_sanctum_rallying_shout() : SpellScriptLoader("spell_ruby_sanctum_rallying_shout") { }
PrepareSpellScript(spell_ruby_sanctum_rallying_shout);
class spell_ruby_sanctum_rallying_shout_SpellScript : public SpellScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
PrepareSpellScript(spell_ruby_sanctum_rallying_shout_SpellScript);
return ValidateSpellInfo({ SPELL_RALLY });
}
void CountAllies()
{
uint32 count = GetSpell()->GetUniqueTargetInfo()->size();
if (count == GetCaster()->GetAuraCount(SPELL_RALLY))
return;
GetCaster()->RemoveAurasDueToSpell(SPELL_RALLY);
if (count > 0)
GetCaster()->CastCustomSpell(SPELL_RALLY, SPELLVALUE_AURA_STACK, count, GetCaster(), true);
}
void Register() override
{
AfterHit += SpellHitFn(spell_ruby_sanctum_rallying_shout_SpellScript::CountAllies);
}
};
SpellScript* GetSpellScript() const override
void CountAllies()
{
return new spell_ruby_sanctum_rallying_shout_SpellScript();
uint32 count = GetSpell()->GetUniqueTargetInfo()->size();
if (count == GetCaster()->GetAuraCount(SPELL_RALLY))
return;
GetCaster()->RemoveAurasDueToSpell(SPELL_RALLY);
if (count > 0)
GetCaster()->CastCustomSpell(SPELL_RALLY, SPELLVALUE_AURA_STACK, count, GetCaster(), true);
}
void Register() override
{
AfterHit += SpellHitFn(spell_ruby_sanctum_rallying_shout::CountAllies);
}
};
void AddSC_instance_ruby_sanctum()
{
new instance_ruby_sanctum();
new spell_ruby_sanctum_rallying_shout();
RegisterSpellScript(spell_ruby_sanctum_rallying_shout);
}

View File

@@ -18,14 +18,7 @@
#ifndef RUBY_SANCTUM_H_
#define RUBY_SANCTUM_H_
#include "Creature.h"
#include "CreatureAIImpl.h"
#include "GameObjectAI.h"
#include "Map.h"
#include "Opcodes.h"
#include "PassiveAI.h"
#include "Player.h"
#include "SpellScript.h"
#define DataHeader "RS"

View File

@@ -15,6 +15,7 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CombatAI.h"
#include "CreatureScript.h"
#include "PassiveAI.h"
#include "Player.h"

View File

@@ -18,7 +18,6 @@
#ifndef DEF_TOC_H
#define DEF_TOC_H
#include "CombatAI.h"
#include "CreatureAIImpl.h"
#define DataHeader "TC"

View File

@@ -19,6 +19,7 @@
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "trial_of_the_crusader.h"

View File

@@ -20,7 +20,6 @@
#include "CreatureAIImpl.h"
#include "GridNotifiers.h"
#include "SpellAuraEffects.h"
#define DataHeader "TCR"

View File

@@ -20,6 +20,7 @@
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "drak_tharon_keep.h"
#include "SpellScript.h"
enum Yells
{

View File

@@ -19,6 +19,7 @@
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "drak_tharon_keep.h"
#include "SpellScript.h"
enum Yells
{

View File

@@ -21,6 +21,8 @@
#include "SpellAuras.h"
#include "SpellScriptLoader.h"
#include "drak_tharon_keep.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
enum Yells
{

View File

@@ -19,8 +19,6 @@
#define DEF_DRAK_THARON_H
#include "CreatureAIImpl.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
#define DataHeader "DTK"

View File

@@ -20,6 +20,7 @@
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "drak_tharon_keep.h"
#include "SpellScript.h"
DoorData const doorData[] =
{

View File

@@ -17,6 +17,7 @@
#include "CreatureScript.h"
#include "halls_of_reflection.h"
#include "ScriptedCreature.h"
enum Yells
{

View File

@@ -18,6 +18,9 @@
#include "CreatureScript.h"
#include "SpellScriptLoader.h"
#include "halls_of_reflection.h"
#include "ScriptedCreature.h"
#include "SpellAuraEffects.h"
#include "SpellScript.h"
enum Yells
{

View File

@@ -18,7 +18,12 @@
#include "halls_of_reflection.h"
#include "AreaTriggerScript.h"
#include "CreatureScript.h"
#include "InstanceScript.h"
#include "MotionMaster.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
enum Events

View File

@@ -19,14 +19,7 @@
#define DEF_HALLS_OF_REFLECTION_H
#include "CreatureAIImpl.h"
#include "CreatureScript.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellAuraEffects.h"
#include "SpellAuras.h"
#include "SpellScript.h"
#define DataHeader "HOR"

View File

@@ -19,6 +19,7 @@
#include "MapMgr.h"
#include "Transport.h"
#include "halls_of_reflection.h"
#include "InstanceScript.h"
class UtherBatteredHiltEvent : public BasicEvent
{

View File

@@ -17,7 +17,6 @@
#include "CreatureGroups.h"
#include "CreatureScript.h"
#include "Opcodes.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellAuras.h"

View File

@@ -16,7 +16,6 @@
*/
#include "CreatureScript.h"
#include "Opcodes.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"

View File

@@ -19,6 +19,7 @@
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "gundrak.h"
#include "SpellScript.h"
enum Spells
{

View File

@@ -20,6 +20,7 @@
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "gundrak.h"
#include "SpellScript.h"
enum Spells
{

View File

@@ -20,6 +20,8 @@
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "gundrak.h"
#include "SpellInfo.h"
#include "SpellScript.h"
enum eSpells
{

View File

@@ -20,6 +20,7 @@
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "gundrak.h"
#include "SpellScript.h"
enum Spells
{

View File

@@ -19,7 +19,6 @@
#define DEF_GUNDRAK_H
#include "CreatureAIImpl.h"
#include "SpellScript.h"
#define DataHeader "GD"

View File

@@ -16,7 +16,6 @@
*/
#include "icecrown_citadel.h"
#include "AccountMgr.h"
#include "AreaTriggerScript.h"
#include "Cell.h"
#include "CellImpl.h"

View File

@@ -28,8 +28,6 @@
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "SpellAuraEffects.h"
#include "SpellAuras.h"
#include "SpellMgr.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"

View File

@@ -19,6 +19,7 @@
#include "CreatureScript.h"
#include "ScriptedCreature.h"
#include "naxxramas.h"
#include "SpellInfo.h"
using namespace Razuvious;

View File

@@ -19,7 +19,6 @@
#define DEF_NAXXRAMAS_H
#include "CreatureAIImpl.h"
#include "SpellScript.h"
#define DataHeader "NAX"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "Player.h"
#include "ScriptedCreature.h"

View File

@@ -18,8 +18,10 @@
#include "AchievementCriteriaScript.h"
#include "CreatureScript.h"
#include "MapReference.h"
#include "ScriptedCreature.h"
#include "nexus.h"
#include "Player.h"
enum eEnums
{

View File

@@ -17,9 +17,13 @@
#include "AchievementCriteriaScript.h"
#include "CreatureScript.h"
#include "GameEventMgr.h"
#include "GridNotifiers.h"
#include "ScriptedCreature.h"
#include "SpellScriptLoader.h"
#include "nexus.h"
#include "SpellInfo.h"
#include "SpellScript.h"
enum Spells
{

View File

@@ -18,6 +18,7 @@
#include "CreatureScript.h"
#include "ScriptedCreature.h"
#include "nexus.h"
#include "PassiveAI.h"
enum eEnums
{

View File

@@ -19,6 +19,7 @@
#include "InstanceMapScript.h"
#include "ScriptedCreature.h"
#include "nexus.h"
#include "Player.h"
DoorData const doorData[] =
{

View File

@@ -19,12 +19,6 @@
#define DEF_NEXUS_H
#include "CreatureAIImpl.h"
#include "GameEventMgr.h"
#include "GridNotifiers.h"
#include "PassiveAI.h"
#include "Player.h"
#include "SpellAuras.h"
#include "SpellScript.h"
#define DataHeader "NEX"

View File

@@ -18,6 +18,7 @@
#include "CreatureScript.h"
#include "ScriptedCreature.h"
#include "oculus.h"
#include "SpellAuras.h"
enum Spells
{

View File

@@ -19,8 +19,6 @@
#define DEF_OCULUS_H
#include "CreatureAIImpl.h"
#include "SpellAuraEffects.h"
#include "SpellAuras.h"
#include "SpellScript.h"
#define DataHeader "OC"

View File

@@ -16,11 +16,11 @@
*/
#include "AchievementCriteriaScript.h"
#include "CellImpl.h"
#include "CombatAI.h"
#include "CreatureScript.h"
#include "GameObjectScript.h"
#include "GridNotifiers.h"
#include "Opcodes.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
@@ -33,6 +33,12 @@
#include "Vehicle.h"
#include "ulduar.h"
/// @todo: this import is not necessary for compilation and marked as unused by the IDE
// however, for some reasons removing it would cause a damn linking issue
// there is probably some underlying problem with imports which should properly addressed
// see: https://github.com/azerothcore/azerothcore-wotlk/issues/9766
#include "GridNotifiersImpl.h"
enum LeviathanSpells
{
// Leviathan basic

View File

@@ -19,7 +19,6 @@
#include "CreatureAI.h"
#include "CreatureScript.h"
#include "Object.h"
#include "Opcodes.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"

View File

@@ -19,7 +19,6 @@
#include "AreaTriggerScript.h"
#include "CombatAI.h"
#include "CreatureScript.h"
#include "GameObjectScript.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"

View File

@@ -18,11 +18,8 @@
#ifndef DEF_ULDUAR_H
#define DEF_ULDUAR_H
#include "CellImpl.h"
#include "Chat.h"
#include "CreatureAIImpl.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#define DataHeader "UU"

View File

@@ -15,7 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CreatureScript.h"
#include "InstanceMapScript.h"
#include "Player.h"
#include "ScriptedCreature.h"

View File

@@ -19,6 +19,7 @@
#include "CreatureScript.h"
#include "GameObjectAI.h"
#include "ScriptedCreature.h"
#include "SpellScript.h"
#include "SpellScriptLoader.h"
#include "Vehicle.h"

View File

@@ -19,7 +19,6 @@
#define DEF_UTGARDE_KEEP_H
#include "CreatureAIImpl.h"
#include "SpellScript.h"
#define UtgardeKeepScriptName "instance_utgarde_keep"

View File

@@ -19,7 +19,6 @@
#define DEF_PINNACLE_H
#include "CreatureAIImpl.h"
#include "Opcodes.h"
#define DataHeader "UP"

View File

@@ -17,7 +17,6 @@
#include "Battlefield.h"
#include "BattlefieldMgr.h"
#include "CreatureScript.h"
#include "GameTime.h"
#include "InstanceMapScript.h"
#include "Player.h"

View File

@@ -24,76 +24,139 @@ enum Supremus
EMOTE_NEW_TARGET = 0,
EMOTE_PUNCH_GROUND = 1,
EMOTE_GROUND_CRACK = 2,
EMOTE_BERSERK = 3,
SPELL_SNARE_SELF = 41922,
SPELL_MOLTEN_PUNCH = 40126,
SPELL_MOLTEN_FLAME = 40980,
SPELL_HATEFUL_STRIKE = 41926,
SPELL_VOLCANIC_ERUPTION = 40276,
SPELL_VOLCANIC_ERUPTION_TRIGGER = 40117,
SPELL_BERSERK = 45078,
SPELL_VOLCANIC_GEYSER = 42055,
SPELL_BERSERK = 26662,
SPELL_CHARGE = 41581,
NPC_SUPREMUS_PUNCH_STALKER = 23095,
SPELL_SERVERSIDE_RANDOM_TARGET = 41951, // Found in 55261. Used for Fixate target
EVENT_SPELL_BERSERK = 1,
EVENT_SPELL_HATEFUL_STRIKE = 2,
EVENT_SPELL_MOLTEN_FLAMES = 3,
EVENT_SWITCH_PHASE = 4,
EVENT_SPELL_VOLCANIC_ERUPTION = 5,
EVENT_SWITCH_TARGET = 6,
EVENT_CHECK_DIST = 7,
NPC_SUPREMUS_VOLCANO = 23085,
EVENT_GROUP_ABILITIES = 1
GROUP_ABILITIES = 1,
GROUP_MOLTEN_PUNCH = 2,
GROUP_PHASE_CHANGE = 3
};
struct boss_supremus : public BossAI
{
boss_supremus(Creature* creature) : BossAI(creature, DATA_SUPREMUS) { }
boss_supremus(Creature* creature) : BossAI(creature, DATA_SUPREMUS)
{
scheduler.SetValidator([this]
{
return !me->HasUnitState(UNIT_STATE_CASTING);
});
}
void Reset() override
{
BossAI::Reset();
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, false);
}
void JustEngagedWith(Unit* who) override
{
BossAI::JustEngagedWith(who);
SchedulePhase(false);
events.ScheduleEvent(EVENT_SPELL_BERSERK, 900000);
events.ScheduleEvent(EVENT_SPELL_MOLTEN_FLAMES, 4000);
SchedulePhase(true);
ScheduleTimedEvent(15min, [&]
{
DoCastSelf(SPELL_BERSERK, true);
Talk(EMOTE_BERSERK);
scheduler.CancelGroup(GROUP_ABILITIES); // Supremus stops all other abilities after berserking
scheduler.CancelGroup(GROUP_MOLTEN_PUNCH);
scheduler.CancelGroup(GROUP_PHASE_CHANGE);
}, 5min);
scheduler.Schedule(20s, [this](TaskContext context)
{
context.SetGroup(GROUP_MOLTEN_PUNCH);
DoCastSelf(SPELL_MOLTEN_PUNCH);
context.Repeat(15s, 20s);
});
}
void SchedulePhase(bool run)
void SchedulePhase(bool isSnared)
{
events.CancelEventGroup(EVENT_GROUP_ABILITIES);
events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000);
scheduler.CancelGroup(GROUP_ABILITIES);
scheduler.Schedule(1min, [this](TaskContext context)
{
context.SetGroup(GROUP_PHASE_CHANGE);
SchedulePhase(me->HasAura(SPELL_SNARE_SELF));
});
DoResetThreatList();
if (!run)
// Hateful Strike Phase
if (isSnared)
{
events.ScheduleEvent(EVENT_SPELL_HATEFUL_STRIKE, 5000, EVENT_GROUP_ABILITIES);
scheduler.Schedule(8s, 15s, [this](TaskContext context)
{
context.SetGroup(GROUP_ABILITIES);
if (Unit* target = FindHatefulStrikeTarget())
DoCast(target, SPELL_HATEFUL_STRIKE);
context.Repeat(1500ms, 15s);
});
if (me->HasAura(SPELL_SNARE_SELF))
Talk(EMOTE_PUNCH_GROUND);
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, false);
me->RemoveAurasDueToSpell(SPELL_SNARE_SELF);
}
// Gaze Phase
else
{
events.ScheduleEvent(EVENT_SPELL_VOLCANIC_ERUPTION, 5000, EVENT_GROUP_ABILITIES);
events.ScheduleEvent(EVENT_SWITCH_TARGET, 0, EVENT_GROUP_ABILITIES);
events.ScheduleEvent(EVENT_CHECK_DIST, 0, EVENT_GROUP_ABILITIES);
DoCastSelf(SPELL_SNARE_SELF, true);
scheduler.Schedule(5s, [this](TaskContext context)
{
context.SetGroup(GROUP_ABILITIES);
if (DoCastRandomTarget(SPELL_VOLCANIC_ERUPTION, 0, 100.f, true) == SPELL_CAST_OK)
Talk(EMOTE_GROUND_CRACK);
context.Repeat(10s, 18s);
}).Schedule(0s, [this](TaskContext context)
{
context.SetGroup(GROUP_ABILITIES);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
{
DoResetThreatList();
me->AddThreat(target, 5000000.0f);
Talk(EMOTE_NEW_TARGET);
DoCastVictim(SPELL_CHARGE);
}
context.Repeat(10s);
});
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
me->CastSpell(me, SPELL_SNARE_SELF, true);
}
}
void JustSummoned(Creature* summon) override
{
summons.Summon(summon);
if (summon->GetEntry() == NPC_SUPREMUS_PUNCH_STALKER)
{
summon->ToTempSummon()->InitStats(20000);
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
summon->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f, MOTION_SLOT_CONTROLLED);
}
else
if (summon->GetEntry() == NPC_SUPREMUS_VOLCANO)
summon->CastSpell(summon, SPELL_VOLCANIC_ERUPTION_TRIGGER, true);
else
summon->ToTempSummon()->InitStats(30000);
}
void SummonedCreatureDespawn(Creature* summon) override
@@ -116,71 +179,42 @@ struct boss_supremus : public BossAI
return target;
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
switch (events.ExecuteEvent())
{
case EVENT_SPELL_BERSERK:
me->CastSpell(me, SPELL_BERSERK, true);
break;
case EVENT_SPELL_HATEFUL_STRIKE:
if (Unit* target = FindHatefulStrikeTarget())
me->CastSpell(target, SPELL_HATEFUL_STRIKE, false);
events.ScheduleEvent(EVENT_SPELL_HATEFUL_STRIKE, urand(1500, 3000), EVENT_GROUP_ABILITIES);
break;
case EVENT_SPELL_MOLTEN_FLAMES:
me->CastSpell(me, SPELL_MOLTEN_PUNCH, false);
events.ScheduleEvent(EVENT_SPELL_MOLTEN_FLAMES, 20000, EVENT_GROUP_ABILITIES);
break;
case EVENT_SWITCH_PHASE:
SchedulePhase(!me->HasAura(SPELL_SNARE_SELF));
break;
case EVENT_SWITCH_TARGET:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
{
DoResetThreatList();
me->AddThreat(target, 5000000.0f);
Talk(EMOTE_NEW_TARGET);
}
events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, EVENT_GROUP_ABILITIES);
break;
case EVENT_CHECK_DIST:
if (me->GetDistance(me->GetVictim()) > 40.0f)
{
Talk(EMOTE_PUNCH_GROUND);
me->CastSpell(me->GetVictim(), SPELL_CHARGE, true);
events.ScheduleEvent(EVENT_CHECK_DIST, 5000, EVENT_GROUP_ABILITIES);
break;
}
events.ScheduleEvent(EVENT_CHECK_DIST, 1, EVENT_GROUP_ABILITIES);
break;
case EVENT_SPELL_VOLCANIC_ERUPTION:
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100, true))
{
me->CastSpell(target, SPELL_VOLCANIC_ERUPTION, true);
Talk(EMOTE_GROUND_CRACK);
}
events.ScheduleEvent(EVENT_SPELL_VOLCANIC_ERUPTION, urand(10000, 18000), EVENT_GROUP_ABILITIES);
break;
}
DoMeleeAttackIfReady();
}
bool CheckEvadeIfOutOfCombatArea() const override
{
return me->GetPositionX() < 565 || me->GetPositionX() > 865 || me->GetPositionY() < 545 || me->GetPositionY() > 1000;
}
};
struct npc_supremus_punch_invisible_stalker : public ScriptedAI
{
npc_supremus_punch_invisible_stalker(Creature* creature) : ScriptedAI(creature) { }
void IsSummonedBy(WorldObject* /*summoner*/) override
{
me->SetInCombatWithZone();
if (Unit* target = SelectTarget(SelectTargetMethod::Random, 0, 100.0f, true))
me->AddThreat(target, 10000.f);
DoCastSelf(SPELL_MOLTEN_FLAME, true);
scheduler.Schedule(6s, 10s, [this](TaskContext /*context*/)
{
me->CombatStop();
me->SetReactState(REACT_PASSIVE);
});
}
void UpdateAI(uint32 diff) override
{
scheduler.Update(diff);
if (!UpdateVictim())
return;
}
};
void AddSC_boss_supremus()
{
RegisterBlackTempleCreatureAI(npc_supremus_punch_invisible_stalker);
RegisterBlackTempleCreatureAI(boss_supremus);
}

View File

@@ -140,7 +140,11 @@ struct boss_lady_vashj : public BossAI
{
summon->GetMotionMaster()->MoveRandom(30.0f);
}
else if (summon->GetEntry() != NPC_TAINTED_ELEMENTAL && summon->GetEntry() != NPC_ENCHANTED_ELEMENTAL)
else if (summon->GetEntry() == NPC_ENCHANTED_ELEMENTAL)
{
summon->GetMotionMaster()->MoveFollow(me, 0.0f, 0.0f);
}
else if (summon->GetEntry() != NPC_TAINTED_ELEMENTAL)
{
summon->GetMotionMaster()->MovePoint(POINT_HOME, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), true, true);
}

View File

@@ -1818,6 +1818,418 @@ public:
}
};
/*
######
# Dragonmaw Races
######
*/
enum DragonmawRaces
{
QUEST_MUCKJAW = 11064,
QUEST_TROPE = 11067,
QUEST_CORLOK = 11068,
QUEST_ICHMAN = 11069,
QUEST_MULVERICK = 11070,
QUEST_SKYSHATTER = 11071,
NPC_MUCKJAW = 23340,
NPC_TROPE = 23342,
NPC_CORLOK = 23344,
NPC_ICHMAN = 23345,
NPC_MULVERICK = 23346,
NPC_SKYSHATTER = 23348,
PATH_MUCKJAW = 233401,
PATH_TROPE = 233421,
PATH_CORLOK = 233441,
PATH_ICHMAN = 233451,
PATH_MULVERICK = 233461,
PATH_SKYSHATTER = 233481,
NPC_TARGET_MUCKJAW = 23356,
NPC_TARGET_TROPE = 23357,
NPC_TARGET_CORLOK = 23358,
NPC_TARGET_ICHMAN = 23359,
NPC_TARGET_MULVERICK = 23360,
NPC_TARGET_SKYSHATTER = 23361,
SAY_START = 0,
SAY_COMPLETE = 1,
SAY_SKYSHATTER_SPECIAL = 2,
};
struct dragonmaw_race_npc : public ScriptedAI
{
dragonmaw_race_npc(Creature* creature) : ScriptedAI(creature)
{
_player = nullptr;
}
void Reset() override
{
scheduler.CancelAll();
me->SetNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
me->SetWalk(true);
me->SetDisableGravity(false);
me->GetMotionMaster()->MoveIdle();
}
void sQuestAccept(Player* player, Quest const* /*quest*/) override
{
_player = player;
me->RemoveNpcFlag(UNIT_NPC_FLAG_QUESTGIVER);
if (_player)
Talk(SAY_START, _player);
switch (me->GetEntry())
{
case NPC_MUCKJAW:
me->GetMotionMaster()->MovePath(PATH_MUCKJAW, false);
break;
case NPC_TROPE:
me->GetMotionMaster()->MovePath(PATH_TROPE, false);
break;
case NPC_CORLOK:
me->GetMotionMaster()->MovePath(PATH_CORLOK, false);
break;
case NPC_ICHMAN:
me->GetMotionMaster()->MovePath(PATH_ICHMAN, false);
break;
case NPC_MULVERICK:
me->GetMotionMaster()->MovePath(PATH_MULVERICK, false);
break;
case NPC_SKYSHATTER:
me->GetMotionMaster()->MovePath(PATH_SKYSHATTER, false);
break;
default:
break;
}
}
void TakeOff()
{
me->SetDisableGravity(true);
}
void StartRace()
{
me->SetWalk(false);
ScheduleTimedEvent(5s, [&]
{
if (!_player)
FailQuest();
else if (!me->IsWithinDist(_player, 100.f))
FailQuest();
}, 5s);
}
void FailQuest()
{
if (_player)
{
switch (me->GetEntry())
{
case NPC_MUCKJAW:
_player->FailQuest(QUEST_MUCKJAW);
break;
case NPC_TROPE:
_player->FailQuest(QUEST_TROPE);
break;
case NPC_CORLOK:
_player->FailQuest(QUEST_CORLOK);
break;
case NPC_ICHMAN:
_player->FailQuest(QUEST_ICHMAN);
break;
case NPC_MULVERICK:
_player->FailQuest(QUEST_MULVERICK);
break;
case NPC_SKYSHATTER:
_player->FailQuest(QUEST_SKYSHATTER);
break;
default:
break;
}
}
scheduler.CancelAll();
me->DespawnOnEvade();
}
void StartRaceAttacks()
{
/*
* Timers are placeholders
* After spawned, the rest is done via SmartAI
*/
if (!_player)
return;
switch (me->GetEntry())
{
case NPC_MUCKJAW:
ScheduleTimedEvent(4s, [&]
{
if (_player)
{
Position summonPos;
summonPos = me->GetRandomPoint(_player->GetPosition(), 15.f);
summonPos.m_positionZ = _player->GetPositionZ(); // So they don't spawn at ground height
me->SummonCreature(NPC_TARGET_MUCKJAW, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
}
else
return;
}, 4s, 8s);
break;
case NPC_TROPE:
ScheduleTimedEvent(4s, [&]
{
if (_player)
{
Position summonPos;
summonPos = me->GetRandomPoint(_player->GetPosition(), 10.f);
summonPos.m_positionZ = _player->GetPositionZ();
me->SummonCreature(NPC_TARGET_TROPE, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
}
else
return;
}, 1s, 3s);
break;
case NPC_CORLOK:
ScheduleTimedEvent(4s, [&]
{
if (_player)
{
Position summonPos;
summonPos = me->GetRandomPoint(_player->GetPosition(), 10.f);
summonPos.m_positionZ = _player->GetPositionZ();
me->SummonCreature(NPC_TARGET_CORLOK, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
}
else
return;
}, 1s, 3s);
break;
case NPC_ICHMAN:
ScheduleTimedEvent(4s, [&]
{
if (_player)
{
Position summonPos;
summonPos = me->GetRandomPoint(_player->GetPosition(), 10.f);
summonPos.m_positionZ = _player->GetPositionZ();
me->SummonCreature(NPC_TARGET_ICHMAN, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
}
else
return;
}, 1s, 3s);
break;
case NPC_MULVERICK:
ScheduleTimedEvent(4s, [&]
{
if (_player)
{
Position summonPos;
summonPos = me->GetRandomPoint(_player->GetPosition(), 10.f);
summonPos.m_positionZ = _player->GetPositionZ();
me->SummonCreature(NPC_TARGET_MULVERICK, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
}
else
return;
}, 1s, 3s);
break;
case NPC_SKYSHATTER:
ScheduleTimedEvent(4s, [&]
{
if (_player)
{
Position summonPos;
summonPos = me->GetRandomPoint(_player->GetPosition(), 7.f);
summonPos.m_positionZ = _player->GetPositionZ(); // So they don't spawn at ground height
me->SummonCreature(NPC_TARGET_SKYSHATTER, summonPos, TEMPSUMMON_TIMED_DESPAWN, 10000);
}
else
return;
}, 1s, 3s);
break;
default:
break;
}
}
void FinishRace()
{
scheduler.CancelAll();
me->SetHover(false);
me->SetDisableGravity(false);
me->SetWalk(true);
if (_player)
{
Talk(SAY_COMPLETE, _player);
switch (me->GetEntry())
{
case NPC_MUCKJAW:
_player->AreaExploredOrEventHappens(QUEST_MUCKJAW);
break;
case NPC_TROPE:
_player->AreaExploredOrEventHappens(QUEST_TROPE);
break;
case NPC_CORLOK:
_player->AreaExploredOrEventHappens(QUEST_CORLOK);
break;
case NPC_ICHMAN:
_player->AreaExploredOrEventHappens(QUEST_ICHMAN);
break;
case NPC_MULVERICK:
_player->AreaExploredOrEventHappens(QUEST_MULVERICK);
break;
case NPC_SKYSHATTER:
_player->AreaExploredOrEventHappens(QUEST_SKYSHATTER);
break;
default:
break;
}
}
}
void MovementInform(uint32 /*type*/, uint32 id) override
{
switch (me->GetEntry())
{
case NPC_MUCKJAW:
switch (id)
{
case 4:
TakeOff();
break;
case 7:
StartRace();
break;
case 9:
StartRaceAttacks();
break;
case 35:
FinishRace();
break;
case 37:
Reset();
break;
}
break;
case NPC_TROPE:
switch (id)
{
case 5:
TakeOff();
break;
case 7:
StartRace();
break;
case 10:
StartRaceAttacks();
break;
case 53:
FinishRace();
break;
case 60:
Reset();
break;
}
break;
case NPC_CORLOK:
switch (id)
{
case 6:
TakeOff();
break;
case 9:
StartRace();
break;
case 12:
StartRaceAttacks();
break;
case 79:
FinishRace();
break;
case 89:
Reset();
break;
}
break;
case NPC_ICHMAN:
switch (id)
{
case 4:
TakeOff();
StartRace();
break;
case 12:
StartRaceAttacks();
break;
case 107:
FinishRace();
break;
case 111:
Reset();
break;
}
break;
case NPC_MULVERICK:
switch (id)
{
case 5:
TakeOff();
break;
case 9:
StartRace();
break;
case 12:
StartRaceAttacks();
break;
case 166:
FinishRace();
break;
case 172:
Reset();
break;
}
break;
case NPC_SKYSHATTER:
switch (id)
{
case 3:
TakeOff();
break;
case 7:
StartRace();
if (_player)
Talk(SAY_SKYSHATTER_SPECIAL, _player);
break;
case 10:
StartRaceAttacks();
break;
case 140:
FinishRace();
break;
case 145:
Reset();
break;
}
break;
default:
break;
}
}
void UpdateAI(uint32 diff) override
{
scheduler.Update(diff);
}
private:
Player* _player;
};
void AddSC_shadowmoon_valley()
{
// Ours
@@ -1825,6 +2237,7 @@ void AddSC_shadowmoon_valley()
RegisterSpellScript(spell_q10563_q10596_to_legion_hold_aura);
// Theirs
RegisterCreatureAI(dragonmaw_race_npc);
new npc_invis_infernal_caster();
new npc_infernal_attacker();
new npc_mature_netherwing_drake();

View File

@@ -436,68 +436,24 @@ enum q11520Roots
SPELL_SUMMON_RAZORTHORN_ROOT = 44941,
};
class spell_q11520_discovering_your_roots : public SpellScript
{
PrepareSpellScript(spell_q11520_discovering_your_roots);
void HandleDummy(SpellEffIndex /*effIndex*/)
{
if (GameObject* go = GetCaster()->FindNearestGameObject(GO_RAZORTHORN_DIRT_MOUNT, 20.0f))
{
GetCaster()->GetMotionMaster()->MovePoint(0, *go);
go->SetLootState(GO_JUST_DEACTIVATED);
GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_RAZORTHORN_ROOT, true);
}
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_q11520_discovering_your_roots::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
class spell_quest_dragonmaw_race_generic : public SpellScript
class spell_q11520_discovering_your_roots : public SpellScript
{
PrepareSpellScript(spell_quest_dragonmaw_race_generic);
PrepareSpellScript(spell_q11520_discovering_your_roots);
bool Load() override
void HandleDummy(SpellEffIndex /*effIndex*/)
{
_x = _y = _z = 0.0f;
return true;
}
SpellCastResult RelocateDest()
{
Unit* caster = GetCaster();
float o = Position::NormalizeOrientation(caster->GetOrientation() + frand(0.0f, 2 * M_PI));
float dist = frand(5.0f, 30.0f);
_x = caster->GetPositionX() + dist * cos(o);
_y = caster->GetPositionY() + dist * std::sin(o);
_z = caster->GetPositionZ() + frand(-10.0f, 15.0f);
GetSpell()->m_targets.SetDst(_x, _y, _z, 0.0f, caster->GetMapId());
return SPELL_CAST_OK;
}
void ChangeDest(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
Unit* caster = GetCaster();
if (Creature* trigger = caster->SummonCreature(23356, _x, _y, _z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1500))
if (GameObject* go = GetCaster()->FindNearestGameObject(GO_RAZORTHORN_DIRT_MOUNT, 20.0f))
{
trigger->CastSpell(trigger, GetSpellInfo()->Effects[effIndex].TriggerSpell, true);
if (GetSpellInfo()->Effects[effIndex].TriggerSpell == 41064)
trigger->CastSpell(trigger, 41284, true);
GetCaster()->GetMotionMaster()->MovePoint(0, *go);
go->SetLootState(GO_JUST_DEACTIVATED);
GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_RAZORTHORN_ROOT, true);
}
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_quest_dragonmaw_race_generic::RelocateDest);
OnEffectHit += SpellEffectFn(spell_quest_dragonmaw_race_generic::ChangeDest, EFFECT_0, SPELL_EFFECT_TRIGGER_MISSILE);
OnEffectHitTarget += SpellEffectFn(spell_q11520_discovering_your_roots::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
private:
float _x, _y, _z;
};
class spell_q11670_it_was_the_orcs_honest : public SpellScript
@@ -2508,7 +2464,6 @@ void AddSC_quest_spell_scripts()
RegisterSpellScript(spell_q12943_shadow_vault_decree);
RegisterSpellAndAuraScriptPair(spell_q10769_dissension_amongst_the_ranks, spell_q10769_dissension_amongst_the_ranks_aura);
RegisterSpellScript(spell_q11520_discovering_your_roots);
RegisterSpellScript(spell_quest_dragonmaw_race_generic);
RegisterSpellScript(spell_q11670_it_was_the_orcs_honest);
RegisterSpellScript(spell_quest_test_flight_charging);
RegisterSpellScript(spell_q12274_a_fall_from_grace_costume);