Register for your free account! | Forgot your password?

You last visited: Today at 20:33

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

Advertisement



[Release]2 NPCS

Discussion on [Release]2 NPCS within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
ih8you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 146
Received Thanks: 38
[Release]2 NPCS

Hi its me again

Flame will be Reported

I Coded these 100% Myself

The NPCS are, CP admin and A Npc that trades gold for cps and cps for gold. Both tested on a LOTF source 100% work

First CP Admin

Code:
                            if (CurrentNPC == 1234)
                            {
                                SendPacket(General.MyPackets.NPCSay("Hi, " + MyChar.Name +  " Would you like to trade a DragonBall for 215 cps or a DBScroll for 2150 cps?"));
                                SendPacket(General.MyPackets.NPCLink("I would Like to trade a DragonBall for 215cps.", 1));
                                SendPacket(General.MyPackets.NPCLink("I would Like to trade a DBScroll for 2150 cps.", 2));
                                SendPacket(General.MyPackets.NPCLink("No thanks.", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
And Controls...
Code:
                            if (CurrentNPC == 1234)
                            {
                                if (Control == 1)
                                {
                                    if (MyChar.InventoryContains(1088000, 1))
                                    {
                                        MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        MyChar.CPs += 215;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 215 cps. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have a DragonBall"));
                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
                                if (Control == 2)
                                {
                                    if (MyChar.InventoryContains(720028, 1))
                                    {
                                        MyChar.RemoveItem(MyChar.ItemNext(720028));
                                        MyChar.CPs += 2150;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 2150 cps. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have a DbScroll"));                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
Now For the gold to cps and cps to gold NPC

Code:
                            if (CurrentNPC == 2345)
                            {
                                SendPacket(General.MyPackets.NPCSay("Hi, " + MyChar.Name + " Would you like to trade 400 cps for 400k or 400k for 400cps?"));
                                 SendPacket(General.MyPackets.NPCLink("I would Like 400cps please", 1));
                                SendPacket(General.MyPackets.NPCLink("I would Like 400k please",  2));
                                SendPacket(General.MyPackets.NPCLink("No thanks", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
And controls ...

Code:
                            if (CurrentNPC == 2345)
                            {
                                if (Control == 1)
                                {
                                    if (MyChar.Silvers >= 400000)
                                    {
                                        MyChar.Silvers -= 400000;
                                        MyChar.CPs += 400;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 400 cps. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have 400k"));
                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
                                if (Control == 2)
                                {
                                    if (MyChar.CPs >= 400)
                                    {
                                        MyChar.CPs -= 400;
                                        MyChar.Silvers += 400000;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 400k. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have 400cps"));
                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
Tell me if The Controls are the wrong way around xD
Press Thanks!!
ih8you is offline  
Thanks
2 Users
Old 05/23/2009, 20:14   #2
 
$HaDoW's Avatar
 
elite*gold: 0
Join Date: Sep 2007
Posts: 285
Received Thanks: 78
simple I have a better one ^_^ but this will wokr perftect for newbies ^_^
Good Job Btw update this
it should be "Sorry, You dont have a DbScroll"
$HaDoW is offline  
Old 05/23/2009, 20:20   #3
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 1,001
Change this
PHP Code:
if (MyChar.CPs == 400
to
PHP Code:
if (MyChar.CPs >= 400
And it'll work 105%
tanelipe is offline  
Old 05/23/2009, 20:24   #4
 
ih8you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 146
Received Thanks: 38
Quote:
Originally Posted by tanelipe View Post
Change this
PHP Code:
if (MyChar.CPs == 400
to
PHP Code:
if (MyChar.CPs >= 400
And it'll work 105%
ok, should i do it to of (MyChar.Silvers >= 400000) too

Quote:
Originally Posted by $HaDoW View Post
simple I have a better one ^_^ but this will wokr perftect for newbies ^_^
Good Job Btw update this
it should be "Sorry, You dont have a DbScroll"
kk and ty, I'm only just learning how to code, not that good yet
ih8you is offline  
Old 05/23/2009, 20:27   #5
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 1,001
Yes.
tanelipe is offline  
Old 05/23/2009, 20:28   #6
 
ih8you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 146
Received Thanks: 38
Did it, Thanks
ih8you is offline  
Old 05/23/2009, 21:27   #7
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,922
Received Thanks: 491
good release =] , and anyone who says he didnt code the cp admin then let me tell you this... try doing cp admin and click no for the control on a regular LOTF it will still take your db =]

+k even though i wont use lol good release though
PeTe Ninja is offline  
Old 05/23/2009, 22:39   #8
 
ih8you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 146
Received Thanks: 38
Quote:
Originally Posted by PeTe Ninja View Post
good release =] , and anyone who says he didnt code the cp admin then let me tell you this... try doing cp admin and click no for the control on a regular LOTF it will still take your db =]

+k even though i wont use lol good release though
Woo Thanks, I got no idea what to do next though =S
ih8you is offline  
Old 05/23/2009, 22:59   #9
 
2coolforu2's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 377
Received Thanks: 80
Quote:
Originally Posted by ih8you View Post
Woo Thanks, I got no idea what to do next though =S
Nice release, Maybe for your next release you can try to make a command called /hide (name or me). It would be for Gm's to be able to use it to hide from players asking for stuff.
2coolforu2 is offline  
Old 05/23/2009, 23:22   #10
 
ih8you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 146
Received Thanks: 38
Quote:
Originally Posted by 2coolforu2 View Post
Nice release, Maybe for your next release you can try to make a command called /hide (name or me). It would be for Gm's to be able to use it to hide from players asking for stuff.
so like, when a player whisper a gm, the command makes them think the gm is offline

so, when a gm comes on and types /hide me and a normal player whispers the gm they get the message hes offline?
ih8you is offline  
Old 05/24/2009, 06:04   #11
 
2coolforu2's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 377
Received Thanks: 80
Quote:
Originally Posted by ih8you View Post
so like, when a player whisper a gm, the command makes them think the gm is offline

so, when a gm comes on and types /hide me and a normal player whispers the gm they get the message hes offline?
Well youc an also make that but also make the GM invisable to players but visable to other GM's.
2coolforu2 is offline  
Old 05/24/2009, 06:10   #12
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,922
Received Thanks: 491
hey mark you know how i said make wisper command you dont need now lol i just said it because i thoght you can do it but its released now in the dex sourcel ol
PeTe Ninja is offline  
Old 05/24/2009, 11:20   #13
 
ih8you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 146
Received Thanks: 38
lol, cool, i need to find out where to start on the invisable command
ih8you is offline  
Old 05/24/2009, 13:10   #14
 
$HaDoW's Avatar
 
elite*gold: 0
Join Date: Sep 2007
Posts: 285
Received Thanks: 78
start working on Vending and release it ! and you will be the hero !
$HaDoW is offline  
Old 05/24/2009, 15:29   #15
 
elite*gold: 0
Join Date: Mar 2006
Posts: 7
Received Thanks: 0
Thumbs up How do i load this on TheCOServer

Quote:
Originally Posted by ih8you View Post
Hi its me again

Flame will be Reported

I Coded these 100% Myself

The NPCS are, CP admin and A Npc that trades gold for cps and cps for gold. Both tested on a LOTF source 100% work

First CP Admin

Code:
                            if (CurrentNPC == 1234)
                            {
                                SendPacket(General.MyPackets.NPCSay("Hi, " + MyChar.Name +  " Would you like to trade a DragonBall for 215 cps or a DBScroll for 2150 cps?"));
                                SendPacket(General.MyPackets.NPCLink("I would Like to trade a DragonBall for 215cps.", 1));
                                SendPacket(General.MyPackets.NPCLink("I would Like to trade a DBScroll for 2150 cps.", 2));
                                SendPacket(General.MyPackets.NPCLink("No thanks.", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
                            }
And Controls...
Code:
                            if (CurrentNPC == 1234)
                            {
                                if (Control == 1)
                                {
                                    if (MyChar.InventoryContains(1088000, 1))
                                    {
                                        MyChar.RemoveItem(MyChar.ItemNext(1088000));
                                        MyChar.CPs += 215;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 215 cps. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have a DragonBall"));
                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
                                if (Control == 2)
                                {
                                    if (MyChar.InventoryContains(720028, 1))
                                    {
                                        MyChar.RemoveItem(MyChar.ItemNext(720028));
                                        MyChar.CPs += 2150;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 2150 cps. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have a DbScroll"));                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
Now For the gold to cps and cps to gold NPC

Code:
                            if (CurrentNPC == 2345)
                            {
                                SendPacket(General.MyPackets.NPCSay("Hi, " + MyChar.Name + " Would you like to trade 400 cps for 400k or 400k for 400cps?"));
                                 SendPacket(General.MyPackets.NPCLink("I would Like 400cps please", 1));
                                SendPacket(General.MyPackets.NPCLink("I would Like 400k please",  2));
                                SendPacket(General.MyPackets.NPCLink("No thanks", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
And controls ...

Code:
                            if (CurrentNPC == 2345)
                            {
                                if (Control == 1)
                                {
                                    if (MyChar.Silvers >= 400000)
                                    {
                                        MyChar.Silvers -= 400000;
                                        MyChar.CPs += 400;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 400 cps. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have 400k"));
                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
                                if (Control == 2)
                                {
                                    if (MyChar.CPs >= 400)
                                    {
                                        MyChar.CPs -= 400;
                                        MyChar.Silvers += 400000;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 4, MyChar.Silvers));
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        SendPacket(General.MyPackets.NPCSay("Here is your 400k. GoodLuck"));
                                        SendPacket(General.MyPackets.NPCLink("Thanks", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("Sorry, You dont have 400cps"));
                                        SendPacket(General.MyPackets.NPCLink("Oh sorry", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
Tell me if The Controls are the wrong way around xD
Press Thanks!!
Hi im new to this and I looked everywhere for the information on how to add a script to the database. I wondering how do i load the script to the database. I know how to open the npc database and create a npc and how to make it show anywhere on any map but my question is where do i add these codes? I would imagen i can make a new folder and save your script to be 1234Guard.cs or something like that but how i make the server load the file when someone calls the guard?Like where do i save the code part and then where do i save the command. any input would be greatly appreciated as i am new with coding and dont know how the server works lol.
sec0nd2n0ne is offline  
Reply


Similar Threads Similar Threads
[Release]Basevendor+Mangos 3.3.3a Npcs
07/27/2012 - WoW Private Server - 10 Replies
Ich habe kürzlich im Internet ein nettes Tool gefunden und möchte es gerne mit euch teilen da ich auf viele Threads gestoßen bin in denen nach Lvl Mobs,Vendoren usw gefragt wurde.Ich weis nicht ob ihrs schon kennt,aber wenn nicht ist es auf jeden Fall was ganz nettes;).Also meine neuste Entdeckung nennt sich Basevendor: Was ist BaseVendor? BaseVendor bietet Dir die Funktion Deine individuell angepassen, eigenen Händler für Deinen Server zu erstellen. In wenigen Minuten hast Du Deine...
[Release]DisCity NPCs (5165)
09/17/2010 - CO2 PServer Guides & Releases - 43 Replies
first lets define our variables in Character.cs search for: public Nobility Nobility; then add these under it: public bool DisCityON = false; public int DisCityMobs = 0; now on to the npc's
[Release] Birth Village NPCs
08/10/2010 - CO2 PServer Guides & Releases - 9 Replies
-Deleted- People are so ungrateful of someones hard work and cba to contribute their own tiny piece. Might release these on a later dat with all the grammer correct for every class. But don't know yet. #Request Close
[Release] Xml Npcs
04/04/2010 - CO2 PServer Guides & Releases - 6 Replies
Honestly, was just bored so I thought I'd take a look at C# since I haven't for a few months. Hard-coded Npc's suck balls, so here's the starting code for Xml Npc's. Pretty sure it was done within CoEmu v2, but can easily be converted into any source. I haven't tested it, since I don't have a Conquer client. Instructions:
[Release]2 Npcs
07/08/2009 - CO2 PServer Guides & Releases - 9 Replies
These are my first 2 ever npcs. I coded them with the help of several other codes. This code will Trade in the amulet for the gear. case 10062: //Magic Artisan { if (LinkBack == 0) { Text("Hi. Gear here.", CSocket); Link("Trojan", 1, CSocket); Link("Warrior", 2, CSocket);



All times are GMT +1. The time now is 20:34.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

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