Exemple #1
0
        public void HandleMelee(Player play, int swingdir)
        {
            List <BaseObject> target = World.GetTileTarget(play, AdjecentTile(play, swingdir), swingdir);

            if (target == null)
            {
                return;
            }
            var take = play.Dam;

            foreach (var tar in target)
            {
                if (tar is Player)
                {
                    if (play.Map == "Village1" || play.Map == "Rest" || play.Map == "Arnold" || play.Map == "Loen")
                    {
                        continue;
                    }

                    take -= (tar as Player).AC;
                    if (take <= 0)
                    {
                        take = 1;
                    }
                    TakeDamage(play, tar, take);

                    if ((tar as Player).Color == 0)
                    {
                        play.pkpinkktime = Server.tickcount.ElapsedMilliseconds;
                    }

                    if ((tar as Player).Map == "Rest" && (tar as Player).Color != 1)
                    {
                        play.pklastpk.Add(Server.tickcount.ElapsedMilliseconds);
                        play.pklastred = Server.tickcount.ElapsedMilliseconds;
                    }
                }
                else if (tar is script.monster.Monster)
                {
                    take -= (tar as script.monster.Monster).AC;
                    if (take <= 0)
                    {
                        take = 1;
                    }
                    TakeDamage(play, tar, take);
                }
            }
        }
Exemple #2
0
        public void HandleMelee(Player play, int swingdir)
        {
            List <BaseObject> target = World.GetTileTarget(play, AdjecentTile(play, swingdir), swingdir);

            if (target == null)
            {
                return;
            }
            var take = play.Dam;

            foreach (var tar in target)
            {
                if (tar is Player)
                {
                    if (play.Map == "Village1" || play.Map == "Rest" || play.Map == "Arnold" || play.Map == "Loen" || play.TakeDam == false)
                    {
                        continue;
                    }

                    take -= (tar as Player).AC;
                    if (take <= 0)
                    {
                        take = 1;
                    }
                    if (play.Map != "대전장")
                    {
                        TakeDamage(play, tar, take);
                    }
                    if (play.Map == "대전장" && play.Color != (tar as Player).Color)
                    {
                        TakeDamage(play, tar, take);
                    }
                    if ((tar as Player).Color == 0)
                    {
                        play.pkpinkktime = Server.tickcount.ElapsedMilliseconds;
                    }

                    if ((tar as Player).Map == "Rest" && (tar as Player).Color != 1)
                    {
                        if (play.Map != "대전장" && play.Map != "큰대전장")
                        {
                            play.pklastpk.Add(Server.tickcount.ElapsedMilliseconds);
                            play.pklastred = Server.tickcount.ElapsedMilliseconds;
                            string text2 = play.Name + " " + "→ PK " + " " + (tar as Player).Name + "→ Die " + "맵 " + play.Map + "                            ";
                            World.SendToAll(new QueDele(play.Serial, "all", new UpdateChatBox(7, 0x65, 1, (short)text2.Count(), text2).Compile()));
                        }

                        /*
                         * if (play.PVPSubRank < (tar as Player).PVPSubRank)
                         * {
                         *  if ((tar as Player).PVPSubRank - play.PVPSubRank <= 3)
                         *      {
                         *      play.m_Win += 1;
                         *      var temp = 5000;
                         *
                         *      if (play.PVPSubRank >= 0 && play.PVPSubRank <= 3)
                         *          temp = (int)(temp * 1.0);
                         *      if (play.PVPSubRank >= 4 && play.PVPSubRank <= 4)
                         *          temp = (int)(temp * 0.8);
                         *      if (play.PVPSubRank >= 5 && play.PVPSubRank <= 6)
                         *          temp = (int)(temp * 0.05);
                         *      if (play.PVPSubRank >= 7 && play.PVPSubRank <= 10)
                         *          temp = (int)(temp * 0.02);
                         *      if (play.PVPSubRank >= 7 && play.PVPSubRank <= 11)
                         *          temp = (int)(temp * 0.02);
                         *      if (play.PVPSubRank >= 12)
                         *          temp = (int)(temp * 0.01);
                         *      play.PvPPoint += temp * 1;
                         *
                         *      Console.WriteLine("대전테스트");
                         *      }
                         * }
                         * if (play.PVPSubRank > (tar as Player).PVPSubRank)
                         * {
                         *  if (play.PVPSubRank - (tar as Player).PVPSubRank <= 3)
                         *  {
                         *      play.m_Win += 1;
                         *
                         *      var temp = 5000;
                         *
                         *      if (play.PVPSubRank >= 0 && play.PVPSubRank <= 3)
                         *          temp = (int)(temp * 1.0);
                         *      if (play.PVPSubRank >= 4 && play.PVPSubRank <= 4)
                         *          temp = (int)(temp * 0.8);
                         *      if (play.PVPSubRank >= 5 && play.PVPSubRank <= 6)
                         *          temp = (int)(temp * 0.05);
                         *      if (play.PVPSubRank >= 7 && play.PVPSubRank <= 10)
                         *          temp = (int)(temp * 0.02);
                         *      if (play.PVPSubRank >= 7 && play.PVPSubRank <= 11)
                         *          temp = (int)(temp * 0.02);
                         *      if (play.PVPSubRank >= 12)
                         *          temp = (int)(temp * 0.01);
                         *      play.PvPPoint += temp * 1;
                         *      Console.WriteLine("대전테스트2");
                         *  }
                         * }
                         * if (play.PVPSubRank == (tar as Player).PVPSubRank)
                         * {
                         *  if (play.PVPSubRank - (tar as Player).PVPSubRank <= 3)
                         *  {
                         *      play.m_Win += 1;
                         *
                         *      var temp = 5000;
                         *
                         *      if (play.PVPSubRank >= 0 && play.PVPSubRank <= 3)
                         *          temp = (int)(temp * 1.0);
                         *      if (play.PVPSubRank >= 4 && play.PVPSubRank <= 4)
                         *          temp = (int)(temp * 0.8);
                         *      if (play.PVPSubRank >= 5 && play.PVPSubRank <= 6)
                         *          temp = (int)(temp * 0.05);
                         *      if (play.PVPSubRank >= 7 && play.PVPSubRank <= 10)
                         *          temp = (int)(temp * 0.02);
                         *      if (play.PVPSubRank >= 7 && play.PVPSubRank <= 11)
                         *          temp = (int)(temp * 0.02);
                         *      if (play.PVPSubRank >= 12)
                         *          temp = (int)(temp * 0.01);
                         *      play.PvPPoint += temp * 1;
                         *      Console.WriteLine("대전테스트3");
                         *  }
                         * }
                         *
                         */
                    }
                }
                else if (tar is script.monster.Monster)
                {
                    take -= (tar as script.monster.Monster).AC;
                    if (take <= 0)
                    {
                        take = 1;
                    }
                    TakeDamage(play, tar, take);
                }
            }
        }