Core/ConditionMgr: You can now add conditions to QuestAccept (at CanTakeQuest check)

--HG--
branch : trunk
This commit is contained in:
Rat
2010-09-19 19:49:23 +02:00
parent c4ed3430cf
commit 5de3183180
4 changed files with 29 additions and 3 deletions
@@ -905,6 +905,16 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
}
break;
}
case CONDITION_SOURCE_TYPE_QUEST_ACCEPT:
{
Quest const *Quest = sObjectMgr.GetQuestTemplate(cond->mSourceEntry);
if (!Quest)
{
sLog.outErrorDb("CONDITION_SOURCE_TYPE_QUESTID specifies non-existing quest (%u), skipped", cond->mSourceEntry);
return false;
}
}
break;
case CONDITION_SOURCE_TYPE_GOSSIP_MENU:
case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION:
case CONDITION_SOURCE_TYPE_NONE:
+3 -2
View File
@@ -79,10 +79,11 @@ enum ConditionSourceType
CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION = 15,//DONE
CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE = 16,//DONE
CONDITION_SOURCE_TYPE_SPELL = 17,//DONE
CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET = 18//DONE
CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET = 18,//DONE
CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19//DONE
};
#define MAX_CONDITIONSOURCETYPE 19
#define MAX_CONDITIONSOURCETYPE 20
struct Condition
{