Discussion on 2 Questions, Selecting multiple coord & multiple inventory items within the CO2 Private Server forum part of the Conquer Online 2 category.
Need a hand with 2 things ive been tryin to work out but not had much luck so far.
1:Took this example from mining which sets the specific map, But how can you set multiple coords on the map so the action can only been done when standing in those coords rather then the entire map?
Code:
switch (client.Entity.MapID)
{
case 1002:
{
Mine(700011, 700001, 700021, 700071, 1072010, 1072050, 1072031, 0, client);
break;
}
default:
{
client.Send(new Message("You cannot mine here. You must go inside a mine.", System.Drawing.Color.Red, Message.TopLeft));
client.Mining = false;
break;
}
2: Below is the basic code for selecting if someone has a certain amount of a specific item in there bag and there removing them, How would you go about checking if they had multiple different items between a certain item number range, Say between item numbers 10000 and 10010 but which ever they had as long as there combined amount = say 10 u would remove them from there inventory?
For Example you could have:
10000 x3
10003 x4
10009 x3
or
10001 x2
10003 x6
10007 x3
Code:
if (client.Inventory.Contains(723467, 10))
{
client.Inventory.Remove(723467, 10);
If you want that sort of a mining system I'd suggest doing a collection of MapID, Points
Implementation would be different in various sources but inside your map class you could do List<Point> or you could have a Dictionary<ushort, List<Point>> where the key is the map id
Then when you receive the mining packet you say...
if(ValidMiningLocations.ContainsKey(user.MapID) && ValidMiningLocations[user.MapID].Contains(user.Location))
allowmining
else
no mining allowed here
This assumes you are using a Point style system for player coords but you can adjust it to suit your source and your needs.
As for your second question, it depends on how your source handles things.
Are you allowing stackable items? Here's an example based on my albetros source.
Code:
public int ItemCountByIDRange(uint startID, uint endID)
{
var Items = from I in this.Inventory.Values where I.StaticID >= startID && I.StaticID <= endID select I;
int count = 0;
foreach (Structures.ItemInfo item in Items)
count += Math.Max(1, (int)item.Amount);
return count;
}
The main idea behind the mining one was a kind of fishing system, Using the rod accessory and the swingaxe action, so was going to be using the pier in bi for instance, marking off the coords around there so it would only work there, i guess to expand that to include multiple shore lines maybe the list<point> would work better for so many coordinates....
Only issue im havin so far is to do with the items, created a new item at 562002 next to hoe and pickaxe using the fishin rod and copied texture, mesh.c3 & weapon.c3 across but it dosent seem to want to show on the character when equipped, and the accessory wont work with 562000 pickaxe item range, Would there be a way to break that so the accessory could be equipped with the pick axe? From testin it seems the swingaxe action is locked into the 562000 range also as i cant get it to activate with another item number range?
Ahhh i see, Ive added lots of new items but nothing that you would equip as yet untill now, I had a quick browse thru the files and saw texture.dds mesh.c3 and weapon.c3 were all linked so did them but guess there is more to it with equipped items, Shall have to have a deeper dive into that side now.
Multiple items??? 03/12/2009 - Conquer Online 2 - 3 Replies Ok well on my server (Leo) iv seen about 3 marketers with multiple items that are identical. Iv seen a guy with about 10 level 30 unique no soc blades a guy with 3 elite 2 soc swords, all of which were the same level, and a girl with two elite+1 no soc bows, what the hecks goin on?
[EMU] Obtain Multiple Unique Items. 11/12/2007 - WoW Exploits, Hacks, Tools & Macros - 4 Replies This only works on some Emu Servers:
Buy the Unique Item from the Vendor.
Put it into an Empty Bag (not your main backpack).
Drag the bag with the item in it onto the vendor's sells window.
Buy another one of the Unique Items.
Buy the Bag back.
You should now have two of the Unique Items.
Multiple Items 12/04/2006 - WoW Exploits, Hacks, Tools & Macros - 11 Replies Hi, basically i found this exploit a while back, say your at a rare vendor and theres only one item in stock e.g recipe
Bascialy, quickly move the item into your inventory, you can then quickly do it 2-3 more times.. So bascially Gratz! you just bought 5 items when you should of only been able to buy 1! Works undectable , this is so obvious so its proably been posted here before, just thought i'd share text2schild.php?smilienummer=1&text=Later :D' border='0' alt='Later :D' />