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


C# Entities.TeleportDynamic方法代码示例

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


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

示例1: BeginTravel

        public static void BeginTravel(Entities.GameClient client, ushort mapid, ushort x, ushort y, int secs = 40)
        {
            uint dynamicid;
            Core.Kernel.Maps.selectorCollection1[999].CreateDynamic(out dynamicid);
            client.TeleportDynamic(dynamicid, 70, 60);

            int travelTime = (secs * 1000);

            /*for (int i = 0; i < (travelTime / 1000); i++)
            {
                ProjectX_V3_Lib.Threading.DelayedTask.StartDelayedTask(() =>
                                                                       {
                                                                       	using (var msg = Packets.Message.MessageCore.CreateCenter(
                                                                       		string.Format("Hitting destination in {0}", ((travelTime / 1000) - i))))
                                                                       	       {
                                                                       	       	client.Send(msg);
                                                                       	       }
                                                                       	}, 1000 * i);
            }*/

            int j = 0;
            for (int i = secs; i > 0; i--)
            {
                int waitTime = (j * 1000);
                string message = string.Format(Core.MessageConst.TRAVEL_TIME, i);
                ProjectX_V3_Lib.Threading.DelayedTask.StartDelayedTask(() =>
                                                                       {
                                                                       	using (var msg = Packets.Message.MessageCore.CreateCenter(
                                                                       		message))
                                                                       	{
                                                                       		client.Send(msg);
                                                                       	}
                                                                       }, waitTime);
                j++;
            }

            ProjectX_V3_Lib.Threading.DelayedTask.StartDelayedTask(() =>
                                                                   {
                                                                   	using (var msg = Packets.Message.MessageCore.CreateCenter(
                                                                   		Core.MessageConst.TRAVEL_REACH))
                                                                   	{
                                                                   		client.Send(msg);
                                                                   	}
                                                                   }, travelTime);

            ProjectX_V3_Lib.Threading.DelayedTask.StartDelayedTask(() =>
                                                                   {
                                                                   	client.Teleport(mapid, x, y);
                                                                   	using (var str = new Packets.StringPacket(new Packets.StringPacker("autorun_end")))
                                                                   	{
                                                                   		str.Action = Enums.StringAction.RoleEffect;
                                                                   		str.Data = client.EntityUID;
                                                                   		client.Send(str);
                                                                   	}
                                                                   }, travelTime);
        }
开发者ID:kenlacoste843,项目名称:ProjectXV3,代码行数:56,代码来源:Travel.cs

示例2: OpenBattle

        public static void OpenBattle(Entities.GameClient Opponent, int PetID, int BattleID)
        {
            //if (!Trainers.ContainsKey(BattleID))
            //	return;
            //Entities.Trainer Trainer = Trainers[BattleID];

            ArenaMatch Match = ArenaMatch.CreateMatch(Opponent, null);
            Match.FightingMatch = false;
            Match.Started = true;
            Match.Player1 = Opponent;
            Opponent.Battle = Match;
            Opponent.PetBattle = new PetBattle();
            Opponent.PetBattle.Match = Match;

            Entities.BattlePet pet1 = new ProjectX_V3_Game.Entities.BattlePet();
            pet1.EntityUID = Core.UIDGenerators.GetMonsterUID();
            pet1.Mesh = 332;
            pet1.Name = "Zapdos";
            pet1.MaxHP = 1000;
            pet1.HP = 1000;
            Opponent.PetBattle.Pet1 = pet1;

            Entities.BattlePet pet2 = new ProjectX_V3_Game.Entities.BattlePet();
            pet2.EntityUID = Core.UIDGenerators.GetMonsterUID();
            pet2.Mesh = 332;
            pet2.Name = "Articuno";
            pet2.MaxHP = 1000;
            pet2.HP = 1000;
            Opponent.PetBattle.Pet2 = pet2;

            /*Opponent.PetBattle.Pet1 = Opponent.Pets[PetID];
            Opponent.PetBattle.Pet2 = Trainer.Pet;*/
            // JailGuard = 150001

            Entities.NPC Trainer = Core.Kernel.NPCs[150001];

            Match.ArenaMap = Core.Kernel.Maps[700].CreateDynamic(out Match.DynamicID);
            Opponent.TeleportDynamic(Match.DynamicID, 51, 58);

            Match.SendMatch();
            Match.SendCountDown(Trainer.Name, Trainer.Level, 15, 0, Trainer.EntityUID, Opponent);
            Match.SendPacket(pet1.EntityUID, pet1.Name, pet1.HP, pet2.EntityUID, pet2.Name, pet2.HP);

            Trainer.X = 51;
            Trainer.Y = 44;

            Match.ArenaMap.EnterMap(Trainer);

            Opponent.PetBattle.ShowOpponent();
            Opponent.PetBattle.SendDialog();
        }
开发者ID:kenlacoste843,项目名称:ProjectXV3,代码行数:51,代码来源:PetBattle.cs

示例3: JoinAsWatcher

        public void JoinAsWatcher(Entities.GameClient Watcher)
        {
            Watcher.CanAttack = false;
            Watchers.Add(Watcher);

            ushort[] Location = GenerateRandomLocation();
            Watcher.TeleportDynamic(DynamicID, Location[0], Location[1]);

            SendPacket();
        }
开发者ID:kenlacoste843,项目名称:ProjectXV3,代码行数:10,代码来源:ArenaMatch.cs


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