Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Need Some Help with Item Requirements

Initiate Mage
Joined
Aug 1, 2008
Messages
3
Reaction score
0
I have created some new classes to the LOTF source, and taken out the original classes.

I ran into a problem of how I can make it so classes with JobId (6-8),(20-22), and (50-52) can all use the trojan armors.

I am new to programming, but have started learning.. and am not sure how to write this in.

I have found this passage in the source which I believe controls the job requirements (I made // notes just to clear things up for me.)

Code:
public static bool CanEquip(string iteM, Character Charr)
        {
            if (iteM.Length < 5)
                return false;
            string[] Splitter = iteM.Split('-');
            bool Returning = true;

            foreach (uint[] item in DataBase.Items)
            {
                if (item[0] == uint.Parse(Splitter[0]))
                {
                    byte TJob = 0;

                    if (Charr.Job > 129 && Charr.Job < 136)//water
                        TJob = (byte)(Charr.Job + 60);
                    else if (Charr.Job > 139 && Charr.Job < 146)//fire
                        TJob = (byte)(Charr.Job + 50);
                    else
                        TJob = Charr.Job;

                    if (Charr.Level >= item[3])
                        if (Charr.Str >= item[5])
                            if (Charr.Agi >= item[6])
                                if (TJob - item[1] >= 0 && TJob - item[1] <= 5 || TJob == 0)//Maybe Job ID needs to be within 5 numbers?
                                    if (Charr.Model != 1002 && Charr.Model != 1003 || item[4] == 0)
                                    {
                                        if (ItemType(item[0]) == 4 || ItemType(item[0]) == 5 && WeaponType(item[0]) != 421)
                                        {
                                            if (WeaponType(item[0]) == 500)//Bow
                                                Charr.AtkType = 25;//range attack
                                            else
                                                Charr.AtkType = 2;//melee attack

                                            if (Charr.Profs.Contains(WeaponType(item[0])))
                                                if ((uint)Charr.Profs[WeaponType(item[0])] >= item[2])
                                                    Returning = true;//equip
                                                else
                                                    Returning = false;
                                        }
                                        else
                                        {
                                            Returning = true;
                                        }
                                    }
                                    else
                                        Returning = false;
                    break;
                }
            }

            if (Splitter[0] == "1200006" || Splitter[0] == "722343" || Splitter[0] == "722344" || Splitter[0] == "722345" || Splitter[0] == "722346" || Splitter[0] == "722347" || Splitter[0] == "722348" || Splitter[0] == "722348" || Splitter[0] == "722349" || Splitter[0] == "722350" || Splitter[0] == "722351" || Splitter[0] == "722352")
                Returning = false;
            if (Splitter[0] == "137910" || Splitter[0] == "137810" || Splitter[0] == "137710" || Splitter[0] == "137610" || Splitter[0] == "137510" || Splitter[0] == "137410" || Splitter[0] == "137310" && Charr.MyClient.Status != 8 && Charr.MyClient.Status != 7)//GM Robes
                Returning = false;

            return Returning;
        }


I am thinking of maybe doing something which may seem nooby, where it will be something like..
Code:
if (Splitter[0] => "lowestIDofArmor" && Splitter[0] =< "highestIDofArmor" && MyChar.Job < 9 && MyChar.Job > 5)
                Returning = true;
            if (Splitter[0] => "lowestIDofArmor" && Splitter[0] =< "highestIDofArmor" && MyChar.Job < 19 && MyChar.Job > 23)
                Returning = true;
            if (Splitter[0] => "lowestIDofArmor" && Splitter[0] =< "highestIDofArmor" && MyChar.Job < 49 && MyChar.Job > 53)
                Returning = true;
All of that is probably wrong, so I need some help in figureing this out.

This is my first time on working with Microsoft Visual C#, and been working on this source for around 2 days.
I am also working on a client modification of the GUI.
(Maybe someone can also help me find and extract the meshes of this game.)

Thank you for your time.
 
Initiate Mage
Joined
Aug 1, 2008
Messages
3
Reaction score
0
Can anyone think of a way to restrict items by job id where job id numbers w/e to w/e work with certain weapons, but at the same time make the armors be used by more than one class (not every class though)?
 
Back
Top