منتدي اكواد

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

Tarek Roshdi 2020-03-13 04:40 AM

حل مشكلة perfection x2
 
بسم الله الرحمن الرحيم

طبعا معروف عن البريفكشن الاكس تو بتاعة مبيطلعش الا لم تكون اعلي بريفكشن من الاكونت ال بتضرب فية
انا عندي مشكلة ان الاكس تو بيطلع من اي اكونت ف اي اكونت ودة طبعا مش مظبوط ف ارجوا حد يفيدني فالحوار دة
انا حاولت اعدل فية وتمام ظبطتة ان الاكس تو ميطلعش الا لو انت اعلي بريفكشن بس جت ع دماغي وحصل مشكلتين الاولي مكنش ينفع اضرب ف الوحوش التانية ان لو اكونت البريفكشن بتاعة صفر مستحيل اموتة ممكن اطلع فية ضربة بنص مليون ومينقصش من صحتة حاجة
وشكرا مقدما للمنتدي

magdy 2020-03-13 05:13 AM

رد: حل مشكلة perfection x2
 
متابع

Users 2020-03-13 02:21 PM

رد: حل مشكلة perfection x2
 
حاضر

Tarek Roshdi 2020-03-13 11:25 PM

رد: حل مشكلة perfection x2
 
اقتباس:

المشاركة الأصلية كتبت بواسطة mr~rayzo (المشاركة 32162)
حاضر

يحضرلك الخير ياغاااالي
بس عاوزين حل بعد حاااضر دي

Tefa 2020-03-15 12:25 PM

رد: حل مشكلة perfection x2
 
وريني الكود الاسلسي و الكود بعد التعديل

Tarek Roshdi 2020-03-16 12:30 AM

رد: حل مشكلة perfection x2
 
كود PHP:

            #region Perfection X2
            
byte Tiempo 0;
            new 
MsgRefineEffect().HandleLuckyStrike(attackerref Tiempo);
            if (
Kernel.Rate(Tiempo))
            {
                
Network.Writer.WriteUInt16((ushort)(<< 10), 36attack.ToArray());
                new 
MsgRefineEffect().SendEffect(attackerattackedGame.Enums.PerfectionEffect.LuckyStrike);
                
damage damage 2;
            } 

اضفتلة
كود PHP:

            #region Perfection X2
            
if ((attacker.Perfection != null)(attacked.Perfection != null))
            {
                if ((
attacker.Perfection.Id) > (attacked.Perfection.Id))
                {
                    
byte Tiempo 0;
                    new 
MsgRefineEffect().HandleLuckyStrike(attackerref Tiempo);
                    if (
Kernel.Rate(Tiempo))
                    {
                        
Network.Writer.WriteUInt16((ushort)(<< 10), 36attack.ToArray());
                        new 
MsgRefineEffect().SendEffect(attackerattackedGame.Enums.PerfectionEffect.LuckyStrike);
                        
damage damage 2;
                    }
                }
            }
            
#endregion 


Tarek Roshdi 2020-03-16 11:04 PM

رد: حل مشكلة perfection x2
 
???

Tefa 2020-03-17 01:43 AM

رد: حل مشكلة perfection x2
 
جرب تخليه بالشكل ده
كود PHP:

 #region Perfection X2
            
if ((attacker.Perfection >0)
            {
                if ((
attacker.TotalPerfectionScore) > (attacked.TotalPerfectionScore))
                {
                    
byte Tiempo 0;
                    new 
MsgRefineEffect().HandleLuckyStrike(attackerref Tiempo);
                    if (
Kernel.Rate(Tiempo))
                    {
                        
Network.Writer.WriteUInt16((ushort)(<< 10), 36attack.ToArray());
                        new 
MsgRefineEffect().SendEffect(attackerattackedGame.Enums.PerfectionEffect.LuckyStrike);
                        
damage damage 2;
                    }
                }
            }
            
#endregion 

دي لو جت ايرور TotalPerfectionScore اكتب TotalPerfectionPoints علي حسب سورس بتاعك

Tarek Roshdi 2020-03-17 02:01 AM

رد: حل مشكلة perfection x2
 
اقتباس:

المشاركة الأصلية كتبت بواسطة Rider (المشاركة 32577)
جرب تخليه بالشكل ده
كود PHP:

 #region Perfection X2
            
if ((attacker.Perfection >0)
            {
                if ((
attacker.TotalPerfectionScore) > (attacked.TotalPerfectionScore))
                {
                    
byte Tiempo 0;
                    new 
MsgRefineEffect().HandleLuckyStrike(attackerref Tiempo);
                    if (
Kernel.Rate(Tiempo))
                    {
                        
Network.Writer.WriteUInt16((ushort)(<< 10), 36attack.ToArray());
                        new 
MsgRefineEffect().SendEffect(attackerattackedGame.Enums.PerfectionEffect.LuckyStrike);
                        
damage damage 2;
                    }
                }
            }
            
#endregion 

دي لو جت ايرور TotalPerfectionScore اكتب TotalPerfectionPoints علي حسب سورس بتاعك


انا شغال ع سورس رايزو
TotalPerfectionPoints
TotalPerfectionScore
الاتنين فيهم ايرور
وللتوضيح اكتر التعديل دة عندي ف كلاس Handle

Tefa 2020-03-17 02:15 AM

رد: حل مشكلة perfection x2
 
كود من سورس رايزو
كود PHP:

 if(attacker.TotalPerfectionScore>attacked.TotalPerfectionScore


Tarek Roshdi 2020-03-17 02:41 AM

رد: حل مشكلة perfection x2
 
كل حاجة عندي فيها بريفكشن هوضحها لحضرتك واسف لو هشغلك معايا كتير لأني مش عارف اوصل لحل
Handle.cs
كود PHP:

   #region Perfection
            
if (attacker.PlayerFlag == PlayerFlag.Player)
            {

                
uint rand = (uint)Rayzo.Kernel.Random.Next(12);
                switch (
rand)
                {
                    case 
1:
                        {
                            
#region Perfection
                            
Game.Enums.PerfectionEffect effect Enums.PerfectionEffect.CalmWind;
                            
byte chance 1;
                            new 
MsgRefineEffect().GenerateEffectandChance(attacker.Ownerref effectref chance);
                            if (
Kernel.Rate(chance))
                            {
                                new 
MsgRefineEffect().SendEffect(attackerattackedeffect);
                            }
                            
#endregion
                            
break;
                        }
                    case 
2:
                        {
                            
#region Perfection
                            
byte chance 0;
                            new 
MsgRefineEffect().HandleLuckyStrike(attackerref chance);
                            if (
Kernel.Rate(chance))
                            {
                                
Network.Writer.WriteUInt16((ushort)(<< 10), 36attack.ToArray());
                                new 
MsgRefineEffect().SendEffect(attackerattackedGame.Enums.PerfectionEffect.LuckyStrike);
                                
damage *= 2;
                            }
                            
#endregion
                            
break;
                        }

                }

            }
            
#endregion
            #region Perfection
            
if (attacked.PlayerFlag == PlayerFlag.Player)
            {
                
uint rand = (uint)Rayzo.Kernel.Random.Next(12);
                switch (
rand)
                {

                    case 
1:
                        {
                           
// if (attacked.PlayerFlag == PlayerFlag.Player)
                            
{
                                
#region Perfection
                                
byte chance 1;
                                new 
MsgRefineEffect().HandleStrickeLock(attackerref chance);
                                if (
Kernel.Rate(chance))
                                {
                                    
Game.Enums.PerfectionEffect effect Enums.PerfectionEffect.Stricklock;
                                    new 
MsgRefineEffect().SendEffect(attackedattackereffect);
                                    return;
                                }
                                
#endregion
                            
}

                            break;
                        }
                    case 
2:
                        {

                          
//  if (attacked.PlayerFlag == PlayerFlag.Player)
                            
{
                                
#region Perfection
                                
Game.Enums.PerfectionEffect effect Enums.PerfectionEffect.MirrorofSin;
                                
byte chance 0;
                                new 
MsgRefineEffect().HandleMirror(attackedref chance);
                                if (
Kernel.Rate(chance))
                                {
                                    new 
MsgRefineEffect().SendEffect(attackedattackereffect);
                                    if (!
attacker.ContainsFlag4(Rayzo.Network.GamePackets.MsgUpdate.Flags4.Omnipotence) || !attacker.ContainsFlag3((ulong)Rayzo.Network.GamePackets.MsgUpdate.Flags3.BladeFlurry)) return;
                                    {
                                        
attacked.AddFlag((ulong)Network.GamePackets.MsgUpdate.Flags.XPList);
                                        
attacker.Owner.XPListStamp Time32.Now;
                                    }
                                }
                                
#endregion
                            
}
                            break;
                        }

                }

            }


            
#endregion
            #region Perfection X2
            
byte Tiempo 0;
            new 
MsgRefineEffect().HandleLuckyStrike(attackerref Tiempo);
            if (
Kernel.Rate(Tiempo))
            {
                
Network.Writer.WriteUInt16((ushort)(<< 10), 36attack.ToArray());
                new 
MsgRefineEffect().SendEffect(attackerattackedGame.Enums.PerfectionEffect.LuckyStrike);
                
damage damage 2;
            }
            
#endregion 

Gamestate.cs
كود PHP:

#region Perfiction
            
if (Player.Perfection != null)
            {
                if (
this.Equipment.TotalPerfectionLevel >= Player.Perfection.Id)
                {
                    
Player.BaseMinAttack += Player.Perfection.PhysicalAttack;
                    
Player.BaseMaxAttack += Player.Perfection.PhysicalAttack;
                    
Player.Defence += Player.Perfection.PhysicalDefense;
                    
Player.BaseMagicAttack += Player.Perfection.MagicAttack;
                    
Player.MagicDefence += Player.Perfection.MagicDefense;
                }
            } 

MsgRefineEffect.cs
كود PHP:

   public byte GetChance(Client.GameState clientGame.Enums.PerfectionEffect effect)
        {
            if (
client.Equipment.TotalPerfectionLevel == 0) return 0;
            
byte Chance 10;
            if (
effect == Game.Enums.PerfectionEffect.CalmWind)
            {
                if (
client.Equipment.TotalPerfectionLevel == 3Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 90Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 170Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 250Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 285Chance += 1;
            }
            if (
effect == Game.Enums.PerfectionEffect.BloodSpawn)
            {
                if (
client.Equipment.TotalPerfectionLevel >= 40Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 240Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 288Chance += 1;
            }
            if (
effect == Game.Enums.PerfectionEffect.DivineGuard)
            {
                if (
client.Equipment.TotalPerfectionLevel <= 40Chance += 5;
            }
            if (
effect == Game.Enums.PerfectionEffect.CoreStrike)
            {
                if (
client.Equipment.TotalPerfectionLevel == 50Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 80Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 135Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 205Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 245Chance += 1;
            }
            if (
effect == Game.Enums.PerfectionEffect.DrainingTouch)
            {
                if (
client.Equipment.TotalPerfectionLevel >= 35Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 220Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 276Chance += 1;
            }
            if (
effect == Game.Enums.PerfectionEffect.FreeSoul)
            {
                if (
client.Equipment.TotalPerfectionLevel >= 25Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 95Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 130Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 195Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 279Chance += 1;
            }
            if (
effect == Game.Enums.PerfectionEffect.InvisibleArrow)
            {
                if (
client.Equipment.TotalPerfectionLevel >= 65Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 225Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 282Chance += 1;
            }
            if (
effect == Game.Enums.PerfectionEffect.KillingFlash)
            {
                if (
client.Equipment.TotalPerfectionLevel >= 55Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 165Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 294Chance += 1;
            }
            if (
effect == Game.Enums.PerfectionEffect.LightofStamina)
            {
                if (
client.Equipment.TotalPerfectionLevel >= 1Chance += 5;
            }
            if (
effect == Game.Enums.PerfectionEffect.LuckyStrike)
            {
                if (
client.Equipment.TotalPerfectionLevel >= 15Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 115Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 215Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 314Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 320Chance += 1;
            }
            if (
effect == Game.Enums.PerfectionEffect.MirrorofSin)
            {
                if (
client.Equipment.TotalPerfectionLevel >= 60Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 190Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 291Chance += 1;
            }
            if (
effect == Game.Enums.PerfectionEffect.ShieldBreak)
            {
                if (
client.Equipment.TotalPerfectionLevel == 155 && client.Equipment.TotalPerfectionLevel <= 254Chance += 50 100;
                if (
client.Equipment.TotalPerfectionLevel == 255 && client.Equipment.TotalPerfectionLevel <= 296Chance += 70 100;
                if (
client.Equipment.TotalPerfectionLevel == 297 && client.Equipment.TotalPerfectionLevel <= 311Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel == 312 && client.Equipment.TotalPerfectionLevel <= 321Chance += 150 100;
                if (
client.Equipment.TotalPerfectionLevel == 322 && client.Equipment.TotalPerfectionLevel >= 322Chance += 2;
            }
            if (
effect == Game.Enums.PerfectionEffect.StraightLife)
            {
                if (
client.Equipment.TotalPerfectionLevel >= 30Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 125Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 210Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 265Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 303Chance += 1;
            }
            if (
effect == Game.Enums.PerfectionEffect.Stricklock)
            {
                if (
client.Equipment.TotalPerfectionLevel >= 30Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 125Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 210Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 265Chance += 1;
                if (
client.Equipment.TotalPerfectionLevel >= 303Chance += 1;
            }
            return 
Chance;
        }
        public 
void SendEffect(Game.Player attackerGame.Player attackedGame.Enums.PerfectionEffect effect)
        {
            if (
attacker == null || attacked == null) return;
            var 
proto = new MsgRefineEffectProto();
            
proto.AttackerUID attacker.UID;
            if (
attacked.PlayerFlag == Game.PlayerFlag.Player)
                
proto.AttackedUID attacked.UID;
            else if (
attacked.PlayerFlag == Game.PlayerFlag.Monster && attacked != null && attacked.UID != 0)
            {
                
proto.AttackedUID attacked.UID;
            }
            
proto.Effect = (uint)effect;
            var 
proto2 Kernel.FinalizeProtoBuf(proto3254);
            
attacker.Owner.SendScreen(proto2true);
            if (
effect == Game.Enums.PerfectionEffect.DrainingTouch)
            {
                
attacker.Hitpoints attacker.MaxHitpoints;
            }
            if (
effect == Game.Enums.PerfectionEffect.KillingFlash)
            {
                if (!
attacker.ContainsFlag4(Rayzo.Network.GamePackets.MsgUpdate.Flags4.Omnipotence) || !attacker.ContainsFlag3((ulong)Rayzo.Network.GamePackets.MsgUpdate.Flags3.BladeFlurry)) return;
                {
                    
attacker.AddFlag((ulong)Network.GamePackets.MsgUpdate.Flags.XPList);

                    
attacker.Owner.XPListStamp Time32.Now;
                }
            }
            if (
effect == Game.Enums.PerfectionEffect.DivineGuard)
            {
                
attacker.AddFlag3((ulong)Network.GamePackets.MsgUpdate.Flags3.DivineGuard);
                
attacker.Defence = (ushort)(((attacker.Defence) * 20) / 100);
                
attacker.DivineGuardStamp Time32.Now;
            }
            if (
effect == Game.Enums.PerfectionEffect.ShieldBreak)
            {
                
attacker.AddFlag3((ulong)Network.GamePackets.MsgUpdate.Flags3.ShieldBreak);
                
attacker.ShieldBreakStamp Time32.Now;
                
attacker.Block += (ushort)(((attacker.Block) * 2) / 10);
            }
            if (
effect == Game.Enums.PerfectionEffect.StraightLife)
            {
                
attacker.BringToLife();
            }
            if (
effect == Game.Enums.PerfectionEffect.LightofStamina && attacked.PlayerFlag == Game.PlayerFlag.Player && attacker.Owner.Equipment.TotalPerfectionLevel attacked.Owner.Equipment.TotalPerfectionLevel || effect == Game.Enums.PerfectionEffect.LightofStamina && attacked.PlayerFlag == Game.PlayerFlag.Monsterattacker.Stamina 100;
        }
        public 
void GenerateEffectandChance(Client.GameState clientref Game.Enums.PerfectionEffect effectref byte chance)
        {
            
effect = (Game.Enums.PerfectionEffect)Kernel.Random.Next(314);
            
chance GetChance(clienteffect);
            while (
chance == 10)
            {
                
effect = (Game.Enums.PerfectionEffect)Kernel.Random.Next(314);
                
chance GetChance(clienteffect);
            }
        }
        public 
void HandleStrickeLock(Game.Player clientref byte chance)
        {
            
chance GetChance(client.OwnerGame.Enums.PerfectionEffect.Stricklock);
        }
        public 
void HandleFreeSoul(Game.Player clientref byte chance)
        {
            
chance GetChance(client.OwnerGame.Enums.PerfectionEffect.FreeSoul);
        }
        public 
void HandleStraightLife(Game.Player clientref byte chance)
        {
            
chance GetChance(client.OwnerGame.Enums.PerfectionEffect.StraightLife);
        }
        public 
void HandleBloodSpawn(Game.Player clientref byte chance)
        {
            
chance GetChance(client.OwnerGame.Enums.PerfectionEffect.BloodSpawn);
        }
        public 
void HandleMirror(Game.Player clientref byte chance)
        {
            
chance GetChance(client.OwnerGame.Enums.PerfectionEffect.MirrorofSin);
        }
        public 
void HandleLuckyStrike(Game.Player clientref byte chance)
        {
            
chance GetChance(client.OwnerGame.Enums.PerfectionEffect.LuckyStrike);
        } 


Equipments.cs
كود PHP:

        public ushort TotalPerfectionLevel
        
{
            
get
            
{
                
ushort Count 0;
                foreach (
Network.GamePackets.MsgItemInfo item in Objects)
                {
                    if (
item == null) continue;
                    if (
item.Position 19 || item.Position == || item.Position == || item.Position == 15 || item.Position == 16 || item.Position == 17) continue;
                    
Count += (ushort)(ItemHandler.IsTwoHand(item.ID) ? item.PerfectionLevel item.PerfectionLevel);
                }
                return 
Count;
            }
        } 


Tefa 2020-03-17 03:05 AM

رد: حل مشكلة perfection x2
 
للاسف مفيش اي كود من الي فوق دول عندي ف سورس ريزو بروتو بس هل لما بدلت كود الي عندك بالكود الي لسه انا كتبهولك فوق لما قولت عندك ايرور هل ظهر اي ايرور جديد

Tarek Roshdi 2020-03-17 07:02 AM

رد: حل مشكلة perfection x2
 
ايوا بيظهر ايرور
بص ياغالي
كل الموضوع الكور الاول كان اية ان الاكس تو بيطلع حظ مش مربزط ب حوار ان الاعلي بريفكشن هو ال يطلع اكس تو ف قومت انا عدلت علي الكود الاصلي دة
كود PHP:

            #region Perfection X2
            
byte Tiempo 0;
            new 
MsgRefineEffect().HandleLuckyStrike(attackerref Tiempo);
            if (
Kernel.Rate(Tiempo))
            {
                
Network.Writer.WriteUInt16((ushort)(<< 10), 36attack.ToArray());
                new 
MsgRefineEffect().SendEffect(attackerattackedGame.Enums.PerfectionEffect.LuckyStrike);
                
damage damage 2;
            } 

ف اصبح بالشكل دة
كود PHP:

            #region Perfection X2
            
if ((attacker.Perfection != null)(attacked.Perfection != null))
            {
                if ((
attacker.Perfection.Id) > (attacked.Perfection.Id))
                {
                    
byte Tiempo 0;
                    new 
MsgRefineEffect().HandleLuckyStrike(attackerref Tiempo);
                    if (
Kernel.Rate(Tiempo))
                    {
                        
Network.Writer.WriteUInt16((ushort)(<< 10), 36attack.ToArray());
                        new 
MsgRefineEffect().SendEffect(attackerattackedGame.Enums.PerfectionEffect.LuckyStrike);
                        
damage damage 2;
                    }
                }
            }
            
#endregion 

بعد التعديل دة الاكونت الاعلي بريفكشن بس هو ال يطلع اكس تو ودي تمام
لاقيت ظهر مشكلتين ان لو الاكونت زيرو بريفكشن الضربة هتطلع فية برقم عالي بس صحتة مش هتنقص ومش هيموت و تاني حاجة مبيضربش فالوحوش
عارف اني طولت عليك
وللعلم السورس دة انا شارية بس للاسف المشاكل كلها غرقان فيها لوحدي

Tefa 2020-03-17 07:07 AM

رد: حل مشكلة perfection x2
 
جرب تمسح اول سطر كده
كود PHP:

            if ((attacker.Perfection != null)(attacked.Perfection != null)) 



الساعة الآن 01:09 AM

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