Register for your free account! | Forgot your password?

You last visited: Today at 23:52

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

Advertisement



Mob Damage (Redux)

Discussion on Mob Damage (Redux) within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
LepEatWorld's Avatar
 
elite*gold: 0
Join Date: Apr 2017
Posts: 76
Received Thanks: 25
Mob Damage (Redux)

Hello, I'm currently using the Redux source to toy around with it. I was wondering how I would go about on making the max damage on monsters. I would like to do something like "DbMonstertype.Life * 600 = MaxDamage" which would be Pheasant(33HP) * 600 = 19800 Max Damage <--- Actual CO Max. Any help would be appreciated, I haven't touched anything that has to do with C# in years, and even then I was a beginner.
LepEatWorld is offline  
Old 11/06/2018, 06:20   #2
 
Yupmoh's Avatar
 
elite*gold: 26
Join Date: Jul 2011
Posts: 522
Received Thanks: 285
Since you're using the Redux source base, You need to go to the Entity class where there's a method to calculate damage depending on what type of attack it is (Archer, Magic, Melee).
All you need to do is to call a Math.MinMax between the attacker's damage calculated and monster life * 600. That way it will output the damage limit if the attacker's damage is higher than monster life * 600.
Yupmoh is offline  
Thanks
1 User
Old 11/07/2018, 00:46   #3
 
LepEatWorld's Avatar
 
elite*gold: 0
Join Date: Apr 2017
Posts: 76
Received Thanks: 25
Thanks for your reply. I added 2 lines to the script, not sure if this is how you were trying to explain things but this is what I did. I found the current code:
Code:
public virtual uint CalculatePhysicalDamage(Entity _target, DbMagicType _spell, bool _canDodge = false)
        {
            var dmg = Common.Random.Next(CombatStats.MinimumDamage, CombatStats.MaximumDamage) * (CombatStats.BonusAttackPct + CombatStats.DragonGemPct) / 100;
            if (_target is Monster)
                dmg *= GetLevelBonusDamageFactor(Level, _target.Level);
            if (_spell != null && _spell.Power > 0)
                dmg = (int)((double)dmg * (double)(_spell.Power % 1000) / (double)100);
            if (HasEffect(ClientEffect.Superman))
                if (_target is Monster)
                    dmg *= 10;
                else
                    dmg *= 2;
            dmg = dmg * (100 - _target.CombatStats.BlessPct) / 100;
            dmg = dmg * (100 - _target.CombatStats.TortGemPct) / 100;
            dmg -= _target.CombatStats.Defense * CombatStats.BonusDefensePct / 100;
            if (dmg < 1)
                dmg = 1;
            if (_canDodge && !Common.PercentSuccess(Math.Max(40, 90 - _target.CombatStats.Dodge + CombatStats.Accuracy)))
                dmg = 0;

            return (uint)dmg;
        }
And I added the following lines:
Code:
            if (_target is Monster && dmg > _target.MaximumLife * 600)
                dmg = (int)_target.MaximumLife * 600;
So it currently looks like:
Code:
        public virtual uint CalculatePhysicalDamage(Entity _target, DbMagicType _spell, bool _canDodge = false)
        {
            var dmg = Common.Random.Next(CombatStats.MinimumDamage, CombatStats.MaximumDamage) * (CombatStats.BonusAttackPct + CombatStats.DragonGemPct) / 100;
            if (_target is Monster)
                dmg *= GetLevelBonusDamageFactor(Level, _target.Level);
            if (_spell != null && _spell.Power > 0)
                dmg = (int)((double)dmg * (double)(_spell.Power % 1000) / (double)100);
            if (HasEffect(ClientEffect.Superman))
                if (_target is Monster)
                    dmg *= 10;
                else
                    dmg *= 2;
            dmg = dmg * (100 - _target.CombatStats.BlessPct) / 100;
            dmg = dmg * (100 - _target.CombatStats.TortGemPct) / 100;
            dmg -= _target.CombatStats.Defense * CombatStats.BonusDefensePct / 100;
            if (dmg < 1)
                dmg = 1;
            if (_target is Monster && dmg > _target.MaximumLife * 600)
                dmg = (int)_target.MaximumLife * 600;
            if (_canDodge && !Common.PercentSuccess(Math.Max(40, 90 - _target.CombatStats.Dodge + CombatStats.Accuracy)))
                dmg = 0;

            return (uint)dmg;
        }
Not sure if this is what you were recommending, but it seems to work perfectly fine. If there's a better way of doing this, I would like a tip or two. Thanks again.
LepEatWorld is offline  
Old 03/11/2019, 05:55   #4
 
Yupmoh's Avatar
 
elite*gold: 26
Join Date: Jul 2011
Posts: 522
Received Thanks: 285
Quote:
Originally Posted by LepEatWorld View Post
Thanks for your reply. I added 2 lines to the script, not sure if this is how you were trying to explain things but this is what I did. I found the current code:
Code:
public virtual uint CalculatePhysicalDamage(Entity _target, DbMagicType _spell, bool _canDodge = false)
        {
            var dmg = Common.Random.Next(CombatStats.MinimumDamage, CombatStats.MaximumDamage) * (CombatStats.BonusAttackPct + CombatStats.DragonGemPct) / 100;
            if (_target is Monster)
                dmg *= GetLevelBonusDamageFactor(Level, _target.Level);
            if (_spell != null && _spell.Power > 0)
                dmg = (int)((double)dmg * (double)(_spell.Power % 1000) / (double)100);
            if (HasEffect(ClientEffect.Superman))
                if (_target is Monster)
                    dmg *= 10;
                else
                    dmg *= 2;
            dmg = dmg * (100 - _target.CombatStats.BlessPct) / 100;
            dmg = dmg * (100 - _target.CombatStats.TortGemPct) / 100;
            dmg -= _target.CombatStats.Defense * CombatStats.BonusDefensePct / 100;
            if (dmg < 1)
                dmg = 1;
            if (_canDodge && !Common.PercentSuccess(Math.Max(40, 90 - _target.CombatStats.Dodge + CombatStats.Accuracy)))
                dmg = 0;

            return (uint)dmg;
        }
And I added the following lines:
Code:
            if (_target is Monster && dmg > _target.MaximumLife * 600)
                dmg = (int)_target.MaximumLife * 600;
So it currently looks like:
Code:
        public virtual uint CalculatePhysicalDamage(Entity _target, DbMagicType _spell, bool _canDodge = false)
        {
            var dmg = Common.Random.Next(CombatStats.MinimumDamage, CombatStats.MaximumDamage) * (CombatStats.BonusAttackPct + CombatStats.DragonGemPct) / 100;
            if (_target is Monster)
                dmg *= GetLevelBonusDamageFactor(Level, _target.Level);
            if (_spell != null && _spell.Power > 0)
                dmg = (int)((double)dmg * (double)(_spell.Power % 1000) / (double)100);
            if (HasEffect(ClientEffect.Superman))
                if (_target is Monster)
                    dmg *= 10;
                else
                    dmg *= 2;
            dmg = dmg * (100 - _target.CombatStats.BlessPct) / 100;
            dmg = dmg * (100 - _target.CombatStats.TortGemPct) / 100;
            dmg -= _target.CombatStats.Defense * CombatStats.BonusDefensePct / 100;
            if (dmg < 1)
                dmg = 1;
            if (_target is Monster && dmg > _target.MaximumLife * 600)
                dmg = (int)_target.MaximumLife * 600;
            if (_canDodge && !Common.PercentSuccess(Math.Max(40, 90 - _target.CombatStats.Dodge + CombatStats.Accuracy)))
                dmg = 0;

            return (uint)dmg;
        }
Not sure if this is what you were recommending, but it seems to work perfectly fine. If there's a better way of doing this, I would like a tip or two. Thanks again.
Sorry for the late response but this is what I meant.

Code:
if (_target is Monster)
{
    dmg = Math.Min(dmg, (uint)(_target.MaximumLife * 600));
}
This will result in damage not exceeding target's maximum life * 600 since it will take that if the damage is higher and if not then it will take the damage.

Edit: Add me on discord if you wish to contact me directly Moh #0530
Yupmoh is offline  
Reply


Similar Threads Similar Threads
[Learning Redux] Video Guides To Using Redux
03/22/2024 - CO2 PServer Guides & Releases - 43 Replies
So I know jumping into a new source can be scary and it's not something everyone wants to do, especially if they have a lot of content running already under something else (looking at you NCOS based servers!). These videos are designed to help people get their feet wet with Redux by providing accurate and easy to follow information on how to accomplish common tasks. DOWNLOAD REDUX/FAQ:...
[Selling] Saints Row 4, Metro Redux, Metro Last Light Redux Keys
12/14/2014 - Steam Trading - 1 Replies
---
[Buying] Metro 2033 Redux, Metro LL Redux, Fallout NV, Fallout 3, S.T.A.L.K.E.R: SoC
12/07/2014 - elite*gold Trading - 4 Replies
Suche diese Spiele für e*g (Steam).



All times are GMT +1. The time now is 23:53.


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