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


C++ ItemInst::GetOrnamentationIcon方法代码示例

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


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

示例1: HandleCombine

// Perform tradeskill combine
void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Object *worldo)
{
	if (!user || !in_combine) {
		Log.Out(Logs::General, Logs::Error, "Client or NewCombine_Struct not set in Object::HandleCombine");
		return;
	}

	Inventory& user_inv = user->GetInv();
	PlayerProfile_Struct& user_pp = user->GetPP();
	ItemInst* container = nullptr;
	ItemInst* inst = nullptr;
	uint8 c_type = 0xE8;
	uint32 some_id = 0;
	bool worldcontainer=false;

	if (in_combine->container_slot == legacy::SLOT_TRADESKILL) {
		if(!worldo) {
			user->Message(13, "Error: Server is not aware of the tradeskill container you are attempting to use");
			return;
		}
		c_type = worldo->m_type;
		inst = worldo->m_inst;
		worldcontainer=true;
	}
	else {
		inst = user_inv.GetItem(in_combine->container_slot);
		if (inst) {
			const Item_Struct* item = inst->GetItem();
			if (item && inst->IsType(ItemClassContainer)) {
				c_type = item->BagType;
				some_id = item->ID;
			}
		}
	}

	if (!inst || !inst->IsType(ItemClassContainer)) {
		user->Message(13, "Error: Server does not recognize specified tradeskill container");
		return;
	}

	container = inst;
	if (container->GetItem() && container->GetItem()->BagType == BagTypeTransformationmold) {
		const ItemInst* inst = container->GetItem(0);
		bool AllowAll = RuleB(Inventory, AllowAnyWeaponTransformation);
		if (inst && ItemInst::CanTransform(inst->GetItem(), container->GetItem(), AllowAll)) {
			const Item_Struct* new_weapon = inst->GetItem();
			user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
			container->Clear();
			user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2));
			user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
			if (RuleB(Inventory, DeleteTransformationMold))
				user->DeleteItemInInventory(in_combine->container_slot, 0, true);
		}
		else if (inst) {
			user->Message_StringID(4, TRANSFORM_FAILED, inst->GetItem()->Name);
		}
		EQApplicationPacket* outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
		user->QueuePacket(outapp);
		safe_delete(outapp);
		return;
	}

	if (container->GetItem() && container->GetItem()->BagType == BagTypeDetransformationmold) {
		const ItemInst* inst = container->GetItem(0);
		if (inst && inst->GetOrnamentationIcon() && inst->GetOrnamentationIcon()) {
			const Item_Struct* new_weapon = inst->GetItem();
			user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
			container->Clear();
			user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, 0, 0);
			user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
		}
		else if (inst) {
			user->Message_StringID(4, DETRANSFORM_FAILED, inst->GetItem()->Name);
		}
		EQApplicationPacket* outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
		user->QueuePacket(outapp);
		safe_delete(outapp);
		return;
	}

	DBTradeskillRecipe_Struct spec;
	if (!database.GetTradeRecipe(container, c_type, some_id, user->CharacterID(), &spec)) {
		user->Message_StringID(MT_Emote,TRADESKILL_NOCOMBINE);
		EQApplicationPacket* outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
		user->QueuePacket(outapp);
		safe_delete(outapp);
		return;
	}

	// Character hasn't learnt the recipe yet.
	// must_learn:
	// bit 1 (0x01): recipe can't be experimented
	// bit 2 (0x02): can try to experiment but not useable for auto-combine until learnt
	// bit 5 (0x10): no learn message, use unlisted flag to prevent it showing up on search
	// bit 6 (0x20): unlisted recipe flag
	if ((spec.must_learn&0xF) == 1 && !spec.has_learnt) {
		// Made up message for the client. Just giving a DNC is the other option.
		user->Message(4, "You need to learn how to combine these first.");
		EQApplicationPacket* outapp = new EQApplicationPacket(OP_TradeSkillCombine, 0);
//.........这里部分代码省略.........
开发者ID:rencro,项目名称:Server,代码行数:101,代码来源:tradeskills.cpp


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