[Guide]Adding Npcs

07/17/2009 18:57 Jay1029#16
Can you make a guide on how to add an NPC in Visual C# for lotf. I want to know how to make a simple NPC that teleports you and simple NPC that gives you a +12 item. =p
07/17/2009 19:15 n0mansland#17
Why are you bumping all these old threads? This is for LOTF also.. I saw you've been messing with CoEmuV2 so was wondering if you knew.

LOTF:

Add Item Example with DB
Code:
MyChar.AddItem("1088001-0-0-0-0-0", 0, (uint)General.Rand.Next(36457836));
Teleport
Code:
MyChar.Teleport(MAP, X, Y);
CoEmuV2:
Add Item <-- Not sure if it's correct just an example

Code:
 AddItem("ID, 9, 2, 12, 7, 255 , 3, 0, 0, CSocket);
Teleport

Code:
 Teleport("MAP, X, Y, INSTANCE, CSocket);
07/17/2009 19:55 Jay1029#18
Yeah I'm working on both but LOTF seems easier for noobs like me. And I know I'm bumping a lot but I need info :p And I didn't pay attention to the date, muh bad>.>
and thanks for your examples=p
07/17/2009 20:34 m7med#19
is it for comeu v2
09/02/2009 11:47 Basser#20
bump because someone requested it, and I added this to my LOTF Releases thread.
09/02/2009 15:25 -Shunsui-#21
Ok after you made the NPCs in the database go ahead Open up your source with C# move to Client.cs Search From the top if (CurrentNPC == That should take you to the first NPC there is in your Client.cs wich is where u put the NPcs to talk On top of that to add a simple NPC
Quote:
if (CurrentNPC == 20)
{
Sendpacket(General.MyPackets.NPCSay("Hey there I Can Send You to A Location A Secret Plaace [:"));
SendPacket(General.myPackets.NPCLink("Ok Take me there", 1));
SendPacket(General.MyPackets.MPCLink("Nah I Dont Trust You", 255));
SendPacket(General.MyPackets.NPCSetFace(154));
SendPacket(General.MyPackets.NPCFinish());
That was just to make him Talk Ok Now look at the NPC UID that you added that one on top of So if its 200 You Search if (CurrentNPC == 200) and it should take you to the controls wich are hes actions
On Top Of it Add
Quote:
if (CurrentNPC == 20)
{
if (Control == 1)
{
MyChar.Teleport(1036, 211, 196);
}
}
Well It should work just fix my Mistakes i know theres alot did it verry quick was doing something ;)[