Results 1 to 8 of 8
  1. #1
    gunit99's Avatar
    Join Date
    May 2011
    Gender
    female
    Posts
    178
    Reputation
    10
    Thanks
    203
    My Mood
    Sleepy

    Question Fabiano - How to edit ranks/Add prefixes ex) [Founder]

    Looked at all the tuts on mpgh but most of them were directed towards other sources and was completely different. Was wondering if anyone knows how to edit ranks and add prefixes to the different ranks. Forexample founder would have a [Founder] prefix, donator would have [Donator] Prefix etc.
    Add Signature Here

  2. #2
    Ahl's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    /modcp
    Posts
    16,599
    Reputation
    3219
    Thanks
    5,383
    My Mood
    Angelic
    If you want a specific rank number to have it, you can look at the Club559 source in wServer/realm/entities/player/player.cs

    Search for "Founder"

    Hopefully that will help you find your answer
    News Force Head Editor from 09/14/2018 - 03/02/2020
    Publicist from 11/23/2017 - 06/07/2019
    Global Moderator since 09/24/2017
    Minion+ from 04/16/2017 - 09/24/2017
    Market Place Minion from 04/16/2017 - 09/24/2017
    Minecraft Minion from 02/23/2017 - 09/24/2017
    Realm of the Mad God Minion from 11/06/2016 - 09/24/2017

    Middleman from 09/14/2016 - 09/24/2017
    News Force Editor from 08/23/2016 - 09/14/2018
    News Force (Section of the Week) from 03/21/2016 - 07/17/2017
    News Force (User News) from 10/18/2015 - 09/14/2018

    Donator since 03/16/2015
    Realm of the Mad God Editor from 05/20/2014 - 07/08/2014
    Member since 12/23/2012


    Rep Power: 82

  3. The Following User Says Thank You to Ahl For This Useful Post:

    gunit99 (07-25-2015)

  4. #3
    gunit99's Avatar
    Join Date
    May 2011
    Gender
    female
    Posts
    178
    Reputation
    10
    Thanks
    203
    My Mood
    Sleepy
    Quote Originally Posted by Hunter's Best Sheep View Post
    If you want a specific rank number to have it, you can look at the Club559 source in wServer/realm/entities/player/player.cs

    Search for "Founder"

    Hopefully that will help you find your answer
    Heres the issue

    What the club source is like:
     
    StatsManager statsMgr;
    public Player(ClientProcessor psr)
    : base((short)psr.Character.ObjectType, psr.Random)
    {
    this.psr = psr;
    statsMgr = new StatsManager(this);
    switch(psr.Account.Rank) {
    case 0:
    Name = psr.Account.Name; break;
    case 1:
    Name = "[P] " + psr.Account.Name; break;
    case 2:
    Name = "[Helper] " + psr.Account.Name; break;
    case 3:
    Name = "[GM] " + psr.Account.Name; break;
    case 4:
    Name = "[Dev] " + psr.Account.Name; break;
    case 5:
    Name = "[HDev] " + psr.Account.Name; break;
    case 6:
    Name = "[CM] " + psr.Account.Name; break;
    case 7:
    Name = "[Founder] " + psr.Account.Name; break;
    }
    nName = psr.Account.Name;
    AccountId = psr.Account.AccountId;
    Level = psr.Character.Level;
    Experience = psr.Character.Exp;
    ExperienceGoal = GetExpGoal(psr.Character.Level);
    if (psr.Account.Rank > 2)
    Stars = 75;
    else if (psr.Account.Rank > 1)
    Stars = 60;
    else


    What the fabianos source looks like:
     
    public Player(RealmManager manager, Client psr)
    : base(manager, (ushort)psr.Character.ObjectType, psr.Random)
    {
    try
    {
    Client = psr;
    Manager = psr.Manager;
    StatsManager = new StatsManager(this, psr.Random.CurrentSeed);
    Name = psr.Account.Name;
    AccountId = psr.Account.AccountId;
    FameCounter = new FameCounter(this);
    Tokens = psr.Account.FortuneTokens;
    HpPotionPrice = 1;
    MpPotionPrice = 1;

    Level = psr.Character.Level == 0 ? 1 : psr.Character.Level;
    Experience = psr.Character.Exp;
    ExperienceGoal = GetExpGoal(Level);
    Stars = GetStars();
    Texture1 = psr.Character.Tex1;
    Texture2 = psr.Character.Tex2;
    Credits = psr.Account.Credits;
    NameChosen = psr.Account.NameChosen;
    CurrentFame = psr.Account.Stats.Fame;
    Fame = psr.Character.CurrentFame;
    XpBoosted = psr.Character.XpBoosted;
    XpBoostTimeLeft = psr.Character.XpTimer;
    xpFreeTimer = XpBoostTimeLeft != -1.0;
    LootDropBoostTimeLeft = psr.Character.LDTimer;
    lootDropBoostFreeTimer = LootDropBoost;
    LootTierBoostTimeLeft = psr.Character.LTTimer;
    lootTierBoostFreeTimer = LootTierBoost;
    var state =


    I tried to overwrite/add the clubs part of the source into fabs source however I get a lot of errors and unknown commands.
    Could you help moi? Thanks
    Add Signature Here

  5. #4
    Ahl's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    /modcp
    Posts
    16,599
    Reputation
    3219
    Thanks
    5,383
    My Mood
    Angelic
    Quote Originally Posted by gunit99 View Post
     
    public Player(RealmManager manager, Client psr)
    : base(manager, (ushort)psr.Character.ObjectType, psr.Random)
    {
    try
    {
    Client = psr;
    Manager = psr.Manager;
    StatsManager = new StatsManager(this, psr.Random.CurrentSeed);
    Name = psr.Account.Name;
    AccountId = psr.Account.AccountId;
    FameCounter = new FameCounter(this);
    Tokens = psr.Account.FortuneTokens;
    HpPotionPrice = 1;
    MpPotionPrice = 1;

    Level = psr.Character.Level == 0 ? 1 : psr.Character.Level;
    Experience = psr.Character.Exp;
    ExperienceGoal = GetExpGoal(Level);
    Stars = GetStars();
    Texture1 = psr.Character.Tex1;
    Texture2 = psr.Character.Tex2;
    Credits = psr.Account.Credits;
    NameChosen = psr.Account.NameChosen;
    CurrentFame = psr.Account.Stats.Fame;
    Fame = psr.Character.CurrentFame;
    XpBoosted = psr.Character.XpBoosted;
    XpBoostTimeLeft = psr.Character.XpTimer;
    xpFreeTimer = XpBoostTimeLeft != -1.0;
    LootDropBoostTimeLeft = psr.Character.LDTimer;
    lootDropBoostFreeTimer = LootDropBoost;
    LootTierBoostTimeLeft = psr.Character.LTTimer;
    lootTierBoostFreeTimer = LootTierBoost;
    var state =
     
    public Player(RealmManager manager, Client psr)
    : base(manager, (ushort)psr.Character.ObjectType, psr.Random)
    {
    try
    {
    Client = psr;
    Manager = psr.Manager;
    StatsManager = new StatsManager(this, psr.Random.CurrentSeed);
    Name = psr.Account.Name;
    switch(psr.Account.Rank) {
    case 0:
    Name = psr.Account.Name; break;
    case 1:
    Name = "[P] " + psr.Account.Name; break;
    case 2:
    Name = "[Helper] " + psr.Account.Name; break;
    case 3:
    Name = "[GM] " + psr.Account.Name; break;
    case 4:
    Name = "[Dev] " + psr.Account.Name; break;
    case 5:
    Name = "[HDev] " + psr.Account.Name; break;
    case 6:
    Name = "[CM] " + psr.Account.Name; break;
    case 7:
    Name = "[Founder] " + psr.Account.Name; break;
    }
    AccountId = psr.Account.AccountId;
    FameCounter = new FameCounter(this);
    Tokens = psr.Account.FortuneTokens;
    HpPotionPrice = 1;
    MpPotionPrice = 1;

    Level = psr.Character.Level == 0 ? 1 : psr.Character.Level;
    Experience = psr.Character.Exp;
    ExperienceGoal = GetExpGoal(Level);
    Stars = GetStars();
    Texture1 = psr.Character.Tex1;
    Texture2 = psr.Character.Tex2;
    Credits = psr.Account.Credits;
    NameChosen = psr.Account.NameChosen;
    CurrentFame = psr.Account.Stats.Fame;
    Fame = psr.Character.CurrentFame;
    XpBoosted = psr.Character.XpBoosted;
    XpBoostTimeLeft = psr.Character.XpTimer;
    xpFreeTimer = XpBoostTimeLeft != -1.0;
    LootDropBoostTimeLeft = psr.Character.LDTimer;
    lootDropBoostFreeTimer = LootDropBoost;
    LootTierBoostTimeLeft = psr.Character.LTTimer;
    lootTierBoostFreeTimer = LootTierBoost;
    var state =


    That is what I'm guessing you should do. Obviously, it may be wrong and if you haven't set the ranks yet, then the rank admin (3) would be GM
    News Force Head Editor from 09/14/2018 - 03/02/2020
    Publicist from 11/23/2017 - 06/07/2019
    Global Moderator since 09/24/2017
    Minion+ from 04/16/2017 - 09/24/2017
    Market Place Minion from 04/16/2017 - 09/24/2017
    Minecraft Minion from 02/23/2017 - 09/24/2017
    Realm of the Mad God Minion from 11/06/2016 - 09/24/2017

    Middleman from 09/14/2016 - 09/24/2017
    News Force Editor from 08/23/2016 - 09/14/2018
    News Force (Section of the Week) from 03/21/2016 - 07/17/2017
    News Force (User News) from 10/18/2015 - 09/14/2018

    Donator since 03/16/2015
    Realm of the Mad God Editor from 05/20/2014 - 07/08/2014
    Member since 12/23/2012


    Rep Power: 82

  6. The Following User Says Thank You to Ahl For This Useful Post:

    gunit99 (07-25-2015)

  7. #5
    gunit99's Avatar
    Join Date
    May 2011
    Gender
    female
    Posts
    178
    Reputation
    10
    Thanks
    203
    My Mood
    Sleepy
    Quote Originally Posted by Hunter's Best Sheep View Post
     
    public Player(RealmManager manager, Client psr)
    : base(manager, (ushort)psr.Character.ObjectType, psr.Random)
    {
    try
    {
    Client = psr;
    Manager = psr.Manager;
    StatsManager = new StatsManager(this, psr.Random.CurrentSeed);
    Name = psr.Account.Name;
    switch(psr.Account.Rank) {
    case 0:
    Name = psr.Account.Name; break;
    case 1:
    Name = "[P] " + psr.Account.Name; break;
    case 2:
    Name = "[Helper] " + psr.Account.Name; break;
    case 3:
    Name = "[GM] " + psr.Account.Name; break;
    case 4:
    Name = "[Dev] " + psr.Account.Name; break;
    case 5:
    Name = "[HDev] " + psr.Account.Name; break;
    case 6:
    Name = "[CM] " + psr.Account.Name; break;
    case 7:
    Name = "[Founder] " + psr.Account.Name; break;
    }
    AccountId = psr.Account.AccountId;
    FameCounter = new FameCounter(this);
    Tokens = psr.Account.FortuneTokens;
    HpPotionPrice = 1;
    MpPotionPrice = 1;

    Level = psr.Character.Level == 0 ? 1 : psr.Character.Level;
    Experience = psr.Character.Exp;
    ExperienceGoal = GetExpGoal(Level);
    Stars = GetStars();
    Texture1 = psr.Character.Tex1;
    Texture2 = psr.Character.Tex2;
    Credits = psr.Account.Credits;
    NameChosen = psr.Account.NameChosen;
    CurrentFame = psr.Account.Stats.Fame;
    Fame = psr.Character.CurrentFame;
    XpBoosted = psr.Character.XpBoosted;
    XpBoostTimeLeft = psr.Character.XpTimer;
    xpFreeTimer = XpBoostTimeLeft != -1.0;
    LootDropBoostTimeLeft = psr.Character.LDTimer;
    lootDropBoostFreeTimer = LootDropBoost;
    LootTierBoostTimeLeft = psr.Character.LTTimer;
    lootTierBoostFreeTimer = LootTierBoost;
    var state =


    That is what I'm guessing you should do. Obviously, it may be wrong and if you haven't set the ranks yet, then the rank admin (3) would be GM
    Yeah this worked ^.^. Thank you so much! But now I have another problem. I gave myself founder rank (rank 6), but I am unable to do any commands. I can only execute commands if I am [GM] Rank which is rank 3.

    Here is what the give command looks like:
     
    internal class GiveCommand : Command
    {
    public GiveCommand()
    : base("give", 1)
    {
    }

    protected override bool Process(Player player, RealmTime time, string[] args)
    {
    if (args.Length == 0)
    {
    player.SendHelp("Usage: /give <Itemname>");
    return false;
    }
    string name = string.Join(" ", args.ToArray()).Trim();
    ushort objType;
    //creates a new case insensitive dictionary based on the XmlDatas
    Dictionary<string, ushort> icdatas = new Dictionary<string, ushort>(player.Manager.GameData.IdToObjectType,
    StringComparer.OrdinalIgnoreCase);
    if (!icdatas.TryGetValue(name, out objType))
    {
    player.SendError("Unknown type!");
    return false;
    }
    if (!player.Manager.GameData.Items[objType].Secret || player.Client.Account.Rank >= 3)
    {
    for (int i = 0; i < player.Inventory.Length; i++)
    if (player.Inventory[i] == null)
    {
    player.Inventory[i] = player.Manager.GameData.Items[objType];
    player.UpdateCount++;
    player.SaveToCharacter();
    player.SendInfo("Success!");
    break;
    }
    }
    else
    {
    player.SendError("Item cannot be given!");
    return false;
    }
    return true;
    }
    }


    I am positive the code that controls what rank can do what command is:
    }
    if (!player.Manager.GameData.Items[objType].Secret || player.Client.Account.Rank >= 3)
    {


    I do not understand why I cannot give items to myself if I am rank 6. I put >= 3.

    Also how do I change rank permissions in other commands? I looked for some key words but was unable to find any like the /give command.
    Forexample the TP command:
     
    internal class TpCommand : Command
    {
    public TpCommand()
    : base("tp", 1)
    {
    }

    protected override bool Process(Player player, RealmTime time, string[] args)
    {
    if (args.Length == 0 || args.Length == 1)
    {
    player.SendHelp("Usage: /tp <X coordinate> <Y coordinate>");
    }
    else
    {
    int x, y;
    try
    {
    x = int.Parse(args[0]);
    y = int.Parse(args[1]);
    }
    catch
    {
    player.SendError("Invalid coordinates!");
    return false;
    }
    player.Move(x + 0.5f, y + 0.5f);
    if (player.Pet != null)
    player.Pet.Move(x + 0.5f, y + 0.5f);
    player.UpdateCount++;
    player.Owner.BroadcastPacket(new GotoPacket
    {
    ObjectId = player.Id,
    Position = new Position
    {
    X = player.X,
    Y = player.Y
    }
    }, null);
    }
    return true;
    }
    }


    Not really sure how to change rank commands with this given code. Any help :$
    Last edited by gunit99; 07-25-2015 at 02:44 PM.
    Add Signature Here

  8. #6
    Ahl's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    /modcp
    Posts
    16,599
    Reputation
    3219
    Thanks
    5,383
    My Mood
    Angelic
    Quote Originally Posted by gunit99 View Post
    Yeah this worked ^.^. Thank you so much! But now I have another problem. I gave myself founder rank (rank 6), but I am unable to do any commands. I can only execute commands if I am [GM] Rank which is rank 3.

    Here is what the give command looks like:
     
    internal class GiveCommand : Command
    {
    public GiveCommand()
    : base("give", 1)
    {
    }

    protected override bool Process(Player player, RealmTime time, string[] args)
    {
    if (args.Length == 0)
    {
    player.SendHelp("Usage: /give <Itemname>");
    return false;
    }
    string name = string.Join(" ", args.ToArray()).Trim();
    ushort objType;
    //creates a new case insensitive dictionary based on the XmlDatas
    Dictionary<string, ushort> icdatas = new Dictionary<string, ushort>(player.Manager.GameData.IdToObjectType,
    StringComparer.OrdinalIgnoreCase);
    if (!icdatas.TryGetValue(name, out objType))
    {
    player.SendError("Unknown type!");
    return false;
    }
    if (!player.Manager.GameData.Items[objType].Secret || player.Client.Account.Rank >= 3)
    {
    for (int i = 0; i < player.Inventory.Length; i++)
    if (player.Inventory[i] == null)
    {
    player.Inventory[i] = player.Manager.GameData.Items[objType];
    player.UpdateCount++;
    player.SaveToCharacter();
    player.SendInfo("Success!");
    break;
    }
    }
    else
    {
    player.SendError("Item cannot be given!");
    return false;
    }
    return true;
    }
    }


    I am positive the code that controls what rank can do what command is:
    }
    if (!player.Manager.GameData.Items[objType].Secret || player.Client.Account.Rank >= 3)
    {


    I do not understand why I cannot give items to myself if I am rank 6. I put >= 3.

    Also how do I change rank permissions in other commands? I looked for some key words but was unable to find any like the /give command.
    Forexample the TP command:
     
    internal class TpCommand : Command
    {
    public TpCommand()
    : base("tp", 1)
    {
    }

    protected override bool Process(Player player, RealmTime time, string[] args)
    {
    if (args.Length == 0 || args.Length == 1)
    {
    player.SendHelp("Usage: /tp <X coordinate> <Y coordinate>");
    }
    else
    {
    int x, y;
    try
    {
    x = int.Parse(args[0]);
    y = int.Parse(args[1]);
    }
    catch
    {
    player.SendError("Invalid coordinates!");
    return false;
    }
    player.Move(x + 0.5f, y + 0.5f);
    if (player.Pet != null)
    player.Pet.Move(x + 0.5f, y + 0.5f);
    player.UpdateCount++;
    player.Owner.BroadcastPacket(new GotoPacket
    {
    ObjectId = player.Id,
    Position = new Position
    {
    X = player.X,
    Y = player.Y
    }
    }, null);
    }
    return true;
    }
    }


    Not really sure how to change rank commands with this given code. Any help :$
    In wServer/realm/entities/commands/Command.cs

    Find this:

    Code:
    private static int GetPermissionLevel(Player player)
            {
                if (player.Client.Account.Rank == 3)
                    return 1;
                return 0;
            }
    Just change
    if (player.Client.Account.Rank == 3)

    to

    if (player.Client.Account.Rank == 1)

    Now following this format, add more under return 1;

    And just make it increase chronologically (make sure both the return and the player.Client.Account.Rank == numbers are increasing. Do not change return 0)

    Then just set the numbers in AdminCommand.cs and you're done
    News Force Head Editor from 09/14/2018 - 03/02/2020
    Publicist from 11/23/2017 - 06/07/2019
    Global Moderator since 09/24/2017
    Minion+ from 04/16/2017 - 09/24/2017
    Market Place Minion from 04/16/2017 - 09/24/2017
    Minecraft Minion from 02/23/2017 - 09/24/2017
    Realm of the Mad God Minion from 11/06/2016 - 09/24/2017

    Middleman from 09/14/2016 - 09/24/2017
    News Force Editor from 08/23/2016 - 09/14/2018
    News Force (Section of the Week) from 03/21/2016 - 07/17/2017
    News Force (User News) from 10/18/2015 - 09/14/2018

    Donator since 03/16/2015
    Realm of the Mad God Editor from 05/20/2014 - 07/08/2014
    Member since 12/23/2012


    Rep Power: 82

  9. The Following User Says Thank You to Ahl For This Useful Post:

    gunit99 (07-27-2015)

  10. #7
    gunit99's Avatar
    Join Date
    May 2011
    Gender
    female
    Posts
    178
    Reputation
    10
    Thanks
    203
    My Mood
    Sleepy
    Quote Originally Posted by Hunter's Best Sheep View Post
    In wServer/realm/entities/commands/Command.cs

    Find this:

    Code:
    private static int GetPermissionLevel(Player player)
            {
                if (player.Client.Account.Rank == 3)
                    return 1;
                return 0;
            }
    Just change
    if (player.Client.Account.Rank == 3)

    to

    if (player.Client.Account.Rank == 1)

    Now following this format, add more under return 1;

    And just make it increase chronologically (make sure both the return and the player.Client.Account.Rank == numbers are increasing. Do not change return 0)

    Then just set the numbers in AdminCommand.cs and you're done
    Thanks again Everything worked out! @Raple
    Add Signature Here

  11. #8
    Juli117's Avatar
    Join Date
    Oct 2013
    Gender
    female
    Posts
    7
    Reputation
    10
    Thanks
    0
    I need help too i did it like this but its not working
    Attached Thumbnails Attached Thumbnails
    Rotmg Pserver 001.PNG  

    Last edited by Juli117; 07-27-2015 at 12:42 PM.

Similar Threads

  1. [Help Request] Fabiano - How to add more custom items?
    By gunit99 in forum Realm of the Mad God Private Servers Help
    Replies: 1
    Last Post: 08-01-2015, 10:10 PM
  2. [Help Request] How Would I Go About Editing Ranks Is Clubs Source?
    By Pandaman1321 in forum Realm of the Mad God Private Servers Help
    Replies: 2
    Last Post: 07-03-2015, 08:01 PM
  3. How to add new items / How to edit items sprites
    By Dadalin in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 18
    Last Post: 03-05-2014, 10:33 PM
  4. [Help Request] Forgot how to edit these files to add hax
    By Trollaux in forum Realm of the Mad God Help & Requests
    Replies: 3
    Last Post: 07-04-2013, 10:04 AM
  5. [Request] How to edit rank in crossfire new patch
    By dipotha in forum CrossFire Mods & Rez Modding
    Replies: 2
    Last Post: 05-22-2012, 02:17 AM