Register for your free account! | Forgot your password?

You last visited: Today at 17:22

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] Change Name NPC

Discussion on [Release] Change Name NPC within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Closed Thread
 
Old   #1
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 912
[Release] Change Name NPC

This is everything you need to Code a Name Changing NPC in LOTF source.

Why Release it?
- It is fairly easy to figure out, and if you have decent knowledge of C# and of the source you use, then you can figure it out.
- Also, I believe that open source coding for servers is a lot more efficient, and produces better/more advanced results.

What does this NPC do?
- Changes your characters name for 1 Dragonball.

What will I need?
- Brain w/ common sense
- LOTF source [Link: ]



How to Code a Name Changing NPC

Database:

- To access the database:

- Create the NPC where ever you want, I'm sure you know how. (UID = 9534)

Source:

- In Client.cs under case 2031: where all the other NPCs are =P:
Code:
                            if (CurrentNPC == 9534)
                            {
                                SendPacket(General.MyPackets.NPCSay("You can change you name in exchange for a Dragonball. Would you like to change your name?"));
                                SendPacket(General.MyPackets.NPCLink("Yes please.", 1));
                                SendPacket(General.MyPackets.NPCLink("No thanks.", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
- Now, under case 2032:, add this:
Code:
                            if (CurrentNPC == 9534)
                            {
                                if (Control == 1)
                                {
                                    if (MyChar.InventoryContains(1088000, 1))
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Enter your new name."));
                                        SendPacket(General.MyPackets.NPCLink2("Name:", 2));
                                        SendPacket(General.MyPackets.NPCLink("Cancel.", 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());
                                    }
                                }
                                if (Control == 2)
                                {
                                    string OldName = MyChar.Name;
                                    string NewName = "";
                                    bool ValidName = true;
                                    for (int i = 14; i < 14 + Data[13]; i++)
                                    {
                                        NewName += Convert.ToChar(Data[i]);
                                    }
                                    if (NewName.IndexOfAny(new char[3] { ' ', '[', ']' }) > -1)
                                    {
                                        ValidName = false;
                                    }

                                    foreach (string name in DataBase.ForbiddenNames)
                                    {
                                        if (name == NewName)
                                        {
                                            ValidName = false;
                                            break;
                                        }
                                    }

                                    try
                                    {
                                        if (ValidName)
                                        {
                                            MyChar.RemoveItem(MyChar.ItemNext(1088000));

                                            MyChar.Name = NewName;

                                            World.SendMsgToAll(OldName + " changed his/her name to " + NewName + ".", "SYSTEM", 2005);

                                            SendPacket(General.MyPackets.CharacterInfo(MyChar));
                                            World.SpawnMeToOthers(MyChar, false);
                                            MyChar.SendEquips(false);
                                        }
                                        else
                                        {
                                            SendPacket(General.MyPackets.NPCSay("That name is not valid!"));
                                            SendPacket(General.MyPackets.NPCLink("I see.", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }
                                    }
                                    catch (Exception Exc) { General.WriteLine(Exc.ToString()); }


                                    break;
                                }
                            }
I think thats everything! Enjoy your new Name Changing NPC!


Press Thanks if this helped!
kinshi88 is offline  
Thanks
20 Users
Old 09/06/2008, 07:25   #2
 
taguro's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
Quote:
Originally Posted by kinshi88 View Post
This is everything you need to Code a Name Changing NPC in LOTF source.

Why Release it?
- It is fairly easy to figure out, and if you have decent knowledge of C# and of the source you use, then you can figure it out.
- Also, I believe that open source coding for servers is a lot more efficient, and produces better/more advanced results.

What does this NPC do?
- Changes your characters name for 1 Dragonball.

What will I need?
- Brain w/ common sense
- LOTF source [Link: ]



How to Code a Name Changing NPC

Database:

- To access the database:

- Create the NPC where ever you want, I'm sure you know how. (UID = 9534)

Source:

- In Client.cs under case 2031: where all the other NPCs are =P:
Code:
                            if (CurrentNPC == 9534)
                            {
                                SendPacket(General.MyPackets.NPCSay("You can change you name in exchange for a Dragonball. Would you like to change your name?"));
                                SendPacket(General.MyPackets.NPCLink("Yes please.", 1));
                                SendPacket(General.MyPackets.NPCLink("No thanks.", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
- Now, under case 2032:, add this:
Code:
                            if (CurrentNPC == 9534)
                            {
                                if (Control == 1)
                                {
                                    if (MyChar.InventoryContains(1088000, 1))
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Enter your new name."));
                                        SendPacket(General.MyPackets.NPCLink2("Name:", 2));
                                        SendPacket(General.MyPackets.NPCLink("Cancel.", 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());
                                    }
                                }
                                if (Control == 2)
                                {
                                    string OldName = MyChar.Name;
                                    string NewName = "";
                                    bool ValidName = true;
                                    for (int i = 14; i < 14 + Data[13]; i++)
                                    {
                                        NewName += Convert.ToChar(Data[i]);
                                    }
                                    if (NewName.IndexOfAny(new char[3] { ' ', '[', ']' }) > -1)
                                    {
                                        ValidName = false;
                                    }

                                    foreach (string name in DataBase.ForbiddenNames)
                                    {
                                        if (name == NewName)
                                        {
                                            ValidName = false;
                                            break;
                                        }
                                    }

                                    try
                                    {
                                        if (ValidName)
                                        {
                                            MyChar.RemoveItem(MyChar.ItemNext(1088000));

                                            MyChar.Name = NewName;

                                            World.SendMsgToAll(OldName + " changed his/her name to " + NewName + ".", "SYSTEM", 2005);

                                            SendPacket(General.MyPackets.CharacterInfo(MyChar));
                                            World.SpawnMeToOthers(MyChar, false);
                                            MyChar.SendEquips(false);
                                        }
                                        else
                                        {
                                            SendPacket(General.MyPackets.NPCSay("That name is not valid!"));
                                            SendPacket(General.MyPackets.NPCLink("I see.", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }
                                    }
                                    catch (Exception Exc) { General.WriteLine(Exc.ToString()); }


                                    break;
                                }
                            }
I think thats everything! Enjoy your new Name Changing NPC!


Press Thanks if this helped!
your on fire bro... keep up the good work =)
taguro is offline  
Old 09/06/2008, 13:37   #3
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
Seems like you got ur comp working again? Hope so,if so,great,then we can start coding,gotta talk to u though :P
Cya

Emme
_Emme_ is offline  
Old 09/06/2008, 21:01   #4
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
Nice^^
~Yuki~ is offline  
Old 09/06/2008, 22:49   #5
 
elite*gold: 0
Join Date: Aug 2008
Posts: 77
Received Thanks: 63
thanks
konkizta is offline  
Old 09/07/2008, 02:17   #6
 
elite*gold: 0
Join Date: Oct 2007
Posts: 120
Received Thanks: 24
thanks i'll try it
by the way : how i can make NPC do some command
i mean there r "/Changename" command how i can make nbc do this command
elragal_30 is offline  
Old 09/07/2008, 02:47   #7
 
elite*gold: 0
Join Date: Aug 2008
Posts: 77
Received Thanks: 63
Quote:
Originally Posted by elragal_30 View Post
thanks i'll try it
by the way : how i can make NPC do some command
i mean there r "/Changename" command how i can make nbc do this command
Code:
if (Splitter[0] == "/nombre")
                                            {
                                                string newname = Splitter[1];
                                                MyChar.Name = newname;
                                                SendPacket(General.MyPackets.CharacterInfo(MyChar));
                                                World.SpawnMeToOthers(MyChar, false);
                                                MyChar.SendEquips(false);
                                            }
konkizta is offline  
Old 09/07/2008, 10:40   #8
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
Quote:
Originally Posted by konkizta View Post
Code:
if (Splitter[0] == "/nombre")
                                            {
                                                string newname = Splitter[1];
                                                MyChar.Name = newname;
                                                SendPacket(General.MyPackets.CharacterInfo(MyChar));
                                                World.SpawnMeToOthers(MyChar, false);
                                                MyChar.SendEquips(false);
                                            }

Yow online translater sux ***** he dont wanna know a command 4 namechangeing
He wanna know how to make NPCs usin commands^^
~Yuki~ is offline  
Old 09/07/2008, 11:42   #9
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
Not possible on loft source if u aint gonna rewrite it all. The only server I know who got that,is hybrid co / acid co
_Emme_ is offline  
Old 09/07/2008, 11:52   #10
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
****-.-
~Yuki~ is offline  
Old 09/07/2008, 17:17   #11
 
elite*gold: 0
Join Date: Aug 2008
Posts: 77
Received Thanks: 63
Quote:
Originally Posted by lolmaster123 View Post
Yow online translater sux ***** he dont wanna know a command 4 namechangeing
He wanna know how to make NPCs usin commands^^
ahhh xD is that translators are a ****.

or writing people xD
konkizta is offline  
Old 09/07/2008, 22:28   #12
 
Mouse>Pro's Avatar
 
elite*gold: 0
Join Date: Sep 2008
Posts: 142
Received Thanks: 89
nice
Mouse>Pro is offline  
Old 09/08/2008, 00:44   #13
 
taguro's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
Quote:
Originally Posted by Mouse>Pro View Post
nice
Changing NPC names is actually pretty easy, the unfortunate part is this: the only way to change the NPC name server wide is to send everyone an edited client. Even if you coded an NPC Changing name command in your script, it still wouldn't effect the individual clients on other peoples computer.
taguro is offline  
Old 09/08/2008, 11:31   #14
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
Quote:
Originally Posted by taguro View Post
Changing NPC names is actually pretty easy, the unfortunate part is this: the only way to change the NPC name server wide is to send everyone an edited client. Even if you coded an NPC Changing name command in your script, it still wouldn't effect the individual clients on other peoples computer.

Its acually ChangeName-NPC, the npc changes your name,not how to change an npc's name. lol
_Emme_ is offline  
Old 09/14/2008, 00:26   #15
 
© Haydz's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
Quote:
Originally Posted by emildayan1 View Post
Not possible on loft source if u aint gonna rewrite it all. The only server I know who got that,is hybrid co / acid co
hmm... :| i've had that for ages lul
© Haydz is offline  
Closed Thread


Similar Threads Similar Threads
Release- Rank Change Just for u lifesoshort
04/06/2015 - Soldier Front Hacks, Bots, Cheats & Exploits - 23 Replies
Here is my Own Rank Change All the High Ranks In the Bigging like The private is red captin and all of them keep going higher from trainne to 2nd lit gl guys. Download >>>> menu_001.sff Instructions: Replace the file menu 001. Make Sure To Copy One To Replace It Again After Each Update.
[Release]NPC To Change Jobs
02/15/2010 - CO2 PServer Guides & Releases - 9 Replies
iam a noob coder but here is my first steps in codeing hope u guys like it #region jobs changer case 301552: { if (Control == 0) {
[Release] Change Into A Monster NPC
10/22/2008 - CO2 Private Server - 7 Replies
hey my second release since i release " Real Broadcast (Same as in Real Co)" so i hope that this is a fun option for your server. Requirements: one of the lotf sources eyes hands first open the project from your source and go to client.cs, then search for; if (CurrentNPC == 6700) You will see the npc stuff and then add above that;
[Release] Size Change NPC
09/10/2008 - CO2 PServer Guides & Releases - 5 Replies
- In Client.cs under case 2031: where all the other NPCs are: - Now, under case 2032:, add this:
[Release] Change your IP address
07/10/2008 - Dekaron Exploits, Hacks, Bots, Tools & Macros - 10 Replies
I know some of you having problem connecting to the game. I had that problem as well but i tried this method to change my IP address and it works. Just change the extension to .bat (sample IpChanger.bat) after that run it. then turn off your router or modem for 5 mins. I hope this will help.. Good luck



All times are GMT +2. The time now is 17:22.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.