|
You last visited: Today at 17:22
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.
09/06/2008, 07:07
|
#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!
|
|
|
09/06/2008, 07:25
|
#2
|
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
|
Quote:
Originally Posted by kinshi88
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 =)
|
|
|
09/06/2008, 13:37
|
#3
|
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
|
|
|
09/06/2008, 21:01
|
#4
|
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
|
Nice^^
|
|
|
09/06/2008, 22:49
|
#5
|
elite*gold: 0
Join Date: Aug 2008
Posts: 77
Received Thanks: 63
|
thanks
|
|
|
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
|
|
|
09/07/2008, 02:47
|
#7
|
elite*gold: 0
Join Date: Aug 2008
Posts: 77
Received Thanks: 63
|
Quote:
Originally Posted by elragal_30
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);
}
|
|
|
09/07/2008, 10:40
|
#8
|
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
|
Quote:
Originally Posted by konkizta
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^^
|
|
|
09/07/2008, 11:42
|
#9
|
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
|
|
|
09/07/2008, 11:52
|
#10
|
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
|
****-.-
|
|
|
09/07/2008, 17:17
|
#11
|
elite*gold: 0
Join Date: Aug 2008
Posts: 77
Received Thanks: 63
|
Quote:
Originally Posted by lolmaster123
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
|
|
|
09/07/2008, 22:28
|
#12
|
elite*gold: 0
Join Date: Sep 2008
Posts: 142
Received Thanks: 89
|
nice
|
|
|
09/08/2008, 00:44
|
#13
|
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
|
Quote:
Originally Posted by Mouse>Pro
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.
|
|
|
09/08/2008, 11:31
|
#14
|
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
|
Quote:
Originally Posted by taguro
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
|
|
|
09/14/2008, 00:26
|
#15
|
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
|
Quote:
Originally Posted by emildayan1
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
|
|
|
|
|
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.
|
|