for those willing to learn a bit

06/07/2009 10:28 yuko#1
this is a little start for ppl willing to learn?
its the npc that levels itemlvls and quality more known as magicartisan.
why not releasing the whole npc
- some ppl here are mad becaus codes are released. and ppl don't learn from it so lets try this.

it is basic so anyone with some logic could have made this. anyway here it is

Code:
case 10062:
                    {

                        if (LinkBack == 0)
                        {
                            Text("hi, i can lvl any equipment", CSocket);
                            Link("try Level: armor", 1, CSocket);
                            Link("try Quality: armor", 2, CSocket);
                            Link("Just passing by.", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            int Location = 3;
                            if (CSocket.Client.Equipment.ContainsKey(Location))
                            {
                                Struct.ItemInfo Item = CSocket.Client.Equipment[Location];
                                Console.WriteLine(Item.ItemID + " " + Item.UID + " " + Calculation.NextEquipLevel(Item.ItemID) + " ");
                                Item.ItemID = Calculation.NextEquipLevel(Item.ItemID);
                                Database.Database.UpdateItem(Item);
                                CSocket.Send(ConquerPacket.ItemInfo(Item.UID, Item.ItemID, Item.Plus, Item.Progress, Item.Bless, Item.Enchant, Item.Soc1, Item.Soc2, Item.Dura, Item.MaxDura, Item.Position, Item.Color));
                            }
                            else
                            {
                                Text("That item is not equipped.", CSocket);
                                Link("Oups", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 2)
                        {
                            int Location = 3;
                            Struct.ItemInfo Item = CSocket.Client.Equipment[Location];
                            if (Calculation.Quality(Convert.ToString(Item.ItemID)) < 9)
                            {
                                Console.WriteLine(Item.ItemID + " " + Item.UID + " " + Calculation.Quality(Convert.ToString(Item.ItemID)) + " next ItemID = " + (Item.ItemID +1));
                                Item.ItemID++;
                            }
                            Database.Database.UpdateItem(Item);
                            CSocket.Send(ConquerPacket.ItemInfo(Item.UID, Item.ItemID, Item.Plus, Item.Progress, Item.Bless, Item.Enchant, Item.Soc1, Item.Soc2, Item.Dura, Item.MaxDura, Item.Position, Item.Color));
                        }
                        break;
                    }
here is also a little thing to block the item to lvl higher than your lvl
Code:
Struct.ItemInfo Item = CSocket.Client.Equipment[Location];
                                Struct.ItemData ItemDat = Nano.Items[Item.ItemID];
                                Struct.ItemData NextItemDat = Nano.Items[Calculation.NextEquipLevel(Item.ItemID)];
                                if ([COLOR="Red"]ItemDat.Level < CSocket.Client.Level[/COLOR] && [COLOR="Lime"]NextItemDat.Level <= CSocket.Client.Level[/COLOR])
                                {
                                    
                                }
ItemDat.Level < CSocket.Client.Level <-- this one will check the items lvl and your own.
NextItemDat.Level <= CSocket.Client.Level <-- this one will check the nextlvlitem lvl and your own.
these two will actualy block the item lvl if your lvl isn't high enough?
ex:
1) if you didn't add that you'll be able to lvl the items as much as you want.
2) if you add only the first check.
when you have lvl 15 armor. and your lvl is higher than 15 it will lvl it to 22.
thats why the second check will look for the next items lvl.
if your lvl is higher than these it will upgreat else it won't
06/07/2009 18:38 nuhali#2
but where to add this?
Struct.ItemInfo Item = CSocket.Client.Equipment[Location];
Struct.ItemData ItemDat = Nano.Items[Item.ItemID];
Struct.ItemData NextItemDat = Nano.Items[Calculation.NextEquipLevel(Item.ItemID)];
if (ItemDat.Level < CSocket.Client.Level && NextItemDat.Level <= CSocket.Client.Level)
{

}
06/07/2009 18:45 yuko#3
you could try to find out first :p
Code:
if (CSocket.Client.Equipment.ContainsKey(Location))
                            {
                                Struct.ItemInfo Item = CSocket.Client.Equipment[Location];
                                Struct.ItemData ItemDat = Nano.Items[Item.ItemID];
                                Struct.ItemData NextItemDat = Nano.Items[Calculation.NextEquipLevel(Item.ItemID)];
                                if (ItemDat.Level < CSocket.Client.Level && NextItemDat.Level <= CSocket.Client.Level)
                                {
                                    Console.WriteLine(Item.ItemID + " " + Item.UID + " " + Calculation.NextEquipLevel(Item.ItemID) + " ");
                                    Item.ItemID = Calculation.NextEquipLevel(Item.ItemID);
                                    Database.Database.UpdateItem(Item);
                                    CSocket.Send(ConquerPacket.ItemInfo(Item.UID, Item.ItemID, Item.Plus, Item.Progress, Item.Bless, Item.Enchant, Item.Soc1, Item.Soc2, Item.Dura, Item.MaxDura, Item.Position, Item.Color));
                                }
                            }
06/07/2009 18:47 nuhali#4
i cant find:P
06/07/2009 18:58 yuko#5
lol,
look at the first post
case 10062:
it belongs there
06/07/2009 19:02 nuhali#6
i got it:P

can u release some more new npc?
06/07/2009 19:07 yuko#7
this is not a release this is an exemple. you'll need to do the rest to make it work. as you could see its some basic stuff.
now what you need to do is checking the inventory for mets and dbs and make something that counts the needed stuff

but thats the easy part :p
06/07/2009 19:17 nuhali#8
i want to make a npc that clears your inv
look:

Code:
                    case 435: // Clear
                    {
                        if (LinkBack == 0)
                        {
                            if (CSocket.Client.Inventory.Count == 40)
                            {
                                Text("Bugged, i can clear u inv?", CSocket);
                                Link("Yes.", 1, CSocket);
                                Link("No, i dont need.", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            else
                                Text("Your inventory is full. You need to clear invectory?", CSocket);
                            Link("Yes, i need.", 1, CSocket);
                            Link("No, i still here.", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        else if (LinkBack == 1)
                        {
                            if (CSocket.Client.Inventory.Count == 0)
                                Text("Your inventory is empty. All remove", CSocket);
                            Link("THANKS!!!", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        break;
                    }
but he dont work can u help me?
06/07/2009 19:29 yuko#9
yeah lol,
look good to that npc, do you see anywhere that he deletes items?
the only thing in here is text
06/07/2009 19:33 nuhali#10
hmm is this good?
if (CSocket.Client.Inventory.Count == 40)
{
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[ERROR] Your inventory is full. You need to clear invectory?", Struct.ChatType.Top));
CSocket.Client.Inventory.Clear
return;
}
06/07/2009 22:00 yuko#11
i don't have much time. but here is one that will work as you want
Code:
case 435: // Clear
                    {
                        List<int> List = new List<int>();
                        if (LinkBack == 0)
                        {
                            if (CSocket.Client.Inventory.Count > 0)
                            {
                                Text("empty IV??", CSocket);
                                Link("yes", 1, CSocket);
                                Link("no", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                            else
                            {
                                Text("Sorry i only can help you if you have items in you inventory.", CSocket);
                                Link("Ok, thanks", 255, CSocket);
                                Face(30, CSocket);
                                End(CSocket);
                            }
                        }
                        else if (LinkBack == 1)
                        {
                            List<int> CountList = new List<int>();
                            foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
                            {
                                CountList.Add(Item.UID);
                            }
                            foreach (int UID in CountList)
                            {
                                CSocket.Client.Inventory.Remove(UID);
                                CSocket.Send(ConquerPacket.ItemUsage(UID, 255, Struct.ItemUsage.RemoveItem));
                                Database.Database.DeleteItem(UID);
                            }
                            Text("There you go New clean IV", CSocket);
                            Link("Great Thanks", 255, CSocket);
                            Face(30, CSocket);
                            End(CSocket);
                        }
                        break;
                    }
06/07/2009 22:33 nuhali#12
Tnx Bro