示例#1
0
        /// <summary>
        /// 创建Buff,以天为单位
        /// </summary>
        /// <param name="template"></param>
        /// <param name="ValidDate"></param>
        /// <returns></returns>
        public static AbstractBuffer CreateBuffer(ItemTemplateInfo template, int ValidDate)
        {
            BufferInfo buffer = new BufferInfo();

            buffer.BeginDate = DateTime.Now;
            buffer.ValidDate = ValidDate * 24 * 60;
            buffer.Value     = template.Property2;
            buffer.Type      = template.Property1;
            buffer.IsExist   = true;
            return(CreateBuffer(buffer));
        }
        public override bool CancelFinish(GamePlayer player)
        {
            ItemTemplateInfo itemTemplateInfo = ItemMgr.FindItemTemplate(this.m_info.Para1);

            if (itemTemplateInfo != null)
            {
                ItemInfo cloneItem = ItemInfo.CreateFromTemplate(itemTemplateInfo, this.m_info.Para2, 117);
                return(player.AddTemplate(cloneItem, eBageType.TempBag, this.m_info.Para2));
            }
            return(false);
        }
示例#3
0
 public static AbstractBuffer CreateBufferMinute(ItemTemplateInfo template, int ValidMinute)
 {
     return(BufferList.CreateBuffer(new BufferInfo
     {
         BeginDate = DateTime.Now,
         ValidDate = ValidMinute,
         Value = template.Property2,
         Type = template.Property1,
         IsExist = true
     }));
 }
示例#4
0
 public static void ExecuteSpell(BaseGame game, Player player, ItemTemplateInfo item)
 {
     try
     {
         ISpellHandler spellHandler = SpellMgr.LoadSpellHandler(item.Property1);
         spellHandler.Execute(game, player, item);
     }
     catch (Exception ex)
     {
         SpellMgr.log.Error("Execute Spell Error:", ex);
     }
 }
示例#5
0
 public bool UseItem(ItemTemplateInfo item)
 {
     if (this.CanUseItem(item))
     {
         this.m_energy -= item.Property4;
         this.m_delay  += item.Property5;
         this.m_game.SendPlayerUseProp(this, -2, -2, item.TemplateID);
         SpellMgr.ExecuteSpell(this.m_game, this.m_game.CurrentLiving as Player, item);
         return(true);
     }
     return(false);
 }
示例#6
0
        public void SetCurrentWeapon(ItemTemplateInfo item)
        {
            this.m_weapon = item;
            BallConfigInfo ballConfigInfo = BallConfigMgr.FindBall(this.m_weapon.TemplateID);

            this.m_mainBallId     = ballConfigInfo.Common;
            this.m_spBallId       = ballConfigInfo.Special;
            this.m_sp2BallId      = ballConfigInfo.SpecialII;
            this.m_AddWoundBallId = ballConfigInfo.CommonAddWound;
            this.m_MultiBallId    = ballConfigInfo.CommonMultiBall;
            this.SetBall(this.m_mainBallId);
        }
        /// <summary>
        /// Gets the MVVM cross view.
        /// </summary>
        /// <param name="itemTemplateInfo">The item template information.</param>
        /// <param name="tokens">The tokens.</param>
        /// <param name="viewTemplateName">Name of the view template.</param>
        /// <param name="viewName">Name of the view.</param>
        /// <returns></returns>
        public TextTemplateInfo GetMvvmCrossView(
            ItemTemplateInfo itemTemplateInfo,
            Dictionary <string, string> tokens,
            string viewTemplateName,
            string viewName)
        {
            TraceService.WriteLine("MvvmCrossViewFactory::GetMvvmCrossView viewTemplateName=" + viewTemplateName);

            if (itemTemplateInfo.ProjectSuffix == this.SettingsService.iOSProjectSuffix)
            {
                return(this.GetiOSMvvmCrossView(
                           itemTemplateInfo,
                           tokens,
                           viewTemplateName,
                           viewName));
            }

            TextTemplateInfo textTemplateInfo = new TextTemplateInfo
            {
                ProjectSuffix     = itemTemplateInfo.ProjectSuffix,
                ProjectFolder     = "Views",
                Tokens            = tokens,
                ShortTemplateName = viewTemplateName,
                TemplateName      = this.SettingsService.ItemTemplatesDirectory + "\\" + itemTemplateInfo.ProjectType + "\\" + viewTemplateName
            };

            TextTransformationRequest textTransformationRequest = new TextTransformationRequest
            {
                SourceFile        = textTemplateInfo.TemplateName,
                Parameters        = textTemplateInfo.Tokens,
                RemoveFileHeaders = this.SettingsService.RemoveDefaultFileHeaders,
                RemoveXmlComments = this.SettingsService.RemoveDefaultComments,
                RemoveThisPointer = this.SettingsService.RemoveThisPointer
            };

            TextTransformation textTransformation = this.GetTextTransformationService().Transform(textTransformationRequest);

            textTemplateInfo.TextOutput = textTransformation.Output;
            textTemplateInfo.FileName   = viewName + "." + textTransformation.FileExtension;

            if (itemTemplateInfo.ProjectSuffix == this.SettingsService.DroidProjectSuffix)
            {
                textTemplateInfo.FileOperations.Add(
                    this.GetCompileFileOperation(textTemplateInfo.ProjectSuffix, textTemplateInfo.FileName));
            }
            else
            {
                textTemplateInfo.FileOperations.Add(
                    this.GetPageFileOperation(textTemplateInfo.ProjectSuffix, textTemplateInfo.FileName));
            }

            return(textTemplateInfo);
        }
示例#8
0
        public ItemInfo GetItemInfo()
        {
            ItemInfo item = null;

            if (this.SecondWeapon != 0)
            {
                ItemTemplateInfo secondWeaponTemp = ItemMgr.FindItemTemplate(this.SecondWeapon);
                item = ItemInfo.CreateFromTemplate(secondWeaponTemp, 1, 1);
                item.StrengthenLevel = this.StrengthLevel;
            }
            return(item);
        }
示例#9
0
 public static AbstractBuffer CreateBufferHour(ItemTemplateInfo template, int ValidHour)
 {
     return(BufferList.CreateBuffer(new BufferInfo
     {
         BeginDate = DateTime.Now,
         ValidDate = ValidHour * 60,
         Value = template.Property2,
         Type = template.Property1,
         ValidCount = 1,
         IsExist = true
     }));
 }
示例#10
0
文件: Player.cs 项目: uvbs/DDTank-3.0
        public void SetCurrentWeapon(ItemTemplateInfo item)
        {
            m_weapon = item;
            //m_mainBallId = m_weapon.Property1;
            //m_spBallId = m_weapon.Property2;
            var ballConfig = BallConfigMgr.FindBall(m_weapon.TemplateID);

            m_mainBallId = ballConfig.Common;
            m_spBallId   = ballConfig.Special;

            SetBall(m_mainBallId);
        }
示例#11
0
        public void SetCurrentWeapon(ItemTemplateInfo item)
        {
            m_weapon = item;
            var ballConfig = BallConfigMgr.FindBall(m_weapon.TemplateID);

            m_mainBallId     = ballConfig.Common;
            m_spBallId       = ballConfig.Special;
            m_sp2BallId      = ballConfig.SpecialII;
            m_AddWoundBallId = ballConfig.CommonAddWound;
            m_MultiBallId    = ballConfig.CommonMultiBall;
            SetBall(m_mainBallId);
        }
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            GSPacketIn gSPacketIn = new GSPacketIn(61, client.Player.PlayerCharacter.ID);

            new StringBuilder();
            int      num            = 40000;
            bool     tranHole       = packet.ReadBoolean();
            bool     tranHoleFivSix = packet.ReadBoolean();
            ItemInfo itemInfo       = client.Player.StoreBag.GetItemAt(0);
            ItemInfo itemInfo2      = client.Player.StoreBag.GetItemAt(1);

            if (itemInfo != null && itemInfo2 != null && itemInfo.Template.CategoryID == itemInfo2.Template.CategoryID && itemInfo2.Count == 1 && itemInfo.Count == 1 && itemInfo.IsValidItem() && itemInfo2.IsValidItem())
            {
                if (client.Player.PlayerCharacter.Gold < num)
                {
                    client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("itemtransferhandler.nogold", new object[0]));
                    return(1);
                }
                client.Player.RemoveGold(num);
                if (itemInfo.Template.CategoryID == 7 || itemInfo2.Template.CategoryID == 7)
                {
                    ItemInfo itemInfo3   = null;
                    ItemInfo itemInfo4   = null;
                    int      templateID  = itemInfo.TemplateID;
                    int      templateID2 = itemInfo2.TemplateID;
                    this.GetWeaponID(ref templateID, ref templateID2);
                    ItemTemplateInfo itemTemplateInfo  = ItemMgr.FindItemTemplate(templateID);
                    ItemTemplateInfo itemTemplateInfo2 = ItemMgr.FindItemTemplate(templateID2);
                    if (itemTemplateInfo != null)
                    {
                        itemInfo3 = ItemInfo.CreateWeapon(itemTemplateInfo, itemInfo, 116);
                    }
                    itemInfo = itemInfo3;
                    if (itemTemplateInfo2 != null)
                    {
                        itemInfo4 = ItemInfo.CreateWeapon(itemTemplateInfo2, itemInfo2, 116);
                    }
                    itemInfo2 = itemInfo4;
                }
                StrengthenMgr.InheritTransferProperty(ref itemInfo, ref itemInfo2, tranHole, tranHoleFivSix);
                client.Player.StoreBag.ClearBag();
                client.Player.StoreBag.AddItemTo(itemInfo, 0);
                client.Player.StoreBag.AddItemTo(itemInfo2, 1);
                gSPacketIn.WriteByte(0);
                client.Out.SendTCP(gSPacketIn);
            }
            else
            {
                client.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("itemtransferhandler.nocondition", new object[0]));
            }
            return(0);
        }
示例#13
0
文件: Player.cs 项目: uvbs/DDTank-3.0
        public override void Reset()
        {
            m_maxBlood = (int)((950 + m_player.PlayerCharacter.Grade * 50 + LevelPlusBlood + m_player.PlayerCharacter.Defence / 10) * m_player.GetBaseBlood());
            if (m_game.RoomType == eRoomType.Treasure || m_game.RoomType == eRoomType.Boss)
            {
                m_game.Cards = new int[21];
            }
            else
            {
                m_game.Cards = new int[8];
            }

            Dander         = 0;
            m_energy       = (m_player.PlayerCharacter.Agility / 30 + 240);
            IsLiving       = true;
            FinishTakeCard = false;
            m_weapon       = m_player.MainWeapon;
            //m_mainBallId = m_weapon.Property1;
            //m_spBallId = m_weapon.Property2;
            var ballConfig = BallConfigMgr.FindBall(m_weapon.TemplateID);

            m_mainBallId = ballConfig.Common;
            m_spBallId   = ballConfig.Special;
            BaseDamage   = m_player.GetBaseAttack();
            BaseGuard    = m_player.GetBaseDefence();

            Attack  = m_player.PlayerCharacter.Attack;
            Defence = m_player.PlayerCharacter.Defence;
            Agility = m_player.PlayerCharacter.Agility;
            Lucky   = m_player.PlayerCharacter.Luck;

            m_currentBall = BallMgr.FindBall(m_mainBallId);
            m_shootCount  = 1;
            m_ballCount   = 1;

            CurrentIsHitTarget = false;

            TotalCure           = 0;
            TotalHitTargetCount = 0;
            TotalHurt           = 0;
            TotalKill           = 0;
            TotalShootCount     = 0;
            LockDirection       = false;
            GainGP    = 0;
            GainOffer = 0;
            Ready     = false;
            PlayerDetail.ClearTempBag();

            LoadingProcess = 0;

            base.Reset();
        }
示例#14
0
        public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
        {
            NoHoleEffect effect = (NoHoleEffect)player.EffectList.GetOfType(typeof(NoHoleEffect));

            if (effect != null)
            {
                effect.Count = item.Property3;
            }
            else
            {
                new NoHoleEffect(item.Property3).Start(player);
            }
        }
示例#15
0
        /// <summary>
        /// 通过模板添加物品
        /// </summary>
        /// <param name="temp"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        public int AddItemTemplate(ItemTemplateInfo temp, int count)
        {
            //ItemInfo info = new ItemInfo(temp);
            ItemInfo info = ItemInfo.CreateFromTemplate(temp, count);

            if (info == null)
            {
                return(-1);
            }
            ItemInfo.BuyItemDate(info, 0);
            info.UserID = _player.PlayerCharacter.ID;
            return(AddItem(info));
        }
示例#16
0
        public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
        {
            player.ShootCount += item.Property2;

            if (item.Property2 == 2)
            {
                player.CurrentShootMinus *= 0.6f;
            }
            else
            {
                player.CurrentShootMinus *= 0.9f;
            }
        }
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            int             num        = (int)packet.ReadByte();
            int             num2       = packet.ReadInt();
            int             place      = packet.ReadInt();
            ItemInfo        itemAt     = client.Player.GetItemAt((eBageType)num2, place);
            PlayerInventory inventory  = client.Player.GetInventory((eBageType)num2);
            string          msg        = "Kích hoạt tiềm năng thành công!";
            GSPacketIn      gSPacketIn = new GSPacketIn(133, client.Player.PlayerCharacter.ID);

            if (num == 1)
            {
                int             num3       = packet.ReadInt();
                int             place2     = packet.ReadInt();
                ItemInfo        itemAt2    = client.Player.GetItemAt((eBageType)num3, place2);
                PlayerInventory inventory2 = client.Player.GetInventory((eBageType)num3);
                inventory2.RemoveCountFromStack(itemAt2, 1);
                ItemTemplateInfo itemTemplateInfo = ItemMgr.FindItemTemplate(itemAt2.TemplateID);
                int    property = itemTemplateInfo.Property3;
                string text     = property.ToString();
                for (int i = 1; i < 4; i++)
                {
                    text = text + "," + property.ToString();
                }
                if (itemAt.latentEnergyCurStr.Split(new char[]
                {
                    ','
                })[0] == "0")
                {
                    itemAt.latentEnergyCurStr = text;
                }
                itemAt.latentEnergyNewStr  = text;
                itemAt.latentEnergyEndTime = DateTime.Now.AddDays((double)itemTemplateInfo.Property4);
            }
            else
            {
                client.Player.MainBag.UpdatePlayerProperties();
                itemAt.latentEnergyCurStr = itemAt.latentEnergyNewStr;
                msg = "Cập nhật tiềm năng thành công!";
            }
            itemAt.IsBinds = true;
            inventory.UpdateItem(itemAt);
            inventory.SaveToDatabase();
            gSPacketIn.WriteInt(itemAt.Place);
            gSPacketIn.WriteString(itemAt.latentEnergyCurStr);
            gSPacketIn.WriteString(itemAt.latentEnergyNewStr);
            gSPacketIn.WriteDateTime(itemAt.latentEnergyEndTime);
            client.Out.SendTCP(gSPacketIn);
            client.Player.SendMessage(msg);
            return(0);
        }
示例#18
0
        public static ItemInfo CreateItem(ShopItemInfo shopItem, int addtype, int valuetype, string color, string skin, bool isBinding)
        {
            if (shopItem == null)
            {
                throw new ArgumentNullException("shopItem");
            }
            ItemTemplateInfo template = ItemMgr.FindItemTemplate(shopItem.TemplateID);
            ItemInfo         item     = ItemInfo.CreateFromTemplate(template, 1, addtype);

            if (0 == shopItem.BuyType)
            {
                if (1 == valuetype)
                {
                    item.ValidDate = shopItem.AUnit;
                }
                if (2 == valuetype)
                {
                    item.ValidDate = shopItem.BUnit;
                }
                if (3 == valuetype)
                {
                    item.ValidDate = shopItem.CUnit;
                }
            }
            else
            {
                if (1 == valuetype)
                {
                    item.Count = shopItem.AUnit;
                }
                if (2 == valuetype)
                {
                    item.Count = shopItem.BUnit;
                }
                if (3 == valuetype)
                {
                    item.Count = shopItem.CUnit;
                }
            }
            item.Color = ((color == null) ? "" : color);
            item.Skin  = ((skin == null) ? "" : skin);
            if (isBinding)
            {
                item.IsBinds = true;
            }
            else
            {
                item.IsBinds = Convert.ToBoolean(shopItem.IsBind);
            }
            return(item);
        }
示例#19
0
        public override void Reset()
        {
            this.m_maxBlood = this.m_player.PlayerCharacter.hp;
            if (this.m_game.RoomType == eRoomType.Dungeon)
            {
                this.m_game.Cards = new int[21];
            }
            else
            {
                this.m_game.Cards = new int[9];
            }
            base.Dander         = 0;
            base.PetMP          = 10;
            base.psychic        = 40;
            this.m_energy       = this.m_player.PlayerCharacter.Agility / 30 + 240;
            base.IsLiving       = true;
            this.FinishTakeCard = false;
            this.m_DeputyWeapon = this.m_player.SecondWeapon;
            this.m_weapon       = this.m_player.MainWeapon;
            BallConfigInfo ballConfigInfo = BallConfigMgr.FindBall(this.m_weapon.TemplateID);

            this.m_mainBallId        = ballConfigInfo.Common;
            this.m_spBallId          = ballConfigInfo.Special;
            this.m_sp2BallId         = ballConfigInfo.SpecialII;
            this.m_AddWoundBallId    = ballConfigInfo.CommonAddWound;
            this.m_MultiBallId       = ballConfigInfo.CommonMultiBall;
            this.BaseDamage          = this.m_player.GetBaseAttack();
            this.BaseGuard           = this.m_player.GetBaseDefence();
            this.Attack              = (double)this.m_player.PlayerCharacter.Attack;
            this.Defence             = (double)this.m_player.PlayerCharacter.Defence;
            this.Agility             = (double)this.m_player.PlayerCharacter.Agility;
            this.Lucky               = (double)this.m_player.PlayerCharacter.Luck;
            this.m_currentBall       = BallMgr.FindBall(this.m_mainBallId);
            this.m_shootCount        = 1;
            this.m_ballCount         = 1;
            this.m_prop              = 0;
            this.CurrentIsHitTarget  = false;
            this.TotalCure           = 0;
            this.TotalHitTargetCount = 0;
            this.TotalHurt           = 0;
            this.TotalKill           = 0;
            this.TotalShootCount     = 0;
            this.LockDirection       = false;
            this.GainGP              = 0;
            this.GainOffer           = 0;
            this.Ready               = false;
            this.PlayerDetail.ClearTempBag();
            this.LoadingProcess = 0;
            this.skillcu        = 0;
            base.Reset();
        }
示例#20
0
 public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
 {
     if (player.IsSpecialSkill)
     {
         return;
     }
     if ((player.CurrentBall.ID == 3 || player.CurrentBall.ID == 5 || player.CurrentBall.ID == 1) && item.TemplateID == 10003)
     {
         player.BallCount = 1;
         return;
     }
     player.CurrentDamagePlus *= 0.5f;
     player.BallCount          = item.Property2;
 }
示例#21
0
 public void ShowInfo(ItemTemplateInfo iti, ItemInfo ii, RectTransform targ)
 {
     if (rt == null)
     {
         Start();
     }
     rt.anchoredPosition = targ.anchoredPosition;
     itemName.text       = iti.Name;
     attackProp.text     = foreAtt + iti.Attack.ToString() + " (+" + ii.AttackCompose.ToString() + ")";
     agilityProp.text    = foreAgi + iti.Agility.ToString() + " (+" + ii.AgilityCompose.ToString() + ")";
     defenceProp.text    = foreDef + iti.Defence.ToString() + " (+" + ii.DefendCompose.ToString() + ")";
     luckProp.text       = foreLuc + iti.Luck.ToString() + " (+" + ii.LuckCompose.ToString() + ")";
     this.gameObject.SetActive(true);
 }
示例#22
0
 private static bool LoadProps(Dictionary <int, ItemTemplateInfo> allProp)
 {
     using (ProduceBussiness db = new ProduceBussiness())
     {
         ItemTemplateInfo[] list  = db.GetSingleCategory(10);
         ItemTemplateInfo[] array = list;
         for (int i = 0; i < array.Length; i++)
         {
             ItemTemplateInfo p = array[i];
             allProp.Add(p.TemplateID, p);
         }
     }
     return(true);
 }
示例#23
0
        public void RevertPetHandle(GameClient client, int place, string msg)
        {
            int num = Convert.ToInt32(PetMgr.FindConfig("RecycleCost").Value);

            if (client.Player.PlayerCharacter.Money >= num)
            {
                UsersPetinfo     petAt        = client.Player.PetBag.GetPetAt(place);
                UsersPetinfo     usersPetinfo = new UsersPetinfo();
                ItemTemplateInfo goods        = ItemMgr.FindItemTemplate(334100);
                ItemInfo         itemInfo     = ItemInfo.CreateFromTemplate(goods, 1, 0);
                itemInfo.IsBinds        = true;
                itemInfo.DefendCompose  = petAt.GP;
                itemInfo.AgilityCompose = petAt.MaxGP;
                if (!client.Player.PropBag.AddTemplate(itemInfo, 1))
                {
                    client.Player.SendItemToMail(itemInfo, LanguageMgr.GetTranslation("UserChangeItemPlaceHandler.full", new object[0]), LanguageMgr.GetTranslation("UserChangeItemPlaceHandler.full", new object[0]), eMailType.ItemOverdue);
                    client.Player.Out.SendMailResponse(client.Player.PlayerCharacter.ID, eMailRespose.Receiver);
                }
                int iD = petAt.ID;
                using (PlayerBussiness playerBussiness = new PlayerBussiness())
                {
                    usersPetinfo = playerBussiness.GetAdoptPetSingle(iD);
                }
                petAt.Blood   = usersPetinfo.Blood;
                petAt.Attack  = usersPetinfo.Attack;
                petAt.Defence = usersPetinfo.Defence;
                petAt.Agility = usersPetinfo.Agility;
                petAt.Luck    = usersPetinfo.Luck;
                int arg_158_0  = client.Player.PlayerCharacter.ID;
                int templateID = usersPetinfo.TemplateID;
                petAt.TemplateID = templateID;
                petAt.Skill      = usersPetinfo.Skill;
                petAt.SkillEquip = usersPetinfo.SkillEquip;
                petAt.GP         = 0;
                petAt.Level      = 1;
                petAt.MaxGP      = 55;
                bool flag = client.Player.PetBag.UpGracePet(petAt, place, false, 0, 0, ref msg);
                client.Player.SendMessage("Phục hồi thành công!");
                client.Player.RemoveMoney(num);
                if (flag)
                {
                    client.Player.Out.SendUpdatePetInfo(client.Player.PlayerCharacter, client.Player.PetBag.GetPets());
                    return;
                }
            }
            else
            {
                client.Player.SendMessage(msg);
            }
        }
示例#24
0
        public override bool CancelFinish(GamePlayer player)
        {
            ItemTemplateInfo template = ItemMgr.FindItemTemplate(m_info.Para1);

            if (template != null)
            {
                ItemInfo item = ItemInfo.CreateFromTemplate(template, m_info.Para2, (int)ItemAddType.TurnProperty);
                return(player.AddTemplate(item, eBageType.TempBag, m_info.Para2));
            }
            else
            {
                return(false);
            }
        }
示例#25
0
        /// <summary>
        /// 通过模板添加物品,成功返回ItemInfo实例,失败返回null。
        /// </summary>
        /// <param name="temp"></param>
        /// <returns></returns>
        public ItemInfo AddItemTemplate(ItemTemplateInfo temp)
        {
            ItemInfo info = ItemInfo.CreateFromTemplate(temp, 1);

            //info.Count = 1;
            if (AddItem(info) != -1)
            {
                return(info);
            }
            else
            {
                return(null);
            }
        }
示例#26
0
 private static bool LoadProps(Dictionary <int, ItemTemplateInfo> allProp)
 {
     using (ProduceBussiness produceBussiness = new ProduceBussiness())
     {
         ItemTemplateInfo[] singleCategory = produceBussiness.GetSingleCategory(10);
         ItemTemplateInfo[] array          = singleCategory;
         for (int i = 0; i < array.Length; i++)
         {
             ItemTemplateInfo itemTemplateInfo = array[i];
             allProp.Add(itemTemplateInfo.TemplateID, itemTemplateInfo);
         }
     }
     return(true);
 }
示例#27
0
        public bool TakeCard(Player player, int index)
        {
            if (player.CanTakeOut == false)
            {
                return(false);
            }

            if (player.IsActive == false || index < 0 || index > 7 || player.HasTakeCard || Cards[index] > 0)
            {
                return(false);
            }

            MapGoodsInfo info = MapMgr.GetRandomAward(m_map.Info.ID, m_map.Info.Type);

            bool isItem = false;
            int  value  = 100;

            if (info != null)
            {
                if (info.GoodsID > 0)
                {
                    ItemTemplateInfo temp = ItemMgr.GetSingleGoods(info.GoodsID);
                    if (temp != null)
                    {
                        isItem = true;
                        value  = info.GoodsID;
                        player.PlayerDetail.TempInventory.AddItemTemplate(temp, info);
                    }
                }
                else if (info.GoodsID == -1)
                {
                    value = info.Value;
                }
            }

            if (isItem == false)
            {
                value = player.PlayerDetail.AddGold(value);
            }

            player.HasTakeCard = true;
            Cards[index]       = 1;

            GSPacketIn pkg = player.PlayerDetail.Out.SendGamePlayerTakeCard(player, index, isItem, value);

            SendToAll(pkg, player.PlayerDetail);

            return(true);
        }
示例#28
0
 public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
 {
     if (!player.IsSpecialSkill)
     {
         if ((player.CurrentBall.ID == 3 || player.CurrentBall.ID == 5 || player.CurrentBall.ID == 1 || player.CurrentBall.ID == 64) && item.TemplateID == 10003)
         {
             player.BallCount = 1;
         }
         else
         {
             player.CurrentShootMinus *= 0.5f;
             player.BallCount          = item.Property2;
         }
     }
 }
示例#29
0
        public void AddBaseProperty(int templateid, ref int attack, ref int defence, ref int agility, ref int lucky)
        {
            ItemTemplateInfo temp = ItemMgr.FindItemTemplate(templateid);

            if (temp != null)
            {
                if (temp.CategoryID == 11 && temp.Property1 == 31 && temp.Property2 == 3)
                {
                    attack  += temp.Property3;
                    defence += temp.Property4;
                    agility += temp.Property5;
                    lucky   += temp.Property6;
                }
            }
        }
示例#30
0
 public void Execute(BaseGame game, Player player, ItemTemplateInfo item)
 {
     if ((player.CurrentBall.ID == 3 || player.CurrentBall.ID == 5 || player.CurrentBall.ID == 1) && (item.TemplateID == 10001 || item.TemplateID == 10002))
     {
         player.ShootCount = 1;
         return;
     }
     player.ShootCount += item.Property2;
     if (item.Property2 == 2)
     {
         player.CurrentShootMinus *= 0.6f;
         return;
     }
     player.CurrentShootMinus *= 0.9f;
 }