NPC locations are all coded in the database. To access the database, go into your browser and type
localhost/phpmyadmin.
After that, open up coproj sql server, and go to NPCs.
The UID is the number that the database looks for in your source to see what the NPC says.
Ex: UID is 3000, the NPC would start with: if (CurrentNPC == 3000), then what the npc says, etc.
Type is the NPC Mech ID (what the NPC looks like)
Name is obvious lol
Direction is what way the NPC is facing, default, use 2 =P
X is the first coordinate number in the game (find this when playing in the server)
Y is the second coordinate number in the game
(for center of tc: X = 438, Y = 377)
Map is the map ID where the NPC will be located (EX: 1002 for Twin City)
Dont worry about SobType, you wont need this anytime soon, just use 0.
And there! you have your NPC placed!
Now you gotta code what it says. Heres an example of a code that would give an item:
Code:
if (CurrentNPC == 3000)
{
SendPacket(General.MyPackets.NPCSay("Want a free awesome Item???"));
SendPacket(General.MyPackets.NPCLink("Yes!!!!!!!", 1));
SendPacket(General.MyPackets.NPCLink("No.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
Code:
if (CurrentNPC == 3000)
{
if (Control == 1)
{
MyChar.AddItem("130209-12-7-255-13-13", 0, (uint)General.Rand.Next(36457836));
SendPacket(General.MyPackets.NPCSay("Theres your awesome freakin Item baby!"));
SendPacket(General.MyPackets.NPCLink("Holy crap! Thank you lots dude!", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}
}
Btw, I just did this real quick =P