اسم العضو كلمة المرور حفظ البيانات؟ تسجيل عضوية



ايجى4يو || Egy4u


  ايجى4يو || Egy4u > أقسام كونكر برفيت > تطوير سيرفرات كـــونـــكر تـــهيس

اعلانات ايجى4يو


المشاركات: 27 [+]
: [+]
:
: [+]
محمد مصطفي غير متواجد حالياً
محمد مصطفي
( مراقب اقسام كونكر برفيت )
تعالوا نتعلم ازاي نعدل علي الاتاك + اكواد جاهزه !

انا لاحظت ان في مشكلة قارفه الناس كلها ,, وهي مشكلة ال Attack

انا مش هحلها لأن في أكتر من سورس وأكتر من طريقه للحل أنا بس همهد الطريق للحلها !

ازاي ؟

يعني هشرحلك المشكله ومسبباتها وازاي تزود وتنقص الاتاك

وكمان هقول ازاي تخصص أتاك معين لنوع شخصيه معينه مثلا ننجا بس او تروجان بس ,

هقولك ازاي تزود الاتاك بتاعه نبتدي بسم الله



أولآ الملفات المسئوله عن الأتاك في السي شارب ,

Handle.cs
Screen.cs في بعض السورسات وبعض الاسكلات بتتعدل من السكرين ,
Attack.cs
Calculate.cs

تعالي نعدل علي الاسكلات وناخد مثلا اسكل الارشر Mortal Wound ,

Html

#region Mortal Wound 
                                
case 11660
                                    { 
                                        if (
CanUseSpell(spellattacker.Owner)) 
                                        { 
                                            if (!
attacker.ContainsFlag3(Update.Flags3.Assassin)) 
                                                return; 
                                            if (
Time32.Now attacker.MortalWoundStamp.AddMilliseconds(750)) 
                                            { 
                                                
attacker.MortalWoundStamp Time32.Now
                                                
PrepareSpell(spellattacker.Owner); 
                                                
attacker.AttackPacket null
                                                
SpellUse suse = new SpellUse(true); 
                                                
suse.Attacker attacker.UID
                                                
suse.SpellID spell.ID
                                                
suse.SpellLevel spell.Level
                                                
suse.X
                                                
suse.Y
                                                if (
attackedsob == null
                                                { 
                                                    if (
CanAttack(attackerattackedspellfalse)) 
                                                    { 
                                                        
attack.Effect1 Attack.AttackEffects1.None
                                                        
uint damage Game.Attacking.Calculate.Ranged(attackerattackedref attack); 
                                                        if (
attacker.NobilityRank == TroZena.Game.ConquerStructures.NobilityRank.King
                                                        { 
                                                            
damage = (uint)(damage 0.5); 
                                                        } 
                                                        if (
attacker.NobilityRank == TroZena.Game.ConquerStructures.NobilityRank.Prince
                                                        { 
                                                            
damage = (uint)(damage 0.4); 
                                                        } 
                                                        if (
attacker.NobilityRank == TroZena.Game.ConquerStructures.NobilityRank.Duke
                                                        { 
                                                            
damage = (uint)(damage 0.3); 
                                                        } 
                                                        if (
attacker.NobilityRank == TroZena.Game.ConquerStructures.NobilityRank.Earl
                                                        { 
                                                            
damage = (uint)(damage 0.2); 
                                                        }  
                                                        
suse.Effect1 attack.Effect1
                                                        
ReceiveAttack(attackerattackedattackref damagespell); 
                                                        
suse.AddTarget(attackeddamageattack); 
                                                        
attacker.Owner.SendScreen(susetrue); 
                                                    } 
                                                } 
                                                else 
                                                { 
                                                    if (
CanAttack(attackerattackedsobspell)) 
                                                    { 
                                                        
attack.Effect1 Attack.AttackEffects1.None
                                                        
uint damage Game.Attacking.Calculate.Ranged(attackerattackedsobref attack); 

                                                        
suse.Effect1 attack.Effect1

                                                        
ReceiveAttack(attackerattackedsobattackdamagespell); 
                                                        
suse.AddTarget(attackedsobdamageattack); 
                                                        
attacker.Owner.SendScreen(susetrue); 
                                                    } 
                                                } 
                                            } 
                                        } 
                                        break; 
                                    } 
                                
#endregion 
شايف انتا الاكواد دي ,

Html

     damage = (uint)(damage 0.5); 
                                                        } 
                                                        if (
attacker.NobilityRank == TroZena.Game.ConquerStructures.NobilityRank.Prince
                                                        { 
                                                            
damage = (uint)(damage 0.4); 
                                                        } 
                                                        if (
attacker.NobilityRank == TroZena.Game.ConquerStructures.NobilityRank.Duke
                                                        { 
                                                            
damage = (uint)(damage 0.3); 
                                                        } 
                                                        if (
attacker.NobilityRank == TroZena.Game.ConquerStructures.NobilityRank.Earl
                                                        { 
                                                            
damage = (uint)(damage 0.2
دي النسبه المئويه لقوة الاسكل أقصي قوه 50% وأقل قوه 20%

damage * 0.5 ,,, damage * 0.2

عاوز تزود القوه زودها من الارقام دي 0.5 خليها مثلا 0.7 والي تحتها بالترتيب

هتلاحظ ان اتاك الاسكل زاد ,



ناخد اسكل تاني ,, مثلآ بتاع التروجان الكروس FatalCross ,

كود الهاندل ,

Html

 #region FatalCross 
                                
case 11980
                                    { 
                                        if (
CanUseSpell(spellattacker.Owner)) 
                                        { 
                                            
PrepareSpell(spellattacker.Owner); 
                                            
SpellUse suse = new SpellUse(true); 
                                            
suse.Attacker attacker.UID
                                            
suse.SpellID spell.ID
                                            
suse.SpellLevel spell.Level
                                            
ushort _X attacker.X_Y attacker.Y
                                            
ushort _tX X_tY Y
                                            
byte dist = (byte)spell.Distance
                                            var Array = 
attacker.Owner.Screen.Objects
                                            
InLineAlgorithm algo = new InLineAlgorithm(attacker.XXattacker.YYdist
                                                                               
InLineAlgorithm.Algorithm.DDA); 
                                            
// X = attacker.X; 
                                            //  Y = attacker.Y; 
                                            
int i algo.lcoords.Count
                                            
/* for (i = 0; i < algo.lcoords.Count; i++) 
                                             { 
                                                 if (attacker.Owner.Map.Floor[algo.lcoords[i].X, algo.lcoords[i].Y, MapObjectType.Player] 
                                                     && !attacker.ThroughGate(algo.lcoords[i].X, algo.lcoords[i].Y)) 
                                                 { 
                                                     X = (ushort)algo.lcoords[i].X; 
                                                     Y = (ushort)algo.lcoords[i].Y; 
                                                 } 
                                                 else 
                                                 { 
                                                     break; 
                                                 } 
                                             }*/ 
                                            
double disth 1.5
                                            if (
attacker.MapID == DeathMatch.MAPIDdisth 1
                                            
suse.X
                                            
suse.Y
                                            foreach (
Interfaces.IMapObject _obj in Array) 
                                            { 
                                                
bool hit false
                                                for (
int j 0ij++) 
                                                    if (
Kernel.GetDDistance(_obj.X_obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= disth
                                                        
hit true
                                                if (
hit
                                                { 
                                                    if (
_obj.MapObjType == MapObjectType.Monster
                                                    { 
                                                        
attacked _obj as Entity
                                                        if (
CanAttack(attackerattackedspellattack.AttackType == Attack.Melee)) 
                                                        { 
                                                            var 
damage Game.Attacking.Calculate.Melee(attackerattackedspellref attack); 

                                                            
ReceiveAttack(attackerattackedattackref damagespell); 

                                                            
suse.AddTarget(attackeddamageattack); 
                                                        } 
                                                    } 
                                                    else if (
_obj.MapObjType == MapObjectType.Player
                                                    { 
                                                        
attacked _obj as Entity
                                                        if (
CanAttack(attackerattackedspellattack.AttackType == Attack.Melee)) 
                                                        { 
                                                            var 
damage Game.Attacking.Calculate.Melee(attackerattackedref attack); 
                                                            
damage = (uint)(damage 0.8); 
                                                            
ReceiveAttack(attackerattackedattackref damagespell); 

                                                            
suse.AddTarget(attackeddamageattack); 
                                                        } 
                                                    } 
                                                    else if (
_obj.MapObjType == MapObjectType.SobNpc
                                                    { 
                                                        
attackedsob _obj as SobNpcSpawn
                                                        if (
CanAttack(attackerattackedsobspell)) 
                                                        { 
                                                            var 
damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack); 
                                                            
ReceiveAttack(attackerattackedsobattackdamagespell); 

                                                            
suse.AddTarget(attackedsobdamageattack); 
                                                        } 
                                                    } 
                                                } 
                                            } 
                                            
attacker.Owner.SendScreen(susetrue); 

                                        } 
                                        break; 
                                    } 
                                
#endregion 
بتنزل لحد ما تلاقي الكود ده ,

Html

damage = (uint)(damage 0.8); 
تعدل علي النسبه المئويه الي هي 0.8 او 80%

لما تزودها قوة الاسكل هتزيد تقللها هتقل .. المهم متجيش تزود تشيل ال 0.8 وتحط 90

كدا اي تروجان هيضرب هيكسر الدنيا



تعالوا نشوف ازاي أزود الاتاك العام للشخصيات او لأنواع الشخصيات يعني الفي اي بي

او الكنج والبرنس ونوع الشخصيه نفسها يعني ارشر او تروجان او ننجا وهكذا

انا هقولك علي أبسط طريقه

هتفتح ملف World.cs او Threads.cs علي حسب سورسك

انا عامل أكواد جاهزه زي كدا ,

دي للكنج ,

Html

#region Kings attack 
            
if (client.Entity.NobilityRank == NobilityRank.King && client.Entity.Class >= 25 && client.Entity.Class <= 15 && client.Entity.Class <= 45 && client.Entity.Class <= 55 && client.Entity.Class <= 65 && client.Entity.Class <= 75 && client.Entity.Class <= 85
            { 
                
client.Entity.MagicDamageIncrease += 5000
                
client.Entity.MaxAttack += 7000
                
client.Entity.MinAttack += 5000
                
client.Entity.Defence += 10000
                } 
            else if (
client.Entity.Class >= 135 && client.Entity.Class <= 145 && client.Entity.NobilityRank == NobilityRank.King
            { 
                
client.Entity.MagicAttack += 8000
                
client.Entity.MinAttack += 5000
                
client.Entity.Defence += 10000
                
client.Entity.MagicDamageIncrease += 5000
            } 
            
#endregion 
الكود دا بيزود اتاك الكنج والدفنس ما عدا الساحر لو كان الكنج Toaist بتزود اتاك الماجيك

طبعآ الكود مثال بس تقدر تستخدمه وتضيف مثلا اتش بي و ماجيك دفنس وبريك وغيره

هشرحلك الكود أنا بحب أشتغل بنظام قاعدة الشرط " If " لأن نسبة عيوبها بتبقا 0%

الكود دا مثلا معناه ايه ,

Html

 if (client.Entity.Class >= 135 && client.Entity.Class <= 145 && client.Entity.NobilityRank == NobilityRank.King
الكود دا ترجمته الحرفيه " لو كانت الشخصيه "كنج" و الكلاس بتاعها فاير أو واتر ..."
يعني لو الشروط دي توافرت يبقا هينفذ الي انت تكتبهوله هيزود دم وأتاك مثلا
زي منا قولتله في الاكواد دي ,

Html

client.Entity.MagicAttack += 8000
                
client.Entity.MinAttack += 5000
                
client.Entity.Defence += 10000
                
client.Entity.MagicDamageIncrease += 5000
طبعآ انتا تقدر تزود أو تقلل في الشروط يعني تقوله لو كان الاكونت كنج بس زي كدا ,

Html

#region Kings attack 
            
if (client.Entity.NobilityRank == NobilityRank.King
            { 
                
client.Entity.MagicDamageIncrease += 5000
                
client.Entity.MaxAttack += 7000
                
client.Entity.MinAttack += 5000
                
client.Entity.Defence += 10000
                } 
#endregion 
دا كود جاهز للكنج والبرنس بيزود الاتاك والدفنس والدم للكنج والبرنس ,

Html

#region Kings attack 
            
if (client.Entity.NobilityRank == NobilityRank.King && client.Entity.Class >= 25 && client.Entity.Class <= 15 && client.Entity.Class <= 45 && client.Entity.Class <= 55 && client.Entity.Class <= 65 && client.Entity.Class <= 75 && client.Entity.Class <= 85
            { 
                
client.Entity.MagicDamageIncrease += 5000
                
client.Entity.MaxAttack += 7000
                
client.Entity.MinAttack += 5000
                
client.Entity.Defence += 10000
                
client.Entity.MaxHitpoints 10000
                } 
            else if (
client.Entity.Class >= 135 && client.Entity.Class <= 145 && client.Entity.NobilityRank == NobilityRank.King
            { 
                
client.Entity.MagicAttack += 8000
                
client.Entity.MinAttack += 5000
                
client.Entity.Defence += 10000
                
client.Entity.MagicDamageIncrease += 5000
                
client.Entity.MaxHitpoints 10000
            } 
            
#endregion 
                 #region Prince attack 
            
if (client.Entity.NobilityRank == NobilityRank.Prince && client.Entity.Class >= 25 && client.Entity.Class <= 15 && client.Entity.Class <= 45 && client.Entity.Class <= 55 && client.Entity.Class <= 65 && client.Entity.Class <= 75 && client.Entity.Class <= 85
            {                
                
client.Entity.MaxAttack += 5000
                
client.Entity.MinAttack += 3000
                
client.Entity.Defence += 6000
                
client.Entity.MagicDamageIncrease += 3000
                
client.Entity.MaxHitpoints 10000
            } 
                else if (
client.Entity.Class >= 135 && client.Entity.Class <= 145 && client.Entity.NobilityRank == NobilityRank.Prince
            { 
                    
client.Entity.MagicAttack += 5000
                
client.Entity.MinAttack += 3000
                
client.Entity.Defence += 6000
                
client.Entity.MagicDamageIncrease += 3000
                
client.Entity.MaxHitpoints 10000
                } 
            
#endregion 
بالنسبه للاستجما Stigma

هتفتح كلاس Entity

وابحث عن ,

Html

public int AdjustAttack(int attack

انزل لحد الكود دا ,

Html

if (ContainsFlag(Network.GamePackets.Update.Flags.Stigma)) 
                
attack += (int)((double)attack 0.3); 
وتعدل علي 0.3 تقللها او تزودها براحتك ,