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!
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!
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.
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
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