mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 23:26:23 +00:00
Merge branch 'master' of https://github.com/ZhengPeiRu21/azerothcore-wotlk into Playerbot
This commit is contained in:
@@ -3595,6 +3595,16 @@ Calculate.Creature.Zone.Area.Data = 0
|
||||
|
||||
Calculate.Gameoject.Zone.Area.Data = 0
|
||||
|
||||
#
|
||||
# Group.Raid.LevelRestriction
|
||||
#
|
||||
# The Group members need to the same, or higher level than the specified value.
|
||||
# Minimum level is 10.
|
||||
# Default: 10
|
||||
#
|
||||
|
||||
Group.Raid.LevelRestriction = 10
|
||||
|
||||
#
|
||||
# LFG.Location.All
|
||||
#
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "Group.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Config.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "GameTime.h"
|
||||
#include "GroupMgr.h"
|
||||
@@ -278,6 +279,16 @@ void Group::ConvertToLFG(bool restricted /*= true*/)
|
||||
SendUpdate();
|
||||
}
|
||||
|
||||
bool Group::CheckLevelForRaid()
|
||||
{
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
if (Player* player = ObjectAccessor::FindPlayer(citr->guid))
|
||||
if (player->getLevel() < sConfigMgr->GetOption<int32>("Group.Raid.LevelRestriction", 10))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Group::ConvertToRaid()
|
||||
{
|
||||
m_groupType = GroupType(m_groupType | GROUPTYPE_RAID);
|
||||
|
||||
@@ -245,6 +245,7 @@ public:
|
||||
uint8 GetMemberGroup(ObjectGuid guid) const;
|
||||
|
||||
void ConvertToLFG(bool restricted = true);
|
||||
bool CheckLevelForRaid();
|
||||
void ConvertToRaid();
|
||||
|
||||
void SetBattlegroundGroup(Battleground* bg);
|
||||
|
||||
@@ -621,6 +621,12 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket& /*recvData*/)
|
||||
return;
|
||||
|
||||
/** error handling **/
|
||||
if (group->CheckLevelForRaid())
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, "", ERR_RAID_DISALLOWED_BY_LEVEL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!group->IsLeader(GetPlayer()->GetGUID()) || group->GetMembersCount() < 2 || group->isLFGGroup()) // pussywizard: not allowed for lfg groups, it is either raid from the beginning or not!
|
||||
return;
|
||||
/********************/
|
||||
|
||||
@@ -641,12 +641,12 @@ void PathGenerator::CreateFilter()
|
||||
|
||||
// creatures don't take environmental damage
|
||||
if (creature->CanEnterWater())
|
||||
includeFlags |= (NAV_WATER | NAV_MAGMA_SLIME);
|
||||
includeFlags |= (NAV_WATER | NAV_MAGMA);
|
||||
}
|
||||
else // assume Player
|
||||
{
|
||||
// perfect support not possible, just stay 'safe'
|
||||
includeFlags |= (NAV_GROUND | NAV_WATER | NAV_MAGMA_SLIME);
|
||||
includeFlags |= (NAV_GROUND | NAV_WATER | NAV_MAGMA);
|
||||
}
|
||||
|
||||
_filter.setIncludeFlags(includeFlags);
|
||||
@@ -671,17 +671,13 @@ void PathGenerator::UpdateFilter()
|
||||
_filter.setIncludeFlags(includedFlags);
|
||||
}
|
||||
|
||||
if (Creature const* _sourceCreature = _source->ToCreature())
|
||||
{
|
||||
/*if (Creature const* _sourceCreature = _source->ToCreature())
|
||||
if (_sourceCreature->IsInCombat() || _sourceCreature->IsInEvadeMode())
|
||||
{
|
||||
_filter.setIncludeFlags(_filter.getIncludeFlags() | NAV_GROUND_STEEP);
|
||||
}
|
||||
}
|
||||
_filter.setIncludeFlags(_filter.getIncludeFlags() | NAV_GROUND_STEEP);*/
|
||||
}
|
||||
}
|
||||
|
||||
NavTerrainFlag PathGenerator::GetNavTerrain(float x, float y, float z) const
|
||||
NavTerrain PathGenerator::GetNavTerrain(float x, float y, float z) const
|
||||
{
|
||||
LiquidData data;
|
||||
LiquidData const& liquidData = _source->GetMap()->GetLiquidData(_source->GetPhaseMask(), x, y, z, _source->GetCollisionHeight(), MAP_ALL_LIQUIDS);
|
||||
@@ -695,7 +691,7 @@ NavTerrainFlag PathGenerator::GetNavTerrain(float x, float y, float z) const
|
||||
return NAV_WATER;
|
||||
case MAP_LIQUID_TYPE_MAGMA:
|
||||
case MAP_LIQUID_TYPE_SLIME:
|
||||
return NAV_MAGMA_SLIME;
|
||||
return NAV_MAGMA;
|
||||
default:
|
||||
return NAV_GROUND;
|
||||
}
|
||||
@@ -1143,9 +1139,9 @@ bool PathGenerator::IsWaterPath(Movement::PointsArray pathPoints) const
|
||||
// Check both start and end points, if they're both in water, then we can *safely* let the creature move
|
||||
for (uint32 i = 0; i < pathPoints.size(); ++i)
|
||||
{
|
||||
NavTerrainFlag terrain = GetNavTerrain(pathPoints[i].x, pathPoints[i].y, pathPoints[i].z);
|
||||
NavTerrain terrain = GetNavTerrain(pathPoints[i].x, pathPoints[i].y, pathPoints[i].z);
|
||||
// One of the points is not in the water
|
||||
if (terrain != NAV_MAGMA_SLIME && terrain != NAV_WATER)
|
||||
if (terrain != NAV_MAGMA && terrain != NAV_WATER)
|
||||
{
|
||||
waterPath = false;
|
||||
break;
|
||||
|
||||
@@ -168,7 +168,7 @@ class PathGenerator
|
||||
void BuildPointPath(float const* startPoint, float const* endPoint);
|
||||
void BuildShortcut();
|
||||
|
||||
[[nodiscard]] NavTerrainFlag GetNavTerrain(float x, float y, float z) const;
|
||||
[[nodiscard]] NavTerrain GetNavTerrain(float x, float y, float z) const;
|
||||
void CreateFilter();
|
||||
void UpdateFilter();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user