[Release]Another Labyrinth NPC Code Pay with CPs to Enter Lab 1-4

02/02/2010 20:01 JKdeVille#1
This NPC let enter you to Lab 1-4 for CPs
I added a Guide how to change the Price´s


Code:
case 1152:
{
    if (Control == 0)
    {
        GC.AddSend(Packets.NPCSay("Hey do you wish to Teleport to Labyrinth ? It will Cost you for Lab 1 ( 20 CPs ) Lab 2 ( 100 CPs ) Lab 3 ( 200 CPs) Lab 4 ( 500 CPs )."));
        GC.AddSend(Packets.NPCLink("Lab 1", 1));
        GC.AddSend(Packets.NPCLink("Lab 2", 2));
        GC.AddSend(Packets.NPCLink("Lab 3", 3));
        GC.AddSend(Packets.NPCLink("Lab 4", 4));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    if (Control == 1)
    {
        if (GC.MyChar.CPs >= 20)
        {
            GC.MyChar.CPs -= 20;
            GC.MyChar.Teleport(1351, 015, 127);
            GC.AddSend(Packets.NPCSay("Here you are."));
            GC.AddSend(Packets.NPCLink("Thanks.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    else if (Control == 2)
    {
        if (GC.MyChar.CPs >= 100)
        {
            GC.MyChar.CPs -= 20;
            GC.MyChar.Teleport(1352, 029, 230);
            GC.AddSend(Packets.NPCSay("Here you are."));
            GC.AddSend(Packets.NPCLink("Thanks.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    else if (Control == 3)
    {
        if (GC.MyChar.CPs >= 200)
        {
            GC.MyChar.CPs -= 200;
            GC.MyChar.Teleport(1353, 028, 270);
            GC.AddSend(Packets.NPCSay("Here you are."));
            GC.AddSend(Packets.NPCLink("Thanks.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    else if (Control == 4)
            {
        if (GC.MyChar.CPs >= 500)
        {
            GC.MyChar.CPs -= 500;
            GC.MyChar.Teleport(1354, 009, 290);
            GC.AddSend(Packets.NPCSay("Here you are."));
            GC.AddSend(Packets.NPCLink("Thanks.", 255));
            GC.AddSend(Packets.NPCSetFace(N.Avatar));
            GC.AddSend(Packets.NPCFinish());
        }
    }
    break;
}

To Change the CPs Prices u need only to change this

if (GC.MyChar.CPs >= 500)
{
GC.MyChar.CPs -= 500;

Like to

if (GC.MyChar.CPs >= 444)
{
GC.MyChar.CPs -= 444;

Now the People have to Pay 444 CPs for entering Lab 4

Say Thanks If you Like My first Release ^^
02/05/2010 14:51 hawas80#2
thnexx
03/09/2010 18:32 DemonicCo#3
Not bad for a first release. It was good. You could have showed alittle guide to where to put this for people that are first starting out. Otherwise good. ;)
03/09/2010 18:44 Arcо#4
Quote:
Originally Posted by 6Sh00ter View Post
Ain't it supposed to have a #region/#endregion?
It doesn't need to, but it keeps it organized.
03/10/2010 02:14 killersub#5
a little one of my newbie tips XD...don't forget your else statements....like you don't need them but it keeps the server managed in an orderly way imo...Example:
Code:
else
    {
        GC.AddSend(Packets.NPCSay("You don't have the required CPs, please come back when you have them!"));
        GC.AddSend(Packets.NPCLink("I see.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }

just an example you know...:) anyways +k since it's your first release...!
03/10/2010 18:03 jasonk1980#6
ummm where exactly would i put this code at cause i am a noob lol
03/10/2010 18:04 Korvacs#7
In with the rest of your Npc Dialogs
03/10/2010 18:18 jasonk1980#8
so in NPCtalk.cs in the client file then?
03/10/2010 18:41 jasonk1980#9
oj nvm i found the NPCDialogue.cs file and added that in but it didnt do anything for simon is there something particular i have to do. Because when i try and use him in game it says "hi i dont talk anything useful yet my id is 1152" and that is after i added in the code. Do i need to have #region Simon before the case number?