mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 23:26:23 +00:00
feat(Core/Conditions): Implement CONDITION_AI_DATA and support for st… (#22879)
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
#include "ConditionMgr.h"
|
||||
#include "AchievementMgr.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "GameObject.h"
|
||||
#include "GameObjectAI.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Pet.h"
|
||||
@@ -576,6 +578,14 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
condMeets = sWorldState->IsConditionFulfilled(ConditionValue1, ConditionValue2);
|
||||
break;
|
||||
}
|
||||
case CONDITION_AI_DATA:
|
||||
{
|
||||
if (Creature* creature = object->ToCreature())
|
||||
condMeets = creature->AI() && creature->AI()->GetData(ConditionValue1) == ConditionValue2;
|
||||
else if (GameObject* go = object->ToGameObject())
|
||||
condMeets = go->AI() && go->AI()->GetData(ConditionValue1) == ConditionValue2;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
condMeets = false;
|
||||
break;
|
||||
@@ -779,6 +789,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition()
|
||||
case CONDITION_WORLD_SCRIPT:
|
||||
mask |= GRID_MAP_TYPE_MASK_ALL;
|
||||
break;
|
||||
case CONDITION_AI_DATA:
|
||||
mask |= GRID_MAP_TYPE_MASK_CREATURE | GRID_MAP_TYPE_MASK_GAMEOBJECT;
|
||||
break;
|
||||
default:
|
||||
ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user