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


C# BaseCreature.GetLootingRights方法代码示例

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


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

示例1: CompileHelpersList

        private void CompileHelpersList(BaseCreature pirate)
        {
            if (Owner == null)
                return;
 
            Party p = Party.Get(Owner);
            List<DamageStore> rights = pirate.GetLootingRights();
 
            IPooledEnumerable eable = pirate.GetMobilesInRange(19);
            foreach (Mobile mob in eable)
            {
                if (mob == Owner || !(mob is PlayerMobile))
                    continue;
 
                Party mobParty = Party.Get(mob);
 
                //Add party memebers regardless of looting rights
                if (p != null && mobParty != null && p == mobParty)
                {
                    m_Helpers.Add(mob);
                    continue;
                }
 
                // add those with looting rights
                for (int i = rights.Count - 1; i >= 0; --i)
                {
                    DamageStore ds = rights[i];
 
                    if (ds.m_HasRight && ds.m_Mobile == mob)
                    {
                        m_Helpers.Add(ds.m_Mobile);
                        break;
                    }
                }
            }
            eable.Free();
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:37,代码来源:ProfessionalBountyQuest.cs

示例2: OnSpawnCreatureKilled

        public static void OnSpawnCreatureKilled(BaseCreature killed, int spawnLevel)
        {
            if (!Enabled || killed == null)
                return;

            List<DamageStore> rights = killed.GetLootingRights();

            rights.ForEach(store =>
                {
                    CityLoyaltySystem city = CityLoyaltySystem.GetCitizenship(store.m_Mobile);

                    if (city != null)
                        city.AwardLove(store.m_Mobile, 1 * (spawnLevel + 1), 0.10 > Utility.RandomDouble());
                });
        }
开发者ID:Ravenwolfe,项目名称:ServUO,代码行数:15,代码来源:CityLoyaltySystem.cs

示例3: FindRandomPlayer

        public static Mobile FindRandomPlayer(BaseCreature creature)
        {
            List<DamageStore> rights = creature.GetLootingRights();

            for (int i = rights.Count - 1; i >= 0; --i)
            {
                DamageStore ds = rights[i];

                if (!ds.m_HasRight)
                    rights.RemoveAt(i);
            }

            if (rights.Count > 0)
                return rights[Utility.Random(rights.Count)].m_Mobile;

            return null;
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:17,代码来源:DemonKnight.cs

示例4: OnCreatureKilled

		public void OnCreatureKilled(BaseCreature killed)
		{
            if (Waves == null)
                return;

            Waves.ForEach(info =>
            {
                if (info.Creatures.Contains(killed))
                {
                    List<DamageStore> list = killed.GetLootingRights();
                    list.Sort();

                    for (int i = 0; i < list.Count; i++)
                    {
                        DamageStore ds = list[i];
                        Mobile m = ds.m_Mobile;

                        if (ds.m_Mobile is BaseCreature && ((BaseCreature)ds.m_Mobile).GetMaster() is PlayerMobile)
                            m = ((BaseCreature)ds.m_Mobile).GetMaster();

                        if (!info.Credit.Contains(m))
                            info.Credit.Add(m);

                        if (!CurrentScore.ContainsKey(m))
                            CurrentScore[m] = killed.Fame / 998;
                        else
                            CurrentScore[m] += killed.Fame / 998;
                    }

                    list.Clear();
                    list.TrimExcess();

                    info.Creatures.Remove(killed);

                    if (info.Creatures.Count == 0)
                    {
                        foreach (Mobile m in info.Credit.Where(m => m.Region == this.Region && m is PlayerMobile))
                        {
                            double award = Math.Max(0, this.Map == Map.Felucca ? Stage * 2 : Stage);

                            if (award > 0)
                            {
                                //Score Bonus
                                if (!CurrentScore.ContainsKey(m))
                                    CurrentScore[m] = Stage * 125;
                                else
                                    CurrentScore[m] += Stage * 125;
                            }
                        }
                    }

                    if (killed.Corpse != null && !killed.Corpse.Deleted)
                        ((Corpse)killed.Corpse).BeginDecay(TimeSpan.FromMinutes(1));
                }
            });
		}
开发者ID:Crome696,项目名称:ServUO,代码行数:56,代码来源:VoidPoolController.cs


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