Register for your free account! | Forgot your password?

You last visited: Today at 13:16

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement

Coding npc(last question)

Discussion on Coding npc(last question) within the CO2 PServer - Discussions / Questions forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
Coding npc(last question)

hi, i have conquer pserver,

i need a video who show me all the steps of changing the price of an npc( breeder for exemple)

pelase guys, i know it's a lot but i'm so needding it


thanks



sohaib is offline  
Old 06/13/2010, 22:55   #2
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,269
if (GC.MyChar.CPs >= PriceYouWant)
{
GC.MyChar.CPs -= PriceYouWant;
}


Arcо is offline  
Thanks
3 Users
Old 06/14/2010, 11:01   #3
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
case 300091:\par
\{\par
if (Control == 0)\par
\{\par
GC.AddSend(Packets.NPCSay("Welcome to the pinoySeller, we sell +7 and +8 stones here.By Nazih "));\par
GC.AddSend(Packets.NPCLink("Cool let me in.", 1));\par
GC.AddSend(Packets.NPCLink("Haa Ok Then", 255));\par
GC.AddSend(Packets.NPCSetFace(N.Avatar));\par
GC.AddSend(Packets.NPCFinish());\par
\}\par
if (Control == 1)\par
\{\par
GC.AddSend(Packets.NPCSay("Are you interested in any of these Items?"));\par
GC.AddSend(Packets.NPCLink("+7 stone - 5100 Cps", 2));\par
GC.AddSend(Packets.NPCLink("+8 stone- 20000 Cps", 3));\par
GC.AddSend(Packets.NPCLink("LifeFuit basaket- 100 CPs", 4));\par
GC.AddSend(Packets.NPCLink("No, thanks.", 255));\par
GC.AddSend(Packets.NPCSetFace(22));\par
GC.AddSend(Packets.NPCFinish());\par
\}\par
\par
if (GC.MyChar.Level <= 69)\par
\{\par
GC.AddSend(Packets.NPCSay("Welcome to the pinoySeller, we sell special items here !! But ur not have lvl 70 yet!"));\par
GC.AddSend(Packets.NPCLink("Damn.", 255));\par
GC.AddSend(Packets.NPCSetFace(N.Avatar));\par
GC.AddSend(Packets.NPCFinish());\par
\'14 \}\par
\par
if (Control == 2)\par
\{\par
if (GC.MyChar.CPs >= 5100)\par
\{\par
GC.MyChar.CPs -= 5400;\par
GC.MyChar.AddItem(730007, 7);\par
GC.AddSend(Packets.NPCSay("Here you are."));\par
GC.AddSend(Packets.NPCLink("Thanks.", 255));\par
GC.AddSend(Packets.NPCSetFace(N.Avatar));\par
GC.AddSend(Packets.NPCFinish());\par
\}\par
else\par
\{\par
GC.AddSend(Packets.NPCSay("You don't have enough Cps."));\par
GC.AddSend(Packets.NPCLink("I see.", 255));\par
GC.AddSend(Packets.NPCSetFace(N.Avatar));\par
GC.AddSend(Packets.NPCFinish());\par
\}\par
\}\par
if (Control == 3)\par
\{\par
if (GC.MyChar.CPs >= 20000)\par
\{\par
GC.MyChar.CPs -= 20000;\par
GC.MyChar.AddItem(730008, 8);\par
GC.AddSend(Packets.NPCSay("Here you are."));\par
GC.AddSend(Packets.NPCLink("Thanks.", 255));\par
GC.AddSend(Packets.NPCSetFace(N.Avatar));\par
GC.AddSend(Packets.NPCFinish());\par
\}\par
else\par
\{\par
GC.AddSend(Packets.NPCSay("You don't have enough Cps."));\par
GC.AddSend(Packets.NPCLink("I see.", 255));\par
GC.AddSend(Packets.NPCSetFace(N.Avatar));\par
GC.AddSend(Packets.NPCFinish());\par
\}\par
\}\par
\par
if (Control == 4)\par
\{\par
if (GC.MyChar.CPs >= 100)\par
\{\par
GC.MyChar.CPs -= 100;\par
GC.MyChar.AddItem(723725);\par
GC.AddSend(Packets.NPCSay("Here you are."));\par
GC.AddSend(Packets.NPCLink("Thanks.", 255));\par
GC.AddSend(Packets.NPCSetFace(N.Avatar));\par
GC.AddSend(Packets.NPCFinish());\par
\}\par
else\par
\{\par
GC.AddSend(Packets.NPCSay("You don't have enough Cps."));\par
GC.AddSend(Packets.NPCLink("I see.", 255));\par
GC.AddSend(Packets.NPCSetFace(N.Avatar));\par
GC.AddSend(Packets.NPCFinish());\par
\}\par
\}\par
\par
break;\par
\}\par
#endregion\par


is the code right?
sohaib is offline  
Old 06/14/2010, 11:04   #4
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
after that, i press F6 and F5, and the server turn On, so i login but , Nothing changet


sohaib is offline  
Old 06/14/2010, 13:30   #5
 
elite*gold: 0
Join Date: Sep 2008
Posts: 494
Received Thanks: 120
omg ur npc is so messed up why have u added useles shit "/par" o.O
here is the working npc
Quote:
#region sohaib npc
case 300091:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Welcome to the pinoySeller, we sell +7 and +8 stones here.By Nazih "));
GC.AddSend(Packets.NPCLink("Cool let me in.", 1));
GC.AddSend(Packets.NPCLink("Haa Ok Then", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
GC.AddSend(Packets.NPCSay("Are you interested in any of these Items?"));
GC.AddSend(Packets.NPCLink("+7 stone - 5100 Cps", 2));
GC.AddSend(Packets.NPCLink("+8 stone - 20000 Cps", 3));
GC.AddSend(Packets.NPCLink("LifeFuit basket - 100 CPs", 4));
GC.AddSend(Packets.NPCLink("No, thanks.", 255));
GC.AddSend(Packets.NPCSetFace(22));
GC.AddSend(Packets.NPCFinish());
}

if (GC.MyChar.Level <= 69)
{
GC.AddSend(Packets.NPCSay("Welcome to the pinoySeller, we sell special items here !! But ur not have lvl 70 yet!"));
GC.AddSend(Packets.NPCLink("Damn.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}

if (Control == 2)
{
if (GC.MyChar.CPs >= 5100)
{
GC.MyChar.CPs -= 5100;
GC.MyChar.AddItem(730007);
GC.AddSend(Packets.NPCSay("Here you are."));
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 Cps."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
if (Control == 3)
{
if (GC.MyChar.CPs >= 20000)
{
GC.MyChar.CPs -= 20000;
GC.MyChar.AddItem(730008);
GC.AddSend(Packets.NPCSay("Here you are."));
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 Cps."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}

if (Control == 4)
{
if (GC.MyChar.CPs >= 100)
{
GC.MyChar.CPs -= 100;
GC.MyChar.AddItem(723725);
GC.AddSend(Packets.NPCSay("Here you are."));
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 Cps."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}

break;
}
#endregion
Adziunia is offline  
Thanks
1 User
Old 06/14/2010, 17:54   #6
 
elite*gold: 0
Join Date: Jun 2010
Posts: 95
Received Thanks: 11
urs messed to, cuz u used quote
Code:
#region sohaib npc
case 300091:
{
if (Control == 0)
{
GC.AddSend(Packets.NPCSay("Welcome to the pinoySeller, we sell +7 and +8 stones here.By Nazih "));
GC.AddSend(Packets.NPCLink("Cool let me in.", 1));
GC.AddSend(Packets.NPCLink("Haa Ok Then", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 1)
{
GC.AddSend(Packets.NPCSay("Are you interested in any of these Items?"));
GC.AddSend(Packets.NPCLink("+7 stone - 5100 Cps", 2));
GC.AddSend(Packets.NPCLink("+8 stone - 20000 Cps", 3));
GC.AddSend(Packets.NPCLink("LifeFuit basket - 100 CPs", 4));
GC.AddSend(Packets.NPCLink("No, thanks.", 255));
GC.AddSend(Packets.NPCSetFace(22));
GC.AddSend(Packets.NPCFinish());
}
if (GC.MyChar.Level <= 69)
{
GC.AddSend(Packets.NPCSay("Welcome to the pinoySeller, we sell special items here !! But ur not have lvl 70 yet!"));
GC.AddSend(Packets.NPCLink("Damn.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
if (Control == 2)
{
if (GC.MyChar.CPs >= 5100)
{
GC.MyChar.CPs -= 5100;
GC.MyChar.AddItem(730007);
GC.AddSend(Packets.NPCSay("Here you are."));
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 Cps."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
if (Control == 3)
{
if (GC.MyChar.CPs >= 20000)
{
GC.MyChar.CPs -= 20000;
GC.MyChar.AddItem(730008);
GC.AddSend(Packets.NPCSay("Here you are."));
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 Cps."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
if (Control == 4)
{
if (GC.MyChar.CPs >= 100)
{
GC.MyChar.CPs -= 100;
GC.MyChar.AddItem(723725);
GC.AddSend(Packets.NPCSay("Here you are."));
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 Cps."));
GC.AddSend(Packets.NPCLink("I see.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
break;
}
#endregion
xStylo is offline  
Old 06/14/2010, 18:15   #7
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,318
Note... he just said breeder as an example so he'd know how to change prices and stuff himself...


But yah..

If it's a SHOP you edit the shop.dat file (guides have been posted, search), if it's an npc you edit the code itself to change the cost, perform a check to see if the user has enough money/cp

if GC.MyChar.CPs > cost)
GC.MyChar.CPs -= cost;

something like that.
pro4never is offline  
Old 06/14/2010, 19:05   #8
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
nooooooo, it's not a shop, it's an npc who speak ,

i mean he say, +12Steed for 1kkcps, not like VIP shot and blacksmith

and, Adziunia all me .cs folders have "/par" things
sohaib is offline  
Old 06/14/2010, 20:16   #9
 
elite*gold: 111
Join Date: Feb 2008
Posts: 2,161
Received Thanks: 646
As long as it doesn't throw you errors you don't have to use it. That should be obvious.
~*NewDuuDe*~ is offline  
Old 06/14/2010, 20:54   #10
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
ohhhh **** my server

so what can i do to add npc normally, **** my life, **** the Luck, **** this ****** life, **** my work, **** the bugs, and **** my self
sohaib is offline  
Thanks
2 Users
Old 06/15/2010, 02:55   #11
 
elite*gold: 0
Join Date: Jun 2010
Posts: 95
Received Thanks: 11
Quote:
Originally Posted by sohaib View Post
nooooooo, it's not a shop, it's an npc who speak ,

i mean he say, +12Steed for 1kkcps, not like VIP shot and blacksmith

and, Adziunia all me .cs folders have "/par" things
why?????????????
wtf you did??
xStylo is offline  
Thanks
1 User
Old 06/15/2010, 07:44   #12
 
elite*gold: 20
Join Date: May 2007
Posts: 1,122
Received Thanks: 330
You guys are subtracting CPs server-side, but what about updating the client? x_x
LetterX is offline  
Old 06/15/2010, 07:54   #13
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,740
Received Thanks: 5,269
Quote:
Originally Posted by LetterX View Post
You guys are subtracting CPs server-side, but what about updating the client? x_x
The 5165 source does that automatically.
Arcо is offline  
Thanks
2 Users
Old 06/15/2010, 16:22   #14
 
elite*gold: 0
Join Date: Sep 2008
Posts: 494
Received Thanks: 120
Quote:
Originally Posted by sohaib
nooooooo, it's not a shop, it's an npc who speak ,

i mean he say, +12Steed for 1kkcps, not like VIP shot and blacksmith

and, Adziunia all me .cs folders have "/par" things
then u SHOULD delete that /par why u added it :O
Adziunia is offline  
Old 06/15/2010, 17:52   #15
 
elite*gold: 0
Join Date: Jun 2010
Posts: 95
Received Thanks: 11
he added /par to his whole source.
wtf!


xStylo is offline  
Thanks
1 User
Reply



« 5207 Fixed Databese | load »

Similar Threads
[Question] for coding part ...
12/31/2009 - Dekaron Private Server - 2 Replies
If skill name part or etc. files passes over 255 line at present, error becomes. Is it that is so because byte coding is measure?
[QUESTION] Coding Portals
06/29/2009 - CO2 PServer - Discussions / Questions - 25 Replies
Can someone like give me a hint how to code Portals into the source?
Coding Question Only Answers NO FLAMING
07/05/2008 - CO2 Main - Discussions / Questions - 2 Replies
Ok I am still working on my pvp server to make it a lvl server so my question is how to delet all commands? exepct skills and profs,job but the stuff and lvl commands if u need more info just ask AND THIS POST IS MADE TO GET AN ANSWER NOT TO GET FLAMED LIKE "wath a noob coder" and shit thank u any way. Other Question IS i got the lvl rates to work but how to add drops if needed more info pm me
Question About Coding...
07/03/2008 - CO2 Main - Discussions / Questions - 12 Replies
Ok I Need Sum Help With A PvP Server It Has infinity Stamina taths noth the probleem but HERC is (they spam it like hell ) How Could Our Team Delet Skill "Herc" or make the command admin Thx For Help If u Wanne Join Us go TO DragonCO :P



All times are GMT +1. The time now is 13:16.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

BTC: 3KeUpz52VCbhmLwuwydqxu6U1xsgbT8YT5
ETH: 0xc6ec801B7563A4376751F33b0573308aDa611E05

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2019 elitepvpers All Rights Reserved.