Register for your free account! | Forgot your password?

You last visited: Today at 23:25

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

Advertisement



Repair costs?

Discussion on Repair costs? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
Repair costs?

Has anyone figured out a correct calculation for the repair costs and wouldn't mind sharing it?

Thank you.
BlooD-BoY is offline  
Old 03/27/2012, 14:54   #2
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 918
It's in the EO source exactly and I don't think it's changed. Grab it from there.

Edit: Nevermind, I thought it was more complicated than this, so I'll just give it to you. I don't remember when we coded this in, so I'm not sure if this is correct but this is (relatively) from our source.

(uint)(EntryPrice - ItemDurability * EntryPrice / ItemMaxDurability);

where EntryPrice is the price of the item when buying from shop, and the others are self-explanatory. Cross reference that with the EO source and let me know as well.
Lateralus is offline  
Thanks
2 Users
Old 03/27/2012, 18:22   #3
 
elite*gold: 0
Join Date: Jan 2007
Posts: 220
Received Thanks: 63
Quote:
Originally Posted by Lateralus View Post
It's in the EO source exactly and I don't think it's changed. Grab it from there.

Edit: Nevermind, I thought it was more complicated than this, so I'll just give it to you. I don't remember when we coded this in, so I'm not sure if this is correct but this is (relatively) from our source.

(uint)(EntryPrice - ItemDurability * EntryPrice / ItemMaxDurability);

where EntryPrice is the price of the item when buying from shop, and the others are self-explanatory. Cross reference that with the EO source and let me know as well.
This is literally off by 1-3 silvers, which is pretty awesome, i'll try playing around with it and see if i can figure out the exact cost, if anything i'll post it here.

Thank you.
BlooD-BoY is offline  
Old 03/27/2012, 22:31   #4
 
.Kinshi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
Pretty sure I had a version of this in the source I released.

Code:
        public static UInt32 ItemRepairCost(Item i)
        {
            DBItem dbi = new DBItem();
            if (Program.ItemDatabase.TryGetValue(i.ItemID, out dbi))
            {
                int nRecoverDurability = Math.Max(0, i.MaxDurability - i.Durability);
                if (nRecoverDurability == 0) return 0;

                ItemQuality Quality = (ItemQuality)(i.ItemID % 10);
                double QualityMultipier = 0.75d;

                switch (Quality)
                {
                    case ItemQuality.Super: QualityMultipier = 1.125d; break;
                    case ItemQuality.Elite: QualityMultipier = 0.975d; break;
                    case ItemQuality.Unique: QualityMultipier = 0.9d; break;
                    case ItemQuality.Refined: QualityMultipier = 0.825d; break;
                }

                int nRepairCost = 0;
                if (dbi[ItemStat.SellGold] > 0)
                    nRepairCost = (int)Math.Ceiling(((Double)dbi[ItemStat.SellGold] * (Double)nRecoverDurability / (Double)i.MaxDurability) * (Double)QualityMultipier);

                nRepairCost = Math.Max(1, nRepairCost);

                return (UInt32)nRepairCost;
            }
            else return 0;
        }
.Kinshi is offline  
Thanks
1 User
Old 03/29/2012, 14:36   #5
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 918
Here's the real calculation gotten from the EO source.

Mine:
Code:
(uint)Math.Max(1, EntryPrice * (ItemMaxDura - ItemDura) / ItemDura / 2);
TQ's:
Code:
int nRecoverDurability = __max(0, GetInt(ITEMDATA_AMOUNTLIMIT) - GetInt(ITEMDATA_AMOUNT));
	
if (nRecoverDurability == 0)
	return 0;

int nRepairCost	= 0;
if (GetInt(ITEMDATA_AMOUNTLIMIT) > 0)
	nRepairCost	= GetInt(ITEMDATA_PRICE) * nRecoverDurability / GetInt(ITEMDATA_AMOUNTLIMIT) / 2;
	
return __max(1, nRepairCost);
Test mine out and see if it's exact.
Lateralus is offline  
Thanks
1 User
Old 03/29/2012, 17:15   #6


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
Yours is crazy complicated Kinshi =x
Korvacs is offline  
Old 03/29/2012, 17:33   #7
 
×Holo's Avatar
 
elite*gold: 0
Join Date: Mar 2012
Posts: 286
Received Thanks: 71
Quote:
Originally Posted by Korvacs View Post
Yours is crazy complicated Kinshi =x
truedat o.o
×Holo is offline  
Old 03/29/2012, 18:00   #8
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 918
Quote:
Originally Posted by Korvacs View Post
Yours is crazy complicated Kinshi =x
I think his is for repairing the maximum durability from that guy in the market.

Edit: Actually, maybe not. =o
Lateralus is offline  
Old 03/29/2012, 18:41   #9
 
.Kinshi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
Quote:
Originally Posted by Korvacs View Post
Yours is crazy complicated Kinshi =x
I coded that a long time ago, so yup :P
And it is perfect, so that's good
.Kinshi is offline  
Old 03/31/2012, 00:44   #10
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
And mine (I believe this is from the CO client.. I can't remember):
Code:
        public uint GetRepairCost()
        {
            var quality = ItemtypeQuality;

            uint numerator = 10;
            switch (quality)
            {
                case 9: numerator = 15; break;
                case 8: numerator = 13; break;
                case 7: numerator = 12; break;
                case 6: numerator = 11; break;
            }

            var amount = Amount;
            uint amountLimit = AmountLimit;
            amountLimit -= amount;

            amountLimit += amountLimit * 2;

            amountLimit = Kernel.MulDiv(TypeData.Price, amountLimit, (uint)AmountLimit * 4);
            amountLimit = Kernel.MulDiv(amountLimit, numerator, 10);
            return amountLimit;
        }
nTL3fTy is offline  
Thanks
1 User
Old 03/31/2012, 08:45   #11
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 918
Quote:
Originally Posted by nTL3fTy View Post
And mine (I believe this is from the CO client.. I can't remember):
Code:
        public uint GetRepairCost()
        {
            var quality = ItemtypeQuality;

            uint numerator = 10;
            switch (quality)
            {
                case 9: numerator = 15; break;
                case 8: numerator = 13; break;
                case 7: numerator = 12; break;
                case 6: numerator = 11; break;
            }

            var amount = Amount;
            uint amountLimit = AmountLimit;
            amountLimit -= amount;

            amountLimit += amountLimit * 2;

            amountLimit = Kernel.MulDiv(TypeData.Price, amountLimit, (uint)AmountLimit * 4);
            amountLimit = Kernel.MulDiv(amountLimit, numerator, 10);
            return amountLimit;
        }
Is that for the market guy, or general repairing? Bro, you're never on MSN anymore!
Lateralus is offline  
Old 03/31/2012, 09:46   #12
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Quote:
Originally Posted by Lateralus View Post
Is that for the market guy, or general repairing? Bro, you're never on MSN anymore!
It should be general repairing, and I know.
nTL3fTy is offline  
Old 03/31/2012, 09:55   #13
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 918
Quote:
Originally Posted by nTL3fTy View Post
It should be general repairing, and I know.
I'm guessing then that EO repairing differs from CO then; what I posted above was gotten from the EO source.
Lateralus is offline  
Old 03/31/2012, 10:50   #14

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 924
Quote:
Originally Posted by Lateralus View Post
I'm guessing then that EO repairing differs from CO then; what I posted above was gotten from the EO source.
Still, does it matter that much? The other poster said your version was only few silvers off anyway.
Kiyono is offline  
Old 03/31/2012, 11:27   #15
 
Lateralus's Avatar
 
elite*gold: 0
Join Date: May 2005
Posts: 1,892
Received Thanks: 918
Quote:
Originally Posted by Kiyono View Post
Still, does it matter that much? The other poster said your version was only few silvers off anyway.
Of course it matters - it's either correct or wrong.
Lateralus is offline  
Reply


Similar Threads Similar Threads
How to pay your costs for your server ?!
02/14/2012 - SRO Private Server - 8 Replies
I wonder for some ppl and I think they're mostly kids Add in them server to many free Silk and Nova and very high exp ! so who will pay in this server and everything is available free?! And of course loved by everyone because everything is free and this quantity ! Look at this example "Start With 1m Silk And 500k Sp And 500M Gold And Magic pop Rate 1x" start items
Silk Costs ! on SJSRO !
02/11/2009 - SRO Private Server - 8 Replies
Well, this chinese friend of mine, said the price! It's only possible to buy 700 silk ! Euro: €5,64 Dollar: $7.32 Or if you wanne see how much it costs with your kind of money, just use 50 Chinese Yuan..!
Re-scoping without any costs
03/02/2007 - WoW Exploits, Hacks, Tools & Macros - 0 Replies
Hi there, I haven't verified this yet, but I'm posting to let other test before I get home. I recently re-scoped my bow from +2dmg to +5 dmg. The new scope stayed in my backpack but was also applied. So I got the bonus without "using" the scope. If anyone else wants to verify please check it out. I will be back after work and after a test. Hf
Low costs for summoning your pet
02/06/2007 - WoW Exploits, Hacks, Tools & Macros - 0 Replies
Hi there, We all know about Dark Pact right? Sucks some of your pets mana and gives it to you. Well.... With Blizzards latest patch to fix the summoning of pets w/ partial HP/MP they failed to make the pet summon WITH full HP/MP, infact when the pet is summoned it still has the low HP/MP until the game fills both of the bars automatically. Well to make a long story short all you have to do is start summoning your pet and as you are casting start spamming your Dark Pact, as soon as the...
No rep costs as lvl 62 priest
01/30/2007 - WoW Exploits, Hacks, Tools & Macros - 2 Replies
Englisch: Thanks to BC priests get a new spell at lvl 62. Shadowword : Death. Basically it´s the same as demonic runes oder Dark Runes. If the spell is cast on an enemy, and he´s not dying because of the spell, you get the same dmg as the target. If You´re about to wipe or getting killed by some overpowered mobs, cast it on one of them, and if you die because of this, you won´t have anything to repair. German: Dank Burning Crusade haben Priester mit lvl 62 einen neuen Spruch:...



All times are GMT +2. The time now is 23:25.


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.