[HELP] Code to add strength for npc?

06/15/2009 20:57 quadruple1#1
Heres an npc im working on

Code:
                case 10151:// Stat Adder
                    {
                        if (LinkBack == 0)
                        {
                            Text("Want your stats increased by 100? You cannot have your stats higher than 10k. It'll cost you 1 million cps. Pick your stat you wanna increase. You must be level 120+.", CSocket);
                            Link("Str", 1, CSocket);
                            Link("Vit", 2, CSocket);
                            Link("Agi", 3, CSocket);
                            Link("Spi", 4, CSocket);
                            Link("No thanks", 225, CSocket);
                            End(CSocket);

                        }
                        else if (LinkBack == 1)
                        {
                            if (CSocket.Client.Strength <= 10000)
                                if (CSocket.Client.Level >= 120)
                                    if(CSocket.Client.CPs >= 1000000)
                                {
                                    CPs(-1000000, CSocket);
                                    Strength(+100, CSocket); ConquerPacket.ToServer(ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", "CONGRATULATIONS! " + CSocket.Client.Name + " has increased his strength stat by 100! Good job!", Struct.ChatType.Center), 0);
                                }
                                else
                                {
                                    Text("You dont meet the requirements!", CSocket);
                                    Link("Damn!", 255, CSocket);
                                    End(CSocket);
                                }
                        }
                        else if (LinkBack == 2)
                        {
                            if (CSocket.Client.Vitality <= 10000)
                                if (CSocket.Client.Level >= 120)
                                    if (CSocket.Client.CPs >= 1000000)
                                {
                                    CPs(-1000000, CSocket);
                                    Vitality(+100, CSocket); ConquerPacket.ToServer(ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", "CONGRATULATIONS! " + CSocket.Client.Name + " has increased his strength stat by 100! Good job!", Struct.ChatType.Center), 0);
                                }
                                else
                                {
                                    Text("You dont meet the requirements!", CSocket);
                                    Link("Damn!", 255, CSocket);
                                    End(CSocket);
                                }
                        }
                        else if (LinkBack == 3)
                        {
                            if (CSocket.Client.Dexterity <= 10000)
                                if (CSocket.Client.Level >= 120)
                                    if (CSocket.Client.CPs >= 1000000)
                                    {
                                        CPs(-1000000, CSocket);
                                        Dexterity(+100, CSocket); ConquerPacket.ToServer(ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", "CONGRATULATIONS! " + CSocket.Client.Name + " has increased his strength stat by 100! Good job!", Struct.ChatType.Center), 0);
                                    }
                                    else
                                    {
                                        Text("You dont meet the requirements!", CSocket);
                                        Link("Damn!", 255, CSocket);
                                        End(CSocket);
                                    }
                        }
                        else if (LinkBack == 4)
                        {
                            if (CSocket.Client.Spirit <= 10000)
                                if (CSocket.Client.Level >= 120)
                                    if (CSocket.Client.CPs >= 1000000)
                                    {
                                        CPs(-1000000, CSocket);
                                        Spirit(+100, CSocket); ConquerPacket.ToServer(ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", "CONGRATULATIONS! " + CSocket.Client.Name + " has increased his strength stat by 100! Good job!", Struct.ChatType.Center), 0);
                                    }
                                    else
                                    {
                                        Text("You dont meet the requirements!", CSocket);
                                        Link("Damn!", 255, CSocket);
                                        End(CSocket);
                                    }
                        }
                        break;
                    }
It will take your cps, but wont give you the stats. Can anyone tell me the method for adding the stats?
I tried using (CSocket.Client.Strength + 100); and (CSocket.Client.Strength += 100); but they didnt work either.
06/15/2009 22:02 Kiyono#2
I think you also need to add this:
Code:
CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Strength, Struct.StatusTypes.StrengthStatPoints));
                                                            Calculation.Vitals(CSocket, false);
06/15/2009 22:34 quadruple1#3
Well I added it in front of Strength(+100, CSocket); if thats the correct place
and it still didnt work...