Solved[FSOD] Command that gives a class set when used

Posts 1–10 of 10 · Page 1 of 1
[FSOD] Command that gives a class set when used
I'm wondering how to add a command where you type /(insertclassnamehere) and it gives you a specific set of items for that class.
So lets say I did /wizard and then it would give me a horror staff a t4 spell an illusionist robe and para hp
The reason I want to know how to add this because I saw it on another server and I want ppl on my serv to have some gear to start off with.
Quote Originally Posted by rtHSE%he5hyeh View Post
I'm wondering how to add a command where you type /(insertclassnamehere) and it gives you a specific set of items for that class.
So lets say I did /wizard and then it would give me a horror staff a t4 spell an illusionist robe and para hp
The reason I want to know how to add this because I saw it on another server and I want ppl on my serv to have some gear to start off with.
i believe theirs already a tutorial on this

maybe it was for SD, but it shouldn't be difficult to translate it to FSOD
how exactly would i translate the code? i'm not familiar with seraphs domain :P
Quote Originally Posted by rtHSE%he5hyeh View Post
how exactly would i translate the code? i'm not familiar with seraphs domain :P
You don't have to be similar really, just look at examples from other codes for starters

 
:/

internal class SetCommand : Command
{
public SetCommand() :
base("set", permLevel: 1)
{
}

protected override bool Process(Player player, RealmTime time, string[] args)
{
string item = args[0];

#region Class'
switch (args[0].ToLower())
{
case "rogue":
player.Inventory[4] = player.Manager.GameData.Items[0xc0a]; // Cronus
player.Inventory[5] = player.Manager.GameData.Items[0xb27]; // Ghostly
player.Inventory[6] = player.Manager.GameData.Items[0xaf9]; // Hydra
player.Inventory[7] = player.Manager.GameData.Items[0xacd]; // Exa HP
player.UpdateCount++;
player.SendInfo("Successfully obtained Rogue class' gear");
return true;
default:
player.SendError("No class found...");
player.SendInfo("Classes: Rogue, Archer, Wizard, Priest, Warrior, Knight, Paladin, Assassin, Necromancer, Huntress, Mystic, Trickster, Sorcerer, Ninja");
player.SendInfo("Success");
break;
}
#endregion
return false;
}
}


here
Which file do I add that to? I tried pasting it in different files but it just gives me errors in visual studio
Quote Originally Posted by rtHSE%he5hyeh View Post
Which file do I add that to? I tried pasting it in different files but it just gives me errors in visual studio
Code:
internal class GearCommand : Command
    {
        public GearCommand()
            : base("set", Ranks.Mod)
        {
        }
        protected override bool Process(Player player, RealmTime time, string[] args)
        {
            string item = args[0].ToLower();

            switch (item)
            {
                case "rogue":
                    player.Inventory[0] = player.Manager.GameData.Items[0xc0a]; // Cronus
                    player.Inventory[1] = player.Manager.GameData.Items[0xb27]; // Ghostly
                    player.Inventory[2] = player.Manager.GameData.Items[0xaf9]; // Hydra
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.Inventory[4] = player.Manager.GameData.Items[0xaff]; // Foul
                    player.Inventory[5] = player.Manager.GameData.Items[0xa5a]; // Planewalker
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained Rogue class' gear");
                    break;
                case "archer":
                    player.Inventory[0] = player.Manager.GameData.Items[0xc10]; // Cbow
                    player.Inventory[1] = player.Manager.GameData.Items[0xb28]; // Elvish
                    player.Inventory[2] = player.Manager.GameData.Items[0xaf9]; // Hydra
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.Inventory[4] = player.Manager.GameData.Items[0xc02]; // Dbow
                    player.Inventory[5] = player.Manager.GameData.Items[0xc07]; // Qot
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained Archer class' gear");
                    break;
                case "wizard":
                    player.Inventory[0] = player.Manager.GameData.Items[0xb08]; // Cwhole
                    player.Inventory[1] = player.Manager.GameData.Items[0xb24]; // Ele-deta
                    player.Inventory[2] = player.Manager.GameData.Items[0xb05]; // GSorc
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained Wizard class' gear");
                    break;
                case "priest":
                    player.Inventory[0] = player.Manager.GameData.Items[0xaf6]; // Recomp
                    player.Inventory[1] = player.Manager.GameData.Items[0xb25]; // HolyG
                    player.Inventory[2] = player.Manager.GameData.Items[0xb05]; // Gsorc
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.Inventory[4] = player.Manager.GameData.Items[0xb3f]; // Cwand
                    player.Inventory[5] = player.Manager.GameData.Items[0xc1e]; // Prot
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained Priest class' gear");
                    break;
                case "warrior":
                    player.Inventory[0] = player.Manager.GameData.Items[0xb0b]; // Acclaim
                    player.Inventory[1] = player.Manager.GameData.Items[0xb29]; // Ggen
                    player.Inventory[2] = player.Manager.GameData.Items[0xafc]; // Accrop
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.Inventory[4] = player.Manager.GameData.Items[0xc01]; // Dblade
                    player.Inventory[5] = player.Manager.GameData.Items[0xc08]; // Jugg
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained Warrior class' gear");
                    break;
                case "knight":
                    player.Inventory[0] = player.Manager.GameData.Items[0xb0b]; // Acclaim
                    player.Inventory[1] = player.Manager.GameData.Items[0xb22]; // Colo
                    player.Inventory[2] = player.Manager.GameData.Items[0xafc]; // Accrop
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.Inventory[4] = player.Manager.GameData.Items[0xc01]; // Dblade
                    player.Inventory[5] = player.Manager.GameData.Items[0xc0f]; // Ogmur
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained Knight class' gear");
                    break;
                case "paladin":
                    player.Inventory[0] = player.Manager.GameData.Items[0xb0b]; // Acclaim
                    player.Inventory[1] = player.Manager.GameData.Items[0xb26]; // Gcookie
                    player.Inventory[2] = player.Manager.GameData.Items[0xafc]; // Accrop
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.Inventory[4] = player.Manager.GameData.Items[0xc01]; // Dblade
                    player.Inventory[5] = player.Manager.GameData.Items[0xc06]; // Oreo
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained Paladin class' gear");
                    break;
                case "assassin":
                    player.Inventory[0] = player.Manager.GameData.Items[0xc0a]; // Cronus
                    player.Inventory[1] = player.Manager.GameData.Items[0xb2a]; // Bane
                    player.Inventory[2] = player.Manager.GameData.Items[0xaf9]; // Hydra
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.Inventory[4] = player.Manager.GameData.Items[0xaff]; // Foul
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained Assassin class' gear");
                    break;
                case "necromancer":
                    player.Inventory[0] = player.Manager.GameData.Items[0xb08]; // Cwhole
                    player.Inventory[1] = player.Manager.GameData.Items[0xb2b]; // BSucker
                    player.Inventory[2] = player.Manager.GameData.Items[0xb05]; // GSorc
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.Inventory[5] = player.Manager.GameData.Items[0xc0e]; // Torment
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained Necromancer class' gear");
                    break;
                case "huntress":
                    player.Inventory[0] = player.Manager.GameData.Items[0xc10]; // Cbow
                    player.Inventory[1] = player.Manager.GameData.Items[0xb2c]; // GCatcher
                    player.Inventory[2] = player.Manager.GameData.Items[0xaf9]; // Hydra
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.Inventory[4] = player.Manager.GameData.Items[0xc02]; // Dbow
                    player.Inventory[5] = player.Manager.GameData.Items[0xc1c]; // Ctrap
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained Huntress class' gear");
                    break;
                case "mystic":
                    player.Inventory[0] = player.Manager.GameData.Items[0xb08]; // Cwhole
                    player.Inventory[1] = player.Manager.GameData.Items[0xb2d]; // Pfetter
                    player.Inventory[2] = player.Manager.GameData.Items[0xb05]; // GSorc
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.Inventory[5] = player.Manager.GameData.Items[0xc0b]; // Conflict
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained mystic gear");
                    break;
                case "trickster":
                    player.Inventory[0] = player.Manager.GameData.Items[0xc0a]; // Cronus
                    player.Inventory[1] = player.Manager.GameData.Items[0xb23]; // App Prism
                    player.Inventory[2] = player.Manager.GameData.Items[0xaf9]; // Hydra
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.Inventory[4] = player.Manager.GameData.Items[0xaff]; // Foul
                    player.Inventory[5] = player.Manager.GameData.Items[0xc0d]; // Dancing Swords
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained Trickster class' gear");
                    break;
                case "sorcerer":
                    player.Inventory[0] = player.Manager.GameData.Items[0xaf6]; // Recomp
                    player.Inventory[1] = player.Manager.GameData.Items[0xb33]; // Storms
                    player.Inventory[2] = player.Manager.GameData.Items[0xb05]; // Gsorc
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.Inventory[4] = player.Manager.GameData.Items[0xc33]; // Condu
                    player.Inventory[5] = player.Manager.GameData.Items[0xc30]; // Fulmi
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained Sorcerer class' gear");
                    break;
                case "ninja":
                    player.Inventory[0] = player.Manager.GameData.Items[0xc50]; // Masamune
                    player.Inventory[1] = player.Manager.GameData.Items[0xc59]; // Dcircle
                    player.Inventory[2] = player.Manager.GameData.Items[0xaf9]; // Hydra
                    player.Inventory[3] = player.Manager.GameData.Items[0xacd]; // Exa HP
                    player.Inventory[4] = player.Manager.GameData.Items[0xc52]; // Ray
                    player.Inventory[5] = player.Manager.GameData.Items[0xc5a]; // Midnight
                    player.UpdateCount++;
                    player.SendInfo("Successfully obtained Ninja class' gear");
                    break;
                default:
                    player.SendError("Usage: /set <ClassName>");
                    player.SendInfo("Classes: Rogue, Archer, Wizard, Priest, Warrior, Knight, Paladin, Assassin, Necromancer, Huntress, Mystic, Trickster, Sorcerer, Ninja");
                    break;
            }
            return true;
        }
    }
My friend fixed the code for me, now it works. There is one problem though. I changed the codes so that when I do "/set class" it puts the items in slots 1-4 of your inventory, but if there are already items in those 4 slots it will overwrite them with the /set items. Is there any way to fix that?
Quote Originally Posted by rtHSE%he5hyeh View Post
My friend fixed the code for me, now it works. There is one problem though. I changed the codes so that when I do "/set class" it puts the items in slots 1-4 of your inventory, but if there are already items in those 4 slots it will overwrite them with the /set items. Is there any way to fix that?
paste this above the switch statement:

Code:
            if (player.Inventory[0] != null || player.Inventory[1] != null || player.Inventory[2] != null || player.Inventory[3] != null)
            {
                player.SendHelp("Not enough space");
                return false;
            }
Posts 1–10 of 10 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?