PK arena npc

11/04/2008 18:50 Valkmax#1
I thought id help cause I couldn't find any release of this and in the loft source I have it was not there.

First Follow the npc guide in the all in 1 thread by plasma-hand

Once your npc is made
Open your source do ctrl + g 955
Go right below the comment */ type this in
Code:
if (CurrentNPC == NPCUIDHERE)
                            
                         {
                            SendPacket(General.MyPackets.NPCSay("Hello,Would you like to enter the PK arena."));
                            SendPacket(General.MyPackets.NPCLink("Yes please.", 1));
                            SendPacket(General.MyPackets.NPCLink("No thanks.", 255));
                            SendPacket(General.MyPackets.NPCSetFace(30));
                            SendPacket(General.MyPackets.NPCFinish());
                          }
Ctrl + g again to 1967
And type this in
Code:
if (CurrentNPC == NPCUIDHERE)
      {
         if (Control == 1)
      {
         MyChar.Teleport(1005, 52, 69);
                                    
      }
         if (Control == 2)
     {
         SendPacket(General.MyPackets.NPCSay("Good Bye"));
     }
     
    }
Hope this helps, and if my coding is bad it cause I don't know any C at all this was just using my brain to find the things I needed cause they were not all in one place for me to use.

Hope this helps

p.s
If you don't want me sending people to your guide plasma-hand let me know and I will make a guide on making a npc
11/04/2008 19:04 _Emme_#2
Quote:
if (CurrentNPC == NPCUID)

{
SendPacket(General.MyPackets.NPCSay("Hello " + MyChar.Name + ". Like to enter PK arena for a fee of 50 silvers?"));
SendPacket(General.MyPackets.NPCLink("Yes please.", 1));
SendPacket(General.MyPackets.NPCLink("No thanks.", 255));
SendPacket(General.MyPackets.NPCSetFace(30));
SendPacket(General.MyPackets.NPCFinish());
}


Quote:
if (CurrentNPC == NPCUID)
{
if (Control == 1)
{
if (MyChar.Silvers >= 50)
{
MyChar.Silvers -= 50;
MyChar.Teleport(1005, 52, 69);
SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));


}
}


}

Thats how I would do it.
11/04/2008 19:24 tanelipe#3
I wouldn't do it like this
Code:
if (MyChar.Silvers >= 50;
Might want to replace the ' ; ' with ')'
11/04/2008 19:30 tao4229#4
And MyChar.Silvers -= 50.. Unless you just want them to have 50 silvers instead of removing them...
11/04/2008 19:58 Valkmax#5
Thanks for the tips =)
11/04/2008 20:56 _Emme_#6
Oh shit,my bad. #Updated