[Request] NPC that Reallot Points

07/21/2009 19:53 nestreys#1
Can someone post a code with guide for NPC that reallot attribute points.. Please. Thanks.
07/21/2009 23:03 WTFoRK#2
Quote:
Originally Posted by nestreys View Post
Can someone post a code with guide for NPC that reallot attribute points.. Please. Thanks.
[Only registered and activated users can see links. Click Here To Register...]

Why making 2 threads about the same thing if 1 of them been answered...? And no , noobody's gonna give you full npc.I almost made a full function for you there.Work out how's the npc gonna be yourself.
07/22/2009 00:21 samehvan#3
what source ??
07/22/2009 02:27 n0mansland#4
Quote:
Originally Posted by samehvan View Post
what source ??
LOTF

I'm not going to give out whole code but here's how you would do it..

Make it check like this...

EXAMPLE:

Code:
if (CurrentNPC == 0)
{
if (MyChar.Reborn >= 1)
{
                                        SendPacket(General.MyPackets.NPCSay("Blablalblalbla reallot your stats blalblalblallblallblallblalllbll"));
                                        SendPacket(General.MyPackets.NPCLink("Ok.", 1));
                                        SendPacket(General.MyPackets.NPCLink("No Thanks.", 255));
                                        SendPacket(General.MyPackets.NPCFinish());
}
                            if (Control == 1)
                            {
if (MyChar.Agi >= 1)// <--- Make it check agility since it's always needed
REALLOT
}
}
Horrible example code but just gives an idea...

Make it check for the Agi attribute point (since it's always needed) if it's greater than or equal to 1 then have it reallot..
07/22/2009 02:32 f0am#5
I thought i already gave you it... lol
07/22/2009 02:43 samehvan#6
i dont use LOTF but i can continue n0mansland Code :p

//REALLOT
if (Control == 1)
{
MyChar.StatePoints+=MyChar.Agi;MyChar.StatePoints+ =MyChar.Str;
MyChar.StatePoints+=MyChar.Vit;MyChar.StatePoints+ =MyChar.Spi;
MyChar.Agi=2;MyChar.Str=3;MyChar.Vit=5;MyChar.Stat ePoints-=10;

// Then Send this attributes
}

i think some Vitals or so, i dont know what packets ur source use , and also notice that u may need to chang some vars i give as an example to whatever ur source calls them
07/22/2009 02:44 pajar22#7
code for reallot stats

search for
if (CurrentNPC == 278) in client.cs
above it add


Code:
if (CurrentNPC == 9548)//Reallot Stats
                            {
                                SendPacket(General.MyPackets.NPCSay("Reborn players who are level 70 or higher can redistribute their attribute points at the cost of a Dragonball."));
                                SendPacket(General.MyPackets.NPCLink("I will reallot my points.", 1));
                                SendPacket(General.MyPackets.NPCLink("Let me think it over.", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
then search for
if (CurrentNPC == 278) again
above it add
Code:
if (CurrentNPC == 9548)
                                if (Control == 1)
                                {
                                    if (MyChar.RBCount >= 1)
                                    {
                                        if (MyChar.InventoryContains(1088000, 1))
                                        {
                                            MyChar.RemoveItem(MyChar.ItemNext(1088000));

                                            uint Points = 0;

                                            Points += MyChar.Str;
                                            Points += MyChar.Spi;
                                            Points += MyChar.Agi;
                                            Points += MyChar.Vit;

                                            MyChar.StatP += (ushort)Points;

                                            MyChar.Str = 0;
                                            MyChar.Spi = 0;
                                            MyChar.Agi = 0;
                                            MyChar.Vit = 0;

                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 16, MyChar.Str));
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 17, MyChar.Agi));
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 15, MyChar.Vit));
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 14, MyChar.Spi));
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 5, (ulong)MyChar.Exp));
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 2, MyChar.MaxMana()));
                                            SendPacket(General.MyPackets.GeneralData((long)MyChar.UID, 0, 0, 0, 92));
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 0, MyChar.CurHP));
                                            SendPacket(General.MyPackets.Vital(MyChar.UID, 11, MyChar.StatP));

                                            MyChar.SaveStatPoints();
                                            MyChar.Save();
                                            SendPacket(General.MyPackets.NPCSay("You can either reallot your stats manually."));
                                            SendPacket(General.MyPackets.NPCSay(" Command Breakdown: /allot [vit, str, agi, spi] [Amount to ADD to the Stat]"));
                                            SendPacket(General.MyPackets.NPCLink("I see, Thanks.", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }
                                        else
                                        {
                                            SendPacket(General.MyPackets.NPCSay("You don't have a Dragonball."));
                                            SendPacket(General.MyPackets.NPCLink("I see.", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("You cannot reallot your attribute points if you aren't reborn."));
                                        SendPacket(General.MyPackets.NPCLink("I see.", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
then on character.cs search for
public void PackSkills()
above it add

Code:
public void SaveStatPoints()
        {
            if (MyClient.There)
                if (MyClient.Online)
                    DataBase.SaveChar(this);
        }
and thats about it i hope it helps
07/22/2009 02:54 f0am#8
Guys already gave him and i also gave him a command so it works >< gos.
07/22/2009 03:40 nestreys#9
foam gave me one already. Thank you so much for the help.