Core/Db/Conditions: Prepare conditions system to work on objects of different type than players.

Warning: API has changed a bit:
ConditionScript::OnConditionCheck(Condition* condition, Player* player, Unit* invoker) is now
ConditionScript::OnConditionCheck(Condition* condition, WorldObject* object, WorldObject* invoker)
This commit is contained in:
QAston
2012-02-10 14:18:59 +01:00
parent e0ad0f0e8d
commit 8713b44ee7
10 changed files with 166 additions and 94 deletions
+3 -3
View File
@@ -132,7 +132,7 @@ struct Condition
mNegativeCondition = false;
}
bool Meets(Player* player, Unit* invoker = NULL);
bool Meets(WorldObject* player, WorldObject* invoker = NULL);
bool isLoaded() const { return mConditionType > CONDITION_NONE || mReferenceId; }
};
@@ -157,7 +157,7 @@ class ConditionMgr
bool isConditionTypeValid(Condition* cond);
ConditionList GetConditionReferences(uint32 refId);
bool IsPlayerMeetToConditions(Player* player, ConditionList const& conditions, Unit* invoker = NULL);
bool IsObjectMeetToConditions(WorldObject* object, ConditionList const& conditions, WorldObject* invoker = NULL);
ConditionList GetConditionsForNotGroupedEntry(ConditionSourceType sourceType, uint32 entry);
ConditionList GetConditionsForSmartEvent(int32 entryOrGuid, uint32 eventId, uint32 sourceType);
ConditionList GetConditionsForVehicleSpell(uint32 creatureID, uint32 spellID);
@@ -167,7 +167,7 @@ class ConditionMgr
bool addToLootTemplate(Condition* cond, LootTemplate* loot);
bool addToGossipMenus(Condition* cond);
bool addToGossipMenuItems(Condition* cond);
bool IsPlayerMeetToConditionList(Player* player, ConditionList const& conditions, Unit* invoker = NULL);
bool IsObjectMeetToConditionList(WorldObject* player, ConditionList const& conditions, WorldObject* invoker = NULL);
bool isGroupable(ConditionSourceType sourceType) const
{