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;
}
}
}