[Release]Easier Npc System for LOTF

11/26/2009 11:18 Arcо#1
Well I don't know if this would count as a release but here it goes.
This is really easy,
I coded this in all of but 5 minutes.
Go to Client.cs and search for
Code:
public void SendPacket(byte[] Dat)
Right above that insert this code.
Code:
        public void Say(string text)
        {
            SendPacket(General.MyPackets.NPCSay(text));
        }
        public void Link(string text, byte option)
        {
            SendPacket(General.MyPackets.NPCLink(text, option));
        }
        public void Done(string text)
        {
            SendPacket(General.MyPackets.NPCLink(text, 255));
            SendPacket(General.MyPackets.NPCSetFace(30));
            SendPacket(General.MyPackets.NPCFinish());
        }
[Only registered and activated users can see links. Click Here To Register...]
After that instead of your npc's being built like this:
Code:
                            if (CurrentNPC == 123)
                            {
                                SendPacket(General.MyPackets.Say("NPC dialog"));
                                SendPacket(General.MyPackets.NPCLink("Option", 1));
                                SendPacket(General.MyPackets.NPCLink("Exit option", 255));
                                SendPacket(General.MyPackets.SetFace(30));
                                SendPacket(General.MyPackets.Finish());
                            }
They will be built like this:
Code:
                            if (CurrentNPC == 123)
                            {
                                Say("NPC Dialog"));
                                Link("Option", 1));
                                Done("Exit Option");
                            }
Hope this helps some of you.
Any questions post here.
11/26/2009 11:36 ~Yuki~#2
and where do u set the face and finish?

Make a complete tutorial -_-

Also this is already released 10 times.
11/26/2009 11:42 Arcо#3
Quote:
Originally Posted by ~Yuki~ View Post
and where do u set the face and finish?

Make a complete tutorial -_-

Also this is already released 10 times.
I have not seen this released at all and I am currently working on screenshots.

#EDIT:Screenshot put in.
Btw I would love some links to releases like this since it has been released 10 times already as you say.
11/26/2009 12:59 sawickas#4
Quote:
Originally Posted by Tiku View Post
Well I don't know if this would count as a release but here it goes.
This is really easy,
I coded this in all of but 5 minutes.
Go to Client.cs and search for
Code:
public void SendPacket(byte[] Dat)
Right above that insert this code.
Code:
        public void Say(string text)
        {
            SendPacket(General.MyPackets.NPCSay(text));
        }
        public void Link(string text, byte option)
        {
            SendPacket(General.MyPackets.NPCLink(text, option));
        }
        public void Done(string text)
        {
            SendPacket(General.MyPackets.NPCLink(text, 255));
            SendPacket(General.MyPackets.NPCSetFace(30));
            SendPacket(General.MyPackets.NPCFinish());
        }
[Only registered and activated users can see links. Click Here To Register...]
After that instead of your npc's being built like this:
Code:
                            if (CurrentNPC == 123)
                            {
                                SendPacket(General.MyPackets.Say("NPC dialog"));
                                SendPacket(General.MyPackets.NPCLink("Option", 1));
                                SendPacket(General.MyPackets.NPCLink("Exit option", 255));
                                SendPacket(General.MyPackets.SetFace(30));
                                SendPacket(General.MyPackets.Finish());
                            }
They will be built like this:
Code:
                            if (CurrentNPC == 123)
                            {
                                Say("NPC Dialog"));
                                Link("Option", 1));
                                Done("Exit Option");
                            }
Hope this helps some of you.
Any questions post here.


can yuo make it for 1565?
11/26/2009 15:53 Arcо#5
Quote:
Originally Posted by sawickas View Post
can yuo make it for 1565?
Show me how a 5165 Npc is built.
11/26/2009 16:55 sawickas#6
Quote:
Originally Posted by Tiku View Post
Show me how a 5165 Npc is built.
Ok



Quote:
#region MightyTao
case 35500:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("I am the mighty tao who teaches skills to those worthy reborn characters. So do you want to learn anything?"));
GC.AddSend(Packets.NPCLink("Teach me Summon Guard.", 1));
GC.AddSend(Packets.NPCLink("Nah. I'll just leave.", 255));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish());
}
else if (Control == 1)
{
if (GC.MyChar.Reborn)
GC.MyChar.NewSkill(new Game.Skill() { ID = 4000, Lvl = 0 });
}
break;
}
#endregion
11/26/2009 17:01 Arcо#7
Quote:
Originally Posted by sawickas View Post
Ok
Hmm well since I haven't personally looked at this 5165 source going around, I can't tell you exactly where to put this.
But here's what you need.
Code:
        public void Say(string text)
        {
            GC.AddSend(Packets.NPCSay(text));
        }
        public void Link(string text, byte option)
        {
            GC.AddSend(Packets.NPCLink(text, option));
        }
        public void Done(string text)
        {
            GC.AddSend(Packets.NPCLink(text, 255));
            GC.AddSend(Packets.NPCSetFace(30));
            GC.AddSend(Packets.NPCFinish());
        }
Hope this helps you sawickas.
11/26/2009 17:15 sawickas#8
Quote:
Originally Posted by Tiku View Post
Hmm well since I haven't personally looked at this 5165 source going around, I can't tell you exactly where to put this.
But here's what you need.
Code:
        public void Say(string text)
        {
            GC.AddSend(Packets.NPCSay(text));
        }
        public void Link(string text, byte option)
        {
            GC.AddSend(Packets.NPCLink(text, option));
        }
        public void Done(string text)
        {
            GC.AddSend(Packets.NPCLink(text, 255));
            GC.AddSend(Packets.NPCSetFace(30));
            GC.AddSend(Packets.NPCFinish());
        }
Hope this helps you sawickas.
can yuo plyz take look Here Link to source>>>>> [Only registered and activated users can see links. Click Here To Register...]
11/26/2009 17:17 Arcо#9
Quote:
Originally Posted by sawickas View Post
can yuo plyz take look Here Link to source>>>>> [Only registered and activated users can see links. Click Here To Register...]
I'm not downloading the entire source just so I can help one person.
If you upload the *.cs with all the npc stuff in it i'll be sure to take a look at it.
11/26/2009 17:35 sawickas#10
Quote:
Originally Posted by Tiku View Post
I'm not downloading the entire source just so I can help one person.
If you upload the *.cs with all the npc stuff in it i'll be sure to take a look at it.
ok
11/26/2009 17:48 Arcо#11
Quote:
Originally Posted by sawickas View Post
ok
Okay well I looked at it and your going to scroll all the way down to the bottom of NPCDialog.cs.
You will see
Code:
catch (Exception Exc) { Program.WriteLine(Exc); }
After the next }, that's where you're going to add the code
Code:
        public void Say(string text)
        {
            GC.AddSend(Packets.NPCSay(text));
        }
        public void Link(string text, byte option)
        {
            GC.AddSend(Packets.NPCLink(text, option));
        }
        public void Done(string text)
        {
            GC.AddSend(Packets.NPCLink(text, 255));
            GC.AddSend(Packets.NPCSetFace(30));
            GC.AddSend(Packets.NPCFinish());
        }
That should work.
I'll post a screenshot if it helps.
[Only registered and activated users can see links. Click Here To Register...]
11/26/2009 18:16 sawickas#12
Quote:
Originally Posted by Tiku View Post
Okay well I looked at it and your going to scroll all the way down to the bottom of NPCDialog.cs.
You will see
Code:
catch (Exception Exc) { Program.WriteLine(Exc); }
After the next }, that's where you're going to add the code
Code:
        public void Say(string text)
        {
            GC.AddSend(Packets.NPCSay(text));
        }
        public void Link(string text, byte option)
        {
            GC.AddSend(Packets.NPCLink(text, option));
        }
        public void Done(string text)
        {
            GC.AddSend(Packets.NPCLink(text, 255));
            GC.AddSend(Packets.NPCSetFace(30));
            GC.AddSend(Packets.NPCFinish());
        }
That should work.
I'll post a screenshot if it helps.
[Only registered and activated users can see links. Click Here To Register...]
Thanks
11/26/2009 18:18 Arcо#13
Quote:
Originally Posted by sawickas View Post
Thanks
Don't just say it.
Press it.
I'd appreciate it.
11/26/2009 18:18 sawickas#14
How i can make it Like in LOTF? Its posible?

I got problem in strukture
11/26/2009 18:19 Korvacs#15
Why are the methods placed in client.cs?