منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   تطوير سيرفرات كونكر (https://code.vpscairo.com/forumdisplay.php?f=11)
-   -   حل مشكلة ضربة فيزيكال للنينجا و بروسلي[RayzoV3] (https://code.vpscairo.com/showthread.php?t=3057)

Rider 2019-11-22 01:53 PM

حل مشكلة ضربة فيزيكال للنينجا و بروسلي[RayzoV3]
 
افتخ كلاس
FatalSpin.cs

و بدله كله ب ده
كود PHP:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 
Rayzo.Game.MsgServer.AttackHandler
{
    public class 
FatalSpin
    
{

        public 
unsafe static void Execute(Client.GameState userInteractQuery AttackServerSockets.Packet streamDictionary<ushortDatabase.MagicType.MagicDBSpells)
        {
            
Database.MagicType.Magic DBSpell;
            
MsgSpell ClientSpell;
            if (
CheckAttack.CanUseSpell.Verified(AttackuserDBSpellsout ClientSpellout DBSpell))
            {
                switch (
ClientSpell.ID)
                {
                    case (
ushort)Enums.SpellID.FatalSpin:
                        {

                            try
                            {
                                
user.SendScreen(stream.InteractionCreate(&Attack), true);
                                
MsgSpellAnimation MsgSpell = new MsgSpellAnimation(user.Entity.UID
                                    
0Attack.XAttack.YClientSpell.ID
                                    
ClientSpell.LevelClientSpell.UseSpellSoul);
                                
Algoritms.InLineAlgorithm Line = new Algoritms.InLineAlgorithm(user.Entity.XAttack.Xuser.Entity.YAttack.Yuser.MapDBSpell.Range0ClientSpell.ID);

                                
byte LineRange 2;
                                
uint Experience 0;

                                foreach (
Interfaces.IMapObject target in user.Screen.Objects)
                                {
                                    
Game.Entity attacked target as Game.Entity;
                                    if (
target.MapObjType == MapObjectType.Monster)
                                    {
                                        if (
Kernel.GetDistance(user.Entity.Xuser.Entity.Yattacked.Xattacked.Y) < DBSpell.Range)
                                        {
                                            if (
Line.InLine(attacked.Xattacked.YLineRange))
                                            {
                                                if (
CheckAttack.CanAttackMonster.Verified(userattackedDBSpell))
                                                {
                                                    
MsgSpellAnimation.SpellObj AnimationObj;
                                                    
Calculate.Physical.OnMonster(user.EntityattackedDBSpellout AnimationObj);
                                                    
AnimationObj.Damage Calculate.Base.CalculateSoul(AnimationObj.DamageClientSpell.UseSpellSoul);
                                                    
Experience += ReceiveAttack.Monster.Execute(streamAnimationObjuserattacked);
                                                    
MsgSpell.Targets.Enqueue(AnimationObj);

                                                }
                                            }
                                        }
                                    }
                                }
                                foreach (
Interfaces.IMapObject targer in user.Screen.Objects)
                                {
                                    var 
attacked targer as Game.Entity;
                                    if (
targer.MapObjType == MapObjectType.Entity && user.Entity.UID != targer.UID)
                                    {
                                        if (
Kernel.GetDistance(user.Entity.Xuser.Entity.Ytarger.Xtarger.Y) < DBSpell.Range)
                                        {
                                            if (
Line.InLine(attacked.Xattacked.YLineRange))
                                            {
                                                if (
CheckAttack.CanAttackPlayer.Verified(userattackedDBSpell))
                                                {
                                                    
MsgSpellAnimation.SpellObj AnimationObj;
                                                    
Calculate.Physical.OnPlayer(user.EntityattackedDBSpellout AnimationObj);
                                                    
AnimationObj.Damage Calculate.Base.CalculateSoul(AnimationObj.DamageClientSpell.UseSpellSoul);
                                                    
AnimationObj.Damage = (uint)(AnimationObj.Damage 2.4);
                                                    
ReceiveAttack.Player.Execute(stream,AnimationObjuserattacked);
                                                    
MsgSpell.Targets.Enqueue(AnimationObj);
                                                }
                                            }
                                        }
                                    }
                                }
                                foreach (
Interfaces.IMapObject targer in user.Screen.Objects)
                                {
                                    var 
attacked targer as Network.GamePackets.SobNpcSpawn;
                                    if (
targer.MapObjType == MapObjectType.SobNpc)
                                    {
                                        if (
Kernel.GetDistance(user.Entity.Xuser.Entity.Ytarger.Xtarger.Y) < DBSpell.Range)
                                        {
                                            if (
Line.InLine(attacked.Xattacked.YLineRange))
                                            {
                                                if (
CheckAttack.CanAttackNpc.Verified(userattackedDBSpell))
                                                {
                                                    
MsgSpellAnimation.SpellObj AnimationObj;
                                                    
Calculate.Physical.OnNpcs(user.EntityattackedDBSpellout AnimationObj);
                                                    
AnimationObj.Damage Calculate.Base.CalculateSoul(AnimationObj.DamageClientSpell.UseSpellSoul);
                                                    
Experience += ReceiveAttack.Npc.Execute(streamAnimationObjuserattacked);
                                                    
MsgSpell.Targets.Enqueue(AnimationObj);
                                                }
                                            }
                                        }
                                    }
                                }
                                
Updates.IncreaseExperience.Up(streamuserExperience);
                                
Updates.UpdateSpell.CheckUpdate(streamuserAttackExperienceDBSpells);
                                
MsgSpell.SetStream(stream); MsgSpell.Send(user);

                            }
                            catch (
Exception e)
                            {
                                
Console.WriteLine(e.ToString());
                            }

                            break;
                        }
                    case (
ushort)Enums.SpellID.DragonPunch:
                        {
                            try
                            {
                                
user.SendScreen(stream.InteractionCreate(&Attack), true);

                                
MsgSpellAnimation MsgSpell = new MsgSpellAnimation(user.Entity.UID
                                    
0Attack.XAttack.YClientSpell.ID
                                    
ClientSpell.LevelClientSpell.UseSpellSoul);
                                
Algoritms.InLineAlgorithm Line = new Algoritms.InLineAlgorithm(user.Entity.XAttack.Xuser.Entity.YAttack.Yuser.MapDBSpell.Range0ClientSpell.ID);

                                
byte LineRange 0;
                                
uint Experience 0;

                                foreach (
Interfaces.IMapObject target in user.Screen.Objects)
                                {
                                    
Game.Entity attacked target as Game.Entity;
                                    if (
target.MapObjType == MapObjectType.Monster)
                                    {
                                        if (
Kernel.GetDistance(user.Entity.Xuser.Entity.Yattacked.Xattacked.Y) < DBSpell.Range)
                                        {
                                            if (
Line.InLine(attacked.Xattacked.YLineRange))
                                            {
                                                if (
CheckAttack.CanAttackMonster.Verified(userattackedDBSpell))
                                                {
                                                    
MsgSpellAnimation.SpellObj AnimationObj;
                                                    
Calculate.Physical.OnMonster(user.EntityattackedDBSpellout AnimationObj);
                                                    
AnimationObj.Damage Calculate.Base.CalculateSoul(AnimationObj.DamageClientSpell.UseSpellSoul);
                                                    
Experience += ReceiveAttack.Monster.Execute(streamAnimationObjuserattacked);
                                                    
MsgSpell.Targets.Enqueue(AnimationObj);

                                                }
                                            }
                                        }
                                    }
                                }
                                foreach (
Interfaces.IMapObject targer in user.Screen.Objects)
                                {
                                    var 
attacked targer as Game.Entity;
                                    if (
targer.MapObjType == MapObjectType.Entity && user.Entity.UID != targer.UID)
                                    {
                                        if (
Kernel.GetDistance(user.Entity.Xuser.Entity.Ytarger.Xtarger.Y) < DBSpell.Range)
                                        {
                                            if (
Line.InLine(attacked.Xattacked.YLineRange))
                                            {
                                                if (
CheckAttack.CanAttackPlayer.Verified(userattackedDBSpell))
                                                {
                                                    
MsgSpellAnimation.SpellObj AnimationObj;
                                                    
Calculate.Physical.OnPlayer(user.EntityattackedDBSpellout AnimationObj);
                                                    
AnimationObj.Damage Calculate.Base.CalculateSoul(AnimationObj.DamageClientSpell.UseSpellSoul);
                                                    
AnimationObj.Damage = (uint)(AnimationObj.Damage 2.4);
                                                    
ReceiveAttack.Player.Execute(stream,AnimationObjuserattacked);
                                                    
MsgSpell.Targets.Enqueue(AnimationObj);
                                                }
                                            }
                                        }
                                    }
                                }
                                foreach (
Interfaces.IMapObject targer in user.Screen.Objects)
                                {
                                    var 
attacked targer as Network.GamePackets.SobNpcSpawn;
                                    if (
targer.MapObjType == MapObjectType.SobNpc)
                                    {
                                        if (
Kernel.GetDistance(user.Entity.Xuser.Entity.Ytarger.Xtarger.Y) < DBSpell.Range)
                                        {
                                            if (
Line.InLine(attacked.Xattacked.YLineRange))
                                            {
                                                if (
CheckAttack.CanAttackNpc.Verified(userattackedDBSpell))
                                                {
                                                    
MsgSpellAnimation.SpellObj AnimationObj;
                                                    
Calculate.Physical.OnNpcs(user.EntityattackedDBSpellout AnimationObj);
                                                    
AnimationObj.Damage Calculate.Base.CalculateSoul(AnimationObj.DamageClientSpell.UseSpellSoul);
                                                    
Experience += ReceiveAttack.Npc.Execute(streamAnimationObjuserattacked);
                                                    
MsgSpell.Targets.Enqueue(AnimationObj);
                                                }
                                            }
                                        }
                                    }
                                }
                                
Updates.IncreaseExperience.Up(streamuserExperience);
                                
Updates.UpdateSpell.CheckUpdate(streamuserAttackExperienceDBSpells);
                                
MsgSpell.SetStream(stream);
                                
MsgSpell.Send(user);

                            }
                            catch (
Exception e)
                            {
                                
Console.WriteLine(e.ToString());
                            }
                            break;
                        }
                }
            }
        }
    }


"]اتفتخ كلاس
FatalSpin.cs

و بدله كله ب ده
كود PHP:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 
Rayzo.Game.MsgServer.AttackHandler
{
    public class 
FatalSpin
    
{

        public 
unsafe static void Execute(Client.GameState userInteractQuery AttackServerSockets.Packet streamDictionary<ushortDatabase.MagicType.MagicDBSpells)
        {
            
Database.MagicType.Magic DBSpell;
            
MsgSpell ClientSpell;
            if (
CheckAttack.CanUseSpell.Verified(AttackuserDBSpellsout ClientSpellout DBSpell))
            {
                switch (
ClientSpell.ID)
                {
                    case (
ushort)Enums.SpellID.FatalSpin:
                        {

                            try
                            {
                                
user.SendScreen(stream.InteractionCreate(&Attack), true);
                                
MsgSpellAnimation MsgSpell = new MsgSpellAnimation(user.Entity.UID
                                    
0Attack.XAttack.YClientSpell.ID
                                    
ClientSpell.LevelClientSpell.UseSpellSoul);
                                
Algoritms.InLineAlgorithm Line = new Algoritms.InLineAlgorithm(user.Entity.XAttack.Xuser.Entity.YAttack.Yuser.MapDBSpell.Range0ClientSpell.ID);

                                
byte LineRange 2;
                                
uint Experience 0;

                                foreach (
Interfaces.IMapObject target in user.Screen.Objects)
                                {
                                    
Game.Entity attacked target as Game.Entity;
                                    if (
target.MapObjType == MapObjectType.Monster)
                                    {
                                        if (
Kernel.GetDistance(user.Entity.Xuser.Entity.Yattacked.Xattacked.Y) < DBSpell.Range)
                                        {
                                            if (
Line.InLine(attacked.Xattacked.YLineRange))
                                            {
                                                if (
CheckAttack.CanAttackMonster.Verified(userattackedDBSpell))
                                                {
                                                    
MsgSpellAnimation.SpellObj AnimationObj;
                                                    
Calculate.Physical.OnMonster(user.EntityattackedDBSpellout AnimationObj);
                                                    
AnimationObj.Damage Calculate.Base.CalculateSoul(AnimationObj.DamageClientSpell.UseSpellSoul);
                                                    
Experience += ReceiveAttack.Monster.Execute(streamAnimationObjuserattacked);
                                                    
MsgSpell.Targets.Enqueue(AnimationObj);

                                                }
                                            }
                                        }
                                    }
                                }
                                foreach (
Interfaces.IMapObject targer in user.Screen.Objects)
                                {
                                    var 
attacked targer as Game.Entity;
                                    if (
targer.MapObjType == MapObjectType.Entity && user.Entity.UID != targer.UID)
                                    {
                                        if (
Kernel.GetDistance(user.Entity.Xuser.Entity.Ytarger.Xtarger.Y) < DBSpell.Range)
                                        {
                                            if (
Line.InLine(attacked.Xattacked.YLineRange))
                                            {
                                                if (
CheckAttack.CanAttackPlayer.Verified(userattackedDBSpell))
                                                {
                                                    
MsgSpellAnimation.SpellObj AnimationObj;
                                                    
Calculate.Physical.OnPlayer(user.EntityattackedDBSpellout AnimationObj);
                                                    
AnimationObj.Damage Calculate.Base.CalculateSoul(AnimationObj.DamageClientSpell.UseSpellSoul);
                                                    
AnimationObj.Damage = (uint)(AnimationObj.Damage 2.4);
                                                    
ReceiveAttack.Player.Execute(stream,AnimationObjuserattacked);
                                                    
MsgSpell.Targets.Enqueue(AnimationObj);
                                                }
                                            }
                                        }
                                    }
                                }
                                foreach (
Interfaces.IMapObject targer in user.Screen.Objects)
                                {
                                    var 
attacked targer as Network.GamePackets.SobNpcSpawn;
                                    if (
targer.MapObjType == MapObjectType.SobNpc)
                                    {
                                        if (
Kernel.GetDistance(user.Entity.Xuser.Entity.Ytarger.Xtarger.Y) < DBSpell.Range)
                                        {
                                            if (
Line.InLine(attacked.Xattacked.YLineRange))
                                            {
                                                if (
CheckAttack.CanAttackNpc.Verified(userattackedDBSpell))
                                                {
                                                    
MsgSpellAnimation.SpellObj AnimationObj;
                                                    
Calculate.Physical.OnNpcs(user.EntityattackedDBSpellout AnimationObj);
                                                    
AnimationObj.Damage Calculate.Base.CalculateSoul(AnimationObj.DamageClientSpell.UseSpellSoul);
                                                    
Experience += ReceiveAttack.Npc.Execute(streamAnimationObjuserattacked);
                                                    
MsgSpell.Targets.Enqueue(AnimationObj);
                                                }
                                            }
                                        }
                                    }
                                }
                                
Updates.IncreaseExperience.Up(streamuserExperience);
                                
Updates.UpdateSpell.CheckUpdate(streamuserAttackExperienceDBSpells);
                                
MsgSpell.SetStream(stream); MsgSpell.Send(user);

                            }
                            catch (
Exception e)
                            {
                                
Console.WriteLine(e.ToString());
                            }

                            break;
                        }
                    case (
ushort)Enums.SpellID.DragonPunch:
                        {
                            try
                            {
                                
user.SendScreen(stream.InteractionCreate(&Attack), true);

                                
MsgSpellAnimation MsgSpell = new MsgSpellAnimation(user.Entity.UID
                                    
0Attack.XAttack.YClientSpell.ID
                                    
ClientSpell.LevelClientSpell.UseSpellSoul);
                                
Algoritms.InLineAlgorithm Line = new Algoritms.InLineAlgorithm(user.Entity.XAttack.Xuser.Entity.YAttack.Yuser.MapDBSpell.Range0ClientSpell.ID);

                                
byte LineRange 0;
                                
uint Experience 0;

                                foreach (
Interfaces.IMapObject target in user.Screen.Objects)
                                {
                                    
Game.Entity attacked target as Game.Entity;
                                    if (
target.MapObjType == MapObjectType.Monster)
                                    {
                                        if (
Kernel.GetDistance(user.Entity.Xuser.Entity.Yattacked.Xattacked.Y) < DBSpell.Range)
                                        {
                                            if (
Line.InLine(attacked.Xattacked.YLineRange))
                                            {
                                                if (
CheckAttack.CanAttackMonster.Verified(userattackedDBSpell))
                                                {
                                                    
MsgSpellAnimation.SpellObj AnimationObj;
                                                    
Calculate.Physical.OnMonster(user.EntityattackedDBSpellout AnimationObj);
                                                    
AnimationObj.Damage Calculate.Base.CalculateSoul(AnimationObj.DamageClientSpell.UseSpellSoul);
                                                    
Experience += ReceiveAttack.Monster.Execute(streamAnimationObjuserattacked);
                                                    
MsgSpell.Targets.Enqueue(AnimationObj);

                                                }
                                            }
                                        }
                                    }
                                }
                                foreach (
Interfaces.IMapObject targer in user.Screen.Objects)
                                {
                                    var 
attacked targer as Game.Entity;
                                    if (
targer.MapObjType == MapObjectType.Entity && user.Entity.UID != targer.UID)
                                    {
                                        if (
Kernel.GetDistance(user.Entity.Xuser.Entity.Ytarger.Xtarger.Y) < DBSpell.Range)
                                        {
                                            if (
Line.InLine(attacked.Xattacked.YLineRange))
                                            {
                                                if (
CheckAttack.CanAttackPlayer.Verified(userattackedDBSpell))
                                                {
                                                    
MsgSpellAnimation.SpellObj AnimationObj;
                                                    
Calculate.Physical.OnPlayer(user.EntityattackedDBSpellout AnimationObj);
                                                    
AnimationObj.Damage Calculate.Base.CalculateSoul(AnimationObj.DamageClientSpell.UseSpellSoul);
                                                    
AnimationObj.Damage = (uint)(AnimationObj.Damage 2.4);
                                                    
ReceiveAttack.Player.Execute(stream,AnimationObjuserattacked);
                                                    
MsgSpell.Targets.Enqueue(AnimationObj);
                                                }
                                            }
                                        }
                                    }
                                }
                                foreach (
Interfaces.IMapObject targer in user.Screen.Objects)
                                {
                                    var 
attacked targer as Network.GamePackets.SobNpcSpawn;
                                    if (
targer.MapObjType == MapObjectType.SobNpc)
                                    {
                                        if (
Kernel.GetDistance(user.Entity.Xuser.Entity.Ytarger.Xtarger.Y) < DBSpell.Range)
                                        {
                                            if (
Line.InLine(attacked.Xattacked.YLineRange))
                                            {
                                                if (
CheckAttack.CanAttackNpc.Verified(userattackedDBSpell))
                                                {
                                                    
MsgSpellAnimation.SpellObj AnimationObj;
                                                    
Calculate.Physical.OnNpcs(user.EntityattackedDBSpellout AnimationObj);
                                                    
AnimationObj.Damage Calculate.Base.CalculateSoul(AnimationObj.DamageClientSpell.UseSpellSoul);
                                                    
Experience += ReceiveAttack.Npc.Execute(streamAnimationObjuserattacked);
                                                    
MsgSpell.Targets.Enqueue(AnimationObj);
                                                }
                                            }
                                        }
                                    }
                                }
                                
Updates.IncreaseExperience.Up(streamuserExperience);
                                
Updates.UpdateSpell.CheckUpdate(streamuserAttackExperienceDBSpells);
                                
MsgSpell.SetStream(stream);
                                
MsgSpell.Send(user);

                            }
                            catch (
Exception e)
                            {
                                
Console.WriteLine(e.ToString());
                            }
                            break;
                        }
                }
            }
        }
    }



ALz3em 2019-11-22 07:08 PM

رد: حل مشكلة ضربة فيزيكال للنينجا و بروسلي[RayzoV3]
 
عاش تسلم


الساعة الآن 10:55 AM

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