Register for your free account! | Forgot your password?

You last visited: Today at 06:04

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

Advertisement



Upgrade Quality Calculation

Discussion on Upgrade Quality Calculation within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
TaiZer's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 39
Received Thanks: 5
Upgrade Quality Calculation

Hello epvp.

With the forging interface in the latest patches I made a calculation for the upgrading quality wich give the same calculations as the client.
If you use it, you will have to adapt it to your source.
I hope this will help someone.

Code:
        public static bool UpgradeQuality(ItemInfo Item, List<ItemInfo> Items)
        {
            if (Item.IsWeapon)
            {
                ItemType Data;
                if (!Kernel.ItemTypes.TryGetValue(Item.ItemID + 1, out Data))
                    return false;
                if (Item.ItemData.RequiredLevel == 1)
                    return false;
                if (Data.RequiredLevel < 120)
                {
                    double Chance = 0;
                    double Percentage = 100;
                    switch (Item.ItemID % 10)
                    {
                        case 9://SUPER
                            return false;
                        case 8://ELITE
                            Percentage = 20;
                            if (Item.ItemData.RequiredLevel <= 70)
                                Percentage = 20;
                            else
                                for (int i = 70; i < Data.RequiredLevel; i += 5)
                                    Percentage -= 1;
                            break;
                        case 7://UNIQUE
                            Percentage = 33;
                            if (Item.ItemData.RequiredLevel <= 70)
                                Percentage = 33;
                            else
                                for (int i = 70; i < Data.RequiredLevel; i += 5)
                                    Percentage -= 2;
                            break;
                        case 6://REFINED
                            Percentage = 50;
                            if (Item.ItemData.RequiredLevel <= 70)
                                Percentage = 100;
                            else
                                for (int i = 70; i < Data.RequiredLevel; i += 5)
                                    Percentage -= 2.5;
                            break;
                        default://NORMAL
                            Percentage = 100;
                            if (Item.ItemData.RequiredLevel <= 70)
                                Percentage = 100;
                            else
                                for (int i = 70; i < Data.RequiredLevel; i += 5)
                                    Percentage -= 5;
                            break;
                    }
                    foreach (var DragonBall in Items)
                    {
                        if (DragonBall.ItemID == 720028)//DB_SCROLL
                            Chance += Percentage * 10;
                        else if (DragonBall.ItemID == 1088000)//DRAGONBALL
                            Chance += Percentage;
                    }
                    return Calculations.PercentSuccess(Chance);
                }
                else
                {
                    double Chance = 0;
                    double Percentage = 0;
                    switch (Item.ItemID % 10)
                    {
                        case 9://SUPER
                            return false;
                        case 8://ELITE
                            Percentage = 10;
                            for (int i = 120; i < Data.RequiredLevel; i += 1)
                                Percentage -= 0.2;
                            break;
                        case 7://UNIQUE
                            Percentage = 16;
                            for (int i = 120; i < Data.RequiredLevel; i += 1)
                                Percentage -= 0.4;
                            break;
                        case 6://REFINED
                            Percentage = 25;
                            for (int i = 120; i < Data.RequiredLevel; i += 1)
                                Percentage -= 0.5;
                            break;
                        default://NORMAL
                            Percentage = 50;
                            for (int i = 120; i < Data.RequiredLevel; i += 1)
                                Percentage -= 1;
                            break;
                    }
                    foreach (var DragonBall in Items)
                    {
                        if (DragonBall.ItemID == 720028)//DB_SCROLL
                            Chance += ((100 / Percentage) * 10);
                        else if (DragonBall.ItemID == 1088000)//DRAGONBALL
                            Chance += (100 / Percentage);
                    }
                    return Calculations.PercentSuccess(Chance);
                }
            }
            return false;
        }
Here is a screen of the interface if you don't see what is it:

TaiZer is offline  
Thanks
1 User
Old 11/30/2013, 17:19   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
for (int i = 70; i < Data.RequiredLevel; i += 5)
Percentage -= 2.5;


why are you looping instead of doing simple math?

This entire script could be collapsed down a TON with a bit of logical thinking tbh.

Example...
Code:
double chance = 0;
//Get initial chance
switch(Item.ItemID % 10)
{
	case 9:
		return false;
	case 8:
		chance = Data.RequiredLevel < 120 ? 20 : 10;
		break;
	case 7:
		chance = Data.RequiredLevel < 120 ? 33 : 16;
		break;
	case 6:
		chance = Data.RequiredLevel < 120 ? 50 : 25;
		break;
	case 5:
		chance = Data.RequiredLevel < 120 ? 100 : 50;
		break;
}


//Adjust by item level
if(Data.RequiredLevel > 120)
	switch(Item.ItemID % 10)
	{
		case 8:
			chance -= Data.RequiredLevel - 120;
			break;
		case 7:
			chance -= (Data.RequiredLevel - 120) * 2;
			break;
		case 6:
			chance -= (Data.RequiredLevel - 120) * 2.5;
			break;
		case 5:
			chance -= (Data.RequiredLevel - 120) * 5;
			break;
	}

else if(Data.RequiredLevel > 70)
	switch(Item.ItemID % 10)
	{
		case 8:
			chance -= (Data.RequiredLevel - 70) / 5 * .2;
			break;
		case 7:
			chance -= (Data.RequiredLevel - 70) / 5 * .4;
			break;
		case 6:
			chance -= (Data.RequiredLevel - 70) / 5 * .5;
			break;
		case 5:
			chance -= (Data.RequiredLevel - 70) / 5;
			break;
	}
Tada! You now have your chance to upgrade and can use it any way you like.
pro4never is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
how to upgrade quality
11/10/2009 - Conquer Online 2 - 10 Replies
hi I want to know is there is any easy and cheap way to upgrade the quality from Elite to Super ? Thx
How to upgrade quality with ONLY 1 Db
10/13/2009 - CO2 Exploits, Hacks & Tools - 212 Replies
Well, I've been using this method for a while and i decided since all you guyz been helping me its time to share my wealth ;) STEPS: 1. Lower your max Dura to 25 (EXAMPLE: 25/X.. X=25) **NOTE**~ To do this you must get hit by a monster such as a king until your dura goes to 0/40. Once the dura hits 0, repair the item and the max dura should lower. Do this several times until the max dura is 25. Also the max dura won't always lower the same times down, such as it may go to 32 then 25. 2....
How to upgrade quality
07/25/2008 - EO Guides & Templates - 23 Replies
Well acctually it's really simple.Every gear has it's lvl(gear's lvl can be upgraded with vio's),when your characters lvl matches you'r gear's lvl then work your ass to hunt bosses for reds. This solution gives you 75% rate. Lets say you have a lvl 80 unique helm,and you'r lvl is 80 (should be same lvl but less then 30% at the lvl xp bar) should take you MAX 5 red's to make the helm elite. From my experience: At lvl 88 made my elite+12+soc brace to super with 1 red,i was same lvl and 20% at...
Upgrade the quality w/o Dbs
10/13/2007 - CO2 Guides & Templates - 16 Replies
ok heres a lil trick i do with -5 items, this isnt a quick money making scheme takes a lil time and effort 1: get a high lvl -5 item or a high lvl soc wep/item (must be high lvl or it doesnt work) 2: make sure the dura is 1-0 if not u gotta wear it down (but dont let it break >.>) 3:if u have a 2nd rb start lucky time and repair it if not just wait till a 2nd rb starts his lucky time in market, tc, ext... 4: repeat this process over n over and the quality will eventually go up



All times are GMT +2. The time now is 06:04.


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.