Register for your free account! | Forgot your password?

You last visited: Today at 09:49

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

Advertisement



Nobilitydmg.cs

Discussion on Nobilitydmg.cs within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
LordGragen.'s Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 68
Nobilitydmg.cs

hey guys been working on a new nobility dmg system, seperated one and here it is, i am not sure if everything is in grate shape but please let me know if there is something i must update or remove, thank you


Code:
using System;
using Rise_Of_Medusa.Network.GamePackets;
using Rise_Of_Medusa.Game;

namespace Rise_Of_Medusa.Game.Attacking
{
   public class NobilityDamage
    {
       public static int Damage = 0;
   

       public static uint Melee(Entity attacker, Entity attacked)
       {
           #region Nobility Damage
           if (attacker.NobilityRank != attacked.NobilityRank)
           {
               int addnobility_damage = 0;
               if ((byte)attacker.NobilityRank == 12)
                   addnobility_damage = (Damage * ((byte)attacker.NobilityRank + 80)) / 100;
               else
                   if ((byte)attacker.NobilityRank > 5)
                       addnobility_damage = (Damage * ((byte)attacker.NobilityRank + 25)) / 100;
               if ((byte)attacked.NobilityRank > 5)
               {
                   if ((addnobility_damage - (uint)((Damage * ((byte)attacked.NobilityRank + 8)) / 100)) > 0)
                   {
                       addnobility_damage -= (int)((Damage * ((byte)attacked.NobilityRank + 8)) / 100);
                   }
                   else
                   {
                       if (Damage > (uint)((Damage * ((byte)attacked.NobilityRank + 8)) / 100))
                       {
                           Damage -= (int)((Damage * ((byte)attacked.NobilityRank + 8)) / 100);
                       }
                       else
                           Damage = 1;
                   }
               }
               if (Damage != 1)
               {
                   Damage += addnobility_damage;
               }

           }
           #endregion
           return (uint)Damage;


       }
       public static uint Melee(Entity attacker, Entity attacked, Database.SpellInformation spell)
       {
           #region Nobility Damage
           if (attacker.NobilityRank != attacked.NobilityRank)
           {
               int addnobility_damage = 0;
               if ((byte)attacker.NobilityRank == 12)
                   addnobility_damage = (Damage * ((byte)attacker.NobilityRank + 80)) / 100;
               else
                   if ((byte)attacker.NobilityRank > 5)
                       addnobility_damage = (Damage * ((byte)attacker.NobilityRank + 25)) / 100;
               if ((byte)attacked.NobilityRank > 5)
               {
                   if ((addnobility_damage - (uint)((Damage * ((byte)attacked.NobilityRank + 8)) / 100)) > 0)
                   {
                       addnobility_damage -= (int)((Damage * ((byte)attacked.NobilityRank + 8)) / 100);
                   }
                   else
                   {
                       if (Damage > (uint)((Damage * ((byte)attacked.NobilityRank + 8)) / 100))
                       {
                           Damage -= (int)((Damage * ((byte)attacked.NobilityRank + 8)) / 100);
                       }
                       else
                           Damage = 1;
                   }
               }
               if (Damage != 1)
               {
                   Damage += addnobility_damage;
               }

           }
           #endregion
           return (uint)Damage;

       }

       public static uint Magic(Entity attacker, Entity attacked, Database.SpellInformation spell)
       {
           #region Nobility Damage
           if (attacker.NobilityRank != attacked.NobilityRank)
           {
               int addnobility_damage = 0;
               if ((byte)attacker.NobilityRank == 12)
                   addnobility_damage = (Damage * ((byte)attacker.NobilityRank + 80)) / 100;
               else
                   if ((byte)attacker.NobilityRank > 5)
                       addnobility_damage = (Damage * ((byte)attacker.NobilityRank + 25)) / 100;
               if ((byte)attacked.NobilityRank > 5)
               {
                   if ((addnobility_damage - (uint)((Damage * ((byte)attacked.NobilityRank + 8)) / 100)) > 0)
                   {
                       addnobility_damage -= (int)((Damage * ((byte)attacked.NobilityRank + 8)) / 100);
                   }
                   else
                   {
                       if (Damage > (uint)((Damage * ((byte)attacked.NobilityRank + 8)) / 100))
                       {
                           Damage -= (int)((Damage * ((byte)attacked.NobilityRank + 8)) / 100);
                       }
                       else
                           Damage = 1;
                   }
               }
               if (Damage != 1)
               {
                   Damage += addnobility_damage;
               }

           }
           #endregion
           return (uint)Damage;
       }

       public static uint Ranged(Entity attacker, Entity attacked)
       {
           #region Nobility Damage
           if (attacker.NobilityRank != attacked.NobilityRank)
           {
               int addnobility_damage = 0;
               if ((byte)attacker.NobilityRank == 12)
                   addnobility_damage = (Damage * ((byte)attacker.NobilityRank + 80)) / 100;
               else
                   if ((byte)attacker.NobilityRank > 5)
                       addnobility_damage = (Damage * ((byte)attacker.NobilityRank + 25)) / 100;
               if ((byte)attacked.NobilityRank > 5)
               {
                   if ((addnobility_damage - (uint)((Damage * ((byte)attacked.NobilityRank + 8)) / 100)) > 0)
                   {
                       addnobility_damage -= (int)((Damage * ((byte)attacked.NobilityRank + 8)) / 100);
                   }
                   else
                   {
                       if (Damage > (uint)((Damage * ((byte)attacked.NobilityRank + 8)) / 100))
                       {
                           Damage -= (int)((Damage * ((byte)attacked.NobilityRank + 8)) / 100);
                       }
                       else
                           Damage = 1;
                   }
               }
               if (Damage != 1)
               {
                   Damage += addnobility_damage;
               }

           }
           #endregion
           return (uint)Damage;
       }

       public static uint Ranged(Entity attacker, Entity attacked, Database.SpellInformation spell)
       {
           #region Nobility Damage
           if (attacker.NobilityRank != attacked.NobilityRank)
           {
               int addnobility_damage = 0;
               if ((byte)attacker.NobilityRank == 12)
                   addnobility_damage = (Damage * ((byte)attacker.NobilityRank + 80)) / 100;
               else
                   if ((byte)attacker.NobilityRank > 5)
                       addnobility_damage = (Damage * ((byte)attacker.NobilityRank + 25)) / 100;
               if ((byte)attacked.NobilityRank > 5)
               {
                   if ((addnobility_damage - (uint)((Damage * ((byte)attacked.NobilityRank + 8)) / 100)) > 0)
                   {
                       addnobility_damage -= (int)((Damage * ((byte)attacked.NobilityRank + 8)) / 100);
                   }
                   else
                   {
                       if (Damage > (uint)((Damage * ((byte)attacked.NobilityRank + 8)) / 100))
                       {
                           Damage -= (int)((Damage * ((byte)attacked.NobilityRank + 8)) / 100);
                       }
                       else
                           Damage = 1;
                   }
               }
               if (Damage != 1)
               {
                   Damage += addnobility_damage;
               }

           }
           #endregion
           return (uint)Damage;
       }
    }
     
}
LordGragen. is offline  
Old 04/01/2013, 22:39   #2
 
EOS 60D's Avatar
 
elite*gold: 0
Join Date: Feb 2013
Posts: 94
Received Thanks: 13
its more fun if you will remove the nobility extra damage.
EOS 60D is offline  
Old 04/01/2013, 22:41   #3
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
All u Posted can be Coded withing 1 Line Rofl ( Different & better way )
shadowman123 is offline  
Reply




All times are GMT +1. The time now is 09:49.


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.