public override void BuildPacket() { this.PushIntoStack(enchant == null ? 0 : enchant.EnchantID); this.PushIntoStack(enchant == null ? string.Empty : enchant.EnchantName.ToNotNullString()); this.PushIntoStack(enchant == null ? string.Empty : enchant.HeadID.ToNotNullString()); this.PushIntoStack(userEnchantInfo == null ? (short)0 : (short)userEnchantInfo.EnchantLv); this.PushIntoStack(enchant == null ? (short)0 : (short)enchant.ColorType); PushIntoStack(currExp); PushIntoStack(upExp); this.PushIntoStack(userEnchantInfo == null ? (short)0 : (short)userEnchantInfo.MaxMature); this.PushIntoStack(TrumpHelper.GetTransformData(finalMature).ToNotNullString()); this.PushIntoStack(enchantLvInfo == null ? 0 : enchantLvInfo.CoinPrice); this.PushIntoStack(enchantLvInfo == null ? 0 : enchantLvInfo.MoJingPrice); this.PushIntoStack(enchant == null ? (short)0 : (short)enchant.AbilityType); this.PushIntoStack(enchantLvInfo == null ? string.Empty :TrumpHelper.GetTransformData(enchantLvInfo.Num).ToNotNullString()); }
public override bool TakeAction() { var package = UserEnchant.Get(ContextUser.UserID); if (package != null) { userEnchant = package.EnchantPackage.Find(m => m.UserEnchantID == userEnchantID); if (userEnchant != null) { matureNum = (decimal)userEnchant.MaxMature / GameConfigSet.MaxEnchantMature; maxMature = CombatHelper.EnchantFinalNum(userEnchant); enchantInfo = new ConfigCacheSet <EnchantInfo>().FindKey(userEnchant.EnchantID); EnchantLvInfo enchantLvInfo = new ConfigCacheSet <EnchantLvInfo>().FindKey(userEnchant.EnchantID, userEnchant.EnchantLv); if (enchantLvInfo != null) { abilityNum = TrumpHelper.GetTransformData(enchantLvInfo.Num); } } } enchantList = EnchantHelper.EnchantCultureList(); return(true); }
public override void BuildPacket() { this.PushIntoStack(enchantInfo == null ? string.Empty : enchantInfo.EnchantName.ToNotNullString()); this.PushIntoStack(enchantInfo == null ? string.Empty : enchantInfo.HeadID.ToNotNullString()); this.PushIntoStack(userEnchant == null ? (short)0 : (short)userEnchant.EnchantLv); this.PushIntoStack(enchantInfo == null ? (short)0 : (short)enchantInfo.ColorType); this.PushIntoStack(matureNum.ToNotNullString()); this.PushIntoStack(TrumpHelper.GetTransformData(maxMature).ToNotNullString()); this.PushIntoStack(enchantInfo == null ? (short)0 : (short)enchantInfo.AbilityType); this.PushIntoStack(abilityNum.ToNotNullString()); this.PushIntoStack(enchantList.Count); foreach (var culTure in enchantList) { DataStruct dsItem = new DataStruct(); dsItem.PushIntoStack((short)culTure.CultureType); dsItem.PushIntoStack(culTure.MoJingNum); dsItem.PushIntoStack(culTure.GoldNum); dsItem.PushIntoStack((int)culTure.UpMature); dsItem.PushIntoStack(culTure.SuccessNum.ToNotNullString()); dsItem.PushIntoStack(IsMeet(ContextUser, culTure) ? (short)1 : (short)0); this.PushIntoStack(dsItem); } }
public override bool TakeAction() { UserTrump userTrump = new PersonalCacheStruct <UserTrump>().FindKey(ContextUser.UserID, TrumpInfo.CurrTrumpID); if (userTrump != null) { worshipLv = userTrump.WorshipLv; short upWorshLv = MathUtils.Addition(userTrump.WorshipLv, (short)1, (short)10); totalNum = userTrump.PropertyInfo.Count; worshipInfo = new ShareCacheStruct <WorshipInfo>().FindKey(TrumpInfo.CurrTrumpID, upWorshLv); if (worshipInfo != null) { successNum = TrumpHelper.GetTransformData(worshipInfo.SuccessNum); int upItemNum = TrumpHelper.GetUserItemNum(ContextUser.UserID, worshipInfo.ItemID); if (upItemNum >= worshipInfo.ItemNum) { isItem = 1; } if (ContextUser.GameCoin >= worshipInfo.GameCoin) { isCoin = 1; } if (ContextUser.ObtainNum >= worshipInfo.ObtainNum) { isObtain = 1; } ItemBaseInfo itemInfo = new ShareCacheStruct <ItemBaseInfo>().FindKey(worshipInfo.ItemID); if (itemInfo != null) { itemName = itemInfo.ItemName; } } } worshipInfoInfoArray = new ShareCacheStruct <WorshipInfo>().FindAll(m => m.IsOpen && m.TrumpID == TrumpInfo.CurrTrumpID).ToArray(); return(true); }