Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 02:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[bugfix]Martial artist automatic attack + add

Discussion on [bugfix]Martial artist automatic attack + add within the Nostale forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2017
Posts: 397
Received Thanks: 60
[bugfix]Martial artist automatic attack + add

OpenNos.GameObject/Character.cs (GenerateSki)


Code:
if (!UseSp)
               {
                   skibase = $"{((byte)Class == 4 ? 1525 : 200 + (20 * (byte)Class))} {((byte)Class < 4 ? 201 + (20 * (byte)Class) : 1526)}";
               }
OpenNos.Handler/CharacterScreenPacketHandler

Code:
       /// <summary>
        /// Char_NEW_JOB character creation character
        /// </summary>
        /// <param name="characterCreateNewJobPacket"></param>
        public void CreateCharacterWrestler(MartialArtistCreatePacket characterCreatePacket)
        {
            if (Session.HasCurrentMapInstance)
            {
                return;
            }

            // TODO: Hold Account Information in Authorized object
            long accountId = Session.Account.AccountId;
            Logger.LogUserEvent("CREATECHARACTER", Session.GenerateIdentity(),
                $"[CreateCharacter]Name: {characterCreatePacket.Name} Slot: {characterCreatePacket.Slot} Gender: {characterCreatePacket.Gender} HairStyle: {characterCreatePacket.HairStyle} HairColor: {characterCreatePacket.HairColor}");
            if (characterCreatePacket.Slot <= 3
                && DAOFactory.CharacterDAO.LoadBySlot(accountId, characterCreatePacket.Slot) == null
                && characterCreatePacket.Name.Length > 3 && characterCreatePacket.Name.Length < 15)
            {
                Regex rg = new Regex(@"^[A-Za-z0-9_äÄöÖüÜß~*<>°+-.!_-Й¤£±†‡×ßø^\S]+$");
                if (rg.Matches(characterCreatePacket.Name).Count == 1)
                {
                    if (DAOFactory.CharacterDAO.LoadByName(characterCreatePacket.Name) == null)
                    {
                        if (characterCreatePacket.Slot > 3)
                        {
                            return;
                        }
                        CharacterDTO newCharacter = new CharacterDTO
                        {
                            Class = ClassType.Fighter,
                            Gender = characterCreatePacket.Gender,
                            HairColor = characterCreatePacket.HairColor,
                            HairStyle = characterCreatePacket.HairStyle,
                            Hp = 221,
                            JobLevel = 1,
                            Level = 81,
                            MapId = 1,
                            MapX = 80,
                            MapY = 116,
                            Mp = 221,
                            MaxMateCount = 10,
                            SpPoint = 2000,
                            SpAdditionPoint = 0,
                            Name = characterCreatePacket.Name,
                            Slot = characterCreatePacket.Slot,
                            AccountId = accountId,
                            MinilandMessage = "Welcome",
                            State = CharacterState.Active,
                            MinilandPoint = 2000,
                            Reputation = 50001,
                        };

                        DAOFactory.CharacterDAO.InsertOrUpdate(ref newCharacter);
                        //CharacterQuestDTO firstQuest = new CharacterQuestDTO { CharacterId = newCharacter.CharacterId, QuestId = 1531, IsMainQuest = true };
                        CharacterSkillDTO sk1 =
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1525 };
                        CharacterSkillDTO sk2 =
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1529 };
                        CharacterSkillDTO sk3 =
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 236 };

                        // init skills
                        List<CharacterSkillDTO> wSkills = new List<CharacterSkillDTO>
                        {
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1525 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1526 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1527 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1528 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1529 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1530 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1531 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1532 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1533 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1534 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1535 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1536 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1537 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1538 },
                            new CharacterSkillDTO { CharacterId = newCharacter.CharacterId, SkillVNum = 1539 }
                        };
                        QuicklistEntryDTO qlst1 = new QuicklistEntryDTO
                        {
                            CharacterId = newCharacter.CharacterId,
                            Type = 1,
                            Slot = 1,
                            Pos = 1
                        };
                        QuicklistEntryDTO qlst2 = new QuicklistEntryDTO
                        {
                            CharacterId = newCharacter.CharacterId,
                            Q2 = 1,
                            Slot = 2
                        };
                        QuicklistEntryDTO qlst3 = new QuicklistEntryDTO
                        {
                            CharacterId = newCharacter.CharacterId,
                            Q2 = 8,
                            Type = 1,
                            Slot = 1,
                            Pos = 16
                        };
                        QuicklistEntryDTO qlst4 = new QuicklistEntryDTO
                        {
                            CharacterId = newCharacter.CharacterId,
                            Q2 = 9,
                            Type = 1,
                            Slot = 3,
                            Pos = 1
                        };
                        //DAOFactory.CharacterQuestDao.InsertOrUpdate(firstQuest);
                        DAOFactory.CharacterSkillDAO.InsertOrUpdate(wSkills);
                        DAOFactory.QuicklistEntryDAO.InsertOrUpdate(qlst1);
                        DAOFactory.QuicklistEntryDAO.InsertOrUpdate(qlst2);
                        DAOFactory.QuicklistEntryDAO.InsertOrUpdate(qlst3);
                        DAOFactory.QuicklistEntryDAO.InsertOrUpdate(qlst4);
                        DAOFactory.CharacterSkillDAO.InsertOrUpdate(sk1);
                        DAOFactory.CharacterSkillDAO.InsertOrUpdate(sk2);
                        DAOFactory.CharacterSkillDAO.InsertOrUpdate(sk3);

                        using (Inventory startupInventory = new Inventory(new Character(newCharacter)))
                        {
                            startupInventory.AddNewToInventory(4757, 1, InventoryType.Wear, 8, 10);
                            startupInventory.AddNewToInventory(4756, 1, InventoryType.Wear, 8, 10);
                            startupInventory.AddNewToInventory(4758, 1, InventoryType.Wear, 8, 10);
                            startupInventory.AddNewToInventory(800, 1, InventoryType.Equipment);
                            startupInventory.AddNewToInventory(801, 1, InventoryType.Equipment);
                            startupInventory.AddNewToInventory(802, 1, InventoryType.Equipment);
                            startupInventory.AddNewToInventory(803, 1, InventoryType.Equipment);    
                            startupInventory.ForEach(i => DAOFactory.IteminstanceDAO.InsertOrUpdate(i));
                            LoadCharacters(characterCreatePacket.OriginalContent);
                        }
                    }
                    else
                    {
                        Session.SendPacketFormat($"info {Language.Instance.GetMessageFromKey("ALREADY_TAKEN")}");
                    }
                }
                else
                {
                    Session.SendPacketFormat($"info {Language.Instance.GetMessageFromKey("INVALID_CHARNAME")}");
                }
            }
        }
OpenNos.GameObject/Packet/ClientPacket

Code:
using OpenNos.Core;
using OpenNos.Domain;

namespace OpenNos.Packets.ClientPackets
{
    [PacketHeader("CHAR_NEW_JOB", PassNonParseablePacket = true)]
    public class MartialArtistCreatePacket : PacketDefinition
    {
        [PacketIndex(0)]
        public string Name { get; set; }

        [PacketIndex(1)]
        public byte Slot { get; set; }

        [PacketIndex(2)]
        public GenderType Gender { get; set; }

        [PacketIndex(3)]
        public HairStyleType HairStyle { get; set; }

        [PacketIndex(4)]
        public HairColorType HairColor { get; set; }
    }
}
redbull2905 is offline  
Thanks
2 Users
Reply


Similar Threads Similar Threads
[Release] Create martial artist 4th class in the creation menu
05/30/2019 - Nostale - 9 Replies
1: OpenNos.GameObject/Packet/ClientPacket => using OpenNos.Core; using OpenNos.Domain; namespace OpenNos.Packets.ClientPackets { public class MartialArtistCreatePacket : PacketDefinition {
[Release] Wizard auto attack bugfix from database
01/02/2018 - SRO PServer Guides & Releases - 18 Replies
#requestdelete
Buying cps gold & martial artist gear
01/07/2017 - Conquer Online 2 Trading - 1 Replies
Looking for stuff in scar server pm me rates :)
[Bugfix] Attack over a mount
08/04/2012 - Metin2 PServer Guides & Strategies - 14 Replies
hello, I release this, because a lot of people have problem with new mounts. So, the problem of the mounts that they don't attack is on our metin2.bin.. I give you this metin2.bin with pong : 1234abcd5678efgh I used it with Lexico starter and i think it's ok for all versions of clients (2010-2012)



All times are GMT +1. The time now is 02:45.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.