Ok, that being said, what I'm trying to do Is to create an npc that will exchange items for levels...I know there are posts about these types of NPC, I have went over them and they do not help me with this. I have the NPC coded, but cannot figure out the correct way to make it take the items and give levels without making the npc the length of my arm. Trying to keep it as neat and clean as possible. Trying to make it give levels up to level 200, 1 level at a time.
Here is the code I got with what I know will either have to add to it or change to some different way, highlighted in red.
Code:
#region VIPZone Exit
case 300657:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello, I can exchagne PowerEXPBalls for levels, or send you back to Twin City."));
GC.AddSend(Packets.NPCLink("Please exchange my PowerEXPBalls.", 1));
GC.AddSend(Packets.NPCLink("Please send me to Twin City.", 2));
GC.AddSend(Packets.NPCLink("Just Passing By.", 255));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
if (GC.MyChar.VipLevel >= 4)
if (GC.MyChar.InventoryContains(722057, 10))
{
[COLOR="Red"]for (int i = 0; i < 10; i++)
GC.MyChar.RemoveItem(GC.MyChar.NextItem(722057));
if (NeededExp(GC.MyChar.Level) <= GC.MyChar.Experience)
GiveLevel(GC);
}[/COLOR]
GC.AddSend(Packets.NPCSay("Congration you have 10 PowerEXPBalls for 1 Level."));
GC.AddSend(Packets.NPCLink("OK Thx", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else
{
GC.AddSend(Packets.NPCSay("Sorry you dont have any PowerEXPBalls."));
GC.AddSend(Packets.NPCLink("OK i see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 2)
GC.MyChar.Teleport(1002, 429, 378);
break;
}
#endregion
Thanks.






