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


C# PrimaryTypes.Character类代码示例

本文整理汇总了C#中Saga.PrimaryTypes.Character的典型用法代码示例。如果您正苦于以下问题:C# Character类的具体用法?C# Character怎么用?C# Character使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Character类属于Saga.PrimaryTypes命名空间,在下文中一共展示了Character类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetJobSpeciaficSkills

        public List<uint> GetJobSpeciaficSkills(MySqlConnection connection, Character target, byte job)
        {
            List<uint> MyList = new List<uint>();
            MySqlDataReader reader = null;
            try
            {
                //LOAD ALL SKILL INFORMATION
                MySqlCommand command = new MySqlCommand(_query_65, connection);
                command.Parameters.AddWithValue("CharId", target.ModelId);

                reader = command.ExecuteReader(CommandBehavior.SequentialAccess);
                while (reader.Read())
                {
                    Skill skill = new Skill();
                    skill.Id = reader.GetUInt32(0);
                    if (Singleton.SpellManager.TryGetSpell(skill.Id, out skill.info) &&
                        skill.info.requiredJobs[job - 1] == 1)
                        MyList.Add(skill.Id);
                }

                return MyList;
            }
            catch (Exception e)
            {
                __dbtracelog.WriteError("Database", e.Message);
                return new List<uint>();
            }
            finally
            {
                //ALWAYS CLOSE THE READ RESULT
                if (reader != null) reader.Close();
            }
        }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:33,代码来源:MysqlProvider.Skills.cs

示例2: Create

        /// <summary>
        /// Create a collection of item drops
        /// </summary>
        /// <param name="mapobject"></param>
        /// <param name="character"></param>
        /// <returns></returns>
        public static LootCollection Create(MapObject mapobject, Character character)
        {
            if (MapObject.IsPlayer(mapobject)) throw new SystemException("Cannot create loot for mapobjects");

            LootCollection collection = new LootCollection();
            PartySession party = character.sessionParty;

            if (party == null)
            {
                collection.LootLeader = character.id;
            }
            else if (party.LootSettings == 3 && party.ItemLeader.currentzone == mapobject.currentzone &&
                mapobject.currentzone.IsInSightRangeBySquare(mapobject.Position, party.ItemLeader.Position))
            {
                collection.LootLeader = party.ItemLeader.id;
            }
            else
            {
                collection.LootLeader = character.id;
            }

            // Generate loot from base mobs
            foreach (Rag2Item c in Singleton.Itemdrops.FindItemDropsById(mapobject.ModelId, character._DropRate))
            {
                collection.Lootlist.Add(c);
            }

            //Item drops from quest content
            foreach (Rag2Item item in QuestBase.UserQuestLoot(mapobject.ModelId, character))
            {
                collection.Lootlist.Add(item);
            }

            return collection;
        }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:41,代码来源:LootCollection.cs

示例3: GetAllLearnedSkills

        public IEnumerable<uint> GetAllLearnedSkills(MySqlConnection connection, Character target)
        {
            MySqlCommand command = new MySqlCommand(_query_61, connection);
            command.Parameters.AddWithValue("CharId", target.ModelId);
            MySqlDataReader reader = null;
            List<uint> Skills = new List<uint>();

            try
            {
                //LOAD ALL SKILL INFORMATION

                reader = command.ExecuteReader(CommandBehavior.SequentialAccess);
                while (reader.Read())
                {
                    Skills.Add(reader.GetUInt32(0));
                }

                return Skills;
            }
            catch (Exception e)
            {
                __dbtracelog.WriteError("Database", e.Message);
                return Skills;
            }
            finally
            {
                //ALWAYS CLOSE THE READ RESULT
                if (reader != null) reader.Close();
            }
        }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:30,代码来源:MysqlProvider.Skills.cs

示例4: OnCheckQuest

 protected void OnCheckQuest(Character target)
 {
     foreach (QuestBase c in target.QuestObjectives)
     {
         c.CheckQuest(target);
     }
 }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:7,代码来源:MapItem.cs

示例5: OnOpenBook

 public void OnOpenBook(Character sender)
 {
     Rag2Collection items = new Rag2Collection();
     foreach (Rag2Item c in Singleton.Itemdrops.FindItemDropsById(this.ModelId, sender._DropRate))
         items.Add(c);
     this.loottable.Add(sender.id, items);
 }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:7,代码来源:Templates.Book.cs

示例6: ClearNpc

        public static void ClearNpc(Character character, Match match)
        {
            ThreadStart AsyncOperation = delegate()
            {
                //Clear all mobs
                foreach (Zone zone in Singleton.Zones.HostedZones())
                {
                    zone.Clear();
                }

                //Respawns world objects (npc & quests)
                Singleton.QuestBoardSpawnManager.Reload();

                //Respawn npc
                Singleton.NpcSpawnManager.Reload();

                //Resend npc to actor
                foreach (Character mcharacter in Tasks.LifeCycle.Characters)
                {
                    Regiontree tree = mcharacter.currentzone.Regiontree;
                    foreach (MapObject regionObject in tree.SearchActors(mcharacter, Saga.Enumarations.SearchFlags.Npcs | Saga.Enumarations.SearchFlags.MapItems | Saga.Enumarations.SearchFlags.StaticObjects))
                    {
                        if (Point.IsInSightRangeByRadius(mcharacter.Position, regionObject.Position))
                        {
                            regionObject.ShowObject(character);
                            regionObject.Appears(character);
                        }
                    }
                }
            };

            Thread thread = new Thread(AsyncOperation);
            thread.Start();
        }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:34,代码来源:gmcommands.cs

示例7: OnAuction

 /// <summary>
 /// Occurs when the auction button is pressed.
 /// </summary>
 /// <param name="npc">Npc who calls the function</param>
 /// <param name="target">Character who requires interaction</param>
 protected virtual void OnAuction(BaseNPC npc, Character target)
 {
     Common.Actions.OpenSubmenu(target, npc,
         _Auction,               //Dialog script to show
         DialogType.Market,      //Button function
         21                      //Open market
     );
 }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:13,代码来源:Func.Auctioneer.cs

示例8: SaveCredits

 public static bool SaveCredits(Character character, int CreditValue)
 {
     IQueryProvider provider = Singleton.Database.GetQueryProvider();
     provider.CmdText = "UPDATE list_credits SET [email protected] [email protected]";
     provider.Parameters.AddWithValue("CharId", character.ModelId);
     provider.Parameters.AddWithValue("Credits", CreditValue);
     return Singleton.Database.ExecuteNonQuery(provider) > 0;
 }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:8,代码来源:NpcWithMysql.cs

示例9: GetDialogButtons

        public DialogType[] GetDialogButtons(Character target)
        {
            List<DialogType> types = new List<DialogType>();
            types.AddRange(this.state.GetDialogButtons(this, target));

            DialogType[] typesa = types.ToArray();
            return typesa;
        }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:8,代码来源:Tempalte.BaseNpc.cs

示例10: Open

 public void Open(Character character, BaseNPC basenpc)
 {
     character.Tag = this;
     SMSG_SUPPLYMENU spkt = new SMSG_SUPPLYMENU();
     spkt.MenuId = this.TradeMenu;
     spkt.SessionId = character.id;
     character.client.Send((byte[])spkt);
 }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:8,代码来源:TradelistContainer.cs

示例11: Appears

 /// <summary>
 /// Subscribes the monsters moving ai if an
 /// character appears.
 /// </summary>
 /// <param name="character"></param>
 public override void Appears(Character character)
 {
     //ENABLE THE AI
     if (!LifespanAI.IsSubscribed(this))
     {
         Lifespan.lasttick = Environment.TickCount;
         LifespanAI.Subscribe(this);
     }
 }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:14,代码来源:Templates.RandomizedMonster.cs

示例12: ComputeIcon

 public override int ComputeIcon(Character target)
 {
     int dialog = 0;
     if (target.client.AvailablePersonalRequests.ContainsKey(this.ModelId))
         dialog |= 1;
     if (QuestBase.IsTalkToObjective(this.ModelId, target))
         dialog |= 2;
     return (int)(base.ComputeIcon(target) | dialog);
 }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:9,代码来源:Tempalte.BaseNpc.cs

示例13: WideMovement

 public void WideMovement(Character character, params WaypointStructure[] waypoints)
 {
     SMSG_WIDEMOVEMENTSTART spkt = new SMSG_WIDEMOVEMENTSTART();
     spkt.SourceActorID = this.id;
     spkt.Speed = (ushort)this.Status.WalkingSpeed;
     for (int i = 0; i < waypoints.Length; i++)
         spkt.AddWaypoint(waypoints[i].point, waypoints[i].rotation);
     spkt.SessionId = character.id;
     character.client.Send((byte[])spkt);
 }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:10,代码来源:BaseMob.cs

示例14: GetLootList

        public Rag2Collection GetLootList(Character target)
        {
            Rag2Collection items;
            if (!loottable.TryGetValue(target.id, out items))
            {
                items = new Rag2Collection();
            }

            return items;
        }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:10,代码来源:Templates.Book.cs

示例15: OnKaftraService

 /// <summary>
 /// Occurs after the Kaftra button is pressed.
 /// </summary>
 /// <param name="npc">Npc who called the event</param>
 /// <param name="target">Character who requirs interaction</param>
 protected virtual void OnKaftraService(BaseNPC npc, Character target)
 {
     Common.Actions.OpenSubmenu(
         target, npc,
         _KaftraService,
         DialogType.Kaftra,
         10,
         11
     );
 }
开发者ID:ELMASTERS,项目名称:SagaRevised,代码行数:15,代码来源:Func.KaftraConversation.cs


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