عرض مشاركة واحدة
قديم 2019-07-28, 10:04 PM
المشاركة 9
Rider
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: مشكله في اسكله TwilightDance هنا
Handle.cs
سيرش علي
كود:
TwilightAction 

و بدله ب ده

كود:
private void TwilightAction(Player attackerMsgMagicEffect suseSpellInformation spellushort Xushort Y)
        {
            
byte dist = (byte)spell.Distance;
            var 
map attacker.Owner.Map;

            var 
algo = new InLineAlgorithm(attacker.XXattacker.YYdist);

            var 
count = (double)algo.lcoords.Count 3;
            
int i 1;
            var 
myx attacker.X;
            var 
myy attacker.Y;
            
Server.Thread.DelayedTask.StartDelayedTask(() =>
            {
                var 
selected = (* (int)count) - 2;
                
selected Math.Min(algo.lcoords.Count 1selected);
                
= (ushort)algo.lcoords[selected].X;
                
= (ushort)algo.lcoords[selected].Y;


                
MsgMapItem floorItem = new MsgMapItem(true);
                
floorItem.MapObjType MapObjectType.FloorSpell;
                
floorItem.ItemID MsgMapItem.Twilight;
                
floorItem.ItemColor = (Enums.Color)(1);
                
floorItem.MapID attacker.MapID;
                
floorItem.Type MsgMapItem.Effect;
                
floorItem.X;
                
floorItem.Y;
                
floorItem.OnFloor Time32.Now;
                
floorItem.Owner attacker.Owner;
                while (
map.Npcs.ContainsKey(floorItem.UID))
                    
floorItem.UID Network.GamePackets.MsgMapItem.FloorUID.Next;
                
map.AddFloorItem(floorItem);

                
attacker.Owner.SendScreenSpawn(floorItemtrue);

                if (
!= 0)
                {
                    
MsgAction data = new Network.GamePackets.MsgAction(true);
                    
data.UID attacker.UID;
                    
data.X2 X;
                    
data.Y2 Y;
                    
data.ID MsgAction.Mode.RemoveTrap;
                    
data.wParam1 myx;
                    
data.wParam2 myy;
                    
attacker.Owner.SendScreen(datatrue);
               
                    
//double percent = 1;
                    //switch (i)
                    //{
                    //    case 1:
                    //        percent = 0.92;
                    //        break;
                    //    case 2:
                    //        percent = 1.02;
                    //        break;
                    //    case 3:
                    //        percent = 1.2;
                    //        break;
                    //}


                    
foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
                    {
                        
bool hit false;
                        var 
selected2 Math.Max(01) * (int)count;
                        
selected2 Math.Min(algo.lcoords.Count 1selected2);
                        if (
Kernel.GetDistance(_obj.X_obj.Y, (ushort)algo.lcoords[selected].X, (ushort)algo.lcoords[selected].Y) <= spell.Range)
                            
hit true;
                        
//for (int j = selected2; j < selected; j++)
                        //    if (Kernel.GetDistance(_obj.X, _obj.Y, (ushort)algo.lcoords[j].X, (ushort)algo.lcoords[j].Y) <= spell.Range)
                        //        hit = true;
                        
if (hit)
                        {
                            if (
_obj.MapObjType == MapObjectType.Monster)
                            {
                                
attacked _obj as Player;
                                if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                {
                                    var 
damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                    
ReceiveAttack(attackerattackedattackref damagespell);

                                    
suse.AddTarget(attacked.UIDdamageattack);
                                }
                            }
                            else if (
_obj.MapObjType == MapObjectType.Player)
                            {
                                
attacked _obj as Player;
                                if (
attacked.ContainsFlag((ulong)MsgUpdate.Flags.Intensify))
                                {
                                    
attacked.RemoveFlag((ulong)MsgUpdate.Flags.Intensify);
                                    
attacked.IntensifyPercent 0;
                                }
                                if (
CanAttack(attackerattackedspellattack.InteractType == MsgInteract.Melee))
                                {
                                    var 
damage Game.Attacking.Calculate.Melee(attackerattackedref attack);
                                    
damage = (uint)(damage spell.IncreaseDMG);
                                    
damage = (uint)(damage spell.DecreaseDMG);
                                    
//damage = (uint)((double)(damage * percent));
                                    
ReceiveAttack(attackerattackedattackref damagespell);

                                    
suse.AddTarget(attacked.UIDdamageattack);
                                }

                            }
                            else if (
_obj.MapObjType == MapObjectType.SobNpc)
                            {
                                var 
attackedsob _obj as MsgNpcInfoEX;
                                if (
CanAttack(attackerattackedsobspell))
                                {
                                    var 
damage Game.Attacking.Calculate.Melee(attackerattackedsobref attack);

                                    
ReceiveAttack(attackerattackedsobattackdamagespell);

                                    
suse.AddTarget(attackedsob.UIDdamageattack);
                                }
                            }
                        }
                    }
                   
                    if (
suse.Targets.Count 0)
                        
attacker.Owner.SendScreen(susetrue);
                    
suse.Targets.Clear();
                }
                
i++;
            }, 
02250);
        } 

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

كود:
 #region TwilightDance
                                
case 12070:
                                    {
                                        if (
CanUseSpell(spellattacker.Owner))
                                        {
                                            
PrepareSpell(spellattacker.Owner);
                                            
MsgMagicEffect suse = new MsgMagicEffect(true);
                                            
suse.Attacker attacker.UID;
                                            
suse.Attacker1 attacker.UID;
                                            
suse.SpellID spell.ID;
                                            
suse.SpellLevel spell.Level;

                                            
TwilightAction(attackersusespellXY);
                                            
attacker.Stamina -= 20;
                                            
attacker.Owner.SendScreen(susetrue);
                                            
attacker.AttackPacket null;

                                        }
                                        break;
                                    }
                                
#endregion 

في انتظار ردك