本文整理汇总了C++中Quest::GetQuestId方法的典型用法代码示例。如果您正苦于以下问题:C++ Quest::GetQuestId方法的具体用法?C++ Quest::GetQuestId怎么用?C++ Quest::GetQuestId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quest
的用法示例。
在下文中一共展示了Quest::GetQuestId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _LoadQuests
void GameObject::_LoadQuests()
{
mQuests.clear();
mInvolvedQuests.clear();
Field *fields;
Quest *pQuest;
QueryResult *result = sDatabase.PQuery("SELECT `quest` FROM `gameobject_questrelation` WHERE `id` = '%u'", GetEntry ());
if(result)
{
do
{
fields = result->Fetch();
pQuest = objmgr.QuestTemplates[ fields[0].GetUInt32() ];
if (!pQuest) continue;
addQuest(pQuest->GetQuestId());
}
while( result->NextRow() );
delete result;
}
QueryResult *result1 = sDatabase.PQuery("SELECT `quest` FROM `gameobject_involvedrelation` WHERE `id` = '%u'", GetEntry ());
if(!result1) return;
do
{
fields = result1->Fetch();
pQuest = objmgr.QuestTemplates[ fields[0].GetUInt32() ];
if (!pQuest) continue;
addInvolvedQuest(pQuest->GetQuestId());
}
while( result1->NextRow() );
delete result1;
}
示例2: HandleLookupQuestCommand
static bool HandleLookupQuestCommand(ChatHandler* handler, char const* args)
{
if (!*args)
return false;
// can be NULL at console call
Player* target = handler->getSelectedPlayer();
std::string namePart = args;
std::wstring wNamePart;
// converting string that we try to find to lower case
if (!Utf8toWStr(namePart, wNamePart))
return false;
wstrToLower(wNamePart);
bool found = false;
uint32 count = 0;
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
ObjectMgr::QuestMap const& qTemplates = sObjectMgr->GetQuestTemplates();
for (ObjectMgr::QuestMap::const_iterator iter = qTemplates.begin(); iter != qTemplates.end(); ++iter)
{
Quest* qInfo = iter->second;
int localeIndex = handler->GetSessionDbLocaleIndex();
if (localeIndex >= 0)
{
uint8 ulocaleIndex = uint8(localeIndex);
if (QuestLocale const* questLocale = sObjectMgr->GetQuestLocale(qInfo->GetQuestId()))
{
if (questLocale->Title.size() > ulocaleIndex && !questLocale->Title[ulocaleIndex].empty())
{
std::string title = questLocale->Title[ulocaleIndex];
if (Utf8FitTo(title, wNamePart))
{
if (maxResults && count++ == maxResults)
{
handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
return true;
}
char const* statusStr = "";
if (target)
{
QuestStatus status = target->GetQuestStatus(qInfo->GetQuestId());
switch (status)
{
case QUEST_STATUS_COMPLETE:
statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_COMPLETE);
break;
case QUEST_STATUS_INCOMPLETE:
statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_ACTIVE);
break;
case QUEST_STATUS_REWARDED:
statusStr = handler->GetTrinityString(LANG_COMMAND_QUEST_REWARDED);
break;
default:
break;
}
}
if (handler->GetSession())
handler->PSendSysMessage(LANG_QUEST_LIST_CHAT, qInfo->GetQuestId(), qInfo->GetQuestId(), qInfo->GetQuestLevel(), title.c_str(), statusStr);
else
handler->PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qInfo->GetQuestId(), title.c_str(), statusStr);
if (!found)
found = true;
continue;
}
}
}
}
std::string title = qInfo->GetTitle();
if (title.empty())
continue;
if (Utf8FitTo(title, wNamePart))
{
if (maxResults && count++ == maxResults)
{
handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
return true;
}
char const* statusStr = "";
if (target)
{
QuestStatus status = target->GetQuestStatus(qInfo->GetQuestId());
switch (status)
{
//.........这里部分代码省略.........
示例3: getDialogStatus
uint32 Creature::getDialogStatus(Player *pPlayer, uint32 defstatus)
{
uint32 result = DIALOG_STATUS_NONE;
QuestStatus status;
uint32 quest_id;
Quest *pQuest;
for( std::list<uint32>::iterator i = mInvolvedQuests.begin( ); i != mInvolvedQuests.end( ); i++ )
{
quest_id = *i;
pQuest = objmgr.QuestTemplates[quest_id];
status = pPlayer->GetQuestStatus( quest_id );
if ((status == QUEST_STATUS_COMPLETE && !pPlayer->GetQuestRewardStatus(quest_id)) ||
(pQuest->IsAutoComplete() && pPlayer->CanTakeQuest(pQuest, false)))
{
SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TRACK_UNIT);
if ( pQuest->IsAutoComplete() && pQuest->IsRepeatable() )
return DIALOG_STATUS_REWARD_REP;
else
return DIALOG_STATUS_REWARD;
}
else if ( status == QUEST_STATUS_INCOMPLETE )
result = DIALOG_STATUS_INCOMPLETE;
}
RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_TRACK_UNIT);
if ( result == DIALOG_STATUS_INCOMPLETE )
return result;
for( std::list<uint32>::iterator i = mQuests.begin( ); i != mQuests.end( ); i++ )
{
pQuest = objmgr.QuestTemplates[*i];
if ( !pQuest )
continue;
quest_id = pQuest->GetQuestId();
status = pPlayer->GetQuestStatus( quest_id );
if ( status == QUEST_STATUS_NONE )
{
if ( pPlayer->CanSeeStartQuest( quest_id ) )
{
if ( pPlayer->SatisfyQuestLevel(quest_id, false) )
{
if ( pQuest->IsAutoComplete() )
return DIALOG_STATUS_REWARD_REP;
else
return DIALOG_STATUS_AVAILABLE;
}
result = DIALOG_STATUS_UNAVAILABLE;
}
}
}
// can train and help unlearn talentes (2 action -> chat menu)
if( isCanTrainingAndResetTalentsOf(pPlayer) )
return DIALOG_STATUS_CHAT;
if ( result == DIALOG_STATUS_UNAVAILABLE )
return result;
if ( defstatus == DIALOG_STATUS_NONE )
return DIALOG_STATUS_NONE;
else
return DIALOG_STATUS_CHAT;
}