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


C# PlayerMobile.SetFlag方法代码示例

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


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

示例1: OnItemLifted

        public override void OnItemLifted(Mobile from, Item item)
        {
            base.OnItemLifted(from,item);

            if(from is PlayerMobile && Owner == null)
            {
                Owner = from as PlayerMobile;
                LootType = LootType.Blessed;
                // flag the owner as carrying a questtoken assuming the book contains quests and then confirm it with CheckOwnerFlag
                Owner.SetFlag(XmlQuest.CarriedXmlQuestFlag,true);
                CheckOwnerFlag();
            }
        }
开发者ID:Godkong,项目名称:Origins,代码行数:13,代码来源:XmlQuestBook.cs

示例2: OnAdded

        public override void OnAdded(object parent)
        {
            base.OnAdded(parent);

            if(parent != null && parent is Container)
            {
                // find the parent of the container
                // note, the only valid additions are to the player pack.  Anything else is invalid.  This is to avoid exploits involving storage or transfer of questtokens
                object from = ((Container)parent).Parent;

                // check to see if it can be added
                if(from != null && from is PlayerMobile)
                {
                    // if it was not owned then allow it to go anywhere
                    if(Owner == null)
                    {
                        Owner = from as PlayerMobile;

                        LootType = LootType.Blessed;
                        // could also bless all of the quests inside as well but not actually necessary since blessed containers retain their
                        // contents whether blessed or not, and when dropped the questtokens will be blessed

                        // flag the owner as carrying a questtoken
                        Owner.SetFlag(XmlQuest.CarriedXmlQuestFlag,true);
                        CheckOwnerFlag();
                    } else
                    if(from as PlayerMobile != Owner || parent is BankBox)
                    {
                        // tried to give it to another player or placed it in the players bankbox. try to return it to the owners pack
                        Owner.AddToBackpack(this);
                    }
                } else
                {
                    if(Owner != null)
                    {
                        // try to return it to the owners pack
                        Owner.AddToBackpack(this);
                    }
                    // allow placement into npcs or drop on their corpses when owner is null
                    else
                    if(!(from is Mobile) && !(parent is Corpse))
                    {
                        // in principle this should never be reached

                        // invalidate the token

                        CheckOwnerFlag();

                        Invalidate();
                    }
                }
            }
        }
开发者ID:Godkong,项目名称:Origins,代码行数:53,代码来源:XmlQuestBook.cs


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