Item Plus Restrition?

04/22/2009 01:01 LordSesshomaru#1
I was messing round with Hybrid's bugles source , and i was wondering how i would go about putting and item + reststion on so players that are not gms can't spawn anything above +9 (Like Acid). I have been messing around but i am not sure how to do it. Anyone have any idea's.

Ive been editing it through the cmds

Thank.

Edit : Nvm i got it
04/22/2009 01:47 InfamousNoone#2
Good stuff, you kept working on it, even after you asked for help.
04/22/2009 02:07 LordSesshomaru#3
For Everyone else who may wonder. This is what i did don't think its the best way but if Hybrid has a better way and would like to share that would be great! Here is what i did btw
Quote:
string[] Info = Item.Split('-');
ItemData.ID = uint.Parse(Info[0]);
ItemData.Plus = 9;
ItemData.Bless = byte.Parse(Info[2]);
ItemData.Enchant = byte.Parse(Info[3]);
ItemData.SocketOne = byte.Parse(Info[4]);
ItemData.SocketTwo = byte.Parse(Info[5]);
ItemData.UID = NextItemUID;
return true;
then even if u type @item ConquestArmor super 12 7 255 13 13 it will still come out as +9 everytime
04/22/2009 02:09 tao4229#4
ItemData.Plus = Math.Min(byte.Parse(Info[1]), 9);
:)
04/22/2009 02:23 LordSesshomaru#5
Hey Tao i ran in to a problem or Hybrid since it your source i am using. I have been packet logging packets working on trying to update above 5017+ . Now i have not broken it but where in the Source are the First and Second keys stored?

Edit : Nvm I found them in the socket dll Just got to decompose it
04/22/2009 04:49 joshvette001#6
Lord, I haven't truly looked at Hybrids source, but in mine how I would do it is in the list of if statements for commands, I would go to my if (Msg[1] == "Create Item") or what ever how ever its coded, because thats not even how mine is coded. than what you do is right at the beginning do a if statement and basically do something like this

assume a GM is 1
if (Client.AccType = 1)
{
put how ever the item is created in his source so if its like this
string[] Info = Item.Split('-');
ItemData.ID = uint.Parse(Info[0]);
ItemData.Plus =byte.Parse(Info[1]);
ItemData.Bless = byte.Parse(Info[2]);
ItemData.Enchant = byte.Parse(Info[3]);
ItemData.SocketOne = byte.Parse(Info[4]);
ItemData.SocketTwo = byte.Parse(Info[5]);
ItemData.UID = NextItemUID;
return true;
}
else
{
if (info[1] > 9 || info[1] < 0)
{
//construct a packet here to send a chat message to the player saying that he is using a invalid number for the plus
and than break it or return it depending on how it is doing it
}
else
{
string[] Info = Item.Split('-');
ItemData.ID = uint.Parse(Info[0]);
ItemData.Plus = byte.Parse(Info[1]);
ItemData.Bless = byte.Parse(Info[2]);
ItemData.Enchant = byte.Parse(Info[3]);
ItemData.SocketOne = byte.Parse(Info[4]);
ItemData.SocketTwo = byte.Parse(Info[5]);
ItemData.UID = NextItemUID;
return true;
}
}

I just came up with this in like two seconds, its not going to work right off the bat but that is the basic logic behind how you could check to make sure its not a value you don't want.
04/22/2009 04:58 tao4229#7
ItemData.Plus = Client.AccType == 1 ? Math.Min(12, byte.Parse(Info[1])) : Math.Min(byte.Parse(Info[1]), 9));

Simple solutions guys..
Again assuming AccType == 1 stands for GM, change based on your source syntax.
04/22/2009 17:19 LordSesshomaru#8
@joshvette001
Yea the source does not have "Status's" setup for players or gms yet. I am working on setting that up now.

>>
I am not sure how to go about when a player equips an item that the other player can see it. Ill keep trying and see if i can come up with a solution.