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


C# Entities.Character类代码示例

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


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

示例1: GroupMember

		public GroupMember(Character character, GroupMemberFlags flags)
		{
			m_lowId = character.EntityId.Low;
			m_characterName = character.Name;
			Flags = flags;
			Character = character;
		}
开发者ID:NVN,项目名称:WCell,代码行数:7,代码来源:GroupMember.cs

示例2: GiveReward

        public void GiveReward(Character character)
        {
            // Wrong gender
            if (character.Gender != Gender && Gender != GenderType.Neutral)
                return;

            if (character.FactionGroup == FactionGroup.Alliance && AllianceTitle != 0)
            {
                character.SetTitle(AllianceTitle,false);
            }
            else if (character.FactionGroup == FactionGroup.Horde && HordeTitle != 0)
            {
                character.SetTitle(HordeTitle, false);
            }

            if (Item != 0)
            {
				var mailMessage = new MailMessage(Subjects.Localize(character.Locale), Bodies.Localize(character.Locale))
            	                  	{
            	                  		ReceiverId = character.EntityId.Low,
            	                  		DeliveryTime = DateTime.Now,
            	                  		SendTime = DateTime.Now,
            	                  		ExpireTime = DateTime.Now.AddMonths(1),
            	                  		MessageStationary = MailStationary.Normal
            	                  	};
            	mailMessage.AddItem(Item);
            	MailMgr.SendMail(mailMessage);
            }
        }
开发者ID:remixod,项目名称:netServer,代码行数:29,代码来源:AchievementReward.cs

示例3: TryUse

        /// <summary>
        /// Tries to use this Object and returns whether the user succeeded using it.
        /// </summary>
        public bool TryUse(Character user)
        {
            if (!CanBeUsedBy(user))
            {
                return false;
            }

            // can't use objects that are in use
            if (m_go.Flags.HasFlag(GameObjectFlags.InUse))
            {
                return false;
            }

            if (!m_go.Entry.AllowMounted)
            {
                user.Dismount();
            }

            var lck = m_go.Entry.Lock;
            if (lck != null)
            {
                if (lck.RequiresAttack)
                {
                    // TODO: Attack Swing
                }
                else if (lck.RequiresKneeling)
                {
                    user.StandState = StandState.Kneeling;
                }
            }
            return m_go.CanOpen(user) && DoUse(user);
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:35,代码来源:GameObjectHandler.cs

示例4: Send_SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA

        public static void Send_SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA(Character chr)
        {
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0))
            {
				chr.Send(packet);
            }
        }
开发者ID:Jeroz,项目名称:WCell,代码行数:7,代码来源:VehicleHandler.cs

示例5: GossipConversation

		/// <summary>
		/// Creates gossip conversation by its fields
		/// </summary>
		/// <param name="menu">starting menu</param>
		/// <param name="chr">character which started the conversation</param>
		/// <param name="speaker">respondent</param>
		public GossipConversation(GossipMenu menu, Character chr, WorldObject speaker, bool keepOpen)
		{
			CurrentMenu = menu;
			Character = chr;
			Speaker = speaker;
			StayOpen = keepOpen;
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:13,代码来源:GossipConversation.cs

示例6: Deselect

        /// <summary>
        /// Sets the Character's selected GameObject
        /// </summary>
        internal GameObject this[Character chr]
        {
            get
            {
                return chr.ExtraInfo.SelectedGO;
            }
            set
            {
                var info = chr.ExtraInfo;
                Deselect(info);

                if (value != null)
                {
                    var selection = new GOSelection(value);
                    if (MarkerId != SpellId.None)
                    {
                        var marker = new DynamicObject(chr, MarkerId, MarkerRadius, value.Map, value.Position);
                        selection.Marker = marker;

                        // also delete marker
                        marker.CallPeriodically(2000, obj =>
                                                    {
                                                        if (!chr.IsInWorld || chr.Map != marker.Map || selection.GO == null || !selection.GO.IsInWorld)
                                                        {
                                                            marker.Delete();
                                                        }
                                                    });
                    }
                    info.m_goSelection = selection;
                }
            }
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:35,代码来源:GOSelectMgr.cs

示例7: Use

		public override bool Use(Character user)
		{
			var entry = m_go.Entry as GODoorEntry;

			m_go.IsState = !m_go.IsState;
			return true;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:7,代码来源:MiscHandlers.cs

示例8: WithdrawMoney

		public void WithdrawMoney(Character withdrawer, GameObject bank, uint withdrawl)
		{
			if (withdrawl == 0) return;
			if (!bank.CanInteractWith(withdrawer)) return;
			if (withdrawer.Guild == null || withdrawer.GuildMember == null) return;
			if (withdrawer.Guild != Guild) return;
			if (Guild.Money < withdrawl) return;

			var member = withdrawer.GuildMember;
			if (!member.HasRight(GuildPrivileges.WITHDRAW_GOLD) ||
				member.HasRight(GuildPrivileges.WITHDRAW_GOLD_LOCK))
			{
				return;
			}
			if (member.BankMoneyWithdrawlAllowance < withdrawl)
			{
				return;
			}

			Guild.Money -= withdrawl;
			withdrawer.Money += withdrawl;
			member.BankMoneyWithdrawlAllowance -= withdrawl;

			BankLog.LogEvent(GuildBankLogEntryType.WithdrawMoney, withdrawer, withdrawl, null, 0, null);

			GuildHandler.SendMemberRemainingDailyWithdrawlAllowance(withdrawer, member.BankMoneyWithdrawlAllowance);
			GuildHandler.SendGuildBankTabNames(withdrawer, bank);
			GuildHandler.SendGuildBankTabContents(withdrawer, bank, 0);
			GuildHandler.SendGuildBankMoneyUpdate(withdrawer, bank);
		}
开发者ID:ray2006,项目名称:WCell,代码行数:30,代码来源:GuildBank.cs

示例9: GetTrainerSpellState

		/// <summary>
		/// The availability of the spell for the spell list filter.
		/// </summary>
		/// <returns>Available, Unavailable, AlreadyKnown</returns>
		public TrainerSpellState GetTrainerSpellState(Character character)
		{
			var spell = Spell;
			if (spell.IsTeachSpell)
			{
				spell = spell.LearnSpell;
			}

			if (character.Spells.Contains(spell.Id))
			{
				return TrainerSpellState.AlreadyLearned;
			}

			if (spell.PreviousRank != null && !character.Spells.Contains(spell.PreviousRank.Id))
			{
				return TrainerSpellState.Unavailable;
			}

			if (spell.Ability == null || RequiredLevel > 0 && character.Level < RequiredLevel)
			{
				return TrainerSpellState.Unavailable;
			}

			if (RequiredSpellId != 0 && !character.Spells.Contains(RequiredSpellId))
				return TrainerSpellState.Unavailable;

			if (RequiredSkillId != 0 && !character.Skills.CheckSkill(RequiredSkillId, (int)RequiredSkillAmount))
				return TrainerSpellState.Unavailable;

			if (Spell.IsProfession && Spell.TeachesApprenticeAbility && character.Skills.FreeProfessions == 0)
				return TrainerSpellState.Unavailable;

			return TrainerSpellState.Available;
		}
开发者ID:pallmall,项目名称:WCell,代码行数:38,代码来源:TrainerSpellEntry.cs

示例10: SendInBounds

		public static void SendInBounds(Character duelist)
		{
            using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_DUEL_INBOUNDS,4))
            {
                duelist.Send(packet);
            }
		}
开发者ID:ray2006,项目名称:WCell,代码行数:7,代码来源:DuelHandler.cs

示例11: Use

        public override bool Use(Character user)
        {
            var entry = m_go.Entry as GODoorEntry;

            m_go.AnimationProgress = m_go.AnimationProgress == 100 ? (byte)0 : (byte)100;
            return true;
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:7,代码来源:MiscHandlers.cs

示例12: Blastenheimer5000Used

 private static bool Blastenheimer5000Used(GameObject go, Character user)
 {
     var cast = user.SpellCast;
     cast.Start(CannonPrepId);
     user.IncMechanicCount(SpellMechanic.Rooted);
     switch (go.EntryId)
     {
         case (uint)Blastenheimer5000ElwynnId:
             {
                 user.TeleportTo(ElwynnTelePosition, ElwynnTeleOrientation);
             } break;
         case (uint)Blastenheimer5000TerokkarId:
             {
                 user.TeleportTo(TerokkarTelePosition, TerokkarTeleOrientation);
             } break;
         case (uint)Blastenheimer5000MulgoreId:
             {
                 user.TeleportTo(MulgoreTelePosition, MulgoreTeleOrientation);
             } break;
         default:
             {
                 user.DecMechanicCount(SpellMechanic.Rooted);
                 return false;
             }
     }
     go.PlaySound(8476);
     
     user.CallDelayed(2000, obj => FireCannon(user));
     return true;
 }
开发者ID:remixod,项目名称:netServer,代码行数:30,代码来源:DarkmoonFaire.cs

示例13: LoadAllOfCharacter

		internal static SpecProfile[] LoadAllOfCharacter(Character chr)
		{
			//ICriterion[] query = { Expression.Eq("_characterGuid", (int)chr.EntityId.Low) };

			var specs = RealmWorldDBMgr.DatabaseProvider.Query<SpecProfile>().Where(specProfile => specProfile.CharacterGuid == chr.EntityId.Low).OrderBy(specProfile => specProfile.SpecIndex).ToArray(); //FindAll(order, query);
			var i = 0;

			foreach (var spec in specs)
			{
				// ensure correct index
				if (spec.SpecIndex != i)
				{
					LogManager.GetCurrentClassLogger().Warn("Found SpecProfile for \"{0}\" with invalid SpecIndex {1} (should be {2})", spec.SpecIndex, i);
					spec.SpecIndex = i;
					RealmWorldDBMgr.DatabaseProvider.SaveOrUpdate(spec);
				}

				// ensure correct ActionButtons
				if (spec.ActionButtons == null)
				{
					// make sure to create the array, if loading or the last save failed
					spec.ActionButtons = (byte[])chr.Archetype.ActionButtons.Clone();
				}
				else if (spec.ActionButtons.Length != chr.Archetype.ActionButtons.Length)
				{
					var buts = spec.ActionButtons;
					Array.Resize(ref buts, chr.Archetype.ActionButtons.Length);
					spec.ActionButtons = buts;
				}
				i++;
			}
			return specs;
		}
开发者ID:remixod,项目名称:netServer,代码行数:33,代码来源:SpecProfile.cs

示例14: HandleTeleport

		/// <summary>
		/// Teleports into an instance
		/// </summary>
		/// <param name="chr"></param>
		/// <param name="trigger"></param>
		/// <returns></returns>
		public static bool HandleTeleport(Character chr, AreaTrigger trigger)
		{
			var regionInfo = World.GetRegionTemplate(trigger.Template.TargetMap);
#if DEBUG
			chr.SendSystemMessage("Target location: {0}", trigger.Template.TargetMap);
#endif

			if (regionInfo.IsInstance)
			{
				if (regionInfo.Type == MapType.Normal)
				{
					InstanceMgr.LeaveInstance(chr, regionInfo, trigger.Template.TargetPos);
					return true;
				}
				else
				{
					return InstanceMgr.EnterInstance(chr, regionInfo, trigger.Template.TargetPos);
				}
			}
			else if (regionInfo.BGTemplate == null)
			{
				var rgn = World.GetRegion(regionInfo.Id);
				if (rgn != null)
				{
					chr.TeleportTo(rgn, trigger.Template.TargetPos, trigger.Template.TargetOrientation);
					return true;
				}
				else
				{
					ContentMgr.OnInvalidDBData("Invalid Region: " + rgn);
				}
			}
			return true;
		}
开发者ID:NVN,项目名称:WCell,代码行数:40,代码来源:AreaTriggerMgr.cs

示例15: GetHighestQuestGiverStatus

        /// <summary>
        /// Gets the Highest Status of any quest newly available or continuable for the given Character
        /// </summary>
        /// <param name="chr">The character which is status calculated with.</param>
        /// <returns></returns>
        public QuestStatus GetHighestQuestGiverStatus(Character chr)
        {
            var highestStatus = QuestStatus.NotAvailable;
            if (QuestStarts != null)
            {
                foreach (var qt in QuestStarts)
                {
                    var qs = qt.GetStartStatus(this, chr);
                    if (qs > highestStatus)
                    {
                        highestStatus = qs;
                    }
                }
            }

            if (QuestEnds != null)
            {
                foreach (var qt in QuestEnds)
                {
                    var qs = qt.GetEndStatus(chr);
                    if (qs > highestStatus)
                    {
                        highestStatus = qs;
                    }
                }
            }
            return highestStatus;
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:33,代码来源:QuestHolderInfo.cs


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