• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Entities.GameObject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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


示例2: Apply

		public override void Apply()
		{
			var goId = (GOEntryId)Effect.MiscValue;
			var goEntry = GOMgr.GetEntry(goId);
			var caster = m_cast.CasterUnit;
			if (goEntry != null)
			{
				GO = goEntry.Spawn(caster, caster);
				GO.State = GameObjectState.Enabled;
				GO.Orientation = caster.Orientation;
				GO.ScaleX = 1;
				GO.Faction = caster.Faction;
				GO.CreatedBy = caster.EntityId;

				// TODO: Handle SummoningRitualHandler properly
				if (GO.Handler is SummoningRitualHandler)
				{
					((SummoningRitualHandler)GO.Handler).Target = firstTarget;
				}

				if (m_cast.IsChanneling)
				{
					m_cast.CasterUnit.ChannelObject = GO;
				}
				else if (Effect.Spell.Durations.Min > 0)
				{
					// not channelled: Activate decay delay
					GO.RemainingDecayDelayMillis = Effect.Spell.Durations.Random();
				}
			}
			else
			{
				log.Error("Summoning Spell {0} refers to invalid Object: {1} ({2})", Effect.Spell, goId, (uint)goId);
			}
		}
开发者ID:remixod,项目名称:netServer,代码行数:35,代码来源:SummonObject.cs


示例3: 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


示例4: Initialize

		protected internal override void Initialize(GameObject go)
		{
		    //var hidden = (go.Entry as GOTrapEntry).Hidden;
			//if (hidden)
			{
				// hide go
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:8,代码来源:TrapHandler.cs


示例5: Teleport

		private static void Teleport(GameObject go, Character chr)
		{
			if (go.Handler.CanBeUsedBy(chr))
			{
				// We need to enqueue a message when moving/removing/adding Objects in this method
				var portal = (Portal)go;
				chr.AddMessage(() => chr.TeleportTo(portal.Target));
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:9,代码来源:GOPortalEntry.cs


示例6: SendRequest

		public static void SendRequest(GameObject duelFlag, Character challenger, Character rival)
		{
			using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_DUEL_REQUESTED))
			{
				packet.Write(duelFlag.EntityId);
				packet.Write(challenger.EntityId);

				rival.Client.Send(packet);
				challenger.Client.Send(packet);
			}
		}
开发者ID:ray2006,项目名称:WCell,代码行数:11,代码来源:DuelHandler.cs


示例7: DepositMoney

		public void DepositMoney(Character depositer, GameObject bankObj, uint deposit)
		{
			if (!CheckBankObj(depositer, bankObj)) return;

			if (deposit == 0) return;
			if (depositer.Money < deposit) return;

			Guild.Money += deposit;
			depositer.Money -= deposit;

			BankLog.LogEvent(GuildBankLogEntryType.DepositMoney, depositer, deposit, null, 0, null);
			GuildHandler.SendGuildBankTabNames(depositer, bankObj);
			GuildHandler.SendGuildBankTabContents(depositer, bankObj, 0);
			GuildHandler.SendGuildBankMoneyUpdate(depositer, bankObj);
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:15,代码来源:GuildBank.cs


示例8: DepositMoney

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

			Guild.Money += deposit;
			depositer.Money -= deposit;

			BankLog.LogEvent(GuildBankLogEntryType.DepositMoney, depositer, deposit, null, 0, null);
			GuildHandler.SendGuildBankTabNames(depositer, bank);
			GuildHandler.SendGuildBankTabContents(depositer, bank, 0);
			GuildHandler.SendGuildBankMoneyUpdate(depositer, bank);
		}
开发者ID:ray2006,项目名称:WCell,代码行数:16,代码来源:GuildBank.cs


示例9: Blastenheimer5000Used

        private static bool Blastenheimer5000Used(GameObject go, Character user)
        {
            var cast = user.SpellCast;
            var target = go.GetNearbyGO(CannonTarget, 1000);
            if(target != null)
            {
                var dist = go.GetDistance(target);
            }
            
            switch (go.EntryId)
            {
                case (uint)Blastenheimer5000ElwynnId:
                    {
                        cast.Start(CannonPrepId);
                        user.StandState = StandState.Sit;
                        user.IncMechanicCount(SpellMechanic.Rooted);
                        var facing = target != null ? go.GetAngleTowards(target) : ElwynnTeleOrientation;
                        user.TeleportTo(ElwynnTelePosition, facing);

                    } break;
                case (uint)Blastenheimer5000TerokkarId:
                    {
                        cast.Start(CannonPrepId);
                        user.StandState = StandState.Sit;
                        user.IncMechanicCount(SpellMechanic.Rooted);
                        var facing = target != null ? go.GetAngleTowards(target) : TerokkarTeleOrientation;
                        user.TeleportTo(TerokkarTelePosition, facing);
                    } break;
                case (uint)Blastenheimer5000MulgoreId:
                    {
                        cast.Start(CannonPrepMulgore);
                        user.StandState = StandState.Sit;
                        user.IncMechanicCount(SpellMechanic.Rooted);
                        var facing = target != null ? go.GetAngleTowards(target) : MulgoreTeleOrientation;
                        user.TeleportTo(MulgoreTelePosition, facing);
                    } break;
                default:
                    {
                        user.DecMechanicCount(SpellMechanic.Rooted);
                        return false;
                    }
            }
            go.PlaySound(8476);
            
            user.CallDelayed(2000, obj => FireCannon(user));
            return true;
        }
开发者ID:KroneckerX,项目名称:WCell,代码行数:47,代码来源:DarkmoonFaire.cs


示例10: Apply

        public override void Apply()
        {
            var goId = (GOEntryId)Effect.MiscValue;
            var goEntry = GOMgr.GetEntry(goId);
            var caster = m_cast.CasterUnit;
            if (goEntry != null)
            {
                if (Cast.TargetLoc.X != 0)
                {
                    var worldLocation = new WorldLocation(caster.Map, Cast.TargetLoc);
                    go = goEntry.Spawn(worldLocation);
                }
                else
                {
                    go = goEntry.Spawn(caster, null);
                }

                go.State = GameObjectState.Enabled;
                go.Orientation = caster.Orientation;
                go.ScaleX = 1;
            }
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:22,代码来源:SummonObjectWildHandler.cs


示例11: InitGO

		/// <summary>
		/// Is called when the given new GameObject has been created.
		/// </summary>
		/// <param name="go"></param>
		internal protected virtual void InitGO(GameObject go)
		{
		}
开发者ID:MeaNone,项目名称:WCell,代码行数:7,代码来源:GOEntry.cs


示例12: OnUse

		private static bool OnUse(GameObject go, Character chr)
		{
			var portal = (Portal)go;
			chr.TeleportTo(portal.Target);
			return true;
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:6,代码来源:GOPortalEntry.cs


示例13: TonkConsoleActivated

 private static void TonkConsoleActivated(GameObject obj)
 {
     obj.State = GameObjectState.Enabled;
 }
开发者ID:remixod,项目名称:netServer,代码行数:4,代码来源:DarkmoonFaire.cs


示例14: OnPlayerClickedOnflag

		public virtual void OnPlayerClickedOnflag(GameObject go, Character chr)
		{
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:3,代码来源:Battleground.cs


示例15: SoulPrisonUsed

		private static bool SoulPrisonUsed(GameObject go, Character user)
		{
			var nearest = go.GetNearbyNPC(NPCId.UnworthyInitiateAnchor, 2);
			if (nearest == null) return false;
			var shackled = nearest.ChannelObject as NPC;
			if (shackled == null) return false;

			var transformSpellId = GetTransformSpellIdFor(shackled.DisplayId);
			//just clear all auras! uh oh...not
			shackled.Auras.Clear();
			shackled.IsInvulnerable = false;
			go.Flags = GameObjectFlags.None;
			shackled.StandState = StandState.Stand;
			shackled.Emote(EmoteType.SimpleTalk);
			shackled.Say("They brand me unworthy? I will show them unworthy!");
			shackled.Spells.Clear();
			shackled.Spells.AddSpell(
				SpellId.ClassSkillPlagueStrikeRank1_2,
				SpellId.ClassSkillIcyTouchRank1_2,
				SpellId.ClassSkillBloodStrikeRank1_2,
				SpellId.ClassSkillDeathCoil,
				SpellId.ClassSkillDeathCoilRank1_3);
			shackled.CallDelayed(3000, wObj => ((NPC)wObj).MoveInFrontThenExecute(go, npc =>
			{
				npc.Emote(EmoteType.SimpleLoot);
				npc.CallDelayed(4000, obj =>
				{
					obj.SpellCast.TriggerSelf(SpellId.DeathKnightInitiateVisual);
					obj.SpellCast.TriggerSelf(transformSpellId);
					((NPC) obj).VirtualItem1 = ItemId.RunedSoulblade;
					obj.FactionId = FactionId.ActorEvil;
				});
				
				npc.CallDelayed(7000, obj =>
				{
					((NPC)obj).Emote(EmoteType.SimplePointNosheathe);
					obj.Say("To battle!");
				});

				npc.CallDelayed(9000, obj =>
				{
					((NPC)obj).ThreatCollection[user] += 10000;
					((NPC)obj).UnitFlags &= ~UnitFlags.SelectableNotAttackable;
					((NPC)obj).UnitFlags &= ~UnitFlags.NotAttackable;
					((NPC) obj).Target = user;
					((NPC)obj).Brain.State = BrainState.Combat;
				});
			}));

			return true;
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:51,代码来源:DeathKnightQuests.cs


示例16: InitGO

		protected internal override void InitGO(GameObject go)
		{
			go.SetUpdatePriority(UpdatePriority.VeryLowPriority);
			if (m_AreaEffectHandler != null)
			{
				go.CallPeriodicallyTicks(UpdateTicks, ApplyEffectsToArea);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:8,代码来源:GOCustomEntry.cs


示例17: GOSelection

		public GOSelection(GameObject go)
		{
			GO = go;
		}
开发者ID:MeaNone,项目名称:WCell,代码行数:4,代码来源:GOSelectMgr.cs


示例18: Initialize

		/// <summary>
		/// Initializes the duel after a new Duel has been proposed
		/// </summary>
		void Initialize()
		{
			// place flag in between the two
			var pos = ((m_challenger.Position + m_rival.Position) / 2);

			m_flag = GameObject.Create(GOEntryId.DuelFlag, new WorldLocationStruct(m_Map, pos));
			if (m_flag == null)
			{
				ContentMgr.OnInvalidDBData("Cannot start Duel: DuelFlag-GameObject (ID: {0}) does not exist.", (int)GOEntryId.DuelFlag);
				Cancel();
			}
			else
			{
				m_flag.Phase = m_challenger.Phase;

				((DuelFlagHandler)m_flag.Handler).Duel = this;
				m_flag.CreatedBy = m_challenger.EntityId;
				m_flag.Level = m_challenger.Level;
				m_flag.AnimationProgress = 255;
				m_flag.Position = m_challenger.Position;
				m_flag.Faction = m_challenger.Faction;
				m_flag.ScaleX = m_challenger.ScaleX;
				m_flag.ParentRotation4 = 1;
				m_flag.Orientation = m_challenger.Orientation;

				m_Map.AddMessage(new Message(() => DuelHandler.SendRequest(m_flag, m_challenger, m_rival)));
				m_challenger.SetEntityId(PlayerFields.DUEL_ARBITER, m_flag.EntityId);
				m_rival.SetEntityId(PlayerFields.DUEL_ARBITER, m_flag.EntityId);
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:33,代码来源:Duel.cs


示例19: TonkConsoleUsed

        private static bool TonkConsoleUsed(GameObject go, Character user)
        {
            go.State = GameObjectState.Disabled;

            var tonkEntry = NPCMgr.GetEntry(SteamTonkNPCId);
            var tonk = tonkEntry.SpawnAt(user);
            tonk.Summoner = user;
            
            //Remove any of the special abilities from the tonk entry
            //and add a random one
            foreach (var tonkSpell in SpecialTonkSpells.Where(tonkSpell => tonkEntry.Spells.ContainsKey(tonkSpell)))
            {
                tonkEntry.Spells.Remove(tonkSpell);
            }
            var rand = new Random();
            tonkEntry.AddSpell(SpecialTonkSpells[rand.Next(0,3)]);

            var cast = user.SpellCast;
            if (cast == null)
            {
                go.State = GameObjectState.Enabled;
                return false;
            }

            if(cast.Start(UseTonkSpellId, false, tonk, user) != SpellFailedReason.Ok)
            {
                go.State = GameObjectState.Enabled;
                return false;
            }
            return true;
        }
开发者ID:remixod,项目名称:netServer,代码行数:31,代码来源:DarkmoonFaire.cs


示例20: InitGO

		protected internal override void InitGO(GameObject trap)
		{
			// init Trap

			trap.Level = Level;
			trap.IsStealthed = Stealthed;
			if (!trap.HasAreaAuras)
			{
				if (Spell != null)
				{
					new AreaAura(trap, Spell, this);
				}
				trap.m_IsTrap = true;
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:15,代码来源:GOTrapEntry.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Entities.NPC类代码示例发布时间:2022-05-26
下一篇:
C# Entities.Character类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap