(Command) Make GM
1) First open Permissions.cs
2) Add this code:
under
3) Open Commands.cs
4) Add this code:
under
5) And last add this code :
under the
code ending
6) To use this command your account Permission must be set to 6
8) To use this command type /makegm PlayerName
2) Add this code:
Code:
GO = 6,
Code:
GM = 5,
4) Add this code:
Code:
{"makegm", Process_MakeGm},
Code:
{"goto", Process_GoTo},
Code:
private static void Process_MakeGm(Player client, string[] command)
{
if (client.Account.Permission < PlayerPermission.GO)
return;
if (client.Account.Permission < PlayerPermission.GO)
return;
if (command.Length < 2)
client.SendMessage("Error: Proper format is /makegm PlayerName");
else
{
Player target = null;
foreach (var p in Managers.PlayerManager.Players.Values)
if (p.Name.ToLower() == command[1].ToLower() || p.Name.ToLower() + "[gm]" == command[1].ToLower())
{
target = p;
break;
}
if (target == null)
client.SendMessage(command[1] + " is not online or could not be found");
else
{
Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, client.Name + ": User " + target.Name + " has been promoted to GM"));
target.SendMessage("Congratulations! " + target.Name + " You have been made a GM by " + client.Name + "!", ChatType.System);
target.SendMessage("You are now being sent to his location", ChatType.System);
target.ChangeMap(client.MapID, client.X, client.Y);
client.SendMessage(target.Name + "is being sent to you location", ChatType.System);
target.Account.Permission = PlayerPermission.GM ;
using (var session = NHibernateHelper.OpenSession())
{
var t = session.CreateSQLQuery("UPDATE Accounts SET Permission=5 WHERE UID=" + target.UID);
t.ExecuteUpdate();
}
using (var session = NHibernateHelper.OpenSession())
{
var b = session.CreateSQLQuery("UPDATE Characters SET Name='" + target.Name +"[GM]' WHERE Name='" + target.Name+ "'");
b.ExecuteUpdate();
}
target.Name += "[GM] ";
target.Save();
}
}
}
Code:
Process_Report
6) To use this command your account Permission must be set to 6
8) To use this command type /makegm PlayerName
(Command) Ban Player
1) Open Commands.cs
2) Add this code:
under
3) Add this code :
under the
code ending
4) To use command type /ban PlayerName
2) Add this code:
Code:
{"ban", Process_Ban},
Code:
{"goto", Process_GoTo},
Code:
private static void Process_Ban(Player client, string[] command)
{
if (client.Account.Permission < PlayerPermission.GM)
return;
if (client.Account.Permission < PlayerPermission.GM)
return;
if (command.Length < 2)
client.SendMessage("Error: Proper format is /ban PlayerName");
else
{
Player target = null;
foreach (var p in Managers.PlayerManager.Players.Values)
if (p.Name.ToLower() == command[1].ToLower() || p.Name.ToLower() + "[gm]" == command[1].ToLower())
{
target = p;
break;
}
if (target == null)
client.SendMessage(command[1] + " is not online or could not be found");
else
{
target.Disconnect();
client.SendMessage(target.Name + "has been banned");
target.Account.Permission = PlayerPermission.Banned;
Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, client.Name + ": User " + target.Name + " has been banned"));
using (var session = NHibernateHelper.OpenSession())
{
var t = session.CreateSQLQuery("UPDATE Accounts SET Permission=255 WHERE UID=" + target.UID);
t.ExecuteUpdate();
}
target.Save();
target.Disconnect();
}
}
}
Code:
Process_Report
4) To use command type /ban PlayerName
(Command) Unban Player
1) Open Commands.cs
2) Add the code :
under
3) Add this code:
under the
code ending
5) To use this command you will need the players UID
6) To use the command type /unban PlayerUID
2) Add the code :
Code:
{"unban", Process_UnBan},
Code:
{"goto", Process_GoTo},
Code:
private static void Process_UnBan(Player client, string[] command)
{
if (client.Account.Permission < PlayerPermission.GM)
return;
if (client.Account.Permission < PlayerPermission.GM)
return;
if (command.Length < 2)
client.SendMessage("Error: Proper format is /unban PlayerUID");
else
{
client.SendMessage(command + " has been unbanned");
Managers.PlayerManager.SendToServer(new TalkPacket(ChatType.GM, client.Name + ": User " + command[1] + " has been unbanned"));
using (var session = NHibernateHelper.OpenSession())
{
var t = session.CreateSQLQuery("UPDATE Accounts SET Permission=1 WHERE UID=" + command[1]);
t.ExecuteUpdate();
}
}
}
Code:
Process_Report
5) To use this command you will need the players UID
6) To use the command type /unban PlayerUID
(Command) Reborn
1) Open Commands.cs
2) Add this code:
under
3) Add this code :
under the
code ending
4) To use the command type /Reborn 1 for 1st Rb and /Reborn 1 for 2nd Rb
2) Add this code:
Code:
{"reborn", Process_Reborn},
Code:
{"goto", Process_GoTo},
Code:
private static void Process_Reborn(Player client, string[] command)
{
if (client.Account.Permission < PlayerPermission.GM)
return;
if (command[1] == "1")
{
client.SendMessage(" 1st rb", ChatType.System);
using (var session = NHibernateHelper.OpenSession())
{
var t = session.CreateSQLQuery("UPDATE Characters SET Profession1=15 WHERE UID=" + client.UID);
t.ExecuteUpdate();
}
client.Character.Profession1 = 15;
client.SendMessage(" 1st rb", ChatType.System);
client.Save();
client.Disconnect();
}
else if (command[1] == "2")
{
client.SendMessage(" 1st rb", ChatType.System);
using (var session = NHibernateHelper.OpenSession())
{
var t = session.CreateSQLQuery("UPDATE Characters SET Profession1=15 WHERE UID=" + client.UID);
t.ExecuteUpdate();
client.Character.Profession1 = 15;
}
using (var session = NHibernateHelper.OpenSession())
{
var b = session.CreateSQLQuery("UPDATE Characters SET Profession2=15 WHERE UID=" + client.UID);
b.ExecuteUpdate();
client.Character.Profession2 = 15;
}
client.SendMessage(" 2nt rb", ChatType.System);
client.Save();
client.Disconnect();
}
else
{
client.SendSysMessage("only 2 reborns are allowed");
}
}
Code:
Process_Report
4) To use the command type /Reborn 1 for 1st Rb and /Reborn 1 for 2nd Rb
(Monster) CP's Drop
1) Open Monster.cs
2) Search for the line
3) Under it paste this code
4) Change the value 100 to any value you want
2) Search for the line
Code:
var killer = PlayerManager.GetUser(_attacker);
Code:
killer.CP += 100;
killer.SendSysMessage("You have gotten 100 cps from monster kill");
killer.Save();
(Monster) Random CP's Drop
1) Open Monster.cs
2) Search for the line
3) Under it paste this code:
4) To change the random values change the two numbers in the brackets rnd.Next(1, 100) e.g you want a drop from 200 to 250 so the numbers in the brackets are going to be like this rnd.Next(200, 250)
2) Search for the line
Code:
var killer = PlayerManager.GetUser(_attacker);
Code:
Random rnd = new Random();
int Valcp = rnd.Next(1, 100);
uint ConvVal = Convert.ToUInt32(Valcp);
killer.CP += ConvVal;
killer.SendSysMessage("You have gotten " + ConvVal + " cps from monster kill");
killer.Save()
(Monster) Drop Items to inventory
1) Open Monster.cs
2) At the very top under
paste this code :
2) Search for the line
3) Under it paste this code:
4) Next replace these codes (all of them in Monster.cs)
with this :
this is to avoid conflicts
5) To change which monster you want to drop the item change the id in the brackets (BaseMonster.ID == 0018)
6) To change the item that you want that monster to drop change the id from the brackets GetById(1072048)
7) You can use the itemtype.dat to find the item id and the Monster.dat to find the mob id (TypeID= MonsterID)
8) You can download both decrypted here :
& 
2) At the very top under
Code:
using System;
Code:
using Redux.Structures;
Code:
var killer = PlayerManager.GetUser(_attacker);
Code:
if (BaseMonster.ID == 0018)
{
var info = Database.ServerDatabase.Context.ItemInformation.GetById(1072048);
var item = new ConquerItem((uint)Common.ItemGenerator.Counter, info);
killer.AddItem(item);
killer.Send(ItemInformationPacket.Create(item));
killer.SendSysMessage("Item Dropped");
}
Code:
ClientStatus.ReviveProtection
Code:
Redux.Enum.ClientStatus.ReviveProtection
5) To change which monster you want to drop the item change the id in the brackets (BaseMonster.ID == 0018)
6) To change the item that you want that monster to drop change the id from the brackets GetById(1072048)
7) You can use the itemtype.dat to find the item id and the Monster.dat to find the mob id (TypeID= MonsterID)
8) You can download both decrypted here :
& 
More will come soon if you have a cool codes post it here ill include it in the post lets make a redux code thread






