Register for your free account! | Forgot your password?

You last visited: Today at 01:55

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


Mob Damage (Redux)

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2017
Posts: 27
Received Thanks: 5
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
 
elite*gold: 0
Join Date: Jul 2011
Posts: 366
Received Thanks: 196
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.


Execution! is offline  
Thanks
1 User
Old 11/07/2018, 00:46   #3
 
elite*gold: 0
Join Date: Apr 2017
Posts: 27
Received Thanks: 5
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  
Reply



« Screen Resolution | Connection client to source conquer online »

Similar Threads
[Learning Redux] Video Guides To Using Redux
06/20/2018 - CO2 PServer Guides & Releases - 38 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 01:55.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.