Merge branch 'master' into Playerbot_20250219
This commit is contained in:
@@ -47,6 +47,7 @@ EndScriptData */
|
||||
#include "Tokenize.h"
|
||||
#include "WardenCheckMgr.h"
|
||||
#include "WaypointMgr.h"
|
||||
#include "WorldGlobals.h"
|
||||
|
||||
using namespace Acore::ChatCommands;
|
||||
|
||||
@@ -73,6 +74,7 @@ public:
|
||||
};
|
||||
static ChatCommandTable reloadCommandTable =
|
||||
{
|
||||
{ "antidos_opcode_policies", HandleReloadAntiDosOpcodePoliciesCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "auctions", HandleReloadAuctionsCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "dungeon_access_template", HandleReloadDungeonAccessCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
{ "dungeon_access_requirements", HandleReloadDungeonAccessCommand, SEC_ADMINISTRATOR, Console::Yes },
|
||||
@@ -1199,6 +1201,14 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAntiDosOpcodePoliciesCommand(ChatHandler* handler)
|
||||
{
|
||||
LOG_INFO("server.loading", "Reloading AntiDos opcode policies...");
|
||||
sWorldGlobals->LoadAntiDosOpcodePolicies();
|
||||
handler->SendGlobalGMSysMessage("AntiDos opcode policies reloaded.");
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleReloadAuctionsCommand(ChatHandler* handler)
|
||||
{
|
||||
///- Reload dynamic data tables from the database
|
||||
|
||||
@@ -377,6 +377,35 @@ class spell_eredar_twins_blaze : public SpellScript
|
||||
}
|
||||
};
|
||||
|
||||
class spell_eredar_twins_handle_touch_periodic : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_eredar_twins_handle_touch_periodic);
|
||||
|
||||
public:
|
||||
spell_eredar_twins_handle_touch_periodic(uint32 touchSpell, uint8 effIndex, uint8 aura) : AuraScript(), _touchSpell(touchSpell), _effectIndex(effIndex), _aura(aura) {}
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ _touchSpell });
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* owner = GetOwner()->ToUnit())
|
||||
owner->CastSpell(owner, _touchSpell, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_eredar_twins_handle_touch_periodic::OnPeriodic, _effectIndex, _aura);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _touchSpell;
|
||||
uint8 _effectIndex;
|
||||
uint8 _aura;
|
||||
};
|
||||
|
||||
class at_sunwell_eredar_twins : public OnlyOnceAreaTriggerScript
|
||||
{
|
||||
public:
|
||||
@@ -404,5 +433,8 @@ void AddSC_boss_eredar_twins()
|
||||
RegisterSpellScriptWithArgs(spell_eredar_twins_apply_touch, "spell_eredar_twins_apply_flame_touched", SPELL_FLAME_TOUCHED);
|
||||
RegisterSpellScript(spell_eredar_twins_handle_touch);
|
||||
RegisterSpellScript(spell_eredar_twins_blaze);
|
||||
RegisterSpellScriptWithArgs(spell_eredar_twins_handle_touch_periodic, "spell_eredar_twins_handle_dark_touched_periodic", SPELL_DARK_TOUCHED, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
RegisterSpellScriptWithArgs(spell_eredar_twins_handle_touch_periodic, "spell_eredar_twins_handle_flame_touched_periodic", SPELL_FLAME_TOUCHED, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
RegisterSpellScriptWithArgs(spell_eredar_twins_handle_touch_periodic, "spell_eredar_twins_handle_flame_touched_flame_sear", SPELL_FLAME_TOUCHED, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
new at_sunwell_eredar_twins();
|
||||
}
|
||||
|
||||
@@ -710,7 +710,6 @@ private:
|
||||
enum AmanishiScout
|
||||
{
|
||||
NPC_WORLD_TRIGGER = 22515,
|
||||
POINT_DRUM = 0,
|
||||
SAY_AGGRO = 0,
|
||||
SPELL_ALERT_DRUMS = 42177,
|
||||
SPELL_MULTI_SHOT = 43205,
|
||||
@@ -737,6 +736,8 @@ struct npc_amanishi_scout : public ScriptedAI
|
||||
{
|
||||
scheduler.CancelAll();
|
||||
me->SetCombatMovement(false);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
_drumGUID.Clear();
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
@@ -748,30 +749,38 @@ struct npc_amanishi_scout : public ScriptedAI
|
||||
GetCreatureListWithEntryInGrid(triggers, me, NPC_WORLD_TRIGGER, 50.0f);
|
||||
triggers.remove_if([](Creature* trigger) {return !IsDrum(trigger);});
|
||||
triggers.sort(Acore::ObjectDistanceOrderPred(me));
|
||||
if (!triggers.empty())
|
||||
{
|
||||
me->ClearTarget();
|
||||
Creature* closestDrum = triggers.front();
|
||||
me->GetMotionMaster()->MovePoint(POINT_DRUM, closestDrum->GetPositionX(), closestDrum->GetPositionY(), closestDrum->GetPositionZ());
|
||||
}
|
||||
else
|
||||
if (triggers.empty())
|
||||
ScheduleCombat();
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id) override
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && id == POINT_DRUM)
|
||||
Creature* closestDrum = triggers.front();
|
||||
me->GetMotionMaster()->MoveFollow(closestDrum, 0.0f, 0.0f);
|
||||
_drumGUID = closestDrum->GetGUID();
|
||||
me->ClearTarget();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
scheduler.Schedule(1s, [this](TaskContext context)
|
||||
{
|
||||
DoCastSelf(SPELL_ALERT_DRUMS);
|
||||
scheduler.Schedule(5s, [this](TaskContext /*context*/)
|
||||
{
|
||||
ScheduleCombat();
|
||||
});
|
||||
}
|
||||
if (_drumGUID)
|
||||
if (Creature* drum = ObjectAccessor::GetCreature(*me, _drumGUID))
|
||||
{
|
||||
if (me->IsWithinRange(drum, INTERACTION_DISTANCE))
|
||||
{
|
||||
me->SetFacingToObject(drum);
|
||||
DoCastSelf(SPELL_ALERT_DRUMS);
|
||||
scheduler.Schedule(5s, [this](TaskContext /*context*/)
|
||||
{
|
||||
ScheduleCombat();
|
||||
});
|
||||
return;
|
||||
}
|
||||
context.Repeat(1s);
|
||||
return;
|
||||
}
|
||||
ScheduleCombat();
|
||||
});
|
||||
}
|
||||
|
||||
void ScheduleCombat()
|
||||
{
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->SetCombatMovement(true);
|
||||
if (Unit* victim = me->GetVictim())
|
||||
me->GetMotionMaster()->MoveChase(victim);
|
||||
@@ -790,11 +799,13 @@ struct npc_amanishi_scout : public ScriptedAI
|
||||
{
|
||||
scheduler.Update(diff);
|
||||
|
||||
if (!UpdateVictim())
|
||||
if (!me->IsCombatMovementAllowed() || !UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
ObjectGuid _drumGUID;
|
||||
};
|
||||
|
||||
enum SpellAlertDrums
|
||||
|
||||
@@ -46,7 +46,6 @@ public:
|
||||
}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
TeamId teamIdInInstance;
|
||||
std::string str_data;
|
||||
ObjectGuid NPC_BronjahmGUID;
|
||||
ObjectGuid NPC_DevourerGUID;
|
||||
@@ -59,7 +58,6 @@ public:
|
||||
void Initialize() override
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
teamIdInInstance = TEAM_NEUTRAL;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const override
|
||||
@@ -72,21 +70,7 @@ public:
|
||||
|
||||
void OnPlayerEnter(Player* player) override
|
||||
{
|
||||
if (teamIdInInstance == TEAM_NEUTRAL)
|
||||
{
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
if (Player* gLeader = ObjectAccessor::FindPlayer(group->GetLeaderGUID()))
|
||||
teamIdInInstance = Player::TeamIdForRace(gLeader->getRace());
|
||||
else
|
||||
teamIdInInstance = player->GetTeamId();
|
||||
}
|
||||
else
|
||||
teamIdInInstance = player->GetTeamId();
|
||||
}
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP))
|
||||
player->SetFaction((teamIdInInstance == TEAM_HORDE) ? 1610 : 1);
|
||||
InstanceScript::OnPlayerEnter(player);
|
||||
|
||||
// this will happen only after crash and loading the instance from db
|
||||
if (m_auiEncounter[0] == DONE && m_auiEncounter[1] == DONE && (!NPC_LeaderSecondGUID || !instance->GetCreature(NPC_LeaderSecondGUID)))
|
||||
@@ -98,24 +82,6 @@ public:
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
if (teamIdInInstance == TEAM_NEUTRAL)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.IsEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
{
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
if (Player* gLeader = ObjectAccessor::FindPlayer(group->GetLeaderGUID()))
|
||||
teamIdInInstance = Player::TeamIdForRace(gLeader->getRace());
|
||||
else
|
||||
teamIdInInstance = player->GetTeamId();
|
||||
}
|
||||
else
|
||||
teamIdInInstance = player->GetTeamId();
|
||||
}
|
||||
}
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_BRONJAHM:
|
||||
@@ -125,7 +91,7 @@ public:
|
||||
NPC_DevourerGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_SYLVANAS_PART1:
|
||||
if (teamIdInInstance == TEAM_ALLIANCE)
|
||||
if (GetTeamIdInInstance() == TEAM_ALLIANCE)
|
||||
creature->UpdateEntry(NPC_JAINA_PART1);
|
||||
NPC_LeaderFirstGUID = creature->GetGUID();
|
||||
|
||||
@@ -133,12 +99,12 @@ public:
|
||||
creature->SetVisible(false);
|
||||
break;
|
||||
case NPC_SYLVANAS_PART2:
|
||||
if (teamIdInInstance == TEAM_ALLIANCE)
|
||||
if (GetTeamIdInInstance() == TEAM_ALLIANCE)
|
||||
creature->UpdateEntry(NPC_JAINA_PART2);
|
||||
NPC_LeaderSecondGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_LORALEN:
|
||||
if (teamIdInInstance == TEAM_ALLIANCE)
|
||||
if (GetTeamIdInInstance() == TEAM_ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ELANDRA);
|
||||
if (!NPC_GuardFirstGUID)
|
||||
{
|
||||
@@ -148,7 +114,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case NPC_KALIRA:
|
||||
if (teamIdInInstance == TEAM_ALLIANCE)
|
||||
if (GetTeamIdInInstance() == TEAM_ALLIANCE)
|
||||
creature->UpdateEntry(NPC_KORELN);
|
||||
if (!NPC_GuardSecondGUID)
|
||||
{
|
||||
@@ -170,9 +136,12 @@ public:
|
||||
leader->GetMotionMaster()->MovePoint(1, boss->GetPositionX() + 10.0f * cos(angle), boss->GetPositionY() + 10.0f * std::sin(angle), boss->GetPositionZ());
|
||||
}
|
||||
|
||||
for (int8 i = 0; outroPositions[i].entry[teamIdInInstance] != 0; ++i)
|
||||
if (Creature* summon = instance->SummonCreature(outroPositions[i].entry[teamIdInInstance], outroPositions[i].startPosition))
|
||||
summon->GetMotionMaster()->MovePath(outroPositions[i].pathId, false);
|
||||
if (GetTeamIdInInstance() < TEAM_NEUTRAL) // Shouldn't happen, but just in case.
|
||||
{
|
||||
for (int8 i = 0; outroPositions[i].entry[GetTeamIdInInstance()] != 0; ++i)
|
||||
if (Creature* summon = instance->SummonCreature(outroPositions[i].entry[GetTeamIdInInstance()], outroPositions[i].startPosition))
|
||||
summon->GetMotionMaster()->MovePath(outroPositions[i].pathId, false);
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data) override
|
||||
|
||||
@@ -887,8 +887,11 @@ class spell_hun_misdirection : public AuraScript
|
||||
GetTarget()->ResetRedirectThreat();
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& /*eventInfo*/)
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
// Do not trigger from Mend Pet
|
||||
if (eventInfo.GetProcSpell() && (eventInfo.GetProcSpell()->GetSpellInfo()->SpellFamilyFlags[0] & 0x800000))
|
||||
return false;
|
||||
return GetTarget()->GetRedirectThreatTarget();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user