|
You last visited: Today at 21:02
Advertisement
[Release/OpenNos] Prestige System
Discussion on [Release/OpenNos] Prestige System within the Nostale forum part of the MMORPGs category.
06/30/2018, 17:22
|
#1
|
elite*gold: 0
Join Date: Nov 2017
Posts: 81
Received Thanks: 33
|
[Release/OpenNos] Prestige System
Hey folks,
today i wanna release a very simple prestige System.
Informations:
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.
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.
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
|
|
|
06/30/2018, 17:50
|
#2
|
elite*gold: 0
Join Date: Jun 2018
Posts: 61
Received Thanks: 4
|
Thanks for Release @  Good Job
|
|
|
06/30/2018, 17:57
|
#3
|
elite*gold: 30
Join Date: Sep 2014
Posts: 593
Received Thanks: 316
|
Thx m8 I appreciate that, but are you sure about the first two requirements? Thats basically copy and paste.
|
|
|
06/30/2018, 18:01
|
#4
|
elite*gold: 0
Join Date: Nov 2017
Posts: 81
Received Thanks: 33
|
Quote:
Originally Posted by mix0067@
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
Thanks for Release @  Good Job
|
Thanks!!
|
|
|
07/01/2018, 17:58
|
#5
|
elite*gold: 0
Join Date: Jul 2013
Posts: 408
Received Thanks: 1,067
|
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
|
|
|
07/01/2018, 23:53
|
#6
|
elite*gold: 0
Join Date: Nov 2017
Posts: 81
Received Thanks: 33
|
Quote:
Originally Posted by erixor
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
|
|
|
07/02/2018, 06:03
|
#7
|
elite*gold: 50
Join Date: Feb 2018
Posts: 149
Received Thanks: 130
|
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));
}
}
}
|
|
|
07/02/2018, 10:16
|
#8
|
elite*gold: 148
Join Date: Jan 2010
Posts: 654
Received Thanks: 1,765
|
Quote:
Originally Posted by Zanouu
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)
|
|
|
07/10/2018, 18:22
|
#9
|
elite*gold: 0
Join Date: Jun 2018
Posts: 27
Received Thanks: 2
|
Use RagePoint for identify prestige!!!
|
|
|
07/11/2018, 23:04
|
#10
|
elite*gold: 0
Join Date: Nov 2017
Posts: 81
Received Thanks: 33
|
Quote:
Originally Posted by [NH]Pyro
Use RagePoint for identify prestige!!!
|
Sounds cool, i personally used Compliments but RagePoint is also cool to use.
|
|
|
07/18/2018, 21:13
|
#11
|
elite*gold: 0
Join Date: Jul 2017
Posts: 397
Received Thanks: 60
|
Quote:
Originally Posted by ImTheReal
Hey folks,
today i wanna release a very simple prestige System.
Informations:
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.
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.
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;
}
}
}
|
|
|
07/18/2018, 22:12
|
#12
|
elite*gold: 50
Join Date: Feb 2018
Posts: 149
Received Thanks: 130
|
Quote:
Originally Posted by redbull2905
Session.Character.DefenceRate = + +500;
Session.Character.DistanceDefence = + +500;
Session.Character.MagicalDefence = + +500;
|
= + + ? wtf is this  
|
|
|
07/18/2018, 22:21
|
#13
|
elite*gold: 0
Join Date: May 2009
Posts: 1,005
Received Thanks: 1,018
|
Quote:
Originally Posted by Zanouu
|
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.
|
|
|
07/18/2018, 22:50
|
#14
|
elite*gold: 0
Join Date: Nov 2017
Posts: 81
Received Thanks: 33
|
Quote:
Originally Posted by redbull2905
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?
|
|
|
07/18/2018, 22:52
|
#15
|
elite*gold: 0
Join Date: Jul 2013
Posts: 408
Received Thanks: 1,067
|
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.
|
|
|
 |
|
Similar Threads
|
OpenNos "The project 'OpenNos.Login' failed to build."
06/19/2019 - Nostale - 11 Replies
Hello! When I put in update-database in Visual Studio I get the 'The project 'OpenNos.Login' failed to build.' error. I already did what was on the troubleshoot before I put it in. I've been at this for hours and I can't figure it out. Can someone help me please?
|
[OpenNos] Prestige level not saving
02/13/2019 - Nostale - 0 Replies
Hey Community.
after a lot of try and do i dont get the prestigeLevel safe....
i looked a lot of Threads but it still dont safe .. could someone help me ?
btw. i use the Cracked Ciapa Source.
its done i just Set AutomaticMigrationsEnabled = true;
|
[OpenNos] ¿How to select the project OpenNos.DAL.EF?
05/04/2018 - Nostale - 4 Replies
Hello, I have a problem with my visual studio 2017, it turns out that to be able to give the update-database command I must have the project OpenNos.DAL.EF But the thing is that in my visual studio there is no option to select the project ... I need help!:D:D
|
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
|
[opennos]The project 'OpenNos.Login' failed to build.
08/03/2017 - Nostale - 9 Replies
Hello I have a problem with the package manager console to run the update- database command to opennos soon as I executes the command, he said: The project ' opennos.login ' failed to build
What to do? I made the updates to Microsoft Visual Studio thank you ..
|
All times are GMT +1. The time now is 21:03.
|
|