[AS3/FSOD] making /give command to give soulbound items
So, I have tried to follow the SD tutorial on how to make this /give command soulbound. Changed it into fabiano scource, but it just won't work, I have tried to write "player.Inventory[i].Soulbound = true;" because only then it would show Soulbound as an option. But it just won't work.
So my question is basically, how do you make it to give soulbound items?
Code for the give command
So my question is basically, how do you make it to give soulbound items?
Code for the give command
The command
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 >= 1)
{
for (int i = 4; 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("Did you type in the correct name?");
return false;
}
return true;
{
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 >= 1)
{
for (int i = 4; 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("Did you type in the correct name?");
return false;
}
return true;