My problem is that the NPC is not doing what I want it to do. I don't notice any errors in the code. Control 6 is supposed to give me 3 "Points" for 10 Meteors. But instead it gives me 3 points but does not take away my Meteors. This is the case for most of the Controls. Can someone please look over this whole code and tell me if anything is wrong. I'm sure you can understand what the code is supposed to do just by reading it. But I've got something very wrong somewhere I just don't know what.
Code:
if (CurrentNPC == 4200)
{
if (Control == 1)
{
SendPacket(General.MyPackets.NPCSay("You wish to buy points? This is what I can give for your items."));
SendPacket(General.MyPackets.NPCLink("1 Point for 1,000,000 silvers.", 3));
SendPacket(General.MyPackets.NPCLink("14 Points for 140 CPs.", 4));
SendPacket(General.MyPackets.NPCLink("20 Points for 5000 VPs", 5));
SendPacket(General.MyPackets.NPCLink("3 Points for 10 Meteors", 6));
SendPacket(General.MyPackets.NPCLink("26 Points for a DragonBall", 7));
SendPacket(General.MyPackets.NPCLink("4 Points for 5 ExpBalls", 13));
SendPacket(General.MyPackets.NPCLink("100 Points for 1000 CPs", 14));
SendPacket(General.MyPackets.NPCLink("Nothing,thanks.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (Control == 2)
{
SendPacket(General.MyPackets.NPCSay("You wish to sell points? This is what I can give for your points."));
SendPacket(General.MyPackets.NPCLink("10000 VPs for 40 points", 8));
SendPacket(General.MyPackets.NPCLink("10 ExpBalls for 8 points.", 9));
SendPacket(General.MyPackets.NPCLink("DragonBall for 26 points", 10));
SendPacket(General.MyPackets.NPCLink("PrayingStone(M) for 28 Points", 11));
SendPacket(General.MyPackets.NPCLink("10,000,000 silvers for 10 Points", 12));
SendPacket(General.MyPackets.NPCLink("Nothing,thanks.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
if (Control == 3)
{
if (MyChar.Silvers >= 1000000)
{
MyChar.Points += 1;
MyChar.Silvers -= 1000000;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 4)
{
if (MyChar.CPs >= 140)
{
MyChar.Points += 14;
MyChar.CPs -= 140;
SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 5)
{
if (MyChar.VP >= 5000)
{
MyChar.Points += 20;
MyChar.VP -= 5000;
MyChar.MyClient.SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 6)
{
if (MyChar.InventoryContains(1088001, 10))
{
MyChar.Points += 3;
MyChar.RemoveItem(1088001);
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 7)
{
if (MyChar.InventoryContains(1088000, 1))
{
MyChar.Points += 26;
MyChar.RemoveItem(1088000);
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 8)
{
if (MyChar.Points >= 140)
{
MyChar.VP += 10000;
MyChar.Points -= 40;
MyChar.MyClient.SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 9)
{
if (MyChar.Points >= 8)
{
MyChar.AddItem("723700-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
MyChar.AddItem("723700-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
MyChar.AddItem("723700-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
MyChar.AddItem("723700-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
MyChar.AddItem("723700-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
MyChar.AddItem("723700-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
MyChar.AddItem("723700-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
MyChar.AddItem("723700-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
MyChar.AddItem("723700-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
MyChar.AddItem("723700-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
MyChar.Points -= 8;
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 10)
{
if (MyChar.Points >= 26)
{
MyChar.AddItem("1088000-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
MyChar.Points -= 26;
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 11)
{
if (MyChar.Points >= 28)
{
MyChar.AddItem("1200001-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
MyChar.Points -= 28;
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 12)
{
if (MyChar.Points >= 10)
{
MyChar.Silvers += 10000000;
MyChar.Points -= 500;
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
if (Control == 13)
{
if (MyChar.InventoryContains(723700, 5))
MyChar.Points += 4;
MyChar.RemoveItem(723700);
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
if (Control == 14)
{
if (MyChar.CPs >= 1000)
MyChar.Points += 100;
MyChar.CPs -= 1000;
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
MyChar.SavePoints();
}
if (Control == 6)
{
if (MyChar.InventoryContains(1088001, 10))
Remove **** right here, not gonna give you the full code, this hint should be enough
{
MyChar.Points += 3;
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
and for some of your other ****
you need to put the save cps packet at the bottom
i see you forgot them
True, I noticed I forgot the packets as well. But I used reference from other codes so I don't understand why it's not working. For control 3 it's the same method and it works. I'm confuzzled lol I needz more help =x
//edit: This is the ORIGINAL code for it made by Emil (EmmeTheCoder) I'm assuming it works because Emme made it and I'm quite certain it worked when I had it in my old sh*tteh server. It's exactly the same to what teh *** mannn?
///edit: Newsflash, Emil's doesn't work either.
Code:
if (Control == 6)
{
if (MyChar.InventoryContains(1088001, 1))
{
MyChar.Points += 15;
MyChar.RemoveItem(1088001);
}
}
True, I noticed I forgot the packets as well. But I used reference from other codes so I don't understand why it's not working. For control 3 it's the same method and it works. I'm confuzzled lol I needz more help =x
//edit: This is the ORIGINAL code for it made by Emil (EmmeTheCoder) I'm assuming it works because Emme made it and I'm quite certain it worked when I had it in my old sh*tteh server. It's exactly the same to what teh fux mannn?
///edit: Newsflash, Emil's doesn't work either.
Code:
if (Control == 6)
{
if (MyChar.InventoryContains(1088001, 1))
{
MyChar.Points += 15;
MyChar.RemoveItem(1088001);
}
}
lol thats for it if it only contains one heres lemme fix your code
O shnap it does work, thanks bro! One more thing, was my code just in the wrong order or does there need to be a space after if (MyChar.InventoryContains(1088001, 10))
and MyChar.RemoveItem(MyChar.ItemNext(1088001));?
//edit: I'm getting the same problem with the 7th control roflll. It's done exactly the same way too. I ever trued without the spaces. Here's the code..
Code:
if (Control == 7)
{
if (MyChar.InventoryContains(1088000, 1))
{
MyChar.RemoveItem(1088000);
MyChar.Points += 26;
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
O shnap it does work, thanks bro! One more thing, was my code just in the wrong order or does there need to be a space after if (MyChar.InventoryContains(1088001, 10))
and MyChar.RemoveItem(MyChar.ItemNext(1088001));?
//edit: I'm getting the same problem with the 7th control roflll. It's done exactly the same way too. I ever trued without the spaces. Here's the code..
Code:
if (Control == 7)
{
if (MyChar.InventoryContains(1088000, 1))
{
MyChar.RemoveItem(1088000);
MyChar.Points += 26;
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "You now have " + MyChar.Points + " Points left.", 2005));
}
}
Npcs 08/03/2010 - Metin2 Private Server - 0 Replies kann mir jemand einen link schicken oder erklären wie man npcs erstellt und auf den marktplatz stellt?ich hab die sufu benutzt da hab ich aber nichts gefunden .
mfg
kingspeedy
NPCS 06/23/2010 - CO2 Private Server - 2 Replies can some one tell me the codes for the NPC that reallot your stats
Npcs 01/01/2010 - Metin2 Private Server - 5 Replies Hi
Ich suche einen , der auf meinem Server die npcs einstellen kann.
Der jenige bekommt auch einen GM account und ein thx
add new NPCs 08/06/2009 - CO2 Private Server - 0 Replies could any1 tell me how i can add new npcs into the npc table in mysql?
NPCs Help 01/21/2009 - CO2 Private Server - 0 Replies I need some good codes of npcs and help me ..... when i try to click on the npc in conquer it don't say anything :D thanks