عرض مشاركة واحدة
قديم 2020-02-04, 04:13 PM
المشاركة 5
ElSaher
.:: مشرف اقسام كونكر ::.
  • غير متواجد
افتراضي رد: تعديل علي ضربه RageofWar
اتفضل يصطي


كود:
                                #region RageOfWar[Stomper]
                                
case 12930:
                                    {
                                        if (
CanUseSpell(spell, attacker.Owner))
                                        {
                                            
PrepareSpell(spell, attacker.Owner);
                                            
InLineAlgorithm ila = new InLineAlgorithm(attacker.X, X, attacker.Y, Y, (byte)spell.Range, InLineAlgorithm.Algorithm.DDA);
                                            
SpellUse suse = new SpellUse(true);
                                            
suse.Attacker = attacker.UID;
                                            
suse.SpellID = SpellID;
                                            
attacker.Stamina -= spell.UseStamina;
                                            
attacker.Stamina -= 15;
                                            
suse.SpellLevel = attacker.Owner.Spells[SpellID].Level;
                                            
suse.X = X;
                                            
suse.Y = Y;
                                            
ushort Xo1 = 0, Yo1 = 0;
                                            foreach (
Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                                            {
                                                if (
_obj == null) continue;
                                                if (
_obj.MapObjType == MapObjectType.Entity)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
ila.InLine(attacked.X, attacked.Y))
                                                    {
                                                        if (!
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee)) continue;
                                                        
attack.Effect1 = Attack.AttackEffects1.None;
                                                        
uint damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
                                                        if (
attacker.NobilityRank == ElSaher.Game.ConquerStructures.NobilityRank.King)
                                                        {
                                                            
damage = (uint)(damage * 0.826);
                                                        }
                                                        if (
attacker.NobilityRank == ElSaher.Game.ConquerStructures.NobilityRank.Prince)
                                                        {
                                                            
damage = (uint)(damage * 0.971);
                                                        }
                                                        if (
attacker.NobilityRank == ElSaher.Game.ConquerStructures.NobilityRank.Duke)
                                                        {
                                                            
damage = (uint)(damage * 1.30);
                                                        }
                                                        if (
attacker.NobilityRank == ElSaher.Game.ConquerStructures.NobilityRank.Earl)
                                                        {
                                                            
damage = (uint)(damage * 1.020);
                                                        }
                                                        
// damage = (uint)MathHelper.AdjustDataEx((int)damage, (int)spell.Power);
                                                        
suse.Effect1 = attack.Effect1;
                                                        
attack.Damage = damage;
                                                        
Xo1 = attacked.X;
                                                        
Yo1 = attacked.Y;
                                                        
suse.AddTarget(attacked.UID, damage, attack);
                                                        
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.Monster)
                                                {
                                                    
attacked = _obj as Entity;
                                                    if (
ila.InLine(attacked.X, attacked.Y))
                                                    {
                                                        if (!
CanAttack(attacker, attacked, spell, attack.AttackType == Attack.Melee)) continue;
                                                        
attack.Effect1 = Attack.AttackEffects1.None;
                                                        
uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, client_Spell.LevelHu2);
                                                        
damage = (uint)(damage * SkillsAttack.RageofWarMonsters);
                                                        
suse.Effect1 = attack.Effect1;
                                                        
attack.Damage = damage;
                                                        
Xo1 = attacked.X;
                                                        
Yo1 = attacked.Y;
                                                        
suse.AddTarget(attacked.UID, damage, attack);
                                                        
ReceiveAttack(attacker, attacked, attack, ref damage, spell);

                                                    }
                                                }
                                                else if (
_obj.MapObjType == MapObjectType.SobNpc)
                                                {
                                                    
attackedsob = _obj as SobNpcSpawn;
                                                    if (
ila.InLine(attackedsob.X, attackedsob.Y))
                                                    {
                                                        if (!
CanAttack(attacker, attackedsob, spell)) continue;
                                                        
attack.Effect1 = Attack.AttackEffects1.None;
                                                        
uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
                                                        
damage = (uint)(damage * 3.4);
                                                        
suse.AddTarget(attackedsob.UID, damage, attack);
                                                        
ReceiveAttack(attacker, attackedsob, attack, damage, spell);

                                                    }
                                                }
                                            }
                                            if (
Xo1 != 0 && Yo1 != 0)
                                            {
                                                
FloorItem item = new FloorItem(true);
                                                
item.Owner = attacker.Owner;
                                                
item.UID = FloorItem.FloorUID.Next;
                                                
// item.MapObjType = MapObjectType.Item;
                                                
item.ItemID = 1500;
                                                
item.X = (ushort)(Xo1);
                                                
item.Y = (ushort)(Yo1);
                                                
item.Type = 10;
                                                
item.mColor = 14;
                                                
item.OwnerUID = attacker.UID;
                                                
item.FlowerType = 1;
                                                
item.Name = "RageofWarTrap";
                                                
attacker.SendScreen(item);
                                                var 
map = Kernel.Maps[attacker.MapID];
                                                while (
map.Npcs.ContainsKey(item.UID))
                                                    
item.UID = Network.GamePackets.FloorItem.FloorUID.Next;
                                                
map.AddFloorItem(item);
                                            }
                                            
attacker.Owner.SendScreen(suse, true);
                                        }
                                        break;
                                    }
                                
#endregion 

وهتنحل انشاء الله