Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2024-08-19 18:59:50 +08:00
12 changed files with 33 additions and 39 deletions

View File

@@ -25,7 +25,7 @@ NullCreatureAI::NullCreatureAI(Creature* c) : CreatureAI(c) { me->SetReactState(
int32 NullCreatureAI::Permissible(Creature const* creature)
{
if (creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK))
if (creature->HasNpcFlag(UNIT_NPC_FLAG_SPELLCLICK))
return PERMIT_BASE_PROACTIVE + 50;
if (creature->IsTrigger())

View File

@@ -2061,21 +2061,21 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
for (WorldObject* target : targets)
if (IsCreature(target))
target->ToUnit()->SetUInt32Value(UNIT_NPC_FLAGS, e.action.unitFlag.flag);
target->ToUnit()->ReplaceAllNpcFlags(NPCFlags(e.action.unitFlag.flag));
break;
}
case SMART_ACTION_ADD_NPC_FLAG:
{
for (WorldObject* target : targets)
if (IsCreature(target))
target->ToUnit()->SetFlag(UNIT_NPC_FLAGS, e.action.unitFlag.flag);
target->ToUnit()->SetNpcFlag(NPCFlags(e.action.unitFlag.flag));
break;
}
case SMART_ACTION_REMOVE_NPC_FLAG:
{
for (WorldObject* target : targets)
if (IsCreature(target))
target->ToUnit()->RemoveFlag(UNIT_NPC_FLAGS, e.action.unitFlag.flag);
target->ToUnit()->RemoveNpcFlag(NPCFlags(e.action.unitFlag.flag));
break;
}
case SMART_ACTION_CROSS_CAST:

View File

@@ -1004,13 +1004,12 @@ public:
[[nodiscard]] bool IsInnkeeper() const { return HasNpcFlag(UNIT_NPC_FLAG_INNKEEPER); }
[[nodiscard]] bool IsSpiritHealer() const { return HasNpcFlag(UNIT_NPC_FLAG_SPIRITHEALER); }
[[nodiscard]] bool IsSpiritGuide() const { return HasNpcFlag(UNIT_NPC_FLAG_SPIRITGUIDE); }
[[nodiscard]] bool IsTabardDesigner()const { return HasNpcFlag(UNIT_NPC_FLAG_TABARDDESIGNER); }
[[nodiscard]] bool IsTabardDesigner() const { return HasNpcFlag(UNIT_NPC_FLAG_TABARDDESIGNER); }
[[nodiscard]] bool IsAuctioner() const { return HasNpcFlag(UNIT_NPC_FLAG_AUCTIONEER); }
[[nodiscard]] bool IsArmorer() const { return HasNpcFlag(UNIT_NPC_FLAG_REPAIR); }
[[nodiscard]] bool IsServiceProvider() const
{
return HasFlag(UNIT_NPC_FLAGS,
UNIT_NPC_FLAG_VENDOR | UNIT_NPC_FLAG_TRAINER | UNIT_NPC_FLAG_FLIGHTMASTER |
return HasNpcFlag(UNIT_NPC_FLAG_VENDOR | UNIT_NPC_FLAG_TRAINER | UNIT_NPC_FLAG_FLIGHTMASTER |
UNIT_NPC_FLAG_PETITIONER | UNIT_NPC_FLAG_BATTLEMASTER | UNIT_NPC_FLAG_BANKER |
UNIT_NPC_FLAG_INNKEEPER | UNIT_NPC_FLAG_SPIRITHEALER |
UNIT_NPC_FLAG_SPIRITGUIDE | UNIT_NPC_FLAG_TABARDDESIGNER | UNIT_NPC_FLAG_AUCTIONEER);

View File

@@ -1104,7 +1104,7 @@ namespace Acore
}
if (i_funit->_IsValidAttackTarget(u, _spellInfo, i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : nullptr) && i_obj->IsWithinDistInMap(u, i_range))
if (i_funit->_IsValidAttackTarget(u, _spellInfo, i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : nullptr) && i_obj->IsWithinDistInMap(u, i_range,true,false))
return true;
return false;

View File

@@ -223,7 +223,7 @@ Map::EnterState MapMgr::PlayerCannotEnter(uint32 mapid, Player* player, bool log
}
// players are only allowed to enter 5 instances per hour
if (entry->IsDungeon() && (!group || !group->isLFGGroup() || !group->IsLfgRandomInstance()))
if (entry->IsNonRaidDungeon() && (!group || !group->isLFGGroup() || !group->IsLfgRandomInstance()))
{
uint32 instaceIdToCheck = 0;
if (InstanceSave* save = sInstanceSaveMgr->PlayerGetInstanceSave(player->GetGUID(), mapid, player->GetDifficulty(entry->IsRaid())))

View File

@@ -9035,7 +9035,7 @@ namespace Acore
if (!target->ToGameObject()->IsInRange(_position->GetPositionX(), _position->GetPositionY(), _position->GetPositionZ(), _range))
return false;
}
else if (!target->IsWithinDist3d(_position, _range))
else if (!target->IsInDist(_position, _range))
return false;
else if (target->GetTypeId() == TYPEID_UNIT && target->ToCreature()->IsAvoidingAOE()) // pussywizard
return false;