Advertisement
XConquer

Fix Ataque Windwalker Rango/Melee

Aug 1st, 2018
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 26.48 KB | None | 0 0
  1. Bueno, se Dirigen a Handler.cs #region Melee y Si no tienen el Codigo lo Pegan!
  2. if (attacker.Assassin() || attacker.IsBowEquipped || attacker.IsChaser() && attacker.IsChaser1() && attacker.IsChaser2())
  3.                         {
  4.                             attack.InteractType = Attack.Ranged;
  5.                             new Game.Attacking.Handle(attack, attacker, attacked);
  6.                             return;
  7.                         }
  8.  
  9. =================================================================================
  10.  
  11. En #region Ranged Abajo de
  12.  if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= Constants.pScreenDistance)
  13.  
  14. Deberian tener un codigo de Assassin, bueno lo borran y lo dejan asi :
  15.  if (!attacker.Assassin() && attacker.IsChaser2())
  16.                                     damage = Game.Attacking.Calculate.Ranged(attacker, attacked, ref attack);
  17.                                 else damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
  18.             attack.Damage = damage / 4;//En caso de que les Pegue Poquito le dividen 2 / 2
  19. ==================================================================================
  20.  
  21. En Handler.cs en la Variable de void StomperMelee la Reemplazan por la mia :
  22.  
  23.  public static void StomperMelee(FloorItem item, ushort SpellID)
  24.         {
  25.             Attack attack = new Attack(true);
  26.             attack.Attacker = item.Owner.Player.UID;
  27.             var spell = Database.SpellTable.GetSpell(SpellID, item.Owner);
  28.             MsgMagicEffect suse = new MsgMagicEffect(true);
  29.             suse.Attacker = SpellID == 12990 ? item.UID : item.Owner.Player.UID;
  30.             suse.SpellID = SpellID;
  31.             attack.SpellID = suse.SpellLevel = spell.Level;
  32.             suse.SpecialEffect = 1;
  33.             if (SpellID == 12990)
  34.             {
  35.                 suse.X = item.Start;
  36.                 suse.Y = item.End;
  37.                 foreach (Interfaces.IMapObject _obj in item.Owner.Screen.Objects)
  38.                 {
  39.                     if (_obj.MapObjType == MapObjectType.Monster)
  40.                     {
  41.                         if (_obj == null) continue;
  42.                         var attacked1 = _obj as Player;
  43.                         if (CanAttack(item.Owner.Player, attacked1, spell, false))
  44.                         {
  45.                             {
  46.                                 var spellange = Enums.HorrorofStomperAngle(item.Angle);
  47.                                 ushort xxxx = item.X;
  48.                                 ushort yyyy = item.Y;
  49.                                 Map.Pushback(ref xxxx, ref yyyy, spellange, 7);
  50.                                 Fan sector = new Fan(item.X, item.Y, xxxx, yyyy, spell.Range, spell.Sector);
  51.                                 if (sector.IsInFan(attacked1.X, attacked1.Y))
  52.                                 {
  53.                                     uint damage = (uint)(Game.Attacking.Calculate.Melee(item.Owner.Player, attacked1, ref attack));
  54.                                     attack.Damage = damage / 2;
  55.                                     ReceiveAttack(item.Owner.Player, attacked1, attack, ref damage, spell);
  56.                                     suse.AddTarget(attacked1.UID, damage, null);
  57.                                     continue;
  58.                                 }
  59.                             }
  60.                             {
  61.                                 var spellange = Enums.OppositeAngle(Enums.HorrorofStomperAngle(item.Angle));
  62.                                 ushort xxxx = item.X;
  63.                                 ushort yyyy = item.Y;
  64.                                 Map.Pushback(ref xxxx, ref yyyy, spellange, 7);
  65.                                 Fan sector = new Fan(item.X, item.Y, xxxx, yyyy, spell.Range, spell.Sector);
  66.                                 if (sector.IsInFan(attacked1.X, attacked1.Y))
  67.                                 {
  68.                                     uint damage = (uint)(Game.Attacking.Calculate.Melee(item.Owner.Player, attacked1, ref attack));
  69.                                     attack.Damage = damage / 2;
  70.                                     ReceiveAttack(item.Owner.Player, attacked1, attack, ref damage, spell);
  71.                                     suse.AddTarget(attacked1.UID, damage, null);
  72.                                 }
  73.                             }
  74.                         }
  75.                     }
  76.                 }
  77.             }
  78.             else
  79.             {
  80.                 suse.X = item.X;
  81.                 suse.Y = item.Y;
  82.                 foreach (Interfaces.IMapObject _obj in item.Owner.Screen.Objects)
  83.                 {
  84.                     if (_obj.MapObjType == MapObjectType.Monster)
  85.                     {
  86.                         if (_obj == null) continue;
  87.                         var attacked1 = _obj as Player;
  88.                         if (Kernel.GetDistance(item.X, item.Y, attacked1.X, attacked1.Y) <= spell.Range)
  89.                         {
  90.                             if (CanAttack(item.Owner.Player, attacked1, spell, false))
  91.                             {
  92.                                 uint damage = (Game.Attacking.Calculate.Melee(item.Owner.Player, attacked1, ref attack));
  93.                                 attack.Damage = damage / 2;
  94.                                 ReceiveAttack(item.Owner.Player, attacked1, attack, ref damage, spell);
  95.                                 suse.AddTarget(attacked1.UID, damage, null);
  96.                             }
  97.                         }
  98.                     }
  99.                 }
  100.             }
  101.             item.Owner.SendScreen(suse.ToArray(), true);
  102.             item.Owner.Player.AttackPacket = null;
  103.         }
  104. =================================================================
  105.  
  106. En FloorItem.cs o MsgMapItem.cs como lo tengan si no los tienen los agregan :
  107.  
  108.  public ushort Start
  109.         {
  110.             get { return Buffer[61]; }
  111.             set { Writer.WriteUInt32(value, 61, Buffer); }
  112.         }
  113.         public ushort Now
  114.         {
  115.             get { return Buffer[62]; }
  116.             set { Writer.WriteUInt32(value, 62, Buffer); }
  117.         }
  118.         public ushort End
  119.         {
  120.             get { return Buffer[63]; }
  121.             set { Writer.WriteUInt32(value, 63, Buffer); }
  122.         }
  123. ===================================================================
  124.  
  125. En Handler.cs #region Melee debajo de if (attacker.Owner.Screen.TryGetValue(attack.Attacked, out attacked)) Pegaran:
  126. #region Stomper(Melee)
  127.                             #region Anger-Horror-Peace~of~Stomper(Windwalker-Stomper-Passive)
  128.                             var lastattacked = attacked;
  129.                             var spell5 = Database.SpellTable.GetSpell(12980, attacker.Owner);
  130.                             if (Kernel.Rate(spell5.Percent) && attacker.Owner.Spells.ContainsKey(12980) && attacker.IsStomper2())
  131.                             {
  132.                                 #region AngerofStomper
  133.                                 {
  134.                                     MsgMagicEffect suse = new MsgMagicEffect(true);
  135.                                     suse.Attacker = attacker.UID;
  136.                                     suse.SpellID = spell5.ID;
  137.                                     suse.SpellLevel = spell5.Level;
  138.                                     suse.X = lastattacked.X;
  139.                                     suse.Y = lastattacked.Y;
  140.                                     foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  141.                                     {
  142.                                         if (_obj == null) continue;
  143.                                         attacked = _obj as Player;
  144.                                         if (attacked == null) continue;
  145.                                         if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) <= spell5.Range)
  146.                                         {
  147.                                             if (_obj.MapObjType == MapObjectType.Player)
  148.                                             {
  149.                                                 if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
  150.                                                 attack.Effect = MsgInteract.InteractEffects.None;
  151.                                                 uint damage5 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 2;
  152.                                                 damage5 = (uint)(damage5 * .5);
  153.                                                 suse.Effect = attack.Effect;
  154.                                                 attack.Damage = damage5 / 2;
  155.                                                 ReceiveAttack(attacker, attacked, attack,ref damage5, spell5);
  156.                                                 suse.AddTarget(attacked.UID, damage5, attack);
  157.                                             }
  158.                                             else if (_obj.MapObjType == MapObjectType.Monster)
  159.                                             {
  160.                                                 if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
  161.                                                 uint damage5 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 2;
  162.                                                 attack.Damage = damage5 / 2;
  163.                                                 ReceiveAttack(attacker, attacked, attack,ref damage5, spell5);
  164.                                                 suse.AddTarget(attacked.UID, damage5, attack);
  165.                                             }
  166.                                         }
  167.                                     }
  168.                                     attacker.AttackPacket = null;
  169.                                     attacker.Owner.SendScreen(suse, true);
  170.                                 }
  171.                                 #endregion
  172.                                 #region HorrorofStomper
  173.                                 {
  174.                                     var spell2 = Database.SpellTable.GetSpell(12990, attacker.Owner);
  175.                                     if (!attacker.Owner.Spells.ContainsKey(12990)) return;
  176.                                     attack.Damage = 1;
  177.                                     MsgMagicEffect suse = new MsgMagicEffect(true);
  178.                                     suse.Attacker = attacker.UID;
  179.                                     suse.SpellID = spell2.ID;
  180.                                     suse.SpellLevel = spell2.Level;
  181.                                     suse.X = lastattacked.X;
  182.                                     suse.Y = lastattacked.Y;
  183.                                     attacker.AttackPacket = null;
  184.                                     attacker.Owner.SendScreen(suse, true);
  185.                                     #region MsgMapItem
  186.                                     var map = Kernel.Maps[attacker.MapID];
  187.                                     MsgMapItem MsgMapItem = new MsgMapItem(true);
  188.                                     MsgMapItem.UID = MsgMapItem.FloorUID.Next;
  189.                                     while (map.Npcs.ContainsKey(MsgMapItem.UID))
  190.                                         MsgMapItem.UID = MsgMapItem.FloorUID.Next;
  191.                                     MsgMapItem.ItemID = MsgMapItem.HorrorofStomper;
  192.                                     MsgMapItem.X = lastattacked.X;
  193.                                     MsgMapItem.Y = lastattacked.Y;
  194.                                     MsgMapItem.Type = MsgMapItem.Effect;
  195.                                     MsgMapItem.mColor = 14;
  196.                                     MsgMapItem.OwnerUID = attacker.UID;
  197.                                     MsgMapItem.OwnerGuildUID = attacker.GuildID;
  198.                                     MsgMapItem.FlowerType = 3;
  199.                                     MsgMapItem.Unknown37 = 1;
  200.                                     MsgMapItem.X2 = attacker.X;
  201.                                     MsgMapItem.Y2 = attacker.Y;
  202.                                     MsgMapItem.Angle = attacker.Facing;
  203.                                     MsgMapItem.MapID = map.ID;
  204.                                     MsgMapItem.Attack = attack;
  205.                                     MsgMapItem.OnFloor = Time32.Now;
  206.                                     MsgMapItem.Owner = attacker.Owner;
  207.                                     map.AddFloorItem(MsgMapItem);
  208.                                     attacker.Owner.SendScreenSpawn(MsgMapItem, true);
  209.                                     #endregion
  210.                                 }
  211.                                 #endregion
  212.                                 #region PeaceofStomper
  213.                                 {
  214.                                     var spell3 = Database.SpellTable.GetSpell(13000, attacker.Owner);
  215.                                     if (!attacker.Owner.Spells.ContainsKey(13000)) return;
  216.                                     attack.Damage = 1;
  217.                                     MsgMagicEffect suse = new MsgMagicEffect(true);
  218.                                     suse.Attacker = attacker.UID;
  219.                                     suse.SpellLevel = spell3.Level;
  220.                                     suse.SpellID = spell3.ID;
  221.                                     suse.X = lastattacked.X;
  222.                                     suse.Y = lastattacked.Y;
  223.                                     attacker.AttackPacket = null;
  224.                                     attacker.Owner.SendScreen(suse, true);
  225.                                     #region MsgMapItem
  226.                                     var map = Kernel.Maps[attacker.MapID];
  227.                                     MsgMapItem MsgMapItem = new MsgMapItem(true);
  228.                                     MsgMapItem.UID = MsgMapItem.FloorUID.Next;
  229.                                     while (map.Npcs.ContainsKey(MsgMapItem.UID))
  230.                                         MsgMapItem.UID = MsgMapItem.FloorUID.Next;
  231.                                     MsgMapItem.ItemID = MsgMapItem.PeaceofStomper;
  232.                                     MsgMapItem.X = lastattacked.X;
  233.                                     MsgMapItem.Y = lastattacked.Y;
  234.                                     MsgMapItem.X2 = attacker.X;
  235.                                     MsgMapItem.Y2 = attacker.Y;
  236.                                     MsgMapItem.Type = MsgMapItem.Effect;
  237.                                     MsgMapItem.mColor = 14;
  238.                                     MsgMapItem.OwnerUID = attacker.UID;
  239.                                     MsgMapItem.OwnerGuildUID = attacker.GuildID;
  240.                                     MsgMapItem.FlowerType = 3;
  241.                                     MsgMapItem.Unknown37 = 1;
  242.                                     MsgMapItem.MapID = map.ID;
  243.                                     MsgMapItem.Attack = attack;
  244.                                     MsgMapItem.OnFloor = Time32.Now;
  245.                                     MsgMapItem.Owner = attacker.Owner;
  246.                                     map.AddFloorItem(MsgMapItem);
  247.                                     attacker.Owner.SendScreenSpawn(MsgMapItem, true);
  248.                                     #endregion
  249.                                 }
  250.                                 #endregion
  251.                                 return;
  252.                             }
  253.                             #endregion
  254.                             else if (attacker.IsStomper1())
  255.                             {
  256.                                 #region Sector-Circle-Rectangle(Windwalker-Stomper-Melee)
  257.                                 if (attack.SpellID == 13040 || attack.SpellID == 13050 || attack.SpellID == 13060)
  258.                                 {
  259.                                     #region Sector
  260.                                     if (attack.SpellID == 13040)
  261.                                     {
  262.                                         var spell = Database.SpellTable.GetSpell(13040, attacker.Owner);
  263.                                         MsgMagicEffect suse = new MsgMagicEffect(true);
  264.                                         suse.Attacker = attacker.UID;
  265.                                         suse.SpellID = attack.SpellID;
  266.                                         suse.X = attacker.X;
  267.                                         suse.Y = attacker.Y;
  268.                                         var angle = Kernel.GetAngle(attacker.X, attacker.Y, attacked.X, attacked.Y);
  269.                                         Map.UpdateCoordonatesForAngle(ref X, ref Y, angle);
  270.                                         Fan sector = new Fan(attacker.X, attacker.Y, X, Y, spell.Range, spell.Sector);
  271.                                         if (Kernel.GetDistance(attacker.X, attacker.Y, X, Y) <= 7)
  272.                                         {
  273.                                             foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  274.                                             {
  275.                                                 if (_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
  276.                                                 {
  277.                                                     if (_obj == null) continue;
  278.                                                     attacked = _obj as Player;
  279.                                                     if (attacked == null) continue;
  280.                                                     if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
  281.                                                     if (sector.IsInFan(attacked.X, attacked.Y))
  282.                                                     {
  283.                                                         if (CanAttack(attacker, attacked, spell, attack.InteractType == MsgInteract.Melee))
  284.                                                         {
  285.                                                             attack.Effect = MsgInteract.InteractEffects.None;
  286.                                                             uint damages = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 4;
  287.                                                             damages = (uint)(damages * .5);
  288.                                                             attack.Damage = damages / 2;
  289.                                                             suse.Effect = attack.Effect;
  290.                                                             ReceiveAttack(attacker, attacked, attack,ref damages, spell);
  291.                                                             suse.AddTarget(attacked.UID, damages, attack);
  292.                                                         }
  293.                                                     }
  294.                                                 }
  295.                                             }
  296.                                         }
  297.                                     }
  298.                                     #endregion
  299.                                     #region Circle
  300.                                     if (attack.SpellID == 13050)
  301.                                     {
  302.                                         var spell = Database.SpellTable.GetSpell(13050, attacker.Owner);
  303.                                         MsgMagicEffect suse = new MsgMagicEffect(true);
  304.                                         suse.Attacker = attacker.UID;
  305.                                         suse.SpellID = attack.SpellID;
  306.                                         suse.X = attacker.X;
  307.                                         suse.Y = attacker.Y;
  308.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  309.                                         {
  310.                                             if (_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
  311.                                             {
  312.                                                 if (_obj == null)
  313.                                                     continue;
  314.                                                 attacked = _obj as Player;
  315.                                                 if (attacked == null) continue;
  316.                                                 if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
  317.                                                 if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 5) continue;
  318.                                                 attack.Effect = MsgInteract.InteractEffects.None;
  319.                                                 uint damage = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 4;
  320.                                                 damage = (uint)(damage * .5);
  321.                                                 attack.Damage = damage / 2;
  322.                                                 ReceiveAttack(attacker, attacked, attack,ref damage, spell);
  323.                                                 suse.AddTarget(attacked.UID, damage, attack);
  324.                                             }
  325.                                         }
  326.                                         attacker.Owner.SendScreen(suse, true);
  327.                                         return;
  328.                                     }
  329.                                     #endregion
  330.                                     #region Rectangle
  331.                                     if (attack.SpellID == 13060)
  332.                                     {
  333.                                         var spell = Database.SpellTable.GetSpell(13060, attacker.Owner);
  334.                                         MsgMagicEffect suse = new MsgMagicEffect(true);
  335.                                         suse.Attacker = attacker.UID;
  336.                                         suse.SpellID = attack.SpellID;
  337.                                         suse.X = attacker.X;
  338.                                         suse.Y = attacker.Y;
  339.                                         var angle = Kernel.GetAngle(attacker.X, attacker.Y, attacked.X, attacked.Y);
  340.                                         Map.UpdateCoordonatesForAngle(ref X, ref Y, angle);
  341.                                         Fan sector = new Fan(attacker.X, attacker.Y, X, Y, spell.Range, spell.Sector);
  342.                                         uint damage2 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack);
  343.                                         attack.Damage = damage2 / 2;
  344.                                         ReceiveAttack(attacker, attacked, attack,ref damage2, spell);
  345.                                         suse.AddTarget(attacked.UID, damage2, attack);
  346.                                         foreach (Interfaces.IMapObject _obj in attacker.Owner.Screen.Objects)
  347.                                         {
  348.                                             if (_obj.MapObjType == MapObjectType.Player || _obj.MapObjType == MapObjectType.Monster)
  349.                                             {
  350.                                                 if (_obj == null) continue;
  351.                                                 attacked = _obj as Player;
  352.                                                 if (attacked == null) continue;
  353.                                                 if (!CanAttack(attacker, attacked, null, attack.InteractType == MsgInteract.Melee)) continue;
  354.                                                 if (sector.IsInFan(attacked.X, attacked.Y))
  355.                                                 {
  356.                                                     if (Kernel.GetDistance(attacked.X, attacked.Y, attacker.X, attacker.Y) > 7) continue;
  357.                                                     attack.Effect = MsgInteract.InteractEffects.None;
  358.                                                     uint damage43 = Game.Attacking.Calculate.Melee(attacker, attacked, ref attack) / 4;
  359.                                                     damage43 = (uint)(damage43 * .5);
  360.                                                     attack.Damage = damage43 / 2;
  361.                                                     ReceiveAttack(attacker, attacked, attack, ref damage43, spell);
  362.                                                     suse.AddTarget(attacked.UID, damage43, attack);
  363.                                                 }
  364.                                             }
  365.                                         }
  366.                                         attacker.Owner.SendScreen(suse, true);
  367.                                         return;
  368.                                     }
  369.                                     #endregion
  370.                                 }
  371.                                 #endregion
  372.  
  373.                             }
  374.                             #endregion
  375.  
  376. y Acomodaran el Daño a su Gusto, los fallos que tengan relacionados a MsgMapItem lo cambian a FloorItem y asi sucesivamente.
  377.  
  378. Ahora mas Abajo if (Kernel.GetDistance(attacker.X, attacker.Y, attacked.X, attacked.Y) <= range || pass) Pegan lo Mismo que arriba y reparan etc, si les aparece error de que la Variable denominada damage esta siendo usada o demas mamadas buscan el uint damage de las skills y lo cambian a uint damage456465465 o el numero o ponen lo que quieran.
  379. ==================================================0
  380. Bueno, otra cosa en EntityTable.cs en la parte de CreateEntity en la parte de switch class donde dice ejemplo windwalker = 8; o como sea que lo tengan recomiendo que los acomoden junto a las Variables de Stomper1 IsChase1 2 3 IsStomper1 2 3 el Numero Correcto en la parte de this.Windwalker ejemplo esta:
  381. public bool IsChaser()//Rango
  382.         {
  383.             if (PlayerFlag == Game.PlayerFlag.Player)
  384.             {
  385.                 if (this.Class >= 160 && this.Class <= 165)
  386.                     if (this.Windwalker == 0)//Esta en 0 por que en mi Source 2D Throne el Windwalker 0 es Rango y Windwalker 8 es Meleè miren el ejemplo del Melee
  387.                         return true;
  388.             }
  389.             return false;
  390.         }
  391.  
  392.  public bool IsStomper1()//Melee
  393.         {
  394.             if (PlayerFlag == Game.PlayerFlag.Player)
  395.             {
  396.                 var weapons = Owner.Weapons;
  397.                 if (weapons.Item1 != null)
  398.                     if (weapons.Item1.ID / 1000 == 626)
  399.                         if (this.Class >= 160 && this.Class <= 165)
  400.                             if (this.Windwalker == 8)// ----> Esta en 8 .
  401.                                 return true;
  402.             }
  403.             return false;
  404.         }
  405.  
  406. Verifiquen que los tienen identicos en sus Sourcer`s la creacion de Winds (Recomiendo que prueben manualmente cuando se crean un aire melee o rango y miren en la base de datos cual numero llevan cada 1 ) y despues acomodar las Variables para que salgan la Skills sin Problema alguno!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement