本文整理汇总了C++中QuestInterface::LoadNPCScript方法的典型用法代码示例。如果您正苦于以下问题:C++ QuestInterface::LoadNPCScript方法的具体用法?C++ QuestInterface::LoadNPCScript怎么用?C++ QuestInterface::LoadNPCScript使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QuestInterface
的用法示例。
在下文中一共展示了QuestInterface::LoadNPCScript方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HasQuestSubLocal
bool QuestParserCollection::HasQuestSubLocal(uint32 npcid, QuestEventID evt) {
std::map<uint32, uint32>::iterator iter = _npc_quest_status.find(npcid);
if(iter != _npc_quest_status.end()) {
//loaded or failed to load
if(iter->second != QuestFailedToLoad) {
std::map<uint32, QuestInterface*>::iterator qiter = _interfaces.find(iter->second);
if(qiter->second->HasQuestSub(npcid, evt)) {
return true;
}
}
} else {
std::string filename;
QuestInterface *qi = GetQIByNPCQuest(npcid, filename);
if(qi) {
_npc_quest_status[npcid] = qi->GetIdentifier();
qi->LoadNPCScript(filename, npcid);
if(qi->HasQuestSub(npcid, evt)) {
return true;
}
} else {
_npc_quest_status[npcid] = QuestFailedToLoad;
}
}
return false;
}
示例2: EventNPCLocal
int QuestParserCollection::EventNPCLocal(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data,
std::vector<void*> *extra_pointers) {
std::map<uint32, uint32>::iterator iter = _npc_quest_status.find(npc->GetNPCTypeID());
if(iter != _npc_quest_status.end()) {
//loaded or failed to load
if(iter->second != QuestFailedToLoad) {
std::map<uint32, QuestInterface*>::iterator qiter = _interfaces.find(iter->second);
return qiter->second->EventNPC(evt, npc, init, data, extra_data, extra_pointers);
}
} else {
std::string filename;
QuestInterface *qi = GetQIByNPCQuest(npc->GetNPCTypeID(), filename);
if(qi) {
_npc_quest_status[npc->GetNPCTypeID()] = qi->GetIdentifier();
qi->LoadNPCScript(filename, npc->GetNPCTypeID());
return qi->EventNPC(evt, npc, init, data, extra_data, extra_pointers);
} else {
_npc_quest_status[npc->GetNPCTypeID()] = QuestFailedToLoad;
}
}
return 0;
}