201 erros in C# lol xD

07/26/2010 11:37 2010mrsurfer#1
So ive started the npc for my 3rd rebirth quest, i have this so far (i think its right)

#region Jon the third rebirth NPC
case 5467:
{
if (Control ==0)
{
GC.AddSend(Packets.NPCSay("Hello young one, would you like to attempt the third rebirth quest? You need to be atleast level 140."));
GC.AddSend(Packets.NPCLink("Yes please!", 1));
GC.AddSend(Packets.NPCLink("Pfft no thanks, im not up for it.", 2));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish());
break;
}
#endregion

I add this then i added 5467 1200 2 0 1002 385 324 to the npcs.txt for the npc and when i go back into C# i check for errors and i get 8 errors... does anybody know why?

Also sorry i just checked and its gone down from 201 errors to 8 errors now for some reason...
07/26/2010 12:44 .Beatz#2
#region Jon the third rebirth NPC
case 5467:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Hello young one, would you like to attempt the third rebirth quest? You need to be atleast level 140."));
GC.AddSend(Packets.NPCLink("Yes please!", 1));
GC.AddSend(Packets.NPCLink("Pfft no thanks, im not up for it.", 2));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish());
} // This one closes this section of the dialog
break;
} // This closes the whole Dialog
#endregion

When you have opening { make sure you have closed them.

So case 7264:
{ < You open its here
if (Control == 0)
{ << Open it here

NPCFinish());
} < Close it here
break;
} < Close it here
07/26/2010 12:57 2010mrsurfer#3
Ahhhh thats simple, ive been trying to fix it for ages, big thanks mattyc :D
07/26/2010 15:05 Fish*#4
always make sure you got same { as }.
ex.
you got
case 292:
{//1
if (hehe = haha)
{//2

}//2
break;
}//1

for having 1 { and 1 } it should be:

case 292:
{//1

break;
}//1

For having 3, it should be:

case 292:
{//1
if (hehe = haha)
{//2
if (haha == hehe)
{//3

}//3
}//2
break;
}//1
07/26/2010 15:12 2010mrsurfer#5
Quote:
Originally Posted by grillmad View Post
always make sure you got same { as }.
ex.
you got
case 292:
{//1
if (hehe = haha)
{//2

}//2
break;
}//1

for having 1 { and 1 } it should be:

case 292:
{//1

break;
}//1

For having 3, it should be:

case 292:
{//1
if (hehe = haha)
{//2
if (haha == hehe)
{//3

}//3
}//2
break;
}//1
Thanks grill, ive made progress with this, ive got the start npc working and ive got a second npc sort of working, just a little confused on how to add a item into the players inventory, i also (think i did it right) edited a item in the items.txt and added it in the additem file as 8899 (is this right? changed some things around)
07/26/2010 15:15 Fish*#6
GC.MyChar.AddItem(ID, +);
07/26/2010 15:26 2010mrsurfer#7
Thanks :D