elitepvpers

elitepvpers (https://www.elitepvpers.com/forum/)
-   Nostale (https://www.elitepvpers.com/forum/nostale/)
-   -   [Release/OpenNos] Prestige System (https://www.elitepvpers.com/forum/nostale/4498176-release-opennos-prestige-system.html)

ImTheReal 06/30/2018 17:22

[Release/OpenNos] Prestige System
 
Hey folks,
today i wanna release a very simple prestige System.

Informations:
Spoiler:
This System is just a simple one.
By using it, you will be able to reset your Level, Hero Level, Joblevel and also gift Items to other players.

Step 1: Add a CommandPacket!
- For this action, you need to visit /OpenNos.GameObjects/Packets/CommandPackets. You need to create a class, which is called "PrestigePacket.cs".
After doing this, you need to implement a code.
Spoiler:
Code:

using OpenNos.Core;
using OpenNos.Domain;

namespace OpenNos.GameObject.CommandPackets
{
    [PacketHeader("$Prestige", PassNonParseablePacket = true, Authority = AuthorityType.User)]
    public class PrestigePacket : PacketDefinition
    {
      //You can add a Helper, but this isnt usefull at all.
    }
}


Thats the command Packet

Step 2: Creating a Handler!
- Visit /OpenNos.Handler/CommandPacketHandler.cs
After you opened it up, you can create a new Code.
Spoiler:
Code:

/// <summary>
/// $Prestige
/// </summary>
/// <param name="prestigePacket"></param>
public void Prestige(PrestigePacket prestigePacket)
        {
            if (Session.Character.Level == 99)
            {
            //-------------------------------------------------------------
            //Now add you actions
            //For example
            //Session.Character.Level = 1;
            //Session.Character.JobLevel = 1;
            //Session.Character.HeroLevel = 0;
            //Now add your Benefits
            //For example: Compliment, Reputation, Gold
            //For this, you have to add Session.Character.and here you can
            //add your wished benefit like Session.Character.Compliment = 50;
            //-------------------------------------------------------------
            Session.Character.Level = 1; //Makes Character Lvl 1
            Session.Character.JobLevel = 1; //Makes Character JLvl 1
            Session.Character.HeroLevel = 0; //Makes Character HLvl 0
            Session.Character.Compliment = 50; //Adds 50 Compliment
            Session.Character.GiftAdd(1, 1); //Adds your gift to the player
            }
            else
            {
            Session.SendPacket("msg 5 Your Level is not high enough!");
            //Add the message, which will pop up, when Player has
            //not the requirements.
            }
        }


Requirements
To add the Code: Knowledge 4/10
To edit it the way you want: 5/10
To add more benefits, or recode it: 7/10

Hope it helped ya guys out!

Greetings,
Brix - Gardia Systems Owner

Voria 06/30/2018 17:50

Thanks for Release @[Only registered and activated users can see links. Click Here To Register...] Good Job

Saber none 06/30/2018 17:57

Thx m8 I appreciate that, but are you sure about the first two requirements? Thats basically copy and paste.

ImTheReal 06/30/2018 18:01

Quote:

Originally Posted by mix0067@ (Post 36984763)
Thx m8 I appreciate that, but are you sure about the first two requirements? Thats basically copy and paste.

I said that, to show how easy it is to add these. :)
And thanks!

Quote:

Originally Posted by Voria (Post 36984749)
Thanks for Release @[Only registered and activated users can see links. Click Here To Register...] Good Job

Thanks!! :)

erixor 07/01/2018 17:58

This is not a prestige system, this is a single if statement (and yet you managed to hardcode it, and make it wrong)

- Don't hardcode lvl 99, on Ciapa's source you have a configuration manager & on ON.NW source you have everything stored in ServerManager, which is a bit better.

- Hardcoded packet strings is not a viable or maintainable solution

- Your else condition is useless

- You don't add 50 compliment, you set the compliment of the character to 50, no matter the prestige

If anyone want's to make a prestige system, this is definately not a good way (I'm talking for developers of course, not copy & paste leechers)


Anyways, that was just my opinion, thanks for contributing to this community

ImTheReal 07/01/2018 23:53

Quote:

Originally Posted by erixor (Post 36986581)
This is not a prestige system, this is a single if statement (and yet you managed to hardcode it, and make it wrong)

- Don't hardcode lvl 99, on Ciapa's source you have a configuration manager & on ON.NW source you have everything stored in ServerManager, which is a bit better.

- Hardcoded packet strings is not a viable or maintainable solution

- Your else condition is useless

- You don't add 50 compliment, you set the compliment of the character to 50, no matter the prestige

If anyone want's to make a prestige system, this is definately not a good way (I'm talking for developers of course, not copy & paste leechers)


Anyways, that was just my opinion, thanks for contributing to this community

Of course it is not the right way but, i like how it works and the else statement is just a checker. It works if u know how. And ye, it just set the Compliments to 50 cuz u forgot to add "+" which was a typo. It is a Prestige System, just simple made.
- Sets Level, Joblevel and Hero Level to 1
- Able to Gift Items to Player
- Can check if Player has the requirements. (Even if its hardcoded its not possible to use it without the requirements)


But thanks for your Opinion

Zanouu 07/02/2018 06:03

Code:

        public void Prestige(Prestige PrestigePacket)
        {
                        if (Session.CurrentMapInstance.MapInstanceType == MapInstanceType.BaseMapInstance)
                        {
                                if (Session.Character.Level == ServerManager.Instance.Configuration.MaxLevel
                                        && Session.Character.JobLevel == ServerManager.Instance.Configuration.MaxJobLevel
                                        && Session.Character.HeroLevel == ServerManager.Instance.Configuration.MaxHeroLevel)
                                {
                                        if (Session.Character.Inventory.All(i => i.Type != InventoryType.Wear))
                                        {
                                                Session.Character.ChangeClassPrestige(ClassType.Adventurer);
                                                Session.Character.Prestige += 1;
                                                ServerManager.Instance.ChangeMap(Session.Character.CharacterId);
                                                //  RewardsHelper.Instance.GetLevelUpRewards(Session);
                                                LogHelper.Instance.InsertCommandLog(Session.Character.Name, Session.Character.CharacterId, PrestigePacket, Session.IpAddress);
                                        }
                                        else
                                        {
                                                Session.SendPacket(UserInterfaceHelper.GenerateMsg(Language.Instance.GetMessageFromKey("EQ_NOT_EMPTY"), 0));
                                        }
                                }
                                else
                                {
                                        Session.SendPacket(UserInterfaceHelper.GenerateMsg(Language.Instance.GetMessageFromKey("NOT_LEVEL_PRESTIGE"), 0));
                                }
                        }
        }


Blowa 07/02/2018 10:16

Quote:

Originally Posted by Zanouu (Post 36987617)
Spoiler:
Code:

public void Prestige(Prestige PrestigePacket)
{
        if (Session.CurrentMapInstance.MapInstanceType != MapInstanceType.BaseMapInstance)
        {
                return;
        }
       
        if (Sesssion.Character.Level != ServerManager.Instance.Configuration.MaxLevel ||
                Session.Character.JobLevel != ServerManager.Instance.Configuration.MaxJobLevel ||
                Session.Character.HeroLevel != ServerManager.Instance.Configuration.MaxHeroLevel)
        {
                Session.SendPacket(UserInterfaceHelper.GenerateMsg(Language.Instance.GetMessageFromKey("NOT_LEVEL_PRESTIGE"), 0));
                return;
        }
       
       
        if (Session.Character.Inventory.Any(s => s.Type == InventoryType.Wear))
        {
                Session.SendPacket(UserInterfaceHelper.GenerateMsg(Language.Instance.GetMessageFromKey("EQ_NOT_EMPTY"), 0));
                return;
        }
       
        Session.Character.ChangeClassPrestige(ClassType.Adventurer);
        Session.Character.Prestige += 1;
        ServerManager.Instance.ChangeMap(Session.Character.CharacterId);
        //  RewardsHelper.Instance.GetLevelUpRewards(Session);
        LogHelper.Instance.InsertCommandLog(Session.Character.Name, Session.Character.CharacterId, PrestigePacket, Session.IpAddress);
}


As I've already told you, invert your conditions and checks "errors" before your processing to reduce code's nesting (like i modified)

[NH]Pyro 07/10/2018 18:22

Use RagePoint for identify prestige!!!

ImTheReal 07/11/2018 23:04

Quote:

Originally Posted by [NH]Pyro (Post 37003963)
Use RagePoint for identify prestige!!!

Sounds cool, i personally used Compliments but RagePoint is also cool to use.

redbull2905 07/18/2018 21:13

Quote:

Originally Posted by ImTheReal (Post 36984691)
Hey folks,
today i wanna release a very simple prestige System.

Informations:
Spoiler:
This System is just a simple one.
By using it, you will be able to reset your Level, Hero Level, Joblevel and also gift Items to other players.

Step 1: Add a CommandPacket!
- For this action, you need to visit /OpenNos.GameObjects/Packets/CommandPackets. You need to create a class, which is called "PrestigePacket.cs".
After doing this, you need to implement a code.
Spoiler:
Code:

using OpenNos.Core;
using OpenNos.Domain;

namespace OpenNos.GameObject.CommandPackets
{
    [PacketHeader("$Prestige", PassNonParseablePacket = true, Authority = AuthorityType.User)]
    public class PrestigePacket : PacketDefinition
    {
      //You can add a Helper, but this isnt usefull at all.
    }
}


Thats the command Packet

Step 2: Creating a Handler!
- Visit /OpenNos.Handler/CommandPacketHandler.cs
After you opened it up, you can create a new Code.
Spoiler:
Code:

/// <summary>
/// $Prestige
/// </summary>
/// <param name="prestigePacket"></param>
public void Prestige(PrestigePacket prestigePacket)
        {
            if (Session.Character.Level == 99)
            {
            //-------------------------------------------------------------
            //Now add you actions
            //For example
            //Session.Character.Level = 1;
            //Session.Character.JobLevel = 1;
            //Session.Character.HeroLevel = 0;
            //Now add your Benefits
            //For example: Compliment, Reputation, Gold
            //For this, you have to add Session.Character.and here you can
            //add your wished benefit like Session.Character.Compliment = 50;
            //-------------------------------------------------------------
            Session.Character.Level = 1; //Makes Character Lvl 1
            Session.Character.JobLevel = 1; //Makes Character JLvl 1
            Session.Character.HeroLevel = 0; //Makes Character HLvl 0
            Session.Character.Compliment = 50; //Adds 50 Compliment
            Session.Character.GiftAdd(1, 1); //Adds your gift to the player
            }
            else
            {
            Session.SendPacket("msg 5 Your Level is not high enough!");
            //Add the message, which will pop up, when Player has
            //not the requirements.
            }
        }


Requirements
To add the Code: Knowledge 4/10
To edit it the way you want: 5/10
To add more benefits, or recode it: 7/10

Hope it helped ya guys out!

Greetings,
Brix - Gardia Systems Owner

I changed the code you had forget Session.Character.ChangeClass (ClassType.Adventurer);
and I set for the hero level

/// <summary>
/// $Prestige
/// </summary>
/// <param name="prestigePacket"></param>
public void Prestige(PrestigePacket prestigePacket)
{
if (Session.Character.Level == 250)
{
if (Session.Character.HeroLevel == 100)
{

Session.Character.ChangeClass(ClassType.Adventurer );
Session.Character.MapId = 1;
Session.Character.Level = 15;
Session.Character.Prestige +=1;
Session.Character.JobLevel = 20;
Session.Character.HeroLevel = 0;
Session.Character.DefenceRate =+500;
Session.Character.GiftAdd(1286, 10);
Session.Character.DistanceDefence =+500;
Session.Character.MagicalDefence =+500;
Session.Character.GiftAdd(9074, 10);
Session.Character.GiftAdd(1249, 10);

{
return;
}

}

}

Zanouu 07/18/2018 22:12

Quote:

Originally Posted by redbull2905 (Post 37020312)
Session.Character.DefenceRate = + +500;
Session.Character.DistanceDefence = + +500;
Session.Character.MagicalDefence = + +500;


= + + ? wtf is this :confused::confused::lul:

0Lucifer0 07/18/2018 22:21

Quote:

Originally Posted by Zanouu (Post 37020436)
= + + ? wtf is this :confused::confused::lul:

The proof he doesn’t know what he is doing... this will set to 500. This still compile because of the space but he could even do + + + + + (((((500))))) this would still compile.

ImTheReal 07/18/2018 22:50

Quote:

Originally Posted by redbull2905 (Post 37020312)
I changed the code you had forget Session.Character.ChangeClass (ClassType.Adventurer);
and I set for the hero level

/// <summary>
/// $ Prestige
/// </ summary>
/// <nom de paramètre = "prestigePacket"> </ param>
public void Prestige (PrestigePacket paquet de prestige)
{
if ( Session.Character.Level == 250)
{
if (Session.Character.HeroLevel == 100)
{

Session.Character.ChangeClass (ClassType.Adventurer);
Session.Character.Level = 15;
Session.Character.JobLevel = 20;
Session.Character.HeroLevel = 0;
Session.Character.DefenceRate = + +500;
Session.Character.GiftAdd (1286, 10);
Session.Character.DistanceDefence = + +500;
Session.Character.MagicalDefence = + +500;
Session.Character.GiftAdd (1289, 10);
Session.Character.GiftAdd (1249, 10);

{
return;
}

}

}
else
{
Session.SendPacket ("msg 5 Votre niveau n'est pas assez élevé!");
}
}

Why would u use 2 If Statements?

erixor 07/18/2018 22:52

Even if it had worked for some reason, the stats would not have been saved. The defense & the added stats would be back to normal after a relog.


All times are GMT +2. The time now is 16:38.

Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.