The code is pretty simple and straight forward, just put it in a area where it checks for the status to be 0 or bigger, if its not there you can also add it. this code allows you, like zatoichi sayd, /str 9 and itl add 9 to your str while deducting your statp by 9, if your statp doesnt have 9 or more points it wont work, its tested, 100% functional, and saves to the DB.
Hope this helps, its just something i made quick, but it works, although its probably not the cleanest way, it works. The red is for the status check only, if you dont have that you'll want it too
Code:
[COLOR="Red"]if (Status >= 0)
{[/COLOR]
if (Splitter[0] == "/str")
{
ushort Str = ushort.Parse(Splitter[1]);
if (MyChar.StatP >= Str)
{
MyChar.Str += Str;
SendPacket(General.MyPackets.Vital(MyChar.UID, 16, MyChar.Str));
World.UpdateSpawn(MyChar);
MyChar.StatP -= Str;
SendPacket(General.MyPackets.Vital(MyChar.UID, 11, MyChar.StatP));
SendPacket(General.MyPackets.CharacterInfo(MyChar));
MyChar.SendEquips(false);
SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
World.SpawnMeToOthers(MyChar, true);
}
}
if (Splitter[0] == "/agi")
{
ushort Agi = ushort.Parse(Splitter[1]);
if (MyChar.StatP >= Agi)
{
MyChar.Agi += Agi;
SendPacket(General.MyPackets.Vital(MyChar.UID, 17, MyChar.Agi));
World.UpdateSpawn(MyChar);
MyChar.StatP -= Agi;
SendPacket(General.MyPackets.Vital(MyChar.UID, 11, MyChar.StatP));
SendPacket(General.MyPackets.CharacterInfo(MyChar));
MyChar.SendEquips(false);
SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
World.SpawnMeToOthers(MyChar, true);
}
}
if (Splitter[0] == "/spi")
{
ushort Spi = ushort.Parse(Splitter[1]);
if (MyChar.StatP >= Spi)
{
MyChar.Spi += Spi;
MyChar.StatP -= Spi;
SendPacket(General.MyPackets.Vital(MyChar.UID, 11, MyChar.StatP));
SendPacket(General.MyPackets.Vital(MyChar.UID, 14, MyChar.Spi));
World.UpdateSpawn(MyChar);
SendPacket(General.MyPackets.CharacterInfo(MyChar));
MyChar.SendEquips(false);
SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
World.SpawnMeToOthers(MyChar, true);
}
}
if (Splitter[0] == "/vit")
{
ushort Vit = ushort.Parse(Splitter[1]);
if (MyChar.StatP >= Vit)
{
MyChar.Vit += Vit;
MyChar.StatP -= Vit;
SendPacket(General.MyPackets.Vital(MyChar.UID, 11, MyChar.StatP));
SendPacket(General.MyPackets.Vital(MyChar.UID, 15, MyChar.Vit));
World.UpdateSpawn(MyChar);
SendPacket(General.MyPackets.CharacterInfo(MyChar));
MyChar.SendEquips(false);
SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
World.SpawnMeToOthers(MyChar, true);
}
}
}
[COLOR="Red"]}[/COLOR]
Hope this helped =)