Xin được hướng dẫn chỉnh tọa độ xuất hiện của npc
Hello & Welcome to our community. Is this your first visit? Đăng Ký
Follow us on
Follow us on Facebook Follow us on Twitter Linked In Flickr Watch us on YouTube My Space Blogger
 
Kết quả 1 đến 10 của 10
  1. #1
    Thành Viên
    Ngày tham gia
    Apr 2011
    Bài viết
    72
    Thanks
    49
    Thanked 1 Time in 1 Post

    Xin được hướng dẫn chỉnh tọa độ xuất hiện của npc

    các bạn cho mình hỏi nếu muốn chỉnh tọa độ xuất hiện của npc thì phải chỉnh ở đâu với.ví dụ như s1 kiến mình mún cho con kiến nó xuất hiện ở chính giữa luôn ấy.thank các bạn
    Khách viếng thăm hãy cùng _Jack_ xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  2. #2
    Thành Viên quancoi000's Avatar
    Ngày tham gia
    Sep 2011
    Bài viết
    572
    Thanks
    336
    Thanked 216 Times in 61 Posts

    Ðề: xin được hướng dẫn chỉnh tọa độ xuất hiện của npc

    Trích dẫn Gửi bởi _Jack_ [Only registered and activated users can see links. ]
    các bạn cho mình hỏi nếu muốn chỉnh tọa độ xuất hiện của npc thì phải chỉnh ở đâu với.ví dụ như s1 kiến mình mún cho con kiến nó xuất hiện ở chính giữa luôn ấy.thank các bạn
    chỉnh trong script. đoạn script add npc có đoạn kiểu như: (idnpc,x,y,z).
    thì cái id là id npc, x và y là tọa độ của npc đó..nhưng vấn đề ở chỗ bạn muốn add npc kiểu như nào. ví dụ con chim ưng sa mạc trong pdha thì nó lại add kiểu khác đó!
    Đến với nhau bằng tình cảm nhưng chia tay vì tình dục...
    [Only registered and activated users can see links. ]

  3. Các thành viên gởi lời cảm ơn đến quancoi000 vì bài viết này !

    _Jack_ (02-11-12)

  4. #3
    Thành Viên gamegn's Avatar
    Ngày tham gia
    Jul 2012
    Bài viết
    436
    Thanks
    92
    Thanked 437 Times in 92 Posts

    Ðề: xin được hướng dẫn chỉnh tọa độ xuất hiện của npc

    Trích dẫn Gửi bởi quancoi000 [Only registered and activated users can see links. ]
    chỉnh trong script. đoạn script add npc có đoạn kiểu như: (idnpc,x,y,z).
    thì cái id là id npc, x và y là tọa độ của npc đó..nhưng vấn đề ở chỗ bạn muốn add npc kiểu như nào. ví dụ con chim ưng sa mạc trong pdha thì nó lại add kiểu khác đó!
    add sao chỉ với
    Khách viếng thăm hãy cùng gamegn xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  5. #4
    Thành Viên quancoi000's Avatar
    Ngày tham gia
    Sep 2011
    Bài viết
    572
    Thanks
    336
    Thanked 216 Times in 61 Posts

    Ðề: xin được hướng dẫn chỉnh tọa độ xuất hiện của npc

    Trích dẫn Gửi bởi gamegn [Only registered and activated users can see links. ]
    add sao chỉ với
    chỉ cái nào? add npc thì chỉ như thế thôi!
    Đến với nhau bằng tình cảm nhưng chia tay vì tình dục...
    [Only registered and activated users can see links. ]

  6. #5
    Thành Viên gamegn's Avatar
    Ngày tham gia
    Jul 2012
    Bài viết
    436
    Thanks
    92
    Thanked 437 Times in 92 Posts

    Ðề: xin được hướng dẫn chỉnh tọa độ xuất hiện của npc

    Trích dẫn Gửi bởi quancoi000 [Only registered and activated users can see links. ]
    chỉ cái nào? add npc thì chỉ như thế thôi!
    tui bik add rồi nhưng sao cho nó như mấy con chim ưng
    Khách viếng thăm hãy cùng gamegn xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  7. #6
    Thành Viên
    Ngày tham gia
    Apr 2012
    Bài viết
    208
    Thanks
    59
    Thanked 116 Times in 41 Posts

    Ðề: Xin được hướng dẫn chỉnh tọa độ xuất hiện của npc

    Trích dẫn Gửi bởi _Jack_ [Only registered and activated users can see links. ]
    các bạn cho mình hỏi nếu muốn chỉnh tọa độ xuất hiện của npc thì phải chỉnh ở đâu với.ví dụ như s1 kiến mình mún cho con kiến nó xuất hiện ở chính giữa luôn ấy.thank các bạn
    Bạn vào Messions tìm đến Messions của ải kiến
    Code:
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Game.Logic.AI;
    using Game.Logic.Phy.Object;
    using Game.Logic;
    
    namespace GameServerScript.AI.Messions
    {
        public class DCSM2001 : AMissionControl
        {
            private List<SimpleNpc> someNpc = new List<SimpleNpc>();
    
            private int dieRedCount = 0;
    
            private int[] npcIDs = { 2001, 2002 };
    
            private int[] birthX = { 52, 115, 183, 253, 320, 1206, 1275, 1342, 1410, 1475 };
    
            public override int CalculateScoreGrade(int score)
            {
                base.CalculateScoreGrade(score);
                if (score > 1870)
                {
                    return 3;
                }
                else if (score > 1825)
                {
                    return 2;
                }
                else if (score > 1780)
                {
                    return 1;
                }
                else
                {
                    return 0;
                }
            }
    
            public override void OnPrepareNewSession()
            {
                base.OnPrepareNewSession();
                int[] resources = { npcIDs[0], npcIDs[1] };
                int[] gameOverResources = { npcIDs[1], npcIDs[0], npcIDs[0], npcIDs[0] };
                Game.LoadResources(resources);
                Game.LoadNpcGameOverResources(gameOverResources);
                Game.SetMap(1165);
            }
    
            //public override void OnPrepareStartGame()
            //{
            //    base.OnPrepareStartGame();
            //}
            //public override void OnStartGame()
            //{
            //    base.OnStartGame();
            //}
    
            public override void OnStartGame()
            {
                //base.OnPrepareNewGame();
                base.OnStartGame();
                //左边五只小怪
                int index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 52, 206, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 100, 207, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 155, 208, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 210, 207, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 253, 207, 1));
    
                //右边五只小怪
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 1275, 208, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 1325, 206, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 1360, 208, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 1410, 206, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 1475, 208, 1));
            }
    
            public override void OnNewTurnStarted()
            {
                base.OnNewTurnStarted();
    
                if (Game.GetLivedLivings().Count == 0)
                {
                    Game.PveGameDelay = 0;
                }
    
                if (Game.TurnIndex > 1 && Game.CurrentPlayer.Delay > Game.PveGameDelay)
                {
                    if (Game.GetLivedLivings().Count < 10)
                    {
                        for (int i = 0; i < 10 - Game.GetLivedLivings().Count; i++)
                        {
                            if (someNpc.Count == Game.MissionInfo.TotalCount)
                            {
                                break;
                            }
                            else
                            {
                                int index = Game.Random.Next(0, birthX.Length);
                                int NpcX = birthX[index];
    
                                int direction = -1;
    
                                if (NpcX <= 320)
                                {
                                    direction = 1;
                                }
    
                                index = Game.Random.Next(0, npcIDs.Length);
    
                                if (index == 1 && GetNpcCountByID(npcIDs[1]) < 10)
                                {
                                    //   someNpc.Add(Game.CreateNpc(redNpcID, 900 + (i + 1) * 100, 505, 1));
                                    //Game.CreateNpc(npcIDs[1],
                                    someNpc.Add(Game.CreateNpc(npcIDs[1], NpcX, 506, 1));
                                }
                                else
                                {
                                    someNpc.Add(Game.CreateNpc(npcIDs[0], NpcX, 506, 1));
                                }
                            }
                        }
                    }
                }
    
            }
            public override void OnBeginNewTurn()
            {
                base.OnBeginNewTurn();
            }
    
            public override bool CanGameOver()
            {
                bool result = true;
    
                base.CanGameOver();
    
                dieRedCount = 0;
    
                foreach (SimpleNpc redNpc in someNpc)
                {
                    if (redNpc.IsLiving)
                    {
                        result = false;
                    }
                    else
                    {
                        dieRedCount++;
                    }
                }
    
                if (result && dieRedCount == Game.MissionInfo.TotalCount)
                {
                    Game.IsWin = true;
                    return true;
                }
    
                return false;
            }
    
            public override int UpdateUIData()
            {
                return Game.TotalKillCount;
            }
    
            //public override void OnPrepareGameOver()
            //{
            //    base.OnPrepareGameOver();
            //}
    
            public override void OnGameOver()
            {
                base.OnGameOver();
                if (Game.GetLivedLivings().Count == 0)
                {
                    Game.IsWin = true;
                }
                else
                {
                    Game.IsWin = false;
                }
                List<LoadingFileInfo> loadingFileInfos = new List<LoadingFileInfo>();
                loadingFileInfos.Add(new LoadingFileInfo(2, "image/map/2/show2", ""));
                Game.SendLoadResource(loadingFileInfos);
            }
    
            protected int GetNpcCountByID(int Id)
            {
                int Count = 0;
                foreach (SimpleNpc npc in someNpc)
                {
                    if (npc.NpcInfo.ID == Id)
                        Count++;
                }
                return Count;
            }
        }
    }
    Bạn chú ý đến những dòng chữ màu đỏ ví dụ
    someNpc.Add(Game.CreateNpc(npcIDs[index], 52, 206, 1));
    52 và 206, 52 là X 206 là Y thì ta thay tọa độ nằm chính giữa vào bạn nhé tương tự các dòng còn lại
    Lần sửa cuối bởi trungqbbn, ngày 06-11-12 lúc 07:45 PM.
    Khách viếng thăm hãy cùng trungqbbn xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  8. Các thành viên gởi lời cảm ơn đến trungqbbn vì bài viết này !

    _Jack_ (06-11-12)

  9. #7
    Thành Viên
    Ngày tham gia
    Nov 2012
    Bài viết
    115
    Thanks
    75
    Thanked 196 Times in 25 Posts

    Ðề: Xin được hướng dẫn chỉnh tọa độ xuất hiện của npc

    Trích dẫn Gửi bởi trungqbbn [Only registered and activated users can see links. ]
    Bạn vào Messions tìm đến Messions của ải kiến
    Code:
    using System;
    using System.Collections.Generic;
    using System.Text;
    using Game.Logic.AI;
    using Game.Logic.Phy.Object;
    using Game.Logic;
    
    namespace GameServerScript.AI.Messions
    {
        public class DCSM2001 : AMissionControl
        {
            private List<SimpleNpc> someNpc = new List<SimpleNpc>();
    
            private int dieRedCount = 0;
    
            private int[] npcIDs = { 2001, 2002 };
    
            private int[] birthX = { 52, 115, 183, 253, 320, 1206, 1275, 1342, 1410, 1475 };
    
            public override int CalculateScoreGrade(int score)
            {
                base.CalculateScoreGrade(score);
                if (score > 1870)
                {
                    return 3;
                }
                else if (score > 1825)
                {
                    return 2;
                }
                else if (score > 1780)
                {
                    return 1;
                }
                else
                {
                    return 0;
                }
            }
    
            public override void OnPrepareNewSession()
            {
                base.OnPrepareNewSession();
                int[] resources = { npcIDs[0], npcIDs[1] };
                int[] gameOverResources = { npcIDs[1], npcIDs[0], npcIDs[0], npcIDs[0] };
                Game.LoadResources(resources);
                Game.LoadNpcGameOverResources(gameOverResources);
                Game.SetMap(1165);
            }
    
            //public override void OnPrepareStartGame()
            //{
            //    base.OnPrepareStartGame();
            //}
            //public override void OnStartGame()
            //{
            //    base.OnStartGame();
            //}
    
            public override void OnStartGame()
            {
                //base.OnPrepareNewGame();
                base.OnStartGame();
                //左边五只小怪
                int index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 52, 206, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 100, 207, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 155, 208, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 210, 207, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 253, 207, 1));
    
                //右边五只小怪
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 1275, 208, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 1325, 206, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 1360, 208, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 1410, 206, 1));
                index = Game.Random.Next(0, npcIDs.Length);
                someNpc.Add(Game.CreateNpc(npcIDs[index], 1475, 208, 1));
            }
    
            public override void OnNewTurnStarted()
            {
                base.OnNewTurnStarted();
    
                if (Game.GetLivedLivings().Count == 0)
                {
                    Game.PveGameDelay = 0;
                }
    
                if (Game.TurnIndex > 1 && Game.CurrentPlayer.Delay > Game.PveGameDelay)
                {
                    if (Game.GetLivedLivings().Count < 10)
                    {
                        for (int i = 0; i < 10 - Game.GetLivedLivings().Count; i++)
                        {
                            if (someNpc.Count == Game.MissionInfo.TotalCount)
                            {
                                break;
                            }
                            else
                            {
                                int index = Game.Random.Next(0, birthX.Length);
                                int NpcX = birthX[index];
    
                                int direction = -1;
    
                                if (NpcX <= 320)
                                {
                                    direction = 1;
                                }
    
                                index = Game.Random.Next(0, npcIDs.Length);
    
                                if (index == 1 && GetNpcCountByID(npcIDs[1]) < 10)
                                {
                                    //   someNpc.Add(Game.CreateNpc(redNpcID, 900 + (i + 1) * 100, 505, 1));
                                    //Game.CreateNpc(npcIDs[1],
                                    someNpc.Add(Game.CreateNpc(npcIDs[1], NpcX, 506, 1));
                                }
                                else
                                {
                                    someNpc.Add(Game.CreateNpc(npcIDs[0], NpcX, 506, 1));
                                }
                            }
                        }
                    }
                }
    
            }
            public override void OnBeginNewTurn()
            {
                base.OnBeginNewTurn();
            }
    
            public override bool CanGameOver()
            {
                bool result = true;
    
                base.CanGameOver();
    
                dieRedCount = 0;
    
                foreach (SimpleNpc redNpc in someNpc)
                {
                    if (redNpc.IsLiving)
                    {
                        result = false;
                    }
                    else
                    {
                        dieRedCount++;
                    }
                }
    
                if (result && dieRedCount == Game.MissionInfo.TotalCount)
                {
                    Game.IsWin = true;
                    return true;
                }
    
                return false;
            }
    
            public override int UpdateUIData()
            {
                return Game.TotalKillCount;
            }
    
            //public override void OnPrepareGameOver()
            //{
            //    base.OnPrepareGameOver();
            //}
    
            public override void OnGameOver()
            {
                base.OnGameOver();
                if (Game.GetLivedLivings().Count == 0)
                {
                    Game.IsWin = true;
                }
                else
                {
                    Game.IsWin = false;
                }
                List<LoadingFileInfo> loadingFileInfos = new List<LoadingFileInfo>();
                loadingFileInfos.Add(new LoadingFileInfo(2, "image/map/2/show2", ""));
                Game.SendLoadResource(loadingFileInfos);
            }
    
            protected int GetNpcCountByID(int Id)
            {
                int Count = 0;
                foreach (SimpleNpc npc in someNpc)
                {
                    if (npc.NpcInfo.ID == Id)
                        Count++;
                }
                return Count;
            }
        }
    }

    Bạn chú ý đến những dòng chữ màu đỏ ví dụ
    someNpc.Add(Game.CreateNpc(npcIDs[index], 52, 206, 1));
    52 và 206, 52 là X 206 là Y thì ta thay tọa độ nằm chính giữa vào bạn nhé tương tự các dòng còn lại
    nếu giờ bạn add con chim ưng vào thì đố bạn làm cho nó "bay" được đấy!
    Khách viếng thăm hãy cùng Im.Nnoitra xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  10. Các thành viên gởi lời cảm ơn đến Im.Nnoitra vì bài viết này !

    _Jack_ (06-11-12)

  11. #8
    Thành Viên
    Ngày tham gia
    Apr 2011
    Bài viết
    72
    Thanks
    49
    Thanked 1 Time in 1 Post

    Ðề: Xin được hướng dẫn chỉnh tọa độ xuất hiện của npc

    Trích dẫn Gửi bởi Im.Nnoitra [Only registered and activated users can see links. ]
    nếu giờ bạn add con chim ưng vào thì đố bạn làm cho nó "bay" được đấy!
    vậy là con chim nó se bò dưới đất hả bạn @@.bạn nào có thơi gian cho minh xin yahoo có gì mình hỏi với
    Khách viếng thăm hãy cùng _Jack_ xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  12. #9
    Thành Viên
    Ngày tham gia
    Apr 2012
    Bài viết
    208
    Thanks
    59
    Thanked 116 Times in 41 Posts

    Ðề: Xin được hướng dẫn chỉnh tọa độ xuất hiện của npc

    Trích dẫn Gửi bởi Im.Nnoitra [Only registered and activated users can see links. ]
    nếu giờ bạn add con chim ưng vào thì đố bạn làm cho nó "bay" được đấy!
    Người ta hỏi làm kiến chuyển sang chim ưng là sao
    Khách viếng thăm hãy cùng trungqbbn xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

  13. #10
    Thành Viên
    Ngày tham gia
    Nov 2012
    Bài viết
    115
    Thanks
    75
    Thanked 196 Times in 25 Posts

    Ðề: Xin được hướng dẫn chỉnh tọa độ xuất hiện của npc

    Trích dẫn Gửi bởi trungqbbn [Only registered and activated users can see links. ]
    Người ta hỏi làm kiến chuyển sang chim ưng là sao
    nếu hỏi kiến thì người ta đã chẳng thèm hỏi, hỏi chim ưng với quỷ khăn hồng đó
    Khách viếng thăm hãy cùng Im.Nnoitra xây dựng diễn đàn CLBGAMESVN vững mạnh nhé!

 

 

Quyền viết bài

  • Bạn Không thể gửi Chủ đề mới
  • Bạn Không thể Gửi trả lời
  • Bạn Không thể Gửi file đính kèm
  • Bạn Không thể Sửa bài viết của mình
  •  
Múi giờ GMT +7. Bây giờ là 11:19 PM.
vBulletin®, Copyright ©2000-2011, Jelsoft Enterprises Ltd.
CLBGamesVN không chịu trách nhiệm về Luật Bản Quyền của các tài liệu, bài viết v.v...được đăng tải trên diễn đàn này.
Diễn đàn phát triển dưới sự đóng góp của tất cả thành viên. BQT chỉ là những người thành lập ra sân chơi, quản lý và duy trì về mặt kỹ thuật, nội dung khi hợp lệ.