منتدي اكواد

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

youssefabdelmanam 2019-12-01 05:31 PM

مشكلى في سرعة الضربة
 
السلام عليكم

يا رجالة انا عندي الننجا بيضرب بسرعة يعني بيضرب الضربة والتانية وراها علي طول

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

دا كمان حطيت اجيلتي وبرضو في بطيْ

فا ياريت الي يعرف حل يقولي حل يفيدني

ودي اكواد السكلة في الهاندل

كود PHP:

case 10381:
                                    {
                                         
//if (CanUseSpell(spell, attacker.Owner) && Time32.Now > attacker.SpellStamp.AddMilliseconds(500))
                                        
{
                                            
attacker.SpellStamp Time32.Now;
                                            
ushort XxYx;
                                            if (
attacked != null)
                                            {
                                                
Xx attacked.X;
                                                
Yx attacked.Y;
                                            }
                                            else
                                            {
                                                
Xx attackedsob.X;
                                                
Yx attackedsob.Y;
                                            }
                                            if (
Kernel.GetDistance(attacker.Xattacker.YXxYx) <= 7)
                                            {
                                                if (
attackedsob == null)
                                                    if (
attacked.ContainsFlag(Update.Flags.Fly))
                                                        return;

                                                if (
attacker.ContainsFlag(Update.Flags.Fly))
                                                    return;
                                                
PrepareSpell(spellattacker.Owner);
                                                
SpellUse suse = new SpellUse(true);
                                                
attacker.Stamina -= spell.UseStamina;
                                                
suse.Attacker attacker.UID;
                                                
// attacker.Stamina -= 9;
                                                
suse.SpellID spell.ID;
                                                
suse.SpellLevel spell.Level;
                                                
suse.X;
                                                
suse.Y;

                                                
bool send false;
                                                if (
attackedsob == null)
                                                {
                                                    if (
CanAttack(attackerattackedspellattack.AttackType == Attack.Melee))
                                                    {
                                                        
attack.Effect1 Attack.AttackEffects1.None;
                                                        
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attackclient_Spell.LevelHu2);
                                                        
damage = (uint)(damage 1.4);
                                                        
suse.Effect1 attack.Effect1;
                                                        
//double dmg = (double)damage * 0.9;
                                                        //damage = (uint)dmg;
                                                        
ReceiveAttack(attackerattackedattackref damagespell);
                                                        
suse.AddTarget(attackeddamageattack);
                                                        
send true;
                                                    }
                                                }
                                                else
                                                {
                                                    if (
CanAttack(attackerattackedsobspell))
                                                    {
                                                        
attack.Effect1 Attack.AttackEffects1.None;
                                                        
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                        
damage = (uint)(damage 180 100);
                                                        
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                        
suse.Effect1 attack.Effect1;
                                                        
suse.AddTarget(attackedsobdamageattack);
                                                        
send true;
                                                    }
                                                }
                                                if (
send)
                                                    
attacker.Owner.SendScreen(susetrue);
                                            }
                                            else
                                            {
                                                
attacker.AttackPacket null;
                                            }
                                        }
                                        break;
                                    } 

وشكرا للجميع مقدما

Hassan Emprator 2019-12-01 05:48 PM

رد: مشكلى في سرعة الضربة
 
سورسك في Spell في القاعده وله لا ؟

Hassan Emprator 2019-12-01 05:51 PM

رد: مشكلى في سرعة الضربة
 
اعمله وجرب

بدل وجرب

كود PHP:

 case 10381:
                                        {
                                            if (
CanUseSpell(spellattacker.Owner) && Time32.Now attacker.SpellStamp.AddMilliseconds(600))
                                            {
                                                
attacker.SpellStamp Time32.Now;
                                                
ushort XxYx;
                                                if (
attacked != null)
                                                {
                                                    
Xx attacked.X;
                                                    
Yx attacked.Y;
                                                }
                                                else
                                                {
                                                    
Xx attackedsob.X;
                                                    
Yx attackedsob.Y;
                                                }
                                                if (
Kernel.GetDistance(attacker.Xattacker.YXxYx) <= 7)
                                                {
                                                    if (
attackedsob == null)
                                                        if (
attacked.ContainsFlag(Update.Flags.Fly))
                                                            return;

                                                    if (
attacker.ContainsFlag(Update.Flags.Fly))
                                                        return;
                                                    
PrepareSpell(spellattacker.Owner);
                                                    
SpellUse suse = new SpellUse(true);
                                                    
attacker.Stamina -= spell.UseStamina;
                                                    
suse.Attacker attacker.UID;
                                                    
// attacker.Stamina -= 9;
                                                    
suse.SpellID spell.ID;
                                                    
suse.SpellLevel spell.Level;
                                                    
suse.X;
                                                    
suse.Y;

                                                    
bool send false;
                                                    if (
attackedsob == null)
                                                    {
                                                        if (
CanAttack(attackerattackedspellattack.AttackType == Attack.Melee))
                                                        {
                                                            
attack.Effect1 Attack.AttackEffects1.None;
                                                            
uint damage Game.Attacking.Calculate.Melee(attackerattackedref attackclient_Spell.LevelHu2);
                                                            
damage = (uint)(damage 1.4);
                                                            
suse.Effect1 attack.Effect1;
                                                            
//double dmg = (double)damage * 0.9;
                                                            //damage = (uint)dmg;
                                                            
ReceiveAttack(attackerattackedattackref damagespell);
                                                            
suse.AddTarget(attackeddamageattack);
                                                            
send true;
                                                        }
                                                    }
                                                    else
                                                    {
                                                        if (
CanAttack(attackerattackedsobspell))
                                                        {
                                                            
attack.Effect1 Attack.AttackEffects1.None;
                                                            
uint damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);
                                                            
damage = (uint)(damage 180 100);
                                                            
ReceiveAttack(attackerattackedsobattackdamagespell);
                                                            
suse.Effect1 attack.Effect1;
                                                            
suse.AddTarget(attackedsobdamageattack);
                                                            
send true;
                                                        }
                                                    }
                                                    if (
send)
                                                        
attacker.Owner.SendScreen(susetrue);
                                                }
                                                else
                                                {
                                                    
attacker.AttackPacket null;
                                                }
                                            }
                                            break;
                                        } 


youssefabdelmanam 2019-12-01 05:52 PM

رد: مشكلى في سرعة الضربة
 
اقتباس:

المشاركة الأصلية كتبت بواسطة Hassan Emprator (المشاركة 23797)
سورسك في Spell في القاعده وله لا ؟

ايوة يسطا

Hassan Emprator 2019-12-01 08:15 PM

رد: مشكلى في سرعة الضربة
 
اقتباس:

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

بدل الاسكله الي انا بعتهالك بي الاسكل اليي عندك

SourceDanger 2019-12-02 11:41 PM

رد: مشكلى في سرعة الضربة
 
الحل بسيط فشخ يا استازي العزيز انت عاوز الاسكله تبقا سريعه بدون اجلتي وفنفس الوقت متبقش بطئيه بس يا زميل هتعمل اي اول حاجه زي ما انت فى Handle تمام هتبحث عن if (!pass && attack.AttackType == Attack.Magic) هتلقي تحتو if (!(doWep1Spell || doWep2Spell)) دة

هتبدلو كلو بده
كود:

if (!pass && attack.AttackType == Attack.Magic)
                    {
                        if (!(doWep1Spell || doWep2Spell))
                        {
                            if (SpellID == 11960 || SpellID == 1045 || SpellID == 1046 || SpellID == 11005 || SpellID == 11000 || SpellID == 1100 || SpellID == 1002 || SpellID == 11070 || SpellID == 12080 || SpellID == 10381 || SpellID == 1095 || SpellID == 1090 || SpellID == 12110 || SpellID == 12350) // FB and SS
                            {
                                //do checks
                            }
                            else
                            {
                                int milliSeconds = 1000 - decrease;
                                if (milliSeconds < 0 || milliSeconds > 5000)
                                    milliSeconds = 0;
                                if (Time32.Now < attacker.AttackStamp.AddMilliseconds(milliSeconds))
                                    return;
                            }

                            attacker.AttackStamp = Time32.Now;
                        }
                    }

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

تقدر تعدل بس على if (Time32.Now >= attacker.SpellStamp.AddMilliseconds(450)) كدا هو جميل قوي لو عاوز تبطئ شوية هتكتب مثلان من 450 لحد 1000 وانت وطلع كدا هتلقي الاسكله بداءت تبطئ انما كل ما تتقل فى الرقم هتلقي الاسكله بقت سريعه فشخوله يارب مكونش طولت عليك وربنا يوفقك

youssefabdelmanam 2019-12-03 01:52 AM

رد: مشكلى في سرعة الضربة
 
اقتباس:

المشاركة الأصلية كتبت بواسطة sourcedanger (المشاركة 23977)
الحل بسيط فشخ يا استازي العزيز انت عاوز الاسكله تبقا سريعه بدون اجلتي وفنفس الوقت متبقش بطئيه بس يا زميل هتعمل اي اول حاجه زي ما انت فى handle تمام هتبحث عن if (!pass && attack.attacktype == attack.magic) هتلقي تحتو if (!(dowep1spell || dowep2spell)) دة

هتبدلو كلو بده
كود:

if (!pass && attack.attacktype == attack.magic)
                    {
                        if (!(dowep1spell || dowep2spell))
                        {
                            if (spellid == 11960 || spellid == 1045 || spellid == 1046 || spellid == 11005 || spellid == 11000 || spellid == 1100 || spellid == 1002 || spellid == 11070 || spellid == 12080 || spellid == 10381 || spellid == 1095 || spellid == 1090 || spellid == 12110 || spellid == 12350) // fb and ss
                            {
                                //do checks
                            }
                            else
                            {
                                int milliseconds = 1000 - decrease;
                                if (milliseconds < 0 || milliseconds > 5000)
                                    milliseconds = 0;
                                if (time32.now < attacker.attackstamp.addmilliseconds(milliseconds))
                                    return;
                            }

                            attacker.attackstamp = time32.now;
                        }
                    }

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

تقدر تعدل بس على if (time32.now >= attacker.spellstamp.addmilliseconds(450)) كدا هو جميل قوي لو عاوز تبطئ شوية هتكتب مثلان من 450 لحد 1000 وانت وطلع كدا هتلقي الاسكله بداءت تبطئ انما كل ما تتقل فى الرقم هتلقي الاسكله بقت سريعه فشخوله يارب مكونش طولت عليك وربنا يوفقك

اشكرك جدا اخي العزيز


الساعة الآن 11:50 PM

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