Beispiel #1
0
        public static bool TryPutCampfire(Player player, WorldPosition position)
        {
            bool putCampfire = true;

            player.Instance.Campfires.Each(campfire =>
            {
                if (campfire.Position.DistanceTo(player.Position) < 1000)
                    putCampfire = false;
            });

            if (!putCampfire)
            {
                SystemMessages.TheresAnotherCampfireNearHere.Send(player);
                return false;
            }

            player.Instance.Campfires.Add(new Campfire
            {
                Instance = player.Instance,
                Type = 1,
                Status = 0,
                Position =
                    Geom.GetNormal(position.Heading).Multiple(50).Add(player.Position)
                    .ToWorldPosition(),
                DespawnUts = Funcs.GetCurrentMilliseconds() + 1200000, //20 minutes
            });

            return true;
        }
Beispiel #2
0
 public static short GetHeading(WorldPosition fromWorldPosition, WorldPosition toWorldPosition)
 {
     return
         (short)
         (Math.Atan2(toWorldPosition.Y - fromWorldPosition.Y, toWorldPosition.X - fromWorldPosition.X) * 32768 /
          Math.PI);
 }
Beispiel #3
0
 public static short GetHeading(WorldPosition fromWorldPosition, Point3D toPoint3D)
 {
     return
         (short)
         (Math.Atan2(toPoint3D.Y - fromWorldPosition.Y, toPoint3D.X - fromWorldPosition.X) * 32768 /
          Math.PI);
 }
        public double FastDistanceTo(WorldPosition p2)
        {
            double a = p2.X - X;
            double b = p2.Y - Y;

            return Math.Sqrt(a*a + b*b);
        }
 public void CopyTo(WorldPosition position)
 {
     position.X = X;
     position.Y = Y;
     position.Z = Z;
     position.Heading = Heading;
 }
Beispiel #6
0
        public Area GetAreaByCoords(WorldPosition coords)
        {
            if (!Data.Data.Areas.ContainsKey(coords.MapId))
                return null;

            return (from area in Data.Data.Areas[coords.MapId] from section in area.Sections where section.Polygon.Contains(coords.ToPoint3D()) select area).FirstOrDefault();
        }
Beispiel #7
0
        public Point3D Add(WorldPosition worldPosition)
        {
            X += worldPosition.X;
            Y += worldPosition.Y;
            Z += worldPosition.Z;

            return this;
        }
Beispiel #8
0
        public static double DistanceToLine(WorldPosition point, WorldPosition p0, WorldPosition p1)
        {
            double dx = p1.X - p0.X;
            double dy = p1.Y - p0.Y;

            return
                Math.Abs(((p0.Y - p1.Y) * point.X + (p1.X - p0.X) * point.Y + (p0.X * p1.Y - p1.X * p0.Y)) /
                         (Math.Sqrt(dx * dx + dy * dy)));
        }
Beispiel #9
0
        public void Release()
        {
            StartPosition = null;
            TargetPosition = null;

            if (Targets != null)
                Targets.Clear();
            Targets = null;
        }
Beispiel #10
0
 public SpDropInfo(int itemId, WorldPosition worldPosition)
 {
     Item = new Item
                {
                    Position = worldPosition,
                    Count = 1,
                    ItemId = itemId,
                    //20000000
                };
 }
Beispiel #11
0
        public static WorldPosition ForwardPosition(WorldPosition position, int distance)
        {
            var result = position.Clone();

            double angle = Math.PI / 32768;
            result.X += (float)Math.Cos(angle) * distance;
            result.Y += (float)Math.Sin(angle) * distance;

            return result;
        }
Beispiel #12
0
        public static double GetAngle(WorldPosition center, WorldPosition point1, WorldPosition point2)
        {
            double x1 = point1.X - center.X;
            double x2 = point2.X - center.X;

            double y1 = point1.Y - center.Y;
            double y2 = point2.Y - center.Y;

            return Math.Acos((x1 * x2 + y1 * y2) / Math.Sqrt((x1 * x1 + y1 * y1) * (x2 * x2 + y2 * y2)));
        }
Beispiel #13
0
        public void ForceTeleport(Player player, WorldPosition position)
        {
            Global.Global.MapService.PlayerLeaveWorld(player);

            player.Position.MapId = position.MapId;
            player.Position.X = position.X;
            player.Position.Y = position.Y;
            Global.Global.VisibleService.Send(player, new SpSetLocation(player));
            Global.Global.VisibleService.Send(player, new SpPlayerInfo(player));
            Global.Global.MapService.PlayerEnterWorld(player);
        }
Beispiel #14
0
        public double DistanceTo(WorldPosition p2)
        {
            if (p2 == null)
                return double.MaxValue;

            double a = p2.X - X;
            double b = p2.Y - Y;
            double c = p2.Z - Z;

            return Math.Sqrt(a*a + b*b + c*c);
        }
        public void ForceTeleport(Player player, WorldPosition position)
        {
            Communication.Global.MapService.PlayerLeaveWorld(player);

            player.Position.MapId = position.MapId;
            player.Position.X = position.X;
            player.Position.Y = position.Y;
            player.Position.Z = position.Z;
            player.Position.Heading = position.Heading;

            new SpCharacterBind(player).Send(player.Connection);
        }
Beispiel #16
0
        public void FixZ(WorldPosition position)
        {
            if ((int)position.X % 256 > 20 || (int)position.Y % 256 > 20)
                return;

            for (int i = 0; i < GeoData[position.MapId].Count; i++)
            {
                if (GeoData[position.MapId][i].CheckIntersect(position.X, position.Y))
                {
                    if (GeoData[position.MapId][i].OffsetZ.Equals(float.MinValue))
                        return;

                    position.Z = GeoData[position.MapId][i].GetZ(position.X, position.Y) + 25;
                    return;
                }
            }
        }
Beispiel #17
0
        public Section GetSectionByCoords(WorldPosition coords)
        {
            Area area = GetAreaByCoords(coords);

            if (area == null)
                return null;

            Section s = null;

            foreach (Section section in area.Sections)
            {
                if (!section.Polygon.Contains(coords.ToPoint3D()))
                    continue;

                foreach (var section1 in section.Sections)
                    if (section1.Polygon.Contains(coords.ToPoint3D()))
                        if (s == null || section1.Priority > s.Priority)
                            s = section1;

                return s ?? section;
            }

            return null;
        }
 public List<Creature> FindTargets(Creature creature, WorldPosition position, double distance, TargetingAreaType type)
 {
     return FindTargets(creature, position.X, position.Y, position.Z, distance, type);
 }
Beispiel #19
0
 public void Release()
 {
     Position = null;
 }
Beispiel #20
0
 public short GetHeadingToTarget(WorldPosition worldPosition)
 {
     return(Geom.GetHeading(((float)((worldPosition.X - X) / DistanceTo(worldPosition)) * 45),
                            ((float)((worldPosition.Y - Y) / DistanceTo(worldPosition)) * 45)));
 }
Beispiel #21
0
 public short GetHeadingToTarget(WorldPosition worldPosition)
 {
     return Geom.GetHeading(((float) ((worldPosition.X - X)/DistanceTo(worldPosition))*45),
                            ((float) ((worldPosition.Y - Y)/DistanceTo(worldPosition))*45));
 }
Beispiel #22
0
 public void CopyTo(WorldPosition position)
 {
     position.X = X;
     position.Y = Y;
     position.Z = Z;
 }
Beispiel #23
0
        public WorldPosition Clone()
        {
            WorldPosition clone = (WorldPosition)MemberwiseClone();

            return(clone);
        }
 public void MoveTo(WorldPosition position, int distance = 0)
 {
     position.CopyTo(TargetPosition);
     TargetDistance = distance;
     Move();
 }
Beispiel #25
0
 public void CopyTo(WorldPosition worldPosition)
 {
     worldPosition.X = X;
     worldPosition.Y = Y;
     worldPosition.Z = Z;
 }
Beispiel #26
0
 public override void Release()
 {
     base.Release();
     ProjectileSkill = null;
     TargetPosition = null;
 }
Beispiel #27
0
        public Projectile(Creature.Creature owner, ProjectileSkill projectileSkill)
        {
            Player.Player player = owner as Player.Player;
            Npc.Npc npc = owner as Npc.Npc;

            Parent = owner;

            if (npc != null)
            {
                TargetPosition = new WorldPosition();
                npc.Target.Position.CopyTo(TargetPosition);
            }
            else
                TargetPosition = owner.Attack.Args.TargetPosition;

            Position = new WorldPosition
                           {
                               Heading = owner.Position.Heading,
                               X = owner.Position.X,
                               Y = owner.Position.Y,
                               Z = owner.Position.Z + projectileSkill.DetachHeight,
                           };

            double angle = Position.Heading * Math.PI / 32768;

            Position.X += projectileSkill.DetachDistance * (float)Math.Cos(angle);
            Position.Y += projectileSkill.DetachDistance * (float)Math.Sin(angle);

            Instance = owner.Instance;
            ProjectileSkill = projectileSkill;
            GameStats = new CreatureBaseStats {HpBase = 1};

            if (player != null)
            {
                Skill = Data.Skills[0][player.TemplateId][ProjectileSkill.Id];
                SkillId = Skill.Id;
            }
            else if (npc != null)
            {
                Skill = Data.Skills[npc.NpcTemplate.HuntingZoneId][npc.NpcTemplate.Id][ProjectileSkill.Id];
                SkillId = Skill.Id + 0x40000000 + (npc.NpcTemplate.HuntingZoneId << 16);
            }

            Lifetime = Skill.ProjectileData.LifeTime != 0
                           ? Skill.ProjectileData.LifeTime
                           : 1000;

            if (projectileSkill.FlyingDistance <= 0f)
                TargetPosition = null;
            else if (Skill != null)
            {
                if (TargetPosition.IsNull())
                {
                    TargetPosition = Position.Clone();

                    TargetPosition.X += projectileSkill.FlyingDistance * (float)Math.Cos(angle);
                    TargetPosition.Y += projectileSkill.FlyingDistance * (float)Math.Sin(angle);
                }

                Speed = (int) (projectileSkill.FlyingDistance*1000/Lifetime);
            }

            if (Skill != null)
            {
                if (Skill.TargetingList != null)
                {
                    for (int i = 0; i < Skill.TargetingList.Count; i++)
                    {
                        if (Skill.TargetingList[i].AreaList == null)
                            continue;

                        for (int j = 0; j < Skill.TargetingList[i].AreaList.Count; j++)
                        {
                            if (Skill.TargetingList[i].AreaList[j].MaxRadius > AttackDistance)
                            {
                                AttackDistance = Skill.TargetingList[i].AreaList[j].MaxRadius;
                                return;
                            }
                        }
                    }
                }
            }
        }
Beispiel #28
0
 public static short GetHeading(Point3D fromPoint3D, WorldPosition toWorldPosition)
 {
     return (short)(Math.Atan2(toWorldPosition.Y - fromPoint3D.Y, toWorldPosition.X - fromPoint3D.X) * 32768 / Math.PI);
 }
Beispiel #29
0
        public double DistanceTo(WorldPosition position)
        {
            double a = position.X - X;
            double b = position.Y - Y;
            double c = position.Z - Z;

            return Math.Sqrt(a*a + b*b + c*c);
        }
Beispiel #30
0
        public static WorldPosition RandomCirclePosition(WorldPosition position, int distance)
        {
            short heading = (short)Funcs.Random().Next(short.MinValue, short.MaxValue);

            return GetNormal(heading).Multiple(distance).Add(position).ToWorldPosition();
        }
Beispiel #31
0
 public static double DistanceToLine(WorldPosition point, WorldPosition p0, WorldPosition p1, double lineHeight)
 {
     return Math.Abs(((p0.Y - p1.Y) * point.X + (p1.X - p0.X) * point.Y + (p0.X * p1.Y - p1.X * p0.Y)) / lineHeight);
 }
Beispiel #32
0
        public static void OpenDialog(Player player, int dialogId, int type, int npcId)
        {
            /*
             * AA55
             * 2700
             * 012C01
             * 9100
             * 1800
             * 0180 dialogId
             * 0000
             * 01000000
             * 01000000
             * 00000000
             * 0000000000000000
             * 0000000000000000
             * 55AA
             */

            //byte[] array = Converter.hexStringToByte(string_);
            //byte[] array2 = new byte[2];
            //byte[] array3 = new byte[2];
            //Buffer.BlockCopy(byte_data, 19, array2, 0, 2);
            //Buffer.BlockCopy(byte_data, 11, array3, 0, 2);
            //int count = (int)BitConverter.ToInt16(array2, 0);
            //int dialogId = (int)BitConverter.ToInt16(array3, 0);

            switch (dialogId)
            {
                case 1:
                    //this.打开仓库中 = true;
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(array3, 0, array, 11, 2);
                    //Buffer.BlockCopy(array3, 0, array, 15, 2);
                    //this.合成物品表.Clear();
                    break;
                case 2:
                    //this.打开仓库中 = false;
                    //this.合成系统解锁();
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(array3, 0, array, 11, 2);
                    //Buffer.BlockCopy(array3, 0, array, 15, 2);
                    break;
                case 3:
                    new SpOpenShop(dialogId, type, npcId).Send(player);
                    return;
                case 4:
                case 6:
                case 7:
                case 8:
                    break;
                case 5:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(array3, 0, array, 11, 2);
                    //Buffer.BlockCopy(array3, 0, array, 15, 2);
                    //this.打开仓库中 = true;
                    //this.打开个人仓库();
                    //this.打开综合仓库();
                    break;
                case 9:
                    if (type <= 28)
                    {
                        switch (type)
                        {
                            case 15:
                                //Buffer.BlockCopy(array2, 0, array, 19, 2);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                                //this.Teleport(0f, -600f, 15f, 401);
                                break;
                            case 16:
                                //Buffer.BlockCopy(array2, 0, array, 19, 1);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                                //this.Teleport(0f, -600f, 15f, 501);
                                break;
                            case 27:
                                //Buffer.BlockCopy(array2, 0, array, 19, 2);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                                //this.Teleport(750f, -880f, 15f, 601);
                                break;
                            case 28:
                                //Buffer.BlockCopy(array2, 0, array, 19, 2);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                                //this.Teleport(-850f, -800f, 15f, 701);
                                break;
                            case 33:
                                //Buffer.BlockCopy(array2, 0, array, 19, 2);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                                //this.Teleport(1630f, -1578f, 15f, 1701);
                                break;
                            case 34:
                                //Buffer.BlockCopy(array2, 0, array, 19, 2);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                                //this.Teleport(-1624f, 1561f, 15f, 1401);
                                break;
                            case 74:
                                //Buffer.BlockCopy(array2, 0, array, 19, 2);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                                //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                                //if (base.Player_Zx == 1)
                                //{
                                //    this.Teleport(1125f, -1555f, 15f, 2001);
                                //    break;
                                //}
                                //this.Teleport(-2231f, 1495f, 15f, 2001);
                                break;
                        }
                    }
                    break;
                case 12:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(12), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(12), 0, array, 15, 2);
                    //base.发送势力战消息1();
                    break;
                case 15:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(10f, 10f, 15f, 1201);
                    break;
                case 17:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(422f, 2194f, 15f, 101);
                    break;
                case 22:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(-302f, 288f, 15f, 2301);
                    break;
                case 23:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(-302f, 288f, 15f, 2341);
                    break;
                case 38:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(1900f, -820f, 15f, 5001);
                    break;
                case 39:
                case 40:
                case 41:
                case 42:
                case 43:
                case 44:
                case 46:
                case 47:
                case 48:
                case 50:
                case 51:
                case 52:
                case 53:
                case 54:
                case 55:
                case 56:
                case 57:
                case 58:
                case 59:
                case 60:
                case 61:
                case 64:
                    break;
                case 45:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(-239f, -226f, 15f, 20001);
                    break;
                case 49:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(345f, 300f, 15f, 21001);
                    break;
                case 62:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(-1f, -221f, 15f, 23001);
                    break;
                case 63:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(422f, 2194f, 15f, 101);
                    break;
                case 65:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23100);
                    break;
                case 66:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23001);
                    break;
                case 67:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23200);
                    break;
                case 68:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23100);
                    break;
                case 69:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23300);
                    break;
                case 70:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23200);
                    break;
                case 71:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23400);
                    break;
                case 72:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23300);
                    break;
                case 73:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23500);
                    break;
                case 74:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23400);
                    break;
                case 75:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23600);
                    break;
                case 76:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23500);
                    break;
                case 77:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23700);
                    break;
                case 78:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23600);
                    break;
                case 79:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23800);
                    break;
                case 80:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23700);
                    break;
                case 81:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23900);
                    break;
                case 82:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23800);
                    break;
                case 92:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(0f, -10f, 15f, 23050);
                    break;
                case 94:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(-900f, 145f, 15f, 6001);
                    break;
                case 101:
                    //this.打开仓库中 = true;
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(array3, 0, array, 11, 2);
                    //Buffer.BlockCopy(array3, 0, array, 15, 2);
                    //this.合成物品表.Clear();
                    break;
                case 102:
                    //this.打开仓库中 = true;
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(array3, 0, array, 11, 2);
                    //Buffer.BlockCopy(array3, 0, array, 15, 2);
                    //this.合成物品表.Clear();
                    break;
                case 103:
                    //this.打开仓库中 = true;
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(array3, 0, array, 11, 2);
                    //Buffer.BlockCopy(array3, 0, array, 15, 2);
                    //this.合成物品表.Clear();
                    break;
                case 110:
                    //this.打开仓库中 = true;
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(array3, 0, array, 11, 2);
                    //Buffer.BlockCopy(array3, 0, array, 15, 2);
                    //SendPacket 发包类2 = new SendPacket();
                    //发包类2.Write2(base.PlayerObjectID);
                    //if (base.Client != null)
                    //{
                    //    base.Client.SendPak(发包类2, 16663, base.PlayerObjectID);
                    //    break;
                    //}
                    break;
                case 111:
                    //this.打开仓库中 = false;
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(array3, 0, array, 11, 2);
                    //Buffer.BlockCopy(array3, 0, array, 15, 2);
                    break;
                case 117:
                    //this.LookIngotCount();
                    //if (base.FLD_RXPIONT >= 50 && base.CharacterMoney >= 50000000L)
                    //{
                    //    Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //    Buffer.BlockCopy(array3, 0, array, 11, 2);
                    //    Buffer.BlockCopy(array3, 0, array, 15, 2);
                    //    break;
                    //}
                    //base.SystemMessage("你的钱数或是元宝不够不能申请帮派战,申请帮战最少50元宝和5千万游戏币", 9, "系統提示");
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    break;
                case 122:
                    //this.打开仓库中 = true;
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(array3, 0, array, 11, 2);
                    //Buffer.BlockCopy(array3, 0, array, 15, 2);
                    //this.合成物品表.Clear();
                    break;
                case 146:
                    //this.打开仓库中 = true;
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(array3, 0, array, 11, 2);
                    //Buffer.BlockCopy(array3, 0, array, 15, 2);
                    //this.合成物品表.Clear();
                    break;
                case 147:
                case 148:
                case 149:
                case 151:
                case 152:
                case 155:
                    break;
                case 150:
                    //if (base.Player_Job_leve >= 6)
                    //{
                    //    Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //    Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //    Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //    this.Teleport(1884f, -1635f, 15f, 25100);
                    //}
                    //base.SystemMessage("只有升天以后才可以进入", 9, "系統提示");
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    break;
                case 153:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(-360f, -363f, 15f, 25201);
                    break;
                case 154:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(117f, -267f, 15f, 25202);
                    break;
                case 156:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(117f, -267f, 15f, 25301);
                    break;
                case 157:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    Random random = new Random();
                    int num4 = random.Next(2, 10);
                    switch (num4)
                    {
                        case 2:
                            //this.Teleport(117f, -267f, 15f, 25200 + num4);
                            break;
                        case 3:
                            //this.Teleport(125f, -329f, 15f, 25200 + num4);
                            break;
                        case 4:
                            //this.Teleport(124f, -244f, 15f, 25200 + num4);
                            break;
                        case 5:
                            //this.Teleport(138f, -271f, 15f, 25200 + num4);
                            break;
                        case 6:
                            //this.Teleport(158f, 256f, 15f, 25200 + num4);
                            break;
                        case 7:
                            //this.Teleport(300f, 92f, 15f, 25200 + num4);
                            break;
                        case 8:
                            //this.Teleport(158f, -302f, 15f, 25200 + num4);
                            break;
                        case 9:
                            //this.Teleport(32f, 92f, 15f, 25200 + num4);
                            break;
                        case 10:
                            //this.Teleport(154f, 30f, 15f, 25200 + num4);
                            break;
                        default:
                            break;
                    }
                    break;
                case 158:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);
                    //this.Teleport(-360f, -363f, 15f, 25201);
                    break;
                case 173:
                    //Buffer.BlockCopy(array2, 0, array, 19, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 11, 2);
                    //Buffer.BlockCopy(BitConverter.GetBytes(2), 0, array, 15, 2);

                    WorldPosition position = new WorldPosition();
                    position.X = 1989;
                    position.Y = -2027;
                    position.Z = 15;
                    position.MapId = 26000;
                    Global.Global.TeleportService.ForceTeleport(player, position);
                    break;
            }
        }
 public SpCreatureMoveTo(Creature creature, Creature target, WorldPosition position)
 {
     Creature = creature;
     Target = target;
     Position = position;
 }
Beispiel #34
0
 public static short GetHeading(WorldPosition worldPosition)
 {
     return (short)(Math.Atan2(worldPosition.Y, worldPosition.X) * 32768 / Math.PI);
 }