Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-05-04 23:35:53 +08:00
12 changed files with 64 additions and 25 deletions

View File

@@ -0,0 +1,2 @@
-- DB update 2024_04_29_00 -> 2024_04_30_00
UPDATE `creature` SET `spawntimesecs`=2700 WHERE `guid` IN (3154, 134483, 134484) AND `id1`=1132;

View File

@@ -0,0 +1,4 @@
-- DB update 2024_04_30_00 -> 2024_05_04_00
--
DELETE FROM `spell_script_names` WHERE `spell_id` = 30166;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (30166, 'spell_magtheridon_shadow_grasp_visual');

View File

@@ -1342,6 +1342,15 @@ vmap.petLOS = 1
vmap.BlizzlikePvPLOS = 1
#
# vmap.BlizzlikeLOSInOpenWorld
# Description: Check line of sight to see game objects in the open world.
# Default: 1 (Enabled, Players will be able to cast spells through tree stumps and other objects in the open world).
# 0 (Disabled, Players will not be able to cast spells through tree stumps and other objects in the open world).
#
vmap.BlizzlikeLOSInOpenWorld = 1
#
# vmap.enableIndoorCheck
# Description: VMap based indoor check to remove outdoor-only auras (mounts etc.).

View File

@@ -40,7 +40,7 @@ void BattlegroundBE::StartingEventOpenDoors()
DoorOpen(i);
for (uint32 i = BG_BE_OBJECT_BUFF_1; i <= BG_BE_OBJECT_BUFF_2; ++i)
SpawnBGObject(i, 60);
SpawnBGObject(i, 90);
}
bool BattlegroundBE::HandlePlayerUnderMap(Player* player)

View File

@@ -103,7 +103,7 @@ void BattlegroundDS::StartingEventOpenDoors()
DoorOpen(i);
for (uint32 i = BG_DS_OBJECT_BUFF_1; i <= BG_DS_OBJECT_BUFF_2; ++i)
SpawnBGObject(i, 60);
SpawnBGObject(i, 90);
_events.ScheduleEvent(BG_DS_EVENT_WATERFALL_WARNING, BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX);
//for (uint8 i = 0; i < BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT; ++i)

View File

@@ -36,7 +36,7 @@ void BattlegroundNA::StartingEventOpenDoors()
DoorOpen(i);
for (uint32 i = BG_NA_OBJECT_BUFF_1; i <= BG_NA_OBJECT_BUFF_2; ++i)
SpawnBGObject(i, 60);
SpawnBGObject(i, 90);
}
bool BattlegroundNA::HandlePlayerUnderMap(Player* player)

View File

@@ -37,7 +37,7 @@ void BattlegroundRL::StartingEventOpenDoors()
DoorOpen(i);
for (uint32 i = BG_RL_OBJECT_BUFF_1; i <= BG_RL_OBJECT_BUFF_2; ++i)
SpawnBGObject(i, 60);
SpawnBGObject(i, 90);
}
bool BattlegroundRL::HandlePlayerUnderMap(Player* player)

View File

@@ -702,9 +702,6 @@ void Map::VisitNearbyCellsOf(WorldObject* obj, TypeContainerVisitor<Acore::Objec
if (!obj->IsPositionValid())
return;
if (obj->GetGridActivationRange() <= 0.0f) // pussywizard: gameobjects for example are on active lists, but range is equal to 0 (they just prevent grid unloading)
return;
// Update mobs/objects in ALL visible cells around object!
CellArea area = Cell::CalculateCellArea(obj->GetPositionX(), obj->GetPositionY(), obj->GetGridActivationRange());
@@ -2448,6 +2445,14 @@ bool Map::isInLineOfSight(float x1, float y1, float z1, float x2, float y2, floa
}
}
if (!sWorld->getBoolConfig(CONFIG_VMAP_BLIZZLIKE_LOS_OPEN_WORLD))
{
if (IsWorldMap())
{
ignoreFlags = VMAP::ModelIgnoreFlags::Nothing;
}
}
if ((checks & LINEOFSIGHT_CHECK_VMAP) && !VMAP::VMapFactory::createOrGetVMapMgr()->isInLineOfSight(GetId(), x1, y1, z1, x2, y2, z2, ignoreFlags))
{
return false;

View File

@@ -454,6 +454,7 @@ public:
[[nodiscard]] bool IsBattleground() const { return i_mapEntry && i_mapEntry->IsBattleground(); }
[[nodiscard]] bool IsBattleArena() const { return i_mapEntry && i_mapEntry->IsBattleArena(); }
[[nodiscard]] bool IsBattlegroundOrArena() const { return i_mapEntry && i_mapEntry->IsBattlegroundOrArena(); }
[[nodiscard]] bool IsWorldMap() const { return i_mapEntry && i_mapEntry->IsWorldMap(); }
bool GetEntrancePos(int32& mapid, float& x, float& y)
{

View File

@@ -178,6 +178,7 @@ enum WorldBoolConfigs
CONFIG_LEAVE_GROUP_ON_LOGOUT,
CONFIG_QUEST_POI_ENABLED,
CONFIG_VMAP_BLIZZLIKE_PVP_LOS,
CONFIG_VMAP_BLIZZLIKE_LOS_OPEN_WORLD,
CONFIG_OBJECT_SPARKLES,
CONFIG_LOW_LEVEL_REGEN_BOOST,
CONFIG_OBJECT_QUEST_MARKERS,

View File

@@ -1318,6 +1318,7 @@ void World::LoadConfigSettings(bool reload)
bool enableHeight = sConfigMgr->GetOption<bool>("vmap.enableHeight", true);
bool enablePetLOS = sConfigMgr->GetOption<bool>("vmap.petLOS", true);
_bool_configs[CONFIG_VMAP_BLIZZLIKE_PVP_LOS] = sConfigMgr->GetOption<bool>("vmap.BlizzlikePvPLOS", true);
_bool_configs[CONFIG_VMAP_BLIZZLIKE_LOS_OPEN_WORLD] = sConfigMgr->GetOption<bool>("vmap.BlizzlikeLOSInOpenWorld", true);
if (!enableHeight)
LOG_ERROR("server.loading", "VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support.");

View File

@@ -52,6 +52,7 @@ enum Spells
SPELL_BERSERK = 27680,
SPELL_SHADOW_GRASP = 30410,
SPELL_SHADOW_GRASP_VISUAL = 30166,
SPELL_SHADOW_CAGE_STUN = 30168,
SPELL_MIND_EXHAUSTION = 44032,
SPELL_QUAKE = 30657,
SPELL_QUAKE_KNOCKBACK = 30571,
@@ -65,13 +66,13 @@ enum Spells
enum Groups
{
GROUP_INTERRUPT_CHECK = 0,
GROUP_EARLY_RELEASE_CHECK = 1
GROUP_EARLY_RELEASE_CHECK = 0
};
enum Actions
{
ACTION_INCREASE_HELLFIRE_CHANNELER_DEATH_COUNT = 1
ACTION_INCREASE_HELLFIRE_CHANNELER_DEATH_COUNT = 1,
ACTION_BANISH_SELF = 2
};
struct boss_magtheridon : public BossAI
@@ -188,21 +189,6 @@ struct boss_magtheridon : public BossAI
{
DoCastSelf(SPELL_BLAST_NOVA);
scheduler.DelayAll(10s);
_interruptScheduler.Schedule(50ms, GROUP_INTERRUPT_CHECK, [this](TaskContext context)
{
if (me->GetAuraCount(SPELL_SHADOW_GRASP_VISUAL) == 5)
{
Talk(SAY_BANISH);
me->InterruptNonMeleeSpells(true);
scheduler.CancelGroup(GROUP_INTERRUPT_CHECK);
}
else
context.Repeat(50ms);
}).Schedule(12s, GROUP_INTERRUPT_CHECK, [this](TaskContext /*context*/)
{
_interruptScheduler.CancelGroup(GROUP_INTERRUPT_CHECK);
});
context.Repeat(54350ms, 55400ms);
}).Schedule(22min, [this](TaskContext /*context*/)
{
@@ -228,6 +214,11 @@ struct boss_magtheridon : public BossAI
});
}
}
else if (action == ACTION_BANISH_SELF )
{
Talk(SAY_BANISH);
me->CastSpell(me, SPELL_SHADOW_CAGE_STUN, true);
}
}
void JustEngagedWith(Unit* who) override
@@ -350,6 +341,30 @@ class spell_magtheridon_shadow_grasp : public AuraScript
}
};
class spell_magtheridon_shadow_grasp_visual : public AuraScript
{
PrepareAuraScript(spell_magtheridon_shadow_grasp_visual);
void HandleDummyApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTarget()->GetAuraCount(SPELL_SHADOW_GRASP_VISUAL) == 5)
{
GetTarget()->GetAI()->DoAction(ACTION_BANISH_SELF);
}
}
void HandleDummyRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE_STUN);
}
void Register() override
{
OnEffectApply += AuraEffectApplyFn(spell_magtheridon_shadow_grasp_visual::HandleDummyApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
OnEffectRemove += AuraEffectRemoveFn(spell_magtheridon_shadow_grasp_visual::HandleDummyRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
class spell_magtheridon_quake : public SpellScript
{
PrepareSpellScript(spell_magtheridon_quake);
@@ -417,6 +432,7 @@ void AddSC_boss_magtheridon()
RegisterMagtheridonsLairCreatureAI(npc_target_trigger);
RegisterSpellScript(spell_magtheridon_blaze);
RegisterSpellScript(spell_magtheridon_shadow_grasp);
RegisterSpellScript(spell_magtheridon_shadow_grasp_visual);
RegisterSpellScript(spell_magtheridon_quake);
RegisterSpellScript(spell_magtheridon_debris_target_selector);
new go_manticron_cube();