[Help/Request] Skill books

06/14/2009 07:16 editor05#1
Can anyone start with a template on the skillbook on how?

If someone can help me here for just one skill book c# code then it'll be helpful for me as a reference for the other skill books...

Thanks a lot...
06/16/2009 08:02 CIRASH#2
Okay this is my first time doing this so it might not be good xD

In ItemUse.cs find:

Code:
                default:
                    {
                        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[ERROR] Please report: Unable to handle item ID: " + Item.ItemID, Struct.ChatType.Top));
                        Delete = false;
                        break;
                    }
Above add:

Code:
                case 725013: //Penetration
                    {
                        LearnSkill(1290, 0, CSocket); // Skill to learn. 1290 = skillid, 0 = level
                        break;
                    }



Lastly, add this at the bottom of useditem.cs

Code:
public static void LearnSkill(int skillid, int level, ClientSocket CSocket) // By scottdavey
        {
            if (CSocket.Client.Skills.ContainsKey(skillid))
            {
                Struct.CharSkill Skill = CSocket.Client.Skills[skillid];
                Skill.Level = level;
                Skill.Exp = 0;
                Database.Database.SetSkill(Skill.ID, Skill.Level, Skill.Exp, CSocket.Client.ID, true);
            }
            else
            {
                Struct.CharSkill Skill = new Struct.CharSkill();
                Skill.Level = level;
                Skill.ID = skillid;
                CSocket.Client.Skills.Add(Skill.ID, Skill);
                Database.Database.SetSkill(skillid, level, 0, CSocket.Client.ID, false);
            }
            CSocket.Send(ConquerPacket.Skill(skillid, level, 0));
        }
    }
06/16/2009 11:04 editor05#3
It's cool.. but need to have somethin that says... you've learned somethin blah blah.. lemme fix that.. hehehe .. thanks again

Quote:
Originally Posted by CIRASH View Post
Okay this is my first time doing this so it might not be good xD

In ItemUse.cs find:

Code:
                default:
                    {
                        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[ERROR] Please report: Unable to handle item ID: " + Item.ItemID, Struct.ChatType.Top));
                        Delete = false;
                        break;
                    }
Above add:

Code:
                case 725013: //Penetration
                    {
                        LearnSkill(1290, 0, CSocket); // Skill to learn. 1290 = skillid, 0 = level
                        break;
                    }



Lastly, add this at the bottom of useditem.cs

Code:
public static void LearnSkill(int skillid, int level, ClientSocket CSocket) // By scottdavey
        {
            if (CSocket.Client.Skills.ContainsKey(skillid))
            {
                Struct.CharSkill Skill = CSocket.Client.Skills[skillid];
                Skill.Level = level;
                Skill.Exp = 0;
                Database.Database.SetSkill(Skill.ID, Skill.Level, Skill.Exp, CSocket.Client.ID, true);
            }
            else
            {
                Struct.CharSkill Skill = new Struct.CharSkill();
                Skill.Level = level;
                Skill.ID = skillid;
                CSocket.Client.Skills.Add(Skill.ID, Skill);
                Database.Database.SetSkill(skillid, level, 0, CSocket.Client.ID, false);
            }
            CSocket.Send(ConquerPacket.Skill(skillid, level, 0));
        }
    }
06/16/2009 12:20 editor05#4
It's cool.. but need to have somethin that says... you've learned somethin blah blah.. lemme fix that.. hehehe .. thanks again

Quote:
Originally Posted by CIRASH View Post
Okay this is my first time doing this so it might not be good xD

In ItemUse.cs find:

Code:
                default:
                    {
                        CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[ERROR] Please report: Unable to handle item ID: " + Item.ItemID, Struct.ChatType.Top));
                        Delete = false;
                        break;
                    }
Above add:

Code:
                case 725013: //Penetration
                    {
                        LearnSkill(1290, 0, CSocket); // Skill to learn. 1290 = skillid, 0 = level
                        break;
                    }



Lastly, add this at the bottom of useditem.cs

Code:
public static void LearnSkill(int skillid, int level, ClientSocket CSocket) // By scottdavey
        {
            if (CSocket.Client.Skills.ContainsKey(skillid))
            {
                Struct.CharSkill Skill = CSocket.Client.Skills[skillid];
                Skill.Level = level;
                Skill.Exp = 0;
                Database.Database.SetSkill(Skill.ID, Skill.Level, Skill.Exp, CSocket.Client.ID, true);
            }
            else
            {
                Struct.CharSkill Skill = new Struct.CharSkill();
                Skill.Level = level;
                Skill.ID = skillid;
                CSocket.Client.Skills.Add(Skill.ID, Skill);
                Database.Database.SetSkill(skillid, level, 0, CSocket.Client.ID, false);
            }
            CSocket.Send(ConquerPacket.Skill(skillid, level, 0));
        }
    }
06/16/2009 16:51 CIRASH#5
Yeah i wanna do that to. When you do it, can you provide me with an example? I just learn from other peoples work and continue it xD
06/16/2009 20:12 glupkotrup#6
If you really don't know anything about coding just follow the code that learns the skill for PMs/GMs...

I take no responsibility if it takes more RAM Memory from hosting the source -_-
See it, try it, learn it, make fun of it!
06/16/2009 21:56 nuhali#7
Code:
                case 725005: //fastblade
                    {
                        if (CSocket.Client.Level >= 10)
                        {
                            LearnSkill(1045, 0, CSocket);
                            CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You learned FastBlade!", Struct.ChatType.Top));
                        }
                        else
                        {
                            Delete = false;

                        }
                        break;
                    }
How i do that you need blade req 5 to use it?
06/16/2009 22:26 CIRASH#8
Quote:
Originally Posted by nuhali View Post
Code:
                case 725005: //fastblade
                    {
                        if (CSocket.Client.Level >= 10)
                        {
                            LearnSkill(1045, 0, CSocket);
                            CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "You learned FastBlade!", Struct.ChatType.Top));
                        }
                        else
                        {
                            Delete = false;

                        }
                        break;
                    }
How i do that you need blade req 5 to use it?
Thats what im trying to figure out now.