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


C# BaseCreature.SetSkill方法代码示例

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


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

示例1: SetStats

        public static void SetStats( BaseCreature steed )
        {
            steed.SetStr( 201, 210 );
            steed.SetDex( 101, 110 );
            steed.SetInt( 101, 115 );

            steed.SetHits( 201, 220 );

            steed.SetDamage( 20, 24 );

            steed.SetDamageType( ResistanceType.Physical, 25 );
            steed.SetDamageType( ResistanceType.Fire, 75 );

            steed.SetResistance( ResistanceType.Physical, 60, 70 );
            steed.SetResistance( ResistanceType.Fire, 90 );
            steed.SetResistance( ResistanceType.Poison, 100 );

            steed.SetSkill( SkillName.MagicResist, 90.1, 110.0 );
            steed.SetSkill( SkillName.Tactics, 50.0 );
            steed.SetSkill( SkillName.Wrestling, 90.1, 110.0 );

            steed.Fame = 0;
            steed.Karma = 0;
        }
开发者ID:felladrin,项目名称:runuo-pt-br,代码行数:24,代码来源:HellSteed.cs

示例2: Summon

        public static void Summon( BaseCreature creature, Mobile caster, int sound, TimeSpan duration, bool scaleDuration, bool scaleStats )
        {
            Map map = caster.Map;

            if( map == null )
                return;

            double scale = 1.0 + ((caster.Skills[SkillName.Magery].Value - 100.0) / 200.0);

            if( scaleDuration )
                duration = TimeSpan.FromSeconds(duration.TotalSeconds * scale);

            if ( creature != null && creature.ControlMaster != null && creature.ControlMaster is Player)
            {
                Summoner sum = Perk.GetByType<Summoner>((Player)creature.ControlMaster);

                if (sum != null && sum.Remanence())
                {
                    duration += TimeSpan.FromSeconds(90.0);
                }

            }

            Point3D p = new Point3D(caster);

            if( SpellHelper.FindValidSpawnLocation(map, ref p, true) )
            {
                BaseCreature.Summon(creature, caster, p, sound, duration);

                if (creature != null && creature.ControlMaster != null && creature.ControlMaster is Player)
                {
                    Summoner sum = Perk.GetByType<Summoner>((Player)creature.ControlMaster);

                    if (sum != null && sum.IntelligentDesign())
                    {
                        creature.SetSkill(SkillName.Wrestling, creature.Skills.Wrestling.Value + Utility.RandomMinMax(15, 20));
                        creature.SetSkill(SkillName.Tactics, creature.Skills.Tactics.Value + Utility.RandomMinMax(20, 25));
                        creature.SetSkill(SkillName.MagicResist, creature.Skills.MagicResist.Value + Utility.RandomMinMax(30, 40));
                        creature.SetSkill(SkillName.Meditation, creature.Skills.Meditation.Value + Utility.RandomMinMax(30, 40));
                        creature.SetSkill(SkillName.Magery, creature.Skills.Magery.Value + Utility.RandomMinMax(15, 20));
                        creature.SetSkill(SkillName.EvalInt, creature.Skills.EvalInt.Value + Utility.RandomMinMax(15, 20));
                    }

                    if (sum != null && sum.SecondNature())
                    {
                        creature.HitsMaxSeed += (int)(creature.HitsMaxSeed * 0.33) + Utility.RandomMinMax(20, 40);
                        creature.Hits = creature.HitsMax;
                    }

                    if (sum != null && sum.Horde())
                    {

                        for(int x = 1; x <= 3; x ++)
                        {
                            if (creature.ControlMaster.Followers + creature.ControlSlots <= creature.ControlMaster.FollowersMax)
                            {
                                BaseCreature newSummon;
                                newSummon = Activator.CreateInstance(creature.GetType()) as BaseCreature;

                                if (SpellHelper.FindValidSpawnLocation(map, ref p, true))
                                    BaseCreature.Summon(newSummon, caster, p, sound, duration);

                                if (sum != null && sum.IntelligentDesign())
                                {
                                    newSummon.SetSkill(SkillName.Wrestling, creature.Skills.Wrestling.Value + Utility.RandomMinMax(15, 20));
                                    newSummon.SetSkill(SkillName.Tactics, creature.Skills.Tactics.Value + Utility.RandomMinMax(20, 25));
                                    newSummon.SetSkill(SkillName.MagicResist, creature.Skills.MagicResist.Value + Utility.RandomMinMax(30, 40));
                                    newSummon.SetSkill(SkillName.Meditation, creature.Skills.Meditation.Value + Utility.RandomMinMax(30, 40));
                                    newSummon.SetSkill(SkillName.Magery, creature.Skills.Magery.Value + Utility.RandomMinMax(15, 20));
                                    newSummon.SetSkill(SkillName.EvalInt, creature.Skills.EvalInt.Value + Utility.RandomMinMax(15, 20));
                                }

                                if (sum != null && sum.SecondNature())
                                {
                                    newSummon.HitsMaxSeed += (int)(newSummon.HitsMaxSeed * 0.33) + Utility.RandomMinMax(20, 40);
                                    newSummon.Hits = newSummon.HitsMax;
                                }
                            }
                        }
                    }
                }

                return;
            }

            creature.Delete();
            caster.SendLocalizedMessage(501942); // That location is blocked.
        }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:88,代码来源:SpellHelper.cs

示例3: CloneMe_OnCommand

        public static void CloneMe_OnCommand(CommandEventArgs e)
        {
            BaseCreature m = new BaseCreature(AIType.AI_None, FightMode.None, 10, 1, 0.2, 0.4);
            m.InitStats(10, 10, 10);
            m.SetSkill(SkillName.Cooking, 65, 88);
            m.SetSkill(SkillName.Snooping, 65, 88);
            m.SetSkill(SkillName.Stealing, 65, 88);
            if (m.Female = Utility.RandomBool())
            {
                m.Body = 0x1A6;
                m.Name = NameList.RandomName("female");

            }
            else
            {
                m.Body = 0x1A4;
                m.Name = NameList.RandomName("male");

            }
            e.Mobile.Hidden = true;
            m.Dex = e.Mobile.Dex;
            m.Int = e.Mobile.Int;
            m.Str = e.Mobile.Str;
            m.Fame = e.Mobile.Fame;
            m.Karma = e.Mobile.Karma;
            m.NameHue = e.Mobile.NameHue;
            m.SpeechHue = e.Mobile.SpeechHue;
            m.Criminal = e.Mobile.Criminal;
            m.Name = e.Mobile.Name;
            m.Title = e.Mobile.Title;
            m.Female = e.Mobile.Female;
            m.Body = e.Mobile.Body;
            m.Hue = e.Mobile.Hue;
            m.Hits = e.Mobile.HitsMax;
            m.Mana = e.Mobile.ManaMax;
            m.Stam = e.Mobile.StamMax;
            m.BodyMod = e.Mobile.Body;
            m.Map = e.Mobile.Map;
            m.Location = e.Mobile.Location;
            m.Direction = e.Mobile.Direction;
            m.HairItemID = e.Mobile.HairItemID;
            m.FacialHairItemID = e.Mobile.FacialHairItemID;
            m.HairHue = e.Mobile.HairHue;
            m.FacialHairHue = e.Mobile.FacialHairHue;

            for (int i = 0; i < e.Mobile.Skills.Length; i++)
                m.Skills[i].Base = e.Mobile.Skills[i].Base;

            ArrayList items = new ArrayList(e.Mobile.Items);
            for (int i = 0; i < items.Count; i++)
            {
                Item item = (Item)items[i]; //my favorite line of code, ever.

                if (((item != null) && (item.Parent == e.Mobile) && (item != e.Mobile.Backpack)))
                {
                    Type t = item.GetType();
                    ConstructorInfo c = t.GetConstructor(Type.EmptyTypes);
                    if (c != null)
                    {
                        try
                        {
                            object o = c.Invoke(null);
                            if (o != null && o is Item)
                            {
                                Item newItem = (Item)o;
                                CopyProperties(newItem, item);
                                item.OnAfterDuped(newItem);
                                newItem.Parent = null;
                                m.AddItem(newItem);
                            }
                        }
                        catch
                        {
                        }
                    }
                }
            }
        }
开发者ID:FreeReign,项目名称:runuo-extended,代码行数:78,代码来源:StaffCommands.cs

示例4: Corrupt

        public static void Corrupt(BaseCreature bc)
        {
            if (bc.IsCorrupt || HalloweenEventController.Instance == null)
            {
                return;
            }

            SkillName[] skills = ((SkillName) 0).GetValues<SkillName>();

            bc.SpecialTitle = "[Spirit of Halloween]";

            int hue = Utility.RandomBool() ? 1358 : 1378;

            bc.Hue = hue;

            bc.SolidHueOverride = hue;

            bc.TitleHue = hue;

            bc.BloodHue = hue;

            if (bc.HitsMaxSeed >= 0)
            {
                bc.HitsMaxSeed = (int) (bc.HitsMaxSeed * HalloweenEventController.HitsBuff);
            }

            bc.RawStr = (int) (bc.RawStr * HalloweenEventController.StrBuff);
            bc.RawInt = (int) (bc.RawInt * HalloweenEventController.IntBuff);
            bc.RawDex = (int) (bc.RawDex * HalloweenEventController.DexBuff);

            bc.Hits = bc.HitsMax;
            bc.Mana = bc.ManaMax;
            bc.Stam = bc.StamMax;

            bc.Tamable = false;

            foreach (SkillName skill in skills)
            {
                bc.SetSkill(skill, 100.0, 120.0);
            }

            bc.PassiveSpeed /= HalloweenEventController.SpeedBuff;
            bc.ActiveSpeed /= HalloweenEventController.SpeedBuff;
            bc.CurrentSpeed = bc.PassiveSpeed;

            bc.DamageMin += HalloweenEventController.DamageBuff;
            bc.DamageMax += HalloweenEventController.DamageBuff;

            if (bc.Fame > 0)
            {
                bc.Fame = (int) (bc.Fame * HalloweenEventController.FameBuff);
            }

            if (bc.Fame > 32000)
            {
                bc.Fame = 32000;
            }

            if (bc.Karma == 0)
            {
                return;
            }

            bc.Karma = (int) (bc.Karma * HalloweenEventController.KarmaBuff);

            if (Math.Abs(bc.Karma) > 32000)
            {
                bc.Karma = 32000 * Math.Sign(bc.Karma);
            }
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:70,代码来源:HalloweenCorruption.cs


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