Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Nostale
You last visited: Today at 01:15

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

Advertisement



[Release] Prestige system with npc implementation

Discussion on [Release] Prestige system with npc implementation within the Nostale forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2018
Posts: 149
Received Thanks: 58
[Release] Prestige system with npc implementation


How it works?
1. Create random npc with Dialog 18
2. Change the case "17779" to npcid
3. Add this code to nrunhandler.cs
HTML Code:
                case 3000:
                    switch (packet.Type)
                    {
                        case 0:
                            switch (packet.Value)
                            {
                                case 2:
                                    switch (packet.NpcId)
                                    {
                                        case 17779: // npc id
                                            {
                                                if (Session.Character.Level >= 99 && Session.Character.prestigeLevel == 4) // minimal lvl and prestige lvl
                                                {
                                                    Session.Character.Level = 1; // what lvl must be set after change prestige
                                                    Session.Character.prestigeLevel = 5; // what prestige lvl must be set after change prestige
                                                    Session.Character.Compliment = 500; // rewards 
                                                    Session.Character.GiftAdd(396, 1); // rewards
                                                    Session.SendPacket(Session.Character.GenerateStat()); // refresh char stat
                                                    Session.SendPacket(Session.Character.GenerateStatChar()); // refresh char stat
                                                }
                                                else
                                                {
                                                    if (Session.Character.Level >= 99 && Session.Character.prestigeLevel == 3)
                                                    {
                                                        Session.Character.Level = 1;
                                                        Session.Character.prestigeLevel = 4;
                                                        Session.Character.Compliment = 400;
                                                        Session.Character.GiftAdd(395, 1);
                                                        Session.SendPacket(Session.Character.GenerateStat());
                                                        Session.SendPacket(Session.Character.GenerateStatChar());
                                                    }
                                                    else
                                                    {
                                                        if (Session.Character.Level >= 99 && Session.Character.prestigeLevel == 2)
                                                        {
                                                            Session.Character.Level = 1;
                                                            Session.Character.prestigeLevel = 3;
                                                            Session.Character.Compliment = 300;
                                                            Session.Character.GiftAdd(394, 1);
                                                            Session.SendPacket(Session.Character.GenerateStat());
                                                            Session.SendPacket(Session.Character.GenerateStatChar());
                                                        }
                                                        else
                                                        {
                                                            if (Session.Character.Level >= 99 && Session.Character.prestigeLevel == 1)
                                                            {
                                                                Session.Character.Level = 1;
                                                                Session.Character.prestigeLevel = 2;
                                                                Session.Character.Compliment = 200;
                                                                Session.Character.GiftAdd(393, 1);
                                                                Session.SendPacket(Session.Character.GenerateStat());
                                                                Session.SendPacket(Session.Character.GenerateStatChar());
                                                            }
                                                            else
                                                            {
                                                                if (Session.Character.Level >= 99 && Session.Character.prestigeLevel == 0)
                                                                {
                                                                    Session.Character.Level = 1;
                                                                    Session.Character.prestigeLevel = 1;
                                                                    Session.Character.Compliment = 100;
                                                                    Session.Character.GiftAdd(392, 1);
                                                                    Session.SendPacket(Session.Character.GenerateStat());
                                                                    Session.SendPacket(Session.Character.GenerateStatChar());
                                                                }
                                                                else
                                                                {
                                                                    Session.SendPacket("msg 5 Your Level is not high enough!"); // too small lvl
                                                                    Session.SendPacket("msg 5 Your Level is not high enough!"); // too small lvl
                                                                    Session.SendPacket("msg 5 Your Level is not high enough!"); // too small lvl
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            break;
                                    }
                                    break;
                            }
                            break;
                    }
                    break;
4. Add
HTML Code:
        public int prestigeLevel { get; set; }
to OpenNos.DAL.EF/CharacterDTO.cs
5. Add
HTML Code:
        public int prestigeLevel { get; set; }
to OpenNos.DAL.EF/Character.cs
6. Add
HTML Code:
             output.prestigeLevel = input.prestigeLevel;
to charactermapper.cs
7. update your database use update-database -Verobse
8. add this code
HTML Code:
        public string GenerateCInfo() => $"c_info {(Authority == AuthorityType.Moderator && !Undercover ? $"[NH]" + Name : Authority == AuthorityType.GameMaster ? $"[P{prestigelevel}]" + Name : Authority == AuthorityType.User ? $"[P{prestigelevel}]" + Name : Authority == AuthorityType.BitchNiggerFaggot ? Name + $"[BitchNiggerFaggot]" : Name)} - -1 {(Family != null && !Undercover ? $"{Family.FamilyId} {Family.Name}({Language.Instance.GetMessageFromKey(FamilyCharacter.Authority.ToString().ToUpper())})" : "-1 -")} {CharacterId} {(Invisible ? 6 : Undercover ? (byte)AuthorityType.User : Authority < AuthorityType.User ? (byte)AuthorityType.User : (byte)Authority)} {(byte)Gender} {(byte)HairStyle} {(byte)HairColor} {(byte)Class} {(GetDignityIco() == 1 ? GetReputationIco() : -GetDignityIco())} {(Authority == AuthorityType.Moderator ? 500 : Compliment)} {(UseSp || IsVehicled ? Morph : 0)} {(Invisible ? 1 : 0)} {Family?.FamilyLevel ?? 0} {(UseSp ? MorphUpgrade : 0)} {ArenaWinner}";
and this
HTML Code:
            return $"in 1 {(Authority == AuthorityType.Moderator && !Undercover ? $"[NH]" + _name : Authority == AuthorityType.GameMaster ? $"[P{prestigelevel}]" + _name : Authority == AuthorityType.User ? $"[P{prestigelevel}]" + _name : Authority == AuthorityType.BitchNiggerFaggot ? $"[BitchNiggerFaggot][P{prestigelevel}]" : _name)} - {CharacterId} {PositionX} {PositionY} {Direction} {(Undercover ? (byte)AuthorityType.User : Authority < AuthorityType.User ? (byte)AuthorityType.User : (byte)Authority)} {(byte)Gender} {(byte)HairStyle} {color} {(byte)Class} {GenerateEqListForPacket()} {Math.Ceiling(Hp / HPLoad() * 100)} {Math.Ceiling(Mp / MPLoad() * 100)} {(IsSitting ? 1 : 0)} {(Group?.GroupType == GroupType.Group ? (Group?.GroupId ?? -1) : -1)} {(fairy != null && !Undercover ? 4 : 0)} {fairy?.Item.Element ?? 0} 0 {fairy?.Item.Morph ?? 0} 0 {(UseSp || IsVehicled ? Morph : 0)} {GenerateEqRareUpgradeForPacket()} {(!Undercover ? (foe ? -1 : Family?.FamilyId ?? -1) : -1)} {(!Undercover ? (foe ? _name : Family?.Name ?? "-") : "-")} {(GetDignityIco() == 1 ? GetReputationIco() : -GetDignityIco())} {(Invisible ? 1 : 0)} {(UseSp ? MorphUpgrade : 0)} {_faction} {(UseSp ? MorphUpgrade2 : 0)} {Level} {Family?.FamilyLevel ?? 0} {ArenaWinner} {(Authority == AuthorityType.Moderator && !Undercover ? 500 : Compliment)} {Size} {HeroLevel}";
in the Gameobject.character.cs

If someone have problem tell me.
Radiv is offline  
Thanks
3 Users
Old 11/16/2018, 13:45   #2
 
elite*gold: 0
Join Date: Apr 2018
Posts: 149
Received Thanks: 58
Quote:
Originally Posted by loulouna23 View Post
How add prestige in item

And how add p0 p1 ...
Why item? Npc is better. And what p0 and p1?
Radiv is offline  
Old 11/16/2018, 17:33   #3
 
elite*gold: 0
Join Date: Jun 2018
Posts: 14
Received Thanks: 3
Code:
        public void PrestigeFunction(ItemInstance inv)
        {
            if (Session.Character.MapInstance != null)
            {
                if (Session.Character.Inventory.Any(s => s.Type == InventoryType.Wear))
                {
                    Session.SendPacket(UserInterfaceHelper.GenerateMsg(Language.Instance.GetMessageFromKey("EQ_NOT_EMPTY"), 0));
                    return;
                }

                if (Session.Character.Level == 250 && Session.Character.HeroLevel == 100 && Session.Character.Prestige < 20)
                {
                    Session.Character.Prestige++;
                    ServerManager.Shout(Name + " est passé prestige " + Prestige);
                    Session.SendPacket(Session.Character.GenerateLev());
                    Session.SendPacket(Session.Character.GenerateIn());
                    Session.SendPacket(Session.Character.GenerateCInfo());
                    Session.SendPacket(Session.Character.GenerateStat());
                    Session.Character.Save();
                    Session.Character.Inventory.RemoveItemFromInventory(inv.Id);

                }
                else
                {
                    Session.SendPacket("msg 4 Tu n'as pas le niveau requis !");
                }
            }
        }
Code:
        public string GenerateCInfo() => $"c_info {(Authority == AuthorityType.Moderator && !Undercover ? $"[NH]" + Name : Authority == AuthorityType.GameMaster ? $"[P{Prestige}]" + Name : Authority == AuthorityType.User ? $"[P{Prestige}]" + Name : Authority == AuthorityType.BitchNiggerFaggot ? Name + $"[BitchNiggerFaggot]" : Name)} - -1 {(Family != null && !Undercover ? $"{Family.FamilyId} {Family.Name}({Language.Instance.GetMessageFromKey(FamilyCharacter.Authority.ToString().ToUpper())})" : "-1 -")} {CharacterId} {(Invisible ? 6 : Undercover ? (byte)AuthorityType.User : Authority < AuthorityType.User ? (byte)AuthorityType.User : (byte)Authority)} {(byte)Gender} {(byte)HairStyle} {(byte)HairColor} {(byte)Class} {(GetDignityIco() == 1 ? GetReputationIco() : -GetDignityIco())} {(Authority == AuthorityType.Moderator ? 500 : Compliment)} {(UseSp || IsVehicled ? Morph : 0)} {(Invisible ? 1 : 0)} {Family?.FamilyLevel ?? 0} {(UseSp ? MorphUpgrade : 0)} {ArenaWinner}";
Code:
            return $"in 1 {(Authority == AuthorityType.Moderator && !Undercover ? $"[NH]" + _name : Authority == AuthorityType.GameMaster ? $"[P{Prestige}]" + _name : Authority == AuthorityType.User ? $"[P{Prestige}]" + _name : Authority == AuthorityType.BitchNiggerFaggot ? $"[BitchNiggerFaggot][P{Prestige}]" : _name)} - {CharacterId} {PositionX} {PositionY} {Direction} {(Undercover ? (byte)AuthorityType.User : Authority < AuthorityType.User ? (byte)AuthorityType.User : (byte)Authority)} {(byte)Gender} {(byte)HairStyle} {color} {(byte)Class} {GenerateEqListForPacket()} {Math.Ceiling(Hp / HPLoad() * 100)} {Math.Ceiling(Mp / MPLoad() * 100)} {(IsSitting ? 1 : 0)} {(Group?.GroupType == GroupType.Group ? (Group?.GroupId ?? -1) : -1)} {(fairy != null && !Undercover ? 4 : 0)} {fairy?.Item.Element ?? 0} 0 {fairy?.Item.Morph ?? 0} 0 {(UseSp || IsVehicled ? Morph : 0)} {GenerateEqRareUpgradeForPacket()} {(!Undercover ? (foe ? -1 : Family?.FamilyId ?? -1) : -1)} {(!Undercover ? (foe ? _name : Family?.Name ?? "-") : "-")} {(GetDignityIco() == 1 ? GetReputationIco() : -GetDignityIco())} {(Invisible ? 1 : 0)} {(UseSp ? MorphUpgrade : 0)} {_faction} {(UseSp ? MorphUpgrade2 : 0)} {Level} {Family?.FamilyLevel ?? 0} {ArenaWinner} {(Authority == AuthorityType.Moderator && !Undercover ? 500 : Compliment)} {Size} {HeroLevel}";
Code:
            switch (Prestige)
            {
                case 0:
                    break;

                case 1:
                    Session.Character.AddStaticBuff(new StaticBuffDTO { CardId = 131 });
                    break;
                case 2:
                case 3:
                case 4:
                case 5:
                    Session.Character.AddStaticBuff(new StaticBuffDTO { CardId = 131 });
                    break;
                case 6:
                case 7:
                case 8:
                case 9:
                case 10:
                    Session.Character.AddStaticBuff(new StaticBuffDTO { CardId = 131 });
                    break;
                case 11:
                case 12:
                case 13:
                case 14:
                case 15:
                    Session.Character.AddStaticBuff(new StaticBuffDTO { CardId = 131 });
                    break;
                case 16:
                case 17:
                case 18:
                case 19:
                case 20:
                    Session.Character.AddStaticBuff(new StaticBuffDTO { CardId = 131 });
                    break;

                default:
                    Session.Character.AddStaticBuff(new StaticBuffDTO { CardId = 131 });
                    Session.Character.AddStaticBuff(new StaticBuffDTO { CardId = 131 });
                    Session.Character.AddStaticBuff(new StaticBuffDTO { CardId = 131 });
                    Session.Character.AddStaticBuff(new StaticBuffDTO { CardId = 131 });
                    Session.Character.AddStaticBuff(new StaticBuffDTO { CardId = 131 });
                    break;
            }
Code:
                case 8000:
                    session.Character.PrestigeFunction(inv);
                    break;



xd
Nephya is offline  
Old 11/16/2018, 18:35   #4
 
Irelia<3's Avatar
 
elite*gold: 0
Join Date: Sep 2018
Posts: 243
Received Thanks: 59
tutorial for NSharp please :c
Irelia<3 is offline  
Old 11/16/2018, 19:59   #5
 
elite*gold: 0
Join Date: Nov 2018
Posts: 11
Received Thanks: 2
command prestige no work help me!
MarsB51 is offline  
Old 11/16/2018, 23:56   #6
 
Irelia<3's Avatar
 
elite*gold: 0
Join Date: Sep 2018
Posts: 243
Received Thanks: 59
NosSharp or NosWings table problem get set does not exist.
Irelia<3 is offline  
Old 11/17/2018, 00:23   #7
 
elite*gold: 0
Join Date: Nov 2018
Posts: 11
Received Thanks: 2
@ i send you pm read
MarsB51 is offline  
Old 11/17/2018, 02:00   #8
 
0Lucifer0's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 1,005
Received Thanks: 1,019
Quote:
Originally Posted by Radiv View Post

How it works?
1. Create random npc with Dialog 18
2. Change the case "17779" to npcid
3. Add this code to nrunhandler.cs
4. Add
HTML Code:
        public int prestigeLevel { get; set; }
to OpenNos.DAL.EF/CharacterDTO.cs
5. Add
HTML Code:
        public int prestigeLevel { get; set; }
to OpenNos.DAL.EF/Character.cs
6. update your database use update-database -Verobse
HTML Code:
                case 3000:
                    switch (packet.Type)
                    {
                        case 0:
                            switch (packet.Value)
                            {
                                case 2:
                                    switch (packet.NpcId)
                                    {
                                        case 17779: // npc id
                                            {
                                                if (Session.Character.Level >= 99 && Session.Character.prestigeLevel == 4) // minimal lvl and prestige lvl
                                                {
                                                    Session.Character.Level = 1; // what lvl must be set after change prestige
                                                    Session.Character.prestigeLevel = 5; // what prestige lvl must be set after change prestige
                                                    Session.Character.Compliment = 500; // rewards 
                                                    Session.Character.GiftAdd(396, 1); // rewards
                                                    Session.SendPacket(Session.Character.GenerateStat()); // refresh char stat
                                                    Session.SendPacket(Session.Character.GenerateStatChar()); // refresh char stat
                                                }
                                                else
                                                {
                                                    if (Session.Character.Level >= 99 && Session.Character.prestigeLevel == 3)
                                                    {
                                                        Session.Character.Level = 1;
                                                        Session.Character.prestigeLevel = 4;
                                                        Session.Character.Compliment = 400;
                                                        Session.Character.GiftAdd(395, 1);
                                                        Session.SendPacket(Session.Character.GenerateStat());
                                                        Session.SendPacket(Session.Character.GenerateStatChar());
                                                    }
                                                    else
                                                    {
                                                        if (Session.Character.Level >= 99 && Session.Character.prestigeLevel == 2)
                                                        {
                                                            Session.Character.Level = 1;
                                                            Session.Character.prestigeLevel = 3;
                                                            Session.Character.Compliment = 300;
                                                            Session.Character.GiftAdd(394, 1);
                                                            Session.SendPacket(Session.Character.GenerateStat());
                                                            Session.SendPacket(Session.Character.GenerateStatChar());
                                                        }
                                                        else
                                                        {
                                                            if (Session.Character.Level >= 99 && Session.Character.prestigeLevel == 1)
                                                            {
                                                                Session.Character.Level = 1;
                                                                Session.Character.prestigeLevel = 2;
                                                                Session.Character.Compliment = 200;
                                                                Session.Character.GiftAdd(393, 1);
                                                                Session.SendPacket(Session.Character.GenerateStat());
                                                                Session.SendPacket(Session.Character.GenerateStatChar());
                                                            }
                                                            else
                                                            {
                                                                if (Session.Character.Level >= 99 && Session.Character.prestigeLevel == 0)
                                                                {
                                                                    Session.Character.Level = 1;
                                                                    Session.Character.prestigeLevel = 1;
                                                                    Session.Character.Compliment = 100;
                                                                    Session.Character.GiftAdd(392, 1);
                                                                    Session.SendPacket(Session.Character.GenerateStat());
                                                                    Session.SendPacket(Session.Character.GenerateStatChar());
                                                                }
                                                                else
                                                                {
                                                                    Session.SendPacket("msg 5 Your Level is not high enough!"); // too small lvl
                                                                    Session.SendPacket("msg 5 Your Level is not high enough!"); // too small lvl
                                                                    Session.SendPacket("msg 5 Your Level is not high enough!"); // too small lvl
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                            break;
                                    }
                                    break;
                            }
                            break;
                    }
                    break;
When you use switch instead of if and if instead of switch... this code deserve a medal and is a good example of what people should never do
0Lucifer0 is offline  
Thanks
3 Users
Old 04/11/2019, 11:21   #9
 
elite*gold: 0
Join Date: Apr 2018
Posts: 149
Received Thanks: 58
Small tutorial update.

Quote:
Originally Posted by 0Lucifer0 View Post
When you use switch instead of if and if instead of switch... this code deserve a medal and is a good example of what people should never do
Bruh it's exmaple if someone want can add this code to command or after use item.
Radiv is offline  
Old 04/11/2019, 11:25   #10
 
0Lucifer0's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 1,005
Received Thanks: 1,019
Quote:
Originally Posted by Radiv View Post
Small tutorial update.



Bruh it's exmaple if someone want can add this code to command or after use item.
It doesn’t change anything in the fact this is ugly monkey code and this should never be used anywhere
0Lucifer0 is offline  
Thanks
2 Users
Old 04/11/2019, 13:01   #11
 
Saber none's Avatar
 
elite*gold: 30
Join Date: Sep 2014
Posts: 593
Received Thanks: 316
Quote:
Originally Posted by Radiv View Post
Small tutorial update.



Bruh it's exmaple if someone want can add this code to command or after use item.
I mean he is right, you confused every if with every switch, you can completly exchange those if's with a switch ^^
Saber none is offline  
Old 03/15/2020, 16:00   #12
 
Zoro889's Avatar
 
elite*gold: 0
Join Date: Jul 2019
Posts: 48
Received Thanks: 15
if i use your system dont save me prestige if i am prestige lvl 0 i prestige to lvl 1 i relog and i come back at p0
Zoro889 is offline  
Old 03/15/2020, 18:24   #13
 
Shitoshi's Avatar
 
elite*gold: 0
Join Date: Feb 2020
Posts: 51
Received Thanks: 69
Quote:
Originally Posted by Zoro889 View Post
if i use your system dont save me prestige if i am prestige lvl 0 i prestige to lvl 1 i relog and i come back at p0
Add prestigeLevel = input.prestigeLevel; to Character.cs in GameObject
Shitoshi is offline  
Old 03/15/2020, 18:37   #14
 
Zoro889's Avatar
 
elite*gold: 0
Join Date: Jul 2019
Posts: 48
Received Thanks: 15
same
Zoro889 is offline  
Old 03/15/2020, 19:07   #15
 
InnoTx's Avatar
 
elite*gold: 100
Join Date: Dec 2016
Posts: 342
Received Thanks: 82
I would change the code with your switch instead of using so many ifs


and yeah do what shitoshi say and it should be work
InnoTx is offline  
Reply


Similar Threads Similar Threads
Class Reborn Cap 110 - Dg 11- Pvp System- Uniques System -Job System- Coin System
04/09/2018 - SRO PServer Advertising - 17 Replies
http://i.epvpimg.com/HXIucab.jpg http://i.epvpimg.com/Ht37fab.png https://www.youtube.com/watch?v=1vJSSpEqTZw http://i.epvpimg.com/Ht37fab.png Site ClassReborn Online
Class Reborn Cap 110 - Dg 11- Pvp System- Uniques System -Job System- Coin System
02/18/2018 - SRO PServer Advertising - 2 Replies
http://i.epvpimg.com/HXIucab.jpg http://i.epvpimg.com/Ht37fab.png Site Download
Chi system implementation
07/28/2013 - CO2 Private Server - 6 Replies
Chi system implementation , i found this from the egy site. anyone could pin point where to put this codes? using Conquer_Online_Server.Client; using System; namespace Conquer_Online_Server.Network.GamePackets {
Zoom Hack [implementation]
01/22/2010 - GW Exploits, Hacks, Bots, Tools & Macros - 34 Replies
Just a small Zoom Hack. How to do: 1. Run Guild Wars (you won't be able to run the hack without running instance of Guild Wars) 2. choose an Value (69-75).* 3. press 'Freeze'.



All times are GMT +1. The time now is 01:15.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.