Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 12:52

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

Advertisement



[Release]Materials NPC's Related to Buying & Upgrading House for 5165

Discussion on [Release]Materials NPC's Related to Buying & Upgrading House for 5165 within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2005
Posts: 96
Received Thanks: 25
[Release]Materials NPC's Related to Buying & Upgrading House for 5165

Not sure if this is anywhere, but I just got finished coding these 4 npc's. they are the necessary npc's needed for the vouchers and stuff needed for the House Permit and the Upgrade Certificate. This works very well with Pringles House code release.

Side Note: I have made these NPC's to require alot less materials needed to aquire the Vouchers needed for the House Permit and the Upgrade Certificate.

Update: Updated Stoneman to allow the use of ALL Rates of Copper Ore...Code in Green is the fix...thanks goes to -impulse- for this fix, it is his code. Also thanks goes to pro4never, for helping me to understand what the code does and how it works. I learned something new from both of them. Thanks.

Copy and paste all 4 codes into the NPCDialog.cs file

Code for Stoneman:
Now goto your Character.cs file and find this code:
Code:
public bool InventoryContains(uint ID, byte Count)
        {
            byte _Count = 0;
            for (int i = 0; i < Inventory.Count; i++)
                if (((Item)Inventory[i]).ID == ID)
                    _Count++;
            return _Count >= Count;
        }
Below that add this code:
Code:
[COLOR="Green"]public byte InventoryItemIDCount(uint ID)
        {
            byte _Count = 0;
            for (int i = 0; i < Inventory.Count; i++)
                if (((Item)Inventory[i]).ID == ID)
                    _Count++;
            return _Count;
        }[/COLOR]
Code for Carpenter:

Code for Craftsman:

Code for HouseAgent:

Now go to your OldCODB/NPCs.txt and place these at the bottom:
Code:
30160 8119 2 28 1036 184 103
30162 8099 2 28 1036 163 098
30158 8086 2 92 1036 141 107
30157 8070 2 92 1002 400 284
If you like this release, please give thanks. This is my first release.
Thanks.
HardNotTo is offline  
Thanks
10 Users
Old 01/30/2010, 23:36   #2
 
ramix's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 272
Received Thanks: 61
Good Release keep it up
ramix is offline  
Old 01/30/2010, 23:52   #3
 
elite*gold: 0
Join Date: Jan 2010
Posts: 116
Received Thanks: 33
good job!
Jedex is offline  
Old 01/31/2010, 12:17   #4
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
nice work
coreymills is offline  
Old 01/31/2010, 16:32   #5
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Awesome release bro! keep it up !
killersub is offline  
Old 01/31/2010, 17:04   #6
 
elite*gold: 0
Join Date: Aug 2005
Posts: 96
Received Thanks: 25
Thanks everyone, glad you liked it. I currently trying to figure out a way to change this:

Code:
else if (Control == 3)
                                    {
                                        if (GC.MyChar.InventoryContains(1072020, 12))
                                        {
                                            for (int i = 0; i < 12; i++)
                                                GC.MyChar.RemoveItem(GC.MyChar.NextItem(1072020));
Trying to get it to accept any Rate of copper ore such as Rate1, Rate2, Rate3 and so on, but I cannot figure out how to get the server to recognize the difference in the Ores Rate. In other words, how to tell it to accept any type of Copper Ore. Is there a way to do something like:I do know that the following code piece is not correct and that it will never work. This post is me looking for help to get the correct code that will work. Im new to coding, give me a break.

Code:
else if (Control == 3)
                                    {
                                        if (GC.MyChar.InventoryContains(1072020-1072032, 12))
                                        {
                                            for (int i = 0; i < 12; i++)
                                                GC.MyChar.RemoveItem(GC.MyChar.NextItem(1072020-1072032));
If anyone knows how I could do this, it would be much appreciated.
Thanks.
HardNotTo is offline  
Thanks
1 User
Old 01/31/2010, 17:33   #7
 
elite*gold: 0
Join Date: Jan 2010
Posts: 116
Received Thanks: 33
Quote:
Originally Posted by HardNotTo View Post
Thanks everyone, glad you liked it. I currently trying to figure out a way to change this:

Code:
else if (Control == 3)
                                    {
                                        if (GC.MyChar.InventoryContains(1072020, 12))
                                        {
                                            for (int i = 0; i < 12; i++)
                                                GC.MyChar.RemoveItem(GC.MyChar.NextItem(1072020));
Trying to get it to accept any Rate of copper ore such as Rate1, Rate2, Rate3 and so on, but I cannot figure out how to get the server to recognize the difference in the Ores Rate. In other words, how to tell it to accept any type of Copper Ore. Is there a way to do something like:

Code:
else if (Control == 3)
                                    {
                                        if (GC.MyChar.InventoryContains(1072020-1072032, 12))
                                        {
                                            for (int i = 0; i < 12; i++)
                                                GC.MyChar.RemoveItem(GC.MyChar.NextItem(1072020-1072032));
If anyone knows how I could do this, it would be much appreciated.
Thanks.
Good job man!
Jedex is offline  
Old 01/31/2010, 23:08   #8
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Quote:
else if (Control == 3)
{
if (GC.MyChar.InventoryContains(1072020-1072032, 12))
{
for (int i = 0; i < 12; i++)
GC.MyChar.RemoveItem(GC.MyChar.NextItem(1072020-1072032));
That way it will never work.

Try this:
PHP Code:
else if (Control == 3)
                                        {
                                            
byte totalcount 0;
                                            
byte othercount 0;
                                            
byte count 1;
                                            while (
count != 13)
                                            {
                                                
totalcount += GC.MyChar.InventoryItemIDCount((uint)(1072020 count));
                                                
count++;
                                            }
                                            if (
totalcount >= 12)
                                            {
                                                
count 1;
                                                while (
count != 13 && othercount != 12)
                                                {
                                                    
GC.MyChar.RemoveItem(GC.MyChar.NextItem((uint)(1072020 count)));
                                                    
count++;
                                                    
othercount++;
                                                }
                                                for (
int i 010i++)
                                                    
GC.MyChar.AddItem(721175);
                                                
GC.AddSend(Packets.NPCSay("Congragulation you have 10 Copper Ore Voucher for 12 Any Rate Copper Ores."));
                                                
GC.AddSend(Packets.NPCLink("OK Thx"255));
                                                
GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                
GC.AddSend(Packets.NPCFinish());
                                            }
                                            else
                                            {
                                                
GC.AddSend(Packets.NPCSay("Sorry you dont have 12 Any Rate Copper Ores."));
                                                
GC.AddSend(Packets.NPCLink("OK i see."255));
                                                
GC.AddSend(Packets.NPCSetFace(N.Avatar));
                                                
GC.AddSend(Packets.NPCFinish());
                                            }
                                        } 
Where GC.MyChar.InventoryItemIDCount(uint) is this:
PHP Code:
public byte InventoryItemIDCount(uint ID)
        {
            
byte _Count 0;
            for (
int i 0Inventory.Counti++)
                if (((
Item)Inventory[i]).ID == ID)
                    
_Count++;
            return 
_Count;
        } 
-impulse- is offline  
Thanks
1 User
Old 01/31/2010, 23:35   #9
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Very good way of doing it actually. I'll have to keep that in mind if I ever need to deal with a specific item of any quality.
pro4never is offline  
Old 01/31/2010, 23:37   #10
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Quote:
Originally Posted by pro4never View Post
Very good way of doing it actually. I'll have to keep that in mind if I ever need to deal with a specific item of any quality.
If you say about HardNotTo way, then you are in nuts.
-impulse- is offline  
Old 01/31/2010, 23:52   #11
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
seeing as his would never work and even if he did try to get it to work with that method he would have a jumble of if statements that make me want to cry... so no, I meant yours.
pro4never is offline  
Thanks
1 User
Old 02/01/2010, 01:40   #12
 
elite*gold: 0
Join Date: Aug 2005
Posts: 96
Received Thanks: 25
Quote:
Originally Posted by -impulse- View Post
If you say about HardNotTo way, then you are in nuts.
My way of doing it was not a release! It was a question looking for some help on how to do it.
HardNotTo is offline  
Old 02/01/2010, 02:25   #13
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
I didn't say it was. You asked for help and he posted a rather well thought out way of doing it that I commented on it. I was just clearing up some confusion about which one I was referring too.
pro4never is offline  
Old 02/01/2010, 02:50   #14
 
elite*gold: 0
Join Date: Aug 2005
Posts: 96
Received Thanks: 25
Quote:
Originally Posted by pro4never View Post
I didn't say it was. You asked for help and he posted a rather well thought out way of doing it that I commented on it. I was just clearing up some confusion about which one I was referring too.
Oh I know, I just said that so that people would know that it wasn't intended for a release or a fix or anything like that. And I do appreciate the help and the code he posted.

Anywho....I understand the first part of his code and what its doing, but Im not too sure about the second part or what to do with it.
Code:
public byte InventoryItemIDCount(uint ID)
        {
            byte _Count = 0;
            for (int i = 0; i < Inventory.Count; i++)
                if (((Item)Inventory[i]).ID == ID)
                    _Count++;
            return _Count;
        }
I kind of remember doing something like this with something else but it has slipped my mind. If I would have to guess, I would think it has to do with the first part of his code being able to call up the function or something like that, whatever its called. Im checking my source files now to try and remember where I done it.
HardNotTo is offline  
Old 02/01/2010, 03:05   #15
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Quote:
Originally Posted by HardNotTo View Post
Oh I know, I just said that so that people would know that it wasn't intended for a release or a fix or anything like that. And I do appreciate the help and the code he posted.

Anywho....I understand the first part of his code and what its doing, but Im not too sure about the second part or what to do with it.
Code:
public byte InventoryItemIDCount(uint ID)
        {
            byte _Count = 0;
            for (int i = 0; i < Inventory.Count; i++)
                if (((Item)Inventory[i]).ID == ID)
                    _Count++;
            return _Count;
        }
I kind of remember doing something like this with something else but it has slipped my mind. If I would have to guess, I would think it has to do with the first part of his code being able to call up the function or something like that, whatever its called. Im checking my source files now to try and remember where I done it.
Yuppp, that's a function that lets you do the same thing over and over without having to write the entire code required. Think about the additem void. Instead of having to go through all the steps of creating a new item, you have a function that does it for you using simple input such as item Id, +, -, sockets, etc.

What this does is gets an input of the id to find and returns the count of it in the players inventory. The 'genius' of the way he wrote it is you have the base item Id for ores and then each loop (the while loop) it adds the loop count to the end of it thus searching for a different kind of ore each time and then returns how many their are. If there are enough it does a similar loop to delete them from the players inventory.

Hope that helps a bit. @ original npc, good job! Nice to see people contributing.
pro4never is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Tiny-Release] Buying Attribute Points! 5165 Source...
01/21/2010 - CO2 PServer Guides & Releases - 18 Replies
#REMOVED! I MADE AN ALL-IN-ONE THREAD ABOUT IT! #Request Close
[Release] Birth-Island NPC's! 5165 Source...
01/21/2010 - CO2 PServer Guides & Releases - 5 Replies
#REMOVED! I MADE AN ALL-IN-ONE THREAD ABOUT IT! #Request Close
Guide: Building and Upgrading a House
05/04/2009 - CO2 Guides & Templates - 7 Replies
Conquer Online House Guide By Kastoli TQ has provided Conquer players with a guide to building and upgrading a house. Although, the TQ guide is badly written and hard to understand. That’s why I made this guide, to make the lives of all EPvPers easier. Building your House It is advised that you have multiple characters logged in mining with one character running back a forward collecting and exchanging ores. Ores are the main component to creating a house; you require 2500 ore to...
Kojan House Materials Guide
03/06/2007 - General Gaming Discussion - 0 Replies
Kojani Style, Single Story, Thatched Roof, Type 48. Sandstone Housing Brick x100 Soapstone Cornerstone x1 Rotwort Mortar x10 Standard Wood Panels x20 Standard Wood Housing Beams x20 Iron Fastners x6 Firegrass Window Coverings x10 Firegrass Thatch x20



All times are GMT +2. The time now is 12:52.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.