当前位置: 首页>>代码示例>>C++>>正文


C++ QuestInterface类代码示例

本文整理汇总了C++中QuestInterface的典型用法代码示例。如果您正苦于以下问题:C++ QuestInterface类的具体用法?C++ QuestInterface怎么用?C++ QuestInterface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了QuestInterface类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetQIByNPCQuest

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;
}
开发者ID:badcaptain,项目名称:Server,代码行数:27,代码来源:QuestParserCollection.cpp

示例2: DispatchEventSpell

int QuestParserCollection::EventSpell(QuestEventID evt, NPC* npc, Client *client, uint32 spell_id, uint32 extra_data,
									  std::vector<void*> *extra_pointers) {
	std::map<uint32, uint32>::iterator iter = _spell_quest_status.find(spell_id);
	if(iter != _spell_quest_status.end()) {
		//loaded or failed to load
		if(iter->second != QuestFailedToLoad) {
			std::map<uint32, QuestInterface*>::iterator qiter = _interfaces.find(iter->second);
			int ret = DispatchEventSpell(evt, npc, client, spell_id, extra_data, extra_pointers);
			int i = qiter->second->EventSpell(evt, npc, client, spell_id, extra_data, extra_pointers);
            if(i != 0) {
                ret = i;
            }
			return ret;
		}
		return DispatchEventSpell(evt, npc, client, spell_id, extra_data, extra_pointers);
	} else {
		std::string filename;
		QuestInterface *qi = GetQIBySpellQuest(spell_id, filename);
		if(qi) {
			_spell_quest_status[spell_id] = qi->GetIdentifier();
			qi->LoadSpellScript(filename, spell_id);
			int ret = DispatchEventSpell(evt, npc, client, spell_id, extra_data, extra_pointers);
			int i = qi->EventSpell(evt, npc, client, spell_id, extra_data, extra_pointers);
            if(i != 0) {
                ret = i;
            }
			return ret;
		} else {
			_spell_quest_status[spell_id] = QuestFailedToLoad;
			return DispatchEventSpell(evt, npc, client, spell_id, extra_data, extra_pointers);
		}
	}
	return 0;
}
开发者ID:badcaptain,项目名称:Server,代码行数:34,代码来源:QuestParserCollection.cpp

示例3: if

bool QuestParserCollection::ItemHasQuestSub(ItemInst *itm, QuestEventID evt) {
	std::string item_script;
	if(itm->GetItem()->ScriptFileID != 0) {
		item_script = "script_";
		item_script += std::to_string(static_cast<long long>(itm->GetItem()->ScriptFileID));
	} else if(strlen(itm->GetItem()->CharmFile) > 0) {
		item_script = itm->GetItem()->CharmFile;
	} else {
		item_script = std::to_string(static_cast<long long>(itm->GetID()));
	}

	uint32 item_id = itm->GetID();
	std::map<uint32, uint32>::iterator iter = _item_quest_status.find(item_id);
	if(iter != _item_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->ItemHasQuestSub(itm, evt);
		}
	} else {
		std::string filename;
		QuestInterface *qi = GetQIByItemQuest(item_script, filename);
		if(qi) {
			_item_quest_status[item_id] = qi->GetIdentifier();
			qi->LoadItemScript(filename, itm);
			return qi->ItemHasQuestSub(itm, evt);
		} else {
			_item_quest_status[item_id] = QuestFailedToLoad;
		}
	}
	return false;
}
开发者ID:badcaptain,项目名称:Server,代码行数:32,代码来源:QuestParserCollection.cpp

示例4: GetQIByPlayerQuest

bool QuestParserCollection::PlayerHasQuestSubGlobal(QuestEventID evt) {
	if(_global_player_quest_status == QuestUnloaded) {
		std::string filename;	
		QuestInterface *qi = GetQIByPlayerQuest(filename);
		if(qi) {
			_global_player_quest_status = qi->GetIdentifier();
			qi->LoadPlayerScript(filename);
			return qi->GlobalPlayerHasQuestSub(evt);
		}
	} else if(_global_player_quest_status != QuestFailedToLoad) {
		std::map<uint32, QuestInterface*>::iterator iter = _interfaces.find(_global_player_quest_status);
		return iter->second->GlobalPlayerHasQuestSub(evt);
	}
	return false;
}
开发者ID:badcaptain,项目名称:Server,代码行数:15,代码来源:QuestParserCollection.cpp

示例5: if

int QuestParserCollection::EventItem(QuestEventID evt, Client *client, ItemInst *item, Mob *mob, std::string data, uint32 extra_data,
									 std::vector<EQEmu::Any> *extra_pointers) {
	// needs pointer validation check on 'item' argument
	
	std::string item_script;
	if(item->GetItem()->ScriptFileID != 0) {
		item_script = "script_";
		item_script += std::to_string(item->GetItem()->ScriptFileID);
	} else if(strlen(item->GetItem()->CharmFile) > 0) {
		item_script = item->GetItem()->CharmFile;
	} else {
		item_script = std::to_string(item->GetID());
	}

	uint32 item_id = item->GetID();
	std::map<uint32, uint32>::iterator iter = _item_quest_status.find(item_id);
	if(iter != _item_quest_status.end()) {
		//loaded or failed to load
		if(iter->second != QuestFailedToLoad) {
			std::map<uint32, QuestInterface*>::iterator qiter = _interfaces.find(iter->second);
			int ret = DispatchEventItem(evt, client, item, mob, data, extra_data, extra_pointers);
			int i = qiter->second->EventItem(evt, client, item, mob, data, extra_data, extra_pointers);
            if(i != 0) {
                ret = i;
            }
			return ret;
		}
		return DispatchEventItem(evt, client, item, mob, data, extra_data, extra_pointers);
	} else {
		std::string filename;
		QuestInterface *qi = GetQIByItemQuest(item_script, filename);
		if(qi) {
			_item_quest_status[item_id] = qi->GetIdentifier();
			qi->LoadItemScript(filename, item);
			int ret = DispatchEventItem(evt, client, item, mob, data, extra_data, extra_pointers);
			int i = qi->EventItem(evt, client, item, mob, data, extra_data, extra_pointers);
            if(i != 0) {
                ret = i;
            }
			return ret;
		} else {
			_item_quest_status[item_id] = QuestFailedToLoad;
			return DispatchEventItem(evt, client, item, mob, data, extra_data, extra_pointers);
		}
	}
	return 0;
}
开发者ID:UnityEQ,项目名称:UnityEQServer,代码行数:47,代码来源:quest_parser_collection.cpp

示例6: GetQIByGlobalPlayerQuest

int QuestParserCollection::EventPlayerGlobal(QuestEventID evt, Client *client, std::string data, uint32 extra_data,
											 std::vector<void*> *extra_pointers) {
	if(_global_player_quest_status == QuestUnloaded) {
		std::string filename;
		QuestInterface *qi = GetQIByGlobalPlayerQuest(filename);
		if(qi) {
			_global_player_quest_status = qi->GetIdentifier();
			qi->LoadGlobalPlayerScript(filename);
			return qi->EventGlobalPlayer(evt, client, data, extra_data, extra_pointers);
		}
	} else { 
		if(_global_player_quest_status != QuestFailedToLoad) {
			std::map<uint32, QuestInterface*>::iterator iter = _interfaces.find(_global_player_quest_status);
			return iter->second->EventGlobalPlayer(evt, client, data, extra_data, extra_pointers);
		}
	}
	return 0;
}
开发者ID:badcaptain,项目名称:Server,代码行数:18,代码来源:QuestParserCollection.cpp

示例7: GetQIByGlobalNPCQuest

int QuestParserCollection::EventNPCGlobal(QuestEventID evt, NPC* npc, Mob *init, std::string data, uint32 extra_data,
										  std::vector<void*> *extra_pointers) {
	if(_global_npc_quest_status != QuestUnloaded && _global_npc_quest_status != QuestFailedToLoad) {
		std::map<uint32, QuestInterface*>::iterator qiter = _interfaces.find(_global_npc_quest_status);
		return qiter->second->EventGlobalNPC(evt, npc, init, data, extra_data, extra_pointers);
	} else {
		std::string filename;
		QuestInterface *qi = GetQIByGlobalNPCQuest(filename);
		if(qi) {
			_global_npc_quest_status = qi->GetIdentifier();
			qi->LoadGlobalNPCScript(filename);
			return qi->EventGlobalNPC(evt, npc, init, data, extra_data, extra_pointers);
		} else {
			_global_npc_quest_status = QuestFailedToLoad;
		}
	}
	return 0;
}
开发者ID:badcaptain,项目名称:Server,代码行数:18,代码来源:QuestParserCollection.cpp

示例8: GetQIByPlayerQuest

int QuestParserCollection::EventPlayerLocal(QuestEventID evt, Client *client, std::string data, uint32 extra_data,
											std::vector<EQEmu::Any> *extra_pointers) {
	if(_player_quest_status == QuestUnloaded) {
		std::string filename;
		QuestInterface *qi = GetQIByPlayerQuest(filename);
		if(qi) {
			_player_quest_status = qi->GetIdentifier();
			qi->LoadPlayerScript(filename);
			return qi->EventPlayer(evt, client, data, extra_data, extra_pointers);
		}
	} else { 
		if(_player_quest_status != QuestFailedToLoad) {
			auto iter = _interfaces.find(_player_quest_status);
			return iter->second->EventPlayer(evt, client, data, extra_data, extra_pointers);
		}
	}
	return 0;
}
开发者ID:N0ctrnl,项目名称:VAServer,代码行数:18,代码来源:quest_parser_collection.cpp

示例9: GetQIBySpellQuest

bool QuestParserCollection::SpellHasQuestSub(uint32 spell_id, QuestEventID evt) {
	std::map<uint32, uint32>::iterator iter = _spell_quest_status.find(spell_id);
	if(iter != _spell_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->SpellHasQuestSub(spell_id, evt);
		}
	} else {
		std::string filename;
		QuestInterface *qi = GetQIBySpellQuest(spell_id, filename);
		if(qi) {
			_spell_quest_status[spell_id] = qi->GetIdentifier();
			qi->LoadSpellScript(filename, spell_id);
			return qi->SpellHasQuestSub(spell_id, evt);
		} else {
			_spell_quest_status[spell_id] = QuestFailedToLoad;
		}
	}
	return false;
}
开发者ID:badcaptain,项目名称:Server,代码行数:21,代码来源:QuestParserCollection.cpp

示例10: GetQIByEncounterQuest

int QuestParserCollection::EventEncounter(QuestEventID evt, std::string encounter_name, uint32 extra_data,
										  std::vector<void*> *extra_pointers) {
	auto iter = _encounter_quest_status.find(encounter_name);
	if(iter != _encounter_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->EventEncounter(evt, encounter_name, extra_data, extra_pointers);
		}
	} else {
		std::string filename;
		QuestInterface *qi = GetQIByEncounterQuest(encounter_name, filename);
		if(qi) {
			_encounter_quest_status[encounter_name] = qi->GetIdentifier();
			qi->LoadEncounterScript(filename, encounter_name);
			return qi->EventEncounter(evt, encounter_name, extra_data, extra_pointers);
		} else {
			_encounter_quest_status[encounter_name] = QuestFailedToLoad;
		}
	}
	return 0;
}
开发者ID:badcaptain,项目名称:Server,代码行数:22,代码来源:QuestParserCollection.cpp


注:本文中的QuestInterface类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。