當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。