hmm Don't Flame im kinda learning.. yes i know its a simple npc.. just as i just stated im learning..
Quote:
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("If you pay me one dragonball, I can have your size changed. . "));
GC.AddSend(Packets.NPCLink("Here is a dragonball.", 2));
GC.AddSend(Packets.NPCLink("I have no dragonball.", 255));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
if (GC.MyChar.InventoryContains(1088000, 1))
{
for (byte i = 0; i < 1; i++)
GC.MyChar.RemoveItem(GC.MyChar.NextItem(1088000));
}
{
if (GC.MyChar.Body == 1004)
GC.MyChar.Body -= 1;
else if (GC.MyChar.Body == 1003)
GC.MyChar.Body += 1;
if (GC.MyChar.Body == 2002)
GC.MyChar.Body -= 1;
else if (GC.MyChar.Body == 2001)
GC.MyChar.Body += 1;
Missing somthing here?..=/
}
}
GC.AddSend(Packets.NPCSay("Sorry, you do not have a DragonBall."));
GC.AddSend(Packets.NPCLink("OK, I Know.", 255));
GC.AddSend(Packets.NPCSetFace(30));
GC.AddSend(Packets.NPCFinish());
{
break;
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("If you pay me one dragonball, I can have your size changed."));
GC.AddSend(Packets.NPCLink("Here is a dragonball.", 1));
GC.AddSend(Packets.NPCLink("I do not have a dragonball.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
if (GC.MyChar.InventoryContains(1088000, 1))
{
for (byte i = 0; i < 1; i++)
GC.MyChar.RemoveItem(GC.MyChar.NextItem(1088000));
{
if (GC.MyChar.Body == 1004)
GC.MyChar.Body -= 1;
else if (GC.MyChar.Body == 1003)
GC.MyChar.Body += 1;
if (GC.MyChar.Body == 2002)
GC.MyChar.Body -= 1;
else if (GC.MyChar.Body == 2001)
GC.MyChar.Body += 1;
}
else
{
GC.AddSend(Packets.NPCSay("Sorry, you do not have a DragonBall."));
GC.AddSend(Packets.NPCLink("OK, I Know.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
}
#endregion
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("If you pay me one dragonball, I can have your size changed."));
GC.AddSend(Packets.NPCLink("Here is a dragonball.", 1));
GC.AddSend(Packets.NPCLink("I do not have a dragonball.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
if (GC.MyChar.InventoryContains(1088000, 1))
{
for (byte i = 0; i < 1; i++)
GC.MyChar.RemoveItem(GC.MyChar.NextItem(1088000));
{
if (GC.MyChar.Body == 1004)
GC.MyChar.Body -= 1;
else if (GC.MyChar.Body == 1003)
GC.MyChar.Body += 1;
if (GC.MyChar.Body == 2002)
GC.MyChar.Body -= 1;
else if (GC.MyChar.Body == 2001)
GC.MyChar.Body += 1;
}
else
{
GC.AddSend(Packets.NPCSay("Sorry, you do not have a DragonBall."));
GC.AddSend(Packets.NPCLink("OK, I Know.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
break;
}
}
#endregion
This should work.
still 1 error.. giveing invalic expression term 'else'
if i remove that it gives control cannot be followed through from one case label to another..
As said it looks like your indentation is wrong (brackets)
So you know where you went wrong in the first one...
GC.AddSend(Packets.NPCLink("Here is a dragonball.", 2));
This line is saying that you are going to Control==2
In your code the actual code is 1...
You will want something structured like this
Code==0
{
initial npc text/options
}
Code==1
{
if inventory contains dragonball
{
remove db and do the actual code for changing sizes
{
else
{
no db option
}
}
That should be the indentation structure for it.
<edit>
At a second look you want to move the }'s up before the break.
Break indicated the END OF THE NPC You are not closing them in the order that they are opened. Think of each section of {} as a complete thought. Data is executed in the order they are opened so you need to close them in the same order. It will help if you look at them as saying "well this is starting this section of code... and here is where this section of code ends"" That will help you see them as unique symbols and see where you should be closing them.
As said it looks like your indentation is wrong (brackets)
So you know where you went wrong in the first one...
GC.AddSend(Packets.NPCLink("Here is a dragonball.", 2));
This line is saying that you are going to Control==2
In your code the actual code is 1...
You will want something structured like this
Code==0
{
initial npc text/options
}
Code==1
{
if inventory contains dragonball
{
remove db and do the actual code for changing sizes
{
else
{
no db option
}
}
That should be the indentation structure for it.
<edit>
At a second look you want to move the }'s up before the break.
Break indicated the END OF THE NPC You are not closing them in the order that they are opened. Think of each section of {} as a complete thought. Data is executed in the order they are opened so you need to close them in the same order. It will help if you look at them as saying "well this is starting this section of code... and here is where this section of code ends"" That will help you see them as unique symbols and see where you should be closing them.
Somone Can Help Me Please 03/12/2009 - Dekaron - 1 Replies Hello I play 2Moons and I am not successful to understand how to operate any Hack someone please can bring me link to hack and detailed explanation how to operate Hack that can help me to kill monster more quickly
Or which Hack that attracts\provoke the monsters to me
Like in this short movie:click here
Thank you in advance for all those who tries to help....
Somone Can Help Me Please 03/12/2009 - Dekaron - 3 Replies Hello I play 2Moons and I am not successful to understand how to operate any Hack someone please can bring me link to hack and detailed explanation how to operate Hack that can help me to kill monster more quickly
Or which Hack that attracts\provoke the monsters to me
Like in this short movie:click here
Thank you in advance for all those who tries to help....
Somone Can Help Me Please 03/12/2009 - Dekaron - 1 Replies Hello I play 2Moons and I am not successful to understand how to operate any Hack someone please can bring me link to hack and detailed explanation how to operate Hack that can help me to kill monster more quickly
Or which Hack that attracts\provoke the monsters to me
Like in this short movie:click here
Thank you in advance for all those who tries to help....
WILL SOMONE PLEASE HELP ME! 02/20/2009 - CO2 Private Server - 11 Replies Well. I followed mutiple Guides. I follwoed the MSQL Guide. I try to log in it sas connection interrupted re login. I tried the Hamachi one. It said the same when it tried to log in.
Please Help. I tried almost everything.I opened server and it said listeting. And said server stared sucessfully. Then i try to log in says connection interrupted please re-login
HELP MEP LEASE I HAVE 18 PPL WAITING TO GO ON MY SERVER.