public uint Execute(PacketDistributed ipacket) { CG_MOUNT_UNMOUNT packet = (CG_MOUNT_UNMOUNT )ipacket; if (null == packet) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } //enter your logic Games.LogicObj.Obj_MainPlayer mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer; if (mainPlayer != null) { mainPlayer.NoPlayerStopMountSound(); } return((uint)PACKET_EXE.PACKET_EXE_CONTINUE); }
/// <summary> /// 筛选装备强化材料 /// </summary> /// <param name="list"></param> /// <returns></returns> static public List <GameItem> EnchanceMaterialFilter(List <GameItem> list, bool valuable, bool auto = false) { List <GameItem> resultlist = new List <GameItem>(); resultlist.AddRange(list); //筛选规则1 材料需要是装备或者强化石 resultlist.RemoveAll(delegate(GameItem item) { if (item != null) { if (item.IsValid()) { if (item.GetClass() == (int)ItemClass.EQUIP) { return(false); } if (item.GetClass() == (int)ItemClass.STRENGTHEN && item.GetSubClass() == (int)StrengthenSubClass.EQUIP_ENCHANCE) { return(false); } } } return(true); }); //筛选规则2 腰带不能强化 resultlist.RemoveAll(delegate(GameItem item) { if (item != null) { if (item.IsValid()) { if (item.IsEquipMent()) { if (item.GetEquipSlotIndex() == (int)EquipPackSlot.Slot_BELT) { return(true); } } } } return(false); }); //筛选规则3 装备等级高于玩家20级以上 不能作为材料 int PlayerLevel = GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Level; //resultlist.RemoveAll(delegate(GameItem item) //{ // if (item != null) // { // if (item.IsValid()) // { // if (item.IsEquipMent()) // { // if (item.GetEquipLevel() > (PlayerLevel + 20)) // { // return true; // } // } // } // } // return false; //}); if (auto == true) { // 自动挂机,戒指跟吊坠不得作为材料 resultlist.RemoveAll(delegate(GameItem item) { if (item != null) { if (item.IsValid()) { if (item.IsEquipMent()) { if (item.GetEquipSlotIndex() == (int)EquipPackSlot.Slot_AMULET || item.GetEquipSlotIndex() == (int)EquipPackSlot.Slot_RING) { return(true); } } } } return(false); }); } if (valuable == true) { //筛选规则4 紫色橙色 && 需求等级与玩家等级相差在正负20级以内 && 不绑定可交易 不能作为材料 resultlist.RemoveAll(delegate(GameItem item) { if (item != null) { if (item.IsValid()) { if (item.IsEquipMent()) { if (item.GetQuality() == ItemQuality.QUALITY_PURPLE || item.GetQuality() == ItemQuality.QUALITY_ORANGE) { if (item.GetEquipLevel() <= (PlayerLevel + 20) || item.GetEquipLevel() >= (PlayerLevel - 20)) { // if (ConsignSaleBag.isCanConsignSale(item)) { return(true); } } } } } } return(false); }); //筛选规则5 紫色橙色 && 符合玩家职业 && 基础属性大于当前装备位 不能作为材料 resultlist.RemoveAll(delegate(GameItem item) { if (item != null) { if (item.IsValid()) { if (item.IsEquipMent()) { if (item.GetQuality() == ItemQuality.QUALITY_PURPLE || item.GetQuality() == ItemQuality.QUALITY_ORANGE) { Games.LogicObj.Obj_MainPlayer mainPlayer = Singleton <ObjManager> .Instance.MainPlayer; if (null == mainPlayer) { LogModule.ErrorLog("mainplayer is null"); return(false); } int nPlayerProfession = mainPlayer.Profession; if (item.GetProfessionRequire() == nPlayerProfession || item.GetProfessionRequire() == -1) { int slotindex = item.GetEquipSlotIndex(); GameItem compareEquip = GameManager.gameManager.PlayerDataPool.EquipPack.GetItem(slotindex); if (compareEquip != null) { if (compareEquip.IsValid() == false || item.GetCombatValue_NoStarEnchance() > compareEquip.GetCombatValue_NoStarEnchance()) { return(true); } } } } } } } return(false); }); //筛选规则6 护符和戒指不能强化 resultlist.RemoveAll(delegate(GameItem item) { if (item != null) { if (item.IsValid()) { if (item.IsEquipMent()) { if (item.GetEquipSlotIndex() == (int)EquipPackSlot.Slot_AMULET || item.GetEquipSlotIndex() == (int)EquipPackSlot.Slot_RING) { return(true); } } } } return(false); }); } return(ItemSort(resultlist)); }