Advertisement
XConquer

Ataques Perfectos Exclusivos by Pezzi Tomas

Aug 2nd, 2018
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 13.78 KB | None | 0 0
  1. En Handler.cs void ReceiveAttack agregan :
  2.  
  3. #region Perfection Attacks
  4.             if (attacked.PlayerFlag == PlayerFlag.Player)
  5.             {
  6.                 #region Perfection StrikeLock TESTEAR
  7.                 Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.StrikeLock;
  8.                 byte chance = 10;
  9.                 new MsgRefineEffect().HandleStrikeLock(attacked, ref chance);
  10.                 if (Kernel.Rate(chance))
  11.                 {
  12.                     new MsgRefineEffect().SendEffect(attacked, attacker, effect);
  13.  
  14.                     damage = damage / 2;
  15.                 }
  16.                 #endregion
  17.             }
  18.             if (attacked.PlayerFlag == PlayerFlag.Player)
  19.             {
  20.                 #region FreeSoul [Remover SoulShakle]
  21.                 if (attacked.ContainsFlag2((ulong)MsgUpdate.Flags2.SoulShackle))
  22.                 {
  23.                     Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.FreeSoul;
  24.                     byte chance = 4;
  25.                     new MsgRefineEffect().HandleFreeSoul(attacked, ref chance);
  26.                     if (Kernel.Rate(chance))
  27.                     {
  28.                         new MsgRefineEffect().SendEffect(attacked, attacker, effect);
  29.  
  30.                     }
  31.                 }
  32.                 #endregion
  33.             }
  34.             if (attacked.PlayerFlag == PlayerFlag.Player)
  35.             {
  36.                 #region Perfection DivineGuard
  37.                 Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.DivineGuard;
  38.                 byte chance = 10;
  39.                 new MsgRefineEffect().HandleDivineGuard(attacked, ref chance);
  40.                 if (Kernel.Rate(chance))
  41.                 {
  42.                     new MsgRefineEffect().SendEffect(attacked, attacker, effect);
  43.  
  44.                 }
  45.                 #endregion
  46.             }
  47.             if (attacked.PlayerFlag == PlayerFlag.Player)
  48.             {
  49.                 #region Perfection ShieldBreak
  50.                 Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.ShieldBreak;
  51.                 byte chance = 10;
  52.                 new MsgRefineEffect().ShieldBreak(attacked, ref chance);
  53.                 if (Kernel.Rate(chance))
  54.                 {
  55.                     new MsgRefineEffect().SendEffect(attacked, attacker, effect);
  56.                    
  57.                 }
  58.                 #endregion
  59.             }
  60.             if (attacked.PlayerFlag == PlayerFlag.Player)
  61.             {
  62.                 #region Perfection BloodSpawn
  63.                 Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.BloodSpawn;
  64.                 byte chance = 10;
  65.                 new MsgRefineEffect().HandleBloodSpawn(attacked, ref chance);
  66.                 if (Kernel.Rate(chance))
  67.                 {
  68.                     new MsgRefineEffect().SendEffect(attacked, attacker, effect);
  69.                     attacked.Hitpoints = attacked.MaxHitpoints;
  70.                     attacked.Mana = attacked.MaxMana;
  71.                 }
  72.                 #endregion
  73.             }
  74.             #region Perfection CalmWind
  75.             if (attacker.PlayerFlag == PlayerFlag.Player)
  76.             {
  77.                 uint rand = (uint)COServer.Kernel.Random.Next(0, 1);
  78.                 switch (rand)
  79.                 {
  80.                     case 0:
  81.                         {
  82.                             break;
  83.                         }
  84.                     case 1:
  85.                         {
  86.                             if (attacked.PlayerFlag == PlayerFlag.Player)
  87.                             {
  88.                                 #region Perfection
  89.                                 Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.CalmWind;
  90.                                 byte chance = 10;
  91.                                 new MsgRefineEffect().GenerateEffectandChance(attacker.Owner, ref effect, ref chance);
  92.                                 if (Kernel.Rate(chance))
  93.                                 {
  94.                                     new MsgRefineEffect().SendEffect(attacker, attacked, effect);
  95.                                 }
  96.                                 #endregion
  97.                             }
  98.                             break;
  99.                         }
  100.  
  101.                 }
  102.  
  103.             }
  104.             #endregion
  105.             #region Perfection MirrorOfSin
  106.             if (attacked.PlayerFlag == PlayerFlag.Player)
  107.             {
  108.                 uint rand = (uint)COServer.Kernel.Random.Next(0, 1);
  109.                 switch (rand)
  110.                 {
  111.  
  112.                     case 0:
  113.                         {
  114.  
  115.                             break;
  116.                         }
  117.                     case 1:
  118.                         {
  119.  
  120.                             if (attacked.PlayerFlag == PlayerFlag.Player)
  121.                             {
  122.                                 #region Perfection
  123.                                 Game.Enums.PerfectionEffect effect = Enums.PerfectionEffect.MirrorofSin;
  124.                                 byte chance = 10;
  125.                                 new MsgRefineEffect().HandleMirror(attacked, ref chance);
  126.                                 if (Kernel.Rate(chance))
  127.                                 {
  128.                                     new MsgRefineEffect().SendEffect(attacked, attacker, effect);
  129.                                     attacked.AddFlag((ulong)Network.GamePackets.MsgUpdate.Flags.XPList);
  130.                                 }
  131.                                 #endregion
  132.                             }
  133.                             break;
  134.                         }
  135.  
  136.  
  137.                 }
  138.  
  139.             }
  140.             #endregion
  141.             #endregion
  142.  
  143.  
  144. ===========================================================================
  145.  
  146. En MsgRefineEffect Agregan :
  147.  
  148.   public void HandleDivineGuard(Game.Player client, ref byte chance)
  149.         {
  150.             chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.DivineGuard);
  151.         }
  152.         public void HandleStrikeLock(Game.Player client, ref byte chance)
  153.         {
  154.             chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.StrikeLock);
  155.         }
  156.         public void ShieldBreak(Game.Player client, ref byte chance)
  157.         {
  158.             chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.ShieldBreak);
  159.         }
  160.         public void HandleFreeSoul(Game.Player client, ref byte chance)
  161.         {
  162.             chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.FreeSoul);
  163.         }
  164.         public void HandleStraightLife(Game.Player client, ref byte chance)
  165.         {
  166.             chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.StraightLife);
  167.         }
  168.         public void HandleBloodSpawn(Game.Player client, ref byte chance)
  169.         {
  170.             chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.BloodSpawn);
  171.         }
  172.         public void HandleMirror(Game.Player client, ref byte chance)
  173.         {
  174.             chance = GetChance(client.Owner, Game.Enums.PerfectionEffect.MirrorofSin);
  175.         }
  176. =============================================================================0
  177.  
  178. en MsgRefine Effect Reemplazan o Agregan :
  179.  
  180.   public byte GetChance(Client.GameState client, Game.Enums.PerfectionEffect effect)
  181.         {
  182.             if (client.Equipment.TotalPerfectionLevel == 0) return 0;
  183.             byte Chance = 10;
  184.             if (effect == Game.Enums.PerfectionEffect.CalmWind)
  185.             {
  186.                 if (client.Equipment.TotalPerfectionLevel == 3) Chance += 1;
  187.                 if (client.Equipment.TotalPerfectionLevel >= 90) Chance += 1;
  188.                 if (client.Equipment.TotalPerfectionLevel >= 170) Chance += 1;
  189.                 if (client.Equipment.TotalPerfectionLevel >= 250) Chance += 1;
  190.                 if (client.Equipment.TotalPerfectionLevel >= 285) Chance += 1;
  191.             }
  192.             if (effect == Game.Enums.PerfectionEffect.BloodSpawn)
  193.             {
  194.                 if (client.Equipment.TotalPerfectionLevel >= 40) Chance += 1;
  195.                 if (client.Equipment.TotalPerfectionLevel >= 240) Chance += 1;
  196.                 if (client.Equipment.TotalPerfectionLevel >= 288) Chance += 1;
  197.             }
  198.             if (effect == Game.Enums.PerfectionEffect.DivineGuard)
  199.             {
  200.                 if (client.Equipment.TotalPerfectionLevel <= 40) Chance += 5;
  201.             }
  202.            
  203.             if (effect == Game.Enums.PerfectionEffect.DrainingTouch)
  204.             {
  205.                 if (client.Equipment.TotalPerfectionLevel >= 35) Chance += 1;
  206.                 if (client.Equipment.TotalPerfectionLevel >= 220) Chance += 1;
  207.                 if (client.Equipment.TotalPerfectionLevel >= 276) Chance += 1;
  208.             }
  209.             if (effect == Game.Enums.PerfectionEffect.FreeSoul)
  210.             {
  211.                 if (client.Equipment.TotalPerfectionLevel >= 25) Chance += 1;
  212.                 if (client.Equipment.TotalPerfectionLevel >= 95) Chance += 1;
  213.                 if (client.Equipment.TotalPerfectionLevel >= 130) Chance += 1;
  214.                 if (client.Equipment.TotalPerfectionLevel >= 195) Chance += 1;
  215.                 if (client.Equipment.TotalPerfectionLevel >= 279) Chance += 1;
  216.             }
  217.            
  218.             if (effect == Game.Enums.PerfectionEffect.KillingFlash)
  219.             {
  220.                 if (client.Equipment.TotalPerfectionLevel >= 55) Chance += 1;
  221.                 if (client.Equipment.TotalPerfectionLevel >= 165) Chance += 1;
  222.                 if (client.Equipment.TotalPerfectionLevel >= 294) Chance += 1;
  223.             }
  224.             if (effect == Game.Enums.PerfectionEffect.LightofStamina)
  225.             {
  226.                 if (client.Equipment.TotalPerfectionLevel >= 1) Chance += 5;
  227.             }
  228.            
  229.             if (effect == Game.Enums.PerfectionEffect.MirrorofSin)
  230.             {
  231.                 if (client.Equipment.TotalPerfectionLevel >= 60) Chance += 1;
  232.                 if (client.Equipment.TotalPerfectionLevel >= 190) Chance += 1;
  233.                 if (client.Equipment.TotalPerfectionLevel >= 291) Chance += 1;
  234.             }
  235.             if (effect == Game.Enums.PerfectionEffect.ShieldBreak)
  236.             {
  237.                 if (client.Equipment.TotalPerfectionLevel == 155 && client.Equipment.TotalPerfectionLevel <= 254) Chance += 50 / 100;
  238.                 if (client.Equipment.TotalPerfectionLevel == 255 && client.Equipment.TotalPerfectionLevel <= 296) Chance += 70 / 100;
  239.                 if (client.Equipment.TotalPerfectionLevel == 297 && client.Equipment.TotalPerfectionLevel <= 311) Chance += 1;
  240.                 if (client.Equipment.TotalPerfectionLevel == 312 && client.Equipment.TotalPerfectionLevel <= 321) Chance += 150 / 100;
  241.                 if (client.Equipment.TotalPerfectionLevel == 322 && client.Equipment.TotalPerfectionLevel >= 322) Chance += 2;
  242.             }
  243.             if (effect == Game.Enums.PerfectionEffect.StraightLife)
  244.             {
  245.                 if (client.Equipment.TotalPerfectionLevel >= 30) Chance += 1;
  246.                 if (client.Equipment.TotalPerfectionLevel >= 125) Chance += 1;
  247.                 if (client.Equipment.TotalPerfectionLevel >= 210) Chance += 1;
  248.                 if (client.Equipment.TotalPerfectionLevel >= 265) Chance += 1;
  249.                 if (client.Equipment.TotalPerfectionLevel >= 303) Chance += 1;
  250.             }
  251.             if (effect == Game.Enums.PerfectionEffect.StrikeLock)
  252.             {
  253.                 if (client.Equipment.TotalPerfectionLevel >= 308) Chance += 1;
  254.             }
  255.             return Chance;
  256.         }
  257.         public void SendEffect(Game.Player attacker, Game.Player attacked, Game.Enums.PerfectionEffect effect)
  258.         {
  259.             if (attacker == null || attacked == null) return;
  260.             var proto = new MsgRefineEffectProto();
  261.             proto.AttackerUID = attacker.UID;
  262.             if (attacked.PlayerFlag == Game.PlayerFlag.Player)
  263.                 proto.AttackedUID = attacked.UID;
  264.             else if (attacked.PlayerFlag == Game.PlayerFlag.Monster && attacked != null && attacked.UID != 0)
  265.             {
  266.                 proto.AttackedUID = attacked.UID;
  267.             }
  268.             proto.Effect = (uint)effect;
  269.             var proto2 = Kernel.FinalizeProtoBuf(proto, 3254);
  270.             attacker.Owner.SendScreen(proto2, true);
  271.             if (effect == Game.Enums.PerfectionEffect.DrainingTouch)
  272.             {
  273.                 attacker.Hitpoints = attacker.MaxHitpoints;
  274.             }
  275.             if (effect == Game.Enums.PerfectionEffect.KillingFlash)
  276.             {
  277.                 attacker.AddFlag((ulong)Network.GamePackets.MsgUpdate.Flags.XPList);
  278.             }
  279.             if (effect == Game.Enums.PerfectionEffect.DivineGuard)
  280.             {
  281.                 attacker.AddFlag3((ulong)Network.GamePackets.MsgUpdate.Flags3.DivineGuard);
  282.                 attacker.DivineGuardStamp = Time32.Now;
  283.                 attacker.Defence = (ushort)(((attacker.Defence) * 50) / 100);
  284.             }
  285.             if (effect == Game.Enums.PerfectionEffect.ShieldBreak)
  286.             {
  287.                 attacker.AddFlag3((ulong)Network.GamePackets.MsgUpdate.Flags3.ShieldBreak);
  288.                 attacker.ShieldBreakStamp = Time32.Now;
  289.                 attacker.Block += (ushort)(((attacker.Block) * 20) / 10);
  290.             }
  291.             if (effect == Game.Enums.PerfectionEffect.FreeSoul)
  292.             {
  293.                 attacked.SoulShackleRemover();
  294.             }
  295.             if (effect == Game.Enums.PerfectionEffect.StraightLife)
  296.             {
  297.                 attacker.BringToLife();
  298.             }
  299.             if (effect == Game.Enums.PerfectionEffect.LightofStamina && attacked.PlayerFlag == Game.PlayerFlag.Player && attacker.Owner.Equipment.TotalPerfectionLevel > attacked.Owner.Equipment.TotalPerfectionLevel || effect == Game.Enums.PerfectionEffect.LightofStamina && attacked.PlayerFlag == Game.PlayerFlag.Monster) attacker.Stamina = 100;
  300.         }
  301. =========================================================
  302.  
  303. Hasta Ahi :D
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement