عرض مشاركة واحدة
احصائياتى

الردود
7

المشاهدات
5078
 
Commander

Commander is on a distinguished road

    غير متواجد

المشاركات
127

+التقييم
0.06

تاريخ التسجيل
Jul 2019

الاقامة
https://www.facebook.com/Hossam.eldein123/

نظام التشغيل

رقم العضوية
407
2019-08-21, 01:07 AM
المشاركة 1 
#1  
افتراضي مشكلة اسكلة thumdercloud في سورس Fighter
بسم الله الرحمن الرحيم
الموضوع معمول بناءا علي طلب العضو ابو مروان والمشكلة هي ان الاسكله بتضرب في اللاعب حتي لو قافل البكي
نخش علي كلاس World وبحث عن

كود:
 void ThunderCloudTimer 

هنبدل الفويد كلو بدا

كود:
 public static void ThunderCloudTimer(Entity ThunderCloudint time)
        {
            if (
ThunderCloud == null) return;
            if (!
Kernel.Maps.ContainsKey(ThunderCloud.MapID))
            {
                
Kernel.Maps[ThunderCloud.MapID].RemoveEntity(ThunderCloud);
                
Data data = new Data(true);
                
data.UID ThunderCloud.UID;
                
data.ID Data.RemoveEntity;
                
ThunderCloud.MonsterInfo.SendScreen(data);
                
ThunderCloud.MonsterInfo.SendScreen(data);
                foreach (var 
client in Kernel.GamePool.Values)
                {
                    if (
Kernel.GetDistance(ThunderCloud.XThunderCloud.Yclient.Player.Xclient.Player.Y) > 16) continue;
                    
client.RemoveScreenSpawn(ThunderCloudtrue);
                }
                return;
            }
            if (
Time32.Now >= ThunderCloud.ThunderCloudStamp.AddSeconds(1))
            {
                
ThunderCloud.ThunderCloudStamp Time32.Now;
                if (
ThunderCloud.Hitpoints 400)
                    
ThunderCloud.Hitpoints -= 400;
                else
                {
                    
Kernel.Maps[ThunderCloud.MapID].RemoveEntity(ThunderCloud);
                    
Data data = new Data(true);
                    
data.UID ThunderCloud.UID;
                    
data.ID Data.RemoveEntity;
                    
ThunderCloud.MonsterInfo.SendScreen(data);
                    
ThunderCloud.MonsterInfo.SendScreen(data);
                    foreach (var 
client in Kernel.GamePool.Values)
                    {
                        if (
Kernel.GetDistance(ThunderCloud.XThunderCloud.Yclient.Player.Xclient.Player.Y) > 16) continue;
                        
client.RemoveScreenSpawn(ThunderCloudtrue);
                    }
                    return;
                }
            }
            if ((
ThunderCloud.SpawnPacket[50] == && Time32.Now >= ThunderCloud.MonsterInfo.LastMove.AddMilliseconds(750)) || ThunderCloud.SpawnPacket[50] == 128)
            {
                
ThunderCloud.MonsterInfo.LastMove Time32.Now;
                if (
ThunderCloud.MonsterInfo.InSight == 0)
                {
                    foreach (var 
one in Kernel.Maps[ThunderCloud.MapID].Entities.Values.Where(=> Kernel.GetDistance(ThunderCloud.XThunderCloud.Yi.Xi.Y) <= ThunderCloud.MonsterInfo.AttackRange))
                    {
                        if (
one == null || one.Dead || one.MonsterInfo.Guard || one.Companion) continue;
                        
ThunderCloud.MonsterInfo.InSight one.UID;
                        
Entity insight null;
                        if (
Kernel.Maps[ThunderCloud.MapID].Entities.ContainsKey(ThunderCloud.MonsterInfo.InSight))
                            
insight Kernel.Maps[ThunderCloud.MapID].Entities[ThunderCloud.MonsterInfo.InSight];
                        else if (
Kernel.GamePool.ContainsKey(ThunderCloud.MonsterInfo.InSight))
                            
insight Kernel.GamePool[ThunderCloud.MonsterInfo.InSight].Player;
                        if (
insight == null || insight.Dead || (insight.MonsterInfo != null && insight.MonsterInfo.Guard))
                        {
                            
ThunderCloud.MonsterInfo.InSight 0;
                            break;
                        }
                        new 
Game.Attacking.Handle(nullThunderCloudinsight);
                        break;
                    }
                }
                else
                {
                    
Entity insight null;
                    if (
Kernel.Maps[ThunderCloud.MapID].Entities.ContainsKey(ThunderCloud.MonsterInfo.InSight))
                        
insight Kernel.Maps[ThunderCloud.MapID].Entities[ThunderCloud.MonsterInfo.InSight];
                    else if (
Kernel.GamePool.ContainsKey(ThunderCloud.MonsterInfo.InSight))
                        
insight Kernel.GamePool[ThunderCloud.MonsterInfo.InSight].Player;
                    if (
insight == null || insight.Dead || (insight.MonsterInfo != null && insight.MonsterInfo.Guard))
                    {
                        
ThunderCloud.MonsterInfo.InSight 0;
                        return;
                    }
                    new 
Game.Attacking.Handle(nullThunderCloudinsight);
                }
            }

        } 

ونحط فوق الفويد الي احنا بدلناه دول

كود:
  public bool Register(Entity ThunderCloudd)
        {
            if (
ThunderCloudd.Owner.TimerSubscriptions == null)
            {
                
ThunderCloudd.Owner.TimerSyncRoot = new object();
                
ThunderCloudd.Owner.TimerSubscriptions = new IDisposable[]
                {
                    
ThunderCloud.Add(ThunderCloudd)
                };
                return 
true;
            }
            return 
false;
        }
        public 
void Unregister(Entity Thundercloud)
        {
            if (
Thundercloud.Owner == null || Thundercloud.Owner.TimerSubscriptions == null) return;
            
lock (Thundercloud.Owner.TimerSyncRoot)
            {
                if (
Thundercloud.Owner.TimerSubscriptions != null)
                {
                    foreach (var 
timer in Thundercloud.Owner.TimerSubscriptions)
                        
timer.Dispose();
                    
Thundercloud.Owner.TimerSubscriptions null;
                }
            }
        } 

بعد كدا نروح كلاس handle ونبحث عن

كود:
 case 12840

هنبدل الاسكلة بده

كود:
#region ThunderCloud
                                
case 12840:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.X;
                                            
suse.Y;
                                            
suse.SpellID spell.ID;
                                            
attacker.Owner.SendScreen(susetrue);
                                            
//////////////////////////////////////////////////
                                            ///////////////////////////////////////////////////
                                            
uint UID Kernel.Maps[attacker.MapID].EntityUIDCounter.Next;
                                            
uint Mesh 980;
                                            
//////////////////////////////////////////////////////
                                            
byte[] Buffer = new byte[68 8];
                                            
Writer.Write(Buffer.Length 80Buffer);
                                            
Writer.Write(20352Buffer);//Packet ID
                                            
Writer.Write(UID4Buffer);//FlowerUID
                                            
Writer.Write(42648Buffer);
                                            
Buffer[12] = 3;
                                            
Writer.Write(Mesh16Buffer);//FloorItemID
                                            
Buffer[24] = 14;//AttackRange
                                            
Writer.Write(X26Buffer);
                                            
Writer.Write(Y28Buffer);
                                            
Writer.Write("Thundercloud"30Buffer);
                                            
//////////////////////////////////////////////////
                                            ///////////////////////////////////////////////////
                                            //////////////////////////////////////////////////////
                                            
Entity ThunderCloud = new Entity(Game.EntityFlag.Monstertrue);
                                            
ThunderCloud.Name "Thundercloud";
                                            
ThunderCloud.Mesh Mesh;
                                            
ThunderCloud.UID UID;
                                            
ThunderCloud.GuildID attacker.GuildID;
                                            
ThunderCloud.MaxHitpoints attacker.MaxHitpoints;
                                            
ThunderCloud.Level 140;
                                            
ThunderCloud.X;
                                            
ThunderCloud.Y;
                                            
ThunderCloud.Facing attacker.Facing;
                                            
ThunderCloud.Boss 1;
                                            
ThunderCloud.MapID attacker.MapID;
                                            
Writer.Write(3308ThunderCloud.SpawnPacket);
                                            
Writer.Write(15272ThunderCloud.SpawnPacket);
                                            
Writer.Write(3271ThunderCloud.SpawnPacket);//AttackUser

                                            
ThunderCloud.CUID attacker.UID;
                                            
ThunderCloud.Owner = new Client.GameState(null);
                                            
ThunderCloud.Owner.Player ThunderCloud;
                                            
ThunderCloud.MonsterInfo = new MonsterInformation();
                                            
ThunderCloud.MonsterInfo.AttackType 24;
                                            
ThunderCloud.MonsterInfo.AttackSpeed 1000;
                                            
ThunderCloud.MonsterInfo.AttackRange 14;
                                            
ThunderCloud.MonsterInfo.Boss true;
                                            
ThunderCloud.MonsterInfo.BoundX X;
                                            
ThunderCloud.Companion true;
                                            
ThunderCloud.MonsterInfo.Guard false;
                                            
ThunderCloud.MonsterInfo.BoundY Y;
                                            
ThunderCloud.MonsterInfo.Defence attacker.Defence;
                                            
ThunderCloud.MonsterInfo.Hitpoints 10000;
                                            
ThunderCloud.MonsterInfo.Mesh 980;
                                            
ThunderCloud.MonsterInfo.MoveSpeed int.MaxValue;
                                            
ThunderCloud.MonsterInfo.Name "Thundercloud";
                                            
ThunderCloud.MonsterInfo.Owner attacker;
                                            
ThunderCloud.MonsterInfo.ViewRange 14;
                                            
ThunderCloud.MonsterInfo.RespawnTime 0;
                                            
ThunderCloud.MonsterInfo.RunSpeed int.MaxValue;
                                            
ThunderCloud.MonsterInfo.SpellID 13190;
                                            
ThunderCloud.Hitpoints 10000;
                                            
Kernel.Maps[ThunderCloud.MapID].AddEntity(ThunderCloud);
                                            
//////////////////////////////////////////////////////////////
                                            //////////////////////////////////////////////////////////
                                            //////////////////////////////////////////////////////////
                                            /////////////////////////////////////////////
                                            
Network.GamePackets.Data d = new Data(true);
                                            
d.UID UID;
                                            
d.ID Data.AddEntity;
                                            
d.Facing attacker.Facing;
                                            
d.X2 ThunderCloud.X;
                                            
d.Y2 ThunderCloud.Y;
                                            
///////////////////////////////////////////////
                                            ////////////////////////////////////////////
                                            /////////////////////////////////////////
                                            
attacker.Owner.SendScreen(Buffertrue);
                                            
attacker.Owner.SendScreen(ThunderCloud.SpawnPackettrue);
                                            
attacker.Owner.SendScreenSpawn(ThunderCloudtrue);
                                            
attacker.Owner.SendScreen(dtrue);
                                            
ThunderCloud.ThunderCloudStamp Time32.Now;
                                            
Program.World.Register(ThunderCloud);
                                            
attacker.AttackPacket null;
                                        }
                                        break;

                                    }
                                
#endregion 

هيجيلك ايرور في x2 و y2 حلهم جي في الاخر
في نفس الكلاس زي ما احنا ركزو بقي في الحته ده هنبحث عن

كود:
 if (attacker.MonsterInfo.SpellID == 0

هتنزل سطرين او تلاته وهتلاقي ريجون اسمو thundercloud امسحو وبعدين انزل شويه لحد سطر

كود:
 uint damage Calculate.MonsterDamage(attackerattackedattacker.MonsterInfo.SpellID); 

حط تحته دا

كود:
#region ThunderCloud
                        
if (attacker.Name == "Thundercloud")
                        {
                            if (
Kernel.GamePool.ContainsKey(attacker.CUID))
                            {
                                var 
owner Kernel.GamePool[attacker.CUID];
                                var 
spell Database.SpellTable.GetSpell(12840owner);
                                var 
spell2 Database.SpellTable.GetSpell(12970owner);
                                
uint damage2 = (uint)(Calculate.Melee(owner.Playerattackedref attack0) * (spell.Level spell.FirstDamage 50) / 100);
                                if (
attacker.SpawnPacket[50] == 128)
                                    
damage2 = (uint)(damage2 spell2.FirstDamage);
                                
SpellUse suse2 = new SpellUse(true);
                                
suse2.Attacker attacker.UID;
                                
suse2.Attacker1 attacked.UID;
                                
suse2.SpellID 13190;
                                
suse2.attacked.X;
                                
suse2.attacked.Y;
                                
suse2.AddTarget(attackeddamage2attack);
                                
attacker.MonsterInfo.SendScreen(suse2);
                                if (
attacked.Hitpoints <= damage2)
                                {
                                    
attacked.Die(attacker);
                                    
attack = new Attack(true);
                                    
attack.Attacker attacker.UID;
                                    
attack.Attacked attacked.UID;
                                    
attack.AttackType Network.GamePackets.Attack.Kill;
                                    
attack.attacked.X;
                                    
attack.attacked.Y;
                                    
attack.Damage 1;
                                    
attack.ResponseDamage damage2;
                                    
attacker.MonsterInfo.SendScreen(attack);
                                }
                                else
                                {
                                    
attacked.Hitpoints -= damage2;
                                }
                                return;
                            }
                            else
                                return;
                        }
                        
#endregion 

هيتبقالك ايرور x2 و y2 روح class data ابحث عن

كود:
 public ushort Thundercloud 

ضيف تحتها

كود:
   public ushort X2
        
{
            
get
            
{
                return 
BitConverter.ToUInt16(Buffer28);
            }
            
set
            
{
                
Writer.Write(value28Buffer);
            }
        }
        public 
ushort Y2
        
{
            
get
            
{
                return 
BitConverter.ToUInt16(Buffer30);
            }
            
set
            
{
                
Writer.Write(value30Buffer);
            }
        } 

بس كدا المشكلة اتحلت والسلام عليكم ورحمة الله وبركاته