Advertisement
XConquer

Fix Attack Taoist Source de Angel by Pezzi

Aug 1st, 2018
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 59.06 KB | None | 0 0
  1. Para reparar ese fallo se Dirigen a su Handler.cs y buscan la #region Melee y la reemplazan por la mia :
  2.  
  3.  #region Melee
  4.                     else if (attack.InteractType == MsgInteract.Melee)
  5.                     {
  6.                         if (attacker.Owner.Screen.TryGetValue(attack.Attacked, out attacked))
  7.                         {
  8.                             #region EarthSweep
  9.                             if (attack.SpellID == 12220 || attack.SpellID == 12210)
  10.                             {
  11.                                 MsgMagicEffect suse = new MsgMagicEffect(true);
  12.                                 suse.Attacker = attacker.UID;
  13.                                 suse.SpellID = attack.SpellID;
  14.                                 suse.SpellLevel = 0;
  15.                                 suse.X = attacker.X;
  16.                                 suse.Y = attacker.Y;
  17.                                 Fan fan = new Fan(attacker.X, attacker.Y, attacked.X, attacked.Y, 7, 180);
  18.                                 foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  19.                                 {
  20.                                     if (_obj == null) continue;
  21.                                     if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  22.                                     {
  23.                                         attacked = _obj as Player;
  24.                                         if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= 7)
  25.                                         {
  26.                                             if (CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee))
  27.                                             {
  28.                                                 attack.Effect = MsgInteract.InteractEffects.None;
  29.                                                 uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
  30.                                                 attack.Attacked = 0;
  31.                                                 attack.Damage = damage / 2;
  32.                                                 suse.Effect = attack.Effect;
  33.                                                 ReceiveAttack(attacker, attacked, attack, ref damage, null);
  34.                                                 suse.AddTarget(attacked.UID, damage, attack);
  35.                                             }
  36.                                         }
  37.                                     }
  38.                                 }
  39.                                 attacker.Owner.SendScreen(suse, true);
  40.                                 attacker.AttackPacket = null;
  41.                                 attack = null;
  42.                                 return;
  43.                             }
  44.                             #endregion
  45.                             #region Stomper(Melee)
  46.                             #region Anger-Horror-Peace~of~Stomper(Windwalker-Stomper-Passive)
  47.                             var lastattacked = attacked;
  48.                             var spell5 = Database.SpellTable.GetSpell(12980, attacker.Owner);
  49.                             if (Kernel.Rate(spell5.Percent) && attacker.Owner.Spells.ContainsKey(12980) && attacker.IsStomper2())
  50.                             {
  51.                                 #region AngerofStomper
  52.                                 {
  53.                                     MsgMagicEffect suse = new MsgMagicEffect(true);
  54.                                     suse.Attacker = attacker.UID;
  55.                                     suse.SpellID = spell5.ID;
  56.                                     suse.SpellLevel = spell5.Level;
  57.                                     suse.X = lastattacked.X;
  58.                                     suse.Y = lastattacked.Y;
  59.                                     foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  60.                                     {
  61.                                         if (_obj == null) continue;
  62.                                         attacked = _obj as Player;
  63.                                         if (attacked == null) continue;
  64.                                         if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) <= spell5.Range)
  65.                                         {
  66.                                             if (_obj.MapObjType == MapObjectType.Player)
  67.                                             {
  68.                                                 if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
  69.                                                 attack.Effect = MsgInteract.InteractEffects.None;
  70.                                                 uint damage5 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 2;
  71.                                                 damage5 = (uint)(damage5 * .5);
  72.                                                 suse.Effect = attack.Effect;
  73.                                                 attack.Damage = damage5 / 2;
  74.                                                 ReceiveAttack(attacker, attacked, attack,ref damage5, spell5);
  75.                                                 suse.AddTarget(attacked.UID, damage5, attack);
  76.                                             }
  77.                                             else if (_obj.MapObjType == MapObjectType.Monster)
  78.                                             {
  79.                                                 if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
  80.                                                 uint damage5 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 2;
  81.                                                 attack.Damage = damage5 / 2;
  82.                                                 ReceiveAttack(attacker, attacked, attack,ref damage5, spell5);
  83.                                                 suse.AddTarget(attacked.UID, damage5, attack);
  84.                                             }
  85.                                         }
  86.                                     }
  87.                                     attacker.AttackPacket = null;
  88.                                     attacker.Owner.SendScreen(suse, true);
  89.                                 }
  90.                                 #endregion
  91.                                 #region HorrorofStomper
  92.                                 {
  93.                                     var spell2 = Database.SpellTable.GetSpell(12990, attacker.Owner);
  94.                                     if (!attacker.Owner.Spells.ContainsKey(12990)) return;
  95.                                     attack.Damage = 1;
  96.                                     MsgMagicEffect suse = new MsgMagicEffect(true);
  97.                                     suse.Attacker = attacker.UID;
  98.                                     suse.SpellID = spell2.ID;
  99.                                     suse.SpellLevel = spell2.Level;
  100.                                     suse.X = lastattacked.X;
  101.                                     suse.Y = lastattacked.Y;
  102.                                     attacker.AttackPacket = null;
  103.                                     attacker.Owner.SendScreen(suse, true);
  104.                                     #region MsgMapItem
  105.                                     var map = Kernel.Maps[attacker.MapID];
  106.                                     MsgMapItem MsgMapItem = new MsgMapItem(true);
  107.                                     MsgMapItem.UID = MsgMapItem.FloorUID.Next;
  108.                                     while (map.Npcs.ContainsKey(MsgMapItem.UID))
  109.                                         MsgMapItem.UID = MsgMapItem.FloorUID.Next;
  110.                                     MsgMapItem.ItemID = MsgMapItem.HorrorofStomper;
  111.                                     MsgMapItem.X = lastattacked.X;
  112.                                     MsgMapItem.Y = lastattacked.Y;
  113.                                     MsgMapItem.Type = MsgMapItem.Effect;
  114.                                     MsgMapItem.mColor = 14;
  115.                                     MsgMapItem.OwnerUID = attacker.UID;
  116.                                     MsgMapItem.OwnerGuildUID = attacker.GuildID;
  117.                                     MsgMapItem.FlowerType = 3;
  118.                                     MsgMapItem.Unknown37 = 1;
  119.                                     MsgMapItem.X2 = attacker.X;
  120.                                     MsgMapItem.Y2 = attacker.Y;
  121.                                     MsgMapItem.Angle = attacker.Facing;
  122.                                     MsgMapItem.MapID = map.ID;
  123.                                     MsgMapItem.Attack = attack;
  124.                                     MsgMapItem.OnFloor = Time32.Now;
  125.                                     MsgMapItem.Owner = attacker.Owner;
  126.                                     map.AddFloorItem(MsgMapItem);
  127.                                     attacker.Owner.SendScreenSpawn(MsgMapItem, true);
  128.                                     #endregion
  129.                                 }
  130.                                 #endregion
  131.                                 #region PeaceofStomper
  132.                                 {
  133.                                     var spell3 = Database.SpellTable.GetSpell(13000, attacker.Owner);
  134.                                     if (!attacker.Owner.Spells.ContainsKey(13000)) return;
  135.                                     attack.Damage = 1;
  136.                                     MsgMagicEffect suse = new MsgMagicEffect(true);
  137.                                     suse.Attacker = attacker.UID;
  138.                                     suse.SpellLevel = spell3.Level;
  139.                                     suse.SpellID = spell3.ID;
  140.                                     suse.X = lastattacked.X;
  141.                                     suse.Y = lastattacked.Y;
  142.                                     attacker.AttackPacket = null;
  143.                                     attacker.Owner.SendScreen(suse, true);
  144.                                     #region MsgMapItem
  145.                                     var map = Kernel.Maps[attacker.MapID];
  146.                                     MsgMapItem MsgMapItem = new MsgMapItem(true);
  147.                                     MsgMapItem.UID = MsgMapItem.FloorUID.Next;
  148.                                     while (map.Npcs.ContainsKey(MsgMapItem.UID))
  149.                                         MsgMapItem.UID = MsgMapItem.FloorUID.Next;
  150.                                     MsgMapItem.ItemID = MsgMapItem.PeaceofStomper;
  151.                                     MsgMapItem.X = lastattacked.X;
  152.                                     MsgMapItem.Y = lastattacked.Y;
  153.                                     MsgMapItem.X2 = attacker.X;
  154.                                     MsgMapItem.Y2 = attacker.Y;
  155.                                     MsgMapItem.Type = MsgMapItem.Effect;
  156.                                     MsgMapItem.mColor = 14;
  157.                                     MsgMapItem.OwnerUID = attacker.UID;
  158.                                     MsgMapItem.OwnerGuildUID = attacker.GuildID;
  159.                                     MsgMapItem.FlowerType = 3;
  160.                                     MsgMapItem.Unknown37 = 1;
  161.                                     MsgMapItem.MapID = map.ID;
  162.                                     MsgMapItem.Attack = attack;
  163.                                     MsgMapItem.OnFloor = Time32.Now;
  164.                                     MsgMapItem.Owner = attacker.Owner;
  165.                                     map.AddFloorItem(MsgMapItem);
  166.                                     attacker.Owner.SendScreenSpawn(MsgMapItem, true);
  167.                                     #endregion
  168.                                 }
  169.                                 #endregion
  170.                                 return;
  171.                             }
  172.                             #endregion
  173.                             else if (attacker.IsStomper1())
  174.                             {
  175.                                 #region Sector-Circle-Rectangle(Windwalker-Stomper-Melee)
  176.                                 if (attack.SpellID == 13040 || attack.SpellID == 13050 || attack.SpellID == 13060)
  177.                                 {
  178.                                     #region Sector
  179.                                     if (attack.SpellID == 13040)
  180.                                     {
  181.                                         var spell = Database.SpellTable.GetSpell(13040, attacker.Owner);
  182.                                         MsgMagicEffect suse = new MsgMagicEffect(true);
  183.                                         suse.Attacker = attacker.UID;
  184.                                         suse.SpellID = attack.SpellID;
  185.                                         suse.X = attacker.X;
  186.                                         suse.Y = attacker.Y;
  187.                                         var angle = Kernel.GetAngle(attacker.X, attacker.Y, attacked.X, attacked.Y);
  188.                                         Map.UpdateCoordonatesForAngle(ref X, ref Y, angle);
  189.                                         Fan sector = new Fan(attacker.X, attacker.Y, X, Y, spell.Range, spell.Sector);
  190.                                         if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 7)
  191.                                         {
  192.                                             foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  193.                                             {
  194.                                                 if (_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
  195.                                                 {
  196.                                                     if (_obj == null) continue;
  197.                                                     attacked = _obj as Player;
  198.                                                     if (attacked == null) continue;
  199.                                                     if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
  200.                                                     if (sector.IsInFan(attacked.X, attacked.Y))
  201.                                                     {
  202.                                                         if (CanAttack(attacker, attacked, spell, attack.InteractType == MsgInteract.Melee))
  203.                                                         {
  204.                                                             attack.Effect = MsgInteract.InteractEffects.None;
  205.                                                             uint damages = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 4;
  206.                                                             damages = (uint)(damages * .5);
  207.                                                             attack.Damage = damages / 2;
  208.                                                             suse.Effect = attack.Effect;
  209.                                                             ReceiveAttack(attacker, attacked, attack,ref damages, spell);
  210.                                                             suse.AddTarget(attacked.UID, damages, attack);
  211.                                                         }
  212.                                                     }
  213.                                                 }
  214.                                             }
  215.                                         }
  216.                                     }
  217.                                     #endregion
  218.                                     #region Circle
  219.                                     if (attack.SpellID == 13050)
  220.                                     {
  221.                                         var spell = Database.SpellTable.GetSpell(13050, attacker.Owner);
  222.                                         MsgMagicEffect suse = new MsgMagicEffect(true);
  223.                                         suse.Attacker = attacker.UID;
  224.                                         suse.SpellID = attack.SpellID;
  225.                                         suse.X = attacker.X;
  226.                                         suse.Y = attacker.Y;
  227.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  228.                                         {
  229.                                             if (_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
  230.                                             {
  231.                                                 if (_obj == null)
  232.                                                     continue;
  233.                                                 attacked = _obj as Player;
  234.                                                 if (attacked == null) continue;
  235.                                                 if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
  236.                                                 if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 5) continue;
  237.                                                 attack.Effect = MsgInteract.InteractEffects.None;
  238.                                                 uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 4;
  239.                                                 damage = (uint)(damage * .5);
  240.                                                 attack.Damage = damage / 2;
  241.                                                 ReceiveAttack(attacker, attacked, attack,ref damage, spell);
  242.                                                 suse.AddTarget(attacked.UID, damage, attack);
  243.                                             }
  244.                                         }
  245.                                         attacker.Owner.SendScreen(suse, true);
  246.                                         return;
  247.                                     }
  248.                                     #endregion
  249.                                     #region Rectangle
  250.                                     if (attack.SpellID == 13060)
  251.                                     {
  252.                                         var spell = Database.SpellTable.GetSpell(13060, attacker.Owner);
  253.                                         MsgMagicEffect suse = new MsgMagicEffect(true);
  254.                                         suse.Attacker = attacker.UID;
  255.                                         suse.SpellID = attack.SpellID;
  256.                                         suse.X = attacker.X;
  257.                                         suse.Y = attacker.Y;
  258.                                         var angle = Kernel.GetAngle(attacker.X, attacker.Y, attacked.X, attacked.Y);
  259.                                         Map.UpdateCoordonatesForAngle(ref X, ref Y, angle);
  260.                                         Fan sector = new Fan(attacker.X, attacker.Y, X, Y, spell.Range, spell.Sector);
  261.                                         uint damage2 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
  262.                                         attack.Damage = damage2 / 2;
  263.                                         ReceiveAttack(attacker, attacked, attack,ref damage2, spell);
  264.                                         suse.AddTarget(attacked.UID, damage2, attack);
  265.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  266.                                         {
  267.                                             if (_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
  268.                                             {
  269.                                                 if (_obj == null) continue;
  270.                                                 attacked = _obj as Player;
  271.                                                 if (attacked == null) continue;
  272.                                                 if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
  273.                                                 if (sector.IsInFan(attacked.X, attacked.Y))
  274.                                                 {
  275.                                                     if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 7) continue;
  276.                                                     attack.Effect = MsgInteract.InteractEffects.None;
  277.                                                     uint damage43 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 4;
  278.                                                     damage43 = (uint)(damage43 * .5);
  279.                                                     attack.Damage = damage43 / 2;
  280.                                                     ReceiveAttack(attacker, attacked, attack, ref damage43, spell);
  281.                                                     suse.AddTarget(attacked.UID, damage43, attack);
  282.                                                 }
  283.                                             }
  284.                                         }
  285.                                         attacker.Owner.SendScreen(suse, true);
  286.                                         return;
  287.                                     }
  288.                                     #endregion
  289.                                 }
  290.                                 #endregion
  291.  
  292.                             }
  293.                             #endregion
  294.                             #region DragonPunch
  295.                             if (attacker.HaveOneLeeLong())
  296.                             {
  297.                                 if (attacker.Owner.Spells.ContainsKey(12240))
  298.                                 {
  299.                                     var spell = Database.SpellTable.GetSpell(12240, attacker.Owner);
  300.                                     if (spell != null)
  301.                                     {
  302.                                         spell.CanKill = true;
  303.                                         if (Kernel.Rate(spell.Percent))
  304.                                         {
  305.                                             MsgMagicEffect suse = new MsgMagicEffect(true);
  306.                                             suse.Attacker = attacker.UID;
  307.                                             suse.SpellID = spell.ID;
  308.                                             suse.SpellLevel = spell.Level;
  309.                                             suse.X = attacker.X;
  310.                                             suse.Y = attacker.Y;
  311.                                             IMapObject lastAttacked = attacker;
  312.                                             foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  313.                                             {
  314.                                                 if (_obj == null) continue;
  315.                                                 if (_obj.MapObjType == MapObjectType.Monster)
  316.                                                 {
  317.                                                     if (_obj.UID == attacked.UID) continue;
  318.                                                     var attacked1 = _obj as Player;
  319.                                                     if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
  320.                                                     {
  321.                                                         if (Handle.CanAttack(attacker, attacked1, spell, false))
  322.                                                         {
  323.                                                             if (!CanAttack(attacker, attacked, spell, attack.InteractType == MsgInteract.Melee))
  324.                                                                 continue;
  325.  
  326.                                                             attack.Effect = MsgInteract.InteractEffects.None;
  327.                                                             uint damages = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack, spell);
  328.                                                             suse.Effect = attack.Effect;
  329.                                                             attack.Damage = damages / 2;
  330.                                                             ReceiveAttack(attacker, attacked, attack,ref damages, spell);
  331.  
  332.                                                             suse.AddTarget(attacked.UID, damages, attack);
  333.                                                         }
  334.                                                     }
  335.                                                 }
  336.                                                 else if (_obj.MapObjType == MapObjectType.Player)
  337.                                                 {
  338.                                                     if (_obj.UID == attacked.UID) continue;
  339.                                                     var attacked1 = _obj as Player;
  340.                                                     if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
  341.                                                     {
  342.                                                         if (Handle.CanAttack(attacker, attacked1, spell, false))
  343.                                                         {
  344.                                                             lastAttacked = attacked1;
  345.                                                             uint damages = Game.Attacking.Calculate.Melee(attacker, attacked1, ref attack, spell);
  346.                                                             attack.Damage = damages / 2;
  347.                                                             suse.Effect = attack.Effect;
  348.                                                             if (damages == 0) break;
  349.                                                             Handle.ReceiveAttack(attacker, attacked1, attack,ref damages, spell);
  350.                                                             suse.AddTarget(attacked1.UID, damages, attack);
  351.                                                         }
  352.                                                     }
  353.                                                 }
  354.                                                 else if (_obj.MapObjType == MapObjectType.SobNpc)
  355.                                                 {
  356.                                                     attackedsob = _obj as MsgNpcInfoEX;
  357.                                                     if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
  358.                                                     {
  359.                                                         if (Handle.CanAttack(attacker, attackedsob, spell))
  360.                                                         {
  361.                                                             lastAttacked = attackedsob;
  362.                                                             uint damages = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  363.                                                             suse.Effect = attack.Effect;
  364.                                                             if (damages == 0) break;
  365.                                                             attack.Damage = damages / 2;
  366.                                                             Handle.ReceiveAttack(attacker, attackedsob, attack, damages, spell);
  367.                                                             suse.AddTarget(attackedsob.UID, damages, attack);
  368.                                                         }
  369.                                                     }
  370.                                                 }
  371.                                             }
  372.                                             attacker.Owner.SendScreen(suse, true);
  373.                                             return;
  374.                                         }
  375.                                     }
  376.  
  377.                                 }
  378.  
  379.                             }
  380.                             #endregion
  381.                             CheckForExtraWeaponPowers(attacker.Owner, attacked);
  382.                             if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) return;
  383.                             pass = false;
  384.                             if (attacker.OnFatalStrike())
  385.                             {
  386.                                 if (attacked.PlayerFlag == PlayerFlag.Monster)
  387.                                 {
  388.                                     pass = true;
  389.                                 }
  390.                             }
  391.                             ushort range = attacker.AttackRange;
  392.                             if (attacker.Transformed)
  393.                                 range = (ushort)attacker.TransformationAttackRange;
  394.                             if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= range || pass)
  395.                             {
  396.                                 #region SyxRay
  397.                                 if (attacker.EpicTrojan())
  398.                                 {
  399.                                     if (attacker.Owner.Spells.ContainsKey(11990))
  400.                                     {
  401.                                         var spell = Database.SpellTable.GetSpell(11990, attacker.Owner);
  402.                                         if (spell != null)
  403.                                         {
  404.                                             spell.CanKill = true;
  405.                                             if (Kernel.Rate(spell.Percent))
  406.                                             {
  407.                                                 MsgMagicEffect suse = new MsgMagicEffect(true);
  408.                                                 suse.Attacker = attacker.UID;
  409.                                                 suse.SpellID = spell.ID;
  410.                                                 suse.SpellLevel = spell.Level;
  411.                                                 suse.X = attacker.X;
  412.                                                 suse.Y = attacker.Y;
  413.                                                 IMapObject lastAttacked = attacker;
  414.                                                 if (Handle.CanAttack(attacker, attacked, spell, false))
  415.                                                 {
  416.                                                     lastAttacked = attacked;
  417.                                                     uint damages = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
  418.                                                     damages = damages * (uint)(damages * 0.45);
  419.                                                     attack.Damage = damages / 2;
  420.                                                     suse.Effect = attack.Effect;
  421.                                                     Handle.ReceiveAttack(attacker, attacked, attack, ref damages, spell);
  422.                                                     suse.AddTarget(attacked.UID, damages, attack);
  423.                                                 }
  424.                                                 foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  425.                                                 {
  426.                                                     if (_obj == null) continue;
  427.                                                     if (_obj.MapObjType == MapObjectType.Monster || _obj.MapObjType == MapObjectType.Player)
  428.                                                     {
  429.                                                         if (_obj.UID == attacked.UID) continue;
  430.                                                         var attacked1 = _obj as Player;
  431.                                                         if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attacked1.X, attacked1.Y) <= 5)
  432.                                                         {
  433.                                                             if (Handle.CanAttack(attacker, attacked1, spell, false))
  434.                                                             {
  435.                                                                 lastAttacked = attacked1;
  436.                                                                 uint damages = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
  437.                                                                 suse.Effect = attack.Effect;
  438.                                                                 if (damages == 0) break;
  439.                                                                 Handle.ReceiveAttack(attacker, attacked1, attack,ref damages, spell);
  440.                                                                 suse.AddTarget(attacked1.UID, damages, attack);
  441.                                                             }
  442.                                                         }
  443.                                                     }
  444.                                                     else if (_obj.MapObjType == MapObjectType.SobNpc)
  445.                                                     {
  446.                                                         attackedsob = _obj as MsgNpcInfoEX;
  447.                                                         if (Kernel.GetDistance(lastAttacked.X, lastAttacked.Y, attackedsob.X, attackedsob.Y) <= 5)
  448.                                                         {
  449.                                                             if (Handle.CanAttack(attacker, attackedsob, spell))
  450.                                                             {
  451.                                                                 lastAttacked = attackedsob;
  452.                                                                 uint damages = Game.Attacking.Calculate.Melee(attacker,
  453.                                                                     attackedsob, ref attack);
  454.                                                                 suse.Effect = attack.Effect;
  455.                                                                 if (damages == 0) break;
  456.                                                                 Handle.ReceiveAttack(attacker, attackedsob, attack, damages, spell);
  457.                                                                 suse.AddTarget(attackedsob.UID, damages, attack);
  458.                                                             }
  459.                                                         }
  460.                                                     }
  461.                                                 }
  462.                                                 attacker.Owner.SendScreen(suse, true);
  463.                                                 return;
  464.                                             }
  465.                                         }
  466.                                     }
  467.                                 }
  468.  
  469.                                 #endregion
  470.                                 attack.Effect = MsgInteract.InteractEffects.None;
  471.                                 ushort spellidd = attack.SpellID;
  472.                                 uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack); // FISICOS GENERALES SIN IMPORTAR CLASE!
  473.                                
  474.                                 attack.Damage = damage;
  475.                                 if (attacker.OnFatalStrike())
  476.                                 {
  477.                                     if (attacked.PlayerFlag == PlayerFlag.Monster)
  478.                                     {
  479.                                         var weaps = attacker.Owner.Weapons;
  480.                                         bool can = false;
  481.                                         if (weaps.Item1 != null)
  482.                                             if (weaps.Item1.ID / 1000 == 601 || weaps.Item1.ID / 1000 == 616)
  483.                                                 can = true;
  484.                                         if (weaps.Item2 != null)
  485.                                             if (weaps.Item2.ID / 1000 == 601 || weaps.Item2.ID / 1000 == 616)
  486.                                                 can = true;
  487.                                         if (!can) return;
  488.                                         ushort x = attacked.X;
  489.                                         ushort y = attacked.Y;
  490.                                         Map.UpdateCoordonatesForAngle(ref x, ref y, Kernel.GetAngle(attacked.X, attacked.Y, attacker.X, attacker.Y));
  491.                                         attacker.Shift(x, y);
  492.                                         attack.X = x;
  493.                                         attack.Y = y;
  494.                                      //   damage = damage / 2;
  495.                                         attack.Damage = damage / 3;
  496.                                         attack.InteractType = MsgInteract.FatalStrike;
  497.                                     }
  498.                                 }
  499.                                 var weapons = attacker.Owner.Weapons;
  500.                                 if (weapons.Item1 != null)
  501.                                 {
  502.                                     MsgItemInfo rightweapon = weapons.Item1;
  503.                                     ushort wep1subyte = (ushort)(rightweapon.ID / 1000), wep2subyte = 0;
  504.                                     bool wep1bs = false, wep2bs = false;
  505.                                     if (wep1subyte == 421)
  506.                                     {
  507.                                         wep1bs = true;
  508.                                         wep1subyte--;
  509.                                     }
  510.                                     ushort wep1spellid = 0, wep2spellid = 0;
  511.                                     if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
  512.                                     {
  513.                                         Database.SpellTable.WeaponSpells[wep1subyte].Shuffle();
  514.                                         wep1spellid = Database.SpellTable.WeaponSpells[wep1subyte].FirstOrDefault();
  515.                                     }
  516.                                     if (wep1spellid == 12570 && attacker.WrathoftheEmperor == false)
  517.                                     {
  518.                                         wep1spellid = 10490;
  519.                                     }
  520.                                     if (attacker.WrathoftheEmperor == true)
  521.                                     {
  522.                                         if (wep1subyte == 622)
  523.                                         {
  524.                                             if (attacker.WrathoftheEmperorStamp <= DateTime.Now.AddMilliseconds(5000))
  525.                                             {
  526.                                                 wep1spellid = 12570;
  527.  
  528.                                             }
  529.                                             attacker.WrathoftheEmperor = false;
  530.                                         }
  531.                                     }
  532.                                     Database.SpellInformation wep1spell = null, wep2spell = null;
  533.                                     if (attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
  534.                                     {
  535.                                         wep1spell = Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
  536.                                         doWep1Spell = Kernel.Rate(wep1spell.Percent);
  537.                                         if (attacked.PlayerFlag == PlayerFlag.Player && wep1spellid == 10490)
  538.                                             doWep1Spell = Kernel.Rate(5);
  539.                                     }
  540.                                     if (!doWep1Spell)
  541.                                     {
  542.                                         if (weapons.Item2 != null)
  543.                                         {
  544.                                             MsgItemInfo leftweapon = weapons.Item2;
  545.                                             wep2subyte = (ushort)(leftweapon.ID / 1000);
  546.                                             if (wep2subyte == 421)
  547.                                             {
  548.                                                 wep2bs = true;
  549.                                                 wep2subyte--;
  550.                                             }
  551.                                            
  552.                                             if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
  553.                                             {
  554.                                                     Database.SpellTable.WeaponSpells[wep1subyte].Shuffle();
  555.                                                     wep1spellid = Database.SpellTable.WeaponSpells[wep2subyte].FirstOrDefault();
  556.                                             }
  557.                                             if (wep2spellid == 12570 && attacker.WrathoftheEmperor == false)
  558.                                             {
  559.                                                 wep2spellid = 10490;
  560.                                             }
  561.                                             if (attacker.WrathoftheEmperor == true)
  562.                                             {
  563.                                                 if (wep2subyte == 622)
  564.                                                 {
  565.                                                     if (attacker.WrathoftheEmperorStamp <= DateTime.Now.AddMilliseconds(5000))
  566.                                                     {
  567.                                                         wep2spellid = 12570;
  568.  
  569.                                                     }
  570.                                                     attacker.WrathoftheEmperor = false;
  571.                                                 }
  572.                                             }
  573.                                             if (attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
  574.                                             {
  575.                                                 wep2spell = Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
  576.                                                 doWep2Spell = Kernel.Rate(wep2spell.Percent);
  577.                                                 if (attacked.PlayerFlag == PlayerFlag.Player && wep2spellid == 10490)
  578.                                                     doWep2Spell = Kernel.Rate(5);
  579.                                             }
  580.                                         }
  581.                                     }
  582.                                     if (!attacker.Transformed)
  583.                                     {
  584.                                         if (doWep1Spell)
  585.                                         {
  586.                                             attacker.AttackPacket = attack;
  587.                                             attack.InteractType = MsgInteract.Magic;
  588.                                             attack.Decoded = true;
  589.                                             attack.CheckWeponSpell = true;
  590.                                             attack.X = attacked.X;
  591.                                             attack.Y = attacked.Y;
  592.                                             attack.Attacked = attacked.UID;
  593.                                             attack.Damage = wep1spell.ID;
  594.                                             goto restart;
  595.                                         }
  596.                                         if (doWep2Spell)
  597.                                         {
  598.                                             attacker.AttackPacket = attack;
  599.                                             attack.InteractType = MsgInteract.Magic;
  600.                                             attack.Decoded = true;
  601.                                             attack.CheckWeponSpell = true;
  602.                                             attack.X = attacked.X;
  603.                                             attack.Y = attacked.Y;
  604.                                             attack.Attacked = attacked.UID;
  605.                                             attack.Damage = wep2spell.ID;
  606.                                             goto restart;
  607.                                         }
  608.                                         if (wep1bs)
  609.                                             wep1subyte++;
  610.                                         if (attacker.PlayerFlag == PlayerFlag.Player && attacked.PlayerFlag != PlayerFlag.Player)
  611.                                             if (damage > attacked.Hitpoints)
  612.                                             {
  613.                                                 attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), wep1subyte);
  614.                                                 if (wep2subyte != 0)
  615.                                                 {
  616.                                                     if (wep2bs)
  617.                                                         wep2subyte++;
  618.                                                     attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), wep2subyte);
  619.                                                 }
  620.                                             }
  621.                                             else
  622.                                             {
  623.                                                 attacker.Owner.IncreaseProficiencyExperience(damage, wep1subyte);
  624.                                                 if (wep2subyte != 0)
  625.                                                 {
  626.                                                     if (wep2bs)
  627.                                                         wep2subyte++;
  628.                                                     attacker.Owner.IncreaseProficiencyExperience(damage, wep2subyte);
  629.                                                 }
  630.                                             }
  631.                                     }
  632.                                 }
  633.                                 else
  634.                                 {
  635.                                     if (!attacker.Transformed)
  636.                                     {
  637.                                         if (attacker.PlayerFlag == PlayerFlag.Player && attacked.PlayerFlag != PlayerFlag.Player)
  638.                                             if (damage > attacked.Hitpoints)
  639.                                             {
  640.                                                 attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attacked.Hitpoints), 0);
  641.                                             }
  642.                                             else
  643.                                             {
  644.                                                 attacker.Owner.IncreaseProficiencyExperience(damage, 0);
  645.                                             }
  646.                                     }
  647.                                 }
  648.                                 ReceiveAttack(attacker, attacked, attack,ref damage, null);
  649.                                 attack.InteractType = MsgInteract.Melee;
  650.                             }
  651.                             else
  652.                             {
  653.                                 attacker.AttackPacket = null;
  654.                             }
  655.                         }
  656.                         else if (attacker.Owner.Screen.TryGetSob(attack.Attacked, out attackedsob))
  657.                         {
  658.                             CheckForExtraWeaponPowers(attacker.Owner, null);
  659.                             if (CanAttack(attacker, attackedsob, null))
  660.                             {
  661.                                 ushort range = attacker.AttackRange;
  662.                                 if (attacker.Transformed)
  663.                                     range = (ushort)attacker.TransformationAttackRange;
  664.                                 if (Kernel.GetDistance(attacker.X, attacker.Y, attackedsob.X, attackedsob.Y) <= range)
  665.                                 {
  666.                                     attack.Effect = MsgInteract.InteractEffects.None;
  667.                                     uint damage = Game.Attacking.Calculate.Melee(attacker, attackedsob, ref attack);
  668.                                     attack.Damage = damage / 2;
  669.                                     var weapons = attacker.Owner.Weapons;
  670.                                     if (weapons.Item1 != null)
  671.                                     {
  672.                                         MsgItemInfo rightweapon = weapons.Item1;
  673.                                         ushort wep1subyte = (ushort)(rightweapon.ID / 1000), wep2subyte = 0;
  674.                                         bool wep1bs = false, wep2bs = false;
  675.                                         if (wep1subyte == 421)
  676.                                         {
  677.                                             wep1bs = true;
  678.                                             wep1subyte--;
  679.                                         }
  680.                                         ushort wep1spellid = 0, wep2spellid = 0;
  681.                                         if (Database.SpellTable.WeaponSpells.ContainsKey(wep1subyte))
  682.                                         {
  683.                                             Database.SpellTable.WeaponSpells[wep1subyte].Shuffle();
  684.                                             wep1spellid = Database.SpellTable.WeaponSpells[wep1subyte].FirstOrDefault();
  685.                                         }
  686.                                         if (wep1spellid == 12570 && attacker.WrathoftheEmperor == false)
  687.                                         {
  688.                                             wep1spellid = 10490;
  689.                                         }
  690.                                         if (attacker.WrathoftheEmperor == true)
  691.                                         {
  692.                                             if (wep1subyte == 622)
  693.                                             {
  694.                                                 if (attacker.WrathoftheEmperorStamp <= DateTime.Now.AddMilliseconds(5000))
  695.                                                 {
  696.                                                     wep1spellid = 12570;
  697.  
  698.                                                 }
  699.                                                 attacker.WrathoftheEmperor = false;
  700.                                             }
  701.                                         }
  702.                                         Database.SpellInformation wep1spell = null, wep2spell = null;
  703.                                         if (attacker.Owner.Spells.ContainsKey(wep1spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep1spellid))
  704.                                         {
  705.                                             wep1spell = Database.SpellTable.SpellInformations[wep1spellid][attacker.Owner.Spells[wep1spellid].Level];
  706.                                             doWep1Spell = Kernel.Rate(wep1spell.Percent);
  707.                                         }
  708.                                         if (!doWep1Spell)
  709.                                         {
  710.                                             if (weapons.Item2 != null)
  711.                                             {
  712.                                                 MsgItemInfo leftweapon = weapons.Item2;
  713.                                                 wep2subyte = (ushort)(leftweapon.ID / 1000);
  714.                                                 if (wep2subyte == 421)
  715.                                                 {
  716.                                                     wep2bs = true;
  717.                                                     wep2subyte--;
  718.                                                 }
  719.  
  720.                                                 if (Database.SpellTable.WeaponSpells.ContainsKey(wep2subyte))
  721.                                                 {
  722.                                                     Database.SpellTable.WeaponSpells[wep2subyte].Shuffle();
  723.                                                     wep2spellid = Database.SpellTable.WeaponSpells[wep2subyte].FirstOrDefault();
  724.                                                 }
  725.                                                 if (wep2spellid == 12570 && attacker.WrathoftheEmperor == false)
  726.                                                 {
  727.                                                     wep2spellid = 10490;
  728.                                                 }
  729.                                                 if (attacker.WrathoftheEmperor == true)
  730.                                                 {
  731.                                                     if (wep2subyte == 622)
  732.                                                     {
  733.                                                         if (attacker.WrathoftheEmperorStamp <= DateTime.Now.AddMilliseconds(5000))
  734.                                                         {
  735.                                                             wep1spellid = 12570;
  736.  
  737.                                                         }
  738.                                                         attacker.WrathoftheEmperor = false;
  739.                                                     }
  740.                                                 }
  741.                                                 if (attacker.Owner.Spells.ContainsKey(wep2spellid) && Database.SpellTable.SpellInformations.ContainsKey(wep2spellid))
  742.                                                 {
  743.                                                     wep2spell = Database.SpellTable.SpellInformations[wep2spellid][attacker.Owner.Spells[wep2spellid].Level];
  744.                                                     doWep2Spell = Kernel.Rate(wep2spell.Percent);
  745.                                                 }
  746.                                             }
  747.                                         }
  748.                                         if (!attacker.Transformed)
  749.                                         {
  750.                                             if (doWep1Spell)
  751.                                             {
  752.                                                 attack.InteractType = MsgInteract.Magic;
  753.                                                 attack.Decoded = true;
  754.                                                 attack.CheckWeponSpell = true;
  755.                                                 attack.X = attackedsob.X;
  756.                                                 attack.Y = attackedsob.Y;
  757.                                                 attack.Attacked = attackedsob.UID;
  758.                                                 attack.Damage = wep1spell.ID;
  759.                                                 goto restart;
  760.                                             }
  761.                                             if (doWep2Spell)
  762.                                             {
  763.                                                 attack.InteractType = MsgInteract.Magic;
  764.                                                 attack.Decoded = true;
  765.                                                 attack.CheckWeponSpell = true;
  766.                                                 attack.X = attackedsob.X;
  767.                                                 attack.Y = attackedsob.Y;
  768.                                                 attack.Attacked = attackedsob.UID;
  769.                                                 attack.Damage = wep2spell.ID;
  770.                                                 goto restart;
  771.                                             }
  772.                                             if (attacker.MapID == 1039)
  773.                                             {
  774.                                                 if (wep1bs)
  775.                                                     wep1subyte++;
  776.                                                 if (attacker.PlayerFlag == PlayerFlag.Player)
  777.                                                     if (damage > attackedsob.Hitpoints)
  778.                                                     {
  779.                                                         attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), wep1subyte);
  780.                                                         if (wep2subyte != 0)
  781.                                                         {
  782.                                                             if (wep2bs)
  783.                                                                 wep2subyte++;
  784.                                                             attacker.Owner.IncreaseProficiencyExperience(Math.Min(damage, attackedsob.Hitpoints), wep2subyte);
  785.                                                         }
  786.                                                     }
  787.                                                     else
  788.                                                     {
  789.                                                         attacker.Owner.IncreaseProficiencyExperience(damage, wep1subyte);
  790.                                                         if (wep2subyte != 0)
  791.                                                         {
  792.                                                             if (wep2bs)
  793.                                                                 wep2subyte++;
  794.                                                             attacker.Owner.IncreaseProficiencyExperience(damage, wep2subyte);
  795.                                                         }
  796.                                                     }
  797.                                             }
  798.                                         }
  799.                                     }
  800.                                     attack.Damage = damage;
  801.                                     ReceiveAttack(attacker, attackedsob, attack, damage, null);
  802.                                 }
  803.                                 else
  804.                                 {
  805.                                     attacker.AttackPacket = null;
  806.                                 }
  807.                             }
  808.                         }
  809.                         else
  810.                         {
  811.                             attacker.AttackPacket = null;
  812.                         }
  813.                     }
  814.                     #endregion
  815.  
  816. ============================================================================================================
  817. Despues Buscan Attack.cs o MsgInteract.cs  y lo deben tener asi
  818.  
  819. public MsgInteract(bool Create)
  820.         {
  821.             if (Create)
  822.             {
  823.                 Packet = new byte[45 + 16];// 45 + 8
  824.                 fixed (byte* Pack = Packet)
  825.                 {
  826.                     *(ushort*)(Pack + (Packet.Length - 8)) = 0;
  827.                     *((ushort*)(Pack + 2)) = (ushort)MsgTypes.MsgInteract;
  828.                     *((uint*)(Pack + 4)) = (uint)Time32.timeGetTime().GetHashCode();
  829.                 }
  830.             }
  831.         }
  832.  
  833. lo mismo con el public Attack. lo que pasa es que yo lo tengo de Emulator pero ya se daran cuenta a que me refiero
  834. despues mas abajo si usan MsgInteract en el codigo de void Process agregaran :
  835.  case Magic:
  836.                     {
  837.                         attack.InteractType = Magic;
  838.                         client.Player.AttackMagicStamp = Time32.Now//Pueden Modificar y hacer que ataque cada 1 Sec
  839.                         break;
  840.                     }
  841.                 case Melee:
  842.                     {
  843.                         attack.InteractType = Melee;
  844.                         client.Player.AttackMeleeStamp = Time32.Now
  845.                         break;
  846.                     }
  847.                 case Ranged:
  848.                     {
  849.                         client.Player.AttackRangedStamp = Time32.Now
  850.                         attack.InteractType = Ranged;
  851.                         break;
  852.                     }
  853. Si Usan Attack.cs busquen en PacketHandler y los agregan tambien.
  854. ======================================================================================0
  855. En Player.cs agregan:
  856. public Time32 AttackRangedStamp, AttackMeleeStamp, AttackMagicStamp;
  857. ========================================================================================
  858. Creditos Reservados del Fix : Pezzi Tomas! EL MEJOR!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement