منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   مشكلات السيرفيرات كونكر الشخصيه (https://code.vpscairo.com/forumdisplay.php?f=12)
-   -   مشكلة في السورس اللي نزلوا MR Online (https://code.vpscairo.com/showthread.php?t=4030)

stevenayman1 2020-03-17 09:20 PM

مشكلة في السورس اللي نزلوا MR Online
 
يا شباب في مشكلة في السورس وهي اني لما باجي اضرب اي وحش ضربة عادية مفيش مشاكل لكن لما اجي اضرب باي اسلكة الاسكلة مش بتضرب وبيجي ايرور زي الصورةhttps://e.top4top.io/p_15379nv3t1.png

Rider 2020-03-18 12:11 AM

رد: مشكلة في السورس اللي نزلوا MR Online
 
صور سطور

stevenayman1 2020-03-18 12:38 AM

رد: مشكلة في السورس اللي نزلوا MR Online
 
اقتباس:

المشاركة الأصلية كتبت بواسطة Rider (المشاركة 32762)
صور سطور

اهم التلاته دول
https://g.top4top.io/p_1537nnxgf1.png
https://h.top4top.io/p_1537urwro2.png
https://i.top4top.io/p_1537lqtzx3.png

Rider 2020-03-19 11:27 AM

رد: مشكلة في السورس اللي نزلوا MR Online
 
فوق
https://g.top4top.io/p_1537nnxgf1.png
جرب تضيف
كود PHP:

if(attacked.entityflag=entityflag.player


MRonlineGvrix 2020-03-19 05:10 PM

رد: مشكلة في السورس اللي نزلوا MR Online
 
اسف يكبير نسيت احلها قبل مرفع وكلمت حاذم يبدل الرابط

الحل بدل الكلاس دا با الى عندك
Calculate

كود PHP:

using System;
using AbdoRedaGxV4.Network.GamePackets;
using System.Runtime.InteropServices;
//using AbdoRedaGxV4.ServerBase;
using AbdoRedaGxV4.Interfaces;
using System.Collections.Generic;
using AbdoRedaGxV4;

namespace 
AbdoRedaGxV4.Game.Attacking
{
    public class 
Calculate
    
{
        public static 
uint Percent(Entity attackedfloat percent)
        {
            return (
uint)(attacked.Hitpoints percent);
        }
        public static 
uint Percent(SobNpcSpawn attackedfloat percent)
        {
            return (
uint)(attacked.Hitpoints percent);
        }
        public static 
uint Percent(int targetfloat percent)
        {
            return (
uint)(target percent);
        }
        public static 
bool RateStatus(byte value)
        {
            return (
Kernel.Random.Next() % 100) < value;
        }
        public static 
bool GetRefinery()
        {
            return 
RateStatus(30);
            
//byte val = (byte)MyRandom.Next(1, 200);
            //return (byte)MyRandom.Next(1, val) > 90;
        
}
        public static 
ulong CalculateExpBonus(ushort Levelushort MonsterLevelulong Experience)
        {
            
int leveldiff = (Level MonsterLevel);
            if (
leveldiff < -5)
                
Experience = (ulong)(Experience 1.3);
            else if (
leveldiff < -1)
                
Experience = (ulong)(Experience 1.2);
            else if (
leveldiff == 4)
                
Experience = (ulong)(Experience 0.8);
            else if (
leveldiff == 5)
                
Experience = (ulong)(Experience 0.3);
            else if (
leveldiff 5)
                
Experience = (ulong)(Experience 0.1);
            return 
Experience;
        }

        
internal static uint CalculateBossDamage(Entity attackerEntity attackedushort SpellID)
        {
            
int Damage 0;
            
Damage MyMath.GetDamageMonster2Entity(attackerattackedSpellID0);
            
Attack a = new Attack(true);
            
CheckDamage(attackerattackedref Damageref atrue);
            return (
uint)Damage;
        }

        
internal static uint Magic(Entity attackerEntity attackedDatabase.SpellInformation spellref Attack attackbyte p 0)
        {
            
int Damage 0;

            if (
attacked.EntityFlag == EntityFlag.Monster)
                
Damage MyMath.GetDamageEntity2Monster(attackerattackedspell.IDspell.Levelref attack);
            else
                
Damage MyMath.GetDamageEntity2Entity(attackerattackedspell.IDspell.Levelref attack);

            
CheckDamage(attackerattackedref Damageref attacktrue);
            return (
uint)Damage;
        }

        
internal static uint Melee(Entity attackerSobNpcSpawn attackedSobNpcref Attack attack)
        {
            return (
uint)MyMath.GetDamageEntity2Environment(attackerattackedSobNpc, (byte)Attack.Meleeref attack);
        }

        
internal static uint Melee(Entity attackerEntity attackedDatabase.SpellInformation spellref Attack attackbyte p 0)
        {
            
int Damage 0;
            if (
attacked.EntityFlag == EntityFlag.Monster)
                
Damage MyMath.GetDamageEntity2Monster(attackerattackedspell.IDspell.Levelref attack);
            else
                
Damage MyMath.GetDamageEntity2Entity(attackerattackedspell.IDspell.Levelref attack);

            
CheckDamage(attackerattackedref Damageref attackfalse);
            return (
uint)Damage;
        }

        
internal static uint MonsterDamage(Entity attackerEntity attackedref Attack attackbool p)
        {
            
int Damage 0;
            
Damage MyMath.GetDamageMonster2Entity(attackerattacked, !Attack.Melee Attack.Magic);
            
Attack a = new Attack(true);
            
CheckDamage(attackerattackedref Damageref ap);
            return (
uint)Damage;
        }

        
internal static uint MonsterDamage(Entity attackerEntity attackedushort spellid)
        {
            
int Damage 0;
            
Damage MyMath.GetDamageMonster2Entity(attackerattackedspellid0);
            
Attack a = new Attack(true);
            
CheckDamage(attackerattackedref Damageref afalse);
            return (
uint)Damage;
        }

        
internal static uint Ranged(Entity attackerEntity attackedref Attack attackbyte p 0)
        {
            
int Damage 0;

            if (
attacked.EntityFlag == EntityFlag.Monster)
                
Damage MyMath.GetDamageEntity2Monster(attackerattackedAttack.Rangedref attack);
            else
                
Damage MyMath.GetDamageEntity2Entity(attackerattackedAttack.Rangedref attack);

            
CheckDamage(attackerattackedref Damageref attackfalse);
            return (
uint)Damage;
        }

        
internal static uint Melee(Entity attackerEntity attackedref Attack attackbyte p 0)
        {
            
int Damage 0;

            if (
attacked.EntityFlag == EntityFlag.Monster)
                
Damage MyMath.GetDamageEntity2Monster(attackerattackedAttack.Meleeref attack);
            else
                
Damage MyMath.GetDamageEntity2Entity(attackerattackedAttack.Meleeref attack);

            
CheckDamage(attackerattackedref Damageref attackfalse);
            return (
uint)Damage;
        }

        
internal static uint Magic(Entity attackerEntity attackedref Attack attackbyte p 0)
        {
            
int Damage 0;

            if (
attacked.EntityFlag == EntityFlag.Monster)
                
Damage MyMath.GetDamageEntity2Monster(attackerattackedAttack.Magicref attack);
            else
                
Damage MyMath.GetDamageEntity2Entity(attackerattackedAttack.Magicref attack);

            
CheckDamage(attackerattackedref Damageref attackfalse);
            return (
uint)Damage;
        }

        
internal static uint Ranged(Entity attackerSobNpcSpawn attackedsobref Attack attack)
        {
            return (
uint)MyMath.GetDamageEntity2Environment(attackerattackedsobAttack.Rangedref attack) / 24;
        }

        
internal static uint Magic(Entity attackerSobNpcSpawn attackedsobDatabase.SpellInformation spellref Attack attack)
        {
            return (
uint)MyMath.GetDamageEntity2Environment(attackerattackedsobspell.IDspell.Levelref attack);
        }

        
internal static uint Ranged(Entity attackerEntity attackedDatabase.SpellInformation spellref Attack attackbyte p 0)
        {
            
int Damage 0;
            if (
attacked.EntityFlag == EntityFlag.Monster)
                
Damage MyMath.GetDamageEntity2Monster(attackerattackedspell.IDspell.Levelref attack);
            else
                
Damage MyMath.GetDamageEntity2Entity(attackerattackedspell.IDspell.Levelref attack);

            
CheckDamage(attackerattackedref Damageref attackfalse);
            return (
uint)Damage;
        }
        public static 
int CalculateSkillCStrike(Entity AttackerClientEntity AttackedClientint damage)
        {
            if (
AttackerClient.SkillCStrike == AttackedClient.Immunity)
                return 
damage;
            if (
AttackerClient.SkillCStrike AttackedClient.Immunity)
            {
                
int Power = (int)(AttackerClient.SkillCStrike AttackedClient.Immunity);
                
damage = (int)((double)damage 1.500);
            }
            return 
damage;
        }
        public static 
int CalculateCriticalStrike(Entity AttackerClientEntity AttackedClientint damage)
        {
            if (
AttackerClient.CriticalStrike == AttackedClient.Immunity)
                return 
damage;

            if (
AttackerClient.CriticalStrike AttackedClient.Immunity)
            {
                
damage = (int)((double)damage 1.500);
            }
            return 
damage;
        }
        public static 
int CalculateBreaktrough(Entity AttackerClientEntity AttackedClientint damage)
        {
            if ((
AttackerClient.Breaktrough == AttackedClient.Counteraction) || AttackerClient.Class >= 130 && AttackerClient.Class <= 135)
                return 
damage;
            if (
AttackerClient.Breaktrough AttackedClient.Counteraction)
            {
                
int Power = (int)(AttackerClient.Breaktrough AttackedClient.Counteraction);
                
damage = (int)((double)damage 1.600);
            }
            return 
damage;
        }
        private static 
void AutoRespone(Entity attackerEntity attackedref int Damage)
        {
            try
            {
                if (
attacker.EntityFlag == EntityFlag.Entity)
                {
                    if (
attacker.Owner.Spells.ContainsKey(11120))
                    {
                        var 
attacker.Owner.Spells[11120];
                        var 
spell Database.SpellTable.SpellInformations[s.ID][s.Level];
                        if (
spell != null)
                        {
                            if (
Kernel.Rate(spell.Percent))
                            {
                                var 
ent attacked as Entity;
                                if (!
ent.IsBlackSpotted)
                                {
                                    
ent.IsBlackSpotted true;
                                    
ent.BlackSpotStamp Time32.Now;
                                    
ent.BlackSpotStepSecs spell.Duration;
                                    
Kernel.BlackSpoted.TryAdd(ent.UIDent);
                                    
BlackSpotPacket bsp = new BlackSpotPacket();
                                    foreach (var 
h in Program.GamePool)
                                    {
                                        
h.Send(bsp.ToArray(trueent.UID));
                                    }
                                }
                            }
                        }
                    }
                }
                if (
attacked.EntityFlag == EntityFlag.Entity)
                {
                    if (
attacked.Owner.Spells.ContainsKey(11130) && attacked.Owner.Entity.IsEagleEyeShooted)
                    {
                        var 
attacked.Owner.Spells[11130];
                        var 
spell Database.SpellTable.SpellInformations[s.ID][s.Level];
                        if (
spell != null)
                        {
                            if (
Kernel.Rate(spell.Percent))
                            {
                                
attacked.Owner.Entity.IsEagleEyeShooted false;
                                
SpellUse ssuse = new SpellUse(true);
                                
ssuse.Attacker attacked.UID;
                                
ssuse.SpellID spell.ID;
                                
ssuse.SpellLevel spell.Level;
                                
ssuse.AddTarget(attacked.Owner.Entity, new SpellUse.DamageClass().Damage 11030null);
                                if (
attacked.EntityFlag == EntityFlag.Entity)
                                {
                                    
attacked.Owner.SendScreen(ssusetrue);
                                }
                            }
                        }
                    }
                    if (
attacked.CounterKillSwitch && Kernel.Rate(30) && !attacker.ContainsFlag((ulong)Update.Flags.Fly) && Time32.Now attacked.CounterKillStamp.AddSeconds(15))
                    {
                        
attacked.CounterKillStamp Time32.Now;
                        
Network.GamePackets.Attack attack = new AbdoRedaGxV4.Network.GamePackets.Attack(true);
                        
attack.Effect1 Attack.AttackEffects1.None;
                        
uint damage Melee(attackedattackerref attack);
                        
damage damage 3;
                        
attack.Attacked attacker.UID;
                        
attack.Attacker attacked.UID;
                        
attack.AttackType Network.GamePackets.Attack.Scapegoat;
                        
attack.Damage 0;
                        
attack.ResponseDamage damage;
                        
attack.attacked.X;
                        
attack.attacked.Y;

                        if (
attacker.Hitpoints <= damage)
                        {
                            if (
attacker.EntityFlag == EntityFlag.Entity)
                            {
                                
attacked.Owner.UpdateQualifier(attacker.Hitpoints);
                                
attacker.Owner.SendScreen(attacktrue);
                                
attacked.AttackPacket null;
                            }
                            else
                            {
                                
attacker.MonsterInfo.SendScreen(attack);
                            }
                            
attacker.Die(attacked);
                        }
                        else
                        {
                            
attacker.Hitpoints -= damage;
                            if (
attacker.EntityFlag == EntityFlag.Entity)
                            {
                                
attacked.Owner.UpdateQualifier(attacker.Hitpoints);
                                
attacker.Owner.SendScreen(attacktrue);
                            }
                            else
                            {
                                
attacker.MonsterInfo.SendScreen(attack);
                            }
                        }
                        
Damage 0;
                    }
                    else if (
attacked.Owner.Spells.ContainsKey(3060) && Kernel.Rate(15))
                    {
                        
uint damage = (uint)(Damage 10);
                        if (
damage <= 0)
                            
damage 1;
                        if (
damage 10000damage 10000;
                        
Network.GamePackets.Attack attack = new AbdoRedaGxV4.Network.GamePackets.Attack(true);
                        
attack.Attacked attacker.UID;
                        
attack.Attacker attacked.UID;
                        
attack.AttackType Network.GamePackets.Attack.Reflect;
                        
attack.Damage damage;
                        
attack.ResponseDamage damage;
                        
attack.attacked.X;
                        
attack.attacked.Y;

                        if (
attacker.Hitpoints <= damage)
                        {
                            if (
attacker.EntityFlag == EntityFlag.Entity)
                            {
                                
attacked.Owner.UpdateQualifier(attacker.Hitpoints);
                                
attacker.Owner.SendScreen(attacktrue);
                                
attacked.AttackPacket null;
                            }
                            else
                            {
                                
attacker.MonsterInfo.SendScreen(attack);
                            }
                            
attacker.Die(attacked);
                        }
                        else
                        {
                            
attacker.Hitpoints -= damage;
                            if (
attacker.EntityFlag == EntityFlag.Entity)
                            {
                                
attacked.Owner.UpdateQualifier(attacker.Hitpoints);
                                
attacker.Owner.SendScreen(attacktrue);
                            }
                            else
                            {
                                
attacker.MonsterInfo.SendScreen(attack);
                            }
                        }
                        
Damage 0;
                    }
                }
            }
            catch (
Exception e) { Program.SaveException(e); }
        }
        public static 
void CheckDamage(Entity attackerEntity attackedref int Damageref Attack Packetbool magic false)
        {
            if (
attacked.EntityFlag == EntityFlag.Monster)
            {
                if (!
attacker.Assassin() && !attacker.IsChaser1())
                {
                    if (
attacked.MonsterInfo.Boss || attacked.Boss == 1)
                    {
                        if (
magic)
                            
Damage = (int)Damage 10;
                        else
                            
Damage = (int)Damage 4;
                        return;
                    }
                }
            }
            if (
attacker.EntityFlag == EntityFlag.Entity)
            {
                
BlessEffect.Effect(attacker);
                
GemEffect.Effect(attacker);
            }
            
Calculate.AutoRespone(attackerattackedref Damage);
            if (
attacked.ContainsFlag2(Network.GamePackets.Update.Flags2.AzureShield))
            {

                if (
Damage attacked.AzureShieldDefence)
                {
                    
Damage -= attacked.AzureShieldDefence;
                    
CreateAzureDMG(attacked.AzureShieldDefenceattackerattacked);
                    
attacked.RemoveFlag2(Network.GamePackets.Update.Flags2.AzureShield);
                }
                else
                {
                    
CreateAzureDMG((uint)Damageattackerattacked);
                    
attacked.AzureShieldDefence -= (ushort)Damage;
                    
attacked.AzureShieldPacket();
                    
Damage 1;
                }
            }
            
#region Nobility Damage
            
if (attacked.EntityFlag == EntityFlag.Entity && (attacker.BattlePower attacked.BattlePower))
            {
                if (
attacked.Owner.Challenge == null)
                {
                    if (
attacker.EntityFlag == EntityFlag.Monster) return;
                    
int sub attacked.BattlePower attacker.BattlePower;
                    
//sub *= 2000;//##Samak BattlePower
                    
if (sub 41)
                    {
                        if (
attacker.EntityFlag == EntityFlag.Monster) return;
                        
Damage 1;
                    }
                    else
                    {
//Samak
                        
if (attacker.EntityFlag == EntityFlag.Monster) return;
                        
Damage = (Int32)Math.Floor((float)Damage * (.75 - (sub 0.01)));
                    }
                }
            }
            if (
attacked.EntityFlag == EntityFlag.Entity && (attacker.BattlePower attacked.BattlePower))
            {
                if (
attacked.Owner.Challenge == null)
                {
                    if (
attacker.EntityFlag == EntityFlag.Monster) return;
                    
int dmg attacked.BattlePower attacker.BattlePower;
                    if (
dmg 50)
                    {
                        if (
attacker.EntityFlag == EntityFlag.Monster) return;
                        
Damage Damage 2;
                    }
                    else
                        if (
attacker.EntityFlag == EntityFlag.Monster) return;
                    
Damage = (Int32)Math.Floor((float)Damage * (1.10 - (dmg 0.01)));
                }
            }
            
#endregion
            /*  #region Nobility Damage
            #region King
            if (attacker.NobilityRank == ConquerStructures.NobilityRank.King)
            {
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.King)
                {
                    Damage = (int)((double)Damage * 1.08);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Prince)
                {
                    Damage = (int)((double)Damage * 1.18);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Duke)
                {
                    Damage = (int)((double)Damage * 1.19);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Earl)
                {
                    Damage = (int)((double)Damage * 1.20);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Baron)
                {
                    Damage = (int)((double)Damage * 1.21);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Knight)
                {
                    Damage = (int)((double)Damage * 1.22);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Serf)
                {
                    Damage = (int)((double)Damage * 1.23);
                }
            }
            #endregion King
            #region Prince
            if (attacker.NobilityRank == ConquerStructures.NobilityRank.Prince)
            {
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.King)
                {
                    Damage = (int)((double)Damage * 1.03);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Prince)
                {
                    Damage = (int)((double)Damage * 1.07);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Duke)
                {
                    Damage = (int)((double)Damage * 1.19);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Earl)
                {
                    Damage = (int)((double)Damage * 1.20);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Baron)
                {
                    Damage = (int)((double)Damage * 1.21);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Knight)
                {
                    Damage = (int)((double)Damage * 1.22);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Serf)
                {
                    Damage = (int)((double)Damage * 1.23);
                }
            }
            #endregion Prince
            #region Duke
            if (attacker.NobilityRank == ConquerStructures.NobilityRank.Duke)
            {
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.King)
                {
                    Damage = (int)((double)Damage * 1.02);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Prince)
                {
                    Damage = (int)((double)Damage * 0.99);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Duke)
                {
                    Damage = (int)((double)Damage * 1.08);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Earl)
                {
                    Damage = (int)((double)Damage * 1.19);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Baron)
                {
                    Damage = (int)((double)Damage * 1.20);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Knight)
                {
                    Damage = (int)((double)Damage * 1.21);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Serf)
                {
                    Damage = (int)((double)Damage * 1.22);
                }
            }
            #endregion Duke
            #region Earl
            if (attacker.NobilityRank == ConquerStructures.NobilityRank.Earl)
            {
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.King)
                {
                    Damage = (int)((double)Damage * 0.91);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Prince)
                {
                    Damage = (int)((double)Damage * 0.95);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Duke)
                {
                    Damage = (int)((double)Damage * 1);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Earl)
                {
                    Damage = (int)((double)Damage * 1.05);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Baron)
                {
                    Damage = (int)((double)Damage * 1.19);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Knight)
                {
                    Damage = (int)((double)Damage * 1.20);
                }
                if (attacked.NobilityRank == ConquerStructures.NobilityRank.Serf)
                {
                    Damage = (int)((double)Damage * 1.21);
                }
            }
            #endregion Earl
            #endregion*/
            #region DragonSwing
            
if (Kernel.Rate(20))//bas kada
            
{
                if (
attacked.ContainsFlag3(Update.Flags3.DragonSwing))
                {
                    
_String str = new _String(true);
                    
str.UID attacked.UID;
                    
str.TextsCount 1;
                    
str.Type _String.Effect;
                    
str.Texts.Add("poisonmiss");
                    if (
attacked.EntityFlag == EntityFlag.Entity)
                        
attacked.Owner.SendScreen(strtrue);
                    
Damage 0;
                }
            }
            
#endregion
            
if (attacked.ContainsFlag(Network.GamePackets.Update.Flags.ShurikenVortex))
                
Damage 1;
            if (
Constants.Damage1Map.Contains(attacked.MapID))
                
Damage 1;
        }
        public static 
void CreateAzureDMG(uint dmgEntity attackerEntity attacked)
        {
            
Network.GamePackets.Attack attac = new Attack(true);
            
attac.Attacker attacker.UID;
            
attac.Attacked attacked.UID;
            
attac.attacked.X;
            
attac.attacked.Y;
            
attac.AttackType 55;
            
attac.Damage dmg;
            
attacked.Owner.SendScreen(attactrue);
        }
        public static 
Int64 GetAgilityWeapons(Entity Attacker)
        {
            
double result 0;
            if (
Attacker.Transformed)
            {
                
result Attacker.TransformationHitRate 100.0f;
            }
            else
            {
                
int Values 0;
                
int Junk 0;
                for (
uint i 010i++)
                {
                    if (
!= 5)
                    {
                        
ConquerItem item Attacker.Owner.Equipment.TryGetItem(i);
                        
Database.ConquerItemInformation CII = new Database.ConquerItemInformation(item.IDitem.Plus);
                        if (
item.Durability != 0)
                            if (
item != null && item.ID != 0)
                            {
                                
int now = (CII.BaseInformation.Agility Attacker.Gems[2]) + Attacker.Gems[2] + Values;
                                
Values now CII.PlusInformation.Agility;
                                
Junk += Attacker.Gems[2]; //UnUse grin emoticon .
                            
}
                    }
                    else
                        continue;
                }
                
result = ((Attacker.Agility) * ((double)Values 100.0f) * 0.0099999998f 100.0f);
            }
            return (
Int64)result;
        }
        public static 
bool isDodged(Entity AttackerEntity Attacked)
        {
            
int result 0;
            
double percent 0;
            if (
Attacker != null && Attacked != null)
            {
                if (!
Attacker.Transformed)
                {
                    
result = (Attacker.Agility >> /* /2 */) - Attacked.Dodge 100;
                    if (
Attacker.Agility != 0)
                    {
                        
percent = (double)((GetAgilityWeapons(Attacker) / Attacker.Agility) - 100.0f) * 0.01f 1.0f;
                    }
                    else
                    {
                        
percent 1.0f;
                    }
                    
//Todo Status Hitrate Status skill :D
                    
result = (int)(percent result);
                    if (
Attacker.Owner.Entity.IsBow() && Attacker.Owner.Entity.IsShield())
                    {
                        
result result 12 100;
                    }
                    
result Math.Max(10Math.Min(90result));
                    if (
Attacker.EntityFlag == EntityFlag.Entity)
                    {
                        if (
Attacked.EntityFlag == EntityFlag.Monster)
                        {
                            
int AntiMonsterPercent Attacker.Level Attacked.Level;
                            if (
AntiMonsterPercent 0)
                            {
                                
result += 10 * (AntiMonsterPercent 5);
                            }
                            if (
Attacker.ContainsFlag(Update.Flags.Cyclone))
                                
result 100;
                        }
                    }
                }
            }
            else
            {
                return 
true;
            }
            return 
Kernel.RandGet(100) >= result;
        }
        public static 
void Immu(Entity Attacked)
        {
            if (
Attacked.EntityFlag == EntityFlag.Entity)
            {
                
_String str = new _String(true);
                
str.UID Attacked.UID;
                
str.TextsCount 1;
                
str.Type _String.Effect;
                
str.Texts.Add("bossimmunity");

                
Attacked.Owner.SendScreen(strtrue);
            }

        }
        public static 
void Refinary(Entity attackerEntity attackedref double Damageref Attack Packetbool magic false)
        {
            if (
attacker.Name == "Thundercloud") return;
            if (
attacker.EntityFlag == EntityFlag.Entity)
            {
                if (!
attacker.IsTaoist(attacker.Class))
                {
                    if (
attacked.BattlePower attacker.BattlePower)
                    {
                        if (
attacker.Breaktrough 0)
                        {
                            if (
attacker.Breaktrough attacked.Counteraction)
                            {
                                
double Power = (double)(attacker.Breaktrough attacked.Counteraction);
                                if (
attacker.NobilityRank ConquerStructures.NobilityRank.King)
                                {
                                    
Power = (double)(Power 0);
                                    if (
MyMath.Success2(Power))
                                    {
                                        
Damage += Damage 1;
                                        
Damage += 15000;
                                        
Packet.Effect1 |= Attack.AttackEffects1.Break;
                                    }
                                    else 
Immu(attacked);
                                }
                                else
                                {
                                    
Power = (double)(Power 0);
                                    if (
MyMath.Success(Power))
                                    {
                                        
Damage += Damage 1;
                                        
Packet.Effect1 |= Attack.AttackEffects1.Break;
                                    }
                                    else 
Immu(attacked);
                                }
                            }
                            else
                                
Immu(attacked);

                        }
                    }
                    if (
RateStatus(80))
                    {

                        if (!
magic)
                        {
                            if (
attacker.CriticalStrike 0)
                            {
                                if (
attacker.CriticalStrike attacked.Immunity)
                                {
                                    
double Power = (double)(attacker.CriticalStrike attacked.Immunity);
                                    if (
Kernel.ChanceSuccess2(((float)attacker.CriticalStrike 300f) - ((float)attacked.Immunity 300f)))
                                    {
                                        
Damage += 15000;
                                        
Packet.Effect1 |= Attack.AttackEffects1.CriticalStrike;
                                    }

                                    else
                                        
Immu(attacked);

                                }
                                else
                                    
Immu(attacked);
                            }
                        }
                        else
                        {
                            if (
attacker.Penetration 0)
                            {
                                
double Power = (double)(attacker.Penetration 1);
                                if (
MyMath.Success(Power))
                                {
                                    
Damage += Damage 4;
                                    
Packet.Effect1 |= Attack.AttackEffects1.Penetration;
                                }
                                else if (
attacker.SkillCStrike 0)
                                {
                                    if (
attacker.SkillCStrike >= attacked.Immunity)
                                    {
                                        
Power = (double)(attacker.SkillCStrike attacked.Immunity);
                                        
Power = (double)(Power 100);
                                        if (
MyMath.Success(Power))
                                        {
                                            
Damage += Damage 50 100;
                                            
Packet.Effect1 |= Attack.AttackEffects1.CriticalStrike;
                                        }
                                        else
                                            
Immu(attacked);
                                    }

                                }
                                else
                                    
Immu(attacked);
                            }
                            else if (
attacker.SkillCStrike 0)
                            {
                                if (
attacker.SkillCStrike >= attacked.Immunity)
                                {
                                    
double Power = (double)(attacker.SkillCStrike attacked.Immunity);
                                    
Power = (double)(Power 100);
                                    if (
MyMath.Success(Power))
                                    {
                                        
Damage += Damage 50 100;
                                        
Packet.Effect1 |= Attack.AttackEffects1.CriticalStrike;
                                    }
                                    else
                                        
Immu(attacked);
                                }

                            }
                            else
                                
Immu(attacked);
                        }
                    }
                }
            }
            if (
attacked.EntityFlag == EntityFlag.Entity)
            {
                if (
RateStatus(5))
                {
                    if (
attacked.Block 0)
                    {
                        
double Power = (double)(attacked.Block 2);
                        if (
MyMath.Success(Power))
                        {
                            
Damage Damage 2;
                            
Packet.Effect1 |= Attack.AttackEffects1.Block;
                        }
                    }
                    if (
attacked.IsShieldBlock)
                    {
                        if (
MyMath.Success(attacked.ShieldBlockPercent))
                        {
                            
Damage Damage 2;
                            
Packet.Effect1 |= Attack.AttackEffects1.Block;
                        }
                    }

                }
            }
        }
        public static 
void Refinary(Entity attackerSobNpcSpawn attackedref double Damageref Attack Packetbool magic false)
        {
            if (
attacker.EntityFlag == EntityFlag.Entity)
            {
                if (
RateStatus(10))
                {

                    if (!
magic)
                    {
                        if (
attacker.CriticalStrike 0)
                        {

                            
double Power = (double)(attacker.CriticalStrike);
                            
Power = (double)(Power 100);
                            if (
MyMath.Success(Power))
                            {
                                
Damage += Damage 80 100;
                                
Packet.Effect1 |= Attack.AttackEffects1.CriticalStrike;
                            }
                        }
                    }
                    else
                    {
                        if (
attacker.Penetration 0)
                        {
                            
double Power = (double)(attacker.Penetration 100);
                            if (
MyMath.Success(Power))
                            {
                                
Damage Damage 50 100;
                                
Packet.Effect1 |= Attack.AttackEffects1.Penetration;
                            }

                        }
                        if (
attacker.SkillCStrike 0)
                        {
                            
double Power = (double)(attacker.SkillCStrike);
                            
Power = (double)(Power 100);
                            if (
MyMath.Success(Power))
                            {
                                
Damage += Damage 50 100;
                                
Packet.Effect1 |= Attack.AttackEffects1.CriticalStrike;
                            }
                        }
                    }
                }
            }
        }
    }

}
namespace 
AbdoRedaGxV4
{
    public class 
StatusConstants
    
{
        public const 
int AdjustSet = -30000,
                         
AdjustFull = -32768,
                         
AdjustPercent 30000;
    }
    public class 
MathHelper
    
{
        public static 
int BitFold32(int lower16int higher16)
        {
            return (
lower16) | (higher16 << 16);
        }
        public static 
void BitUnfold32(int bits32out int lower16out int upper16)
        {
            
lower16 = (int)(bits32 UInt16.MaxValue);
            
upper16 = (int)(bits32 >> 16);
        }
        public static 
void BitUnfold64(ulong bits64out int lower32out int upper32)
        {
            
lower32 = (int)(bits64 UInt32.MaxValue);
            
upper32 = (int)(bits64 >> 32);
        }
        public static 
int RoughDistance(int x1int y1int x2int y2)
        {
            return 
Math.Max(Math.Abs(x1 x2), Math.Abs(y1 y2));
        }
        public static 
int ConquerDirection(int x1int y1int x2int y2)
        {
            
double angle Math.Atan2(y2 y1x2 x1);
            
angle -= Math.PI 2;

            if (
angle 0angle += Math.PI;

            
angle *= / (Math.PI);
            return (int)
angle;
        }
        public static 
int MulDiv(int numberint numeratorint denominator)
        {
            return (
number numerator denominator 2) / denominator;
        }
        public static 
bool OverflowAdd(ref int accint add)
        {
            if (
int.MaxValue acc add)
                return 
true;
            
acc Math.Max(acc add0);
            return 
false;
        }
        public static 
int AdjustDataEx(int dataint adjustint maxData 0)
        {
            if (
adjust >= StatusConstants.AdjustPercent)
                return 
MulDiv(dataadjust StatusConstants.AdjustPercent100);

            if (
adjust <= StatusConstants.AdjustSet)
                return -
adjust StatusConstants.AdjustSet;

            if (
adjust == StatusConstants.AdjustFull)
                return 
maxData;

            return 
data adjust;
        }
    }
    public class 
GemTypes
    
{
        public const 
int
            Phoenix 
0,
            
Dragon 1,
            
Fury 2,
            
Rainbow 3,
            
Kylin 4,
            
Violet 5,
            
Moon 6,
            
Tortoise 7,
            
Thunder 10,
            
Glory 12,

            
First Phoenix,
            
Last Glory 1;

        public static 
readonly string[] Animation = new string[]
                {
                    
"phoenix",
                    
"goldendragon",
                    
"fastflash",
                    
"rainbow",
                    
"goldenkylin",
                    
"purpleray",
                    
"moon",
                    
"recovery"
                
};

        public static 
readonly int[][] Effects = new[]
                {
                    new[] { 
051015 },
                    new[] { 
051015 },
                    new[] { 
051015 },
                    new[] { 
0101525 },
                    new[] { 
050100200 },
                    new[] { 
03050100 },
                    new[] { 
0153050 },
                    new[] { 
024},
                    new[] { 
000},
                    new[] { 
000},
                    new[] { 
0100300500 },
                    new[] { 
000},
                    new[] { 
0100300500 }
                };
    }



stevenayman1 2020-03-19 07:05 PM

رد: مشكلة في السورس اللي نزلوا MR Online
 
اقتباس:

المشاركة الأصلية كتبت بواسطة Rider (المشاركة 32855)
فوق

جرب تضيف
كود PHP:

if(attacked.entityflag=entityflag.player


جاب يرور هنا entityflag

stevenayman1 2020-03-19 07:11 PM

رد: مشكلة في السورس اللي نزلوا MR Online
 
اقتباس:

المشاركة الأصلية كتبت بواسطة mronlinegvrix (المشاركة 32888)
اسف يكبير نسيت احلها قبل مرفع وكلمت حاذم يبدل الرابط

الحل بدل الكلاس دا با الى عندك
calculate

كود PHP:

using system;
using abdoredagxv4.network.gamepackets;
using system.runtime.interopservices;
//using abdoredagxv4.serverbase;
using abdoredagxv4.interfaces;
using system.collections.generic;
using abdoredagxv4;

namespace 
abdoredagxv4.game.attacking
{
    public class 
calculate
    
{
        public static 
uint percent(entity attackedfloat percent)
        {
            return (
uint)(attacked.hitpoints percent);
        }
        public static 
uint percent(sobnpcspawn attackedfloat percent)
        {
            return (
uint)(attacked.hitpoints percent);
        }
        public static 
uint percent(int targetfloat percent)
        {
            return (
uint)(target percent);
        }
        public static 
bool ratestatus(byte value)
        {
            return (
kernel.random.next() % 100) < value;
        }
        public static 
bool getrefinery()
        {
            return 
ratestatus(30);
            
//byte val = (byte)myrandom.next(1, 200);
            //return (byte)myrandom.next(1, val) > 90;
        
}
        public static 
ulong calculateexpbonus(ushort levelushort monsterlevelulong experience)
        {
            
int leveldiff = (level monsterlevel);
            if (
leveldiff < -5)
                
experience = (ulong)(experience 1.3);
            else if (
leveldiff < -1)
                
experience = (ulong)(experience 1.2);
            else if (
leveldiff == 4)
                
experience = (ulong)(experience 0.8);
            else if (
leveldiff == 5)
                
experience = (ulong)(experience 0.3);
            else if (
leveldiff 5)
                
experience = (ulong)(experience 0.1);
            return 
experience;
        }

        
internal static uint calculatebossdamage(entity attackerentity attackedushort spellid)
        {
            
int damage 0;
            
damage mymath.getdamagemonster2entity(attackerattackedspellid0);
            
attack a = new attack(true);
            
checkdamage(attackerattackedref damageref atrue);
            return (
uint)damage;
        }

        
internal static uint magic(entity attackerentity attackeddatabase.spellinformation spellref attack attackbyte p 0)
        {
            
int damage 0;

            if (
attacked.entityflag == entityflag.monster)
                
damage mymath.getdamageentity2monster(attackerattackedspell.idspell.levelref attack);
            else
                
damage mymath.getdamageentity2entity(attackerattackedspell.idspell.levelref attack);

            
checkdamage(attackerattackedref damageref attacktrue);
            return (
uint)damage;
        }

        
internal static uint melee(entity attackersobnpcspawn attackedsobnpcref attack attack)
        {
            return (
uint)mymath.getdamageentity2environment(attackerattackedsobnpc, (byte)attack.meleeref attack);
        }

        
internal static uint melee(entity attackerentity attackeddatabase.spellinformation spellref attack attackbyte p 0)
        {
            
int damage 0;
            if (
attacked.entityflag == entityflag.monster)
                
damage mymath.getdamageentity2monster(attackerattackedspell.idspell.levelref attack);
            else
                
damage mymath.getdamageentity2entity(attackerattackedspell.idspell.levelref attack);

            
checkdamage(attackerattackedref damageref attackfalse);
            return (
uint)damage;
        }

        
internal static uint monsterdamage(entity attackerentity attackedref attack attackbool p)
        {
            
int damage 0;
            
damage mymath.getdamagemonster2entity(attackerattacked, !Attack.melee Attack.magic);
            
attack a = new attack(true);
            
checkdamage(attackerattackedref damageref ap);
            return (
uint)damage;
        }

        
internal static uint monsterdamage(entity attackerentity attackedushort spellid)
        {
            
int damage 0;
            
damage mymath.getdamagemonster2entity(attackerattackedspellid0);
            
attack a = new attack(true);
            
checkdamage(attackerattackedref damageref afalse);
            return (
uint)damage;
        }

        
internal static uint ranged(entity attackerentity attackedref attack attackbyte p 0)
        {
            
int damage 0;

            if (
attacked.entityflag == entityflag.monster)
                
damage mymath.getdamageentity2monster(attackerattackedattack.rangedref attack);
            else
                
damage mymath.getdamageentity2entity(attackerattackedattack.rangedref attack);

            
checkdamage(attackerattackedref damageref attackfalse);
            return (
uint)damage;
        }

        
internal static uint melee(entity attackerentity attackedref attack attackbyte p 0)
        {
            
int damage 0;

            if (
attacked.entityflag == entityflag.monster)
                
damage mymath.getdamageentity2monster(attackerattackedattack.meleeref attack);
            else
                
damage mymath.getdamageentity2entity(attackerattackedattack.meleeref attack);

            
checkdamage(attackerattackedref damageref attackfalse);
            return (
uint)damage;
        }

        
internal static uint magic(entity attackerentity attackedref attack attackbyte p 0)
        {
            
int damage 0;

            if (
attacked.entityflag == entityflag.monster)
                
damage mymath.getdamageentity2monster(attackerattackedattack.magicref attack);
            else
                
damage mymath.getdamageentity2entity(attackerattackedattack.magicref attack);

            
checkdamage(attackerattackedref damageref attackfalse);
            return (
uint)damage;
        }

        
internal static uint ranged(entity attackersobnpcspawn attackedsobref attack attack)
        {
            return (
uint)mymath.getdamageentity2environment(attackerattackedsobattack.rangedref attack) / 24;
        }

        
internal static uint magic(entity attackersobnpcspawn attackedsobdatabase.spellinformation spellref attack attack)
        {
            return (
uint)mymath.getdamageentity2environment(attackerattackedsobspell.idspell.levelref attack);
        }

        
internal static uint ranged(entity attackerentity attackeddatabase.spellinformation spellref attack attackbyte p 0)
        {
            
int damage 0;
            if (
attacked.entityflag == entityflag.monster)
                
damage mymath.getdamageentity2monster(attackerattackedspell.idspell.levelref attack);
            else
                
damage mymath.getdamageentity2entity(attackerattackedspell.idspell.levelref attack);

            
checkdamage(attackerattackedref damageref attackfalse);
            return (
uint)damage;
        }
        public static 
int calculateskillcstrike(entity attackercliententity attackedclientint damage)
        {
            if (
attackerclient.skillcstrike == attackedclient.immunity)
                return 
damage;
            if (
attackerclient.skillcstrike attackedclient.immunity)
            {
                
int power = (int)(attackerclient.skillcstrike attackedclient.immunity);
                
damage = (int)((double)damage 1.500);
            }
            return 
damage;
        }
        public static 
int calculatecriticalstrike(entity attackercliententity attackedclientint damage)
        {
            if (
attackerclient.criticalstrike == attackedclient.immunity)
                return 
damage;

            if (
attackerclient.criticalstrike attackedclient.immunity)
            {
                
damage = (int)((double)damage 1.500);
            }
            return 
damage;
        }
        public static 
int calculatebreaktrough(entity attackercliententity attackedclientint damage)
        {
            if ((
attackerclient.breaktrough == attackedclient.counteraction) || attackerclient.class >= 130 && attackerclient.class <= 135)
                return 
damage;
            if (
attackerclient.breaktrough attackedclient.counteraction)
            {
                
int power = (int)(attackerclient.breaktrough attackedclient.counteraction);
                
damage = (int)((double)damage 1.600);
            }
            return 
damage;
        }
        private static 
void autorespone(entity attackerentity attackedref int damage)
        {
            try
            {
                if (
attacker.entityflag == entityflag.entity)
                {
                    if (
attacker.owner.spells.containskey(11120))
                    {
                        var 
attacker.owner.spells[11120];
                        var 
spell database.spelltable.spellinformations[s.id][s.level];
                        if (
spell != null)
                        {
                            if (
kernel.rate(spell.percent))
                            {
                                var 
ent attacked as entity;
                                if (!
ent.isblackspotted)
                                {
                                    
ent.isblackspotted true;
                                    
ent.blackspotstamp time32.now;
                                    
ent.blackspotstepsecs spell.duration;
                                    
kernel.blackspoted.tryadd(ent.uident);
                                    
blackspotpacket bsp = new blackspotpacket();
                                    foreach (var 
h in program.gamepool)
                                    {
                                        
h.send(bsp.toarray(trueent.uid));
                                    }
                                }
                            }
                        }
                    }
                }
                if (
attacked.entityflag == entityflag.entity)
                {
                    if (
attacked.owner.spells.containskey(11130) && attacked.owner.entity.iseagleeyeshooted)
                    {
                        var 
attacked.owner.spells[11130];
                        var 
spell database.spelltable.spellinformations[s.id][s.level];
                        if (
spell != null)
                        {
                            if (
kernel.rate(spell.percent))
                            {
                                
attacked.owner.entity.iseagleeyeshooted false;
                                
spelluse ssuse = new spelluse(true);
                                
ssuse.attacker attacked.uid;
                                
ssuse.spellid spell.id;
                                
ssuse.spelllevel spell.level;
                                
ssuse.addtarget(attacked.owner.entity, new spelluse.damageclass().damage 11030null);
                                if (
attacked.entityflag == entityflag.entity)
                                {
                                    
attacked.owner.sendscreen(ssusetrue);
                                }
                            }
                        }
                    }
                    if (
attacked.counterkillswitch && kernel.rate(30) && !attacker.containsflag((ulong)update.flags.fly) && time32.now attacked.counterkillstamp.addseconds(15))
                    {
                        
attacked.counterkillstamp time32.now;
                        
network.gamepackets.attack attack = new abdoredagxv4.network.gamepackets.attack(true);
                        
attack.effect1 attack.attackeffects1.none;
                        
uint damage melee(attackedattackerref attack);
                        
damage damage 3;
                        
attack.attacked attacker.uid;
                        
attack.attacker attacked.uid;
                        
attack.attacktype network.gamepackets.attack.scapegoat;
                        
attack.damage 0;
                        
attack.responsedamage damage;
                        
attack.attacked.x;
                        
attack.attacked.y;

                        if (
attacker.hitpoints <= damage)
                        {
                            if (
attacker.entityflag == entityflag.entity)
                            {
                                
attacked.owner.updatequalifier(attacker.hitpoints);
                                
attacker.owner.sendscreen(attacktrue);
                                
attacked.attackpacket null;
                            }
                            else
                            {
                                
attacker.monsterinfo.sendscreen(attack);
                            }
                            
attacker.die(attacked);
                        }
                        else
                        {
                            
attacker.hitpoints -= damage;
                            if (
attacker.entityflag == entityflag.entity)
                            {
                                
attacked.owner.updatequalifier(attacker.hitpoints);
                                
attacker.owner.sendscreen(attacktrue);
                            }
                            else
                            {
                                
attacker.monsterinfo.sendscreen(attack);
                            }
                        }
                        
damage 0;
                    }
                    else if (
attacked.owner.spells.containskey(3060) && kernel.rate(15))
                    {
                        
uint damage = (uint)(damage 10);
                        if (
damage <= 0)
                            
damage 1;
                        if (
damage 10000damage 10000;
                        
network.gamepackets.attack attack = new abdoredagxv4.network.gamepackets.attack(true);
                        
attack.attacked attacker.uid;
                        
attack.attacker attacked.uid;
                        
attack.attacktype network.gamepackets.attack.reflect;
                        
attack.damage damage;
                        
attack.responsedamage damage;
                        
attack.attacked.x;
                        
attack.attacked.y;

                        if (
attacker.hitpoints <= damage)
                        {
                            if (
attacker.entityflag == entityflag.entity)
                            {
                                
attacked.owner.updatequalifier(attacker.hitpoints);
                                
attacker.owner.sendscreen(attacktrue);
                                
attacked.attackpacket null;
                            }
                            else
                            {
                                
attacker.monsterinfo.sendscreen(attack);
                            }
                            
attacker.die(attacked);
                        }
                        else
                        {
                            
attacker.hitpoints -= damage;
                            if (
attacker.entityflag == entityflag.entity)
                            {
                                
attacked.owner.updatequalifier(attacker.hitpoints);
                                
attacker.owner.sendscreen(attacktrue);
                            }
                            else
                            {
                                
attacker.monsterinfo.sendscreen(attack);
                            }
                        }
                        
damage 0;
                    }
                }
            }
            catch (
exception e) { program.saveexception(e); }
        }
        public static 
void checkdamage(entity attackerentity attackedref int damageref attack packetbool magic false)
        {
            if (
attacked.entityflag == entityflag.monster)
            {
                if (!
attacker.assassin() && !attacker.ischaser1())
                {
                    if (
attacked.monsterinfo.boss || attacked.boss == 1)
                    {
                        if (
magic)
                            
damage = (int)damage 10;
                        else
                            
damage = (int)damage 4;
                        return;
                    }
                }
            }
            if (
attacker.entityflag == entityflag.entity)
            {
                
blesseffect.effect(attacker);
                
gemeffect.effect(attacker);
            }
            
calculate.autorespone(attackerattackedref damage);
            if (
attacked.containsflag2(network.gamepackets.update.flags2.azureshield))
            {

                if (
damage attacked.azureshielddefence)
                {
                    
damage -= attacked.azureshielddefence;
                    
createazuredmg(attacked.azureshielddefenceattackerattacked);
                    
attacked.removeflag2(network.gamepackets.update.flags2.azureshield);
                }
                else
                {
                    
createazuredmg((uint)damageattackerattacked);
                    
attacked.azureshielddefence -= (ushort)damage;
                    
attacked.azureshieldpacket();
                    
damage 1;
                }
            }
            
#region nobility damage
            
if (attacked.entityflag == entityflag.entity && (attacker.battlepower attacked.battlepower))
            {
                if (
attacked.owner.challenge == null)
                {
                    if (
attacker.entityflag == entityflag.monster) return;
                    
int sub attacked.battlepower attacker.battlepower;
                    
//sub *= 2000;//##samak battlepower
                    
if (sub 41)
                    {
                        if (
attacker.entityflag == entityflag.monster) return;
                        
damage 1;
                    }
                    else
                    {
//samak
                        
if (attacker.entityflag == entityflag.monster) return;
                        
damage = (int32)math.floor((float)damage * (.75 - (sub 0.01)));
                    }
                }
            }
            if (
attacked.entityflag == entityflag.entity && (attacker.battlepower attacked.battlepower))
            {
                if (
attacked.owner.challenge == null)
                {
                    if (
attacker.entityflag == entityflag.monster) return;
                    
int dmg attacked.battlepower attacker.battlepower;
                    if (
dmg 50)
                    {
                        if (
attacker.entityflag == entityflag.monster) return;
                        
damage damage 2;
                    }
                    else
                        if (
attacker.entityflag == entityflag.monster) return;
                    
damage = (int32)math.floor((float)damage * (1.10 - (dmg 0.01)));
                }
            }
            
#endregion
            /*  #region nobility damage
            #region king
            if (attacker.nobilityrank == conquerstructures.nobilityrank.king)
            {
                if (attacked.nobilityrank == conquerstructures.nobilityrank.king)
                {
                    damage = (int)((double)damage * 1.08);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.prince)
                {
                    damage = (int)((double)damage * 1.18);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.duke)
                {
                    damage = (int)((double)damage * 1.19);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.earl)
                {
                    damage = (int)((double)damage * 1.20);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.baron)
                {
                    damage = (int)((double)damage * 1.21);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.knight)
                {
                    damage = (int)((double)damage * 1.22);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.serf)
                {
                    damage = (int)((double)damage * 1.23);
                }
            }
            #endregion king
            #region prince
            if (attacker.nobilityrank == conquerstructures.nobilityrank.prince)
            {
                if (attacked.nobilityrank == conquerstructures.nobilityrank.king)
                {
                    damage = (int)((double)damage * 1.03);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.prince)
                {
                    damage = (int)((double)damage * 1.07);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.duke)
                {
                    damage = (int)((double)damage * 1.19);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.earl)
                {
                    damage = (int)((double)damage * 1.20);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.baron)
                {
                    damage = (int)((double)damage * 1.21);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.knight)
                {
                    damage = (int)((double)damage * 1.22);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.serf)
                {
                    damage = (int)((double)damage * 1.23);
                }
            }
            #endregion prince
            #region duke
            if (attacker.nobilityrank == conquerstructures.nobilityrank.duke)
            {
                if (attacked.nobilityrank == conquerstructures.nobilityrank.king)
                {
                    damage = (int)((double)damage * 1.02);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.prince)
                {
                    damage = (int)((double)damage * 0.99);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.duke)
                {
                    damage = (int)((double)damage * 1.08);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.earl)
                {
                    damage = (int)((double)damage * 1.19);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.baron)
                {
                    damage = (int)((double)damage * 1.20);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.knight)
                {
                    damage = (int)((double)damage * 1.21);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.serf)
                {
                    damage = (int)((double)damage * 1.22);
                }
            }
            #endregion duke
            #region earl
            if (attacker.nobilityrank == conquerstructures.nobilityrank.earl)
            {
                if (attacked.nobilityrank == conquerstructures.nobilityrank.king)
                {
                    damage = (int)((double)damage * 0.91);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.prince)
                {
                    damage = (int)((double)damage * 0.95);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.duke)
                {
                    damage = (int)((double)damage * 1);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.earl)
                {
                    damage = (int)((double)damage * 1.05);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.baron)
                {
                    damage = (int)((double)damage * 1.19);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.knight)
                {
                    damage = (int)((double)damage * 1.20);
                }
                if (attacked.nobilityrank == conquerstructures.nobilityrank.serf)
                {
                    damage = (int)((double)damage * 1.21);
                }
            }
            #endregion earl
            #endregion*/
            #region dragonswing
            
if (kernel.rate(20))//bas kada
            
{
                if (
attacked.containsflag3(update.flags3.dragonswing))
                {
                    
_string str = new _string(true);
                    
str.uid attacked.uid;
                    
str.textscount 1;
                    
str.type _string.effect;
                    
str.texts.add("poisonmiss");
                    if (
attacked.entityflag == entityflag.entity)
                        
attacked.owner.sendscreen(strtrue);
                    
damage 0;
                }
            }
            
#endregion
            
if (attacked.containsflag(network.gamepackets.update.flags.shurikenvortex))
                
damage 1;
            if (
constants.damage1map.contains(attacked.mapid))
                
damage 1;
        }
        public static 
void createazuredmg(uint dmgentity attackerentity attacked)
        {
            
network.gamepackets.attack attac = new attack(true);
            
attac.attacker attacker.uid;
            
attac.attacked attacked.uid;
            
attac.attacked.x;
            
attac.attacked.y;
            
attac.attacktype 55;
            
attac.damage dmg;
            
attacked.owner.sendscreen(attactrue);
        }
        public static 
int64 getagilityweapons(entity attacker)
        {
            
double result 0;
            if (
attacker.transformed)
            {
                
result attacker.transformationhitrate 100.0f;
            }
            else
            {
                
int values 0;
                
int junk 0;
                for (
uint i 010i++)
                {
                    if (
!= 5)
                    {
                        
conqueritem item attacker.owner.equipment.trygetitem(i);
                        
database.conqueriteminformation cii = new database.conqueriteminformation(item.iditem.plus);
                        if (
item.durability != 0)
                            if (
item != null && item.id != 0)
                            {
                                
int now = (cii.baseinformation.agility attacker.gems[2]) + attacker.gems[2] + values;
                                
values now cii.plusinformation.agility;
                                
junk += attacker.gems[2]; //unuse grin emoticon .
                            
}
                    }
                    else
                        continue;
                }
                
result = ((attacker.agility) * ((double)values 100.0f) * 0.0099999998f 100.0f);
            }
            return (
int64)result;
        }
        public static 
bool isdodged(entity attackerentity attacked)
        {
            
int result 0;
            
double percent 0;
            if (
attacker != null && attacked != null)
            {
                if (!
attacker.transformed)
                {
                    
result = (attacker.agility >> /* /2 */) - attacked.dodge 100;
                    if (
attacker.agility != 0)
                    {
                        
percent = (double)((getagilityweapons(attacker) / attacker.agility) - 100.0f) * 0.01f 1.0f;
                    }
                    else
                    {
                        
percent 1.0f;
                    }
                    
//todo status hitrate status skill :d
                    
result = (int)(percent result);
                    if (
attacker.owner.entity.isbow() && attacker.owner.entity.isshield())
                    {
                        
result result 12 100;
                    }
                    
result math.max(10math.min(90result));
                    if (
attacker.entityflag == entityflag.entity)
                    {
                        if (
attacked.entityflag == entityflag.monster)
                        {
                            
int antimonsterpercent attacker.level attacked.level;
                            if (
antimonsterpercent 0)
                            {
                                
result += 10 * (antimonsterpercent 5);
                            }
                            if (
attacker.containsflag(update.flags.cyclone))
                                
result 100;
                        }
                    }
                }
            }
            else
            {
                return 
true;
            }
            return 
kernel.randget(100) >= result;
        }
        public static 
void immu(entity attacked)
        {
            if (
attacked.entityflag == entityflag.entity)
            {
                
_string str = new _string(true);
                
str.uid attacked.uid;
                
str.textscount 1;
                
str.type _string.effect;
                
str.texts.add("bossimmunity");

                
attacked.owner.sendscreen(strtrue);
            }

        }
        public static 
void refinary(entity attackerentity attackedref double damageref attack packetbool magic false)
        {
            if (
attacker.name == "thundercloud") return;
            if (
attacker.entityflag == entityflag.entity)
            {
                if (!
attacker.istaoist(attacker.class))
                {
                    if (
attacked.battlepower attacker.battlepower)
                    {
                        if (
attacker.breaktrough 0)
                        {
                            if (
attacker.breaktrough attacked.counteraction)
                            {
                                
double power = (double)(attacker.breaktrough attacked.counteraction);
                                if (
attacker.nobilityrank conquerstructures.nobilityrank.king)
                                {
                                    
power = (double)(power 0);
                                    if (
mymath.success2(power))
                                    {
                                        
damage += damage 1;
                                        
damage += 15000;
                                        
packet.effect1 |= attack.attackeffects1.break;
                                    }
                                    else 
immu(attacked);
                                }
                                else
                                {
                                    
power = (double)(power 0);
                                    if (
mymath.success(power))
                                    {
                                        
damage += damage 1;
                                        
packet.effect1 |= attack.attackeffects1.break;
                                    }
                                    else 
immu(attacked);
                                }
                            }
                            else
                                
immu(attacked);

                        }
                    }
                    if (
ratestatus(80))
                    {

                        if (!
magic)
                        {
                            if (
attacker.criticalstrike 0)
                            {
                                if (
attacker.criticalstrike attacked.immunity)
                                {
                                    
double power = (double)(attacker.criticalstrike attacked.immunity);
                                    if (
kernel.chancesuccess2(((float)attacker.criticalstrike 300f) - ((float)attacked.immunity 300f)))
                                    {
                                        
damage += 15000;
                                        
packet.effect1 |= attack.attackeffects1.criticalstrike;
                                    }

                                    else
                                        
immu(attacked);

                                }
                                else
                                    
immu(attacked);
                            }
                        }
                        else
                        {
                            if (
attacker.penetration 0)
                            {
                                
double power = (double)(attacker.penetration 1);
                                if (
mymath.success(power))
                                {
                                    
damage += damage 4;
                                    
packet.effect1 |= attack.attackeffects1.penetration;
                                }
                                else if (
attacker.skillcstrike 0)
                                {
                                    if (
attacker.skillcstrike >= attacked.immunity)
                                    {
                                        
power = (double)(attacker.skillcstrike attacked.immunity);
                                        
power = (double)(power 100);
                                        if (
mymath.success(power))
                                        {
                                            
damage += damage 50 100;
                                            
packet.effect1 |= attack.attackeffects1.criticalstrike;
                                        }
                                        else
                                            
immu(attacked);
                                    }

                                }
                                else
                                    
immu(attacked);
                            }
                            else if (
attacker.skillcstrike 0)
                            {
                                if (
attacker.skillcstrike >= attacked.immunity)
                                {
                                    
double power = (double)(attacker.skillcstrike attacked.immunity);
                                    
power = (double)(power 100);
                                    if (
mymath.success(power))
                                    {
                                        
damage += damage 50 100;
                                        
packet.effect1 |= attack.attackeffects1.criticalstrike;
                                    }
                                    else
                                        
immu(attacked);
                                }

                            }
                            else
                                
immu(attacked);
                        }
                    }
                }
            }
            if (
attacked.entityflag == entityflag.entity)
            {
                if (
ratestatus(5))
                {
                    if (
attacked.block 0)
                    {
                        
double power = (double)(attacked.block 2);
                        if (
mymath.success(power))
                        {
                            
damage damage 2;
                            
packet.effect1 |= attack.attackeffects1.block;
                        }
                    }
                    if (
attacked.isshieldblock)
                    {
                        if (
mymath.success(attacked.shieldblockpercent))
                        {
                            
damage damage 2;
                            
packet.effect1 |= attack.attackeffects1.block;
                        }
                    }

                }
            }
        }
        public static 
void refinary(entity attackersobnpcspawn attackedref double damageref attack packetbool magic false)
        {
            if (
attacker.entityflag == entityflag.entity)
            {
                if (
ratestatus(10))
                {

                    if (!
magic)
                    {
                        if (
attacker.criticalstrike 0)
                        {

                            
double power = (double)(attacker.criticalstrike);
                            
power = (double)(power 100);
                            if (
mymath.success(power))
                            {
                                
damage += damage 80 100;
                                
packet.effect1 |= attack.attackeffects1.criticalstrike;
                            }
                        }
                    }
                    else
                    {
                        if (
attacker.penetration 0)
                        {
                            
double power = (double)(attacker.penetration 100);
                            if (
mymath.success(power))
                            {
                                
damage damage 50 100;
                                
packet.effect1 |= attack.attackeffects1.penetration;
                            }

                        }
                        if (
attacker.skillcstrike 0)
                        {
                            
double power = (double)(attacker.skillcstrike);
                            
power = (double)(power 100);
                            if (
mymath.success(power))
                            {
                                
damage += damage 50 100;
                                
packet.effect1 |= attack.attackeffects1.criticalstrike;
                            }
                        }
                    }
                }
            }
        }
    }

}
namespace 
abdoredagxv4
{
    public class 
statusconstants
    
{
        public const 
int adjustset = -30000,
                         
adjustfull = -32768,
                         
adjustpercent 30000;
    }
    public class 
mathhelper
    
{
        public static 
int bitfold32(int lower16int higher16)
        {
            return (
lower16) | (higher16 << 16);
        }
        public static 
void bitunfold32(int bits32out int lower16out int upper16)
        {
            
lower16 = (int)(bits32 uint16.maxvalue);
            
upper16 = (int)(bits32 >> 16);
        }
        public static 
void bitunfold64(ulong bits64out int lower32out int upper32)
        {
            
lower32 = (int)(bits64 uint32.maxvalue);
            
upper32 = (int)(bits64 >> 32);
        }
        public static 
int roughdistance(int x1int y1int x2int y2)
        {
            return 
math.max(math.abs(x1 x2), math.abs(y1 y2));
        }
        public static 
int conquerdirection(int x1int y1int x2int y2)
        {
            
double angle math.atan2(y2 y1x2 x1);
            
angle -= math.pi 2;

            if (
angle 0angle += math.pi;

            
angle *= / (math.pi);
            return (int)
angle;
        }
        public static 
int muldiv(int numberint numeratorint denominator)
        {
            return (
number numerator denominator 2) / denominator;
        }
        public static 
bool overflowadd(ref int accint add)
        {
            if (
int.maxvalue acc add)
                return 
true;
            
acc math.max(acc add0);
            return 
false;
        }
        public static 
int adjustdataex(int dataint adjustint maxdata 0)
        {
            if (
adjust >= statusconstants.adjustpercent)
                return 
muldiv(dataadjust statusconstants.adjustpercent100);

            if (
adjust <= statusconstants.adjustset)
                return -
adjust statusconstants.adjustset;

            if (
adjust == statusconstants.adjustfull)
                return 
maxdata;

            return 
data adjust;
        }
    }
    public class 
gemtypes
    
{
        public const 
int
            phoenix 
0,
            
dragon 1,
            
fury 2,
            
rainbow 3,
            
kylin 4,
            
violet 5,
            
moon 6,
            
tortoise 7,
            
thunder 10,
            
glory 12,

            
first phoenix,
            
last glory 1;

        public static 
readonly string[] animation = new string[]
                {
                    
"phoenix",
                    
"goldendragon",
                    
"fastflash",
                    
"rainbow",
                    
"goldenkylin",
                    
"purpleray",
                    
"moon",
                    
"recovery"
                
};

        public static 
readonly int[][] effects = new[]
                {
                    new[] { 
051015 },
                    new[] { 
051015 },
                    new[] { 
051015 },
                    new[] { 
0101525 },
                    new[] { 
050100200 },
                    new[] { 
03050100 },
                    new[] { 
0153050 },
                    new[] { 
024},
                    new[] { 
000},
                    new[] { 
000},
                    new[] { 
0100300500 },
                    new[] { 
000},
                    new[] { 
0100300500 }
                };
    }



ولا يهمك يا غالي بس بعد ما بدلت مفيش جديد نفس الايرورات

stevenayman1 2020-03-20 04:00 AM

رد: مشكلة في السورس اللي نزلوا MR Online
 
يغلق تم تغير السورس


الساعة الآن 07:27 AM

مرحبا بكم في منتدي اكواد لتطوير الالعاب