Merge branch 'master' into maexxna

This commit is contained in:
Jelle Meeus
2024-04-30 07:19:14 +02:00
13 changed files with 22663 additions and 13 deletions

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

@@ -33,7 +33,7 @@ enum BG_EY_Events
enum BG_EY_Timers
{
BG_EY_FLAG_RESPAWN_TIME = 20 * IN_MILLISECONDS,
BG_EY_FLAG_RESPAWN_TIME = 10 * IN_MILLISECONDS,
BG_EY_FLAG_ON_GROUND_TIME = 10 * IN_MILLISECONDS,
BG_EY_FPOINTS_CHECK_TIME = 2 * IN_MILLISECONDS,
BG_EY_FPOINTS_TICK_TIME = 1 * IN_MILLISECONDS

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

@@ -406,7 +406,7 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
}
}
LastUsedScriptID = GetGOInfo()->ScriptId;
LastUsedScriptID = GetScriptId();
AIM_Initialize();
if (uint32 linkedEntry = GetGOInfo()->GetLinkedGameObjectEntry())
@@ -1140,6 +1140,7 @@ bool GameObject::LoadGameObjectFromDB(ObjectGuid::LowType spawnId, Map* map, boo
GOState go_state = data->go_state;
uint32 artKit = data->artKit;
m_goData = data;
m_spawnId = spawnId;
if (!Create(map->GenerateLowGuid<HighGuid::GameObject>(), entry, map, phaseMask, x, y, z, ang, data->rotation, animprogress, go_state, artKit))
@@ -1175,8 +1176,6 @@ bool GameObject::LoadGameObjectFromDB(ObjectGuid::LowType spawnId, Map* map, boo
m_respawnTime = 0;
}
m_goData = data;
if (addToMap && !GetMap()->AddToMap(this))
return false;

View File

@@ -91,14 +91,23 @@ bool ChaseMovementGenerator<T>::DoUpdate(T* owner, uint32 time_diff)
Unit* target = i_target.getTarget();
bool const mutualChase = IsMutualChase(owner, target);
bool mutualChase = IsMutualChase(owner, target);
bool const mutualTarget = target->GetVictim() == owner;
float const chaseRange = GetChaseRange(owner, target);
float const meleeRange = owner->GetMeleeRange(target);
float const minTarget = (_range ? _range->MinTolerance : 0.0f) + chaseRange;
float const maxRange = _range ? _range->MaxRange + chaseRange : owner->GetMeleeRange(target); // melee range already includes hitboxes
float const maxRange = _range ? _range->MaxRange + chaseRange : meleeRange; // melee range already includes hitboxes
float const maxTarget = _range ? _range->MaxTolerance + chaseRange : CONTACT_DISTANCE + chaseRange;
Optional<ChaseAngle> angle = mutualChase ? Optional<ChaseAngle>() : _angle;
// Prevent almost infinite spinning of mutual targets.
if (angle && !mutualChase && _mutualChase && mutualTarget && chaseRange < meleeRange)
{
angle = Optional<ChaseAngle>();
mutualChase = true;
}
// periodically check if we're already in the expected range...
i_recheckDistance.Update(time_diff);
if (i_recheckDistance.Passed())

View File

@@ -136,7 +136,7 @@ void ScriptMgr::OnPlayerReputationRankChange(Player* player, uint32 factionID, R
void ScriptMgr::OnPlayerLearnSpell(Player* player, uint32 spellID)
{
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_PLAYER_LEARN_TALENTS, script->OnLearnSpell(player, spellID));
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_LEARN_SPELL, script->OnLearnSpell(player, spellID));
}
void ScriptMgr::OnPlayerForgotSpell(Player* player, uint32 spellID)
@@ -211,7 +211,7 @@ void ScriptMgr::OnBeforePlayerUpdate(Player* player, uint32 p_time)
void ScriptMgr::OnPlayerUpdate(Player* player, uint32 p_time)
{
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_BEFORE_UPDATE, script->OnUpdate(player, p_time));
CALL_ENABLED_HOOKS(PlayerScript, PLAYERHOOK_ON_UPDATE, script->OnUpdate(player, p_time));
}
void ScriptMgr::OnPlayerLogin(Player* player)

View File

@@ -467,7 +467,7 @@ struct npc_echo_of_medivh : public ScriptedAI
break;
}
if (newRow < MAX_ROW && newCol < MAX_COL && newRow >= 0 && newCol >= 0)
if (newRow < MAX_ROW && newCol < MAX_COL)
if (Creature* targetPiece = ObjectAccessor::GetCreature(*me, _boards[newRow][newCol].pieceGUID))
if (!IsFriendly(piece, targetPiece))
return targetPiece;