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

الردود
21

المشاهدات
5583
 
Commander

Commander is on a distinguished road

    غير متواجد

المشاركات
127

+التقييم
0.06

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

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

نظام التشغيل

رقم العضوية
407
2019-08-23, 09:09 PM
المشاركة 1 
#1  
افتراضي تــعــديـل ع حـل مشـكـلة الاسـكـلةة للاخ ابـو مـرووان
بسم الله الرحمن الرحيم
الناس الي متعرفش الموضوع القديم اهو
عفواً لايمكن عرض الرابط إلا بعد الرد على الموضوع
هنعدل بس علي الاكواد بتاعت كلاس handle وباقي الموضوع تمام

ابحث عن

كود:
 #region Monster -> Entity \ Monster 

[CENTER]هتلاقي جواه
#region ThunderCloud
#region ThunderCloudSight
اقفلهم وبدلهم الاتنين بدول

كود:
   #region ThunderCloud
                    
if (attacker.Name == "Thundercloud")
                    {
                        
                        if (
Kernel.GamePool.ContainsKey(attacker.OwnerUID))
                        {
                          
                            var 
owner Kernel.GamePool[attacker.OwnerUID];
                            var 
spell Database.SpellTable.GetSpell(12840owner);
                            var 
spell2 Database.SpellTable.GetSpell(12970owner);
                            
byte percent 0;
                            if (
spell2 != null)
                            {
                                if (
spell2.Level == 0percent 130;
                                if (
spell2.Level == 1percent 140;
                                if (
spell2.Level == 2percent 150;
                                if (
spell2.Level == 3percent 160;
                                if (
spell2.Level == 4percent 170;
                                if (
spell2.Level == 5percent 180;
                                if (
spell2.Level == 6percent 200;
                            }
                            
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;
                            
uint damage2 = (uint)(Calculate.Melee(owner.Playerattackedref attack) * spell.FirstDamage 100);
                            if (
attacker.SpawnPacket[50] == 128)//ThunderBolt
                                
damage2 = (uint)(damage2 percent 100);
                            
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.ResponseDamage damage2;
                                
attacker.MonsterInfo.SendScreen(attack);
                            }
                            else
                            {
                                
attacked.Hitpoints -= damage2;
                            }
                            return;
                        }
                        else
                            return;
                    }
                    
#endregion
                    #region ThunderCloudSight
                    
if (attacker != null && Kernel.Maps[attacker.MapID] != null)
                    {
                        foreach (var 
th in Kernel.Maps[attacker.MapID].Entities.Values.Where(=> i.Name == "Thundercloud"))
                        {
                            if (
th.OwnerUID == attacked.UID)
                            {
                                if (
attacker == null || Kernel.GetDistance(attacker.Xattacker.Yth.Xth.Y) > th.MonsterInfo.AttackRange || attacker.Dead) break;
                                
th.MonsterInfo.InSight attacker.UID;
                                break;
                            }
                        }
                    }
                    
#endregion 

بعد كدا روح علي الاسكله الي انا نزلتها و بدلها بده

كود:
#region ThunderCloud(Passive)
                                
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;
                                            
//////////////////////////////////////////////////////
                                            
MsgPetInfo pet = new MsgPetInfo();
                                            
pet.UID UID;
                                            
pet.PetID 4264;
                                            
pet.PetType 3;
                                            
pet.Mesh Mesh;
                                            
pet.AttackRange 14;
                                            
pet.X;
                                            
pet.Y;
                                            
pet.Name "Thundercloud";
                                            
//////////////////////////////////////////////////
                                            ///////////////////////////////////////////////////
                                            //////////////////////////////////////////////////////
                                            
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
                                            
Writer.Write(attacker.Owner.UnionID278ThunderCloud.SpawnPacket);//UnionID
                                            
ThunderCloud.OwnerUID 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(pet.ToArray(), true);
                                            
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 

بعد كدا روح فويد

كود:
void ReceiveAttack(Game.Entity attackerGame.Entity attackedAttack attackref uint damageDatabase.SpellInformation spell

هتلاقي

كود:
region thundercloud 

بدلو بده

كود:
#region ThunderCloud
            
if (attacked.Name == "Thundercloud")
            {
                if (
spell != null && spell.ID != 0damage 0;
                else 
damage 1;
            }
            foreach (var 
th in Kernel.Maps[attacker.MapID].Entities.Values.Where(=> i.Name == "Thundercloud"))
            {
                if (
th.OwnerUID == attacked.UID)
                {
                    if (
attacker == null || Kernel.GetDistance(attacker.Xattacker.Yth.Xth.Y) > th.MonsterInfo.AttackRange || attacker.Dead) break;
                    
th.MonsterInfo.InSight attacker.UID;
                    break;
                }
            }
            
#endregion 

بعد كدا تروح البول ده

كود:
 static bool CanAttack(Game.Entity attackerGame.Entity attackedDatabase.SpellInformation spellbool melee

هتلاقي region thundercloud بدله بده

كود:
#region ThunderCloud
            
if (attacked.Name == "Thundercloud")
            {
                if (
attacked.OwnerUID == attacker.UID) return false;
                if (!
Constants.PKForbiddenMaps.Contains(attacker.MapID))
                {
                    if (
attacker.PKMode != Fighter.Game.Enums.PKMode.PK &&
                     
attacker.PKMode != Fighter.Game.Enums.PKMode.Team)
                        return 
false;
                    else if (
Constants.PKFreeMaps.Contains(attacker.MapID))
                    {
                        return 
true;
                    }
                    else
                    {
                        
attacker.FlashingNameStamp Time32.Now;
                        
attacker.FlashingNameTime 20;
                        
attacker.AddFlag(Network.GamePackets.Update.Flags.FlashingName);
                        return 
true;
                    }
                }
                else if (
Constants.PKForbiddenMaps.Contains(attacker.Owner.Map.ID))
                {
                    if (
attacker.PKMode == Fighter.Game.Enums.PKMode.PK ||
                        
attacker.PKMode == Fighter.Game.Enums.PKMode.Team || (spell != null && spell.CanKill))
                    {
                        
attacker.Owner.Send(Constants.PKForbidden);
                        
attacker.AttackPacket null;
                    }
                    return 
false;
                }
            }
            
#endregion 

بعد كدا ابحث عن

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

[/CENTER
انزل لحد

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

ضيف فوقيه ده

كود:
#region ThunderCloud
                        
if (attacker.Name == "Thundercloud")
                        {
                            if (
Kernel.GamePool.ContainsKey(attacker.OwnerUID))
                            {
                                var 
owner Kernel.GamePool[attacker.OwnerUID];
                                var 
spell Database.SpellTable.GetSpell(12840owner);
                                var 
spell2 Database.SpellTable.GetSpell(12970owner);
                                
attack = new Attack(true);
                                
attack.Attacker attacker.UID;
                                
attack.Attacked attacked.UID;
                                
attack.AttackType Network.GamePackets.Attack.Magic;
                                
uint damage2 = (uint)(Calculate.Melee(owner.Playerattackedspell2ref attack) * (spell.Level spell.FirstDamage 50) / 100);
                                if (
attacker.ContainsFlag4(Network.GamePackets.Update.Flags4.ThunderBolt))
                                    
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