PK Point Npc [5165]

07/16/2012 03:50 ryski1#1
Hi, I Was wondering if you could help me with this, I want to make an NPC for it to take away pks for 20cps, i got this so far:
Code:
#region PKPointsNPC
case 10065:
{
    if (Control == 0)
    {

        GC.AddSend(Packets.NPCSay("You have pkpoints let me take 30pks from you for the price of 20cps."));
        GC.AddSend(Packets.NPCLink("Yes please", 1));
        GC.AddSend(Packets.NPCLink("No Thanks", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }

    if (Control == 1)
    {
        if (GC.MyChar.CPs >= 20)
            GC.MyChar.CPs -= 20;
        GC.MyChar.PKPoints -= 30;
    }

    break;
}
#endregion
But if u have less than 30pkps it gives you 60k something pk points, i have searched for the working code and then my last option is to ask here, or even if you can help me make the Penitence amulet work it would be much appreciated

~Ryski
07/16/2012 06:45 Zeroxelli#2
Change
Code:
        if (GC.MyChar.CPs >= 20)
            GC.MyChar.CPs -= 20;
        GC.MyChar.PKPoints -= 30;
to
Code:
    if (GC.MyChar.PKPoints >= 30 && GC.MyChar.CPs >= 20)
    {
        GC.MyChar.CPs -= 20;
        GC.MyChar.PKPoints -= 30;
    }
07/16/2012 08:36 I don't have a username#3
And use a switch for your options as well.
07/16/2012 14:53 ryski1#4
Quote:
Originally Posted by Zeroxelli View Post
Change
Code:
        if (GC.MyChar.CPs >= 20)
            GC.MyChar.CPs -= 20;
        GC.MyChar.PKPoints -= 30;
to
Code:
    if (GC.MyChar.PKPoints >= 30 && GC.MyChar.CPs >= 20)
    {
        GC.MyChar.CPs -= 20;
        GC.MyChar.PKPoints -= 30;
    }
Thanks mate this works :)