[Help] coding for dummies :P

01/13/2010 16:57 w.maatman#1
hello,

im trying to set up my own private server and i could use some help :P

i got a few questions u might could help me with.

I got a 5165 server with korolos3 source.

so my questions are :

1. How to edit the chat of a npc with C# ? i tried to edit the cpadmin by getting rid of the trade of 500k money for 5k cps but i failed :P
Quote:
#region korolos cpadmin
case 1524230:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hallow i am CPS Admin here to exchang Dragonsball and dbscroll for cps and exchang silvers for cps say thanks to korolos he make me."));
GC.AddSend(Packets.NPCLink("Dragonball for (215 cps)", 4));
GC.AddSend(Packets.NPCLink("Dragonball scroll for (2150 cps) ", 5));
GC.AddSend(Packets.NPCLink("Me doesnt have DBs, gimme plx", 255));
GC.AddSend(Packets.NPCSetFace(50));
GC.AddSend(Packets.NPCFinish());
}
else if (GC.MyChar.Inventory.Count < 40)
{

if (Control == 4)
{
if (GC.MyChar.InventoryContains(1088000, 1))
{
GC.MyChar.RemoveItem(GC.MyChar.NextItem(1088000));
GC.MyChar.CPs += 215;
GC.AddSend(Packets.NPCSay("You have have got 215 cps"));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else
{
GC.AddSend(Packets.NPCSay("You don't have enough Dragonball."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
else if (Control == 5)
{
if (GC.MyChar.InventoryContains(720028, 1))
{
GC.MyChar.RemoveItem(GC.MyChar.NextItem(720028));
GC.MyChar.CPs += 2150;
GC.AddSend(Packets.NPCSay("You have got 2150 cps"));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
else
{
GC.AddSend(Packets.NPCSay("You don't dbscroll."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
this is what i got now..

2. how to create an extra map wich i can put special monsters in with a npc.

if im getting more questions ill post them here.

peace,
W.Maatman
01/13/2010 18:26 xScott#2
Code:
GC.AddSend(Packets.NPCSay("Hallow i am CPS Admin here to exchang Dragonsball and dbscroll for cps and exchang silvers for cps say thanks to korolos he make me."));
See where it says Packets.NPCSay?
Thats what the NPC says, change the text in the qoutes to change the text :)

Code:
GC.AddSend(Packets.NPCSay("Your Text Here"));
01/14/2010 13:38 w.maatman#3
okey, but it if i change the dialog it seems like it doesnt change in my client :S

how comes :S

Code:
#region korolos cpadmin
case 1524230:
{
    if (Control == 0)
    {
        GC.AddSend(Packets.NPCSay("Hallow i am   CPS  Admin  here to exchang Dragonsball and dbscroll for cps and exchang silvers for cps say thanks to korolos he make me."));
        GC.AddSend(Packets.NPCLink("Dragonball for (215 cps)", 4));
        GC.AddSend(Packets.NPCLink("Dragonball scroll for (2150 cps) ", 5));
        GC.AddSend(Packets.NPCLink("500k silver for (5k cps) ", 6));
        GC.AddSend(Packets.NPCLink("Just passing by.", 255));
        GC.AddSend(Packets.NPCSetFace(50));
        GC.AddSend(Packets.NPCFinish());
    }
    else if (GC.MyChar.Inventory.Count < 40)
    {

        if (Control == 4)
        {
            if (GC.MyChar.InventoryContains(1088000, 1))
            {
                GC.MyChar.RemoveItem(GC.MyChar.NextItem(1088000));
                GC.MyChar.CPs += 215;
                GC.AddSend(Packets.NPCSay("You have have got 215 cps"));
                GC.AddSend(Packets.NPCLink("Thanks.", 255));
                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                GC.AddSend(Packets.NPCFinish());
            }
            else
            {
                GC.AddSend(Packets.NPCSay("You don't have enough Dragonball."));
                GC.AddSend(Packets.NPCLink("I see.", 255));
                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                GC.AddSend(Packets.NPCFinish());
            }
        }
        else if (Control == 5)
        {
            if (GC.MyChar.InventoryContains(720028, 1))
            {
                GC.MyChar.RemoveItem(GC.MyChar.NextItem(720028));
                GC.MyChar.CPs += 2150;
                GC.AddSend(Packets.NPCSay("You have got 2150 cps"));
                GC.AddSend(Packets.NPCLink("Thanks.", 255));
                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                GC.AddSend(Packets.NPCFinish());
            }
            else
            {
                GC.AddSend(Packets.NPCSay("You don't dbscroll."));
                GC.AddSend(Packets.NPCLink("I see.", 255));
                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                GC.AddSend(Packets.NPCFinish());
            }
        }
        else if (Control == 6)
        {
            if (GC.MyChar.Silvers >= 500000)
            {
                GC.MyChar.Silvers -= 500000;
                GC.MyChar.CPs += 5000;
                GC.AddSend(Packets.NPCSay("You have got 5k cps say thanks to korolos"));
                GC.AddSend(Packets.NPCLink("Thanks.", 255));
                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                GC.AddSend(Packets.NPCFinish());
            }
            else
            {
                GC.AddSend(Packets.NPCSay("You don't have enough silvers."));
                GC.AddSend(Packets.NPCLink("I see.", 255));
                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                GC.AddSend(Packets.NPCFinish());
            }
        }
    }

    else
    {
        GC.AddSend(Packets.NPCSay("Im sorry you  dont  have nothing"));
        GC.AddSend(Packets.NPCLink("I see.", 255));
        GC.AddSend(Packets.NPCSetFace(N.Avatar));
        GC.AddSend(Packets.NPCFinish());
    }
    break;

i want this to be editted to the normal cpadmin...
01/14/2010 14:22 .Kob#4
You need press f5 for compile <.<'
01/14/2010 15:22 w.maatman#5
so if i want to get rid off:

Code:
     else if (Control == 6)
        {
            if (GC.MyChar.Silvers >= 500000)
            {
                GC.MyChar.Silvers -= 500000;
                GC.MyChar.CPs += 5000;
                GC.AddSend(Packets.NPCSay("You have got 5k cps say thanks to korolos"));
                GC.AddSend(Packets.NPCLink("Thanks.", 255));
                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                GC.AddSend(Packets.NPCFinish());
            }
            else
            {
                GC.AddSend(Packets.NPCSay("You don't have enough silvers."));
                GC.AddSend(Packets.NPCLink("I see.", 255));
                GC.AddSend(Packets.NPCSetFace(N.Avatar));
                GC.AddSend(Packets.NPCFinish());
            }
        }
    }
i just have to press f6 to build, then press delete to delete it then f5 to debug and compile ?
01/14/2010 15:30 pro4never#6
You shouldn't need to build (assuming you are running your debug copy anyways)

Change the script around to how you want it to be ingame, close the server (if it is running), debug (f5), restart server, login with your client and the npc should be updated.
01/14/2010 21:44 w.maatman#7
allright, i got that working now

but how can i create a new map like dis city with special level monsters ??
01/15/2010 19:44 Basser#8
Quote:
Originally Posted by w.maatman View Post
allright, i got that working now

but how can i create a new map like dis city with special level monsters ??
I would pick a random map which your not using and with enough space, than in the database add the monsters and or spawns. Not that hard is it?
01/15/2010 19:46 pro4never#9
I think he is talking about adding a new/clone of a map. I know clone maps are possible by re-using the .dmaps or something but I have no idea in practice how to go about it so can't really help there.

As said though, there are ALOT of un-used maps and quite a few copies. Find one that suits your quest and add some spawns there, then worry about drops, npcs, quest functions and all that good stuff later.
01/15/2010 19:48 Basser#10
Quote:
Originally Posted by pro4never View Post
I think he is talking about adding a new/clone of a map. I know clone maps are possible by re-using the .dmaps or something but I have no idea in practice how to go about it so can't really help there.

As said though, there are ALOT of un-used maps and quite a few copies. Find one that suits your quest and add some spawns there, then worry about drops, npcs, quest functions and all that good stuff later.
Seriously, creating a new map is probably just a matter of copying, editing and renaming files.