Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 19:58

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

Advertisement



[Needed] HP/MP Formula, Maybe some guys who wanna join into dev

Discussion on [Needed] HP/MP Formula, Maybe some guys who wanna join into dev within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2011
Posts: 648
Received Thanks: 413
[Needed] HP/MP Formula, Maybe some guys who wanna join into dev

I am currently writing a source from scratch for the Client Version 4351.

Ive ran into much much problems already but got them sorted out on my own

I can not figure out the HP/MP Formula tho, i tried much combinations but it wont fit. I want it as close as possibly to TQ´s Calculations.

Now i need some assistance, is there any source out where i can "leech" the formula? Or is anyone of you so knid to share it with me?

Would save me alot of time,

Thanks

If you want to Join the Project, Add me on MSN and message me.
-Yuki
Y u k i is offline  
Old 07/03/2011, 01:40   #2
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
Code:
public void CalculateHPBonus()
        {
            ushort stathp = (ushort)((Character.Strength * 3) +
                                     (Character.Agility * 3) +
                                     (Character.Spirit * 3) +
                                     (Character.Vitality * 24));
            switch (Character.Class)
            {
                case 11: Character.MaxHitpoints = (ushort)(stathp * 1.05F); break;
                case 12: Character.MaxHitpoints = (ushort)(stathp * 1.08F); break;
                case 13: Character.MaxHitpoints = (ushort)(stathp * 1.10F); break;
                case 14: Character.MaxHitpoints = (ushort)(stathp * 1.12F); break;
                case 15: Character.MaxHitpoints = (ushort)(stathp * 1.15F); break;
                default: Character.MaxHitpoints = (ushort)stathp; break;
            }
            Character.Hitpoints = Math.Min(Character.Hitpoints, Character.MaxHitpoints);
        }
Code:
        public void CalculateMPBonus()
        {
            switch (Character.Class)
            {
                case 132: case 142: Character.MaxMana = (ushort)(Character.Spirit * 15); break;
                case 133: case 143: Character.MaxMana = (ushort)(Character.Spirit * 20); break;
                case 134: case 144: Character.MaxMana = (ushort)(Character.Spirit * 25); break;
                case 135: case 145: Character.MaxMana = (ushort)(Character.Spirit * 30); break;
                default: Character.MaxMana = (ushort)(Character.Spirit * 5); break;
            }
            Character.Mana = Math.Min(Character.Mana, Character.MaxMana);
        }
Spirited is offline  
Thanks
2 Users
Old 07/03/2011, 01:48   #3
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
Quote:
Originally Posted by Y u k i View Post
Jesus, holy **** that was fast. Thanks alot Fang, i should of just asked you on msn
Sorry o.o
That usually happens with me. I start coding and then an hour later I get bored and say, 'I wonder what's happening on elitepvpers.' And every time I do that, there's always a thread that was just posted. =p

And formulas are easy to come up with. Just look at the attribute points and the details, and you'll understand exactly how TQ does all of their formulas (with a little messing around).
Spirited is offline  
Old 07/03/2011, 01:58   #4
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
You forgot to mention adding the item's stats as well:

Code:
public const int STAT_MAXLIFE_STR = 3, STAT_MAXLIFE_AGI = 3, STAT_MAXLIFE_VIT = 24, STAT_MAXLIFE_SPI = 3;
public const int STAT_MAXMANA_STR = 0, STAT_MAXMANA_AGI = 0, STAT_MAXMANA_VIT = 0, STAT_MAXMANA_SPI = 5;
Code:
private static readonly int[] _trojanLifeBonus = new[] { 100, 105, 108, 110, 112, 115 };
private static readonly int[] _taoistManaBonus = new[] { 100, 100, 300, 400, 500, 600 };

public static int GetTrojanLifeBonus(int index)
{
    return index < 0 || index >= _trojanLifeBonus.Length ? _trojanLifeBonus[0] : _trojanLifeBonus[index];
}

public static int GetTaoistManaBonus(int index)
{
    return index < 0 || index >= _taoistManaBonus.Length ? _taoistManaBonus[0] : _taoistManaBonus[index];
}

public static int MulDiv(int number, int numerator, int denominator)
{
    return number * numerator / denominator;
}
Code:
var maxLife = Constants.STAT_MAXLIFE_STR * Strength +
              Constants.STAT_MAXLIFE_AGI * Agility +
              Constants.STAT_MAXLIFE_VIT * Vitality +
              Constants.STAT_MAXLIFE_SPI * Spirit;

// check if player is a trojan
if (ProfessionSort == ProfessionSort.Trojan)
{
    // if player is a trojan, apply life bonus now
    maxLife = Kernel.MulDiv(maxLife, Kernel.GetTrojanLifeBonus(ProfessionLevel), 100);
}

IterateEquipment(equip =>
{
    maxLife += equip.TypeData.Life;
    maxLife += equip.AddLife;
    if (equip.Magic3 > 0 && equip.AdditionData != null)
    {
        maxLife += equip.AdditionData.Life;
    }
});

return maxLife;
Code:
var maxMana = Constants.STAT_MAXMANA_STR * Strength +
              Constants.STAT_MAXMANA_AGI * Agility +
              Constants.STAT_MAXMANA_VIT * Vitality +
              Constants.STAT_MAXMANA_SPI * Spirit;

// check if player is a taoist
if (ProfessionSort == ProfessionSort.WaterTaoist || ProfessionSort == ProfessionSort.FireTaoist)
{
    // if player is a taoist, apply mana bonus now
    maxMana = Kernel.MulDiv(maxMana, Kernel.GetTaoistManaBonus(ProfessionLevel), 100);
}

IterateEquipment(equip => maxMana += equip.TypeData.Mana);

return maxMana;
nTL3fTy is offline  
Thanks
3 Users
Reply


Similar Threads Similar Threads
Pets mana recovering from Mana tunnel
02/23/2010 - Mabinogi - 28 Replies
So, Anybody have any idea how to start with this? It'd be one awesome thing to have pets recover Mana by mana tunnels. You could sit there gathering herbs all day from your gnu or whatever pet:handsdown: Golem unlimited range mod might be nice too. Both very possible... IDAPRO+OllyDBG .dll edits maybe?
Can you help me? Attack formula !!
01/31/2010 - Aion - 0 Replies
- I want to ask about the attack's formula in INFO of the Character when equip weapon . - And how many defense i need to increase in order to decrease 1 damage. :confused:
Steed Formula
07/30/2009 - CO2 Private Server - 1 Replies
What is the accurate formula for steed breeding (the 0.9+0.1 rough estimate isnt gonna cut it for rare steeds). Dont need a calculator either



All times are GMT +2. The time now is 19:58.


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.